CN102779084A - Fault injection method and device - Google Patents
Fault injection method and device Download PDFInfo
- Publication number
- CN102779084A CN102779084A CN2011101220541A CN201110122054A CN102779084A CN 102779084 A CN102779084 A CN 102779084A CN 2011101220541 A CN2011101220541 A CN 2011101220541A CN 201110122054 A CN201110122054 A CN 201110122054A CN 102779084 A CN102779084 A CN 102779084A
- Authority
- CN
- China
- Prior art keywords
- port
- data
- fault
- intercepting
- sends
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
The invention provides a fault injection method and a device, relates to the field of computers, and solves the problem of a shortage of a reliability testing mechanism for a recommended standard-485 (RS-485) bus. The method includes intercepting data which is transmitted by a first port to a second port, processing the intercepted data to generate a fault injection output signal, replacing the data by the fault injection output signal, and sending the fault injection output signal to the second port. According to the fault injection method and the device, the technical scheme can be used for detecting the RS-485 to achieve the fault injection reliability testing.
Description
Technical field
The present invention relates to computer realm, relate in particular to a kind of fault filling method and device.
Background technology
RS-485 is asynchronous serial communication UART, widely applies in industries such as Industry Control, Aeronautics and Astronautics, weapons, boats and ships.Concerning high reliability, high stability equipment, reliability of data communication is most important.
In order to realize reliability testing to the RS-485 bus, need carry out fault to the RS-485 bus and inject to accomplish detection, still lack a kind of like this testing mechanism at present.
Summary of the invention
The invention provides a kind of fault filling method, solved the problem of shortage RS-485 bus reliability testing mechanism.
A kind of fault filling method is applicable to that two ends have the RS-485 bus of first port and second port respectively, comprising:
The data that said first port of intercepting sends to said second port;
Said data to intercepting are handled, and produce fault and inject the output signal;
Inject the said data of output signal substituting with said fault, send to said second port.
Preferably, said first port of said intercepting also comprised before the step of the data that said second port sends:
Dispose the WORD form and the transfer rate of said RS-485 bus.
Preferably, said data bit length is 4 to 9, and said check bit indication verification form is no parity check or odd or even parity check or is fixed as 0 or be fixed as 1, and said position of rest is 1 or 1.5 or 2, and said transfer rate is 300 to 1M bps.
Preferably, said first port of said intercepting also comprised before the step of the data that said second port sends:
Keep watch on said first port, detecting said first port when said second port sends data, these data of indication intercepting.
Preferably, said first port of said supervision is specially the FIFO of said first port of monitoring.
The present invention also provides a kind of fault injection device, is applicable to that two ends have the RS-485 bus of first port and second port respectively, comprising:
The data cutout module is used for the data that said first port of intercepting sends to said second port;
The signal generation module is used for the said data of intercepting are handled, and produces fault and injects the output signal;
Signal transmitting module is used for injecting the said data of output signal substituting with said fault, sends to said second port.
Preferably, above-mentioned fault injection device also comprises:
Configuration module is used to dispose the WORD form and the transfer rate of said RS-485 bus.
Preferably, above-mentioned fault injection device also comprises:
Monitor module is used to keep watch on said first port, is detecting said first port when said second port sends data, these data of indication intercepting.
Embodiments of the invention provide a kind of fault filling method and device; Be applicable to that two ends have the RS-485 bus of first port and second port respectively; Said first port of intercepting is handled the said data of intercepting to the data that said second port sends, and produces fault and injects the output signal; Inject the said data of output signal substituting with said fault; Send to said second port, solved shortage, especially lack the problem of the mechanism that detects through fault injection means the mechanism that RS-485 bus reliability detects.
Description of drawings
The process flow diagram of a kind of fault filling method that Fig. 1 provides for embodiments of the invention one;
The structural representation of a kind of fault injection device that Fig. 2 provides for embodiments of the invention two;
Fig. 3 is a fault injection device described in the embodiments of the invention three and the synoptic diagram that is connected of RS-485 bus.
Embodiment
In order to solve the mechanism that shortage detects RS-485 bus reliability; Especially the problem that lacks the mechanism that detects through fault injection means, embodiments of the invention provide a kind of fault filling method and device that is applicable to asynchronous serial communication RS-485.Can realize that any RS-485 bus signals is carried out fault to be injected, and guarantee the transmitted in both directions normal running of data, flexible operation, the fault injection can repeat to realize, but quantization operation.
Below in conjunction with accompanying drawing, embodiments of the invention are described.
At first, embodiments of the invention one are described.
The embodiment of the invention provides a kind of fault filling method, through monitoring the RS-485 bus data of current transmission, and carries out real time data and divides and continue transmission on the RS-485 bus.The flow process that the fault filling method completion fault of using the embodiment of the invention to provide is injected is as shown in Figure 1, comprising:
The WORD form and the transfer rate of step 101, the said RS-485 bus of configuration;
In this step, before carrying out the fault injection, need the WORD form and the transfer rate of RS-485 bus be configured, wherein, the WORD form comprises data bit length, check bit sum position of rest.
Preferred configuration parameter is following:
Data bit length: can be configured to the 4-9 position;
Check bit configuration: can be configured to no parity check, odd, even parity check, be fixed as 0 or be fixed as 1;
Position of rest is provided with: can be configured to 1,1.5 or 2;
Transfer rate is provided with: baud rate just can be set to 300~1M bps.
Step 102, said first port of supervision are detecting said first port when said second port sends data, these data of indication intercepting;
In the embodiment of the invention, the RS-485 bus has two ports, is respectively first port and second port, and the embodiment of the invention is injected to example with the fault of first port in the flow process of second port transmission data and describes.
The data that step 103, said first port of intercepting send to said second port;
Step 104, the said data of intercepting are handled, produced fault and inject the output signal;
Step 105, inject the said data of output signal substituting, send to said second port with said fault.
Need to prove that when the data that second port is sent to first port were carried out the fault injection, it realized that principle is identical with flow process shown in Figure 1, so in this not repeat specification.
Below in conjunction with accompanying drawing, embodiments of the invention two are described.
The embodiment of the invention provides a kind of fault injection device, and the structure of this device is as shown in Figure 2, comprising:
Preferably, above-mentioned fault injection device also comprises:
Preferably, above-mentioned fault injection device also comprises:
Below, embodiments of the invention three are described.
The fault injection device that the embodiment of the invention three uses the embodiment of the invention two to be provided in conjunction with the fault filling method that embodiments of the invention one are provided, has been accomplished the fault injection.The concrete realization as follows:
At first, the RS-485 bus is broken as 2 groups of unconnected RS-485 buses, and 2 groups of unconnected RS-485 buses after will breaking off are connected according to mode as shown in Figure 3 with the fault injection device.
Secondly, the data of the RS-485 bus that detection port 1 connects, and the data that control is sent to port one when needs carry out the fault injection; Concrete, forbid that RS-485 bus port 1 sends, allow to keep watch on and receive the data on the RS-485 bus port 1, and when detecting and receiving the data on the RS-485 bus port 1, with data storage in the reception FIFO of RS-485 bus port 1.
Then, port one is handled to the data that port 2 sends, produced fault and inject the output signal;
At last, fault is injected the output signal from port 2 outputs; Concrete; In data processing module detects the reception FIFO of RS-485 port one, data are arranged; And on the current RS-485 port 2 when idle; Data among the reception FIFO of RS-485 port one are carried out this fault being injected output signal sending on the RS-485 port 2 after fault inject to handle operation (fault that is about to generate is injected the output signal and replaced former data).
In like manner, can carry out the fault injection to port 2 to the process that port one sends data according to above-mentioned flow process, specific as follows:
At first, the data of the RS-485 bus that connects by detection port 2, and carry out the fault data that control is sent to port 2 when injecting at needs; Concrete, forbid that RS-485 port 2 sends, allow to keep watch on and receive the data on the RS-485 port 2, detecting and receiving when on the RS-485 port 2 data being arranged, with data storage in the reception FIFO of RS-485 port 2.
Secondly, port 2 is handled to the data that port one sends, produced fault and inject the output signal;
At last, fault being injected the output signal exports from port one; Concrete; In the reception FIFO that detects RS-485 port 2, data are arranged; And on the current RS-485 port one when idle; Data among the reception FIFO of RS-485 port 2 are carried out this fault being injected output signal sending on the RS-485 port one through transmitting-receiving control 1 interface after fault inject to handle operation (fault that is about to generate is injected the output signal and replaced former data).
Can realize the bi-directional data on the RS-485 bus is carried out the fault implant operation through said method.Need to prove that the direction of data transmission is injected flow process by the fault of port one to port 2 and injected flow process by the fault of port 2 to port one and can carry out simultaneously.
Embodiments of the invention provide a kind of fault filling method and device; Be applicable to that two ends have the RS-485 bus of first port and second port respectively; Said first port of intercepting is handled the said data of intercepting to the data that said second port sends, and produces fault and injects the output signal; Inject the said data of output signal substituting with said fault; Send to said second port, solved shortage, especially lack the problem of the mechanism that detects through fault injection means the mechanism that RS-485 bus reliability detects.Fault filling method that embodiments of the invention provide and device can be realized that any RS-485 bus signals is carried out fault to be injected, and guarantee the transmitted in both directions normal running of data, flexible operation, and the fault injection can repeat to realize, but quantization operation.
The all or part of step that the one of ordinary skill in the art will appreciate that the foregoing description program circuit that can use a computer is realized; Said computer program can be stored in the computer-readable recording medium; Said computer program (like system, unit, device etc.) on the relevant hardware platform is carried out; When carrying out, comprise one of step or its combination of method embodiment.
Alternatively, all or part of step of the foregoing description also can use integrated circuit to realize, these steps can be made into integrated circuit modules one by one respectively, perhaps a plurality of modules in them or step is made into the single integrated circuit module and realizes.Like this, the present invention is not restricted to any specific hardware and software combination.
Each device/functional module/functional unit in the foregoing description can adopt the general calculation device to realize, they can concentrate on the single calculation element, also can be distributed on the network that a plurality of calculation element forms.
Each device/functional module/functional unit in the foregoing description is realized with the form of software function module and during as independently production marketing or use, can be stored in the computer read/write memory medium.The above-mentioned computer read/write memory medium of mentioning can be a ROM (read-only memory), disk or CD etc.
Claims (8)
1. a fault filling method is applicable to that two ends have the RS-485 bus of first port and second port respectively, it is characterized in that, comprising:
The data that said first port of intercepting sends to said second port;
Said data to intercepting are handled, and produce fault and inject the output signal;
Inject the said data of output signal substituting with said fault, send to said second port.
2. fault filling method according to claim 1 is characterized in that, said first port of said intercepting also comprised before the step of the data that said second port sends:
Dispose the WORD form and the transfer rate of said RS-485 bus.
3. fault filling method according to claim 2; It is characterized in that; Said data bit length is 4 to 9; Said check bit indication verification form is no parity check or odd or even parity check or is fixed as 0 or be fixed as 1, and said position of rest is 1 or 1.5 or 2, and said transfer rate is 300 to 1Mbps.
4. fault filling method according to claim 1 is characterized in that, said first port of said intercepting also comprised before the step of the data that said second port sends:
Keep watch on said first port, detecting said first port when said second port sends data, these data of indication intercepting.
5. fault filling method according to claim 4 is characterized in that, said first port of said supervision is specially the FIFO of said first port of monitoring.
6. a fault injection device is applicable to that two ends have the RS-485 bus of first port and second port respectively, it is characterized in that, comprising:
The data cutout module is used for the data that said first port of intercepting sends to said second port;
The signal generation module is used for the said data of intercepting are handled, and produces fault and injects the output signal;
Signal transmitting module is used for injecting the said data of output signal substituting with said fault, sends to said second port.
7. fault injection device according to claim 6 is characterized in that, this device also comprises:
Configuration module is used to dispose the WORD form and the transfer rate of said RS-485 bus.
8. fault injection device according to claim 6 is characterized in that, this device also comprises:
Monitor module is used to keep watch on said first port, is detecting said first port when said second port sends data, these data of indication intercepting.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110122054.1A CN102779084B (en) | 2011-05-12 | 2011-05-12 | Fault filling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110122054.1A CN102779084B (en) | 2011-05-12 | 2011-05-12 | Fault filling method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102779084A true CN102779084A (en) | 2012-11-14 |
CN102779084B CN102779084B (en) | 2015-11-25 |
Family
ID=47124003
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110122054.1A Active CN102779084B (en) | 2011-05-12 | 2011-05-12 | Fault filling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102779084B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106130829A (en) * | 2016-08-30 | 2016-11-16 | 北京润科通用技术有限公司 | A kind of bus test method and device |
CN108009060A (en) * | 2017-11-29 | 2018-05-08 | 北京润科通用技术有限公司 | A kind of RS485 bus failures analogy method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1890922A (en) * | 2003-10-03 | 2007-01-03 | 佩佩尔+富克斯有限公司 | Diagnostic system for a modular fieldbus board |
CN1945547A (en) * | 2006-10-31 | 2007-04-11 | 哈尔滨工业大学 | Embedded fault injection system and its method |
CN201110868Y (en) * | 2007-11-30 | 2008-09-03 | 北京飞天诚信科技有限公司 | USB bus current detecting device with alarming function |
CN201751897U (en) * | 2010-07-01 | 2011-02-23 | 珠海欧比特控制工程股份有限公司 | 1553B bus test equipment |
-
2011
- 2011-05-12 CN CN201110122054.1A patent/CN102779084B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1890922A (en) * | 2003-10-03 | 2007-01-03 | 佩佩尔+富克斯有限公司 | Diagnostic system for a modular fieldbus board |
CN1945547A (en) * | 2006-10-31 | 2007-04-11 | 哈尔滨工业大学 | Embedded fault injection system and its method |
CN201110868Y (en) * | 2007-11-30 | 2008-09-03 | 北京飞天诚信科技有限公司 | USB bus current detecting device with alarming function |
CN201751897U (en) * | 2010-07-01 | 2011-02-23 | 珠海欧比特控制工程股份有限公司 | 1553B bus test equipment |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106130829A (en) * | 2016-08-30 | 2016-11-16 | 北京润科通用技术有限公司 | A kind of bus test method and device |
CN106130829B (en) * | 2016-08-30 | 2020-02-04 | 北京润科通用技术有限公司 | Bus test method and device |
CN108009060A (en) * | 2017-11-29 | 2018-05-08 | 北京润科通用技术有限公司 | A kind of RS485 bus failures analogy method and device |
Also Published As
Publication number | Publication date |
---|---|
CN102779084B (en) | 2015-11-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102301364B (en) | Cpu interconnecting device | |
CN102647320B (en) | Integrated circuit suitable for high-speed 1553 bus protocol control | |
CN102866971A (en) | Data transmission device, system and method | |
CN102449614B (en) | Packetized interface for coupling agents | |
EP2467781B1 (en) | Systems and methods to efficiently schedule commands at a memory controller | |
CN101325090B (en) | Offsetting cyclic redundancy code lanes from data lanes to reduce latency | |
CN102541791A (en) | Data transferring apparatus and control method thereof | |
CN105573239A (en) | High speed backboard bus communication control device and method | |
CN101702639B (en) | Check value calculation method and device of cyclic redundancy check | |
CN105357147A (en) | High-speed and high-reliability network-on-chip adapter unit | |
US10114687B2 (en) | System for checking the integrity of a communication between two circuits | |
CN201751898U (en) | 1553B bus test device | |
US9647766B2 (en) | Method, communication apparatus, and communication system | |
CN102779084A (en) | Fault injection method and device | |
CN201751896U (en) | ARINC429 bus testing device | |
CN202102421U (en) | Fault injection detector | |
CN102638306A (en) | 1394b optical bus monitor and monitoring method thereof | |
CN104484260A (en) | Simulation monitoring circuit based on GJB289 bus interface SoC (system on a chip) | |
CN201918981U (en) | Dual-phase harvard code bus signal coding-decoding circuit | |
CN115706661A (en) | Synchronous high speed signaling interconnect | |
CN100357933C (en) | A 386EX CPU based embedded computer system | |
CN103279440A (en) | Bus communication method between single-machine modules | |
CN102880576B (en) | Method for simulating multiple groups of UART interfaces based on STM32F103VE chip | |
CN201544888U (en) | Multifunctional vehicle bus master equipment | |
CN203164959U (en) | ARINC429 bus test board card |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |