A method, device, equipment and medium for injecting fault into a UAV simulation model

By introducing a fault vector table and real-time solution mechanism in the drone simulation model, the problem of insufficient universality of fault injection of drone onboard equipment in the existing technology is solved, and general fault injection of different devices is realized, design efficiency and memory utilization are improved.

CN115618587BActive Publication Date: 2025-05-16CHENGDU AIRCRAFT INDUSTRY GROUP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211219480.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2025-05-16
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

In the prior art, the failure injection of drone-borne equipment is poor in versatile, and a separate fault injection module is required.

Method used

Provide a fault injection method for the drone simulation model, which can inject fault information into the simulation model of the target device by receiving fault injection instructions, data packet grouping, parsing, real-time solution, positioning target equipment, creating fault vector tables and injecting fault information.

Benefits of technology

This improves the universality of fault injection for target equipment, avoids the need to design fault injection methods separately for each target equipment, and greatly saves the time cost and memory space of model construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115618587B_ABST
    Figure CN115618587B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for fault injection into a UAV simulation model, and relates to the technical field of fault injection into a simulation model. The method includes receiving a fault injection instruction; data packaging the fault injection instruction to obtain a fault data packet; parsing the fault data packet to obtain a fault data frame; performing real-time calculation on the fault data frame through a simulation model to match the device ID information in the fault data frame with the device ID information in the simulation model; locating the target device if the device ID information in the fault data frame matches the device ID information in the simulation model; creating an initialized fault vector table; and injecting fault information into the simulation model of the target device. The above technical solution enables different target devices to share the same simulation model, thereby greatly improving the versatility of fault injection into the target device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of simulation model fault injection, and in particular to a method, device, equipment and medium for injecting fault into a simulation model of an unmanned aerial vehicle. Background Art

[0002] Semi-physical simulation, also known as physical-mathematical simulation, hardware-in-the-loop simulation or semi-physical simulation, is a system real-time simulation method that uses simulation models to replace part of the physical objects and form a closed-loop simulation with other physical objects. It is often used to verify the correctness and feasibility of control system design and is one of the essential test verification links in the control system design process in the field of UAV design. In the process of semi-physical simulation test, it is often necessary to change the data transmitted by the simulation equipment interconnected with the control system in real time. Therefore, when designing a semi-physical simulation system, it is often necessary to design a fault injection function.

[0003] However, when fault injection is performed on drone-mounted devices in the prior art, different drone-mounted devices need to have separate fault injection modules designed, which results in poor versatility of fault injection on drone-mounted devices in the prior art. Summary of the invention

[0004] The main purpose of this application is to provide a method, device, equipment and medium for fault injection into a drone simulation model, aiming to solve the technical problem in the prior art that different drone airborne equipment requires separately designed fault injection modules, resulting in poor universality of fault injection into drone airborne equipment.

[0005] To achieve the above objectives, the first aspect of the present application provides a method for injecting faults into a UAV simulation model, the method comprising:

[0006] Receiving a fault injection instruction; wherein the fault injection instruction includes fault information;

[0007] Packaging the fault injection instruction to obtain a fault data packet;

[0008] Parsing the fault data packet to obtain the fault data frame;

[0009] Performing real-time calculation on the fault data frame through the simulation model to match the device ID information in the fault data frame with the device ID information in the simulation model;

[0010] If the device ID information in the fault data frame matches the device ID information in the simulation model, the target device is located; wherein the target device is the device to which the fault information needs to be injected;

[0011] Based on the located target device, creating an initialized fault vector table; wherein the initialized fault vector table has an initial memory space opened for the target device for storing the fault data frame and injecting the fault information;

[0012] It is determined whether the fault type information in the fault data frame is no-fault information, so as to inject fault information into the simulation model of the target device.

[0013] Optionally, the determining whether the fault type information in the fault data frame is no-fault information to inject fault information into the simulation model of the target device includes:

[0014] If the fault type information in the fault data frame is no fault information, clearing the fault information injected into the target device;

[0015] If the fault type information in the fault data frame is fault information, traverse the fault vector table to query the start bit field information in each of the fault data frames;

[0016] Based on the start bit field information in the fault data frame queried in the fault vector table, fault information is injected into the simulation model of the target device.

[0017] Optionally, injecting fault information into the simulation model of the target device based on the start bit field information in the fault data frame queried in the fault vector table includes:

