CN109738732B - Signal edge fault injection method and device - Google Patents

Signal edge fault injection method and device Download PDF

Info

Publication number
CN109738732B
CN109738732B CN201910124605.4A CN201910124605A CN109738732B CN 109738732 B CN109738732 B CN 109738732B CN 201910124605 A CN201910124605 A CN 201910124605A CN 109738732 B CN109738732 B CN 109738732B
Authority
CN
China
Prior art keywords
edge
data
target
fault
digital signal
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.)
Active
Application number
CN201910124605.4A
Other languages
Chinese (zh)
Other versions
CN109738732A (en
Inventor
马巍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Runke General Technology Co Ltd
Original Assignee
Beijing Runke General Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Runke General Technology Co Ltd filed Critical Beijing Runke General Technology Co Ltd
Priority to CN201910124605.4A priority Critical patent/CN109738732B/en
Publication of CN109738732A publication Critical patent/CN109738732A/en
Application granted granted Critical
Publication of CN109738732B publication Critical patent/CN109738732B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)
  • Monitoring And Testing Of Transmission In General (AREA)

Abstract

The embodiment of the invention provides a signal edge fault injection method and a signal edge fault injection device, wherein the method comprises the following steps: acquiring an electrical signal sent by a tested object, and converting the electrical signal into a digital signal; obtaining statistical information according to the digital signals; the statistical information comprises level information and edge point number of the digital signal; generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user; updating original edge data and original level data in the digital signal according to the target edge data and the number of edge points so as to realize edge fault injection in the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same. The invention can perform edge fault injection on the tested object under different bus types and different scenes, and has the advantages of high universality, high flexibility, user application fitting and high practical use value.

Description

Signal edge fault injection method and device
Technical Field
The invention relates to the technical field of signal processing, in particular to a signal edge fault injection method and a signal edge fault injection device.
Background
Currently, fault injection methods for signal edges are implemented in an indirect manner, for example, a low level is inserted between high levels of signals to implement a falling edge, or a high level is inserted between low levels of signals to implement a rising edge.
However, the current signal edge fault injection method cannot be automatically adjusted and adapted according to the electrical characteristics of the bus, cannot be flexibly applied under different bus types and different scenes, and has great limitations in generality, flexibility and practical application.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for injecting a signal edge fault, which can implement flexible application in different bus types and different scenarios, and have high versatility, high flexibility, and high practical use value. The technical scheme is as follows:
based on an aspect of the embodiments of the present invention, an embodiment of the present invention provides a signal edge fault injection method, including:
acquiring an electrical signal sent by a measured object, and converting the electrical signal into a digital signal;
obtaining statistical information according to the digital signals; wherein the statistical information comprises level information and edge point number of the digital signal;
generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user;
updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points so as to inject edge faults into the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same.
Optionally, the statistical information further includes amplitude information, the edge fault injection configuration parameter information includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode; generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user, wherein the target edge data comprises the following steps:
when the injection-allowed edge fault is judged according to the level information, determining the edge fault type when the injection-allowed edge fault is caused according to the level information;
when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; when the edge injection mode is an edge value real-time generation mode, generating the target edge data according to the amplitude information and the edge point number parameters;
updating the original edge data and the original level data in the digital signal according to the target edge data and the number of the edge points, wherein the updating comprises the following steps:
and under the condition that the target edge type is matched with the target edge data, updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points.
Optionally, the statistical information further includes amplitude information, the edge fault injection configuration parameter information includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode; generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user, wherein the target edge data comprises the following steps:
when the injection-allowed edge fault is judged according to the level information, determining the edge fault type when the injection-allowed edge fault is caused according to the level information;
judging whether the target edge type is matched with the edge fault type when the edge fault is allowed to be injected;
when the target edge type and the edge fault type when the edge fault is allowed to be injected are matched, executing the following steps: when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; and when the edge injection mode is an edge value real-time generation mode, generating the target edge type according to the amplitude information and the edge point number parameters.
Optionally, updating the original edge data and the original level data in the digital signal according to the target edge data and the number of the edge points includes:
calculating the difference between the edge point number and the target edge point number in the target edge data;
and updating the original edge data into the target edge data, and adjusting the original level data in the digital signal according to the difference value so as to inject edge faults into the digital signal, wherein the total number of data points in the digital signal before and after updating is the same.
Based on another aspect of the embodiments of the present invention, an embodiment of the present invention provides a signal edge fault injection apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an electrical signal sent by a measured object and converting the electrical signal into a digital signal;
the statistical unit is used for obtaining statistical information according to the digital signals; wherein the statistical information comprises level information and edge point number of the digital signal;
the generating unit is used for generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user;
the updating unit is used for updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points so as to inject edge faults into the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same.
Optionally, the statistical information further includes amplitude information, the edge fault injection configuration parameter information includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode; the generation unit includes:
the first determining subunit is used for determining the edge fault type when the injection of the edge fault is allowed according to the level information;
the first generation subunit is configured to generate the target edge data according to the edge value parameter and the edge point number parameter when the edge fault injection mode is an edge value configuration mode; when the edge injection mode is an edge value real-time generation mode, generating the target edge data according to the amplitude information and the edge point number parameters;
the updating unit is specifically configured to update the original edge data and the original level data in the digital signal according to the target edge data and the number of edge points under the condition that the target edge type is matched with the target edge data.
Optionally, the statistical information further includes amplitude information, the edge fault injection configuration parameter information includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode; the generation unit includes:
the second determining subunit is used for determining the edge fault type when the injection of the edge fault is allowed according to the level information;
the judging subunit is used for judging whether the target edge type is matched with the edge fault type when the edge fault is allowed to be injected;
a second generating subunit, configured to, when the determining subunit determines that the target edge type matches an edge fault type when the edge fault is allowed to be injected, perform: when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; and when the edge injection mode is an edge value real-time generation mode, generating the target edge type according to the amplitude information and the edge point number parameters.
Optionally, the updating unit includes:
a calculating subunit, configured to calculate a difference between the number of edge points and a target edge point number in the target edge data;
and the updating subunit is used for updating the original edge data into the target edge data and adjusting the original level data in the digital signal according to the difference value so as to inject edge faults into the digital signal, and the total number of data points in the digital signal before and after updating is the same.
Based on a further aspect of the embodiments of the present invention, an embodiment of the present invention provides a signal edge fault injection apparatus, including: the system comprises a bus interface, a master control device and a host interface; wherein:
the bus interface is connected with a tested object and used for receiving an electric signal sent by the tested object;
the host interface is connected with a host or application software and is used for receiving edge fault injection configuration parameter information input by a user through the host or application software;
the master device includes:
the configuration module is used for receiving and storing the edge fault injection configuration parameter information sent by the host interface;
the signal receiving module is used for receiving the electrical signal sent by the bus interface and converting the electrical signal into a digital signal;
the electrical value counting module is used for receiving the digital signal sent by the signal receiving module and obtaining counting information according to the digital signal; wherein the statistical information comprises level information and edge point number of the digital signal;
the edge generation module is used for receiving the statistical information sent by the electrical value statistical module, acquiring the edge fault injection configuration parameter information input by a user from the configuration module, and generating target edge data matched with the level information according to the statistical information and the edge fault injection configuration parameter information;
the edge injection module is used for receiving the digital signal sent by the signal receiving module and the target edge data sent by the edge generation module, and updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points so as to realize edge fault injection in the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same;
and the signal sending module is used for receiving the digital signal sent by the edge injection module after the edge fault is injected, converting the digital signal after the edge fault is injected into a new electrical signal and sending the new electrical signal to the bus interface.
Optionally, the main control device is implemented by a field programmable gate array FPGA.
In the signal edge fault injection method and device provided by the embodiment of the invention, the edge fault injection configuration parameter information is input by a user for determination and flexible configuration, and the edge fault injection can be performed on the tested objects (such as tested equipment, tested devices and tested systems) under the scenes of different bus types, different amplitudes, different rates and the like. In addition, the embodiment of the invention generates the target edge data matched with the level information in the statistical information according to the statistical information and the edge fault injection configuration parameter information, realizes the automatic adaptation and adjustment of the fault injection and the bus electrical characteristics, and has high universality, high flexibility, high application value and high practical use value, and is suitable for users to apply.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a signal edge fault injection method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another signal edge fault injection method according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for updating original edge data and original level data in a digital signal according to an embodiment of the present invention;
FIG. 4 is a comparison graph of edge fault injection before and after an embodiment of the present invention;
FIG. 5 is a flowchart of another method for injecting a signal edge fault according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a signal edge fault injection apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a generating unit according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another generation unit according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an update unit according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another signal edge fault injection apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The signal edge fault injection method and device provided by the embodiment of the invention can be used for performing edge electrical layer fault injection on bus signals. In the actual implementation process, part or all of parameters such as an edge injection mode, an edge value parameter, an edge point parameter (edge point or edge time), a target edge type (rising edge or falling edge) and the like of a bus signal can be flexibly set by a user, so that the purposes of quickly analyzing, verifying and positioning the tolerance and the robustness of the electrical characteristics of a tested object (such as tested equipment, a device, a system and the like) at the edge are achieved, and the method is high in universality, high in flexibility, high in practical use value and suitable for application of the user.
Example one
The signal edge fault injection method provided by the embodiment of the present invention is specifically applied to a signal edge fault injection device, which may be an FPGA (Field-Programmable Gate Array), an MCU (micro controller Unit), a DSP (digital signal processor), and the like, as shown in fig. 1. The method can comprise the following steps:
step 101, acquiring an electrical signal sent by a measured object, and converting the electrical signal into a digital signal.
The tested object can comprise a tested device, a tested system and the like, the tested object sends an electrical signal through the bus, and the electrical signal is converted into a digital signal after the electrical signal sent by the tested object is received.
In particular, embodiments of the present invention may utilize an AD (Analog-to-Digital) converter or signal transceiver to convert the electrical signal into a Digital signal.
102, obtaining statistical information according to the digital signal; wherein the statistical information includes level information and edge point number of the digital signal.
Specifically, the embodiment of the present invention may obtain statistical information by counting the level information and the number of edge points of the digital signal. Optionally, in the embodiment of the present invention, the amplitude information of the digital signal may be counted, that is, the obtained statistical information may further include the amplitude information of the digital signal.
The amplitude information of the digital signal includes a maximum amplitude, a minimum amplitude, and the like of the digital signal, and the level information of the digital signal includes level data, such as a high level signal, a low level signal, and the like.
And 103, generating target edge data matched with the level information according to the statistical information and the edge fault injection configuration parameter information input by the user.
In the practical application process of the embodiment of the invention, a user can input the edge fault injection configuration parameter information through a host or application software, and the input edge fault injection configuration parameter information can be sent to the signal edge fault injection device through a host interface. In the embodiment of the present invention, the edge fault injection configuration parameter information input by the user may include an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, may also include an edge point number parameter and a target edge type, and may also include an edge value parameter, an edge point number parameter, and a target edge type. In practical application, the information included in the fault injection configuration parameter information is determined according to actual requirements, but at least includes an edge point number parameter and a target edge type, the edge point number parameter is used for representing a target edge point number which is required to be injected forever, a slope of a finally injected fault can be determined according to the target edge point number, and the target edge type is used for representing an edge type which is required to be injected by a user. Wherein the edge point number parameter may include a target edge point number or an edge time.
The edge fault injection configuration parameter information input by the user can be stored in a preset designated position, after the statistical information is obtained, the edge fault injection configuration parameter information input by the user is read from the designated position, and then the target edge data matched with the level information is generated according to the statistical information and the edge fault injection configuration parameter information.
In the embodiment of the invention, when the level information indicates that the level signal is changed from a high level signal to a low level signal, the target edge data matched with the level information is falling edge data; when the level signal jumps from a low level signal to a high level signal, the target edge data matched with the level information is rising edge data.
The target edge data matched with the level information generated in the embodiment of the present invention at least includes a target edge point number and an edge value of each target edge point (also referred to as a data point). The expression manner of the edge value of each target edge point in the target edge data may be various, for example, the expression manner may be the amplitude of the digital signal, or the expression manner may be that the edge value of each target edge point is directly configured in the edge fault injection configuration parameter information.
Step 104, updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points so as to realize edge fault injection in the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same.
After the target edge data and the number of edge points in the digital signal are obtained, the original edge data in the digital signal is replaced by the target edge data, the original level data in the digital signal is updated at the same time, and the total number of data points in the digital signal before and after updating is the same after the edge fault is injected into the digital signal, so that the signal rate of the digital signal is not changed.
In the signal edge fault injection method provided by the embodiment of the invention, the edge fault injection configuration parameter information is input by a user to be determined and flexibly configured, and the edge fault injection can be performed on a tested object (such as a tested device, a tested device and a tested system) under the scenes of different bus types, different amplitudes, different rates and the like. In addition, the embodiment of the invention generates the target edge data matched with the level information in the statistical information according to the statistical information and the edge fault injection configuration parameter information, realizes the automatic adaptation and adjustment of the fault injection and the bus electrical characteristics, and has high universality, high flexibility, high application value and high practical use value, and is suitable for users to apply.
Example two
As shown in fig. 2, another signal edge fault injection method provided in an embodiment of the present invention is specifically applied to a signal edge fault injection apparatus, where edge fault injection configuration parameter information in the embodiment includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode. The method can comprise the following steps:
step 201, acquiring an electrical signal sent by a measured object, and converting the electrical signal into a digital signal.
Step 202, obtaining statistical information according to the digital signal; wherein the statistical information includes level information, edge point number and amplitude information of the digital signal.
And 203, determining the type of the edge fault when the edge fault is allowed to be injected according to the level information.
In the practical application process, when the current continuous high-level signal or the continuous low-level signal is determined according to the level information of the digital signal, the injection edge fault is judged not to be allowed currently, otherwise, the injection edge fault is judged to be allowed currently.
When the edge fault which is currently allowed to be injected is judged, when the fact that the level signal is changed from the high level signal to the low level signal in a jumping mode is detected, the type of the edge fault which is currently required to be injected can be determined to be a falling edge fault, and when the fact that the level signal is changed from the low level signal to the high level signal in a jumping mode is detected, the type of the edge fault which is currently required to be injected can be determined to be a rising edge fault.
Step 204, when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; and when the edge injection mode is an edge value real-time generation mode, generating the target edge data according to the amplitude information and the edge point number parameters.
Specifically, in the implementation process of the embodiment of the present invention, after determining that the edge fault is currently allowed to be injected, the embodiment of the present invention further needs to determine the edge value of each target edge point in the target edge data.
The edge value is a specific value of data points in the data signal, the number of the edge points is the number of the data points in the digital signal, and the edge injection mode is used for determining which mode the edge value in the generated target edge data is obtained by. The edge injection mode in the embodiment of the present invention may include two modes, one is an edge value configuration mode, and the other is an edge value real-time generation mode. When the edge injection mode is the edge value configuration mode, the edge value in the target edge data is the edge value in the edge fault injection configuration parameter information, namely the edge value input by the user, and the edge value is given by the edge value parameter. For example, assuming that the edge injection mode configured by the user is the edge configuration mode, and the number of edge points configured by the software is 10, the edge values include specific edge values corresponding to the 10 data points, such as 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, and 0xaa, and the target edge data can be determined by combining the edge values and the number of edge points. In this case, duplicate information in the statistical information is not needed. Of course, in the embodiment of the edge-only configuration mode, the amplitude information may not be included in the statistical information.
When the edge injection mode is an edge value real-time generation mode, the target edge data and the real-time edge value of each data point are obtained by calculating according to the level information and the amplitude information of the digital signal and the edge point number parameters in the edge fault injection configuration parameter information, and the currently calculated real-time edge value is used as the edge value in the target edge data. Of course, in an embodiment such as the edge-only real-time generation mode, the edge-value parameter may not be included in the edge-fault injection configuration parameter information.
The type of the generated target edge data is the same as the edge fault type determined according to the level information, that is, the target edge data is matched with the level information.
Step 205, in a situation that the target edge type matches the target edge data, updating the original edge data and the original level data in the digital signal according to the target edge data and the number of the edge points.
In the embodiment of the present invention, the target edge type may be understood as an enable parameter for a rising edge and a falling edge, and is used for deciding whether to update rising edge data or falling edge data. Colloquially, the target edge type may be understood as being used for fault injection on either a rising or falling edge. For example, when the target edge type input by the user is the rising edge injection enable and the falling edge injection is not enabled, it indicates that the rising edge fault can be currently injected, and the falling edge fault is not allowed to be injected. In other words, only when the generated target edge data is rising edge data, the target edge data and the target edge type are matched, and the digital signal is updated subsequently.
In this embodiment of the present invention, the target edge data generated in step 204 is specifically rising edge data or falling edge data, and the target edge type is rising edge enable or falling edge enable, so that when the target edge data is rising edge data and the target edge type is rising edge enable, it indicates that the target edge data and the target edge data are matched, when the target edge data is falling edge data and the target edge type is falling edge enable, it indicates that the target edge data and the target edge data are matched, and if the target edge data is falling edge data and the target edge type is rising edge enable, it indicates that the target edge data and the target edge data are not matched, or when the target edge data is rising edge data and the target edge type is falling edge enable, it indicates that the target edge data and the target edge data are not matched.
As a specific implementation manner of the embodiment of the present invention, the embodiment of the present invention may generate an identification signal for determining whether to update the edge data according to a result of whether the type of the target edge matches the target edge data, where the identification signal is carried in the target edge data (or not carried in the target edge data) and is used to indicate whether to update the edge data currently. For example, when the flag signal is 1, it indicates that the update of the edge data is currently permitted, and when the flag signal is 0, it indicates that the update of the edge data is not currently permitted. Of course, the enable signal matched with the target edge type may also be directly generated according to the target edge type, so that in step 205, it may be determined whether the target edge type matches the edge fault type when the edge fault is allowed to be injected according to the matching result of the enable signal and the target edge data.
After determining that the target edge type matches the edge fault type when the edge fault is allowed to be injected, the embodiment of the invention needs to update the digital signal. Specifically, in the embodiment of the present invention, an implementation method for updating original edge data and original level data in a digital signal according to the target edge data and the number of edge points may adopt a method shown in fig. 3, where the method may include:
step 301, calculating a difference between the number of edge points in the original edge data and the number of target edge points in the target edge data.
Optionally, in the embodiment of the present invention, it may be determined whether to update the edge data currently according to an enable signal or an identifier signal carried in the target edge data, and when it is determined that the edge data needs to be updated currently, step 301 is performed. The number of edge points in the original edge data in step 301 is the number of edge points in the statistical information. And the target edge points in the target edge data are the target edge points represented by the edge point parameters in the edge fault injection configuration parameter information.
Referring to fig. 4, it is assumed that the original digital signal is a signal that transits from a low level signal to a high level signal, wherein the low level portion corresponds to 40 original data points, the edge (rising edge) portion corresponds to 10 original data points, and the high level portion corresponds to 50 original data points, which collectively include 100 original data points.
Further, it is assumed that an edge value in the target edge data is an edge value in the edge fault injection configuration parameter information, and a target edge point number input by the user is 20, so that the difference between the edge point number in the original edge data and the edge point number in the target edge data can be calculated to be 10, that is, 10 data points.
Step 302, updating the original edge data to the target edge data, and adjusting the original level data in the digital signal according to the difference value to realize that the edge fault is injected into the digital signal, and the total number of data points in the digital signal before and after updating is the same.
In the embodiment of the invention, the edge points in the target edge data are 20 data points, and the edge points in the original edge data are replaced by 10 data points, and at the moment, the edge points in the original edge data are updated to be 20 data points. However, after the edge points in the original edge data are updated to 20 data points, the total number of the original data points in the original edge data is increased by 10 data points compared to the previous number, so that the embodiment of the present invention further needs to adjust the original level data in the digital signal, that is, the high level data and/or the low level data in fig. 4, according to the difference calculated in step 301, and delete 10 data points in the high level data and/or the low level data altogether, to ensure that the total number of the points after the fault injection is still 100, thereby ensuring that the signal rate is not changed after the edge fault is injected in the digital signal.
Fig. 4 shows that only the high portion of the signal is truncated by the corresponding 10 data points, and the final result is a low-level transition to a high-level transition, where the low portion corresponds to 40 data points, the rising portion corresponds to 20 data points, and the high portion corresponds to 40 data points, which is a total of 100 data points.
Of course, in the embodiment of the present invention, 10 corresponding data points may be deleted in the low level portion, or corresponding data points may be deleted in both the high level portion and the low level portion, where the sum of the number of the data points deleted in the high level portion and the number of the data points deleted in the low level portion is equal to 10.
In the signal edge fault injection method provided by the embodiment of the invention, the edge fault injection configuration parameter information is determined by user input, namely, the edge injection mode, the edge value parameter, the edge point number parameter and the edge type in the embodiment of the invention can be flexibly configured, and the edge fault injection method can meet the requirement of performing edge fault injection on a tested object (such as a tested device, a tested device and a tested system) under the scenes of different bus types, different amplitudes and different rates. In addition, the embodiment of the invention generates the target edge data matched with the level information in the statistical information according to the statistical information and the edge fault injection configuration parameter information, realizes the automatic adaptation and adjustment of the fault injection and the bus electrical characteristics, and has high universality, high flexibility, high application value and high practical use value, and is suitable for users to apply.
EXAMPLE III
As shown in fig. 5, a further signal edge fault injection method provided in an embodiment of the present invention is specifically applied to a signal edge fault injection apparatus, and the method may include:
step 501, obtaining an electrical signal sent by a measured object, and converting the electrical signal into a digital signal.
Step 502, obtaining statistical information according to the digital signal; wherein the statistical information includes level information, edge point number and amplitude information of the digital signal.
And 503, determining the type of the edge fault when the injection of the edge fault is allowed according to the level information.
The implementation principle of steps 501 to 503 in the third embodiment of the present invention is the same as that of steps 201 to 203 in the second embodiment, and the applicant does not describe any further here.
Step 504, determine whether the target edge type matches the edge fault type when the edge fault is allowed to be injected.
Wherein the target edge type and the edge fault type match when the injection of the edge fault is allowed means that the target edge type and the edge fault type when the injection of the edge fault is allowed are consistent, such as both for rising edge data or both for falling edge data.
Step 505, when the target edge type matches the edge fault type when the edge fault is allowed to be injected, executing: when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; and when the edge injection mode is an edge value real-time generation mode, generating the target edge type according to the amplitude information and the edge point number parameters.
Step 506, updating the original edge data and the original level data in the digital signal according to the target edge data and the number of the edge points.
The manner of updating the digital signal may refer to the embodiment shown in fig. 3, and is not described herein again.
The difference between the third embodiment of the present invention and the second embodiment of the present invention is that, after determining the edge fault type when the edge fault is currently allowed to be injected, the third embodiment of the present invention first determines whether the target edge type and the edge fault type when the edge fault is allowed to be injected are matched, and when determining the match, then performs step 505, otherwise stops the processing. Compared with the second embodiment, the third embodiment of the invention can determine whether the edge data updating is allowed to be executed at present or not more quickly, and improves the data processing efficiency.
It should be noted that, in practical applications, after the original edge data and the original level data in the digital signal are updated, the updated digital signal needs to be converted into an electrical signal, and the electrical signal obtained by the conversion needs to be injected into the bus, so as to implement final bus fault injection.
Based on the signal edge fault injection method provided by the foregoing embodiment of the present invention, an embodiment of the present invention further provides a signal edge fault injection apparatus, as shown in fig. 6, the apparatus may include:
an acquisition unit 10 for acquiring an electrical signal transmitted by a measured object and converting the electrical signal into a digital signal;
a statistical unit 20, configured to obtain statistical information according to the digital signal; wherein the statistical information comprises level information and edge point number of the digital signal;
a generating unit 30, configured to generate target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user;
an updating unit 40, configured to update original edge data and original level data in the digital signal according to the target edge data and the number of edge points, so as to inject an edge fault into the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same.
As an optional embodiment of the present invention, the statistical information may further include amplitude information, the edge fault injection configuration parameter information includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode, as shown in fig. 7, the generation unit 30 may further include:
a first determining subunit 31, configured to determine, according to the level information, an edge fault type when the injection of the edge fault is allowed according to the level information when the injection of the edge fault is allowed;
more specifically, the first determining subunit 31 is specifically configured to, when determining that the current signal is a continuous high-level signal or a continuous low-level signal according to the level information of the digital signal, determine that the injection edge fault is not currently allowed, otherwise, determine that the injection edge fault is currently allowed;
when the edge fault which is allowed to be injected currently is judged, when the fact that the high-level signal jumps to the low-level signal is detected, the type of the edge fault which needs to be injected currently is determined to be a falling edge fault, and when the low-level signal jumps to the high-level signal, the type of the edge fault which needs to be injected currently is determined to be a rising edge fault.
A first generating subunit 32, configured to generate the target edge data according to the edge value parameter and the edge point number parameter when the edge fault injection mode is an edge value configuration mode; and when the edge injection mode is an edge value real-time generation mode, generating the target edge data according to the amplitude information and the edge point number parameters.
At this time, the updating unit 40 is specifically configured to, under the condition that the target edge type is matched with the target edge data, update the original edge data and the original level data in the digital signal according to the target edge data and the number of the edge points.
As an optional embodiment of the present invention, the statistical information may further include amplitude information, and the edge fault injection configuration parameter information includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, where the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode. As shown in fig. 8, the generating unit 30 may further include:
a second determining subunit 33, configured to determine, according to the level information, an edge fault type when the injection of the edge fault is allowed according to the level information when the injection of the edge fault is allowed;
a judging subunit 34, configured to judge whether the target edge type matches an edge fault type when the edge fault is allowed to be injected;
a second generating subunit 35, configured to, when the determining subunit 34 determines that the target edge type matches the edge fault type when the edge fault is allowed to be injected, perform: when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; and when the edge injection mode is an edge value real-time generation mode, generating the target edge type according to the amplitude information and the edge point number parameters.
As shown in fig. 9, the updating unit 40 may further include:
a calculation subunit 41, configured to calculate a difference between the number of edge points and a target edge point number in the target edge data;
and an updating subunit 42, configured to update the original edge data to the target edge data, and adjust the original level data in the digital signal according to the difference, so as to inject an edge fault into the digital signal, where the total number of data points in the digital signal before and after updating is the same.
Based on the signal edge fault injection method provided in the foregoing embodiment of the present invention, an embodiment of the present invention further provides a signal edge fault injection apparatus, as shown in fig. 10, the apparatus may include: bus interface 100, master device 200, and host interface 300. Wherein:
the bus interface 100 is connected to the object to be tested, and is used for physically transmitting an electrical signal to the object to be tested. In the embodiment of the present invention, the bus interface 100 is specifically configured to receive an electrical signal sent by a measured object.
The host interface 300 is connected with a host or application software, and information interaction between the host interface 300 and the host or application software, such as injection parameter configuration management, state monitoring and the like, can be completed. In this embodiment of the present invention, the host interface 300 is specifically configured to receive edge fault injection configuration parameter information input by a user through the host or application software, where specific information included in the edge fault injection configuration parameter information may refer to the foregoing method embodiment, and for example, when the master device 200 executes the embodiment shown in fig. 2, the edge fault injection configuration parameter information may include an edge injection mode, an edge value parameter, an edge point number parameter, a target edge type, and the like.
The main control device 200 in the embodiment of the present invention may be implemented by an FPGA (Field-Programmable Gate Array). Of course, the system can also be implemented by using an MCU (micro controller Unit), a DSP (digital signal processing), a single chip, an arm (advanced RISC machines), or application software.
The main control device 200 in the embodiment of the present invention may include the following modules:
the configuration module 201 is connected to the host interface 300, and is configured to receive and store the edge fault injection configuration parameter information sent by the host interface 300, and support configuration management of each parameter in the edge fault injection configuration parameter information.
The signal receiving module 202 is connected to the bus interface 100, and is configured to receive an electrical signal sent by the bus interface 100 and convert the electrical signal into a digital signal. Specifically, the signal receiving module 202 may convert the electrical signal into a digital signal using an AD converter or a signal transceiver.
And the electrical value counting module 203 is connected with the signal receiving module 202 and is used for receiving the digital signal sent by the signal receiving module 202 and counting the amplitude information, the level information and the edge information of the digital signal to obtain statistical information.
The edge generating module 204 is connected to the configuration module 201 and the electrical value counting module 204, and configured to receive the statistical information sent by the electrical value counting module 203, acquire edge fault injection configuration parameter information input by a user from the configuration module 201, and generate target edge data according to the statistical information and the edge fault injection configuration parameter information.
An edge injection module 205, which is connected to both the signal receiving module 202 and the edge generating module 204, and configured to receive the digital signal sent by the signal receiving module 202 and target edge data sent by the edge generating module 204, and update original edge data and original level data in the digital signal according to the target edge data, so as to implement injection of an edge fault in the digital signal, and ensure that a signal rate is unchanged after the edge fault is injected in the digital signal;
and a signal sending module 206, connected to the edge injection module 205, configured to receive the digital signal sent by the edge injection module 205 after the edge fault is injected, convert the digital signal after the edge fault is injected into a new electrical signal, and send the new electrical signal to the bus interface 100.
Specifically, the signal sending module 206 may convert the digital signal after the edge fault is injected into a new electrical signal by using a DA converter or a signal transceiver.
In the signal edge fault injection device provided by the embodiment of the invention, by using the main control device 200, such as but not limited to an FPGA, a DSP, a single chip microcomputer or an ARM, a signal edge fault injection function can be realized, an edge injection mode, an edge type, and configurable edge points (or edge time) can be realized, fault injection and verification can be performed on a tested device, and a tested system on the aspects of different bus types, different amplitudes, different rate scenes, and different performances, and the signal edge fault injection device has high flexibility, is suitable for user application, and has high actual use value.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method and the apparatus for injecting a signal edge fault provided by the embodiment of the present invention are described in detail above, and a specific example is applied in the description to explain the principle and the implementation manner of the embodiment of the present invention, and the description of the embodiment is only used to help understanding the method and the core idea of the embodiment of the present invention; meanwhile, for a person skilled in the art, according to the idea of the embodiment of the present invention, there may be a change in the specific implementation and application scope, and in summary, the content of the present specification should not be construed as a limitation to the embodiment of the present invention.

Claims (8)

1. A method of signal edge fault injection, comprising:
acquiring an electrical signal sent by a measured object, and converting the electrical signal into a digital signal;
obtaining statistical information according to the digital signals; wherein the statistical information comprises level information and edge point number of the digital signal;
generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user;
updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points so as to inject edge faults into the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same;
wherein, the updating the original edge data and the original level data in the digital signal according to the target edge data and the number of the edge points comprises:
calculating the difference between the edge point number and the target edge point number in the target edge data;
and updating the original edge data into the target edge data, and adjusting the original level data in the digital signal according to the difference.
2. The method of claim 1, wherein the statistical information further includes amplitude information, the edge fault injection configuration parameter information includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode; generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user, wherein the target edge data comprises the following steps:
when the injection-allowed edge fault is judged according to the level information, determining the edge fault type when the injection-allowed edge fault is caused according to the level information;
when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; when the edge injection mode is an edge value real-time generation mode, generating the target edge data according to the amplitude information and the edge point number parameters;
updating the original edge data and the original level data in the digital signal according to the target edge data and the number of the edge points, wherein the updating comprises the following steps:
and under the condition that the target edge type is matched with the target edge data, updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points.
3. The method of claim 1, wherein the statistical information further includes amplitude information, the edge fault injection configuration parameter information includes an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode includes an edge value real-time generation mode and an edge value configuration mode; generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user, wherein the target edge data comprises the following steps:
when the injection-allowed edge fault is judged according to the level information, determining the edge fault type when the injection-allowed edge fault is caused according to the level information;
judging whether the target edge type is matched with the edge fault type when the edge fault is allowed to be injected;
when the target edge type and the edge fault type when the edge fault is allowed to be injected are matched, executing the following steps: when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; and when the edge injection mode is an edge value real-time generation mode, generating the target edge type according to the amplitude information and the edge point number parameters.
4. A signal edge fault injection apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an electrical signal sent by a measured object and converting the electrical signal into a digital signal;
the statistical unit is used for obtaining statistical information according to the digital signals; wherein the statistical information comprises level information and edge point number of the digital signal;
the generating unit is used for generating target edge data matched with the level information according to the statistical information and edge fault injection configuration parameter information input by a user;
the updating unit is used for updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points so as to inject edge faults into the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same;
wherein the update unit includes:
a calculating subunit, configured to calculate a difference between the number of edge points and a target edge point number in the target edge data;
and the updating subunit is used for updating the original edge data into the target edge data and adjusting the original level data in the digital signal according to the difference.
5. The apparatus of claim 4, wherein the statistical information further comprises amplitude information, the edge fault injection configuration parameter information comprises an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode comprises an edge value real-time generation mode and an edge value configuration mode; the generation unit includes:
the first determining subunit is used for determining the edge fault type when the injection of the edge fault is allowed according to the level information;
the first generation subunit is configured to generate the target edge data according to the edge value parameter and the edge point number parameter when the edge fault injection mode is an edge value configuration mode; when the edge injection mode is an edge value real-time generation mode, generating the target edge data according to the amplitude information and the edge point number parameters;
the updating unit is specifically configured to update the original edge data and the original level data in the digital signal according to the target edge data and the number of edge points under the condition that the target edge type is matched with the target edge data.
6. The apparatus of claim 4, wherein the statistical information further comprises amplitude information, the edge fault injection configuration parameter information comprises an edge injection mode, an edge value parameter, an edge point number parameter, and a target edge type, and the edge injection mode comprises an edge value real-time generation mode and an edge value configuration mode; the generation unit includes:
the second determining subunit is used for determining the edge fault type when the injection of the edge fault is allowed according to the level information;
the judging subunit is used for judging whether the target edge type is matched with the edge fault type when the edge fault is allowed to be injected;
a second generating subunit, configured to, when the determining subunit determines that the target edge type matches an edge fault type when the edge fault is allowed to be injected, perform: when the edge fault injection mode is an edge value configuration mode, generating the target edge data according to the edge value parameters and the edge point number parameters; and when the edge injection mode is an edge value real-time generation mode, generating the target edge type according to the amplitude information and the edge point number parameters.
7. A signal edge fault injection apparatus, comprising: the system comprises a bus interface, a master control device and a host interface; wherein:
the bus interface is connected with a tested object and used for receiving an electric signal sent by the tested object;
the host interface is connected with a host or application software and is used for receiving edge fault injection configuration parameter information input by a user through the host or application software;
the master device includes:
the configuration module is used for receiving and storing the edge fault injection configuration parameter information sent by the host interface;
the signal receiving module is used for receiving the electrical signal sent by the bus interface and converting the electrical signal into a digital signal;
the electrical value counting module is used for receiving the digital signal sent by the signal receiving module and obtaining counting information according to the digital signal; wherein the statistical information comprises level information and edge point number of the digital signal;
the edge generation module is used for receiving the statistical information sent by the electrical value statistical module, acquiring the edge fault injection configuration parameter information input by a user from the configuration module, and generating target edge data matched with the level information according to the statistical information and the edge fault injection configuration parameter information;
the edge injection module is used for receiving the digital signal sent by the signal receiving module and the target edge data sent by the edge generation module, and updating original edge data and original level data in the digital signal according to the target edge data and the number of the edge points so as to realize edge fault injection in the digital signal; wherein, the total number of data points in the digital signal before and after updating is the same;
the signal sending module is used for receiving the digital signal sent by the edge injection module after the edge fault is injected, converting the digital signal after the edge fault is injected into a new electrical signal and sending the new electrical signal to the bus interface;
when the edge injection module is configured to update the original edge data and the original level data in the digital signal according to the target edge data and the number of the edge points, the edge injection module specifically includes:
calculating the difference between the edge point number and the target edge point number in the target edge data;
and updating the original edge data into the target edge data, and adjusting the original level data in the digital signal according to the difference.
8. The apparatus of claim 7, wherein the master device is implemented using a Field Programmable Gate Array (FPGA).
CN201910124605.4A 2019-02-14 2019-02-14 Signal edge fault injection method and device Active CN109738732B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910124605.4A CN109738732B (en) 2019-02-14 2019-02-14 Signal edge fault injection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910124605.4A CN109738732B (en) 2019-02-14 2019-02-14 Signal edge fault injection method and device

