CN114625586A - Pin detection method and detection equipment - Google Patents

Pin detection method and detection equipment Download PDF

Info

Publication number
CN114625586A
CN114625586A CN202210127314.2A CN202210127314A CN114625586A CN 114625586 A CN114625586 A CN 114625586A CN 202210127314 A CN202210127314 A CN 202210127314A CN 114625586 A CN114625586 A CN 114625586A
Authority
CN
China
Prior art keywords
detected
pin
detection
gpio
communication module
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.)
Pending
Application number
CN202210127314.2A
Other languages
Chinese (zh)
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.)
Shenzhen Neoway Technology Co Ltd
Original Assignee
Shenzhen Neoway 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 Shenzhen Neoway Technology Co Ltd filed Critical Shenzhen Neoway Technology Co Ltd
Priority to CN202210127314.2A priority Critical patent/CN114625586A/en
Publication of CN114625586A publication Critical patent/CN114625586A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)

Abstract

The invention relates to the technical field of pin detection, in particular to a pin detection method and device. The key of the pin detection method and the pin detection device provided by the embodiment of the invention is that the detection device determines the function of the pin to be detected and the pin to be detected in a communication module according to a received detection request data packet, and then the detection device detects the corresponding pin function of the pin to be detected in the communication module to obtain a detection result to complete detection, wherein the detection request data packet is generated by the communication module according to the function of the pin to be detected and the pin to be detected in a format specified by a preset protocol, and the detection result at least comprises that the corresponding pin function of the pin to be detected is in a normal state or an abnormal state. The method and the device for detecting the pins, provided by the embodiment of the invention, can flexibly detect different pins and different numbers of pins, and have high detection efficiency.

Description

Pin detection method and detection equipment
Technical Field
The invention relates to the technical field of pin detection, in particular to a pin detection method and device.
Background
The communication module is widely applied to the fields of vehicle monitoring, access control systems, industrial data acquisition systems, digital audio and the like, has data communication capabilities such as LTE (Long Term Evolution, Long Term Evolution communication technology), WIFI (Wireless Fidelity, Wireless network communication technology) and the like, and integrates rich functional interfaces such as a UART interface (Universal Asynchronous Receiver/Transmitter ), a USB interface (Universal Serial Bus, Universal Serial Bus) and the like. Before the communication module leaves the factory, pin detection related to the communication module is an important production link. And the purpose of the pin detection is mainly to detect whether the function of the pin in the communication module is normal.
In the prior art, a pin detection method includes that after a single chip microcomputer is connected with a pin to be detected in a communication module, a relevant technician writes a relevant detection program in the single chip microcomputer according to the pin to be detected in the communication module to complete detection. When the pins to be detected are changed, the number of the pins to be detected is increased or decreased, or the communication module to be detected is different, the related technical personnel needs to re-develop the related detection program to complete the detection, so the detection mode is not flexible, and the detection efficiency is low.
Disclosure of Invention
According to the pin detection method and the pin detection device provided by the embodiment of the invention, when the pin to be detected changes, related technical personnel do not need to develop programs again, so that the pin in the communication module can be detected flexibly, and the detection efficiency is higher.
In one aspect, an embodiment of the present invention provides a method for pin detection, where the method for pin detection includes: the method comprises the steps that detection equipment receives a detection request data packet, wherein the detection request data packet is generated by a communication module according to the function of a pin to be detected and the pin to be detected in the communication module in a format specified by a preset protocol, and the detection request data packet comprises the function information of the pin to be detected and the identity information of the pin to be detected; the detection device determines the pin function to be detected according to the pin function information to be detected in the detection request data packet, determines the pin to be detected according to the identity information of the pin to be detected in the detection request data packet, and detects the corresponding pin function of the pin to be detected in the communication module to obtain a detection result, wherein the detection result at least comprises that the corresponding pin function of the pin to be detected is in a normal state or an abnormal state. The pin functions to be detected include a General-purpose input/output (GPIO) function and an Analog-to-Digital Converter (ADC) function.
On the other hand, the embodiment of the invention also provides a detection device, which comprises a memory, a processor and a plurality of pins; the plurality of pins are used for being correspondingly connected with a plurality of pins to be detected in a communication module respectively so as to establish physical connection between the detection equipment and the communication module; the memory stores a program instruction, and the program instruction is used for the processor to call and then execute the pin detection method provided by the embodiment of the invention so as to detect the pin to be detected in the communication module.
When the pins to be detected are changed, the number of the pins to be detected is increased or decreased, or the communication module to be detected is different, the communication module generates a new detection request data packet according to the changed functions of the pins to be detected and the format specified by the preset protocol, and the detection device detects the changed pins to be detected in the communication module according to the received new detection request data packet to obtain a detection result. Therefore, the pin detection method and the pin detection device provided by the embodiment of the invention can more flexibly detect the pins of different communication modules or the pins with different functions and serial numbers and different numbers of pins of the same module, and have high detection efficiency.
Drawings
In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings used in the description of the embodiment will be briefly introduced below.
Fig. 1 is a flowchart illustrating steps of the method for pin detection according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a method for pin detection according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps of a method for pin detection according to a third embodiment of the present invention;
FIG. 4 is a flowchart illustrating steps of a method for pin detection according to a fourth embodiment of the present invention;
fig. 5 is a schematic composition diagram of the detection apparatus according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
The communication module is widely applied to the fields of vehicle monitoring, access control systems, industrial data acquisition systems, digital audio and the like, has data communication capabilities such as Long Term Evolution (LTE), Wireless Fidelity (WIFI), and the like, and integrates rich functional interfaces such as Universal Asynchronous Receiver/Transmitter (UART) interfaces, Universal Serial Bus (USB) interfaces and the like. Before the communication module leaves the factory, pin detection related to the communication module is an important production link. The purpose of the pin detection is mainly to detect whether the function of the pin in the communication module is normal.
Pin detection generally detects pins exposed in the communication module, that is, pins available in the communication module for connection with other hardware. Before pin detection is performed, that is, before the method for pin detection provided by the embodiment of the present invention is performed, first, a physical connection between a detection device and the communication module is established, where the detection device is configured to detect a pin to be detected in the communication module, and the physical connection between the detection device and the communication module includes: and the pin in the detection equipment is correspondingly connected with the pin to be detected in the communication module. For example, when the pin to be detected in the communication module is a General-purpose input/output (GPIO) pin, the GPIO pin in the detection device is connected to the pin to be detected in the communication module to establish a physical connection between the detection device and the communication module; when the pin to be detected in the communication module is an ADC (Analog to Digital Converter) pin, the ADC pin in the detection device is connected to the ADC pin to be detected in the communication module, so as to establish a physical connection between the detection device and the communication module.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a pin detection method according to a first embodiment of the invention:
101. the detection device receives a detection request data packet. The detection request data packet is generated by a communication module according to functions of pins to be detected in the communication module and formats specified by a preset protocol, and the detection request data packet comprises function information of the pins to be detected and identity information of the pins to be detected.
102. The detection equipment determines the pin function to be detected according to the pin function information to be detected in the detection request data packet, determines the pin to be detected according to the identity information of the pin to be detected, and detects the corresponding pin function of the pin to be detected in the communication module to obtain a detection result.
The pin functions to be detected comprise GPIO functions and ADC functions; the detection result at least comprises that the corresponding pin function of the pin to be detected is in a normal state or an abnormal state.
In the method for pin detection provided in the embodiment of the present invention, the key to implement pin detection is that the detection device determines the function of the pin to be detected and the pin to be detected according to the detection request data packet generated and sent by the communication module, and then the detection device detects the corresponding pin function of the pin to be detected in the communication module to obtain the detection result. The communication module informs the detection device of the functions of the pins to be detected and the pins to be detected in the communication module in the format specified by the preset protocol, and the detection device completes corresponding detection.
Therefore, when the pins and functions to be detected are changed, the pins to be detected are increased or reduced, or the detected communication modules are different products, that is, the condition of the pins to be detected changes, the communication module only needs to include the pins to be detected to generate a new detection request data packet according to the changed functions of the pins to be detected and the pins to be detected, and send the new detection request data packet to the detection device, and the detection device completes corresponding detection according to the new detection request data packet and obtains a corresponding detection result. Therefore, in the pin detection method provided by the embodiment of the present invention, when the condition of the pin to be detected changes, it is not necessary for related technicians to rewrite a corresponding set of pin detection programs in the detection device to implement the detection of the pin in the communication module.
The detection device comprises a pin for connecting with the pin to be detected in the communication module and a communication pin for mutually transmitting data with the communication module, wherein the communication pin in the detection device is connected with a corresponding communication pin in the communication module, and the data mutually transmitted by the detection device and the communication module comprises the detection request data packet.
In some embodiments, the detection device comprises a single-chip microcomputer.
In some embodiments, the manner for the communication module to acquire the function of the pin to be detected and the information of the pin to be detected includes, but is not limited to: and reading a configuration file in the communication module, and receiving information about the functions of the pin to be detected, the pin to be detected and the like input by related technicians through an interpersonal interaction module in the communication module. The configuration file is a file which is edited in advance, has a specific format, and comprises information about the functions of the pin to be detected, the pin to be detected and the like.
When the condition of the pin to be detected changes, if the manner of acquiring the function of the pin to be detected and the information of the pin to be detected by the communication module is that the configuration file in the communication module is read, the pin detection can be completed only by modifying the part of the configuration file with a specific format, which is related to the information of the pin to be detected, by the related technical personnel and further executing the method for detecting the pin provided by the embodiment of the invention; if the communication module acquires the function of the pin to be detected and the information of the pin to be detected and the like in a manner that the interpersonal interaction module in the communication module receives the information about the function of the pin to be detected and the like input by related technicians, the pin detection can be completed only by modifying the information about the pin to be detected on the interpersonal interaction interface in the communication module by the related technicians and further executing the method for detecting the pin provided by the embodiment of the invention. Therefore, no matter what way the communication module obtains the functions of the pin to be detected and the information of the pin to be detected, when the condition of the pin to be detected changes, the way of completing the pin detection by modifying the information of the pin to be detected is more flexible, more efficient and more convenient than the way of completing the pin detection by re-writing a set of corresponding program for detecting the pin by related technicians.
Thus, in some embodiments, before step 101, the method of pin detection further comprises: the communication module obtains the functions of the pins to be detected and the pins to be detected by reading a configuration file in the communication module, wherein the configuration file is the pre-edited file with a specific format and comprises information about the functions of the pins to be detected, the pins to be detected and the like.
Referring to fig. 2, fig. 2 is a flowchart illustrating steps of a pin detection method according to a second embodiment of the present invention:
201. the detection device receives a detection request data packet.
202. The detection equipment determines the functions of the pins to be detected according to the information of the functions of the pins to be detected in the detection request data packet, determines the pins to be detected according to the identity information of the pins to be detected, and detects the corresponding functions of the pins to be detected in the communication module to obtain a detection result.
203. And the detection equipment generates a detection response data packet in a format specified by the preset protocol according to the detection result and sends the detection response data packet to the communication module.
Steps 201 and 202 correspond to steps 101 and 102 in fig. 1, and the related descriptions may refer to each other.
The detection response packet includes detection result information.
As mentioned above, the preset protocol specifies the communication format between the detection device and the communication module, so that the preset protocol not only specifies the communication format for the communication module to inform the detection device of the information such as the function of the pin to be detected and the pin to be detected in the communication module, but also specifies the communication format for the detection device to inform the communication module of the detection result after the detection is completed.
In some embodiments, after the communication module receives the detection response data packet including the detection result information sent by the detection device, the communication module displays information about the detection result through a human-computer interaction interface in the communication module, so that a relevant technician can know whether a pin in the communication module is normal or abnormal, and further subsequent development is facilitated.
In some embodiments, when the pin function to be detected is a GPIO function, the pin function information to be detected includes that the pin function to be detected is a GPIO function, and the identity information of the pin to be detected includes serial numbers of all the GPIO pins to be detected.
In some embodiments, the GPIO function includes a function in which the GPIO output is at a target level, wherein the target level is either a high level or a low level. When the pin function to be detected is a GPIO function, the method for pin detection further includes: in step 101 (or step 201), when the detection device receives the detection request packet, the communication module controls all the GPIO pins to be detected to output the target level. Furthermore, in step 102 (or step 202), the detecting device performs corresponding pin function detection on the pin to be detected in the communication module, including: and the detection equipment detects whether the level output by all the GPIO pins to be detected is the target level. For each GPIO pin to be detected, if the level output by the GPIO pin to be detected currently detected by the detection equipment is the target level, judging that the GPIO function of the GPIO pin to be detected currently is in a normal state; and if the level output by the GPIO pin to be detected currently detected by the detection equipment is not the target level, judging that the GPIO function of the GPIO pin to be detected currently is in an abnormal state.
In some embodiments, when the pin function to be detected is a GPIO function, the detection result specifically includes that all GPIO functions of the GPIO pin to be detected are in a normal state, and at least one GPIO function of the GPIO pin to be detected is in an abnormal state. When the detection result is that all GPIO functions of the GPIO pins to be detected are in a normal state, the detection result information comprises information that all the GPIO functions of the GPIO pins to be detected are in a normal state; and when the detection result is that the GPIO function of at least one GPIO pin to be detected is in an abnormal state, the detection result information comprises information that the GPIO function of at least one GPIO pin to be detected is in the abnormal state and the serial numbers of all the GPIO pins with the GPIO functions in the abnormal state. In some embodiments, the detection result further specifically includes that the detection device cannot detect at least one GPIO pin to be detected. And when the detection result is that the detection device cannot detect at least one GPIO pin to be detected, the detection result information comprises information that the detection device cannot detect at least one GPIO pin to be detected and the serial numbers of all the GPIO pins to be detected, which cannot be detected by the detection device.
The serial number of the GPIO pin can be a pin serial number of the GPIO pin in the communication module or a pin serial number of the GPIO pin in the detection device. And no matter the serial number of the GPIO pin is the serial number of the GPIO pin in the communication module or the serial number of the GPIO pin in the detection equipment, the serial number of the GPIO pin points to the same GPIO pin. Therefore, no matter the serial number of the GPIO pin is the pin serial number of the GPIO pin in the communication module or the pin serial number of the GPIO pin in the detection device, the definitions of the serial numbers of the GPIO pins in the communication module and the detection device need to be unified according to the specific pin connection relationship between the communication module and the detection device, so as to prevent communication between the communication module and the detection device from being incorrect.
In some embodiments, when the pin function to be detected is an ADC function, the pin function information to be detected further includes that the pin function to be detected is an ADC function, and the identity information of the pin to be detected further includes serial numbers of all the ADC pins to be detected.
In some embodiments, when the pin function to be detected is an ADC function, in step 102 (or step 202), the detecting device performs detection on the pin to be detected in the communication module to obtain a detection result, including: the detection equipment detects whether the voltage output by all the ADC pins to be detected is within a preset voltage range. For each ADC pin to be detected, if the detection equipment currently detects that the voltage output by the ADC pin to be detected is within the preset voltage range, judging that the ADC function of the ADC pin to be detected is in a normal state currently; if the detection device currently detects that the voltage output by the ADC pin to be detected is not within the preset voltage range, judging that the ADC function of the ADC pin to be detected is in an abnormal state currently. Under normal conditions, the voltage output by the ADC pin in the communication module is stabilized within a certain voltage range, that is, the preset voltage range, and under normal conditions, the voltage output by the ADC pin in different communication modules is stabilized within different voltage ranges, so that the preset voltage range is different for different communication modules, and the specific preset voltage range is adjusted according to actual conditions.
In some embodiments, when the pins to be detected are ADC functions, the detection result specifically includes that the ADC functions of all the ADC pins to be detected are in a normal state, and the ADC function of at least one ADC pin to be detected is in an abnormal state. When the detection result is that the ADC functions of all the ADC pins to be detected are in a normal state, the detection result information comprises information that the ADC functions of all the ADC pins to be detected are in the normal state; and when the detection result is that the ADC function of at least one ADC pin to be detected is in an abnormal state, the detection result information comprises information about that the ADC function of at least one ADC pin to be detected is in the abnormal state and the serial numbers of all ADC pins in the abnormal state. In some embodiments, the detection result further specifically includes that the detection device cannot detect at least one ADC pin to be detected, and when the detection result is that the detection device cannot detect at least one ADC pin to be detected, the detection result information includes information that the detection device cannot detect at least one ADC pin to be detected, and serial numbers of the ADC pins to be detected that all the detection devices cannot detect.
The serial number of the ADC pin may be a pin serial number of the ADC pin in the communication module, or a pin serial number of the ADC pin in the detection device. No matter the serial number of the ADC pin is the serial number of the ADC pin in the communication module or the serial number of the ADC pin in the detection equipment, the serial numbers of the ADC pins all point to the same ADC pin. Therefore, no matter the serial number of the ADC pin is the serial number of the ADC pin in the communication module or the serial number of the ADC pin in the detection device, the definitions of the serial numbers of the ADC pins in the communication module and the detection device need to be unified according to the specific pin connection relationship between the communication module and the detection device, so as to prevent communication between the communication module and the detection device from being incorrect.
The detection device in the pin detection method provided by the embodiment of the invention has the capability of detecting various functional pins such as GPIO pins, ADC pins and the like, but cannot simultaneously execute the action of detecting various pins with different functions. For example, when the detection device detects the GPIO function of the GPIO pin in the communication module, the ADC function of the ADC pin in the communication module cannot be detected simultaneously, and only when the detection device completes the operation of detecting the GPIO function of the GPIO pin, the operation of detecting the ADC function of the ADC pin can be started. Generally, after the detection device sends one round of the detection response data packet to the communication module, the detection device can receive the next round of the detection request data packet from the communication module for pin detection of different pin functions.
In some embodiments, before step 101 (or 201), the method for pin detection further includes matching between the communication module and the detection device to establish a communication connection between the communication module and the detection device. Referring to fig. 3, fig. 3 is a flowchart illustrating steps of a method for pin detection according to a third embodiment of the present invention:
301. the detection device receives a handshake request packet. The handshake request data packet is generated by the communication module according to the product model of the communication module in a format specified by the preset protocol, and the handshake request data packet includes the product model information of the communication module.
302. And the detection equipment determines the product model of the communication module according to the product model information of the communication module in the handshake request data packet, and matches the product model of the communication module with the communication module to obtain a matching result.
303. And when the detection equipment is successfully matched with the communication module, establishing communication connection between the communication module and the detection equipment.
304. The detection device receives a detection request data packet.
305. The detection equipment determines the functions of the pins to be detected according to the information of the functions of the pins to be detected in the detection request data packet, determines the pins to be detected according to the identity information of the pins to be detected, and detects the corresponding functions of the pins to be detected in the communication module to obtain a detection result.
306. And the detection equipment generates a detection response data packet in a format specified by the preset protocol according to the detection result and sends the detection response data packet to the communication module.
Steps 304, 305, 306 correspond to steps 201, 202, 203, and the related descriptions can be referred to each other.
As mentioned above, the preset protocol specifies the communication format between the detection device and the communication module, and the communication module informs the detection device of the information about the product model of the communication module through the handshake request data packet, so that the handshake request data packet may also be generated in the format specified by the preset protocol.
The communication module is matched with the detection device, after the detection device is successfully matched with the communication module, communication connection between the communication module and the detection device is established, and meanwhile, initialization work aiming at the current pin detection of the communication module is finished by the detection device according to the product model of the communication module, wherein the initialization work comprises confirming a specific pin of the communication module connected with the detection device and confirming the preset voltage range of the communication module according to the product model of the communication module.
The establishing of the communication connection between the communication module and the detection device is specifically to establish the communication connection between the communication pin in the detection device and the corresponding communication pin in the communication module. The communication connection in this application refers to that the detection device and the communication module can perform data interaction through respective communication pins. The physical connection between the communication pin in the detection device and the corresponding communication pin in the communication module may be established in advance, and only when the detection device and the communication module are successfully matched, which is equivalent to successful handshaking, the communication connection between the communication module and the detection device may be established, that is, the transmission and reception of other non-handshaking request packets may be allowed.
Wherein the matching result comprises a successful matching or a failed matching of the detection device and the communication module. When the matching between the detection device and the communication module is successful, a communication connection between the communication module and the detection device is established, and step 304 and step 306 are further executed. In some embodiments, when the matching between the detection device and the communication module fails, steps 301 and 302 are repeatedly performed until the matching between the detection device and the communication module succeeds, the communication connection between the communication module and the detection device is established, and step 304 and step 306 are further performed.
Referring to fig. 4, fig. 4 is a flowchart illustrating steps of the pin detection method according to a fourth embodiment of the invention:
401. the detection device receives a handshake request packet.
402. And the detection equipment determines the product model of the communication module according to the product model information of the communication module in the handshake request data packet, and matches the product model of the communication module with the communication module to obtain a matching result.
403. And when the detection equipment is successfully matched with the communication module, establishing communication connection between the communication module and the detection equipment.
404. And the detection equipment generates a handshake response data packet in a format specified by the preset protocol according to a matching result of successful matching between the detection equipment and the communication module, and sends the handshake response data packet to the communication module.
405. The detection device receives a detection request data packet.
406. The detection equipment determines the functions of the pins to be detected according to the information of the functions of the pins to be detected in the detection request data packet, determines the pins to be detected according to the identity information of the pins to be detected, and detects the corresponding functions of the pins to be detected in the communication module to obtain a detection result.
407. And the detection equipment generates a detection response data packet in a format specified by the preset protocol according to the detection result and sends the detection response data packet to the communication module.
Steps 401, 402 and 403 correspond to steps 301, 302 and 303, steps 405, 406 and 407 correspond to steps 304, 305 and 306, and the related descriptions can be referred to each other.
In some embodiments, if the matching between the detection device and the communication module fails, the detection device generates the handshake response packet in a format specified by the preset protocol according to the matching result of the matching failure between the detection device and the communication module after obtaining the matching result of the matching failure between the detection device and the communication module, and sends the handshake response packet to the communication module. When the communication module receives the handshake response data packet which comprises the matching result of the failure matching between the detection device and the communication module, the handshake request data packet is regenerated and sent to the detection device, and then the detection device repeatedly executes the steps 401 and 402 until the detection device is successfully matched with the communication module, the communication connection between the communication module and the detection device is established, and then the step 404 is executed.
Wherein the handshake response packet includes matching result information, and when the matching result is that the detection device and the communication module are successfully matched, the matching result information includes information about the successful matching of the detection device and the communication module; when the matching result is that the matching of the detection device and the communication module fails, the matching result information includes information about the failure of matching of the detection device and the communication module.
And when the detection device is successfully matched with the communication module, the detection device generates a handshake response data packet in a format specified by the preset protocol according to a matching result of successful matching between the detection device and the communication module, and sends the handshake response data packet to the communication module so as to inform the communication module that the communication connection is successfully established. And when the communication module knows that the detection device is successfully matched with the communication module, the detection request data packet is generated and sent to the detection device, and then step 405 and 407 are executed.
In some embodiments, before step 401 (or step 301), the method of pin detection further comprises: the communication module obtains the product model of the communication module by reading the configuration file in the communication module, wherein the configuration file is the pre-edited file with a specific format and includes information about the functions of the pins to be detected, the pins to be detected and the like, and the configuration file also includes information about the product model of the communication module.
Therefore, the detection device and the communication module communicate with each other through the aforementioned detection request packet, detection response packet, handshake request packet, handshake response packet, and the like, and each packet is generated in a content format specified by the preset protocol.
With respect to the preset protocol, in some embodiments, the content format specified by the preset protocol sequentially includes: the frame head, the frame type, the data length, the specific data, the check value and the frame tail are six parts.
The frame header part is placed at the beginning of the data packet and used for defining the beginning of the data packet, the size of the space occupied by the frame header part is two bytes, and the specific content comprises 0xF80xF 9; the frame tail is placed at the end of the data packet and used for defining the end of the data packet, the space occupied by the frame tail part is two bytes, and the specific content comprises 0xFD0 xFE.
The frame type part is used for defining the roles of the data packets, and the roles of the data packets are different. The contents included in the frame type part are different.
The data length part is used for representing the total bytes of the specific data part, the representation of the data length part adopts a large-end mode and is transmitted in a hexadecimal form, and the space occupied by the data length part is two bytes.
The specific data portion includes actual specific data received or transmitted between the detection device and the communication module, the content of the actual specific data is defined according to the frame type portion, the content of the frame type portion in the data packet is different, the content of the corresponding specific data portion is different, and the size of the space occupied by the specific data portion is determined by the actual specific data.
The check value part is used for representing the sum of the space occupied by the frame type part, the data length part and the specific data part in the current data packet, the representation of the check value part adopts a large-end mode and is transmitted in a hexadecimal form, and the space occupied by the check value part is two bytes. Since the data content in the data packet may be misplaced or lost during the data transmission, for example, a certain data 0x01 in the data packet may be misplaced to 0x10 or lost during the data transmission, and when the data content is misplaced or lost, the accumulated sum of all or a certain part of the data content may be changed, when the data packet is received by the detection device or the communication module, the first action to be performed is to calculate the data sum of the key data in the current data packet, that is, the accumulated sum of the space sizes occupied by the frame type part, the data length part and the specific data part, and check whether the data sum of the key data in the current data packet is consistent with the check value in the data packet, if the data sum of the key data in the current data packet is consistent with the check value in the data packet, if the sum of the critical data in the current data packet is inconsistent with the check value in the data packet, it is determined that data inaccuracy is possibly caused by misalignment in the transmission process of the data packet, and the data inaccuracy data packet is sent back to the communication module or the detection device sending the data inaccuracy data packet, so that a new data packet is sent back by the communication module or the detection device sending the data inaccuracy data packet. Thus, the check value part is used to check whether the content of the data packet received by the detection device or the communication module is the same as the content of the data packet sent by the communication module or the detection device.
In some embodiments, the content corresponding to different frame types is as follows:
Figure BDA0003500991650000081
Figure BDA0003500991650000091
specifically, as shown in the above table, the space occupied by the frame type part is one byte, and the frame type part includes a handshake frame, a GPIO detection frame, a version number frame, or an ADC detection frame, where the handshake frame is an identifier that requests or responds to matching between the communication module and the detection device, and specific content includes 0x 01; the GPIO detection frame is used for requesting or responding to the identification of the GPIO pin to be detected in the communication module, and the specific content comprises 0x 02; the version number frame is an identifier for requesting or responding to obtain the version number of the detection equipment, and specific content comprises 0x 03; the ADC detection frame is a request or response to detect the identifier of the ADC pin to be detected in the communication module, and the specific content includes 0x 04. In some embodiments, when it is necessary for the communication module to obtain the version number of the detection device, the frame type part in the data packet sent by the communication module to the detection device is a version number frame.
For example, the frame type portions in the detection request packet and the detection response packet are the GPIO detection frames or the ADC detection frames, and specifically, when the pin function to be detected is a GPIO function, the frame type portions in the detection request packet and the detection response packet are the GPIO detection frames; and when the pin function to be detected is an ADC function, the frame type parts in the detection request data packet and the detection response data packet are the ADC detection frames. And the frame type parts in the handshake request data packet and the handshake response data packet are handshake frames.
As mentioned above, the content of the specific data portion is defined according to the frame type portion, the content of the frame type portion in the data packet is different, the content of the corresponding specific data portion is different, and the size of the space occupied by the specific data portion is determined by the actual specific data. In some embodiments, the content corresponding to the specific data portion is as follows:
the content formats of the specific data parts of the handshake request data packet and the handshake response data packet when the frame type part is the handshake frame are shown in the following table:
a. the content format of the specific data portion of the handshake request packet is:
Figure BDA0003500991650000092
b. the content format of the specific data part of the handshake response data packet is:
Figure BDA0003500991650000093
specifically, as shown in the above table, when the frame type part is the handshake frame, the specific data part in the handshake request data packet includes a product model and a protocol version, where the product model is a product model of the communication module, and is transmitted in a character string manner, and the occupied space size is 10 bytes; the protocol version is the version number of the preset protocol currently applied, is expressed by decimal, is transmitted by adopting the value of American Standard Code for Information exchange (ASCII) Code, and occupies 1 byte. The specific data part in the handshake response data packet includes a matching result, the size of the occupied space is 1 byte, when the detection device is successfully matched with the communication module, the content of the matching result is 0x01, and when the detection device is unsuccessfully matched with the communication module, the content of the matching result is 0x 02.
(II) when the frame type part is the GPIO detection frame, the content formats of the specific data parts of the detection request data packet and the detection response data packet are shown as the following table:
a. the content format of the specific data part of the detection request data packet is as follows:
Figure BDA0003500991650000101
b. the content format of the specific data part of the detection response data packet is as follows:
Figure BDA0003500991650000102
specifically, as shown in the above table, when the frame type part is the GPIO detection frame, the specific data part in the detection request data packet includes a GPIO request detection state and a GPIO request detection configuration table, where the GPIO request detection state is an identifier that requests to detect whether the output of the GPIO pin to be detected is the target level, and the occupied space size is 1 byte, when the communication module requests to detect whether the output of the GPIO pin to be detected is the low level, the specific content of the GPIO request detection state is 0x00, and when the communication module requests to detect whether the output of the GPIO pin to be detected is the high level, the specific content of the GPIO request detection state is 0x 01. Specifically, for example, when the GPIO function to be detected is a function whose GPIO output is at a low level, the specific content of the GPIO request detection state is 0x 00; and when the GPIO function to be detected is a function with GPIO output at high level, the specific content of the GPIO request detection state is 0x 01. The GPIO request detection configuration table specifically comprises serial numbers of all GPIO pins to be detected, the space occupied by the serial numbers of all the GPIO pins to be detected changes dynamically along with the specific GPIO pins to be detected, the space occupied by the serial numbers of each GPIO pin to be detected is 2 bytes, the serial numbers are transmitted in a hexadecimal mode, and the serial numbers of each GPIO pin to be detected are expressed in a large-end mode.
And when the frame type part is the GPIO detection frame, the specific data part in the detection response data packet includes a GPIO response detection state and a GPIO response detection configuration table, where the GPIO response detection state is a representation of whether the output of the GPIO pin to be detected is the target level in response to detecting that the occupied space size is 1 byte, when all the GPIO pin to be detected are the target level, the specific content of the GPIO response detection state is 0x01, when at least one of the GPIO pin to be detected is not the target level, the specific content of the GPIO response detection state is 0x80, and when the detection device cannot detect at least one of the GPIO pin to be detected, the specific content of the GPIO response detection state is 0x 81. The content and occupied space of the GPIO response detection configuration table dynamically change along with the GPIO response detection state, when the specific content of the GPIO response detection state is 0x01, the GPIO response detection configuration table does not comprise any content, when the specific content of the GPIO response detection state is 0x80, the GPIO response detection configuration table specifically comprises the serial numbers of all GPIO pins of which the output is not at the target level, when the specific content of the GPIO response detection state is 0x81, the GPIO response detection configuration table specifically comprises the serial numbers of all GPIO pins which cannot be detected by the detection equipment, wherein the occupied space of the serial number of each GPIO pin in the GPIO response detection configuration table is 2 bytes, the serial number of each GPIO pin is transmitted in a hexadecimal form, and the serial number of each GPIO pin is represented in a large-end mode.
(III) the content format of the specific data part of the detection request data packet and the detection response data packet when the frame type part is the ADC detection frame is as follows:
a. the content format of the specific data part of the detection request data packet is as follows:
Figure BDA0003500991650000111
b. the content format of the specific data part of the detection response data packet is as follows:
Figure BDA0003500991650000112
Figure BDA0003500991650000121
specifically, as shown in the above table, when the frame type part is the ADC detection frame, the specific data part in the detection request data packet includes an ADC request detection configuration table, where the ADC request detection configuration table specifically includes serial numbers of all ADC pins to be detected, and the size of the occupied space of the ADC pins to be detected changes dynamically along with the ADC pins to be detected, where the size of the occupied space of the serial number of each ADC pin to be detected is 2 bytes, the serial number of each ADC pin to be detected is transmitted in a hexadecimal manner, and the serial number of each ADC pin to be detected is represented by a big-end mode.
And when the frame type part is the ADC test frame, the specific data part in the test response data packet comprises an ADC response test state and an ADC response test configuration table, wherein the ADC response detection state is the representation of responding to detect whether the voltage output by the ADC pin to be detected is within the preset voltage range, the occupied space size is 1 byte, when the voltage output by all the ADC pins to be detected is within the preset voltage range, the specific content of the ADC response detection state is 0x01, when the voltage output by at least one ADC pin to be detected is not in the preset voltage range, the specific content of the ADC response detection state is 0x80, when the detection device cannot detect at least one ADC pin to be detected, the specific content of the ADC response detection state is 0x 81. The content and the occupied space size of the ADC response detection configuration table dynamically change along with the ADC response detection state, and when the specific content of the ADC response detection state is 0x01, the ADC response detection configuration table does not contain any content; when the specific content of the ADC response detection state is 0x80, the ADC response detection configuration table specifically includes all numbers of ADC pins whose output voltages are not within the preset voltage range and specific voltage values output by ADC pins whose output voltages are not within the preset voltage range, and the specific format is { number of ADC pins, specific voltage value }, … …, { number of ADC pins, specific voltage value }; when the specific content of the ADC response detection state is 0x81, the ADC response detection configuration table specifically includes serial numbers of ADC pins that cannot be detected by all the detection devices, where, for the serial number of each ADC pin and the specific voltage value, character string transmission is adopted, and the number part is represented by decimal, and the specific voltage value retains 3 bits after the decimal point.
And (IV) when the frame type part is the version number frame, the content formats of the specific data parts of the request data packet and the response data packet are shown in the following table:
a. content format of the specific data portion of the request packet:
Figure BDA0003500991650000122
b. content format of the specific data portion of the response packet:
Figure BDA0003500991650000123
specifically, as shown in the above table, when the frame type part is the version number frame, the specific data part in the corresponding data packet related to the request sent by the communication module includes information of the requested read version number, where the size of the space occupied by the information of the requested read version number is 1 byte, and the specific content is 0x 01. Furthermore, the specific data portion in the corresponding data packet about the response sent by the detection device includes version number information, where the version number information is the version number of the detection device, is transmitted in a character string form, and occupies 16 bytes in size.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating the components of the detection apparatus according to an embodiment of the present invention:
the detection apparatus 10 includes a memory 1, a processor 2, and a number of pins 3.
The pins 3 are used for being respectively connected with a plurality of pins to be detected in a communication module 20, so as to establish physical connection between the detection device 10 and the communication module 20.
The memory 1 stores a program instruction, and the program instruction is used for the processor 2 to execute the pin detection method provided by any embodiment of the present invention after being called, so as to detect the pin 3 to be detected in the communication module 20.
Further, the "a plurality of pins 3 are used to respectively perform corresponding connection with a plurality of pins to be detected in a communication module 20", including: the pin 3 of the detection device 10 is connected to a pin with the same function in the communication module 20, and each pin 3 of the detection device 10 used for connecting with the communication module 20 is not repeatedly connected to a plurality of pins in the communication module 20, for example, an ADC pin of the detection device 10 is connected to an ADC pin of the communication module 20, and a GPIO pin of the detection device 10 is connected to a GPIO pin of the communication module 20.
In some embodiments, if there are more pins to be detected in the communication module 20 and the pins 3 in the detection device 10 are not enough to be connected to all the pins to be detected in the communication module 20, the pin extension process is performed on the detection device 10.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (13)

1. A method of pin inspection, the method comprising:
the detection device receives a detection request data packet, wherein the detection request data packet is generated by a communication module according to functions of pins to be detected and the pins to be detected in the communication module in a format specified by a preset protocol, the detection request data packet comprises function information of the pins to be detected and identity information of the pins to be detected, and the functions of the pins to be detected comprise GPIO (General-purpose input/output) functions and ADC (Analog-to-Digital Converter) functions;
the detection device determines the function of the pin to be detected according to the pin function information to be detected in the detection request data packet, determines the pin to be detected according to the identity information of the pin to be detected, and detects the corresponding pin function of the pin to be detected in the communication module to obtain a detection result, wherein the detection result at least comprises that the corresponding pin function of the pin to be detected is in a normal state or an abnormal state.
2. The method of claim 1, further comprising:
the detection equipment generates a detection response data packet in a format specified by the preset protocol according to the detection result and sends the detection response data packet to the communication module; wherein the detection response packet includes the detection result information.
3. The method according to claim 2, wherein when the pin function to be detected is a GPIO function, the pin function information to be detected includes that the pin function to be detected is a GPIO function, and the identity information of the pin to be detected includes serial numbers of all the GPIO pins to be detected.
4. The method of claim 3, wherein GPIO functions comprise GPIO output to a target level, wherein the target level is high or low;
when the pin function to be detected is a GPIO function, the method further comprises the following steps:
when the detection equipment receives the detection request data packet, the communication module controls all the GPIO pins to be detected to output the target level;
the detection device detects the corresponding pin function of the pin to be detected in the communication module, and the detection device comprises:
the detection equipment detects whether the level output by all the GPIO pins to be detected is the target level;
for each GPIO pin to be detected, if the level output by the GPIO pin to be detected currently detected by the detection equipment is the target level, judging that the GPIO function of the GPIO pin to be detected currently is in a normal state; and if the level output by the GPIO pin to be detected currently detected by the detection equipment is not the target level, judging that the GPIO function of the GPIO pin to be detected currently is in an abnormal state.
5. The method according to claim 4, wherein when the pin functions to be detected are GPIO functions, the detection result specifically includes that all GPIO functions of the GPIO pins to be detected are in a normal state, and that at least one GPIO function of the GPIO pins to be detected is in an abnormal state;
when the detection result is that all GPIO functions of the GPIO pins to be detected are in a normal state, the detection result information comprises information that all the GPIO functions of the GPIO pins to be detected are in a normal state; and when the detection result is that the GPIO function of at least one GPIO pin to be detected is in an abnormal state, the detection result information comprises information that the GPIO function of at least one GPIO pin to be detected is in the abnormal state and the serial numbers of all the GPIO pins with the GPIO functions in the abnormal state.
6. The method according to claim 5, wherein the detection result further includes that the detection device cannot detect at least one GPIO pin to be detected;
and when the detection result is that the detection device cannot detect at least one GPIO pin to be detected, the detection result information comprises information that the detection device cannot detect at least one GPIO pin to be detected and the serial numbers of all the GPIO pins to be detected, which cannot be detected by the detection device.
7. The method according to claim 2, wherein when the pin function to be detected is an ADC function, the pin function information to be detected further includes that the pin function to be detected is an ADC function, and the identity information of the pin to be detected further includes serial numbers of all ADC pins to be detected.
8. The method according to claim 7, wherein when the pin function to be detected is an ADC function, the detecting device detects the corresponding pin function of the pin to be detected in the communication module to obtain a detection result, and the method includes:
the detection equipment detects whether the voltage output by all the ADC pins to be detected is within a preset voltage range;
for each ADC pin to be detected, if the detection equipment currently detects that the voltage output by the ADC pin to be detected is within the preset voltage range, judging that the ADC function of the ADC pin to be detected is in a normal state; if the detection device currently detects that the voltage output by the ADC pin to be detected is not within the preset voltage range, judging that the ADC function of the ADC pin to be detected is in an abnormal state currently.
9. The method according to claim 8, wherein when the pins to be detected are ADC functions, the detection result specifically includes that the ADC functions of all the ADC pins to be detected are in a normal state, and the ADC function of at least one ADC pin to be detected is in an abnormal state;
when the detection result is that the ADC functions of all the ADC pins to be detected are in a normal state, the detection result information comprises information that the ADC functions of all the ADC pins to be detected are in the normal state; and when the detection result is that the ADC function of at least one ADC pin to be detected is in an abnormal state, the detection result information comprises information about that the ADC function of at least one ADC pin to be detected is in the abnormal state and the serial numbers of all ADC pins in the abnormal state.
10. The method according to claim 9, wherein the detection result further includes that the detection device cannot detect at least one ADC pin to be detected;
and when the detection result indicates that the detection device cannot detect at least one ADC pin to be detected, the detection result information includes information that the detection device cannot detect at least one ADC pin to be detected and the serial numbers of all the ADC pins to be detected, which cannot be detected by the detection device.
11. The method of claim 2, wherein before the detection device receives a detection request packet, the method further comprises:
the detection equipment receives a handshake request data packet, wherein the handshake request data packet is generated by the communication module according to the product model of the communication module in a format specified by the preset protocol, and the handshake request data packet comprises the product model information of the communication module;
and the detection equipment determines the product model of the communication module according to the product model information of the communication module in the handshake request data packet, matches the product model of the communication module with the communication module to obtain a matching result, and establishes communication connection between the communication module and the detection equipment when the detection equipment is successfully matched with the communication module.
12. The method of claim 11, further comprising:
and the detection equipment generates a handshake response data packet in a format specified by the preset protocol according to a matching result of successful matching between the detection equipment and the communication module, and sends the handshake response data packet to the communication module.
13. The detection equipment is characterized by comprising a memory, a processor and a plurality of pins; the plurality of pins are used for being correspondingly connected with a plurality of pins to be detected in a communication module respectively so as to establish physical connection between the detection equipment and the communication module; the memory stores program instructions for the processor to execute the method according to any one of claims 1 to 12 after being called, so as to detect the pin to be detected in the communication module.
CN202210127314.2A 2022-02-11 2022-02-11 Pin detection method and detection equipment Pending CN114625586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210127314.2A CN114625586A (en) 2022-02-11 2022-02-11 Pin detection method and detection equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210127314.2A CN114625586A (en) 2022-02-11 2022-02-11 Pin detection method and detection equipment

Publications (1)

Publication Number Publication Date
CN114625586A true CN114625586A (en) 2022-06-14

Family

ID=81898500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210127314.2A Pending CN114625586A (en) 2022-02-11 2022-02-11 Pin detection method and detection equipment

Country Status (1)

Country Link
CN (1) CN114625586A (en)

Similar Documents

Publication Publication Date Title
CN109768970B (en) Configurable universal protocol generation method
CN106793007B (en) Interactive communication method and system of cloud and Bluetooth device and wireless router
CN111506047B (en) Vehicle diagnosis method, device and storage medium
KR101001074B1 (en) Method for transmittng data on a bus
JPH07147592A (en) Congestion control method, terminal adaptor using the method and communication system having the terminal adaptor
CN111813622B (en) Equipment monitoring method and device
CN108958781B (en) Remote embedded firmware online upgrading method
CN111190851A (en) Analysis method, device, equipment and medium for variable length protocol
CN106971525B (en) Bluetooth signal conversion device and Bluetooth signal conversion method
CN114625586A (en) Pin detection method and detection equipment
CN112671770A (en) Outdoor unit serial port protocol analysis method and device, computer equipment and storage medium
CN107171915B (en) Communication protocol changing method and device
CN112910838B (en) Composite protocol analysis method, device, equipment, system and storage medium
CN112068893B (en) USB device and method for distinguishing mobile device operating systems
CN112084076A (en) Test method, electronic device, and storage medium
CN117834750B (en) Device, method, system, equipment, medium and server for acquiring protocol data
CN112165465B (en) Data processing method and device for outgoing third-party platform and electronic device
CN216673042U (en) Separated standardized self-organizing internet of things node architecture
CN114817113B (en) Method, system, equipment and storage medium for judging SDA data direction
CN117834750A (en) Device, method, system, equipment, medium and server for acquiring protocol data
CN117354379A (en) Data transmission method, device, terminal equipment and computer readable storage medium
CN110505136B (en) Layered MODBUS communication system and method
CN116800654A (en) Monitoring system, method, equipment and storage medium for bus data transmission
CN117992201A (en) Interrupt information processing method, electronic device, and readable storage medium
CN115955728A (en) Bluetooth automatic pairing method and device and computer equipment

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