A method and system for controlling aircraft ground test mode based on stm32 chip
Through the aircraft ground test mode control method based on the STM32 chip, the integrated mode switching and data transmission functions solve the problems of poor integration and high cost in the existing technology, and achieve convenient test control and data transmission accuracy and security. .
Patent Information
- Application Number
- CN202311838062.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-12-28
AI Technical Summary
In the existing technology, mode switching and remote disconnection functions in ground test platforms in the aviation and automotive industries are completed by boards, which have poor integration, waste cabinet space, and high costs.
The aircraft ground test mode control method based on STM32 chip is adopted. The host computer sends instructions for switching test mode and injection mode. The data acquisition module analyzes and mirrors the data. The data analysis module performs data deserialization and filtering prediction to realize mode switching and data transmission. integration.
The integrated solution of the STM32 chip reduces test costs, enhances the accuracy of signal transmission, ensures the integrity and privacy of the data link, and supports data analysis in more test scenarios.
Smart Images

Figure CN117806887B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of hardware control, and in particular relates to a method and system for controlling an aircraft ground test mode based on an STM32 chip. Background Art
[0002] The STM32 chip is a widely used microcontroller with a variety of features, including low power consumption, high performance, easy programming, and a wide range of applications, which make it an ideal choice for many devices.
[0003] In ground test platform projects in the aviation and automotive industries, mode switching functions are often used. Currently, most mode switching and remote disconnection functions are completed using boards, which have poor integration, waste cabinet space and are costly. Summary of the invention
[0004] In order to solve the above problems existing in the prior art, in a first aspect, the present invention provides an aircraft ground test mode control method based on an STM32 chip, comprising the following steps:
[0005] S1: The host computer sends a test mode switching instruction to the system control module, and the system control module calls the data acquisition module to obtain aircraft ground test service data according to the test mode switching instruction;
[0006] S2: the data acquisition module parses the aircraft ground test service data to obtain test service data and a test timestamp, mirrors the test service data to obtain bypass data, adds data to the bypass data and the test timestamp to obtain a bypass communication data packet, and stores the bypass communication data packet in the bypass data storage module;
[0007] S3: the host computer sends a switching injection mode instruction to the system control module, and the system control module calls the data injection module according to the switching injection mode instruction to obtain injection data and an injection timestamp associated with the injection data, performs data string addition on the injection data and the injection timestamp to obtain an injection communication data packet, and sends the injection communication data packet to the data analysis module;
[0008] S4: the data analysis module obtains the bypass communication data packet, deserializes the bypass communication data packet and the injection communication data packet to obtain the test timestamp, the injection timestamp, the bypass data and the injection data, and performs filtering and prediction on the bypass data and the injection data according to the test timestamp and the injection timestamp to obtain the synchronization timestamp, the time synchronization bypass data and the time synchronization injection data;
[0009] S5: The data analysis module performs an abnormality check according to the synchronization timestamp and the bypass data and the injected data corresponding to the synchronization timestamp. When an abnormal alarm condition is triggered, the data analysis module sends abnormal alarm information to the host computer.
[0010] Specifically, the switching test mode instruction in S1 and the switching injection mode instruction in S3 are control data packets based on the communication protocol of the stm32 chip, including: a start bit, a function code, a data bit, a check bit and an end character, wherein the function code includes a test code and a simulation code, the data bit indicates the activation state of the DPDT relay, and the check bit indicates the parity of the number of digits "1" in the control data packet.
[0011] Specifically, after receiving the control data packet, the system control module processes the control data packet according to the following steps:
[0012] S101: Check whether the start bit and end bit of the control data packet are set values;
[0013] S102: Check whether the parity of the check bit is consistent with the number of digits "1" in the control data packet. When the check fails, reacquire the control data packet and send a data abnormality signal to the host computer. When the check passes, execute S103 and S104;
[0014] S103: Obtain a function code in the control data packet, and send a level signal to an I / O pin of the stm32 chip according to the function code;
[0015] S104: The Darlington transistor amplifies the level signal to obtain an amplified signal, and the DPDT relay performs a corresponding calling operation according to the amplified signal.
[0016] Specifically, the specific implementation method of the mirror replication in S2 includes:
[0017] S201: The data acquisition module parses the aircraft ground test service data to obtain the test service data and the test timestamp;
[0018] S202: Acquire the serial key of the data acquisition module and the bypass data storage module, the serial key includes N data bits, N is an integer multiple of 4, according to the serial key N / 4 data bits and the serial key N / 4 data bits calculate the first initial value of the mirror and mirror the second initial value , according to the serial key intermediate N / 2 data bits to calculate the first initialization parameter of the image And the second initialization parameter of the image ;
[0019] S203: Calculate the mirror initial value according to the mirror first initial value and the mirror second initial value, and the calculation formula is: , x 0 represents the initial value of the image, and the [mod] operation represents the remainder after the value before mod is divided by the value after mod. The initial value of the image parameter is calculated according to the first initialization parameter of the image and the second initialization parameter of the image, and the calculation formula is: , p 0 represents the initial value of the image, where α and β is the set modulo constant;
[0020] S204: Iteratively calculate the mirror initial value and the mirror parameter initial value according to the amount of the bypass data to obtain a pseudo-random sequence;
[0021] S205: performing permutation calculation on the pseudo-random sequence and the bypass data to obtain mirror data, and copying the mirror data to obtain the bypass data.
[0022] Specifically, the specific method of filtering prediction in S4 includes:
[0023] S401: Acquire the bypass data, the injection data, the test timestamp and the injection timestamp;
[0024] S402: Calculate the bypass data and the injected data t The error matrix at time ,in, , represent the error matrices of the bypass data and the injected data respectively, F t represents the state transition matrix of the system, Q To test the system noise of the system;
[0025] S403: Calculate correction matrices for the bypass data and the injected data respectively according to the error matrix ,in and are the correction matrices for the bypass data and the injected data respectively, H t is the observation matrix, R To measure noise;
[0026] S404: Setting an alignment timestamp, and filtering and predicting the bypass data and the injected data according to the correction matrix and the alignment timestamp to obtain the time-synchronized bypass data and the time-synchronized injected data.
[0027] In a second aspect, the present invention also provides an aircraft ground test mode control system based on an stm32 chip, which is operated using the method described above, including: a host computer, a system control module, a data acquisition module, a bypass data storage module, a data injection module and a data analysis module.
[0028] The host computer is used to send the switching test mode instruction and the switching injection mode instruction to the system control module, and receive the abnormal alarm information of the data analysis module;
[0029] The system control module is used to receive the switching test mode instruction and the switching injection mode instruction sent by the host computer, and send a call signal to the data acquisition module and the data injection module;
[0030] The data acquisition module is used to parse the aircraft ground test service data to obtain test service data and a test timestamp, mirror the test service data to obtain bypass data, and string the bypass data and the test timestamp to obtain a bypass communication data packet;
[0031] The bypass data storage module is used to store the bypass communication data packet;
[0032] The data injection module is used to obtain the injection data and the injection timestamp associated with the injection data, perform data string addition on the injection data and the injection timestamp to obtain an injection communication data packet, and send the injection communication data packet to the data analysis module;
[0033] The data analysis module is used to obtain the bypass communication data packet, deserialize the bypass communication data packet and the injection communication data packet to obtain the test timestamp, the injection timestamp, the bypass data and the injection data, filter and predict the bypass data and the injection data according to the test timestamp and the injection timestamp to obtain the synchronization timestamp, time-synchronized bypass data and time-synchronized injection data, perform anomaly verification according to the synchronization timestamp and the bypass data and the injection data corresponding to the synchronization timestamp, and when an abnormal alarm condition is triggered, send abnormal alarm information to the host computer.
[0034] The beneficial effects of the present invention are:
[0035] (1) The network communication, data acquisition, data injection, mode switching and other functions are integrated through the STM32 chip, and the host computer is used for remote control, which provides convenience for aircraft ground testing and reduces the cost of testing;
[0036] (2) The data signal is amplified by Darlington transistors, and the accuracy of signal transmission is enhanced through a series of verification processes during data transmission;
[0037] (3) By mirroring the original data and encrypting the data during the mirroring process, the integrity of the original data link and the privacy of the test data are guaranteed;
[0038] (4) By synchronizing the time of bypass data and injected data, it supports joint data analysis of bypass data and injected data, which is applicable to more test scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0040] Figure 1 It is a flow chart of the aircraft ground test mode control method based on the stm32 chip of the present invention;
[0041] Figure 2 It is a structural block diagram of the aircraft ground test mode control system based on the stm32 chip of the present invention. DETAILED DESCRIPTION
[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0043] See also Figure 1 ,A flow chart of a method for controlling an aircraft ground test mode based on an stm32 chip, S1: The host computer sends a switching test mode instruction to the system control module, and the system control module calls the data acquisition module to obtain aircraft ground test service data according to the switching test mode instruction;
[0044] S2: the data acquisition module parses the aircraft ground test service data to obtain test service data and a test timestamp, mirrors the test service data to obtain bypass data, adds data to the bypass data and the test timestamp to obtain a bypass communication data packet, and stores the bypass communication data packet in the bypass data storage module;
[0045] S3: the host computer sends a switching injection mode instruction to the system control module, and the system control module calls the data injection module according to the switching injection mode instruction to obtain injection data and an injection timestamp associated with the injection data, performs data string addition on the injection data and the injection timestamp to obtain an injection communication data packet, and sends the injection communication data packet to the data analysis module;
[0046] S4: the data analysis module obtains the bypass communication data packet, deserializes the bypass communication data packet and the injection communication data packet to obtain the test timestamp, the injection timestamp, the bypass data and the injection data, and performs filtering and prediction on the bypass data and the injection data according to the test timestamp and the injection timestamp to obtain the synchronization timestamp, the time synchronization bypass data and the time synchronization injection data;
[0047] S5: The data analysis module performs an abnormality check according to the synchronization timestamp and the bypass data and the injected data corresponding to the synchronization timestamp. When an abnormal alarm condition is triggered, the data analysis module sends abnormal alarm information to the host computer.
[0048] Specifically, the switching test mode instruction in S1 and the switching injection mode instruction in S3 are control data packets based on the communication protocol of the stm32 chip, including: a start bit, a function code, a data bit, a check bit and an end character, wherein the function code includes a test code and a simulation code, the data bit indicates the activation state of the DPDT relay, and the check bit indicates the parity of the number of digits "1" in the control data packet.
[0049] Specifically, after receiving the control data packet, the system control module processes the control data packet according to the following steps:
[0050] S101: Check whether the start bit and end bit of the control data packet are set values;
[0051] S102: Check whether the parity of the check bit is consistent with the number of digits "1" in the control data packet. When the check fails, reacquire the control data packet and send a data abnormality signal to the host computer. When the check passes, execute S103 and S104;
[0052] S103: Obtain a function code in the control data packet, and send a level signal to an I / O pin of the stm32 chip according to the function code;
[0053] S104: The Darlington transistor amplifies the level signal to obtain an amplified signal, and the DPDT relay performs a corresponding calling operation according to the amplified signal.
[0054] Specifically, the specific implementation method of the mirror replication in S2 includes:
[0055] S201: The data acquisition module parses the aircraft ground test service data to obtain the test service data and the test timestamp;
[0056] S202: Obtain the serial keys of the data acquisition module and the bypass data storage module, the serial keys comprising N data bits, where N is an integer multiple of 4, calculate a mirrored first initial value and a mirrored second initial value according to the first N / 4 data bits of the serial key and the last N / 4 data bits of the serial key, and calculate a mirrored first initialization parameter and a mirrored second initialization parameter according to the middle N / 2 data bits of the serial key;
[0057] S203: Calculate the mirror initial value according to the mirror first initial value and the mirror second initial value, and the calculation formula is: , x 0 represents the initial value of the image, and the [mod] operation represents the remainder after the value before mod is divided by the value after mod. The initial value of the image parameter is calculated according to the first initialization parameter of the image and the second initialization parameter of the image, and the calculation formula is: , p 0 represents the initial value of the image, where α and β are set modulo constants;
[0058] S204: Iteratively calculate the mirror initial value and the mirror parameter initial value according to the amount of the bypass data to obtain a pseudo-random sequence;
[0059] S205: performing permutation calculation on the pseudo-random sequence and the bypass data to obtain mirror data, and copying the mirror data to obtain the bypass data.
[0060] Specifically, the specific method of filtering prediction in S4 includes:
[0061] S401: Acquire the bypass data, the injection data, the test timestamp and the injection timestamp;
[0062] S402: Calculate the error matrix between the bypass data and the injected data at time t ,in, , represent the error matrices of the bypass data and the injected data respectively, F t represents the state transfer matrix of the system, Q is the system noise of the test system;
[0063] S403: Calculate correction matrices for the bypass data and the injected data respectively according to the error matrix ,in and are the correction matrices for the bypass data and the injected data respectively, H t is the observation matrix, R is the measurement noise;
[0064] S404: Setting an alignment timestamp, and filtering and predicting the bypass data and the injected data according to the correction matrix and the alignment timestamp to obtain the time-synchronized bypass data and the time-synchronized injected data.
[0065] The aircraft ground test mode control system based on the stm32 chip in this embodiment is as follows Figure 2 As shown, it includes: a host computer, a system control module, a data acquisition module, a bypass data storage module, a data injection module and a data analysis module.
[0066] The host computer is used to send the switching test mode instruction and the switching injection mode instruction to the system control module, and receive the abnormal alarm information of the data analysis module;
[0067] The system control module is used to receive the switching test mode instruction and the switching injection mode instruction sent by the host computer, and send a call signal to the data acquisition module and the data injection module;
[0068] The data acquisition module is used to parse the aircraft ground test service data to obtain test service data and a test timestamp, mirror the test service data to obtain bypass data, and string the bypass data and the test timestamp to obtain a bypass communication data packet;
[0069] The bypass data storage module is used to store the bypass communication data packet;
[0070] The data injection module is used to obtain the injection data and the injection timestamp associated with the injection data, perform data string addition on the injection data and the injection timestamp to obtain an injection communication data packet, and send the injection communication data packet to the data analysis module;
[0071] The data analysis module is used to obtain the bypass communication data packet, deserialize the bypass communication data packet and the injection communication data packet to obtain the test timestamp, the injection timestamp, the bypass data and the injection data, filter and predict the bypass data and the injection data according to the test timestamp and the injection timestamp to obtain the synchronization timestamp, time-synchronized bypass data and time-synchronized injection data, perform anomaly verification according to the synchronization timestamp and the bypass data and the injection data corresponding to the synchronization timestamp, and when an abnormal alarm condition is triggered, send abnormal alarm information to the host computer.
[0072] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for controlling aircraft ground test mode based on stm32 chip, characterized in that: The following steps are involved: S1: The host computer sends a test mode switching instruction to the system control module, and the system control module calls the data acquisition module to obtain aircraft ground test service data according to the test mode switching instruction; S2: the data acquisition module parses the aircraft ground test service data to obtain test service data and a test timestamp, mirrors the test service data to obtain bypass data, adds data to the bypass data and the test timestamp to obtain a bypass communication data packet, and stores the bypass communication data packet in the bypass data storage module; S3: the host computer sends a switching injection mode instruction to the system control module, and the system control module calls the data injection module according to the switching injection mode instruction to obtain injection data and an injection timestamp associated with the injection data, performs data string addition on the injection data and the injection timestamp to obtain an injection communication data packet, and sends the injection communication data packet to the data analysis module; S4: the data analysis module obtains the bypass communication data packet, deserializes the bypass communication data packet and the injection communication data packet to obtain the test timestamp, the injection timestamp, the bypass data and the injection data, and performs filtering and prediction on the bypass data and the injection data according to the test timestamp and the injection timestamp to obtain the synchronization timestamp, the time synchronization bypass data and the time synchronization injection data; S5: The data analysis module performs an abnormality check according to the synchronization timestamp and the bypass data and the injected data corresponding to the synchronization timestamp. When an abnormal alarm condition is triggered, the data analysis module sends abnormal alarm information to the host computer.
2. The method according to claim 1, characterized in that The switching test mode instruction in S1 and the switching injection mode instruction in S3 are control data packets based on the communication protocol of the stm32 chip, including: a start bit, a function code, a data bit, a check bit and an end character, wherein the function code includes a test code and a simulation code, the data bit indicates the activation state of the DPDT relay, and the check bit indicates the parity of the number of digits "1" in the control data packet.
3. The method according to claim 2, characterized in that After receiving the control data packet, the system control module processes the control data packet according to the following steps: S101: Check whether the start bit and end bit of the control data packet are set values; S102: Check whether the parity of the check bit is consistent with the number of digits "1" in the control data packet. When the check fails, reacquire the control data packet and send a data abnormality signal to the host computer. When the check passes, execute S103 and S104; S103: Obtain a function code in the control data packet, and send a level signal to an I / O pin of the stm32 chip according to the function code; S104: The Darlington transistor amplifies the level signal to obtain an amplified signal, and the DPDT relay performs a corresponding calling operation according to the amplified signal.
4. The method according to claim 1, characterized in that: The specific implementation method of the mirror copy in S2 includes: S201: The data acquisition module parses the aircraft ground test service data to obtain the test service data and the test timestamp; S202: Acquire the serial key of the data acquisition module and the bypass data storage module, the serial key includes N data bits, N is an integer multiple of 4, according to the serial key N / 4 data bits and the serial key N / 4 data bits calculate the first initial value of the mirror and mirror the second initial value , according to the serial key intermediate N / 2 data bits to calculate the first initialization parameter of the image And the second initialization parameter of the image ; S203: Calculate the mirror initial value according to the mirror first initial value and the mirror second initial value, and the calculation formula is: , x 0 represents the initial value of the image, and the [mod] operation represents the remainder after the value before mod is divided by the value after mod. The initial value of the image parameter is calculated according to the first initialization parameter of the image and the second initialization parameter of the image, and the calculation formula is: , p 0 represents the initial value of the image, where α and β is the set modulo constant; S204: Iteratively calculate the mirror initial value and the mirror parameter initial value according to the amount of the bypass data to obtain a pseudo-random sequence; S205: performing permutation calculation on the pseudo-random sequence and the bypass data to obtain mirror data, and copying the mirror data to obtain the bypass data.
5. The method according to claim 1, characterized in that The specific method of filtering prediction in S4 includes: S401: Acquire the bypass data, the injection data, the test timestamp and the injection timestamp; S402: Calculate the bypass data and the injected data t The error matrix at time ,in, , represent the error matrices of the bypass data and the injected data respectively, F t represents the state transition matrix of the system, Q To test the system noise of the system; S403: Calculate correction matrices for the bypass data and the injected data respectively according to the error matrix ,in and are the correction matrices for the bypass data and the injected data respectively, H t is the observation matrix, R To measure noise; S404: Setting an alignment timestamp, and filtering and predicting the bypass data and the injected data according to the correction matrix and the alignment timestamp to obtain the time-synchronized bypass data and the time-synchronized injected data.
6. An aircraft ground test mode control system based on a stm32 chip, operated using the method described in any one of claims 1 to 5, characterized in that: It includes a host computer, a system control module, a data acquisition module, a bypass data storage module, a data injection module and a data analysis module, among which: The host computer is used to send the switching test mode instruction and the switching injection mode instruction to the system control module, and receive the abnormal alarm information of the data analysis module; The system control module is used to receive the switching test mode instruction and the switching injection mode instruction sent by the host computer, and send a call signal to the data acquisition module and the data injection module; The data acquisition module is used to parse the aircraft ground test service data to obtain test service data and a test timestamp, mirror the test service data to obtain bypass data, and string the bypass data and the test timestamp to obtain a bypass communication data packet; The bypass data storage module is used to store the bypass communication data packet; The data injection module is used to obtain the injection data and the injection timestamp associated with the injection data, perform data string addition on the injection data and the injection timestamp to obtain an injection communication data packet, and send the injection communication data packet to the data analysis module; The data analysis module is used to obtain the bypass communication data packet, deserialize the bypass communication data packet and the injection communication data packet to obtain the test timestamp, the injection timestamp, the bypass data and the injection data, filter and predict the bypass data and the injection data according to the test timestamp and the injection timestamp to obtain the synchronization timestamp, time-synchronized bypass data and time-synchronized injection data, perform anomaly verification according to the synchronization timestamp and the bypass data and the injection data corresponding to the synchronization timestamp, and send anomaly alarm information to the host computer when an abnormal alarm condition is triggered.