Publications (2)

Publication Number Publication Date
CN109738732A CN109738732A (en) 2019-05-10
CN109738732B true CN109738732B (en) 2021-04-20

Family

ID=66367764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910124605.4A Active CN109738732B (en) 2019-02-14 2019-02-14 Signal edge fault injection method and device

Country Status (1)

Country Link
CN (1) CN109738732B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1740980A (en) * 2004-08-29 2006-03-01 华为技术有限公司 Fault filling method and apparatus based on programmable logical device
CN102413005A (en) * 2010-09-26 2012-04-11 北京旋极信息技术股份有限公司 Fault injection method
CN105052039A (en) * 2012-05-18 2015-11-11 美国亚德诺半导体公司 Calibrating interleaved ADCs mismatch using signal injection
CN105162458A (en) * 2015-08-28 2015-12-16 北京理工大学 Whole-spacecraft single-particle soft error time-frequency fault ground-based simulation system
CN105628406A (en) * 2015-12-28 2016-06-01 中南大学 High-speed train traction transmission control system fault injection method and simulation system
CN109217951A (en) * 2018-09-07 2019-01-15 深圳市紫光同创电子有限公司 A kind of transmission delay test method and device based on FPGA

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10290455B2 (en) * 2016-01-22 2019-05-14 Carling Technologies, Inc. Self testing GFCI

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1740980A (en) * 2004-08-29 2006-03-01 华为技术有限公司 Fault filling method and apparatus based on programmable logical device
CN102413005A (en) * 2010-09-26 2012-04-11 北京旋极信息技术股份有限公司 Fault injection method
CN105052039A (en) * 2012-05-18 2015-11-11 美国亚德诺半导体公司 Calibrating interleaved ADCs mismatch using signal injection
CN105162458A (en) * 2015-08-28 2015-12-16 北京理工大学 Whole-spacecraft single-particle soft error time-frequency fault ground-based simulation system
CN105628406A (en) * 2015-12-28 2016-06-01 中南大学 High-speed train traction transmission control system fault injection method and simulation system
CN109217951A (en) * 2018-09-07 2019-01-15 深圳市紫光同创电子有限公司 A kind of transmission delay test method and device based on FPGA

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种航空数字控制器的故障注人系统设计;朱广荣 等;《中国水运》;20080131;第8卷(第1期);第59-60页 *

