Fault injection method of equipment based on RS232 serial port communication and related device

By setting up a fault injection module on the RS232 serial communication line, automatically parsing and executing the fault injection request, the complex problem of fault injection operation between the upper computer and the controlled device is solved, and an automated and simplified fault injection process is realized.

CN119127774APending Publication Date: 2024-12-13上海北汇信息科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411436168.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, the fault injection method between the upper computer and the controlled device is complex in operation, with high manual participation, making it difficult to achieve automation and simplification.

Method used

A fault injection method and device based on RS232 serial communication is designed. By setting up a fault injection module on the communication line, it receives the fault injection request of the upper computer, parses the request and performs data or hardware fault injection in accordance with the specified method, including data fault injection. and hardware fault injection, and use the relay in the fault injection module to achieve hardware fault injection state.

Benefits of technology

It realizes the automation of fault injection operation between the upper computer and the controlled equipment, reduces manual participation, simplifies the operation process, and improves the efficiency and accuracy of fault injection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127774A_ABST
    Figure CN119127774A_ABST
Patent Text Reader

Abstract

The invention discloses a fault injection method of equipment based on RS232 serial port communication and a related device, and relates to the technical field of fault injection. A fault injection module is arranged on a communication line between an upper computer based on RS232 serial port communication and controlled equipment; the fault injection module is connected with a first test node on the upper computer and a second test node on the controlled equipment, receives a fault injection request sent by the upper computer, analyzes the fault injection request and completes fault injection according to a corresponding fault injection mode obtained through analysis. Data fault injection or hardware fault injection can be realized through automatic control of the upper computer by adopting the external fault injection module, the manual participation degree is low, and the operation is simple.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of fault injection, and in particular to a fault injection method and related apparatus for equipment based on RS232 serial port communication. Background Art

[0002] The combination of the host computer and the controlled device based on RS232 serial port communication can be flexibly applied in various scenarios. For example: the computer is connected to the modem through the RS232 interface to realize the function of dial-up Internet access; the printer is directly connected to the computer through the equipped RS232 interface, receives the print command and document data from the computer, and completes the printing task; various environmental sensors are connected to the computer through the RS232 interface to realize the real-time transmission of environmental monitoring data.

[0003] Accordingly, there are various ways to perform fault injection between the host computer and the controlled device in the known technology. For example, physical layer fault injection directly operated on the RS232 interface; signal layer fault injection implemented with the help of external equipment or software tools; protocol layer or software layer fault injection implemented at the software level; and environmental factor simulation and network layer fault injection that require specific test environment or equipment to be implemented; etc.

[0004] The various methods of fault injection between the host computer and the controlled device mentioned above require high manual involvement and are complex to operate. Summary of the invention

[0005] In view of the above problems, the present application provides a fault injection method and related devices for devices based on RS232 serial port communication, so as to provide a fault injection method between a host computer and a controlled device based on RS232 serial port communication with low manual participation and low complexity. The specific scheme is as follows:

[0006] In a first aspect, the present application provides a fault injection method for a device based on RS232 serial communication, which is applied to a fault injection module. The fault injection module is connected to a communication line between a host computer and a controlled device, and is respectively connected to a first test node on the host computer and a second test node on the controlled device. The method comprises:

[0007] Receive the fault injection request sent by the host computer;

[0008] Parsing the fault injection request to obtain a fault injection method; the fault injection method includes a data fault injection method and a hardware fault injection method;

[0009] In the case where the fault injection mode is a data fault injection mode, a communication message received from the first test node is processed according to a preset mode, a test message including fault data is generated, and the test message is sent to the second test node to complete the data fault injection between the first test node and the second test node;

[0010] When the fault injection mode is a hardware fault injection mode, the communication line is disconnected and the disconnected communication line is connected to a hardware fault injection channel in the fault injection module that matches the fault injection request, so as to adjust the communication line to a hardware fault injection state that matches the fault injection request, and complete the hardware fault injection between the first test node and the second test node.

[0011] In a possible implementation, processing the communication message received from the second test node in a preset manner includes:

[0012] The communication message received from the second test node is tampered with using a preset communication message tampering method.

[0013] In a possible implementation, processing the communication message received from the second test node in a preset manner includes:

[0014] The preset communication message insertion method is used to insert the preset test information into the communication message received from the second test node.

[0015] In a possible implementation, disconnecting a communication line and connecting the disconnected communication line to a hardware fault injection channel that matches the fault injection request in the fault injection module includes:

[0016] According to the fault injection request, the relay in the fault injection module is controlled to disconnect the communication line, and the disconnected communication line is connected to the hardware fault injection channel in the fault injection module that matches the fault injection request.

[0017] In a possible implementation, the hardware fault injection state includes a short circuit state, an open circuit state, and a short-to-ground state.

[0018] In a possible implementation, the communication message is a message.

[0019] The second aspect of the present application provides a fault injection device for a device based on RS232 serial communication, comprising:

[0020] Receiving unit, parsing unit, data fault injection unit and hardware fault injection unit; wherein:

[0021] A receiving unit, used for receiving a fault injection request sent by a host computer;

[0022] A parsing unit, used for parsing a fault injection request to obtain a fault injection method; the fault injection method includes a data fault injection method and a hardware fault injection method;

[0023] A data fault injection unit, for processing the communication message received from the second test node in a preset manner when the fault injection mode is a data fault injection mode, generating a test message containing fault data, and sending the test message to the first test node to complete the data fault injection between the first test node and the second test node;

[0024] The hardware fault injection unit is used to disconnect the communication line when the fault injection mode is the hardware fault injection mode, and connect the disconnected communication line to the hardware fault injection channel that matches the fault injection request in the fault injection module, so as to adjust the communication line to the hardware fault injection state that matches the fault injection request, and complete the hardware fault injection between the first test node and the second test node.

[0025] A third aspect of the present application provides a fault injection device for a device based on RS232 serial port communication, comprising at least one processor and a memory connected to the processor, wherein:

[0026] The memory is used to store computer programs;

[0027] The processor is used to execute the computer program so that the fault injection device of the device based on RS232 serial port communication can implement the fault injection method of the device based on RS232 serial port communication as described in any one of the above.

[0028] A fourth aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on the computer program product, the computer program product implements a fault injection method for a device based on RS232 serial port communication as described in any one of the above.

[0029] In a fifth aspect, the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by the computer storage medium, the computer storage medium can implement a fault injection method for a device based on RS232 serial port communication as described in any one of the above.

[0030] By means of the above technical scheme, the fault injection method and related device of the device based on RS232 serial communication provided by the present application are provided with a fault injection module on the communication line between the host computer and the controlled device based on RS232 serial communication, the fault injection module is connected to the first test node on the host computer and the second test node on the controlled device, the fault injection module receives the fault injection request sent by the host computer, parses the fault injection request and completes the fault injection according to the corresponding fault injection method obtained by parsing. In the present application, an external fault injection module is used to realize data fault injection or hardware fault injection through the self-control of the host computer, with low manual participation and simple operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0032] Figure 1 A flow chart of a fault injection method for a device based on RS232 serial communication provided by the present application;

[0033] Figure 2 This is an example diagram of the hardware fault injection principle in the fault injection method for a device based on RS232 serial port communication provided in this application;

[0034] Figure 3 A flow chart showing an example of a fault injection method for a device based on RS232 serial communication provided in this application;

[0035] Figure 4 A schematic diagram of the structure of a fault injection device for a device based on RS232 serial communication provided by the present application;

[0036] Figure 5 A schematic diagram of the structure of a fault injection device based on RS232 serial port communication provided in this application. DETAILED DESCRIPTION

[0037] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0038] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0039] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0040] In the known technology, there are fault injection methods for different layers such as the physical layer, signal layer, protocol layer, software layer, and network layer between the host computer and the controlled device. The specific operation methods of various fault injection methods are different and the operations are complicated.

[0041] For example, the fault injection at the physical layer between the host computer and the controlled device is to disconnect or short-circuit the pins, which is achieved by directly operating on the physical connection of the RS232 interface. It requires direct operation of the hardware interface, professional technical knowledge and sophisticated operating skills, and the operation is complicated. The fault injection at the protocol layer between the host computer and the controlled device is achieved through frame error insertion and command tampering, which requires the tester to have an in-depth understanding of the communication protocol, have advanced technical knowledge, and accurately operate and modify the device driver or application.

[0042] It can be seen that the operations of various fault injection methods between the host computer and the controlled device in the known technology are complicated and require high manual participation.

[0043] In order to solve the above problems, the present application provides a fault injection method and related apparatus for a device based on RS232 serial port communication.

[0044] It should be noted that the present application provides a fault injection module to complete fault injection between a host computer and a controlled device that communicate based on an RS232 serial port.

[0045] The host computer and the controlled device are connected and communicated mainly through a communication line. The fault injection module is connected to the communication line, and is respectively connected to the first test node on the host computer and the second test node on the controlled device, and is controlled by the host computer. The host computer can control the fault injection module to start fault injection and the specific method of fault injection.

[0046] Exemplarily, when the fault injection module is connected to the communication line between the computer and the modem connected via the RS232 interface, the fault injection module is controlled by the computer; when the fault injection module is connected to the communication line between the computer and the printer connected via the RS232 interface, the fault injection module is controlled by the computer.

[0047] It should be noted that the communication line connected to the fault injection module can be the original communication line between the host computer and the controlled device, or it can be a new communication line established between the test nodes of the two devices for connecting the fault injection module. If the fault injection module is connected to the new communication line, specifically during the fault injection test, the original communication line between the host computer and the controlled device is disconnected until the test is completed and the normal communication state can be restored.

[0048] Optional, see Figure 1 , a flow chart of a fault injection method for a device based on RS232 serial port communication provided in the present application.

[0049] like Figure 1 As shown, the fault injection method of the device based on RS232 serial port communication includes the following steps:

[0050] Step 101: Receive a fault injection request sent by a host computer.

[0051] It should be noted that the fault injection request is a trigger request for fault injection sent by the host computer. It should be noted that the fault injection request includes a specific fault injection method, which can control the fault injection module to complete the corresponding fault injection according to the fault injection method indicated by the fault injection request.

[0052] Optionally, the fault injection module receives a fault injection request sent by a host computer.

[0053] It should also be noted that the fault injection request is specifically sent by the tester operating the host computer. The tester can directly send the fault injection request on the host computer according to the needs of the fault injection test, or pre-set the sending time of the fault injection request on the host computer. The host computer will automatically send the fault injection request after the sending time is reached.

[0054] Step 102: parse the fault injection request to obtain a fault injection method; the fault injection method includes a data fault injection method and a hardware fault injection method.

[0055] It should be noted that the fault injection module provided in the present application includes but is not limited to two fault injection methods, namely a data fault injection method and a hardware fault injection method.

[0056] It can be understood that the implementation logic of the data fault injection method is mainly to process the communication message received from the second test node according to the preset fault injection method through the fault injection module. That is, the communication message received from the second test node is processed into a test message including fault data. Among them, the communication message between the two test nodes is generally transmitted in the form of a message.

[0057] The implementation logic of the hardware fault injection method is mainly to disconnect the communication line through the fault injection module and adjust the communication line to the hardware fault injection state. The fault injection state of the communication line includes but is not limited to the short circuit state, the broken circuit state and the open circuit state.

[0058] Optionally, the fault injection module parses the fault injection request and obtains that the fault injection mode indicated in the fault injection request is a data fault mode or a hardware fault injection mode.

