Equipment integrated bus data acquisition system for data security storage
By combining linear congruence generator and environmental thermal noise entropy source generator, high-quality random number seeds are generated, and AES encryption algorithm is used to solve the problem of insufficient security in data storage, and data acquisition is improved and storage security and reliability.
Patent Information
- Application Number
- CN202411333270.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The existing linear congruent pseudo-random number generation method has problems such as insufficient periodicity and low security in data storage, making it difficult to generate high-quality random number seeds, which affects the security and reliability of data storage.
Combining the linear congruent generator and the ambient thermal noise entropy source generator, high-quality random number seeds are generated through quantization processing and entropy value analysis, and using SHA-256 hashing and AES encryption algorithm to ensure data confidentiality and integrity sex.
It significantly improves the security and reliability of data acquisition and storage, enhances the quality of random number seeds, prevents data leakage and unauthorized access, and provides solid data support for performance optimization and real-time monitoring of engineering equipment.
Smart Images

Figure CN119249515A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of engineering equipment, and more specifically, to an equipment integrated bus data acquisition system for data security storage. Background Art
[0002] In the test of two types of engineering equipment with bridge laying and mobile minesweeping functions, the collection of data such as bridge erection time, withdrawal time, march release time, mechanical minesweeping time, and number of placement marks can dynamically display the equipment's operating status information and calculate 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 diversified 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 with better quality and improve the security and reliability of data storage has become a problem that needs to be solved at present. Summary of the invention
[0003] In order to overcome the above-mentioned defects of the prior art, the present invention provides an equipment integrated bus data acquisition system for data security storage, which improves the security and reliability of data acquisition and storage by combining a linear congruential generator and an environmental thermal noise entropy source generator. The high-quality random number seed and AES encryption algorithm are used to ensure the confidentiality and integrity of the data, and optimize the performance of engineering equipment and the calculation of operational efficiency.
[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 mount sensor module for acquisition of equipment mount 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 acquisition of environmental thermal noise. The entropy source generator initializes the number of quantization levels, uses an environmental thermal noise quantization function, converts a 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 an environmental thermal noise signal entropy analysis formula Calculate the entropy of each quantized value, obtain the maximum entropy among all the quantized value entropies, gradually increase the number of quantized 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 quantized 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, 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, use a part of the hash value as the encryption key of the AED encryption algorithm, perform AES encryption on the collected information data, and generate a ciphertext.
[0006] When operating, the data layer can automatically collect equipment chassis speed, motorcycle hours, vehicle speed, mileage, oil temperature, engine parameters, etc., as well as upper-mounted operation status (front cantilever data, rear swing frame data, ignition circuit data), system diagnostic information, driver control box and various sensors and other related equipment bus data through the CAN bus interface of two types of engineering equipment. The collected equipment chassis and upper-mounted bus signals are analyzed to obtain the various equipment operation status and system fault information corresponding to the bus signal, providing a basis for subsequent signal display and measurement. Combined with the results of bus data analysis, the equipment operation status information can be dynamically displayed on the acquisition device, as well as the basic data for measuring the equipment operation efficiency, such as erection time, withdrawal time, marching fixed time, mechanical minesweeping time, and the number of drop marks.
[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 test of engineering equipment with bridge laying and mobile minesweeping functions, the security of data collection and storage is extremely important. In order to improve the security and reliability of data storage, the present invention proposes an improved entropy source generator, which generates high-quality random number seeds by quantizing the environmental thermal noise. Environmental thermal noise is a random and unpredictable natural phenomenon. Using it as an entropy source can effectively improve the security of the pseudo-random number generator. Environmental thermal noise signals have a high degree of randomness and nonlinear changes. Simple linear quantization methods are difficult to capture these changes, which will cause uneven distribution of quantized signals and reduce entropy values.
[0009] As a further solution of the present invention, in the entropy source generator, the environmental thermal noise quantization function processes the nonlinear change of the signal based on the logarithmic signal difference formula through the maximum and minimum values in the collected environmental noise signal, obtains 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 environmental thermal noise after quantization. The formula of the environmental 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 changes of the signal can be effectively processed and the uniformity of the signal distribution after quantization can be improved. The logarithmic signal difference formula can distribute the quantization level more evenly, making the discrete value distribution after quantization wider and more uniform, increasing the entropy value of the signal, and helping to generate high-quality random numbers, thereby improving the security and unpredictability of the pseudo-random number generator. High-quality random number seeds are the basis of the security of pseudo-random number generators. By using the logarithmic signal difference formula of environmental thermal noise, seeds with higher entropy values 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 essential for data encryption. Using environmental thermal noise as an entropy source and generating seeds with high entropy values through an improved quantization function can improve the security and reliability of data storage encryption and prevent data leakage and unauthorized access.
[0016] In the test of engineering equipment with bridge laying and mobile mine sweeping functions, it is crucial to ensure the security and reliability of data storage. In order to improve the quality of pseudo-random number generation, high-quality seeds must be used. By quantizing the environmental thermal noise signal and calculating its entropy, a random number seed with a high entropy value can be generated, thereby enhancing the security of data encryption. The randomness and unpredictability of the environmental thermal noise signal make it an ideal entropy source. However, it is complicated and inefficient to directly use the original signal for analysis and calculation. Therefore, by quantizing the continuous environmental thermal noise signal into discrete values, the processing process can be simplified while retaining the random characteristics of the signal. Statistical distribution of the number of discrete values after each quantization can reflect the overall characteristics of the signal. In order to calculate the entropy of the environmental thermal noise signal, it is first necessary to count the frequency of occurrence of each quantized discrete value and then convert it into probability. The probability reflects the distribution of each discrete value in the overall signal. Using probability for entropy calculation can more accurately measure the randomness and complexity of the signal. By calculating the entropy value of the environmental thermal noise signal, the impact of different numbers of quantization levels on the randomness of the signal can be evaluated. The number of quantization levels is gradually increased and the corresponding maximum entropy value is calculated until the number of quantization levels that results in the maximum 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 entropy analysis formula of the environmental thermal noise signal is obtained by counting the number distribution of the discrete values after quantization of each environmental thermal noise and the statistical contribution of the unoccupied state, and counting the number distribution of all the discrete values after quantization of the environmental thermal noise on each discrete value after quantization of the environmental thermal noise, and the entropy formula of the environmental thermal noise signal is:
[0018] S=-k B ∑ i [p i lni -(1+p i )ln p i ]
[0019] Where: S is the environmental thermal noise signal entropy, k B is the Boltzmann constant, i is the index of the discrete value of the ambient thermal noise signal, and p i is the probability of discrete values of the environmental thermal noise signal, where f i is the frequency of occurrence of the i-th discrete value of the ambient thermal noise signal, and N is the total number of discrete values of the ambient thermal noise signal.
[0020] 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 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.
[0021] As a further solution of the present invention, in the environmental thermal noise sensor, the thermal noise voltage generated by the thermal noise source is:
[0022]
[0023] Where: V rms is the thermal noise voltage, T is the absolute temperature of the thermal resistor in Kelvin, R is the resistance value of the thermal noise source, and Δf is the bandwidth, which is set manually.
[0024] As a further solution of the present invention, in the data storage module, after the collected plaintext data is input, encrypted data is generated through the AES encryption algorithm together with the key. 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 through the AES decryption algorithm using the key obtained through the communication interface.
[0025] 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 includes a setting directory, and several files; CMD6 is used to store data information, which includes a 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 to 0xFF, a total of 512 bytes; the data storage punctuality uses the RTC clock, and the Beidou GPS is used to perform timing and error correction on the RTC clock.
[0026] As a further solution of the present invention, in the data storage module, the data storage initialization process includes the following steps:
[0027] Step 1: System initialization, RTC initialization, SD initialization;
[0028] Step 2, read CMD0~CMD3;
[0029] Step 3, communication initialization: When CDM0~CMD3 are read successfully, the system initializes communication;
[0030] Step 4, directory validity test: perform directory validity test. If the device is empty, it will enter the setting mode and wait for the PC software to set up, including equipment type, encoding and encryption group settings. The device determines the objects that can be detected and performs the corresponding detection procedures.
[0031] Step 5, read CMD4~CMD6 parameters: After the directory is read and it is valid, read CMD4~CMD6 parameters, enter the detection mode according to the format of directory, file and information, and wait for data detection and storage.
[0032] Compared with the prior art, the technical effect of the equipment integrated bus data acquisition system for data security storage proposed in 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 of 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 of data storage, and provide solid data support and guarantee for performance optimization and real-time monitoring of two types of engineering equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a system block diagram of the system proposed by the present invention;
[0034] Figure 2 It is a power circuit diagram of the system proposed by the present invention;
[0035] Figure 3 This is a power supply circuit diagram of a 12V to 5V power supply module of the system proposed in the present invention;
[0036] Figure 4 This is a circuit diagram of a 5V to 3.3V power supply module of the system proposed in the present invention;
[0037] Figure 5 This is a specific pin structure diagram of the IP2 power indicator light module of the system proposed by the present invention;
[0038] Figure 6 This is a function diagram of the main chip pins where the MUC circuit of the system proposed by the present invention is located;
[0039] Figure 7 This is the pin definition diagram of the RTC real-time clock module of the system proposed by the present invention;
[0040] Figure 8 The RTC program code of the system proposed by the present invention;
[0041] Fig. 9 This is the pin definition diagram of the GPS positioning chip of the system proposed by the present invention;
[0042] Fig.10 The GPS program code of the system proposed by the present invention;
[0043] Fig.11 The CAN chip circuit diagram of the system proposed by the present invention;
[0044] Fig.12 The SPI interface of the system proposed in the present invention drives the MCP2515 chip circuit diagram;
[0045] Fig.13 It is the circuit diagram of the CAN module of the system proposed by the present invention;
[0046] Fig.14 The circuit diagram of the RSM232 series isolation transceiver of the system proposed by the present invention;
[0047] Fig.15 This is a pin definition diagram of the network communication chip of the system proposed by the present invention;
[0048] Fig.16 This is the pin definition diagram of the SD storage chip of the system proposed by the present invention;
[0049] Fig.17 This is the I2C bus start / stop signal function code of the system proposed by the present invention. DETAILED DESCRIPTION
[0050] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the present invention. Obviously, the described technical solution is only a part of the present invention. Based on the technical solution of the present invention, all other technical solutions obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention.
[0051] 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 real-time acquisition of 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 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 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 occurrence probability, 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 the 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, uses a part of the hash value as the encryption key of the AED encryption algorithm, and performs AES encryption on the collected information data to generate a ciphertext.
[0052] The 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 a 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, combines SHA-256 hash processing and AES encryption algorithm, 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 of data storage, and provide solid data support and guarantee for the performance optimization and real-time monitoring of two types of engineering equipment.
[0053] When operating, the data layer can automatically collect equipment chassis speed, motorcycle hours, vehicle speed, mileage, oil temperature, engine parameters, etc., as well as upper-mounted operation status (front cantilever data, rear swing frame data, ignition circuit data), system diagnostic information, driver control box and various sensors and other related equipment bus data through the CAN bus interface of two types of engineering equipment. The collected equipment chassis and upper-mounted bus signals are analyzed to obtain the various equipment operation status and system fault information corresponding to the bus signal, providing a basis for subsequent signal display and measurement. Combined with the results of bus data analysis, the equipment operation status information can be dynamically displayed on the acquisition device, as well as the basic data for measuring the equipment operation efficiency, such as erection time, withdrawal time, marching fixed time, mechanical minesweeping time, and the number of drop marks.
[0054] In the system proposed by the present invention, its hardware circuit includes power supply circuit, MCU circuit, CAN communication circuit, network communication circuit and SD storage circuit, wherein the power supply circuit is composed of (light-emitting) diode, (electrolytic) capacitor, inductor and current limiting resistor. The inductor is 33μH, the electrolytic capacitor is 220μF / 50V, the capacitor is 4.7μF / 50V, and the 10K current limiting resistor is connected in series with the light-emitting diode LED1. After power is on, 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 connection of power supply; F5 (2A / 30V) - fuse, used to protect the circuit from damage caused by excessive current. If the current exceeds 2A, the fuse will blow 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 input and output voltages to ensure a stable output voltage; D1 (SMBJ36CA) - bidirectional clamping transient voltage suppression 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 is used to convert unstable or different voltage level input voltage into a more stable +12V output. It integrates multiple protection functions (such as over-current protection, reverse voltage protection and transient over-voltage protection) to ensure the safe and stable operation of the circuit. The LED indicator provides intuitive working status feedback and enhances the friendliness of the user interface.
[0055] The 12V to 5V power 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 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 follows Figure 4 The IP2 power indicator module leads to 7 pins, including 12V power indicator positive pole, 12V power indicator negative pole, charging indicator positive pole 5V, power indicator green, charging indicator red, battery voltage 0-3V, battery current 0-3V, and the specific pin structure is as follows: Figure 5 shown.
[0056] 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 communications 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, and 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 the data of the 32-byte registers in 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, and the voltage range is 0~1.5V; VBAT is the backup power input pin. When the VDD power supply fails, VBAT provides power for 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, when the backup power supply of the VBAT pin is activated, this pin is disabled; 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 description: When the CPU main frequency is 168MHz, the MDK I2C library function used will not accurately control the I2C communication speed, so it is necessary to add software delay to ensure the correct timing. The SCL high level duration corresponding to different SCL frequencies (such as 1.78MHz, 1.1MHz, 440KHz, etc.) (0.5us, 0.9us, 2.2us respectively) shows that more precise delay control is required at higher rates. Delay function implementation purpose: The function implements delay by executing 100 empty operations. Depending on the CPU execution speed and the compiler optimization settings, a delay of several microseconds to tens of microseconds can be generated. In I2C communication, controlling the timing is very important, especially in high-speed communication. Due to different hardware and environmental differences, the timing needs to be fine-tuned to ensure the stability and reliability of communication. This function allows developers to flexibly adjust the timing through software without changing the hardware settings. Using such a delay function can help solve problems caused by I2C communication speed mismatch or fast CPU processing speed, such as data misalignment, communication errors, etc. In practical applications, developers need to adjust the number of loops to obtain the best communication effect according to the actual CPU speed and the timing requirements of the I2C device. As shown in Figure 17, this is the I2C bus start / stop signal function code. This code contains two functions, SD2068_I2C_Start and SD2068_I2C_Stop, which are used to control the start signal and stop signal of the I2C bus. This is a basic component of the I2C communication protocol, which is used to mark the beginning and end of a communication session. Each function operates 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 clock line SCL is high and the data line SDA jumps from high to low. This signal tells the I2C device that a transmission session is starting. 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 clock line SCL is high and the data line SDA jumps from low to high. This signal tells the I2C device that a transmission session has ended.
[0057] CAN directly uses the CAN controller integrated inside 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 Fig.11The 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 Fig.12 As shown in the figure, the baud rate configuration of the CAN bus has an important impact on the communication efficiency and reliability of the network. Choosing the right baud rate can reduce the error rate and adapt to the processing power and distance of different devices on the network. By configuring the baud rate through parameters, the code provides flexibility, so that the same code can be used in different application scenarios. It only needs to modify the baud rate parameters to adapt to different network requirements. Correctly configuring the time period and pre-scaling value is the key to ensure the stable operation of the CAN network, which helps to be compatible with devices from different manufacturers in the network. The practicality of this code snippet lies in that it provides a basic but critical configuration for CAN communication, ensuring efficient data transmission and stable operation of the network, which is basic and necessary for any embedded system that relies on the CAN bus. The main chip uses the SPI interface to drive the MCP2515 chip, which is a CAN expansion chip used to expand CAN2.0 communication. The device can send and receive standard and extended data frames and 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, first load 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 send 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 1TXCAN and pin 2RXCAN are the transmit output and input pins connected to the CAN bus. The circuit structure is as follows: Fig.13 The RSM232 series isolation 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 the UART controller inside, uses RSM232 for isolation, and performs data transparent transmission or transceiver. The circuit diagram is shown in Fig.14 shown.
[0058] The network communication uses W5500, which is a cost-effective Ethernet chip. Its unique patented technology of full hardware TCPIP protocol stack solves the access problem of embedded Ethernet. It is simple, easy to use, safe and stable. The chip pins 1TXP and 2TXP are TXN / TXP signal pairs for differential signal transmission, and 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 Fig.15 shown.
[0059] It should be noted that, in the entropy source generator, the value of the number of initialization quantization levels is set to 128.
[0060] In the test of engineering equipment with bridge laying and mobile minesweeping functions, the security of data collection and storage is extremely important. In order to improve the security and reliability of data storage, the present invention proposes an improved entropy source generator, which generates high-quality random number seeds by quantizing the environmental thermal noise. Environmental thermal noise is a random and unpredictable natural phenomenon. Using it as an entropy source can effectively improve the security of the pseudo-random number generator. Environmental thermal noise signals have a high degree of randomness and nonlinear changes. Simple linear quantization methods are difficult to capture these changes, which will cause uneven distribution of quantized signals and reduce entropy values.
[0061] As a further solution of the present invention, in the entropy source generator, the environmental thermal noise quantization function processes the nonlinear change of the signal based on the logarithmic signal difference formula through the maximum and minimum values in the collected environmental noise signal, obtains 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 environmental thermal noise after quantization. The formula of the environmental thermal noise quantization function is:
[0062]
[0063] 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.
[0064] It should be noted that in the entropy source generator, the logarithmic signal difference formula in the ambient thermal noise quantization function formula is:
[0065]
[0066] Where: X min , X max are the minimum and maximum values in the ambient thermal noise signal, respectively.
[0067] By introducing the logarithmic signal difference formula, the nonlinear changes of the signal can be effectively processed and the uniformity of the signal distribution after quantization can be improved. The logarithmic signal difference formula can distribute the quantization level more evenly, making the discrete value distribution after quantization wider and more uniform, increasing the entropy value of the signal, and helping to generate high-quality random numbers, thereby improving the security and unpredictability of the pseudo-random number generator. High-quality random number seeds are the basis of the security of pseudo-random number generators. By using the logarithmic signal difference formula of environmental thermal noise, seeds with higher entropy values 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 essential for data encryption. Using environmental thermal noise as an entropy source and generating seeds with high entropy values through an improved quantization function can improve the security and reliability of data storage encryption and prevent data leakage and unauthorized access.
[0068] In the test of engineering equipment with bridge laying and mobile mine sweeping functions, it is crucial to ensure the security and reliability of data storage. In order to improve the quality of pseudo-random number generation, high-quality seeds must be used. By quantizing the environmental thermal noise signal and calculating its entropy, a random number seed with a high entropy value can be generated, thereby enhancing the security of data encryption. The randomness and unpredictability of the environmental thermal noise signal make it an ideal entropy source. However, it is complicated and inefficient to directly use the original signal for analysis and calculation. Therefore, by quantizing the continuous environmental thermal noise signal into discrete values, the processing process can be simplified while retaining the random characteristics of the signal. Statistical distribution of the number of discrete values after each quantization can reflect the overall characteristics of the signal. In order to calculate the entropy of the environmental thermal noise signal, it is first necessary to count the frequency of occurrence of each quantized discrete value and then convert it into probability. The probability reflects the distribution of each discrete value in the overall signal. Using probability for entropy calculation can more accurately measure the randomness and complexity of the signal. By calculating the entropy value of the environmental thermal noise signal, the impact of different numbers of quantization levels on the randomness of the signal can be evaluated. The number of quantization levels is gradually increased and the corresponding maximum entropy value is calculated until the number of quantization levels that results in the maximum 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.
[0069] 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. The entropy formula of the ambient thermal noise signal is:
[0070] s=-k B ∑ i [p i lni -(1+p i )ln p i ]
[0071] Where: S is the environmental thermal noise signal entropy, k B is the Boltzmann constant, i is the index of the discrete value of the ambient thermal noise signal, and p i is the probability of discrete values of the environmental thermal noise signal, where f i is the frequency of occurrence of the i-th discrete value of the ambient thermal noise signal, and N is the total number of discrete values of the ambient thermal noise signal.
[0072] 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 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 and retains 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.
[0073] It should be noted that in the environmental thermal noise sensor, the thermal noise voltage generated by the thermal noise source is:
[0074]
[0075] Where: V rms is the thermal noise voltage, T is the absolute temperature of the thermal resistor in Kelvin, R is the resistance value of the thermal noise source, and Δf is the bandwidth, which is set manually.
[0076] 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 through the AES decryption algorithm using the key obtained through the communication interface.
[0077] 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, 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 to 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 for timing.
[0078] 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: Fig. 9 As shown. Among them, pin 3 1PPS series 1K resistor supports accurate second pulse output, and the rising edge of the pulse is aligned with UTC time; pin 8nRESET is the module reset input, low level is effective, and it is 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 auxiliary serial data output / input, which can be used for code upgrade; pin 18SDA is I 2 C data interface; pin 19SCL is I 2 C clock interface; TXD1 / RXD1 are navigation data output / interactive command input (configuration command input).
[0079] 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 Fig.10 shown.
[0080] 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 Fig.16 shown.
[0081] It should be noted that in the data storage module, the data storage initialization process includes the following steps:
[0082] Step 1: System initialization, RTC initialization, SD initialization;
[0083] Step 2, read CMD0~CMD3;
[0084] Step 3, communication initialization: When CDM0~CMD3 are read successfully, the system initializes communication;
[0085] Step 4, directory validity test: perform directory validity test. If the device is empty, it will enter the setting mode and wait for the PC software to set up, including equipment type, encoding and encryption group settings. The device determines the objects that can be detected and performs the corresponding detection procedures.
[0086] Step 5, read CMD4~CMD6 parameters: After the directory is read and it is valid, read CMD4~CMD6 parameters, enter the detection mode according to the format of directory, file and information, and wait for data detection and storage.
[0087] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0088] 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 protection scope of the present invention.
Claims
1. An equipment integrated bus data acquisition system for data security storage, comprising a data layer and an acquisition layer, wherein the data layer comprises 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, and transmits the acquired data to the acquisition layer via a CAN bus interface, and the acquisition layer is a data recorder, comprising a data acquisition module and a data storage module, and is characterized in that: A linear congruential generator is provided in the data storage module, and the linear congruential generator is connected to an entropy source generator, and the entropy source generator is connected to a thermal noise sensor for collecting environmental thermal noise. The entropy source generator initializes the number of quantization levels, and uses the environmental thermal noise quantization function to convert the continuous environmental thermal noise signal into a discrete value, and counts the frequency of occurrence of each quantization value, and converts the frequency of occurrence of each quantization value into its probability of occurrence, and then uses the environmental thermal noise signal entropy analysis formula to calculate the entropy of each quantization value, and obtains the maximum entropy of all quantization 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. 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 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 by AES 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 number 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 change of the signal based on the logarithmic signal difference formula through 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 ambient thermal noise after quantization. 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 entropy analysis formula of the environmental thermal noise signal is obtained by counting the number distribution of each discrete value of the environmental thermal noise quantization and the statistical contribution of the unoccupied state, and counting the number distribution of all discrete values of the environmental thermal noise quantization on each discrete value of the environmental thermal noise quantization. The entropy formula of the environmental thermal noise signal is: S=-k B ∑ i [p i ln p i -(1+p i )ln p i ] Where: S is the environmental thermal noise signal entropy, k B is the Boltzmann constant, i is the index of the discrete value of the ambient thermal noise signal, and p i is the probability of discrete values of the environmental thermal noise signal, where f i is the frequency of occurrence of the i-th discrete value of the ambient thermal noise signal, and N is the total number of discrete values of the ambient thermal noise signal.
6. 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 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 and retains 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.
7. The equipment integrated bus data acquisition system for data security storage according to claim 5 is characterized in that: In an ambient thermal noise sensor, the thermal noise voltage generated by the thermal noise source is: Where: V rms is the thermal noise voltage, T is the absolute temperature of the thermal resistor in Kelvin, R is the resistance value of the thermal noise source, and Δf is the bandwidth, which is set manually.
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, 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. The encrypted data is restored to valid plaintext data through the AES decryption algorithm using the key obtained through the communication interface.
9. 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 CMDO, 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, 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 to OxFF, a total of 512 bytes. The data storage time uses the RTC clock, and the Beidou GPS is used to correct the error of the RTC clock.
10. The equipment integrated bus data acquisition system for data security storage according to claim 1, 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~CMD3; Step 3, communication initialization: When CDM0~CMD3 are read successfully, the system initializes communication; Step 4, directory validity test: perform directory validity test. If the device is empty, it will enter the setting mode and wait for the PC software to set up, including equipment 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~CMD6 parameters: After the directory is read and it is valid, read CMD4~CMD6 parameters, enter the detection mode according to the format of directory, file and information, and wait for data detection and storage.
Citation Information
Patent Citations
Dynamic encryption method and device for platform data
CN106941407A
Multi-entropy source true random number generator, control method, medium, equipment and terminal
CN114706556A
Random number generation method and chip
CN115309366A
Generation device and method of true random number, equipment and storage medium
CN116185341A
High-entropy random number generation method in physical unclonable function hardware
CN116527238A