[0018] If there is a fault data frame in the fault data table having the same starting bit field information as the current fault data frame, then the corresponding fault data frame in the fault data table is replaced with the current fault data frame;

[0019] If there is no fault data frame in the fault data table having the same start bit field information as the current fault data frame, then adding the current fault data frame to the fault data table;

[0020] Based on the fault data frame added to the fault data table, fault information is injected into the simulation model of the target device.

[0021] Optionally, injecting fault information into the simulation model of the target device based on the fault data frame added to the fault data table includes:

[0022] Determining whether the fault type information in the fault data frame added to the fault data table is constant fault information or deviation fault information;

[0023] If the fault type information in the fault data frame added to the fault data table is constant fault information, superimposing the original numerical value in the simulation model that has not undergone the fault information injection operation with the fault value field information in the fault data frame;

[0024] If the fault type information in the fault data frame added to the fault data table is constant fault information, the original numerical value in the simulation model that has not undergone the fault information injection operation is replaced with the fault value field information in the fault data frame.

[0025] Optionally, after the step of determining whether the fault type information in the fault data frame is no-fault information to inject fault information into the simulation model of the target device, the method further includes:

[0026] The fault information injected into the simulation model is generated to the upper computer software.

[0027] Optionally, if there is no fault data frame in the fault data table having the same start bit field information as the current fault data frame, adding the current fault data frame to the fault data table comprises:

[0028] Determining whether the fault data table is full;

[0029] If the fault data table is full, clearing the first fault data frame in the fault data table;

[0030] If the fault data table is not full, the current fault data frame is added to the fault data table.

[0031] Optionally, the step of packaging the fault injection instruction to obtain a fault data packet includes:

[0032] Based on the packetization protocol, the received fault injection instruction is packetized to obtain a fault data packet.

[0033] In a second aspect, a UAV simulation model fault injection device is provided, the device comprising:

[0034] A receiving module, configured to receive a fault injection instruction; wherein the fault injection instruction includes fault information;

[0035] A first obtaining module, used for data packetizing the fault injection instruction to obtain a fault data packet;

[0036] The second obtaining module is used to parse the fault data packet to obtain the fault data frame;

[0037] A solution module, used for performing real-time solution on the fault data frame through a simulation model to match the device ID information in the fault data frame with the device ID information in the simulation model;

[0038] A positioning module, used for locating a target device if the device ID information in the fault data frame matches the device ID information in the simulation model; wherein the target device is a device that needs to be injected with the fault information;

[0039] A creation module, used to create an initialized fault vector table based on the located target device; wherein the initialized fault vector table has an initial memory space opened up for the target device to store the fault data frame and inject the fault information;

[0040] The judgment module is used to judge whether the fault type information in the fault data frame is no-fault information, so as to inject fault information into the simulation model of the target device.

[0041] In a third aspect, the present application provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the embodiment.

[0042] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and a processor executes the computer program to implement the method described in the embodiment.

[0043] Through the above technical solution, the present application has at least the following beneficial effects:

[0044] The method, device, equipment and medium for fault injection of a drone simulation model proposed in the embodiment of the present application, the method first receives a fault injection instruction; wherein the fault injection instruction includes fault information; then the fault injection instruction is data packaged to obtain a fault data packet; then the fault data packet is parsed to obtain a fault data frame; then the fault data frame is solved in real time through the simulation model to match the device ID information in the fault data frame with the device ID information in the simulation model; then if the device ID information in the fault data frame matches the device ID information in the simulation model, the target device is located; wherein the target device is the device to be injected with the fault information; then based on the located target device, an initialized fault vector table is created; wherein the initialized fault vector table has an initial memory space opened up for the target device for storing the fault data frame and injecting the fault information; finally, it is determined whether the fault type information in the fault data frame is no fault information, so as to inject fault information into the simulation model of the target device. That is, when it is necessary to perform fault injection on the target device, firstly, the received fault injection instruction is packaged and a fault data packet is obtained, then the fault data packet is parsed to obtain a fault data frame, and then the device ID information in the fault data frame is matched with the device ID information in the simulation model. If the device ID information in the fault data frame is consistent with the device ID information in the simulation model, it means that the target device is located, and then a fault vector table that can be used to store the fault data frame after initialization is created, and finally, the fault information is injected into the simulation model of the target device by judging whether the fault type information in the fault data frame contains fault information. That is, since the initialized fault vector table is created, a relationship based on fault information is established between the fault vector table and the simulation model of the target device, so that different target devices can share the same simulation model, and the construction personnel of the simulation model no longer need to design a set of fault injection methods for each target device separately, thereby greatly improving the versatility of fault injection on the target device. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A schematic diagram of the computer device structure of the hardware operating environment involved in the embodiments of the present application;

[0046] Figure 2 This is a flow chart of a method for injecting faults into a UAV simulation model according to an embodiment of the present application;

[0047] Figure 3 A schematic diagram of a format of a fault data frame provided in an embodiment of the present application;

[0048] Figure 4Schematic diagram of a fault injection device for a drone simulation model according to an embodiment of the present application.

[0049] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0050] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] Semi-physical simulation, also known as physical-mathematical simulation, hardware-in-the-loop simulation or semi-physical simulation, is a system real-time simulation method that uses simulation models to replace part of the physical objects and form a closed-loop simulation with other physical objects. It is often used to verify the correctness and feasibility of control system design and is one of the essential test verification links in the control system design process in the field of UAV design. In the process of semi-physical simulation test, it is often necessary to change the data transmitted by the simulation equipment interconnected with the control system in real time. Therefore, when designing a semi-physical simulation system, it is often necessary to design a fault injection function.

[0052] At present, two modes are usually used when injecting faults into unmanned simulation models. One of them is to generate .out files and .M3I files through the VX_MC.tlc compilation environment, and then load the M3I file through the simulation control software SimCreator for online parameter modification. This mode requires the use of hardware and software together, and is only applicable to the scenario of fault injection for a small number of signals. It is not universal, and the fault injection in the simulation model requires the model designer to set the parameter names one by one, which will consume a lot of manual time costs. At the same time, the manual interaction interface of the host computer software can only display the Uint8 type, which is not convenient for the test personnel to observe the fault injection results in real time. The other mode uses Matlab automatic code generation, and index information needs to be manually established in the simulation model. The fault injection in the simulation model is completed by establishing independent static forms for different drone airborne equipment to store index information and fault data frame information. This method requires a complex data packaging-data unpacking-data packaging process, which not only consumes a lot of computer memory and manual time costs, but also has the problem of memory overflow when the simulation model is large in scale. Different airborne equipment needs to be designed separately for fault injection modules, which is not universal and extensible. In summary, when fault injection is currently performed on drone-mounted devices, different drone-mounted devices need to design fault injection modules separately, which results in poor versatility of fault injection on drone-mounted devices in the existing technology.

[0053] In order to solve the above technical problems, the present application provides a method, device, equipment and medium for fault injection into a drone simulation model. Before introducing the specific technical solution of the present application, the hardware operating environment involved in the implementation scheme of the present application is first introduced.

[0054] Reference Figure 1 , Figure 1 A schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application.

[0055] like Figure 1 As shown, the computer device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0056] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0057] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and an electronic program.

[0058] exist Figure 1 In the computer device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the computer device of the present invention can be set in the computer device, and the computer device calls the drone simulation model fault injection device stored in the memory 1005 through the processor 1001, and executes the drone simulation model fault injection method provided in the embodiment of the present application.

[0059] Reference Figure 2 Based on the hardware environment of the aforementioned embodiment, an embodiment of the present application provides a method for injecting faults into a UAV simulation model, the method comprising:

[0060] S10: Receive a fault injection instruction; wherein the fault injection instruction includes fault information.

[0061] In the specific implementation process, the test personnel send fault injection instructions through the host computer. The content of the fault injection instruction consists of fault information such as "device name", "fault type", and "fault value" on the human-computer interaction interface. That is, the fault injection instruction is sent by the test personnel on the human-computer interaction interface of the host computer software. Different onboard devices, different fault types, and different fault values ​​can be selected for fault injection operations.

[0062] S11: Packaging the fault injection instruction to obtain a fault data packet.

[0063] In the specific implementation process, the host computer software packages the fault injection instructions sent by the test personnel according to the package package protocol to obtain a hexadecimal fault data packet for transmission. Among them, the host computer software is a simulation management human-computer interaction software, which can be used by the test personnel to send fault injection instructions, is responsible for packaging and transmitting the fault injection instructions, and can display the model point B data and point C data in real time. Among them, the point B data refers to the original value in the simulation model without the fault injection operation, and the point C data refers to the value of the point B data in the simulation model after the fault injection operation.

[0064] S12: Parse the fault data packet to obtain a fault data frame.