[0059] Step 103, when the fault injection method is a data fault injection method, process the communication message received from the first test node according to a preset method, generate a test message containing fault data, and send the test message to the second test node to complete the data fault injection between the first test node and the second test node.

[0060] It should be noted that there are various preset processing methods, mainly processing the communication message into a test message including fault data.

[0061] The preset method can be a preset communication message tampering method, specifically changing the value of the data field in the communication message, deleting or adding data, etc. After obtaining the test message, it is sent to the second test node located on the controlled device. This data fault injection method can test the ability of the device group composed of the host computer and the controlled device based on RS232 serial port communication to handle erroneous data.

[0062] The preset method can be a preset communication message insertion method, specifically inserting a preset test message into the communication message, and after obtaining the test message, sending it to the second test node located in the controlled device. Among them, the preset test message can be an error code, that is, inserting an error code into the communication message, such as an incorrect checksum, an incorrect sequence number, etc. This data fault injection method can test the detection and processing capabilities of the device group composed of the host computer and the controlled device based on RS232 serial communication for error codes.

[0063] Optionally, after the fault injection module parses out that the fault injection request sent by the host computer indicates a data fault injection request, it processes the communication message sent from the first test node on the host computer according to a preset communication message tampering method or a preset communication message insertion method, processes the communication message into a test message including fault data, and then sends it to the second test node on the controlled device.

[0064] It should be noted that the fault injection module can not only process the communication messages sent from the first test node on the host computer in a preset manner, but also process the communication messages sent from the second test node on the controlled device in a preset manner, and process the communication messages into test messages including fault data and then send them to the first test node on the host computer.

[0065] That is, the data fault injection method provided by the present application is to process the communication message requested by the communication message request end into a test message containing fault data in a preset manner and then send it to the communication message request end.

[0066] Step 104: When the fault injection mode is a hardware fault injection mode, disconnect the communication line, connect the disconnected communication line to the hardware fault injection channel that matches the fault injection request in the fault injection module, so as to adjust the communication line to the hardware fault injection state that matches the fault injection request, and complete the hardware fault injection between the first test node and the second test node.

[0067] It should be noted that the hardware fault injection method mainly changes the connection mode of the communication line in the fault injection module, specifically, adjusts the communication line to a short circuit, open circuit, short to ground, etc. state.

[0068] Optionally, the fault injection module adjusts the state of the communication line to a hardware fault injection state indicated by the fault injection request.

[0069] Specifically, the fault injection module controls the relay in the fault injection module to complete the state adjustment of the communication line according to the fault injection request. First, the original communication line is disconnected and connected to the two hardware fault injection channels in the fault injection module. Each hardware fault injection channel included in the fault injection module has the functions of short circuit, open circuit and short ground, and each function is controlled by a corresponding relay.

[0070] By controlling the corresponding relay in the hardware fault injection channel to be disconnected, the communication line is disconnected; by controlling the corresponding relay in the hardware fault injection channel to be closed, the communication line is short-circuited.

[0071] For example, see Figure 2 , an example diagram of the hardware fault injection principle in the fault injection method for a device based on RS232 serial port communication provided in this application.

[0072] Depend on Figure 2 It can be seen that the fault injection module is driven by a relay to adjust the connection state of the communication line. The communication line can be adjusted to the state of short circuit, open circuit and short ground, and KL30 and KL31 can also be short-circuited.

[0073] In summary, the fault injection method of the device based on RS232 serial port communication provided by the present application is provided with a fault injection module on the communication line between the host computer based on RS232 serial port communication and the controlled device, the fault injection module connects the first test node on the host computer and the second test node on the controlled device, the fault injection module receives the fault injection request sent by the host computer, parses the fault injection request and completes the fault injection according to the corresponding fault injection method obtained by parsing. In the present application, an external fault injection module is used to realize data fault injection or hardware fault injection through the self-control of the host computer, with low manual participation and simple operation.

[0074] For example, see Figure 3 , a flow chart of an example of a fault injection method for a device based on RS232 serial port communication provided in this application.

[0075] like Figure 3 As shown, the host computer software communicates with the RS232 fault injection module to control the module. The RS232 fault injection module includes a relay and a communication module, which are respectively connected to the node 1 and the node 2 that need to be tested for fault injection.

[0076] Specifically, during the fault injection process, the host computer controls the relay in the fault injection module to open and close to complete the fault injection. It should also be noted that the fault injection module is connected to the communication line between node 1 and node 2 only when there is a need for fault injection between node 1 and node 2. The normal communication line between node 1 and node 2 is disconnected during fault injection.

[0077] A fault injection method for a device based on RS232 serial port communication provided in an embodiment of the present application is introduced above. A device for executing the fault injection method for a device based on RS232 serial port communication is introduced below.

[0078] See also Figure 4 , Figure 4 A schematic structural diagram of a fault injection device for a device based on RS232 serial port communication provided in the present application.

[0079] like Figure 4 As shown, the fault injection device of the device based on RS232 serial communication includes a receiving unit 10, a parsing unit 20, a data fault injection unit 30 and a hardware fault injection unit 40; wherein:

[0080] The receiving unit 10 is used to receive a fault injection request sent by a host computer;

[0081] The parsing unit 20 is used to parse the fault injection request to obtain a fault injection method; the fault injection method includes a data fault injection method and a hardware fault injection method;

[0082] The data fault injection unit 30 is used to process the communication message received from the second test node according to a preset method when the fault injection method is a data fault injection method, generate a test message containing fault data, and send the test message to the first test node to complete the data fault injection between the first test node and the second test node;

[0083] The hardware fault injection unit 40 is used to disconnect the communication line when the fault injection mode is the hardware fault injection mode, and connect the disconnected communication line to the hardware fault injection channel that matches the fault injection request in the fault injection module, so as to adjust the communication line to the hardware fault injection state that matches the fault injection request, and complete the hardware fault injection between the first test node and the second test node.

[0084] In one implementation, the data fault injection unit 30 is specifically configured to:

[0085] The communication message received from the second test node is tampered with using a preset communication message tampering method.

[0086] In one implementation, the data fault injection unit 30 is specifically configured to:

[0087] The preset communication message insertion method is used to insert the preset test information into the communication message received from the second test node.

[0088] In one implementation, the hardware fault injection unit 40 is specifically configured to:

[0089] According to the fault injection request, the relay in the fault injection module is controlled to disconnect the communication line, and the disconnected communication line is connected to the hardware fault injection channel in the fault injection module that matches the fault injection request.

[0090] In one implementation, the hardware fault injection states in the hardware fault injection unit 40 include a short circuit state, an open circuit state, and a short-to-ground state.

[0091] In one implementation, the communication message in the data fault injection unit 30 is a message.

[0092] The present application also provides a fault injection device for a device based on RS232 serial communication. Figure 5 As shown, it shows a schematic diagram of the structure of a fault injection device suitable for implementing a device based on RS232 serial port communication in an embodiment of the present application. The fault injection device based on RS232 serial port communication in an embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 5The fault injection device based on RS232 serial port communication is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0093] like Figure 5 As shown, the fault injection device for the device based on RS232 serial communication may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 to the random access memory (RAM) 603. When the fault injection device for the device based on RS232 serial communication is powered on, various programs and data required for the operation of the fault injection device for the device based on RS232 serial communication are also stored in the RAM 603. The processing device 601, the ROM 602 and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.

[0094] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0095] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on the computer program product, the computer program product implements any fault injection method for a device based on RS232 serial port communication provided in the embodiment of the present application.

