Equipment integrated bus data acquisition system for data security storage
By combining a linear congruential generator and an environmental thermal noise entropy source generator to generate high-quality random number seeds and using the AES encryption algorithm, the problem of insufficient data security and reliability in the data acquisition system is solved, and efficient, secure storage and real-time monitoring of data are achieved.
Patent Information
- Application Number
- CN202411333270.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-09-24
AI Technical Summary
In the existing data acquisition systems for bridge laying and mobile minesweeping engineering equipment, the multi-source and diversified data lead to insufficient security and reliability issues in data acquisition and storage encryption technology. In particular, the pseudo-random number key generated by the linear congruential method is of low quality, affecting the security and reliability of data storage.
Combining a linear congruential generator and an environmental thermal noise entropy source generator, high-quality random number seeds are generated through environmental thermal noise quantization processing, and the AES encryption algorithm is used to optimize the security and reliability of data acquisition and storage.
It improves the security and reliability of data collection and storage, ensures the confidentiality and integrity of data, enhances the performance and operational efficiency measurement of engineering equipment, and prevents data leakage and unauthorized access.
Smart Images

Figure CN119249515B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of engineering equipment, and more particularly to an equipment integrated bus data acquisition system oriented to data security storage. Background Art
[0002] In the test of two types of engineering equipment capable of bridge laying and mobile minesweeping, the collection of data such as bridge erection time, withdrawal time, march release time, mechanical minesweeping time, and number of markers can dynamically display the equipment's operating status information and measure the equipment's operating efficiency. Data collection and analysis play a vital role. The performance and efficiency optimization of the two types of engineering equipment are inseparable from accurate data monitoring and real-time analysis. The chassis and equipment upper parts of these two types of engineering equipment are equipped with a variety of sensors and operating systems, and various types of data are transmitted through the CAN bus. The multi-source and diversification of data have brought challenges to the existing data acquisition system for efficient data collection, real-time analysis and effective display. Among the existing data storage encryption technologies, the linear congruential method (LCG for short) is a common and simple pseudo-random number generator. The linear congruential method generates a series of pseudo-random numbers through a linear recursive relationship, and uses the generated pseudo-random data as a key. The most important thing about the linear congruential method is that it defines three integers: the multiplier A, the increment B, and the modulus M, where A, B, and M are constants that need to be set. The maximum period of LCG is M, but in most cases it will be less than M. To make LCG reach the maximum period, it should meet the following conditions: B and M are mutually prime; all prime factors of M can divide A-1; if M is a multiple of 4, so is A-1; A, B, and N[0] are all smaller than M; A and B are positive integers. The generation of LCG random numbers requires seeds. High-quality seeds can make the key security of data storage higher. How to improve the existing LCG to obtain seeds of better quality and improve the security and reliability of data storage has become a problem that needs to be solved. Summary of the Invention
[0003] To overcome the aforementioned shortcomings of the existing technology, the present invention provides an integrated equipment bus data acquisition system for secure data storage. By combining a linear congruential generator with an ambient thermal noise entropy source, this system enhances the security and reliability of data acquisition and storage. Utilizing a high-quality random number seed and the AES encryption algorithm, it ensures data confidentiality and integrity, optimizing the performance and operational efficiency of engineering equipment.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] An equipment integrated bus data acquisition system for data security storage includes a data layer and an acquisition layer. The data layer includes a chassis sensor module for real-time acquisition of equipment chassis data and an equipment upper body sensor module for acquisition of equipment upper body data. The acquired data is transmitted to the acquisition layer through a CAN bus interface. The acquisition layer is a data recorder, including a data acquisition module and a data storage module. A linear congruential generator is provided in the data storage module. The linear congruential generator is connected to an entropy source generator. The entropy source generator is connected to a thermal noise sensor for acquiring environmental thermal noise. The entropy source generator initializes the number of quantization levels, uses the environmental thermal noise quantization function to convert the continuous environmental thermal noise signal into a discrete value, counts the frequency of occurrence of each quantized value, converts the frequency of occurrence of each quantized value into its probability of occurrence, and then uses the environmental thermal noise signal entropy analysis formula Calculate the entropy of each quantized value, obtain the maximum entropy among all quantized value entropies, gradually increase the number of quantization levels, and calculate the corresponding maximum entropy until the value of the maximum entropy is found to reach the maximum value, output the number of quantization levels, update the environmental noise quantization function, use the updated environmental noise quantization function to convert the continuous noise signal into a discrete value, obtain the collected environmental thermal noise samples, combine the environmental thermal noise samples, generate an initial seed, and transmit the generated initial seed to the linear congruential generator. The linear congruential generator is initialized with the initial seed and generates a pseudo-random number based on the linear congruential method. SHA-256 is then used to hash the pseudo-random number generated by the linear congruential method to generate a hash value. A part of the hash value is used as the encryption key of the AED encryption algorithm, and the collected information data is encrypted with AES to generate a ciphertext.
[0006] During operations, the data layer can automatically collect relevant equipment bus data such as chassis speed, motorcycle hours, vehicle speed, mileage, oil temperature, engine parameters, and superstructure operating status (front boom data, rear swing frame data, ignition circuit data), system diagnostic information, driver control box, and various sensors through the CAN bus interface of two types of engineering equipment. The collected equipment chassis and superstructure bus signals are analyzed to obtain the equipment's various operating status and system fault information corresponding to the bus signals, providing a basis for subsequent signal display and measurement. Combined with the results of bus data analysis, the equipment's operating status information can be dynamically displayed on the collection device, as well as basic data for measuring equipment operating efficiency, such as erection time, withdrawal time, march release time, mechanical mine clearance time, and the number of deployed markers.
[0007] As a further solution of the present invention, in the entropy source generator, the value of the number of initialization quantization levels is set to 128.
[0008] In the testing of engineering equipment with bridge-laying and mobile minesweeping capabilities, data collection and storage security are crucial. To improve the security and reliability of data storage, the present invention proposes an improved entropy source generator that generates high-quality random number seeds by quantizing ambient thermal noise. Ambient thermal noise is a random and unpredictable natural phenomenon. Using it as an entropy source can effectively improve the security of pseudo-random number generators. Ambient thermal noise signals are highly random and exhibit nonlinear variations. Simple linear quantization methods have difficulty capturing these variations, resulting in uneven distribution of the quantized signal and reduced entropy.
[0009] As a further solution of the present invention, in the entropy source generator, the ambient thermal noise quantization function processes the nonlinear change of the signal based on the logarithmic signal difference formula by the maximum and minimum values of the collected ambient noise signal to obtain the logarithmic signal difference, and then multiplies the logarithmic signal difference by the number of quantization levels minus one and rounds down to obtain the discrete value of the quantized ambient thermal noise. The formula of the ambient thermal noise quantization function is:
[0010]
[0011] Where: X is the continuous ambient thermal noise signal collected by the ambient thermal noise sensor, Q(X) is the discrete value of the ambient thermal noise after quantization, ΔX d is the logarithmic signal difference of the continuous ambient thermal noise signal, obtained by the logarithmic signal difference formula, m is the number of quantization levels, The floor operator.
[0012] As a further solution of the present invention, in the entropy source generator, the logarithmic signal difference formula in the ambient thermal noise quantization function formula is:
[0013]
[0014] Where: X min 、X max are the minimum and maximum values in the ambient thermal noise signal, respectively.
[0015] By introducing the logarithmic signal difference formula, the nonlinear variations of the signal can be effectively handled, improving the uniformity of the quantized signal distribution. The logarithmic signal difference formula can more evenly distribute quantization levels, resulting in a wider and more uniform distribution of discrete values after quantization. This increases the signal's entropy, helps generate high-quality random numbers, and improves the security and unpredictability of the pseudo-random number generator. A high-quality random number seed is fundamental to the security of a pseudo-random number generator. By utilizing the logarithmic signal difference formula of ambient thermal noise, a seed with higher entropy can be generated, thereby enhancing the quality and security of random numbers generated by the linear congruential generator (LCG). High-quality keys generated by pseudo-random number generators are crucial for data encryption. Using ambient thermal noise as an entropy source and generating a high-entropy seed through an improved quantization function can improve the security and reliability of data storage encryption, preventing data leakage and unauthorized access.
[0016] Ensuring the security and reliability of data storage is crucial in testing engineering equipment with bridge-building and mobile minesweeping capabilities. To improve the quality of pseudo-random number generation, a high-quality seed must be used. By quantizing the ambient thermal noise signal and calculating its entropy, a high-entropy random number seed can be generated, thereby enhancing the security of data encryption. The randomness and unpredictability of the ambient thermal noise signal make it an ideal entropy source. However, directly analyzing and calculating the original signal is complex and inefficient. Therefore, quantizing the continuous ambient thermal noise signal into discrete values simplifies the processing while preserving the signal's random characteristics. Statistically analyzing the distribution of each quantized discrete value can reflect the overall characteristics of the signal. To calculate the entropy of the ambient thermal noise signal, the frequency of occurrence of each quantized discrete value must first be counted and then converted into a probability. The probability reflects the distribution of each discrete value within the overall signal. Using probabilities for entropy calculation provides a more accurate measure of the signal's randomness and complexity. By calculating the entropy of the ambient thermal noise signal, the impact of different quantization levels on the signal's randomness can be assessed. The number of quantization levels is gradually increased, and the corresponding maximum entropy value is calculated until the number of quantization levels that maximizes entropy is found. This ensures that the quantized signal has the highest randomness and unpredictability, providing a guarantee for generating high-quality random number seeds.
[0017] As a further solution of the present invention, the environmental thermal noise sensor includes a thermal noise source resistor, a noise amplifier, a filter, a digital-to-analog converter and a signal acquisition and storage unit. The thermal noise source generates a thermal noise signal that is proportional to the resistance value and temperature. The noise amplifier amplifies the thermal noise voltage generated by the thermal noise source. The gain of the noise amplifier is set according to actual needs. The filter filters the amplified thermal noise signal to retain the target segment noise signal. The digital-to-analog converter converts the amplified and filtered analog signal into a digital signal. The resolution of the digital-to-analog converter is 12 bits and the sampling rate is 1kHz.
[0018] As a further solution of the present invention, in the data storage module, after the collected plaintext data is input, encrypted data is generated together with the key through the AES encryption algorithm. The key is selected from multiple key groups through the communication interface. During decryption, the same key needs to be used for reading and encryption. The key is transmitted through the communication interface, and the encrypted data is restored to valid plaintext data using the key obtained through the communication interface through the AES decryption algorithm.
[0019] As a further solution of the present invention, in the data storage module, the data storage content based on SD includes 6 layers, namely CMD0, CMD1, CMD2, CMD3, CMD4, CMD5, and CMD6, wherein the CMD0 layer is used to store basic storage information, which is unique to the device; the CMD1 layer is used to store encryption information, which is unique to the device; the CMD2 layer is used to store device parameter settings, which is unique to the device; CMD3 is used to store global storage parameters, which is unique to the device; the CMD4 layer is used to store directory information, which includes several directories; CMD5 is used to store file information, which belongs to the setting directory, and several files; CMD6 is used to store data information, which belongs to the setting file, and stores data content. All storage contents use standard frame headers and frame tails, use storage commands, and the storage length is fixed at 0xFF, a total of 512 bytes. The data storage uses the RTC clock for punctuality, and the Beidou GPS is used to correct the error of the RTC clock.
[0020] As a further solution of the present invention, in the data storage module, the data storage initialization process includes the following steps:
[0021] Step 1: System initialization, RTC initialization, SD initialization;
[0022] Step 2: Read CMD0 to CMD3;
[0023] Step 3: Communication initialization: When CDM0~CMD3 are read successfully, the system initializes communication;
[0024] Step 4: Directory validity check: Perform directory validity check. If the device is empty, it will enter the setup mode and wait for the PC software to set up the device, including the device type, encoding and encryption group settings. The device determines the objects that can be detected and performs the corresponding detection procedures.
[0025] Step 5: Read CMD4 to CMD6 parameters: After the directory is read and it is valid, read CMD4 to CMD6 parameters, enter the detection mode according to the format of the directory, file and information, and wait for data detection and storage.
[0026] Compared with the existing technology, the technical effect of the equipment integrated bus data acquisition system for data security storage proposed by the present invention is as follows: the present invention effectively improves the security and reliability of data acquisition and storage by adopting an improved technology combining a linear congruential generator with an environmental thermal noise entropy source generator. The chassis sensor module and the equipment upper body sensor module realize efficient acquisition of multi-source data through the CAN bus interface. The data acquisition module performs real-time analysis and preprocessing on the data to ensure the timeliness and accuracy of the data. The entropy source generator in the data storage module utilizes the randomness of the environmental thermal noise signal to generate high-quality seeds through quantization processing and entropy value analysis, further optimizes the pseudo-random number generation process of the linear congruential generator, and combines SHA-256 hash processing and AES encryption algorithm to generate high-quality encryption keys, encrypt and store the collected information data, ensure the confidentiality and integrity of the data, significantly improve the quality of random number seeds, enhance the security and anti-attack ability of data storage, and provide solid data support and guarantee for the performance optimization and real-time monitoring of the two types of engineering equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a system block diagram of the system proposed in the present invention;
[0028] Figure 2 This is a power circuit diagram of the system proposed in the present invention;
[0029] Figure 3 This is the power supply circuit diagram of the 12V to 5V power supply module of the system proposed in the present invention;
[0030] Figure 4 This is the circuit diagram of the 5V to 3.3V power supply module of the system proposed in the present invention;
[0031] Figure 5 This is a specific pin structure diagram of the IP2 power indicator light module of the system proposed in the present invention;
[0032] Figure 6 This is a functional diagram of the main chip pins where the MUC circuit of the system proposed in the present invention is located;
[0033] Figure 7 This is the pin definition diagram of the RTC real-time clock module of the system proposed by the present invention;
[0034] Figure 8 The RTC program code of the system proposed by the present invention;
[0035] Figure 9 This is the pin definition diagram of the GPS positioning chip of the system proposed by the present invention;
[0036] Figure 10 The GPS program code of the system proposed by the present invention;
[0037] Figure 11 This is the CAN chip circuit diagram of the system proposed in the present invention;
[0038] Figure 12 This is the circuit diagram of the SPI interface driving the MCP2515 chip of the system proposed in the present invention;
[0039] Figure 13 This is the circuit diagram of the CAN module of the system proposed in the present invention;
[0040] Figure 14 This is the circuit diagram of the RSM232 series isolated transceiver of the system proposed in the present invention;
[0041] Figure 15 This is the pin definition diagram of the network communication chip of the system proposed by the present invention;
[0042] Figure 16 This is the pin definition diagram of the SD storage chip of the system proposed by the present invention;
[0043] Figure 17 This is the I2C bus start / stop signal function code of the system proposed by the present invention. DETAILED DESCRIPTION
[0044] The following is a clear and complete description of the technical solutions of the present invention, in conjunction with the accompanying drawings. Obviously, the technical solutions described are only part of the present invention. All other technical solutions derived by persons of ordinary skill in the art based on the technical solutions of the present invention without inventive effort fall within the scope of protection of the present invention.
[0045] like Figure 1As shown, the equipment integrated bus data acquisition system for data security storage proposed by the present invention includes a data layer and an acquisition layer. The data layer includes a chassis sensor module for acquiring equipment chassis data in real time and an equipment upper body sensor module for acquiring equipment upper body data. The acquired data is transmitted to the acquisition layer through the CAN bus interface. The acquisition layer is a data recorder, including a data acquisition module and a data storage module. The data storage module is provided with a linear congruential generator, the linear congruential generator is connected to an entropy source generator, the entropy source generator is connected to a thermal noise sensor for acquiring environmental thermal noise, the entropy source generator initializes the number of quantization levels, uses the environmental thermal noise quantization function to convert the continuous environmental thermal noise signal into a discrete value, counts the frequency of occurrence of each quantized value, converts the frequency of occurrence of each quantized value into its probability of occurrence, and then uses the environmental thermal noise signal The entropy analysis formula calculates the entropy of each quantized value, obtains the maximum entropy among all quantized value entropies, gradually increases the number of quantization levels, and calculates the corresponding maximum entropy until the value of the maximum entropy is found to reach the maximum value, outputs the number of quantization levels, updates the environmental noise quantization function, uses the updated environmental noise quantization function to convert the continuous noise signal into a discrete value, obtains the collected environmental thermal noise samples, combines the environmental thermal noise samples, generates an initial seed, and transmits the generated initial seed to the linear congruential generator. The linear congruential generator is initialized with the initial seed, generates a pseudo-random number based on the linear congruential method, and then uses SHA-256 to hash the pseudo-random number generated by the linear congruential method to generate a hash value. A part of the hash value is used as the encryption key of the AED encryption algorithm, and the collected information data is encrypted with AES to generate a ciphertext.
[0046] The present invention effectively improves the security and reliability of data acquisition and storage by adopting an improved technology that combines a linear congruential generator with an environmental thermal noise entropy source generator. The chassis sensor module and the equipment upper body sensor module realize efficient acquisition of multi-source data through the CAN bus interface. The data acquisition module performs real-time analysis and preprocessing on the data to ensure the timeliness and accuracy of the data. The entropy source generator in the data storage module utilizes the randomness of the environmental thermal noise signal to generate high-quality seeds through quantization processing and entropy value analysis. The pseudo-random number generation process of the linear congruential generator is further optimized. Combined with SHA-256 hash processing and AES encryption algorithm, it can generate high-quality encryption keys, encrypt and store the collected information data, ensure the confidentiality and integrity of the data, significantly improve the quality of random number seeds, enhance the security and anti-attack capability of data storage, and provide solid data support and guarantee for the performance optimization and real-time monitoring of the two types of engineering equipment.
[0047] During operations, the data layer can automatically collect relevant equipment bus data such as chassis speed, motorcycle hours, vehicle speed, mileage, oil temperature, engine parameters, and superstructure operating status (front boom data, rear swing frame data, ignition circuit data), system diagnostic information, driver control box, and various sensors through the CAN bus interface of two types of engineering equipment. The collected equipment chassis and superstructure bus signals are analyzed to obtain the equipment's various operating status and system fault information corresponding to the bus signals, providing a basis for subsequent signal display and measurement. Combined with the results of bus data analysis, the equipment's operating status information can be dynamically displayed on the collection device, as well as basic data for measuring equipment operating efficiency, such as erection time, withdrawal time, march release time, mechanical mine clearance time, and the number of deployed markers.
[0048] In the system proposed by the present invention, its hardware circuit includes a power supply circuit, an MCU circuit, a CAN communication circuit, a network communication circuit, and an SD storage circuit. The power supply circuit is composed of a (light-emitting) diode, an (electrolytic) capacitor, an inductor, and a current-limiting resistor. The inductor is 33μH, the electrolytic capacitor is 220μF / 50V, and the capacitor is 4.7μF / 50V. The 10K current-limiting resistor is connected in series with the light-emitting diode LED1. After power is applied, the LED lights up as a power indicator. The circuit diagram is as follows Figure 2 As shown: D18 (SS510) - Schottky diode, used to prevent reverse current and protect the circuit from damage caused by reverse power connection; F5 (2A / 30V) - fuse, used to protect the circuit from damage caused by excessive current. If the current exceeds 2A, the fuse will melt and cut off the circuit; L1 (33μH) - inductor, used to store energy and reduce voltage fluctuations; C2, C7, C8 (4.7μF / 50V and 22μF / 50V) - these capacitors are used to filter out noise from the input and output voltages and ensure a stable output voltage; D1 (SMBJ36CA) - bidirectional clamping transient voltage suppressor diode (TVS diode), used to protect the circuit from the impact of high-energy transient voltage; R10 (10kΩ) - resistor, used to set the reference voltage and limit the current in the circuit; LED1 - light-emitting diode, used to indicate the power status or fault indication. Figure 2 The circuit shown in the figure converts unstable or variable-voltage input voltages into a more stable +12V output. It integrates multiple protection features (such as overcurrent protection, reverse voltage protection, and transient overvoltage protection) to ensure safe and stable operation of the circuit. LED indicators provide intuitive operating status feedback, enhancing the user interface.
[0049] The 12V to 5V power supply module URB2405YMD-10WR3 has input undervoltage protection, output short circuit, overcurrent, and overvoltage protection functions. It is a single-channel pin mode. The module includes an electrolytic capacitor, a resistor, and a light-emitting diode. The circuit diagram is as follows Figure 3 The 5V to 3.3V power supply module AMS1117-3V3 can provide a stable 3.3V DC power supply. It adopts a single-channel pin mode. The module is mainly composed of electrolytic capacitors. The circuit diagram is as shown below. Figure 4 The IP2 power indicator module leads to 7 pins, including 12V power indicator positive, 12V power indicator negative, charging indicator positive 5V, power indicator green, charging indicator red, battery voltage 0-3V, battery current 0-3V, the specific pin structure is as follows Figure 5 shown.
[0050] The MCU circuit is the circuit of the main chip. The main chip STM32F407VET6 is the core component of the entire computer system and is responsible for the execution and control of all instructions. It can perform mathematical and logical operations through the built-in arithmetic logic unit, and process various data, signals, and input and output. The main control chip can also be responsible for memory access and data transmission, as well as coordinating communication between various hardware parts. The core is an ARM32-bit Cortex-M4 CPU with FPU and an adaptive real-time accelerator. Other functions include: clock, reset and power management, 3×12-bit, 2.4MSPS A / D converters and 2×12-bit D / A converters, with serial wire debugging (SWD) and JTAG interfaces, up to 140 I / O ports with interrupt functions, 15 communication interfaces: 3 I 2 C interface, 4 USART / 2 UART, 3 SPI interfaces, 2×CAN interfaces, SDIO interface, one USB OTG full speed and one high-speed USB OTG with full speed function. The main chip pin functions are as follows: Figure 6 As shown. The RTC real-time clock module mainly provides a time reference for various electronic systems. The SD2068 used in this system is a real-time clock chip with a standard IIC interface. The CPU uses this interface to read and write data in the 32-byte registers on the chip (including time registers, alarm registers, control registers, and general SRAM registers) through 5-bit addressing. The specific pin definitions are as follows Figure 7As shown. Among them, pin 1OSCIN and pin 2OSCOUT are the input and output pins of the crystal oscillator, with a voltage range of 0~1.5V; VBAT is the backup power input pin. When the VDD power supply fails, VBAT provides power to the IC. A diode is required in series to increase the voltage difference; VDD and GND are positive and negative power supplies; SCL serial clock input pin, CMOS input, is disabled when the backup power supply of the VBAT pin is activated; INT alarm interrupt output pin, its working mode is set according to the control register, and it can be disabled by rewriting the control register. The RTC program code includes I2C delay function, I2C bus start / stop signal function, and ACK signal sending function. The specific code is as follows Figure 8As shown. CPU clock and I2C rate explanation: When the CPU main frequency is 168MHz, the MDK I2C library functions used do not precisely control the I2C communication speed, so software delays are required to ensure correct timing. The corresponding SCL high-level durations of 0.5us, 0.9us, and 2.2us for different SCL frequencies (such as 1.78MHz, 1.1MHz, and 440kHz) illustrate the need for more precise delay control at higher speeds. Delay function implementation purpose: This function implements a delay by executing 100 no-ops. Depending on the CPU execution speed and compiler optimization settings, the resulting delay can range from a few microseconds to tens of microseconds. Timing control is crucial in I2C communication, especially at high speeds. Due to hardware and environmental variations, fine-tuning of timing is necessary to ensure stable and reliable communication. This function allows developers to flexibly adjust timing through software without changing hardware settings. Using delay functions like these can help resolve issues caused by I2C communication speed mismatches or faster CPU processing speeds, such as data misalignment and communication errors. In actual applications, developers will need to adjust the number of loops to achieve optimal communication performance based on the actual CPU speed and timing requirements of the I2C device. Figure 17 shows the I2C bus start / stop signal function code. This code contains two functions, SD2068_I2C_Start and SD2068_I2C_Stop, which control the start and stop signals of the I2C bus. These are fundamental components of the I2C communication protocol, used to mark the beginning and end of a communication session. Each function manipulates the SCL (clock line) and SDA (data line) on the I2C bus by calling lower-level functions. The SD2068_I2C_Start function is used to generate the "start" signal for I2C communication. According to the I2C protocol, a start signal is when the data line SDA transitions from high to low while the clock line SCL is high. This signal tells the I2C device that a transmission session is beginning. The SD2068_I2C_Stop function is used to generate the "stop" signal for I2C communication. According to the I2C protocol, a stop signal is when the data line SDA transitions from low to high while the clock line SCL is high. This signal tells the I2C device that a transmission session has ended.
[0051] CAN directly uses the CAN controller integrated in the main chip, with a total of 2 CAN communications. The chip uses the CTM1051M ultra-small high-speed CAN isolation transceiver, with pins 6 and 7 as CANL and CANH pins. The specific circuit diagram is as follows Figure 11As shown. The CAN1 and CAN2 program code files include mode configuration, FF0_Filter_Init initialization function, CANGPIO port configuration, and CAN sending and receiving data. The specific code is as follows Figure 12 As shown, the baud rate configuration of the CAN bus has a significant impact on the communication efficiency and reliability of the network. Choosing the appropriate baud rate can reduce error rates and adapt to the processing capabilities and distances of different devices on the network. By parameterizing the baud rate, the code provides flexibility, allowing the same code to be used in different application scenarios. Simply modifying the baud rate parameters can adapt to different network requirements. Correctly configuring the time period and prescaler value is key to ensuring stable operation of the CAN network and facilitates compatibility with devices from different manufacturers on the network. The practicality of this code snippet lies in providing a basic but critical configuration for CAN communication, ensuring efficient data transmission and stable network operation. This is fundamental and essential for any embedded system that relies on the CAN bus. The main chip uses the SPI interface to drive the MCP2515 chip, a CAN expansion chip used to expand CAN 2.0 communication. This device can send and receive standard and extended data frames, as well as remote frames. The function of the CAN module is to handle the reception and transmission of all messages on the CAN bus. When sending a message, it first loads the message into the correct message buffer and control register. The sending operation can be started by setting the corresponding bit in the control register through the SPI interface or using the transmit enable pin. The communication status and errors can be checked by reading the corresponding register. Any message detected on the CAN bus will be error checked and then matched with the user-defined filter to determine whether to move the message to one of the two receive buffers. Pin 1 TXCAN and pin 2 RXCAN are the transmit output and input pins connected to the CAN bus. The circuit structure is as follows Figure 13 The RSM232 series isolated transceiver can be directly embedded in the circuit board and communicate with the computer through the RS-232 serial line. Pins 6 and 7 are the RS-232 receiver input pin and driver output pin respectively. The main chip integrates a UART controller and uses RSM232 for isolation to perform data transparent transmission or reception. The circuit diagram is shown in the figure. Figure 14 shown.
[0052] Network communication uses W5500, a cost-effective Ethernet chip. Its globally unique patented full-hardware TCPIP protocol stack technology solves the access problem of embedded Ethernet. It is simple, easy to use, safe and stable. Chip pins 1TXP and 2TXP are TXN / TXP signal pairs for differential signal transmission, pins 5 and 6 are RXP / RXN signal pairs for differential signal reception; pin 30XI / CLKIN is external clock input crystal oscillator, pin 31XO is external clock input crystal oscillator output, and the definitions of the remaining pins are as follows Figure 15 shown.
[0053] It should be noted that, in the entropy source generator, the value of the number of initial quantization levels is set to 128.
[0054] In the testing of engineering equipment with bridge-laying and mobile minesweeping capabilities, data collection and storage security are crucial. To improve the security and reliability of data storage, the present invention proposes an improved entropy source generator that generates high-quality random number seeds by quantizing ambient thermal noise. Ambient thermal noise is a random and unpredictable natural phenomenon. Using it as an entropy source can effectively improve the security of pseudo-random number generators. Ambient thermal noise signals are highly random and exhibit nonlinear variations. Simple linear quantization methods have difficulty capturing these variations, resulting in uneven distribution of the quantized signal and reduced entropy.
[0055] As a further solution of the present invention, in the entropy source generator, the ambient thermal noise quantization function processes the nonlinear change of the signal based on the logarithmic signal difference formula by the maximum and minimum values of the collected ambient noise signal to obtain the logarithmic signal difference, and then multiplies the logarithmic signal difference by the number of quantization levels minus one and rounds down to obtain the discrete value of the quantized ambient thermal noise. The formula of the ambient thermal noise quantization function is:
[0056]
[0057] Where: X is the continuous ambient thermal noise signal collected by the ambient thermal noise sensor, Q(X) is the discrete value of the ambient thermal noise after quantization, ΔX d is the logarithmic signal difference of the continuous ambient thermal noise signal, obtained by the logarithmic signal difference formula, m is the number of quantization levels, The floor operator.
[0058] It should be noted that in the entropy source generator, the logarithmic signal difference formula in the ambient thermal noise quantization function formula is:
[0059]
[0060] Where: X min 、X max are the minimum and maximum values in the ambient thermal noise signal, respectively.
[0061] By introducing the logarithmic signal difference formula, the nonlinear variations of the signal can be effectively handled, improving the uniformity of the quantized signal distribution. The logarithmic signal difference formula can more evenly distribute quantization levels, resulting in a wider and more uniform distribution of discrete values after quantization. This increases the signal's entropy, helps generate high-quality random numbers, and improves the security and unpredictability of the pseudo-random number generator. A high-quality random number seed is fundamental to the security of a pseudo-random number generator. By utilizing the logarithmic signal difference formula of ambient thermal noise, a seed with higher entropy can be generated, thereby enhancing the quality and security of random numbers generated by the linear congruential generator (LCG). High-quality keys generated by pseudo-random number generators are crucial for data encryption. Using ambient thermal noise as an entropy source and generating a high-entropy seed through an improved quantization function can improve the security and reliability of data storage encryption, preventing data leakage and unauthorized access.
[0062] Ensuring the security and reliability of data storage is crucial in testing engineering equipment with bridge-building and mobile minesweeping capabilities. To improve the quality of pseudo-random number generation, a high-quality seed must be used. By quantizing the ambient thermal noise signal and calculating its entropy, a high-entropy random number seed can be generated, thereby enhancing the security of data encryption. The randomness and unpredictability of the ambient thermal noise signal make it an ideal entropy source. However, directly analyzing and calculating the original signal is complex and inefficient. Therefore, quantizing the continuous ambient thermal noise signal into discrete values simplifies the processing while preserving the signal's random characteristics. Statistically analyzing the distribution of each quantized discrete value can reflect the overall characteristics of the signal. To calculate the entropy of the ambient thermal noise signal, the frequency of occurrence of each quantized discrete value must first be counted and then converted into a probability. The probability reflects the distribution of each discrete value within the overall signal. Using probabilities for entropy calculation provides a more accurate measure of the signal's randomness and complexity. By calculating the entropy of the ambient thermal noise signal, the impact of different quantization levels on the signal's randomness can be assessed. The number of quantization levels is gradually increased, and the corresponding maximum entropy value is calculated until the number of quantization levels that maximizes entropy is found. This ensures that the quantized signal has the highest randomness and unpredictability, providing a guarantee for generating high-quality random number seeds.
[0063] It should be noted that the entropy analysis formula of the ambient thermal noise signal obtains the entropy of the ambient thermal noise signal by counting the number distribution of the discrete values after quantization of each ambient thermal noise and the statistical contribution of the unoccupied state, and counting the number distribution of all the discrete values after quantization of the ambient thermal noise on each discrete value after quantization of the ambient thermal noise.
[0064] Specifically, the environmental thermal noise sensor includes a thermal noise source resistor, a noise amplifier, a filter, a digital-to-analog converter, and a signal acquisition and storage unit. The thermal noise source generates a thermal noise signal that is proportional to the resistance value and temperature. The noise amplifier amplifies the thermal noise voltage generated by the thermal noise source. The gain of the noise amplifier is set according to actual needs. The filter filters the amplified thermal noise signal to retain the target segment noise signal. The digital-to-analog converter converts the amplified and filtered analog signal into a digital signal. The resolution of the digital-to-analog converter is 12 bits and the sampling rate is 1kHz.
[0065] It should be noted that in the data storage module, after the collected plaintext data is input, it is used together with the key to generate encrypted data through the AES encryption algorithm. The key is selected from multiple key groups through the communication interface. When decrypting, the same key needs to be used for reading and encryption. The key is transmitted through the communication interface, and the encrypted data is restored to valid plaintext data using the key obtained through the communication interface through the AES decryption algorithm.
[0066] It should be noted that in the data storage module, the data storage content based on SD includes 6 layers, namely CMD0, CMD1, CMD2, CMD3, CMD4, CMD5, and CMD6. Among them, the CMD0 layer is used to store basic storage information, which is unique to the device. The CMD1 layer is used to store encryption information, which is unique to the device. The CMD2 layer is used to store device parameter settings, which is unique to the device. CMD3 is used to store global storage parameters, which is unique to the device. The CMD4 layer is used to store directory information, which includes several directories. CMD5 is used to store file information, which belongs to the setting directory and several files. CMD6 is used to store data information, which belongs to the setting file and stores data content. All storage contents use standard frame headers and frame trailers, use storage commands, and the storage length is fixed at 0xFF, a total of 512 bytes. The RTC clock is used for data storage timekeeping, and the Beidou GPS is used to correct the error of the RTC clock.
[0067] GPS positioning uses the AT6558 chip, which is a six-in-one multi-mode satellite navigation and positioning chip. It contains 32 tracking channels and can simultaneously receive GNSS signals from six satellite navigation systems, and realize joint positioning, navigation and timing. The module has the advantages of high sensitivity, low power consumption and low cost. The specific pin definitions are as follows Figure 9 As shown in the figure. Among them, pin 31PPS is connected in series with a 1K resistor to support precise second pulse output, and the rising edge of the pulse is aligned with the UTC time; pin 8nRESET is the module reset input, which is valid at low level and should be left floating when not in use; pin 9VCC_RF is the output power supply, generally 3.3V, which can power the antenna; pin 11RF_IN is the antenna signal input; TXD2 / RXD2 are auxiliary serial data output / input, which can be used for code upgrades; pin 18SDA is I 2C data interface; pin 19SCL is I 2 C clock interface; TXD1 / RXD1 are navigation data output / interactive command input (configuration command input).
[0068] The GPS program code consists of GPS_USART_Config serial port pin configuration, GPW_PWR_Init initialization function, GPS_SetPWR setting PWR function, GPS_SendByte sending single byte function and receiving data processing function GPS_GetData. The specific program code is as follows Figure 10 shown.
[0069] SD storage uses solid-state storage technology and does not contain mechanical parts, so it is shock-resistant and drop-resistant, and has a long service life. This memory is usually used to store operating systems, applications, multimedia files and other data. Users can insert it into the embedded memory card slot of a compatible device to expand the storage capacity of the device. The specific pin definition is as follows Figure 16 shown.
[0070] It should be noted that in the data storage module, the data storage initialization process includes the following steps:
[0071] Step 1: System initialization, RTC initialization, SD initialization;
[0072] Step 2: Read CMD0 to CMD3;
[0073] Step 3: Communication initialization: When CDM0~CMD3 are read successfully, the system initializes communication;
[0074] Step 4: Directory validity check: Perform directory validity check. If the device is empty, it will enter the setup mode and wait for the PC software to set up the device, including the device type, encoding and encryption group settings. The device determines the objects that can be detected and performs the corresponding detection procedures.
[0075] Step 5: Read CMD4 to CMD6 parameters: After the directory is read and it is valid, read CMD4 to CMD6 parameters, enter the detection mode according to the format of the directory, file and information, and wait for data detection and storage.
[0076] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0077] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An equipment integrated bus data acquisition system for secure data storage, comprising a data layer and an acquisition layer. The data layer comprises a chassis sensor module for acquiring real-time equipment chassis data and an equipment upper body sensor module for acquiring equipment upper body data. The acquired data is transmitted to the acquisition layer via a CAN bus interface. The acquisition layer is a data recorder, comprising a data acquisition module and a data storage module. The system is characterized in that: The data storage module is provided with a linear congruential generator, which is connected to an entropy source generator, which is connected to a thermal noise sensor for collecting environmental thermal noise. The entropy source generator initializes the number of quantization levels, uses the environmental thermal noise quantization function to convert the continuous environmental thermal noise signal into a discrete value, counts the frequency of occurrence of each quantized value, converts the frequency of occurrence of each quantized value into its probability of occurrence, and then uses the environmental thermal noise signal entropy analysis formula to calculate the entropy of each quantized value, obtains the maximum entropy among all the quantized value entropies, gradually increases the number of quantization levels, and calculates the corresponding maximum entropy until the value that makes the maximum entropy reach the maximum value is found. Output the number of quantization levels, update the environmental noise quantization function, use the updated environmental noise quantization function to convert the continuous noise signal into a discrete value, obtain the collected environmental thermal noise samples, combine the environmental thermal noise samples, generate an initial seed, and transmit the generated initial seed to the linear congruential generator. The linear congruential generator is initialized with the initial seed and generates a pseudo-random number based on the linear congruential method. SHA-256 is then used to hash the pseudo-random number generated by the linear congruential method to generate a hash value. A part of the hash value is used as the encryption key of the AED encryption algorithm to perform AES encryption on the collected information data to generate a ciphertext.
2. The equipment integrated bus data acquisition system for data security storage according to claim 1 is characterized in that: In the entropy source generator, set the value of the initial quantization level to 128.
3. The equipment integrated bus data acquisition system for data security storage according to claim 1 is characterized in that: In the entropy source generator, the ambient thermal noise quantization function processes the nonlinear changes of the signal based on the logarithmic signal difference formula by collecting the maximum and minimum values of the ambient noise signal to obtain the logarithmic signal difference. The logarithmic signal difference is then multiplied by the number of quantization levels minus one and rounded down to obtain the discrete value of the quantized ambient thermal noise. The formula of the ambient thermal noise quantization function is: Where: X is the continuous ambient thermal noise signal collected by the ambient thermal noise sensor, Q(X) is the discrete value of the ambient thermal noise after quantization, ΔX d is the logarithmic signal difference of the continuous ambient thermal noise signal, obtained by the logarithmic signal difference formula, m is the number of quantization levels, The floor operator.
4. The equipment integrated bus data acquisition system for data security storage according to claim 3 is characterized in that: In the entropy source generator, the logarithmic signal difference formula in the ambient thermal noise quantization function formula is: Where: X min 、X max are the minimum and maximum values in the ambient thermal noise signal, respectively.
5. The equipment integrated bus data acquisition system for data security storage according to claim 1 is characterized in that: The environmental thermal noise sensor includes a thermal noise source resistor, a noise amplifier, a filter, a digital-to-analog converter, and a signal acquisition and storage unit. The thermal noise source generates a thermal noise signal that is proportional to the resistance value and temperature. The noise amplifier amplifies the thermal noise voltage generated by the thermal noise source. The gain of the noise amplifier is set according to actual needs. The filter filters the amplified thermal noise signal to retain the target segment noise signal. The digital-to-analog converter converts the amplified and filtered analog signal into a digital signal. The resolution of the digital-to-analog converter is 12 bits and the sampling rate is 1kHz.
6. The equipment integrated bus data acquisition system for data security storage according to claim 1 is characterized in that: In the data storage module, after the collected plaintext data is input, it is encrypted together with the key through the AES encryption algorithm to generate encrypted data. The key is selected from multiple key groups through the communication interface. When decrypting, the same key needs to be used for reading and encryption. The key is transmitted through the communication interface. The encrypted data is restored to valid plaintext data using the key obtained through the communication interface through the AES decryption algorithm.
7. The equipment integrated bus data acquisition system for data security storage according to claim 1 is characterized in that: In the data storage module, the data storage content based on SD includes 6 layers, namely CMD0, CMD1, CMD2, CMD3, CMD4, CMD5, and CMD6. Among them, the CMD0 layer is used to store basic storage information, which is unique to the device. The CMD1 layer is used to store encryption information, which is unique to the device. The CMD2 layer is used to store device parameter settings, which is unique to the device. CMD3 is used to store global storage parameters, which is unique to the device. The CMD4 layer is used to store directory information, which includes several directories. CMD5 is used to store file information, which belongs to the setting directory and several files. CMD6 is used to store data information, which belongs to the setting file and stores data content. All storage contents use standard frame headers and frame trailers, use storage commands, and the storage length is fixed at 0xFF, a total of 512 bytes. The RTC clock is used for data storage timekeeping, and the Beidou GPS is used to correct the error of the RTC clock.
8. The equipment integrated bus data acquisition system for data security storage according to claim 1 is characterized in that: In the data storage module, the data storage initialization process includes the following steps: Step 1: System initialization, RTC initialization, SD initialization; Step 2: Read CMD0 to CMD3; Step 3: Communication initialization: When CDM0~CMD3 are read successfully, the system initializes communication; Step 4: Directory validity check: Perform directory validity check. If the device is empty, it will enter the setup mode and wait for the PC software to set up the device, including the device type, encoding and encryption group settings. The device determines the objects that can be detected and performs the corresponding detection procedures. Step 5: Read CMD4 to CMD6 parameters: After the directory is read and it is valid, read CMD4 to CMD6 parameters, enter the detection mode according to the format of the directory, file and information, and wait for data detection and storage.
Citation Information
Patent Citations
Random number generation method and chip
CN115309366A
Generation device and method of true random number, equipment and storage medium
CN116185341A