Also Published As

Publication number Publication date
CN109738732A (en) 2019-05-10

Similar Documents

Publication Publication Date Title
CN112491135B (en) Power carrier and information fusion-based method and system for identifying low-voltage topology in power distribution network
KR20100053895A (en) Testing method and its apparatus of digital substation merging unit
CA3128075C (en) Simulated battery construction method and simulated battery construction device
CN109738732B (en) Signal edge fault injection method and device
CN107092502B (en) Automatic application configuration method and device based on cloud operating system
CN109815102A (en) A kind of test data statistical method, device and storage medium
CN112419094B (en) Power distribution Internet of things data product construction method and device and readable storage medium
CN105612674A (en) Method and device for signaling and controlling a power grid coupling a plurality of actuators
CN109741743A (en) A kind of control method and device of equipment, non-volatile memory medium
CN110858223A (en) Playback method, system, server and client based on database
CN102495335B (en) Sensitivity detection method of travelling wave distance measuring device and system thereof
CN109684879B (en) Universal monitoring method and system for domestic software and hardware equipment
CN109256791B (en) Power control method and power control equipment of energy storage unit
US6545454B1 (en) System and method for testing an integrated circuit device using FFT analysis based on a non-iterative FFT coherency analysis algorithm
CN109948316A (en) Fingerprint processing method and device and storage medium
CN109150322B (en) Vector standing-wave ratio obtaining method, FPGA and remote radio frequency unit
CN116893977B (en) Automatic deployment method, device, equipment and medium for distributed simulation test environment
CN111176192B (en) Flow control system, method and device for controlling chip starting flow
CN116366477B (en) Train network communication signal detection method, device, equipment and storage medium
CN117411190B (en) Power distribution network topology identification method, equipment, system and medium based on multi-source information
CN112348074B (en) Power distribution network power failure event accurate diagnosis method, device and system based on data driving
US20240051423A1 (en) Charging pile type recognition
CN117764007A (en) Megawatt charging device situation detection method and device
CN115344643A (en) Synchronous recording system for cluster energy storage battery information
CN113450767A (en) Voice recognition test method, device, test equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant