Data processing method and device

By acquiring and integrating data in the sensor through the main control chip to form a fusion sensor, the problems of single function, high cost and low integration in sensor deployment are solved, and efficient data collection and transmission are achieved.

CN120850207APending Publication Date: 2025-10-28BEIJING URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510959688.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing sensor deployment methods suffer from problems such as limited functionality, large and dispersed numbers, high installation and maintenance costs, low system integration, lack of flexibility and scalability, and difficulty in integrating data according to actual application scenarios.

Method used

Initial data is acquired from at least two types of sensors through the data interface associated with the main control chip, and the data is integrated after data integrity detection to form a fused sensor. The main control chip is then used to integrate the initial data at the data frame level to generate target data.

Benefits of technology

It improves the efficiency of data acquisition, reduces the installation and maintenance costs of sensors, enhances the flexibility of data integration, and enables the integration and transmission of multiple types of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120850207A_ABST
    Figure CN120850207A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, and the method comprises the steps: obtaining at least two groups of initial data from at least two types of sensors through a data interface associated with a main control chip, and enabling the at least two types of sensors to form a fusion sensor; and under the condition that the at least two groups of initial data pass the data integrity detection, performing data integration on the at least two groups of initial data and the attribute data corresponding to the at least two groups of initial data in a data frame dimension by utilizing the main control chip to obtain target data. The initial data corresponding to the at least two types of sensors are acquired through the main control chip, and the data acquisition efficiency is improved. At least two types of sensors are installed in a fusion sensor form, so that the installation and maintenance cost of the sensors is reduced, and the flexibility of data integration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to data processing methods and apparatus. Background Technology

[0002] With the rapid development and increasing intelligence of urban rail transit, higher demands are being placed on the safety and comfort of the operating environment. Currently, a large number of sensor devices are widely deployed in subway platforms, concourses, restrooms, and buildings to collect parameters such as temperature, humidity, air quality, and personnel density. However, existing sensor deployment and data acquisition methods have many problems, such as: limited functionality, with each sensor only able to collect one or a limited number of parameters; a large number of sensors deployed in a dispersed manner, leading to high installation and maintenance costs and low system integration; and a lack of flexibility and scalability, making it difficult to integrate data according to actual application scenarios. Summary of the Invention

[0003] In view of this, embodiments of this specification provide a data processing method. This specification also relates to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, to address the aforementioned problems in the prior art.

[0004] According to a first aspect of the embodiments of this specification, a data processing method is provided, comprising: At least two sets of initial data are acquired from at least two types of sensors through the data interface associated with the main control chip, and the at least two types of sensors constitute a fusion sensor. If the at least two sets of initial data pass the data integrity check, the main control chip integrates the at least two sets of initial data and the attribute data corresponding to the at least two sets of initial data at the data frame dimension to obtain the target data.

[0005] Optionally, data acquisition from the target sensor among the at least two types of sensors includes: The interrupt mode is enabled, and if data is detected in the target sensor, a set of initial data matching the preset data amount is obtained from the target sensor through the target interface corresponding to the target sensor.

[0006] Optionally, the data integrity check of any one of the at least two sets of initial data to be tested includes: Determine the data bytes corresponding to the initial data to be tested; If the data byte matches the start and end identifier of the data frame, and the number of bytes corresponding to the data byte matches the preset number of bytes, then the initial data to be tested is determined to have passed the data integrity check.

[0007] Optionally, the acquisition of at least two sets of initial data from at least two types of sensors via the data interface associated with the main control chip includes: Among the at least two types of sensors, temperature and humidity sensors, gas sensors, particulate matter sensors, and personnel sensors are identified; The data interface associated with the main control chip includes a communication bus, a first communication interface, a first peripheral interface, a second communication interface, and a second peripheral interface. The temperature and humidity data are acquired in the temperature and humidity sensor using the communication bus, the first gas data is acquired in the gas sensor using the first communication interface, the second gas data is acquired in the gas sensor using the first peripheral interface, the particulate matter data is acquired in the particulate matter sensor using the second communication interface, and the personnel data is acquired in the personnel sensor using the second peripheral interface. The temperature and humidity data, the first gas data, the second gas data, the particulate matter data, and the personnel data are used as the at least two sets of initial data.

[0008] Optionally, the step of using the main control chip to integrate the at least two sets of initial data and the attribute data corresponding to the at least two sets of initial data at the data frame dimension to obtain the target data includes: The main control chip is used to convert the at least two sets of initial data into a message body in the target format; Add attribute data corresponding to the at least two sets of initial data to the message body at the data frame dimension to obtain the target data.

[0009] Optionally, acquiring the second gas data from the gas sensor using the first peripheral interface includes: The analog voltage is acquired from the gas sensor using the first peripheral interface, and the analog voltage is converted into the second gas data.

[0010] Optionally, acquiring personnel data from the personnel sensor using the second peripheral interface includes: The second peripheral interface is used to acquire level data from the personnel sensor and convert the level data into personnel data.