[0065] In the specific implementation process, the upper computer transmits the data frame to the lower computer through the UDP protocol. The lower computer parses the fault data packet to obtain the fault data frame, that is, the fault data frame is obtained by the upper computer assembling the fault instruction. The fault data frame is Uint8 type data. Among them, the fault data frame format is as follows Figure 3 As shown, Figure 3 A schematic diagram of the format of a fault data frame provided in an embodiment of the present application, the fault data frame format consists of frame header information, device ID information, start bit information, bit length information, fault type information and fault value information, wherein the device ID information occupies 5 bytes, the fault type occupies 1 byte, the fault value is of variable length, occupies 8 bytes at most, and the remaining information occupies 2 bytes. The drone airborne device ID information refers to the numbering of different airborne devices in the simulation model, using 5 bytes of data to represent the device ID, wherein the upper four bytes represent the sending address, sending sub-address, receiving address, and receiving sub-address, and the lower one byte represents the sub-frame number.

[0066] S13: performing real-time calculation on the fault data frame through a simulation model to match the device ID information in the fault data frame with the device ID information in the simulation model.

[0067] In the specific implementation process, the simulation model is a model built in advance by conventional means. The simulation model is a simulation model of the UAV airborne system, including simulation modeling of subsystems such as servo subsystem, dynamics subsystem, sensor subsystem, and electromechanical subsystem. After receiving the fault data frame, the simulation model performs real-time calculation on it and matches the "device ID" field of the fault data frame with the device ID given in the model.

[0068] S14: If the device ID information in the fault data frame matches the device ID information in the simulation model, the target device is located; wherein the target device is the device into which the fault information needs to be injected.

[0069] In the specific implementation process, the target device is the device that needs fault injection, and the purpose of matching the device ID information in the fault data frame with the device ID information in the simulation model is to find the target device. Specifically, if the device ID information in the fault data frame is consistent with the device ID information in the simulation model, the drone airborne device that needs fault injection is located, that is, the target device is located. In this way, the target device can be found more accurately.

[0070] S15: creating an initialized fault vector table based on the located target device; wherein the initialized fault vector table has an initial memory space opened for the target device to store the fault data frame and inject the fault information.

[0071] In the specific implementation process, the fault vector table refers to a dynamic vector table implemented using a vector data structure, which can be dynamically expanded and dynamically add, delete, search and modify data. For the matched drone airborne equipment, a fault vector table is created and initialized to open up an initial memory space for storing fault data frames for fault injection for the drone airborne equipment.

[0072] S16: Determine whether the fault type information in the fault data frame is no-fault information, so as to inject fault information into the simulation model of the target device.

[0073] In the specific implementation process, the fault information injection is performed by the test personnel sending the fault injection instruction, and the simulation model can perform real-time instruction solution and fault injection operations. If the fault type information in the fault data frame is no fault information, the fault information injected into the target device is cleared. Specifically, the corresponding fault data frame in the fault vector table is queried according to the starting bit information, the fault data frame is cleared, and the memory space is released; if the fault type information in the fault data frame is fault information, the fault vector table is traversed to query the starting bit field information in each fault data frame; based on the starting bit field information in the fault data frame queried in the fault vector table, the simulation model of the target device is injected with fault information. Specifically, in order to make it easier for the computer to identify, the fault type information can be represented by 0 when there is no fault information. That is, when the fault type information is not 0, it is necessary to inject a constant type fault or a deviation type fault into the target device, and the fault vector table is traversed to query the "starting bit" field information of each data frame. If there exists a fault data frame in the fault data table that has the same starting bit field information as the current fault data frame, the corresponding fault data frame in the fault data table is replaced with the current fault data frame; if there does not exist a fault data frame in the fault data table that has the same starting bit field information as the current fault data frame, the current fault data frame is added to the fault data table.

[0074] Finally, based on the fault data frame added to the fault data table, the simulation model of the target device is injected with fault information, that is, the model value is injected with fault information according to the content of the fault data frame contained in the fault table, and each fault data frame corresponds to a fault injection operation. Specifically, it is determined whether the fault type information in the fault data frame added to the fault data table is constant fault information or deviation fault information. In order for the computer to better identify constant fault information and deviation fault information, the constant fault information is represented by 1 and the deviation fault information is represented by 2. If the fault type information in the fault data frame added to the fault data table is constant fault information, the original value in the simulation model that has not undergone the fault information injection operation is superimposed with the fault value field information in the fault data frame; if the fault type information in the fault data frame added to the fault data table is constant fault information, the original value in the simulation model that has not undergone the fault information injection operation is replaced with the fault value field information in the fault data frame. Finally, the fault injected value is sent to the cross-linked control system through the hardware interface, and is returned to the host computer software at the same time to complete the real-time fault injection of the UAV simulation model.

[0075] In summary, when it is necessary to perform fault injection on the target device, the received fault injection instruction is first packaged to obtain a fault data packet, and then the fault data packet is parsed to obtain a fault data frame, and then the device ID information in the fault data frame is matched with the device ID information in the simulation model. If the device ID information in the fault data frame is consistent with the device ID information in the simulation model, it means that the target device is located, and then a fault vector table that can be used to store the fault data frame after initialization is created, and finally, the fault information is injected into the simulation model of the target device by judging whether the fault type information in the fault data frame contains fault information. That is, since the initialized fault vector table is created, a relationship based on fault information is established between the fault vector table and the simulation model of the target device, so that different target devices can share the same simulation model, and the construction personnel of the simulation model no longer need to design a set of fault injection methods for each target device separately, thereby greatly improving the versatility of fault injection on the target device.

[0076] In order to better add the fault data frame to the fault data table, in some embodiments, the following technical solution is provided: if there is no fault data frame in the fault data table having the same starting bit field information as the current fault data frame, the step of adding the current fault data frame to the fault data table includes: determining whether the fault data table is full; if the fault data table is full, clearing the first fault data frame in the fault data table; if the fault data table is not full, adding the current fault data frame to the fault data table.

[0077] In this embodiment, before adding the fault data frame to the fault data table, it is first determined whether the fault data table is full. If the fault data table is full, the first fault data frame in the fault data table is cleared, and then the fault data frame is added to the fault data table; if the fault data table is not full, the current fault data frame is added to the fault data table. In this way, it is possible to avoid the situation where the fault data table is full and the fault data frame is continuously added to the fault data table, thereby reducing the situation where the fault data frame is lost.

[0078] In some embodiments, a dynamic vector table is used to store each fault data frame, and the specific calculation process is as follows:

[0079] S401: Setting the initial capacity of the fault vector table and the value of each memory increase when the vector table is expanded (expansion size);

[0080] S402: Declare and initialize the fault vector table, and allocate initial memory space for the fault vector table;

[0081] S403: Determine whether the “fault type” of the fault data frame is 0, if it is 0, go to step S404, otherwise go to step S408;

[0082] S404: The fault type is 0, and the injected fault needs to be cleared;

[0083] S405: traverse the fault vector table to search for fault data frames with the same starting bit;

[0084] S406: Clear the fault data frame from the fault vector table;

[0085] S407: Release the corresponding memory space;

[0086] S408: If the fault type is not 0, the current fault data frame needs to be stored in the fault vector table;

[0087] S409: traverse the fault vector table to search for fault data frames with the same starting bit;

[0088] S410: Determine whether there is a fault data frame with the same starting bit. If yes, the fault data frame needs to be updated and the process goes to step S411. Otherwise, the fault data frame is directly added and the process goes to step S413.

[0089] S411: Mark the position of the corresponding fault data frame in the fault vector table;

[0090] S412: Replace the fault data frame at the marked position in the fault vector table with the current fault data frame;

[0091] S413: writing the current fault data frame into the fault vector table;

[0092] S414: Determine whether the memory occupied by the current fault vector table is equal to the set memory capacity, if yes, go to step S415, otherwise go to step S416;

[0093] S415: The fault vector table is dynamically expanded, and the capacity is increased upward by the expansion size;

[0094] S416: adding the current fault data frame to the fault vector table;

[0095] S417: Update the fault vector table;

[0096] In this embodiment, the fault vector table is based on a vector data structure, and realizes the addition, deletion, modification, and search of data. The specific data format is shown in Table 3.

[0097] Table 3 is the data format of the fault vector table

[0098]

[0099] It contains the fault data frame obtained by parsing each fault injection instruction sent by the test personnel, and has the function of dynamic expansion; the starting bit information of the fault data frame in the fault vector table is different, which means that fault injection operations need to be performed on different fields of the data at point B of the device.

[0100] In some embodiments, the fault injection operation is classified into constant fault injection and deviation fault injection. Different fault injection types are processed in different ways. The specific steps are as follows:

