Data acquisition system and method
The data acquisition system, which uses a microcontroller module and a storage module, receives PCIe switch data using the DMA channel and idle interrupt signal. This solves the problems of cumbersome operation and difficult deployment in the existing technology, and achieves simplified operation and efficient data acquisition.
Patent Information
- Application Number
- CN202210665283.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-06-13
AI Technical Summary
In existing technologies, PCIe switch data acquisition methods are cumbersome to operate, require computers and specific software, and are difficult and costly to deploy.
The data acquisition system, which uses a microcontroller module and a storage module, receives PCIe switch data through the DMA channel and idle interrupt signal, and drives the storage module to save the data through the SPI module, simplifying the operation process.
It lowers the technical threshold for data collection, reduces deployment time and costs, improves production efficiency, and supports remote operation.
Smart Images

Figure CN117271403B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data acquisition technology, and in particular to a data acquisition system and method. Background Technology
[0002] The typical method for acquiring data from a high-speed serial computer expansion module (Peripheral Component Interconnect Express Switch, PCIe switch) is as follows: Connect the PCIe switch to the computer's serial port using a serial cable. Simultaneously, use the software tools provided by the PCIe switch manufacturer on the computer to input commands, thereby activating the PCIe switch's interface status and triggering data transmission. After data transmission is complete, the computer copies and pastes the received data from the PCIe switch device into the file system, thus completing the acquisition of data from the PCIe switch device.
[0003] The above methods involve numerous technical processes and are cumbersome to operate. Users need to undergo certain training, and because they require the use of computers and specific software and accessories, it is difficult and costly to deploy these methods on the production line. Summary of the Invention
[0004] In view of this, it is necessary to propose a data acquisition system and method to solve the above problems.
[0005] This application proposes a data acquisition system, which includes a microcontroller module, a switch, and a storage module. The microcontroller module is used to send protocol information to the switch to configure the switch's port and to send control commands to the switch. The switch is used to receive the control commands and transmit data according to the control commands. The microcontroller module is also used to receive the data transmitted by the switch, process the received data, and transmit the processed data to the storage module. The storage module is electrically connected to the microcontroller module and is used to receive and save the data processed by the microcontroller module. The microcontroller module is equipped with buttons and an LED module. The buttons are used by the user to select the acquisition content, and the LED module is used to provide indication information to the user.
[0006] Furthermore, the data acquisition system also includes a port conversion module, and the microcontroller module also includes a first port; the port conversion module is used to achieve the adaptation between the first port and the port of the switch.
[0007] Furthermore, the microcontroller module includes a serial peripheral interface (SPI) module, which includes an SPI interface and an SPI driver module. The SPI interface is used to connect to the storage module. The SPI driver module is used to send drive signals to the storage module to drive the storage module to form a communication connection with the SPI module, so that the microcontroller module can transmit data to the storage module through the SPI module.
[0008] Furthermore, the microcontroller module includes a second port; the second port is used to electrically connect one or more buttons, which are used to trigger the microcontroller module to output protocol information to the switch to configure the switch's port; after the switch's port is configured, the microcontroller module sends command-line interface (CLI) commands to the switch to control the switch to transmit data.
[0009] Furthermore, the microcontroller module also includes a processor cache module and a data processing module; the processor cache module is used to cache the data received by the microcontroller module from the switch; the data processing module is used to process the data cached in the processor cache module.
[0010] Furthermore, the microcontroller module also includes a direct processor cache module that accesses the DMA channel and the processor. The DMA channel is connected between the first port and the processor. The processor is used to detect whether the first port and the DMA channel are transmitting data. When the processor detects that the first port and the DMA channel are not transmitting data, the processor generates an idle interrupt signal and sends the idle interrupt signal to the data processing module to control the data processing module to process the data cached in the processor cache module. The DMA channel is also connected between the first port and the processor cache module and is used to quickly transmit the data received by the first port to the processor cache module.
[0011] Furthermore, when the data processing module receives an idle interrupt signal sent by the processor, the data processing module processes the data cached in the processor cache module and transmits the processed data to the SPI module.
[0012] Furthermore, the processor is also used to control the SPI driver module to send a drive signal to the storage module after the SPI module receives the data processed by the data processing module, thereby driving the storage module to form a communication connection with the SPI module; after the communication connection is formed between the storage module and the SPI module, the SPI module transmits the received processed data to the storage module for storage.
[0013] This application also proposes a data acquisition method, which is applied to a data acquisition system. The data acquisition method includes: a microcontroller module configuring the port of a switch and controlling the switch to transmit data; the microcontroller module receiving the data transmitted by the switch, processing the received data, and transmitting the processed data to a storage module; and the storage module receiving the data transmitted by the microcontroller module and saving the data.
[0014] Furthermore, the data acquisition method also includes: triggering the microcontroller module to send protocol information to the switch to configure the switch's port; after the switch's port is configured, the microcontroller module sends CLI commands to the switch to control the switch to start transmitting data.
[0015] Furthermore, the data acquisition method also includes: the microcontroller module receives data transmitted by the switch and caches the received data in the processor cache module; after the data transmission is completed, the processor generates an idle interrupt signal and sends the idle interrupt signal to the data processing module to control the data processing module to process the data cached in the processor cache module; when the data processing module receives the idle interrupt signal sent by the processor, it processes the data cached in the processor cache module and transmits the processed data to the SPI module.
[0016] Furthermore, the data acquisition method also includes: controlling the SPI driver module to send a drive signal to the storage module, driving the storage module to form a communication connection with the SPI module, and then the SPI module sends the data processed by the data processing module to the storage module; the storage module receives the data and saves it; after all the data in the SPI module has been transferred to the storage module, the microcontroller module clears the cached data and performs functional initialization.
[0017] The data acquisition system and method proposed in this application utilize a microcontroller module to receive, buffer, and process data from the switch via a DMA channel and idle interrupt triggering. Furthermore, the microcontroller module drives a storage module via an SPI module, establishing a connection to the storage module to transfer the received switch data for storage, thus achieving data acquisition from the switch. The small size of the microcontroller module facilitates deployment, reducing deployment time and improving production efficiency. Data acquisition can be initiated by pressing buttons on the microcontroller module, lowering the technical barrier for users. Additionally, remote operation and data acquisition are possible by installing a wireless communication module on the microcontroller module. Attached Figure Description
[0018] Figure 1 This is a system block diagram of the data acquisition system according to an embodiment of this application;
[0019] Figure 2 This is a flowchart of a data acquisition method according to an embodiment of this application.
[0020] Explanation of main component symbols
[0021] Data Acquisition System 1
[0022] Microcontroller Module 10
[0023] First port 11
[0024] SPI module 12
[0025] SPI interface 121
[0026] SPI driver module 122
[0027] Second port 13
[0028] Button 14
[0029] Processor cache module 15
[0030] Processor 16
[0031] Data processing module 17
[0032] DMA Channel 18
[0033] switch 20
[0034] Storage module 30
[0035] Port conversion module 40
[0036] LED module 50
[0037] Wireless communication module 60
[0038] The following detailed description, in conjunction with the accompanying drawings, will further illustrate this application. Detailed Implementation
[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0041] The terms "first" and "second," etc., used in the specification and accompanying drawings of this application are used to distinguish different objects and not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other steps or modules inherent to such process, method, product, or apparatus.
[0042] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0043] Please see Figure 1 The diagram below shows a system block diagram of the data acquisition system 1 proposed in this application. The data acquisition system 1 includes a microcontroller module 10, a switch 20, a storage module 30, and a port conversion module 40. Specifically, the microcontroller module 10 is electrically connected to the switch 20 through the port conversion module 40, and the storage module 30 is electrically connected to the microcontroller module 10. The microcontroller module 10 is used to receive data from the switch 20, process the received data, and then transmit it to the storage module 30 for storage, thereby realizing data acquisition from the switch 20.
[0044] In some embodiments, the microcontroller module 10 may be, but is not limited to, an STM32F103C8T6 microcontroller, and the storage module 30 may be a micro SD card.
[0045] The microcontroller module 10 includes a first port 11. Optionally, the first port 11 can be a Universal Asynchronous Receiver / Transmitter (UART) on the microcontroller module 10. The port conversion module 40 is electrically connected between the switch 20 and the first port 11.
[0046] The port conversion module 40 is used to adapt the first port 11 of the microcontroller module 10 to the port of the switch 20. In some embodiments, the transistor-to-transistor logic (TTL) level of the first port 11 is inconsistent with the TTL level of the switch 20 port. For example, the TTL level of the first port 11 can be 1.8V, and the TTL level of the switch 20 port can be 3.3V. The port conversion module 40 can be a port converter that converts 1.8V TTL to 3.3V TTL.
[0047] The microcontroller module 10 also includes a Serial Peripheral Interface (SPI) module 12. The microcontroller module 10 is electrically connected to the storage module 30 through the SPI module 12, thereby transmitting data from the microcontroller module 10 to the storage module 30. Specifically, the SPI module 12 includes an SPI interface 121 and an SPI driver module 122. The SPI interface 121 is connected to the storage module 30, and the SPI driver module 122 is used to send drive signals to the storage module 30 to drive the storage module 30 to communicate with the SPI module 12, thereby realizing the communication connection between the microcontroller module 10 and the storage module 30.
[0048] The microcontroller module 10 includes a second port 13, which can be a general-purpose input / output (GPIO) port on the microcontroller module 10. The second port 13 is used to install buttons 14. In some embodiments, multiple buttons 14 are connected to the second port 13 on the microcontroller module 10 when powered on, and pressing the buttons 14 triggers the data acquisition system 1 to acquire data.
[0049] In some embodiments, staff can press different buttons 14 according to different needs to collect various data from switch 20, such as collecting log data of switch 20, collecting interface status of switch 20, etc.
[0050] The microcontroller module 10 also includes a processor cache module 15, a processor 16, a data processing module 17, and a Direct Memory Access (DMA) channel 18.
[0051] The processor cache module 15 is used to cache the data transmitted by switch 20 received by the microcontroller module 10. The data processing module 17 is used to process the data cached in the processor cache module 15 (e.g., package it into a file).
[0052] In some embodiments, the processor cache module 15 is also used to store program code or multiple instructions, as well as various data. The processor 16 is used to call the program code and various data stored in the processor cache module 15, thereby executing various functions of the microcontroller module 10 and processing data.
[0053] Specifically, button 14 is connected to processor 16 through second port 13. When data acquisition system 1 acquires data, pressing the corresponding button 14 triggers processor 16 to call the corresponding protocol information from processor cache module 15, and transmits the protocol information to switch 20 through first port 11 and port conversion module 40 to configure the port of switch 20.
[0054] Furthermore, after the port configuration of switch20 is completed, processor 16 calls command-line interface (CLI) instructions from processor cache module 15, and transmits CLI instructions to switch20 through first port 11 and port conversion module 40 to control switch20 to start data transmission, thereby obtaining the corresponding data in switch20.
[0055] DMA channel 18 is electrically connected between the first port 11 and the processor cache module 15. DMA channel 18 is used to quickly transfer the data received by the first port 11 to the processor cache module 15.
[0056] Specifically, when the microcontroller module 10 receives data transmitted by the switch 20, the data transmitted by the switch 20 is transmitted to the first port 11 through the port conversion module 40, and then transmitted to the processor cache module 15 through the DMA channel 18. The processor cache module 15 then receives the data transmitted by the switch 20 and caches it.
[0057] DMA channel 18 is also connected between the first port 11 and the processor 16. In some embodiments, the processor 16 includes a clock device for detecting whether data transfer is occurring between the first port 11 and the DMA channel 18. When the clock device in the processor 16 detects that no data transfer is occurring between the first port 11 and the DMA channel 18, it generates an idle interrupt signal.
[0058] Furthermore, when the processor 16 generates an idle interrupt signal, it sends the signal to the data processing module 17 to control the module to process the data cached in the processor cache module 15. When the data processing module 17 receives the idle interrupt signal from the processor 16, it processes the data cached in the processor cache module 15 and transmits the processed data to the SPI module 12.
[0059] Furthermore, when the SPI module 12 receives the data processed by the data processing module 17, the processor 16 controls the SPI driver module 122 to send a drive signal to the storage module 30 to drive the storage module 30 to communicate with the SPI module 12. Then, the microcontroller module 10 transmits the processed data to the storage module 30 through the SPI interface 121. The storage module 30 receives the data transmitted by the microcontroller module 10 and saves it.
[0060] Furthermore, after all the data cached in the processor cache module 15 is transferred to the storage module 30, the processor 16 controls the processor cache module 15 to clear the cached data and perform functional initialization in preparation for the next data acquisition.
[0061] In some embodiments, the microcontroller module 10 is further provided with a light-emitting diode (LED) module 50. The LED module 50 is used to display the progress of data acquisition. For example, when the microcontroller module 10 receives data from the switch 20 and transmits the received data to the storage module 30 for storage, the processor 16 controls the LED module 50 to remain constantly lit, and when the data storage is complete, the processor 16 controls the LED module 50 to turn off. In some embodiments, when the button 14 is pressed, the processor 16 controls the LED module 50 to emit a brief flashing light. Thus, the progress of data acquisition can be determined by observing the LED module 50.
[0062] In some embodiments, the microcontroller module 10 is further provided with a wireless communication module 60, which can be a Wi-Fi module or a Bluetooth module. The microcontroller module 10 can be connected to a mobile terminal device (e.g., a tablet computer, a laptop computer, a mobile phone, a personal digital assistant (PDA), or other electronic communication products) via the wireless communication module 60. By remotely operating the mobile terminal, the microcontroller module 10 can be controlled to receive and transmit data, that is, to control the operation of the data acquisition system 1.
[0063] Please see Figure 2 This is a flowchart of a data acquisition method proposed in an embodiment of this application. The data acquisition method can be applied to a data acquisition system and may include the following steps:
[0064] S201: The microcontroller module 10 performs functional initialization.
[0065] Specifically, the functional initialization of the microcontroller module 10 may include button interrupt signal initialization, LED module initialization, port initialization, SPI driver initialization, DMA initialization, idle interrupt signal initialization, data processing module initialization, and storage module initialization.
[0066] S202: Trigger the microcontroller module 10 to send protocol information to switch20 to configure the port of switch20.
[0067] Specifically, pressing the corresponding button 14 triggers the processor 16 to retrieve the corresponding protocol information from the processor cache module 15, and transmits the protocol information to the switch 20 through the first port 11 and the port conversion module 40 to configure the port of the switch 20.
[0068] S203: The microcontroller module 10 sends CLI commands to switch 20 to control switch 20 to transmit data.
[0069] Specifically, after the port configuration of switch20 is completed, processor 16 calls CLI instructions from processor cache module 15 and transmits the CLI instructions to switch20 through first port 11 and port conversion module 40 to control switch20 to start data transmission.
[0070] S204: The microcontroller module 10 receives the data transmitted by the switch 20 and caches the received data in the processor cache module 15.
[0071] Specifically, the DMA channel 18 is electrically connected between the first port 11 and the processor cache module 15. Then, the switch 20 transmits data to the first port 11 through the port conversion module 40, and then transmits it to the processor cache module 15 for caching through the DMA channel 18.
[0072] S205: After the data reception is completed, the microcontroller module 10 generates an idle interrupt signal.
[0073] In some embodiments, the processor 16 includes a clock device for detecting whether the first port 11 and the DMA channel 18 are transmitting data. When the clock device in the processor 16 detects that the first port 11 and the DMA channel 18 are not transmitting data, it generates an idle interrupt signal.
[0074] When the processor 16 generates an idle interrupt signal, the processor 16 sends the idle interrupt signal to the data processing module 17 to control the data processing module 17 to process the data cached in the processor cache module 15.
[0075] S206: The microcontroller module processes the cached data and transmits the processed data to the storage module 30 for saving.
[0076] Specifically, after the data processing module 17 receives the idle interrupt signal sent by the processor 16, the data processing module 17 packages and integrates the data cached in the processor cache module 15, and transmits the packaged and integrated data to the SPI module 12.
[0077] In some embodiments, the microcontroller module 10 is connected to the storage module 30 via the SPI interface 121. Further, when the SPI module 12 receives data processed by the data processing module 17, the processor 16 controls the SPI driver module 122 to send a drive signal to the storage module 30 to drive the communication connection between the storage module 30 and the SPI module 12. Then, the microcontroller module 10 transmits data to the storage module 30 for storage via the SPI module 12.
[0078] S207: After all the data cached in the microcontroller module 10 is transferred to the storage module 30 for storage, the microcontroller module 10 clears the cached data and performs functional initialization.
[0079] Specifically, after clearing the data stored in the processor cache module 15, the microcontroller module 10 performs functional initialization and continues to wait for the button interrupt signal to perform the next data acquisition.
[0080] The data acquisition system and method proposed in this application utilize a microcontroller module 10 to receive, buffer, and process data from a switch 20 via a DMA channel 18 and an idle interrupt signal. Furthermore, the microcontroller module 10 drives a storage module 30 via an SPI module 12, establishing a communication connection with the storage module 30 to transfer the received data from the switch 20 to the storage module 30 for storage, thus achieving data acquisition from the switch 20. Because the microcontroller module 10 is small and easy to deploy, it reduces deployment time and improves production efficiency. Data acquisition can be performed by pressing the button 14 on the microcontroller module 10, lowering the technical barrier for users. Remote operation and data acquisition are also possible by installing a wireless communication module 60 on the microcontroller module 10.
[0081] Those skilled in the art should recognize that the above embodiments are merely illustrative of this application and are not intended to limit this application. Any appropriate changes and variations made to the above embodiments within the essential spirit and scope of this application should fall within the scope of protection claimed in this application.
Claims
1. A data acquisition system, characterized in that, The data acquisition system includes a microcontroller module, a switch, a storage module, and a port conversion module; The microcontroller module includes a first port; the port conversion module is used to adapt the first port to the port of the switch. The microcontroller module is used to send protocol information to the switch to configure the port of the switch and send control commands to the switch; The microcontroller module is also used to receive data transmitted by the switch, process the received data transmitted by the switch, and transmit the processed data to the storage module; The microcontroller module further includes a direct processor cache module accessing a DMA channel and a processor. The DMA channel is connected between the first port and the processor. The processor is used to detect whether the first port and the DMA channel are transmitting data. When the processor detects that the first port and the DMA channel are not transmitting data, the processor generates an idle interrupt signal and sends the idle interrupt signal to the data processing module to control the data processing module to process the data cached in the processor cache module. The DMA channel is also connected between the first port and the processor cache module, and the DMA channel is used to quickly transmit the data received by the first port to the processor cache module. The storage module is electrically connected to the microcontroller module. The storage module is used to receive data processed by the microcontroller module and save the data.
2. The data acquisition system as described in claim 1, characterized in that, The microcontroller module includes a serial peripheral interface (SPI) module, which includes an SPI interface and an SPI driver module. The SPI interface is used to connect to the storage module; The SPI driver module is used to send a drive signal to the storage module to drive the storage module to form a communication connection with the SPI module, and then the microcontroller module transmits data to the storage module through the SPI module.
3. The data acquisition system as described in claim 1, characterized in that, The microcontroller module includes a second port; The second port is used to electrically connect one or more buttons, which are used to trigger the microcontroller module to output protocol information to the switch in order to configure the port of the switch; Once the port configuration of the switch is complete, the microcontroller module sends command-line interface (CLI) commands to the switch to control the switch to transmit data.
4. The data acquisition system according to any one of claims 1 to 3, characterized in that, The microcontroller module also includes a processor cache module and a data processing module; The processor cache module is used to cache the data received by the microcontroller module from the switch; The data processing module is used to process the data cached in the processor cache module.
5. The data acquisition system as described in claim 4, characterized in that, When the data processing module receives an idle interrupt signal sent by the processor, the data processing module processes the data cached in the processor cache module and transmits the processed data to the SPI module.
6. The data acquisition system as described in claim 5, characterized in that, The processor is also configured to control the SPI driver module to send the drive signal to the storage module after the SPI module receives the data processed by the data processing module, thereby driving the storage module to form a communication connection with the SPI module; After a communication connection is established between the storage module and the SPI module, the SPI module transmits the received processed data to the storage module for storage.
7. A data acquisition method, characterized in that, The data acquisition method is applied to the data acquisition system as described in any one of claims 1 to 6, wherein the data acquisition method includes: The microcontroller module configures the port of the switch and controls the switch to transmit data; The microcontroller module receives data transmitted by the switch, processes the received data, and transmits the processed data to the storage module. The storage module receives data transmitted by the microcontroller module and saves the data.
8. The data acquisition method as described in claim 7, characterized in that, The data acquisition method further includes: The microcontroller module is triggered to send the protocol information to the switch to configure the port of the switch; After the port configuration of the switch is completed, the microcontroller module sends the CLI command to the switch to control the switch to start transmitting data.
9. The data acquisition method as described in claim 8, characterized in that, The data acquisition method further includes: The microcontroller module receives the data transmitted by the switch and caches the received data in the processor cache module; After the data transmission is completed, the processor generates an idle interrupt signal and sends the idle interrupt signal to the data processing module to control the data processing module to process the data cached in the processor cache module; When the data processing module receives an idle interrupt signal sent by the processor, it processes the data cached in the processor cache module and transmits the processed data to the SPI module.
10. The data acquisition method as described in claim 9, characterized in that, The data acquisition method further includes: The SPI driver module is controlled to send a drive signal to the storage module, thereby driving the storage module to form a communication connection with the SPI module. Then, the SPI module sends the data processed by the data processing module to the storage module. The storage module receives the data and saves it; After all the data in the SPI module is transmitted to the storage module, the microcontroller module clears the cached data and performs functional initialization.
Citation Information
Patent Citations
Data processing method, device and system
CN111984557A
Configurable control device
CN203595936U
