CN113225232B - Hardware testing method and device, computer equipment and storage medium - Google Patents

Hardware testing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113225232B
CN113225232B CN202110519065.7A CN202110519065A CN113225232B CN 113225232 B CN113225232 B CN 113225232B CN 202110519065 A CN202110519065 A CN 202110519065A CN 113225232 B CN113225232 B CN 113225232B
Authority
CN
China
Prior art keywords
data
test
message
test instruction
instruction message
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
CN202110519065.7A
Other languages
Chinese (zh)
Other versions
CN113225232A (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.)
FAW Group Corp
Original Assignee
FAW Group Corp
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 FAW Group Corp filed Critical FAW Group Corp
Priority to CN202110519065.7A priority Critical patent/CN113225232B/en
Publication of CN113225232A publication Critical patent/CN113225232A/en
Application granted granted Critical
Publication of CN113225232B publication Critical patent/CN113225232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a hardware testing method and device, computer equipment and a storage medium. The method comprises the following steps: analyzing the test instruction message to obtain a detection type corresponding to the test instruction message; inquiring and calling a matched test program according to the detection type; and acquiring the test result of the matched test program, and generating a feedback message for responding. The embodiment of the invention can quickly and accurately test the hardware, improve the efficiency and the accuracy of the hardware test and reduce the labor cost of the test.

Description

Hardware testing method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of data processing, in particular to a hardware testing method and device, computer equipment and a storage medium.
Background
The domain controller may divide functions of each part of the automobile electronics into a plurality of domains, such as a power transmission domain, a body Electronic domain, an auxiliary driving domain, a chassis domain, and the like, and then replace a conventional distributed architecture by using most functions of each Electronic Control Unit (ECU) originally belonging to a Control domain with a relatively centralized Processing capability of a multi-core Central Processing Unit (CPU) and/or a Graphics Processing Unit (GPU) chip.
In an existing chassis Area Controller, there are various signals, for example, an air compressor temperature sensor, a five-way valve pressure sensor, a vehicle body acceleration sensor signal, a high-side drive diagnosis, a low-side drive diagnosis, a power drive power supply voltage acquisition, a reserved power supply output voltage acquisition, a key gate signal acquisition, a Controller Area Network (CAN) wake-up signal, a CAN error signal, a high-side switching value input, a low-side switching value input, and the like.
In the method, the types and the number of signals controlled by the chassis domain are large, and the writing and debugging of the test software program are easy to make mistakes. Moreover, the tester is different from the developer, and the tester needs to know the system developed by the developer completely to realize the hardware test accurately.
Disclosure of Invention
The embodiment of the invention provides a hardware testing method, a hardware testing device, computer equipment and a storage medium, which can quickly and accurately test hardware, improve the efficiency and accuracy of hardware testing and reduce the labor cost of testing.
In a first aspect, an embodiment of the present invention provides a hardware testing method, including:
analyzing the test instruction message to obtain a detection type corresponding to the test instruction message;
inquiring and calling a matched test program according to the detection type;
and acquiring the test result of the matched test program, and generating a feedback message for responding.
In a second aspect, an embodiment of the present invention further provides a hardware testing apparatus, including:
the detection type acquisition module is used for analyzing the test instruction message to obtain a detection type corresponding to the test instruction message;
the program classification calling module is used for inquiring and calling the matched test program according to the detection type;
and the test result feedback module acquires the test result of the matched test program and generates a feedback message for responding.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the hardware testing method according to any one of the embodiments of the present invention when executing the computer program.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the hardware testing method according to any one of the embodiments of the present invention.
The embodiment of the invention determines the detection type by analyzing the test instruction message, calls the test program matched with the detection type, and feeds the test result back to the requesting party, thereby solving the problems of multiple signal types, high test difficulty and high test labor cost in the prior art, and carrying out different types of tests through message indication, improving the efficiency and accuracy, reducing the test difficulty and reducing the test labor cost.
Drawings
FIG. 1 is a flowchart of a hardware testing method according to a first embodiment of the present invention;
FIG. 2a is a flowchart of a hardware testing method according to a second embodiment of the present invention;
FIG. 2b is a diagram illustrating a hardware structure according to a second embodiment of the present invention;
FIG. 2c is a diagram illustrating a software structure according to a second embodiment of the present invention;
FIG. 2d is a flowchart of a hardware testing method according to the second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a hardware testing apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device in the fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a hardware testing method in a first embodiment of the present invention, where this embodiment is applicable to a situation of testing a controller, and the method may be executed by a hardware testing apparatus provided in the first embodiment of the present invention, and the apparatus may be implemented in a software and/or hardware manner, and may be generally integrated into a computer device. As shown in fig. 1, the method of this embodiment specifically includes:
s110, analyzing the test instruction message to obtain the detection type corresponding to the test instruction message.
The test command message may be information carried by an input signal received by the controller, where the controller may be a chassis domain controller. The test instruction message is used for instructing the controller to execute corresponding test operation so as to test whether the corresponding function of the controller is normal. The test instruction message is analyzed, and data included in the test instruction message can be extracted from the test instruction message according to a predefined data format of the test instruction message. Usually hardware devices are mounted on a bus, and the data carriers communicating on the bus are data frames, usually including a frame start, an arbitration segment, a control segment, a data segment, a cycle check segment, an acknowledgement segment, and a frame end. And analyzing the test instruction message, and actually extracting data of the data section from the data frame. Typically a maximum of 8 bytes are included in a data segment. One data bit represents one byte. The detection type is used to determine the task type for the controller to perform the test task, i.e., determine what type of test to perform on the hardware.
Illustratively, the test instruction message is a controller area network message in the chassis domain controller.
The test instruction message is a Controller Area Network (CAN) message. CAN is a high performance, high reliability, easy to develop, and low cost field bus for the detection and control of various processes or devices. The method can be widely applied to detection of each device in the automobile controller domain, such as detection of an automobile chassis domain controller.
And S120, inquiring and calling the matched test program according to the detection type.
The test program is used to detect one or a class of functions of the hardware device. The test program is matched with the detection type.
For example, the test programs may include an analog quantity reading program, a digital quantity reading program, a frequency quantity reading program, a digital quantity output program, an Integrated Circuit bus (I2C) reading and writing program, a Serial Peripheral Interface (SPI) reading and writing program, a CAN transceiver program, and the like. In addition, the test programs can be increased or decreased according to the needs, only the test programs need to be specified, and the matched detection types are established.
S130, obtaining the test result of the matched test program, and generating a feedback message for responding.
The test results are used to describe the test results of the hardware test, and for example, the test results may include: test normal, test failed, or invalid commands. And generating a feedback message according to the test result, wherein the feedback message has the same data structure as the test instruction message. And adding the test result to the specified data bit of the message to form a feedback message.
The embodiment of the invention determines the detection type by analyzing the test instruction message, calls the test program matched with the detection type, and feeds the test result back to the requesting party, thereby solving the problems of multiple signal types, high test difficulty and high test labor cost in the prior art, and carrying out different types of tests through message indication, improving the efficiency and accuracy, reducing the test difficulty and reducing the test labor cost.
Example two
Fig. 2a is a flowchart of a hardware testing method according to a second embodiment of the present invention, which is embodied on the basis of the above embodiments. Analyzing the test instruction message to obtain a detection type corresponding to the test instruction message, which is embodied as follows: analyzing the test instruction message to obtain data of at least one data bit of the test instruction message; in the data of each of the data bits, a detection type is determined based on the data of the designated data bit.
The method of the embodiment specifically includes:
s210, analyzing the test instruction message to obtain data of at least one data bit of the test instruction message.
The test instruction message can be analyzed according to the transmission protocol, the data section is inquired in the test instruction message, and the data of at least one data bit is obtained in the data section.
Reference may be made to the description of the embodiments above without specific recitation to embodiments of the invention.
Optionally, the analyzing the test instruction packet includes: according to a preset check rule, carrying out validity detection on the test instruction message; and when the detection result of the test instruction message is an effective result, analyzing the test instruction message.
The check rule is used for detecting whether the data of each data bit in the test instruction message is correct and complete. Illustratively, the Check rule may be a Cyclic Redundancy Check (CRC) Check rule. The validity check is used to determine whether the data of each data bit in the test command message is correct and complete. The detection result of the validity detection includes a valid result or an invalid result. The valid result shows that the data of each data bit in the test instruction message is correct and complete; the invalid result indicates that the data bits in the test instruction message are erroneous and/or incomplete. The correctness and completeness of each data bit in the test instruction message can mean that the data of each data bit in the test instruction message is consistent with the data of each data bit when the test instruction message is sent, that is, the test instruction message is not interfered in the transmission process so as to cause data loss or change; an error and/or an incomplete state of each data bit in the test instruction message may mean that the data of each data bit in the test instruction message is different from the data of each data bit in the test instruction message when the test instruction message is sent. When the detection result of the test instruction message is a valid result, it is indicated that the data of each data bit in the test instruction message is correct and complete, so that the result obtained by analysis is correct and complete.
By checking the test instruction message in advance and analyzing the test instruction message when the detection result is a valid result, a correct analysis result is obtained, the analysis accuracy is improved, and the analysis cost is reduced.
Optionally, the determining, in the data of each data bit, the detection type according to the data of the designated data bit includes: carrying out XOR logic calculation on data in other data bits except the last data bit in sequence according to bits; comparing the logic calculation result with the data of the last data bit; when the comparison result is the same result, inquiring the data of the appointed data bit in the data of each data bit; and determining the detection type according to the data of the specified data bit.
The data in the last data bit is used to verify the data of each data bit in the data segment. The other data bits are data bits except the last data bit in the data segment of the test instruction message. The sequential exclusive-or logic may be that the exclusive-or logic calculation is performed on the other data bits sequentially according to the order of each other data bit. Wherein, the XOR algorithm is as follows: exclusive OR of a and b, using the formula: and a ≦ b. If the two values of a and b are not the same, the XOR result is 1. If the values of a and b are the same, the XOR result is 0. The Byte0 is the first data bit. Byte7 is the last data bit.
The format of the data frame in the test instruction message is shown in table 1 below:
TABLE 1
Figure BDA0003063213940000071
Wherein the data in the leading data bit Byte0 identifies the detection type. Illustratively, the data of Byte0 is 0, and the corresponding detection type is an analog quantity reading test type; the data of the Byte0 is 1, and the corresponding detection type is a digital quantity reading test type; the data of Byte0 is 2 (e.g., 10 in 2-ary), the corresponding detection type is a frequency quantity reading test type, and other cases can be configured as required. The last bit Byte7 is used as a check bit to check whether the Byte0-Byte7 data is correct and complete. The second Byte1 is used as a signal sequence number to identify which pin the test command message is received from and/or to identify which peripheral the test command message is received from. The Byte2-Byte6 is used for carrying valid data.
Whether the calculation results of the sequential exclusive or logics of the Byte7 and the Byte0-Byte6 are the same or not is calculated based on the following formula:
Byte7?=Byte0⊕Byte1⊕Byte2⊕Byte3⊕Byte4⊕Byte5⊕Byte6
the comparison result is used to describe whether the data of each data bit is correct and complete. The comparison results may include the same result or different results. Wherein, the same result indicates that the data of each data bit in the test instruction message is correct and complete; different results indicate data errors and/or incompleteness of data bits in the test instruction message. When the comparison result is the same, it can be shown that the data of each data bit in the test instruction message is correct and complete, and at this time, the data of the specified data bit can be queried and the detection type can be determined to obtain the correct detection type.
The method comprises the steps of carrying out XOR logic calculation on data of data bits except the last data bit in sequence according to bits in advance, comparing a logic calculation result with the last data bit, and determining a detection type according to the data of the specified data bit when the comparison result is an effective result so as to obtain a correct detection type, improve the detection accuracy of the detection type and reduce the determination cost of the detection type.
Optionally, before analyzing the test instruction packet, the method further includes: receiving an original message; detecting the original message according to a preset transmission protocol; and when the data format of the original message is the data format specified by the transmission protocol, determining the message as a test instruction message.
The original message is a message received by the local device. In fact, different types of messages may be received by the native device. The preset transmission protocol is used for screening the messages to screen out the test instruction messages, and the transmission protocol may include a data format of the test instruction messages. The data format of the original message is the data format specified by the transmission protocol, which indicates that the data format of the original message meets the data format requirement specified by the transmission protocol, so that the original message can be determined to be the test instruction message. Illustratively, the transmission protocol is the CAN transmission protocol.
By configuring the transmission protocol and detecting the original message according to the transmission protocol, the test instruction message can be quickly and accurately screened out, so that the hardware is tested according to the test instruction message, and the test accuracy and efficiency are improved.
S220, in the data of each data bit, the detection type is determined according to the data of the appointed data bit.
The data of the data bits in different orders may specify the represented function in the transport protocol. For example, one data bit, i.e., a designated data bit, may be selected from a plurality of data bits as a criterion for determining the detection type. The corresponding relation between the data in the data bits and the detection type can be established, and the detection type corresponding to the data of the specified data bits can be inquired according to the data of the specified data bits and the corresponding relation.
Optionally, the test instruction packet includes 8 data bits, and the specified data bit is a first data bit.
The test command message includes 8 data bits, each of which is a Byte. The 8 data bits are arranged according to a preset sequence, and in each data bit, the first data bit is determined as a designated data bit, wherein the data in the designated data bit is used for identifying the detection type.
By configuring the first data bit into the designated data bit in the test instruction message, the data bit for identifying the detection type can be designated quickly, so that the connection between the test instruction message and the detection type is established quickly, the detection type is determined according to the test instruction message, and the test accuracy is improved.
And S230, inquiring and calling the matched test program according to the detection type.
S240, obtaining the test result of the matched test program, and generating a feedback message for responding.
The structure of the data segment in the data frame of the feedback packet is shown in table 2:
TABLE 2
Figure BDA0003063213940000091
Wherein, the data in the first data bit Byte0 identifies the command response result, i.e. the test result of the test operation corresponding to the identification detection type, exemplarily, the data of Byte0 is 0, and the corresponding test result is a success result; the data of Byte0 is 1, and the corresponding test result is a failure result; the data of Byte0 is 2 (e.g., 10 in 2-ary), and the corresponding test result is an invalid result of the test instruction. The last bit Byte7 is used as a check bit to check whether the Byte0-Byte7 data is correct and complete. The second Byte1 is used as a signal sequence number to identify the test command message. The Byte2-Byte6 is used for carrying valid data.
In a specific example, the chassis domain controller hardware provided by the embodiment of the present invention is shown in fig. 2b, wherein the hardware system includes 24 analog input signals (air compressor temperature sensor, five-way valve pressure sensor, vehicle body acceleration sensor signal, Printed Circuit Board (PCB) Board temperature, high-side driving diagnosis, low-side driving diagnosis, power driving power voltage acquisition, power chip output voltage acquisition, battery voltage acquisition, compressor relay output voltage acquisition, reserved power output voltage acquisition, etc.), 10 digital input signals (key gate signal acquisition, CAN wake-up signal, CAN error signal, high-side switching value input, low-side switching value input, etc.), 32 digital output signals (five-way valve air bag valve control signal, compressor valve pressurization control signal, compressor relay control signal, etc.), 32 digital output signals (five-way valve air bag valve control signal, compressor valve pressurization control signal, compressor relay control signal, etc.), and the like, A power chip control signal, a low-side drive output enable signal, a low-side drive output control signal, a high-side drive output notification signal), 4 channels of frequency quantity input signals (vehicle height Sensor signals), 5 channels of SPI communication signals (power, solenoid valve drive, low-side drive, Electrically Erasable Programmable Read Only Memory (EEPROM), a Sensor based on a Sensor Peripheral Interface 5 (PSI 5), 1 channel of I2C signals (6-axis acceleration Sensor chip), 4 channels of CAN communication signals (chassis CAN, calibration CAN, and 2 channels of reserved CAN signals).
Actually, the hardware test provided by the embodiment of the present invention receives the CAN message through the calibration CAN communication interface, that is, the calibration CAN communication interface of the chassis domain controller is used as the communication interface of the test software. Accordingly, a structure diagram of the test software for hardware testing provided by the embodiment of the present invention is shown in fig. 2 c. The top software interface is associated with the calibrated CAN communication interface and is used for processing the message received from the calibrated CAN communication interface. Generally, a chassis domain controller receives a plurality of different types of messages, and a hardware pin of the controller can be configured in advance to which type of peripheral or which peripheral corresponds, so that the message received from the pin is the message received by the peripheral of the corresponding type. For example, as shown in table 1 and table 2, a signal sequence number may be configured in the message to correspond to the target pin, and thus to the target peripheral. And the CAN message filtering and checking program is used for detecting whether the message is a CAN message and detecting the validity of the CAN message. And the CAN protocol layer software is used for detecting whether the received message is a CAN message or not based on the CAN protocol. The bottom driver (MCAL) is used to configure which type of peripheral or which peripheral the controller hardware pins correspond to. And the signal classification processing program is used for inquiring and calling the testing program matched with the detection type according to the detection type so as to execute the test on the chassis domain controller. The hardware interface may refer to a calibrated CAN communication interface for receiving or transmitting a CAN message. The MCAL can visually edit and configure functions such as pins, the difficulty of pin function configuration is reduced, the situation of manually editing codes is reduced, and the accuracy and efficiency of pin function configuration are improved.
In a specific application scenario, as shown in fig. 2d, the hardware testing method may include:
and S251, receiving the CAN message.
And S252, calibrating CAN message filtering.
And filtering identification Information (ID) of the message through a CAN message filtering and checking program. And judging whether the ID is valid, if so, executing S253, otherwise, discarding the message, and ending.
And S253, judging whether the message accords with the CRC rule, and if so, executing S254-S261 respectively.
And simultaneously, the microcontroller analyzes the CAN message and determines the detection type according to the first byte, namely the data in the first data bit. And judging which processing program should be called according to the detection type.
If the message does not accord with the CRC rule, the message is discarded, and the process is finished.
S254, judging whether the Byte0 command value is an analog quantity reading command, if so, executing S262.
Otherwise, S255 is executed.
S255, determine whether the Byte0 command value is a digital quantity reading command, if yes, execute S263.
Otherwise, S256 is executed.
S256, judging whether the command value of Byte0 is a frequency reading command, if so, executing S264.
Otherwise, S257 is performed.
S257, it is determined whether the Byte0 command value is a digital quantity output command, and if so, S265 is executed. Otherwise, S258 is executed.
S258, judging whether the command value of the Byte0 is the I2C communication command, if so, executing S266. Otherwise, S259 is performed.
S259, determine whether the Byte0 command value is an SPI communication command, if so, execute S267. Otherwise, S260 is performed.
S260, judging whether the command value of the Byte0 is a CAN communication command or not, and if so, executing S268. Otherwise, S261 is executed.
S261, judging whether the command value of Byte0 is an invalid command, if yes, executing S269.
Otherwise, discarding the message, and ending.
And S262, calling an analog quantity reading program.
The analog quantity reading program is used for reading the analog quantity signal.
And S263, calling a digital quantity reading program.
The digital quantity reading program is used for reading the digital quantity signal.
S264, a frequency reading program is called.
The frequency quantity reading program is used for reading the frequency quantity signal.
And S265, calling a digital quantity output program.
The digital quantity output program is used for outputting a digital quantity signal.
And S266, calling the I2C read-write program.
The I2C read-write program is used to read or write the I2C transmission signal.
And S267, calling the SPI read-write program.
The SPI read-write program is used for reading or writing the SPI transmission signal.
And S268, calling a CAN transceiving program.
The CAN read-write program is used for reading or writing CAN transmission signals.
S269, 100ms task calibrates the CAN transmission program.
The 100ms task is a timing task of 100ms, and whether a feedback message is generated or not needs to be detected within 100ms and sent to a request party. And replying a response CAN message in the task of the 100ms period.
An Autorix series single chip microcomputer can be adopted, a Micro Control Unit (MCU) is configured by using an MCAL programming tool supporting an Autosar architecture, the MCU resource is used for producing a bottom layer drive code conforming to the Autosar architecture, and the signal processing of the software of the chassis domain controller is classified according to the signal type, so that the hardware test software of the chassis domain controller is easy to read and maintain. The top-level logic programming of the chassis domain controller hardware test program is realized by using a data transmission method based on a CAN protocol with data verification, so that the problem of data failure caused by factors such as Electromagnetic Compatibility (EMC) interference of communication equipment or a test environment is avoided, and the safe and effective transmission of data is ensured. In fact, the embodiment of the invention realizes the hardware classification test of the chassis domain controller. Meanwhile, the hardware test program of the chassis domain controller is programmed by using an MCAL configuration tool through a bottom driver, and the test logic of top software realizes a method for classifying and processing according to signal types. And, the hardware test program CAN protocol of the chassis domain controller increases check bits, and the check of CAN data is realized by carrying out XOR operation according to the bits. The test platform can support manual test, environmental test, EMC test and the like of chassis domain controller hardware, and has flexible expandability. The method of classification processing according to the types of the input and output signals of the MCU can flexibly adapt to the increase and decrease of the input quantity and the output quantity; meanwhile, CRC (cyclic redundancy check) is carried out on CAN bus receiving and sending data, and the correctness and the safety of data transmission are ensured.
The embodiment of the invention analyzes the test instruction message to obtain the data of a plurality of data bits, configures the appointed data bits in the plurality of data bits, and determines the detection type according to the data of the appointed data bits, can accurately determine the detection type according to the test instruction message, and improves the detection accuracy of the detection type, thereby indicating different types of tests by appointing the detection type through the test instruction message, improving the test efficiency and accuracy, reducing the test difficulty, and reducing the test labor cost.
EXAMPLE III
Fig. 3 is a schematic diagram of a hardware testing apparatus according to a third embodiment of the present invention. The third embodiment is a corresponding device for implementing the hardware testing method provided by the above embodiments of the present invention, and the device can be implemented in a software and/or hardware manner, and can be generally integrated into a computer device.
Accordingly, the apparatus of the present embodiment may include:
the detection type obtaining module 310 is configured to analyze the test instruction packet to obtain a detection type corresponding to the test instruction packet;
a program classification calling module 320, configured to query and call a matched test program according to the detection type;
and the test result feedback module 330 is configured to obtain a test result of the matched test program, and generate a feedback message to respond.
The embodiment of the invention determines the detection type by analyzing the test instruction message, calls the test program matched with the detection type, and feeds the test result back to the requesting party, thereby solving the problems of multiple signal types, high test difficulty and high test labor cost in the prior art, and carrying out different types of tests through message indication, improving the efficiency and accuracy, reducing the test difficulty and reducing the test labor cost.
Further, the detection type obtaining module 310 is specifically configured to: analyzing the test instruction message to obtain data of at least one data bit of the test instruction message; in the data of each of the data bits, a detection type is determined based on the data of the designated data bit.
Further, the test instruction packet includes 8 data bits, and the specified data bit is a first data bit.
Further, the detection type obtaining module 310 is specifically configured to: according to a preset check rule, carrying out validity detection on the test instruction message; and when the detection result of the test instruction message is an effective result, analyzing the test instruction message.
Further, the detection type obtaining module 310 is specifically configured to: carrying out XOR logic calculation on data in other data bits except the last data bit in sequence according to bits; comparing the logic calculation result with the data of the last data bit; when the comparison result is the same result, inquiring the data of the appointed data bit in the data of each data bit; and determining the detection type according to the data of the specified data bit.
Further, the hardware testing apparatus further includes: the message screening module is used for receiving an original message before analyzing the test instruction message; detecting the original message according to a preset transmission protocol; and when the data format of the original message is the data format specified by the transmission protocol, determining the message as a test instruction message.
Further, the test instruction message is a controller area network message in the chassis domain controller.
The device can execute the method provided by the embodiment of the invention and has corresponding functional components and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 4 is only one example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 4, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16. The computer device 12 may be a device that is attached to a bus.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a PerIPheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read-Only Memory (CD-ROM), Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program components configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program components 42 may be stored, for example, in system memory 28, such program components 42 including but not limited to an operating system, one or more application programs, other program components, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program component 42 generally performs the functions and/or methods of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 22. Further, computer device 12 may also communicate with one or more networks (e.g., Local Area Network (LAN), Wide Area Network (WAN)) via Network adapter 20. As shown, Network adapter 20 communicates with other components of computer device 12 via bus 18. it should be understood that although not shown in FIG. 4, other hardware and/or software components may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, Redundant processing units, external disk drive array (RAID) systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing, such as implementing the methods provided by any of the embodiments of the present invention, by executing programs stored in the system memory 28.
EXAMPLE five
Fifth, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the hardware testing method provided in all the inventive embodiments of the present application:
that is, the program when executed by the processor implements: analyzing the test instruction message to obtain a detection type corresponding to the test instruction message; inquiring and calling a matched test program according to the detection type; and acquiring the test result of the matched test program, and generating a feedback message for responding.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a LAN or a WAN, or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A method of hardware testing, comprising:
analyzing the test instruction message to obtain a detection type corresponding to the test instruction message;
inquiring and calling a matched test program according to the detection type;
obtaining the test result of the matched test program, and generating a feedback message for responding;
the analyzing the test instruction message to obtain the detection type corresponding to the test instruction message includes:
analyzing the test instruction message to obtain data of at least one data bit of the test instruction message;
in the data of each of the data bits, a detection type is determined based on the data of the designated data bit.
2. The method of claim 1, wherein the test instruction packet includes 8 data bits, and wherein the designated data bits are first data bits.
3. The method of claim 1, wherein parsing the test instruction packet comprises:
according to a preset check rule, carrying out validity detection on the test instruction message;
and when the detection result of the test instruction message is an effective result, analyzing the test instruction message.
4. The method of claim 3, wherein determining the detection type from the data of the designated data bit among the data of each data bit comprises:
carrying out XOR logic calculation on data in other data bits except the last data bit in sequence according to bits;
comparing the logic calculation result with the data of the last data bit;
when the comparison result is the same result, inquiring the data of the appointed data bit in the data of each data bit;
and determining the detection type according to the data of the specified data bit.
5. The method of claim 1, further comprising, prior to parsing the test instruction packet:
receiving an original message;
detecting the original message according to a preset transmission protocol;
and when the data format of the original message is the data format specified by the transmission protocol, determining the message as a test instruction message.
6. The method of claim 1, wherein the test order message is a controller area network message in a chassis domain controller.
7. A hardware testing apparatus, comprising:
the detection type acquisition module is used for analyzing the test instruction message to obtain a detection type corresponding to the test instruction message; the program classification calling module is used for inquiring and calling the matched test program according to the detection type;
the test result feedback module is used for acquiring the test result of the matched test program and generating a feedback message for responding;
the detection type acquisition module is specifically used for analyzing a test instruction message and acquiring data of at least one data bit of the test instruction message; in the data of each of the data bits, a detection type is determined based on the data of the designated data bit.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the hardware testing method according to any of claims 1-6 when executing the program.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the hardware testing method according to any one of claims 1 to 6.
CN202110519065.7A 2021-05-12 2021-05-12 Hardware testing method and device, computer equipment and storage medium Active CN113225232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110519065.7A CN113225232B (en) 2021-05-12 2021-05-12 Hardware testing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110519065.7A CN113225232B (en) 2021-05-12 2021-05-12 Hardware testing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113225232A CN113225232A (en) 2021-08-06
CN113225232B true CN113225232B (en) 2022-06-10

Family

ID=77095252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110519065.7A Active CN113225232B (en) 2021-05-12 2021-05-12 Hardware testing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113225232B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710432B (en) * 2022-03-24 2023-10-10 武汉光庭信息技术股份有限公司 Vehicle-mounted Ethernet communication joint debugging method and system
CN115503418A (en) * 2022-09-27 2022-12-23 中国第一汽车股份有限公司 Five-connection valve function safety circuit and method for chassis domain controller system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4628158A (en) * 1982-07-16 1986-12-09 At&T Bell Laboratories Stored program controller
WO2004010437A1 (en) * 2002-07-22 2004-01-29 Advanced Micro Devices, Inc. Built-in-self-test of flash memory cells
US7028240B1 (en) * 2002-07-22 2006-04-11 Advanced Micro Devices, Inc. Diagnostic mode for testing functionality of BIST (built-in-self-test) back-end state machine
CN105472083A (en) * 2015-12-08 2016-04-06 北京奇虎科技有限公司 Testing method and system for wireless terminals
WO2019205280A1 (en) * 2018-04-24 2019-10-31 平安科技(深圳)有限公司 Server testing method, apparatus, and device, and computer readable storage medium
CN111177005A (en) * 2019-12-31 2020-05-19 中国银行股份有限公司 Service application testing method, device, server and storage medium

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100966895B1 (en) * 2004-01-06 2010-06-30 삼성전자주식회사 Apparatus for testing nonvolatile memory and the method thereof
CN101441587B (en) * 2007-11-19 2011-05-18 辉达公司 Method and system for automatically analyzing GPU test result
US9626267B2 (en) * 2015-01-30 2017-04-18 International Business Machines Corporation Test generation using expected mode of the target hardware device
CN107168873B (en) * 2017-05-11 2020-06-09 南京南瑞继保电气有限公司 Network testing system and method based on script
US10979325B2 (en) * 2018-01-19 2021-04-13 Verizon Patent And Licensing Inc. Protocol independent speed testing service
CN108519933A (en) * 2018-02-08 2018-09-11 广州视源电子科技股份有限公司 Board test method, device, readable storage medium storing program for executing and computer equipment
CN109270916A (en) * 2018-08-03 2019-01-25 惠州市德赛西威汽车电子股份有限公司 Analog detection method, device, storage medium and the terminal of vehicle air system
CN109656831A (en) * 2018-12-26 2019-04-19 北京物芯科技有限责任公司 Test packet centralization generation method, device, equipment and storage medium
CN109710533A (en) * 2018-12-29 2019-05-03 亚信科技(中国)有限公司 A kind of interface test method, device and server
US11182278B2 (en) * 2019-08-29 2021-11-23 Atlassian Pty Ltd. Performance test using third-party hardware devices
CN110891285B (en) * 2019-12-03 2023-03-21 锐捷网络股份有限公司 Transmitting equipment, reflecting equipment, network performance testing method and system
CN112256557B (en) * 2020-09-16 2024-05-07 广东蘑菇物联科技有限公司 Program regression testing method, device, system, computer equipment and storage medium
CN112181749A (en) * 2020-10-19 2021-01-05 龙尚科技(上海)有限公司 Hardware testing method and device, electronic equipment and storage medium
CN112100013B (en) * 2020-11-18 2021-09-21 北京智芯微电子科技有限公司 Method, device and system for testing security chip SPI (Serial peripheral interface)
CN112597034A (en) * 2020-12-25 2021-04-02 深圳证券交易所 Test case generation method and device and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4628158A (en) * 1982-07-16 1986-12-09 At&T Bell Laboratories Stored program controller
WO2004010437A1 (en) * 2002-07-22 2004-01-29 Advanced Micro Devices, Inc. Built-in-self-test of flash memory cells
US7028240B1 (en) * 2002-07-22 2006-04-11 Advanced Micro Devices, Inc. Diagnostic mode for testing functionality of BIST (built-in-self-test) back-end state machine
CN105472083A (en) * 2015-12-08 2016-04-06 北京奇虎科技有限公司 Testing method and system for wireless terminals
WO2019205280A1 (en) * 2018-04-24 2019-10-31 平安科技(深圳)有限公司 Server testing method, apparatus, and device, and computer readable storage medium
CN111177005A (en) * 2019-12-31 2020-05-19 中国银行股份有限公司 Service application testing method, device, server and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王璇等.可变报文格式测试工具设计方法.《测试技术学报》.2015,(第01期), *

Also Published As

Publication number Publication date
CN113225232A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN107145140B (en) Automatic test system and test method for CAN interface of vehicle-mounted electronic control unit
CN113225232B (en) Hardware testing method and device, computer equipment and storage medium
US7539903B2 (en) Method for monitoring the execution of a program by comparing a request with a response and introducing a falsification in a response
CN110554929B (en) Data verification method, device, computer equipment and storage medium
CN113608518A (en) Data generation method, device, terminal equipment and medium
CN114326659A (en) Fault diagnosis system and method for automobile electronic control unit
CN112286825A (en) Screen testing method and device for intelligent cabin and electronic equipment
CN111506047A (en) Vehicle diagnosis method, device and storage medium
CN111351669B (en) Fault diagnosis method and device, storage medium and vehicle
CN116257437A (en) ADAS system defect verification method and device based on real vehicle data reinjection
US11537485B2 (en) Test sequencing method, configuration generating method, and configuration generating apparatus for testing devices according to their communication protocols
CN112590471B (en) Fault detection method and device of tire pressure monitoring system and electronic equipment
CN112306038B (en) Detection method, detection device and diagnosis equipment
CN113934198A (en) Vehicle diagnosis method, vehicle diagnosis device, electronic device, and storage medium
CN114327981A (en) Safety verification system, method and device of function safety mechanism
CN108648298B (en) Message processing method and device, storage medium and electronic equipment
CN113010114A (en) Data processing method and device, computer equipment and storage medium
CN111752823A (en) Method, device and equipment for testing vehicle-mounted power supply application software
Mouzakitis et al. Advanced automated onboard vehicle diagnostics testing
CN116095436B (en) Self-adaptive vehicle-mounted camera driving method
CN117170350B (en) Service testing method and device, electronic equipment and storage medium
CN117910401B (en) Method, apparatus, device, storage medium and program product for configuring operation mode
CN113093688B (en) Input and output testing method and system for new energy vehicle control unit
CN112000579B (en) Software interface testing method, system, equipment and medium
CN117370174A (en) Method and system for debugging vehicle-mounted host, serializer and deserializer programmable box

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