[0011] Optionally, the data processing method further includes: If no program anomalies are detected by using a hardware timer, the target data is sent to the host computer wirelessly based on the target transmission protocol.

[0012] Optionally, the data processing method further includes: When configuring the parameters to be configured, the transmission connection of the target data is interrupted, and the parameters to be configured are configured.

[0013] According to a second aspect of the embodiments of this specification, a data processing apparatus is provided, comprising: The acquisition module is configured to acquire at least two sets of initial data from at least two types of sensors via a data interface associated with the main control chip. The integration module is configured to, when the at least two sets of initial data pass the data integrity check, use the main control chip to integrate the at least two sets of initial data and the attribute data corresponding to the at least two sets of initial data at the data frame dimension to obtain the target data.

[0014] According to a third aspect of the embodiments of this specification, a computing device is provided, including a memory, a processor, and a computer program or instructions stored in the memory and executable on the processor, wherein the processor executes the computer program or instructions to implement the steps of the data processing method.

[0015] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program or instructions which, when executed by a processor, implement the steps of the data processing method.

[0016] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described data processing method.

[0017] The data processing method provided in this specification acquires at least two sets of initial data from at least two types of sensors through a data interface associated with the main control chip, forming a fusion sensor from the at least two types of sensors. If the at least two sets of initial data pass data integrity checks, the main control chip integrates the at least two sets of initial data, along with their corresponding attribute data, at the data frame level to obtain the target data. This method enables the acquisition of initial data from at least two types of sensors via the main control chip, improving data acquisition efficiency. The installation of at least two types of sensors as a fusion sensor reduces sensor installation and maintenance costs and increases the flexibility of data integration. Attached Figure Description

[0018] Figure 1 This is a flowchart of a data processing method provided in one embodiment of this specification; Figure 2 This is a data transmission diagram illustrating a data processing method provided in one embodiment of this specification; Figure 3This is a flowchart illustrating a data processing method applied to a rail transit scenario, provided in one embodiment of this specification. Figure 4 This is a schematic diagram of the program design logic of a data processing method provided in one embodiment of this specification; Figure 5 This is a schematic diagram of the structure of a data processing device provided in one embodiment of this specification; Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0019] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0020] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0021] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0022] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0023] IIC (Inter-Integrated Circuit): is a two-wire serial communication protocol used to connect low-speed peripheral integrated circuits on the same circuit board or over short distances.

[0024] The IIC clock signal, commonly known as SCL (Serial Clock Line), is one of the two main signals on the IIC bus; the other is SDA (Serial Data Line). The primary function of the IIC clock is to synchronize data transmission and control the data read / write rate.

[0025] STM32 is a series of 32-bit embedded microcontrollers. It is widely used in industrial control, consumer electronics, automotive electronics, the Internet of Things (IoT), smart homes, robotics, and many other fields. The "XX" in "STM32XX" is a generic placeholder representing different sub-series models within this series.

[0026] A Wi-Fi module is a hardware component used to enable wireless network communication between devices. It is typically integrated into a microcontroller unit (MCU) or exists as a standalone module, enabling data exchange with other Wi-Fi-enabled devices over short distances via radio waves. The main functions of a Wi-Fi module include connecting to the internet, other devices within a local area network, and providing a way for devices to send and receive data.

[0027] ppm (Parts Per Million): A unit of measurement used to express very low concentrations, especially for trace components in gases and liquids. 1 ppm means one part of the target substance per million parts of air. For example, in gas concentration measurements, 1 ppm of H2S or NH3 means one volume unit of H2S or NH3 in one million volume units of air.

[0028] MQTT (Message Queuing Telemetry Transport): A lightweight messaging protocol designed for efficient message transmission in low-bandwidth, unreliable network conditions.

[0029] UART: A hardware device for serial communication that allows two devices to communicate by sending and receiving data bits. UART communication does not require clock synchronization; instead, it relies on a pre-set baud rate between the two devices.

[0030] GPIO: A pin that can be controlled by a user program to perform digital input or output operations. These pins can be directly read as high or low level or set to high or low level to drive other circuits.

[0031] RS485 (also known as EIA-485): A serial communication standard widely used in industrial automation, used as an electrical interface specification for multi-point, differential signal transmission.

[0032] Watchdog Timer (WDT): A hardware timer used to monitor whether a program is running normally. Its basic principle is: when the program is running normally, it periodically "feeds" the watchdog, which means resetting the watchdog timer; if the program enters an infinite loop, freezes, or makes an abnormal jump, causing it to fail to feed the watchdog in time, the watchdog will time out; after timeout, the watchdog will trigger an interrupt or directly cause a system reset (reboot), thus restoring the system to a normal state.

[0033] This specification provides a data processing method, and also relates to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0034] Figure 1 A flowchart of a data processing method according to an embodiment of this specification is shown, which specifically includes the following steps: Step 102: Acquire at least two sets of initial data from at least two types of sensors through the data interface associated with the main control chip, wherein the at least two types of sensors constitute a fusion sensor.

[0035] Specifically, each of the at least two types of sensors is used to collect different types of environmental parameters in the target space. The fusion sensor integrates at least two types of sensors, avoiding scattered distribution and improving sensor installation and maintenance efficiency. The main control chip is a microcontroller chip, which can be an STM32XX chip. The STM32XX chip is the smallest and lowest power consumption chip in the STM32 series. The main control chip includes multiple data interfaces, specifically three UART peripheral interfaces, an IIC peripheral interface, and a watchdog peripheral. The at least two types of sensors can include various sensors such as temperature and humidity sensors, carbon dioxide sensors, NH3 / HS gas sensors, PM2.5 / 10 sensors, and human body sensors.

[0036] Based on this, the main control chip contains multiple data interfaces. Through the multiple data interfaces associated with the main control chip, at least two sets of initial data can be acquired from at least two types of sensors. Each type of sensor acquires one set of initial data, and the at least two types of sensors form a fusion sensor, which is then integrated and installed in the form of a fusion sensor.

[0037] In practical applications, the data processing method provided in the embodiments of this specification corresponds to a data processing device. This data processing device integrates at least two types of sensors, a main control chip, and registers for buffering data. Before reading data from each sensor, it enters interrupt mode to perform data acquisition.

[0038] Furthermore, the prerequisite for acquiring data from various sensors is the existence of readable data within the sensors. When entering interrupt mode and reading data from the sensors, a suitable amount of data can be read, that is, a set of initial data matching the preset data volume can be obtained. The specific implementation is as follows: The interrupt mode is enabled, and if data is detected in the target sensor, a set of initial data matching the preset data amount is obtained from the target sensor through the target interface corresponding to the target sensor.

[0039] Based on this, an interrupt mode is enabled before reading data from the sensor to determine if the target sensor is empty. If the target sensor is empty, it means there is no data in the target sensor, and data reading cannot be performed. If the target sensor is not empty, it means there is data in the target sensor, and data reading can be performed. An initial set of data matching the preset data volume is obtained from the target sensor through the target interface corresponding to the target sensor, enabling the reading of one bit of data per interrupt.

[0040] For example, the STM32XX chip includes three UART peripheral interfaces. An interrupt is triggered when reading data from at least two types of sensors. Each interrupt reads one bit of data from the sensor via the UART interface. Before reading data, the sensor's data register is checked for emptiness. If not empty, data is read until an initial set of data corresponding to the target sensor is obtained.

[0041] In summary, after entering interrupt mode, a set of initial data is read from the target sensor to ensure the integrity and real-time performance of the data reading.

[0042] Furthermore, at least two types of sensors include various types such as temperature and humidity sensors, gas sensors, particulate matter sensors, and personnel sensors. When acquiring initial data, it is necessary to acquire data one by one according to the data storage format. The specific implementation is as follows: Among the at least two types of sensors, a temperature and humidity sensor, a gas sensor, a particulate matter sensor, and a personnel sensor are identified; the communication bus, a first communication interface, a first peripheral interface, a second communication interface, and a second peripheral interface included in the data interface associated with the main control chip are identified; temperature and humidity data are acquired from the temperature and humidity sensor using the communication bus, first gas data is acquired from the gas sensor using the first communication interface, second gas data is acquired from the gas sensor using the first peripheral interface, particulate matter data is acquired from the particulate matter sensor using the second communication interface, and personnel data is acquired from the personnel sensor using the second peripheral interface; the temperature and humidity data, the first gas data, the second gas data, the particulate matter data, and the personnel data are used as the at least two sets of initial data.

[0043] Specifically, the temperature and humidity sensor is used to collect temperature and humidity data in the target space; the gas sensor is used to collect data on gases such as NH3 / HS and carbon dioxide in the target space; the particulate matter sensor is used to collect data on PM2.5 / 10 in the target space; and the personnel sensor is used to collect the number of people in the target space to achieve personnel monitoring. The communication bus can be an IIC bus; the first communication interface can be a UART1 interface, the first peripheral interface can be a GPIO interface, the second communication interface can be a UART2 interface, and the second peripheral interface can be a GPIO interface.

[0044] Based on this, a temperature and humidity sensor, a gas sensor, a particulate matter sensor, and a personnel sensor are identified from at least two types of sensors. The data interface associated with the main control chip is determined to include a communication bus, a first communication interface, a first peripheral interface, a second communication interface, and a second peripheral interface. The first and second peripheral interfaces can be GPIO interfaces; the first and second communication interfaces can be UART interfaces. Temperature and humidity data are acquired from the temperature and humidity sensor using the communication bus. First gas data, which can correspond to carbon dioxide concentration, is acquired from the gas sensor using the first communication interface. Second gas data, which can correspond to ammonia or hydrogen sulfide, is acquired from the gas sensor using the first peripheral interface for gas monitoring in the target space. Particulate matter data is acquired from the particulate matter sensor using the second communication interface, and personnel data is acquired from the personnel sensor using the second peripheral interface for personnel monitoring. The temperature and humidity data, the first gas data, the second gas data, the particulate matter data, and the personnel data are used as at least two sets of initial data.