[0101] S501, obtaining the initial value of the simulation model, and naming the value as point B data;

[0102] S502, obtaining a fault vector table, at which point the fault vector table has been updated and contains fault injection instruction operation information to be performed on the device;

[0103] S503, traversing the fault vector table to query the frame header information of the fault data frame, each frame header corresponds to a fault data frame, indicating that a fault injection operation needs to be performed on the data at point B;

[0104] S504, for each fault data frame, query the "starting bit" and "bit length" information of the data frame to obtain the corresponding starting bit and bit length;

[0105] S505, determining whether the bit length information is greater than 8, if so, it indicates that fault injection is performed on the content exceeding one byte, and the process goes to step S506, otherwise, the process goes to step S510;

[0106] S506, performing fault injection operations on multiple bytes respectively;

[0107] S507, determine whether the "fault type" of the fault data frame is 1, if yes, go to step S508, otherwise go to step S509;

[0108] S508, performing constant value type fault injection on the data, replacing the corresponding multiple bytes in the point B data with the contents of the "fault value" field in the fault data frame;

[0109] S509, injecting a deviation type fault into the data, adding the corresponding multiple bytes in the data at point B to the content of the "fault value" field of the fault data frame to obtain the data after the fault injection (data at point C);

[0110] S510, performing a single byte bit operation on the data at point B;

[0111] S511, determine whether the "fault type" of the fault data frame is 1, if yes, go to step S512, otherwise go to step S515;

[0112] S512, clearing the corresponding bit of the data at point B according to the start bit and bit length information;

[0113] S513, performing a shift operation on the “fault value” in the fault data frame;

[0114] S514, adding the data obtained in step S513 and step S514 to complete the fault injection of the bit corresponding to the data at point B;

[0115] S515, directly performing a shift operation on the “fault value” in the fault data frame;

[0116] S516, adding the corresponding bit of the data at point B to the data obtained in step S515;

[0117] S517, judging whether the fault injection operation spans bytes according to the start bit and the bit length information, if so, turning to step S518, otherwise directly turning to step S519;

[0118] S518, processing the bytes corresponding to the data at point B separately, processing the first byte data first, and then processing the subsequent byte data, the method is the same as steps S511 to S516;

[0119] S519, returning the data after the fault injection (point C data).

[0120] In some embodiments, a global dynamic vector table is used to store fault data frames. The specific storage method steps are as follows:

[0121] S601, using a global dynamic expansion method to store fault data frames. The difference from the above embodiment is that device ID matching is no longer performed before creating a fault vector table, but each fault data frame is stored in the same fault vector table. The specific storage method is the same as step S401 to step S417.

[0122] S602, traversing the fault vector table to query fault data frame header information, each frame header information corresponds to a fault injection operation;

[0123] S603, performing fault injection operations on the queried fault data frames in sequence, matching the "device ID" field in the fault data frames, and locating matching devices;

[0124] S604, performing a fault injection operation on the corresponding device, and the specific fault injection details are the same as steps S501 to S518;

[0125] S605, returning the data after the fault injection, completing the real-time fault injection operation of the UAV simulation model.

[0126] Compared with the above embodiment, this embodiment has the advantage of only needing to open up memory space once, but more data needs to be traversed when querying the fault vector table, which requires more time overhead and has lower time efficiency than the above embodiment.

[0127] In some embodiments, a static fault table is used to store fault data frames, and the specific storage method steps are as follows:

[0128] S701, setting the size of the static fault vector table, that is, defining the maximum number of fault data frames that can be stored in the fault vector table;

[0129] S702, initializing the static fault table and opening up memory space;

[0130] S703, determine whether the static fault table is full, if so, go to step S704, otherwise go to step S705;

[0131] S704, the fault table is full, the first fault data frame is cleared, and subsequent fault data frames are moved forward to provide storage space for new fault data frames;

[0132] S705: the fault vector table is not full, and new fault data frames can continue to be added, and the current fault data frame is directly stored in the fault vector table;

[0133] S706, traversing the fault table to query the frame header information of the fault data frame;

[0134] S707, performing a fault injection operation on each fault data frame, the specific method is the same as step S501 to step S518;

[0135] S708, returning the data after fault injection, completing the real-time fault injection operation of the UAV simulation model.

[0136] Compared with the above embodiment, this embodiment saves the time required for dynamic expansion and has higher time efficiency; however, this embodiment is only applicable to the situation where a limited number of fault injection instructions are sent. When the required fault injection operation is greater than the upper limit of the static vector table storage, some historical fault injection information will be lost.

[0137] In some embodiments, a fault stack is used to store fault data frames, and the specific storage method steps are as follows:

[0138] S801, using a stack data structure to build a fault stack to store fault data frames;

[0139] S802, initializing the fault stack;

[0140] S803, storing each fault data frame in the constructed data stack. The storage method of each fault data frame is the same as step S401 to step S407, except that the storage details of the data in the frame follow the "first in, last out" principle. When clearing and modifying the data frame, the top data of the stack needs to be moved out of the fault stack in sequence, and then pushed into the stack in sequence after being cleared and updated;

[0141] S804, traversing the fault stack, and performing a fault injection operation according to each fault data frame in the stack, the specific method is the same as step S501 to step S518;

[0142] S805, returning the data after fault injection, completing the real-time fault injection operation of the UAV simulation model.

[0143] Compared with the above embodiment, this method uses a different data structure to store fault data frames. The disadvantage is that when performing data frame storage operations, the top data of the stack needs to be retrieved first, and the query operation does not support subscript indexing. Data can only be queried through pop and push operations, which greatly reduces the time efficiency of the fault injection operation.

[0144] In summary, the present application is to send fault injection instructions through the human-computer interaction interface of the upper computer software by the test personnel, the upper computer software performs fault data grouping according to the grouping protocol, and transmits the fault data packet to the lower computer according to the UDP transmission protocol; the lower computer parses the fault data packet to obtain the fault data frame, and the UAV simulation model matches the "device ID" field content in the data frame with the airborne device ID, and locates the simulated airborne device for fault injection; creates a fault vector table and initializes it, and opens up the initial memory space; the simulation model dynamically updates the fault vector table according to the different fault types in the fault packet; the simulation model performs fault injection processing on the B point data of the model in turn according to the fault data frame existing in the fault vector table to obtain the C point data, and sends the C point data to the cross-linked control system through the hardware interface, and returns it to the upper computer software human-computer interaction interface for display, so as to realize the real-time fault injection of the simulation model. Compared with the existing method, this method has strong versatility and scalability, different airborne devices can share the same fault injection module, and the model builder no longer needs to design a set of fault injection methods for each airborne device separately, which greatly saves the time cost of model construction and improves the design efficiency of the UAV simulation model. In addition, because a dynamic fault table is used to store fault data frames, computer memory space is greatly saved and the memory overflow problem in large-scale complex models is solved.

[0145] In another embodiment, if Figure 4 As shown, based on the same inventive concept as the above-mentioned embodiment, the embodiment of the present application further provides a UAV simulation model fault injection device, which includes:

[0146] A receiving module, configured to receive a fault injection instruction; wherein the fault injection instruction includes fault information;

[0147] A first obtaining module, used for data packetizing the fault injection instruction to obtain a fault data packet;

[0148] The second obtaining module is used to parse the fault data packet to obtain the fault data frame;

[0149] A solution module, used for performing real-time solution on the fault data frame through a simulation model to match the device ID information in the fault data frame with the device ID information in the simulation model;

[0150] A positioning module, used for locating a target device if the device ID information in the fault data frame matches the device ID information in the simulation model; wherein the target device is a device that needs to be injected with the fault information;

[0151] A creation module, used to create an initialized fault vector table based on the located target device; wherein the initialized fault vector table has an initial memory space opened up for the target device to store the fault data frame and inject the fault information;

[0152] The judgment module is used to judge whether the fault type information in the fault data frame is no-fault information, so as to inject fault information into the simulation model of the target device.

[0153] It should be noted that each module in the drone simulation model fault injection device in this embodiment corresponds one-to-one to each step in the drone simulation model fault injection method in the aforementioned embodiment. Therefore, the specific implementation method and technical effects achieved by this embodiment can refer to the implementation method of the aforementioned drone simulation model fault injection method, which will not be repeated here.

[0154] In addition, in one embodiment, the present application also provides a computer device, which includes a processor, a memory, and a computer program stored in the memory, and the computer program implements the method in the aforementioned embodiment when executed by the processor.

[0155] In addition, in one embodiment, the present application further provides a computer storage medium, on which a computer program is stored, and the computer program implements the method in the aforementioned embodiment when executed by a processor.

[0156] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.

[0157] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0158] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0159] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0160] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0161] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0162] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0163] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for injecting faults into a UAV simulation model, characterized in that: The method comprises: Receiving a fault injection instruction; wherein the fault injection instruction includes fault information; Packaging the fault injection instruction to obtain a fault data packet; Parsing the fault data packet to obtain the fault data frame; Performing real-time calculation on the fault data frame through the simulation model to match the device ID information in the fault data frame with the device ID information in the simulation model; If the device ID information in the fault data frame matches the device ID information in the simulation model, the target device is located; wherein the target device is the device to which the fault information needs to be injected; Based on the located target device, creating an initialized fault vector table; wherein the initialized fault vector table has an initial memory space opened for the target device for storing the fault data frame and injecting the fault information; It is determined whether the fault type information in the fault data frame is no-fault information, so as to inject fault information into the simulation model of the target device.

2. The UAV simulation model fault injection method according to claim 1, characterized in that: The determining whether the fault type information in the fault data frame is no-fault information to inject fault information into the simulation model of the target device includes: If the fault type information in the fault data frame is no fault information, clearing the fault information injected into the target device; If the fault type information in the fault data frame is fault information, traverse the fault vector table to query the start bit field information in each of the fault data frames; Based on the start bit field information in the fault data frame queried in the fault vector table, fault information is injected into the simulation model of the target device.

3. The UAV simulation model fault injection method as claimed in claim 2, characterized in that: The injecting fault information into the simulation model of the target device based on the start bit field information in the fault data frame queried in the fault vector table includes: If there is a fault data frame in the fault data table having the same starting bit field information as the current fault data frame, then the corresponding fault data frame in the fault data table is replaced with the current fault data frame; If there is no fault data frame in the fault data table having the same start bit field information as the current fault data frame, then adding the current fault data frame to the fault data table; Based on the fault data frame added to the fault data table, fault information is injected into the simulation model of the target device.

4. The UAV simulation model fault injection method as claimed in claim 3, characterized in that: The injecting fault information into the simulation model of the target device based on the fault data frame added to the fault data table includes: Determining whether the fault type information in the fault data frame added to the fault data table is constant fault information or deviation fault information; If the fault type information in the fault data frame added to the fault data table is constant fault information, superimposing the original numerical value in the simulation model that has not undergone the fault information injection operation with the fault value field information in the fault data frame; If the fault type information in the fault data frame added to the fault data table is constant fault information, the original numerical value in the simulation model that has not undergone the fault information injection operation is replaced with the fault value field information in the fault data frame.

5. The UAV simulation model fault injection method according to claim 1, characterized in that: After the step of determining whether the fault type information in the fault data frame is no fault information to inject fault information into the simulation model of the target device, the method further includes: The fault information injected into the simulation model is generated to the upper computer software.

6. The UAV simulation model fault injection method according to claim 1, characterized in that: If there is no fault data frame having the same start bit field information as the current fault data frame in the fault data table, adding the current fault data frame to the fault data table comprises: Determining whether the fault data table is full; If the fault data table is full, clearing the first fault data frame in the fault data table; If the fault data table is not full, the current fault data frame is added to the fault data table.

7. The UAV simulation model fault injection method according to claim 1, characterized in that: The step of packing the fault injection instruction into data packets to obtain a fault data packet includes: Based on the packetization protocol, the received fault injection instruction is packetized to obtain a fault data packet.

8. A fault injection device for a drone simulation model, characterized in that: The device comprises: A receiving module, configured to receive a fault injection instruction; wherein the fault injection instruction includes fault information; A first obtaining module, used for data packetizing the fault injection instruction to obtain a fault data packet; The second obtaining module is used to parse the fault data packet to obtain the fault data frame; A solution module, used for performing real-time solution on the fault data frame through a simulation model to match the device ID information in the fault data frame with the device ID information in the simulation model; A positioning module, used for locating a target device if the device ID information in the fault data frame matches the device ID information in the simulation model; wherein the target device is a device that needs to be injected with the fault information; A creation module, used to create an initialized fault vector table based on the located target device; wherein the initialized fault vector table has an initial memory space opened up for the target device to store the fault data frame and inject the fault information; The judgment module is used to judge whether the fault type information in the fault data frame is no-fault information, so as to inject fault information into the simulation model of the target device.

9. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Fault simulation system and fault analysis method for single event upset

    CN103198868A

  • Software fault injection method and system

    CN103559112A