[0096] A computer storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by the computer storage medium, the computer storage medium can implement any fault injection method for a device based on RS232 serial port communication provided in an embodiment of the present application.

[0097] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0098] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the method of each embodiment of the present application.

[0099] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0100] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device or data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integration. Available media can be magnetic media, (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid-state hard disk (SSD)), etc.

Claims

1. A fault injection method for a device based on RS232 serial communication, characterized in that: Applied to a fault injection module, the fault injection module is connected to a communication line between a host computer and a controlled device, and is respectively connected to a first test node located on the host computer and a second test node located on the controlled device; the method comprises: Receiving a fault injection request sent by the host computer; Parsing the fault injection request to obtain a fault injection method; the fault injection method includes a data fault injection method and a hardware fault injection method; In the case where the fault injection mode is a data fault injection mode, processing the communication message received from the first test node in a preset manner, generating a test message including fault data, and sending the test message to the second test node to complete the data fault injection between the first test node and the second test node; In the case where the fault injection method is a hardware fault injection method, the communication line is disconnected, and the disconnected communication line is connected to a hardware fault injection channel in the fault injection module that matches the fault injection request, so as to adjust the communication line to a hardware fault injection state that matches the fault injection request, and complete the hardware fault injection between the first test node and the second test node.

2. The fault injection method for a device based on RS232 serial communication according to claim 1, characterized in that: The processing of the communication message received from the second test node in a preset manner includes: The communication message received from the second test node is tampered with using a preset communication message tampering method.

3. The fault injection method for a device based on RS232 serial communication according to claim 1, characterized in that: The processing of the communication message received from the second test node in a preset manner includes: The preset communication message insertion method is used to insert the preset test information into the communication message received from the second test node.

4. The fault injection method for a device based on RS232 serial communication according to claim 1, characterized in that: The disconnecting the communication line and connecting the disconnected communication line to a hardware fault injection channel in the fault injection module that matches the fault injection request comprises: According to the fault injection request, the relay in the fault injection module is controlled to disconnect the communication line, and the disconnected communication line is connected to the hardware fault injection channel in the fault injection module that matches the fault injection request.

5. The fault injection method for a device based on RS232 serial communication according to claim 1, characterized in that: The hardware fault injection state includes a short circuit state, an open circuit state and a short-to-ground state.

6. The fault injection method for a device based on RS232 serial communication according to claim 2, characterized in that: The communication message is a message.

7. A fault injection device for equipment based on RS232 serial communication, characterized in that: include: Receiving unit, parsing unit, data fault injection unit and hardware fault injection unit; wherein: The receiving unit is used to receive a fault injection request sent by the host computer; The parsing unit is used to parse the fault injection request to obtain a fault injection method; the fault injection method includes a data fault injection method and a hardware fault injection method; The data fault injection unit is used to process the communication message received from the second test node in a preset manner when the fault injection mode is the data fault injection mode, generate a test message containing fault data, and send the test message to the first test node to complete the data fault injection between the first test node and the second test node; The hardware fault injection unit is used to disconnect the communication line when the fault injection mode is the hardware fault injection mode, and connect the disconnected communication line to the hardware fault injection channel in the fault injection module that matches the fault injection request, so as to adjust the communication line to a hardware fault injection state that matches the fault injection request, and complete the hardware fault injection between the first test node and the second test node.

8. A fault injection device based on RS232 serial communication, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the fault injection device of the device based on RS232 serial port communication can implement the fault injection method of the device based on RS232 serial port communication as claimed in any one of claims 1 to 6.

9. A computer program product, characterized in that It comprises computer-readable instructions. When the computer-readable instructions are executed on the computer program product, the computer program product implements the fault injection method for a device based on RS232 serial port communication as claimed in any one of claims 1 to 6.

10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs. When the one or more computer programs are executed by the computer storage medium, the computer storage medium can implement the fault injection method for a device based on RS232 serial port communication as described in any one of claims 1 to 6.