[0045] Continuing with the previous example, when collecting data from multiple types of sensors, such as Figure 2 As shown, this system can collect data on carbon dioxide concentration, PM2.5 / 10, number of people, ammonia, and hydrogen sulfide. Carbon dioxide concentration data is collected via a carbon dioxide gas sensor through the UART1 interface; PM2.5 / 10 data is collected via an NH3 / HS sensor through the UART2 interface; PM2.5 / 10 data is collected via a particulate matter sensor through the GPIO interface; and number of people data is collected via a human body sensor through the GPIO interface. Temperature and humidity data are collected using the IIC bus. These data are used as at least two sets of initial data and transmitted to the WIFI module via the UART3 interface using an STM32XX chip, and then transmitted to the host computer based on the MQTT protocol.

[0046] In summary, by using multiple interfaces such as the communication bus, the first communication interface, the first peripheral interface, the second communication interface, and the second peripheral interface, data from temperature and humidity sensors, gas sensors, particulate matter sensors, and personnel sensors are collected respectively, thereby enabling multi-type data collection of the target space and improving the accuracy of data collection.

[0047] Furthermore, considering that the concentrations of ammonia and hydrogen sulfide cannot be directly collected from the gas sensor using the first peripheral interface, the concentrations of ammonia and hydrogen sulfide can be determined by collecting analog voltage data and performing data conversion. The specific implementation is as follows: The analog voltage is acquired from the gas sensor using the first peripheral interface, and the analog voltage is converted into the second gas data.

[0048] Therefore, the first peripheral interface can directly acquire analog quantities in the gas sensor. The analog voltage is acquired in the gas sensor using the first peripheral interface, and after conversion based on the relationship between voltage and gas concentration, the analog voltage is converted into second gas data.

[0049] Continuing with the previous example, when reading data from the gas sensor (NH3 / HS sensor) using the first peripheral interface GPIO, the received value is an analog quantity, i.e., analog voltage. It is then necessary to convert the read analog voltage into gas concentration (second gas data) based on the linear relationship between voltage and gas concentration. The linear relationship between voltage and gas concentration can be expressed as: ,in, Indicates gas concentration; represents the sensor output voltage; a and b represent parameters determined by the sensor characteristic curve.

[0050] In summary, by utilizing the relationship between voltage and gas concentration, and after conversion, the analog voltage is transformed into secondary gas data, ensuring the accuracy of data acquisition.

[0051] Furthermore, considering that personnel data cannot be directly collected from the personnel sensor using the second peripheral interface, the level data can be converted into personnel data by collecting level data from the personnel sensor. The specific implementation is as follows: The second peripheral interface is used to acquire level data from the personnel sensor and convert the level data into personnel data.

[0052] Based on this, the personnel sensor stores high and low level data. After acquiring the level data from the personnel sensor using the second peripheral interface, the level data can be converted into personnel data according to the high and low levels corresponding to the level data.

[0053] Continuing with the previous example, using the actual time level captured by GPIO, the infrared sensor used to determine the presence of people will collect high and low levels (0 or 1) to indicate whether someone is present. The collected level data can then be converted into personnel data according to the conversion rules.

[0054] In summary, after acquiring the level data from the personnel sensor using the second peripheral interface, the level data is converted into personnel data based on the high and low levels corresponding to the level data, thereby improving the accuracy of personnel monitoring.

[0055] Step 104: If the at least two sets of initial data pass the data integrity check, the main control chip is used to integrate the at least two sets of initial data and the attribute data corresponding to the at least two sets of initial data at the data frame dimension to obtain the target data.

[0056] Specifically, after acquiring at least two sets of initial data from at least two types of sensors via the data interface associated with the main control chip, and forming a fusion sensor from these two types of sensors, the main control chip can integrate the at least two sets of initial data, along with their corresponding attribute data, at the data frame level, provided that the at least two sets of initial data pass data integrity checks, to obtain the target data. The purpose of data integrity checks on each set of initial data is to determine whether each acquired set of initial data completely includes a frame header and frame trailer, and whether the data length corresponding to the number of data bytes conforms to the length field. The attribute data corresponding to the at least two sets of initial data includes, but is not limited to, timestamps, device IDs, etc. The target data refers to the data obtained after integrating the at least two sets of initial data; the target data can be a frame of MQTT message body.

[0057] Based on this, after acquiring at least two sets of initial data from at least two types of sensors through the data interface associated with the main control chip, and forming a fused sensor from these two types of sensors, data integrity checks are performed on the at least two sets of initial data. If both sets of initial data pass the data integrity check, the attribute data corresponding to each of the at least two sets of initial data is determined. The main control chip then integrates the at least two sets of initial data and their corresponding attribute data at the data frame level to obtain the target data.

[0058] Furthermore, when performing data integrity checks on any one of the at least two sets of initial data to be tested, the data bytes corresponding to the initial data to be tested can be checked, as specifically implemented as follows: Determine the data bytes corresponding to the initial data to be tested; if the data bytes match the start and end identifiers of the data frame, and the number of bytes corresponding to the data bytes matches the preset number of bytes, determine that the initial data to be tested has passed the data integrity check.

[0059] Specifically, the data bytes corresponding to the initial data to be tested refer to the data frame information corresponding to the initial data to be tested, including but not limited to the data frame format, number of bytes, etc. The data frame start and end identifiers include the frame header identifier and frame trailer identifier. The target data bytes can be any bytes other than the length bytes. The preset number of bytes can be recorded in the data length field as data length + 5, and the preset number of bytes can be set according to actual needs.

[0060] Based on this, the data bytes are determined according to the data frame information corresponding to the initial data to be tested. The data frame start and end identifiers include a frame header identifier and a frame tail identifier. If the data bytes match both the frame header identifier and the frame tail identifier, and the number of bytes corresponding to the data bytes matches the preset number of bytes, the initial data to be tested is determined to have passed the data integrity check and is determined to be a complete frame of data.

[0061] Following the previous example, when performing data integrity checks on any one of at least two sets of initial data to be tested, we can first determine the data bytes corresponding to the initial data to be tested. These data bytes typically include: frame header, function code, data length, data area, checksum, and frame trailer. The initial data to be tested corresponds to the following data bytes: "0xAA, 0x01, 0x03, 0x10, 0x20, 0x30, 0x64, and 0x55". The data frame start and end identifiers include the frame header 0xAA and the frame trailer 0x55. If the frame header "0xAA" of the initial data to be tested is the same as the frame header 0xAA included in the data frame start and end identifiers, then the frame header is considered to match. Similarly, if the frame trailer "0x55" of the initial data to be tested is the same as the frame trailer 0x55 included in the data frame start and end identifiers, then the frame trailer is considered to match. Furthermore, if the number of bytes is equal to the data length + 5, then the data is considered complete.

[0062] In summary, if the data bytes match both the frame header and frame tail identifiers, and the number of bytes corresponding to the data bytes matches the preset number of bytes, the initial data to be tested is deemed to have passed the data integrity check. By performing a data integrity check on the initial data to be tested, the integrity of the collected initial data is ensured.

[0063] Furthermore, when integrating at least two sets of initial data and attribute data, the initial data can first be parsed and formatted to obtain a message body in the target format, which facilitates data packaging. The specific implementation is as follows: The main control chip is used to convert the at least two sets of initial data into a message body in the target format; attribute data corresponding to the at least two sets of initial data is added to the message body at the data frame dimension to obtain the target data.

[0064] Based on this, the target format can be JSON or a key-value pair structure. The main control chip parses at least two sets of initial data directly acquired from the sensor, analyzes the sensor frame structure, converts the data units to physical units, and then performs format conversion to convert it into a message body in the target format. At least two sets of attribute data corresponding to the initial data are added to the message body at the data frame level to obtain the target data.

[0065] Following the previous example, after acquiring data such as temperature and humidity, carbon dioxide content, NH3 / HS concentration, and particulate matter content through the IIC, UART1, UART2, and GPIO interfaces, it is necessary to convert the data units to physical units such as ppm, μg / m³ (micrograms per cubic meter), and ℃ (degrees Celsius). Then, the converted data is converted into JSON or key-value pair format and packaged into an MQTT message body. After adding a timestamp and device ID field to the MQTT message body, the target data is obtained.

[0066] In summary, by adding at least two sets of attribute data corresponding to the initial data to the message body at the data frame level, the target data can be obtained, thereby improving the traceability of the target data.

[0067] Furthermore, when sending the target data to the host computer, it is also necessary to avoid abnormal issues such as program freezing as much as possible. The specific implementation is as follows: If no program anomalies are detected by using a hardware timer, the target data is sent to the host computer wirelessly based on the target transmission protocol.

[0068] Based on this, the hardware timer can be a watchdog timer. Before data transmission, a "feed the watchdog" operation is performed. This operation involves writing a specific value to the watchdog register to clear the current counter value, preventing overflow and triggering a reset. After confirming there are no program exceptions using the hardware timer, the target data is wirelessly transmitted to the Wi-Fi module based on the target transport protocol MQTT, and then sent to the host computer.

[0069] In summary, assuming no program errors are detected using a hardware timer, the target data is transmitted to the host computer wirelessly based on the target transmission protocol. The use of a hardware timer prevents program freezes and improves the stability and reliability of data transmission.

[0070] Furthermore, to ensure data security, authentication is required before acquiring data from the sensor. The configurable parameters used for authentication can be configured even if the data transmission connection is interrupted, as detailed below: When configuring the parameters to be configured, the transmission connection of the target data is interrupted, and the parameters to be configured are configured.

[0071] Specifically, the configurable parameters are used for authentication before reading data from the sensor. These parameters include, but are not limited to, configurable parameters such as username, password, account, and Wi-Fi settings. A single-pole double-throw switch can be configured to interrupt and enable the transmission of target data.

[0072] Based on this, when configuring the parameters to be configured, the transmission connection of the target data can be interrupted by toggling a single-pole double-throw switch. The RS485 connection cable is used to communicate with the host computer to configure the parameters. That is, the parameters are configured through a serial port debugging assistant or a self-designed debugging program. After configuring the output, the single-pole double-throw switch is toggled to the other side, and the power is turned on again to restore the transmission connection of the target data and continue the transmission.

[0073] Continuing with the previous example, such as Figure 2 As shown, an RS485 module exists alongside the WIFI module. When configurable parameters such as username, password, account, and WIFI settings need to be changed, the data transmission connection can be interrupted by tossing a single-pole double-throw switch. At this time, the RS485 cable is used to communicate with the host computer to configure the parameters. After configuration, the single-pole double-throw switch is tossed to the other side, and power is restored to resume the data transmission connection.

[0074] In summary, by setting a single-pole double-throw switch, the configuration of parameters to be configured can be carried out even when the data transmission connection is interrupted, thus improving the ease of parameter configuration.

[0075] The data processing method provided in this specification acquires at least two sets of initial data from at least two types of sensors through a data interface associated with the main control chip, forming a fusion sensor from the at least two types of sensors. If the at least two sets of initial data pass data integrity checks, the main control chip integrates the at least two sets of initial data, along with their corresponding attribute data, at the data frame level to obtain the target data. This method enables the acquisition of initial data from at least two types of sensors via the main control chip, improving data acquisition efficiency. The installation of at least two types of sensors as a fusion sensor reduces sensor installation and maintenance costs and increases the flexibility of data integration.

[0076] The following is in conjunction with the appendix Figure 3 Taking the application of the data processing method provided in this specification in a rail transit scenario as an example, the data processing method will be further explained. Figure 3 This specification illustrates a data processing method for a rail transit scenario according to an embodiment, which includes the following steps: Step 302: Identify temperature and humidity sensors, gas sensors, particulate matter sensors, and personnel sensors from at least two types of sensors.

[0077] In rail transit scenarios, there are issues with sensors acquiring single parameters, and the large number and scattered distribution of sensors. The data processing method provided in this embodiment integrates multiple sensors, including temperature and humidity sensors, carbon dioxide sensors, NH3 / HS gas sensors, PM2.5 / 10 sensors, and infrared human body sensors. The main control chip is an STM32XX, a powerful and stable microcontroller chip. Within the STM32 series, it is a small, low-power chip with a 7×7mm package, meeting the requirements of integration and portability. It includes three UART peripheral interfaces, an IIC peripheral interface, a watchdog timer, and other rich on-chip resources, making it suitable for various embedded applications and capable of receiving data from the aforementioned sensors.

[0078] Step 304: Determine the communication bus, first communication interface, first peripheral interface, second communication interface and second peripheral interface included in the data interface associated with the main control chip.

[0079] The communication bus can be IIC, the first and second communication interfaces can be UART, and the first and second peripheral interfaces can be GPIO.

[0080] Step 306: Acquire temperature and humidity data from the temperature and humidity sensor using the communication bus, acquire first gas data from the gas sensor using the first communication interface, acquire second gas data from the gas sensor using the first peripheral interface, acquire particulate matter data from the particulate matter sensor using the second communication interface, and acquire personnel data from the personnel sensor using the second peripheral interface.

[0081] In practical applications, temperature and humidity are collected via IIC, carbon dioxide and PM2.5 / 10 data are collected via UART serial port, NH3 and HS sensor data are collected via GPIO, and personnel information is captured.

[0082] It should be noted that for personnel information, GPIO captures electrical levels. For infrared sensors indicating presence or absence, it's a high or low level (0 or 1) representing the presence of someone. For NH3 and HS sensor data, it collects analog quantities, i.e., analog voltage. The voltage-concentration relationship needs to be used to convert the data to the corresponding ppm value.

[0083] Furthermore, interrupts are introduced when reading data via the UART interface. Each interrupt can capture one bit from a data frame; that is, with the register not empty, each interrupt reads one bit of data and stores it in the buffer. By determining whether the acquired data includes a frame header and a frame tail, it can be determined whether the acquired data is complete.

[0084] Step 308: After the temperature and humidity data, first gas data, second gas data, particulate matter data, and personnel data have passed the data integrity check, the data is integrated to obtain integrated data.

[0085] The collected data is converted into physical units, formatted into JSON or key-value pairs, and then packaged into a single MQTT message body.

[0086] Step 310: Add attribute data to the integrated data, obtain the target data, and send the target data to the host computer.

[0087] After adding attributes such as timestamp and device ID to the packaged MQTT message body, the target data is obtained. The target data is then sent to the WIFI module via UART, and finally transmitted to the host computer based on the MQTT protocol.

[0088] To facilitate debugging and change WIFI parameters such as username, password, and account, a single-pole double-throw switch was designed. When configuration information is needed, the switch is thrown to the wired serial port, and an RS485 connection cable is used to communicate with the host computer. The parameters are configured through a serial port debugging assistant or a self-designed debugging program. After the output is configured, the switch is thrown to the other side, and power is turned on again to realize the transmission.

[0089] The program design logic corresponding to the data processing method is as follows: Figure 4 As shown, the system is powered on, thus initializing the hardware. Data from each serial port is collected by entering an interrupt. For GPIO, the detection of personnel is determined by capturing and judging the level. IIC data is collected in conjunction with the IIC clock (SCL clock). The collected data is placed in a buffer and then sent to the ESP8266 chip (WIFI chip). After a watchdog timer operation, a data transmission is performed, thus completing one main loop.

[0090] In summary, sensor fusion was achieved by integrating multiple parameters, including temperature, humidity, carbon dioxide, ammonia, hydrogen sulfide, PM2.5, PM10, and people monitoring. These multifunctional sensors were integrated into indoor environments such as subway platforms, station halls, and buildings. On-chip fusion of different monitoring information was achieved using an STM chip. Data transmission was implemented via the lightweight MQTT protocol and based on Wi-Fi, meeting the needs of various application scenarios.

[0091] Corresponding to the above method embodiments, this specification also provides data processing apparatus embodiments. Figure 5 A schematic diagram of the structure of a data processing apparatus provided in one embodiment of this specification is shown. For example... Figure 5 As shown, the device includes: The acquisition module 502 is configured to acquire at least two sets of initial data from at least two types of sensors through a data interface associated with the main control chip. The integration module 504 is configured to, when the at least two sets of initial data pass the data integrity check, use the main control chip to integrate the at least two sets of initial data and the attribute data corresponding to the at least two sets of initial data at the data frame dimension to obtain the target data.

[0092] In an optional embodiment, the acquisition module 502 is further configured to: The interrupt mode is enabled, and if data is detected in the target sensor, a set of initial data matching the preset data amount is obtained from the target sensor through the target interface corresponding to the target sensor.

[0093] In an optional embodiment, the integration module 504 is further configured to: Determine the data bytes corresponding to the initial data to be tested; If the data byte matches the start and end identifier of the data frame, and the number of bytes corresponding to the data byte matches the preset number of bytes, then the initial data to be tested is determined to have passed the data integrity check.

[0094] In an optional embodiment, the acquisition module 502 is further configured to: Among the at least two types of sensors, temperature and humidity sensors, gas sensors, particulate matter sensors, and personnel sensors are identified; The data interface associated with the main control chip includes a communication bus, a first communication interface, a first peripheral interface, a second communication interface, and a second peripheral interface. The temperature and humidity data are acquired in the temperature and humidity sensor using the communication bus, the first gas data is acquired in the gas sensor using the first communication interface, the second gas data is acquired in the gas sensor using the first peripheral interface, the particulate matter data is acquired in the particulate matter sensor using the second communication interface, and the personnel data is acquired in the personnel sensor using the second peripheral interface. The temperature and humidity data, the first gas data, the second gas data, the particulate matter data, and the personnel data are used as the at least two sets of initial data.

[0095] In an optional embodiment, the integration module 504 is further configured to: The main control chip is used to convert the at least two sets of initial data into a message body in the target format; Add attribute data corresponding to the at least two sets of initial data to the message body at the data frame dimension to obtain the target data.

[0096] In an optional embodiment, the acquisition module 502 is further configured to: The analog voltage is acquired from the gas sensor using the first peripheral interface, and the analog voltage is converted into the second gas data.

[0097] In an optional embodiment, the acquisition module 502 is further configured to: The second peripheral interface is used to acquire level data from the personnel sensor and convert the level data into personnel data.

[0098] In an optional embodiment, the integration module 504 is further configured to: If no program anomalies are detected by using a hardware timer, the target data is sent to the host computer wirelessly based on the target transmission protocol.

[0099] In an optional embodiment, the integration module 504 is further configured to: When configuring the parameters to be configured, the transmission connection of the target data is interrupted, and the parameters to be configured are configured.

[0100] The data processing apparatus provided in this specification acquires at least two sets of initial data from at least two types of sensors through a data interface associated with a main control chip. These at least two types of sensors form a fusion sensor. If the at least two sets of initial data pass data integrity checks, the main control chip integrates the at least two sets of initial data, along with their corresponding attribute data, at the data frame level to obtain the target data. This enables the acquisition of initial data from at least two types of sensors via the main control chip, improving data acquisition efficiency. The installation of at least two types of sensors as a fusion sensor reduces sensor installation and maintenance costs and increases the flexibility of data integration.

[0101] The above is an illustrative scheme of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the data processing method described above.

[0102] Figure 6 A structural block diagram of a computing device 600 according to an embodiment of this specification is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.

[0103] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0104] In one embodiment of this specification, the above-described components of the computing device 600 and Figure 6 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0105] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 600 can also be a mobile or stationary server.

[0106] The processor 620 implements the data processing method when executing the computer program or instructions.

[0107] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the data processing method described above.

[0108] An embodiment of this specification also provides a computer-readable storage medium storing a computer program or instructions that, when executed by a processor, implement the steps of the data processing method as described above.

[0109] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the data processing method described above.

[0110] An embodiment of this specification also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described data processing method.

[0111] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the data processing method described above.

[0112] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0113] The computer program or instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0114] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this specification is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this specification. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this specification.

[0115] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0116] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. These embodiments have been selected and specifically described in this specification to better explain the principles and practical applications of this specification, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A data processing method, characterized in that, include: At least two sets of initial data are acquired from at least two types of sensors through the data interface associated with the main control chip, and the at least two types of sensors constitute a fusion sensor. If the at least two sets of initial data pass the data integrity check, the main control chip integrates the at least two sets of initial data and the attribute data corresponding to the at least two sets of initial data at the data frame dimension to obtain the target data.

2. The data processing method according to claim 1, characterized in that, Data acquisition from the target sensor among the at least two types of sensors includes: The interrupt mode is enabled, and if data is detected in the target sensor, a set of initial data matching the preset data amount is obtained from the target sensor through the target interface corresponding to the target sensor.

3. The data processing method according to claim 1, characterized in that, The data integrity check of any one of the at least two sets of initial data to be tested includes: Determine the data bytes corresponding to the initial data to be tested; If the data byte matches the start and end identifier of the data frame, and the number of bytes corresponding to the data byte matches the preset number of bytes, then the initial data to be tested is determined to have passed the data integrity check.

4. The data processing method according to claim 1, characterized in that, The acquisition of at least two sets of initial data from at least two types of sensors via the data interface associated with the main control chip includes: Among the at least two types of sensors, temperature and humidity sensors, gas sensors, particulate matter sensors, and personnel sensors are identified; The data interface associated with the main control chip includes a communication bus, a first communication interface, a first peripheral interface, a second communication interface, and a second peripheral interface. The temperature and humidity data are acquired in the temperature and humidity sensor using the communication bus, the first gas data is acquired in the gas sensor using the first communication interface, the second gas data is acquired in the gas sensor using the first peripheral interface, the particulate matter data is acquired in the particulate matter sensor using the second communication interface, and the personnel data is acquired in the personnel sensor using the second peripheral interface. The temperature and humidity data, the first gas data, the second gas data, the particulate matter data, and the personnel data are used as the at least two sets of initial data.

5. The data processing method according to claim 1, characterized in that, The step of integrating the at least two sets of initial data and the corresponding attribute data at the data frame dimension using the main control chip to obtain the target data includes: The main control chip is used to convert the at least two sets of initial data into a message body in the target format; Add attribute data corresponding to the at least two sets of initial data to the message body at the data frame dimension to obtain the target data.

6. The data processing method according to claim 4, characterized in that, The step of acquiring second gas data from the gas sensor using the first peripheral interface includes: The analog voltage is acquired from the gas sensor using the first peripheral interface, and the analog voltage is converted into the second gas data.

7. The data processing method according to claim 4, characterized in that, The step of acquiring personnel data from the personnel sensor using the second peripheral interface includes: The second peripheral interface is used to acquire level data from the personnel sensor and convert the level data into personnel data.

8. The data processing method according to claim 1, characterized in that, The data processing method further includes: If no program anomalies are detected by using a hardware timer, the target data is sent to the host computer wirelessly based on the target transmission protocol.

9. The data processing method according to claim 1, characterized in that, The data processing method further includes: When configuring the parameters to be configured, the transmission connection of the target data is interrupted, and the parameters to be configured are configured.

10. A data processing apparatus, characterized in that, include: The acquisition module is configured to acquire at least two sets of initial data from at least two types of sensors through a data interface associated with the main control chip. The integration module is configured to, when the at least two sets of initial data pass the data integrity check, use the main control chip to integrate the at least two sets of initial data and the attribute data corresponding to the at least two sets of initial data at the data frame dimension to obtain the target data.

11. A computing device, comprising a memory, a processor, and a computer program or instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program or instructions, it implements the steps of the method according to any one of claims 1-9.

12. A computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1-9.

13. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Data processing method and device

    CN109635870A

  • Multi-class sensor data fusion method and device and electronic equipment

    CN117150428A

  • Power distribution and transformation full-dimension data fusion method and system

    CN117632949A

  • Data processing method and system

    CN118972405A

  • Multi-sensor apparatus and joint data collection assembly

    WO2024098200A1