CN114840370A - Universal serial bus test method, wireless communication module, device and storage medium - Google Patents

Universal serial bus test method, wireless communication module, device and storage medium Download PDF

Info

Publication number
CN114840370A
CN114840370A CN202210482404.3A CN202210482404A CN114840370A CN 114840370 A CN114840370 A CN 114840370A CN 202210482404 A CN202210482404 A CN 202210482404A CN 114840370 A CN114840370 A CN 114840370A
Authority
CN
China
Prior art keywords
code
flow
universal serial
serial bus
code sequence
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
CN202210482404.3A
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 Guanghetong Wireless Communication Software Co ltd
Original Assignee
Shenzhen Guanghetong Wireless Communication Software 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 Guanghetong Wireless Communication Software Co ltd filed Critical Shenzhen Guanghetong Wireless Communication Software Co ltd
Priority to CN202210482404.3A priority Critical patent/CN114840370A/en
Publication of CN114840370A publication Critical patent/CN114840370A/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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis

Abstract

The application relates to a universal serial bus testing method, a wireless communication module, equipment and a storage medium, and relates to the field of testing. The universal serial bus test method comprises the following steps: acquiring a flow code sequence, wherein the flow code sequence comprises at least one flow code sequenced according to acquisition time, and the flow code is used for indicating a flow step of universal serial bus operation; according to the flow code sequence, determining that the universal serial bus has a fault, and identifying a diagnostic code corresponding to the flow code sequence; outputting a diagnosis code; and acquiring the fault reason of the universal serial bus according to the diagnosis code. The method and the device are used for solving the problem that the time consumed for searching the fault reason of the universal serial bus is long.

Description

Universal serial bus test method, wireless communication module, device and storage medium
Technical Field
The present application relates to the field of testing, and in particular, to a universal serial bus testing method, a wireless communication module, a device, and a storage medium.
Background
In order to debug the USB (Universal Serial Bus) function of the 4G module, most of the methods in the market currently output printed information to debug dedicated Serial ports of the 4G module, or analyze D + and D-communication waveforms with instruments such as a USB protocol analyzer and an oscilloscope.
While the analysis of the printed information requires a technician to have professional skills, i.e. to be familiar with the source code or the USB function, the USB protocol analyzer does not necessarily have enough equipment to be used in the customer or company due to high cost and use threshold, and the operation also requires the flying on the customer board. It is very cumbersome, time consuming and inefficient to troubleshoot and debug USB problems.
Disclosure of Invention
The application provides a universal serial bus testing method, a wireless communication module, equipment and a storage medium, which are used for solving the problem of long time consumption for searching fault reasons of a universal serial bus.
In a first aspect, an embodiment of the present application provides a universal serial bus test method, including:
acquiring a flow code sequence, wherein the flow code sequence comprises at least one flow code sequenced according to acquisition time, and the flow code is used for indicating a flow step of universal serial bus operation;
according to the flow code sequence, determining that the universal serial bus has a fault, and identifying a diagnostic code corresponding to the flow code sequence;
outputting the diagnosis code;
and acquiring the fault reason of the universal serial bus according to the diagnosis code.
Optionally, the determining that the universal serial bus is faulty according to the flow code sequence includes:
searching the flow code sequence in a preset database;
and if the flow code sequence can be found, determining that the universal serial bus has a fault.
Optionally, the identifying a diagnostic code corresponding to the flow code sequence includes:
and searching the diagnostic code corresponding to the flow code sequence in the preset database according to a first mapping relation between the flow code sequence and the diagnostic code.
Optionally, the diagnosis code includes a target process code and an error code, where the target process code is used to indicate a process step of finally stopping working when the usb fails, and the error code is used to indicate a cause of the failure.
Optionally, the outputting the diagnostic code comprises:
acquiring the diagnosis code through an AT instruction;
or, the diagnosis code is output through a debugging serial port;
or writing the diagnosis code into a record file.
Optionally, the obtaining a fault cause of the universal serial bus according to the diagnostic code includes:
and searching the fault reason corresponding to the diagnosis code according to a second mapping relation between the diagnosis code and the fault reason.
Optionally, the obtaining a flow code sequence includes:
acquiring each flow code on the universal serial bus in the running process of the universal serial bus;
and sequencing all the flow codes according to the acquisition time to generate the flow code sequence.
In a second aspect, an embodiment of the present application provides a wireless communication module, which includes a controller, a universal serial bus, and at least one universal serial bus interface, where the controller and the universal serial bus interface communicate via the universal serial bus;
the controller is configured to acquire a flow code sequence, where the flow code sequence includes at least one flow code ordered according to an acquisition time, and the flow code is used to indicate a flow step in which the universal serial bus is currently operating; determining that the universal serial bus has a fault according to the flow code sequence; identifying a diagnostic code corresponding to the flow code sequence; outputting the diagnosis code; and acquiring the fault reason of the universal serial bus according to the diagnosis code.
In a third aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor is configured to execute the program stored in the memory, and implement the universal serial bus test method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the usb testing method according to the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: in the embodiment of the application, a flow code sequence is obtained, where the flow code sequence includes at least one flow code sequenced according to an acquisition time, and the flow code is used to indicate a flow step of the operation of the universal serial bus, determine that the universal serial bus has a fault according to the flow code sequence, identify a diagnostic code corresponding to the flow code sequence, output the diagnostic code, and obtain a fault cause of the universal serial bus according to the diagnostic code. The method can obtain the running sequence of the practical flow steps of the universal serial bus in the running process by obtaining the flow code sequence, furthermore, the fault of the universal serial bus can be determined through the flow code sequence, the diagnostic code corresponding to the flow code sequence can be identified, according to the diagnosis code, the fault reason of the universal serial bus can be obtained, and the front-end technician or client can obtain the fault reason of the universal serial bus without being very familiar with the function or the code of the universal serial bus, quickly locate the fault reason of the universal serial bus, avoid the abnormal condition of the universal serial bus caused by improper operation, or other problems are wrongly classified into the problem of the universal serial bus, so that the time consumed for searching the fault reason of the universal serial bus is saved, the cost of detection equipment investment is reduced, and the problem of long time consumed for searching the fault reason of the universal serial bus is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic flowchart of a method for testing a universal serial bus according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a USB initialization process according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a USB enumeration process in an embodiment of the present application;
FIG. 4 is a flow chart illustrating a method for USB testing according to an embodiment of the present application;
FIG. 5 is a flow chart illustrating a method for USB testing according to an embodiment of the present application;
FIG. 6 is a block diagram of a wireless communication module according to an embodiment of the present disclosure;
FIG. 7 is a schematic structural diagram of a USB testing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making creative efforts shall fall within the protection scope of the present application.
The method provided in the embodiment of the application can be applied to electronic equipment, the electronic equipment can be specifically a module capable of realizing a communication function or terminal equipment containing the module, and the terminal equipment can be a mobile terminal or an intelligent terminal. The mobile terminal can be at least one of a mobile phone, a tablet computer, a notebook computer and the like; the intelligent terminal can be a terminal containing a wireless communication module, such as an intelligent automobile, an intelligent watch, a shared bicycle, an intelligent cabinet and the like; the module may be a wireless communication module, such as any one of a 2G communication module, a 3G communication module, a 4G communication module, a 5G communication module, and an NB-IOT communication module.
In the embodiment of the application, a universal serial bus test method is provided. As shown in fig. 1, the method flow of the usb test includes:
step 101, acquiring a flow code sequence, wherein the flow code sequence comprises at least one flow code sequenced according to acquisition time, and the flow code is used for indicating a flow step of universal serial bus operation.
In one embodiment, obtaining a flow code sequence includes: collecting each flow code on the universal serial bus in the running process of the universal serial bus; and sequencing the flow codes according to the acquisition time to generate a flow code sequence.
The process of operating a Universal Serial Bus (USB) mainly includes a USB initialization process, a USB enumeration process, a USB sleep wakeup process, and a USB data communication process.
As shown in fig. 2, the USB initialization process is roughly divided into 6 process steps after the wireless communication module is powered on: initializing a USB bus controller, creating a composite device object, setting a bus controller event notification, creating a USB work queue, setting a USB work mode, and starting a USB function.
As shown in fig. 3, after the USB is connected, the USB enumeration process is roughly divided into 10 process steps: the method comprises the steps of interrupting a vbus (power line), starting a vbus delay enumeration timer, accessing but not enumerating the USB, stabilizing the vbus, attempting enumeration of the USB, triggering and judging whether enumeration is started or not by the timer, configuring the USB, reporting information such as a device descriptor and the like, finishing USB enumeration, judging whether the re-enumeration frequency is more than N or not, and closing the USB. N is an integer greater than or equal to 1.
Setting flow codes for important flow steps, and listing part of the flow codes as follows: initializing the USB bus controller: u1; creating a composite device object: u2; setting bus controller event notification: u3; creating a USB work queue: u4; setting a USB working mode: u5; starting the USB function: u6; vbus interruption: u7; the vbus delay enumeration timer is started: u8; USB access but not enumeration: u9; the vbus is stable: u10; USB attempt enumeration: u11; and (3) triggering and judging whether to start enumeration or not by a timer: u12; reporting information such as USB configuration device descriptors: u13; the USB enumeration is completed: u14; the number of re-enumerations is greater than N: u15; and (3) closing the USB: u16; USB suspension: u17; USB reset: u18; USB awakening: u19; the USB is disconnected: u20; the USB continuously operates: u21.
In the running process of the universal serial bus, each process code on the universal serial bus is collected, a step of generating the process code can be added in each process step of the USB, and when the universal serial bus runs to a certain process step, the process code corresponding to the process step can be generated. And storing the generated flow code into a message queue, starting a self-diagnosis thread, and acquiring the flow code in the message queue by the self-diagnosis thread.
When the universal serial bus runs to a certain flow step, the flow code corresponding to the flow step is collected. The method may include acquiring a flow code corresponding to the flow step when the flow step is just run, acquiring the flow code corresponding to the flow step when the flow step is run to a middle part of the flow step, acquiring the flow code corresponding to the flow step when the flow step is run to an end part of the flow step, or acquiring the flow codes corresponding to the flow step when the flow step is just run, the middle part of the flow step is run, and the end part of the flow step, so as to avoid that the flow code corresponding to the flow step cannot be acquired when a fault occurs.
The flow code sequence includes at least one flow code sorted according to the acquisition time, for example, the flow code sequence may be U11, U12, U15, and U16, which indicates that the USB actually runs in the sequence of attempting enumeration according to the USB (U11), determining whether to start enumeration according to timer triggering (U12), re-enumerating for more than N (U15), and turning off the USB (U16) in the current running process.
And 102, determining that the universal serial bus has a fault according to the flow code sequence, and identifying a diagnostic code corresponding to the flow code sequence.
In one embodiment, determining that the universal serial bus is faulty based on the flow code sequence includes: searching a flow code sequence in a preset database; and if the flow code sequence can be found, determining that the universal serial bus has a fault.
In one embodiment, identifying a diagnostic code corresponding to a flow code sequence includes: and searching a diagnostic code corresponding to the flow code sequence in a preset database according to a first mapping relation between the flow code sequence and the diagnostic code.
The preset database stores a flow code sequence and a diagnosis code of the universal serial bus with a fault and a first mapping relation between the flow code sequence and the diagnosis code. The preset database may be dynamically updated, and a technician may add a new flow code sequence, a new diagnostic code, and a first mapping relationship between the flow code sequence and the diagnostic code to the preset database at any time.
For example, the preset database stores the following: (1) if the sequence of the U13 and U14 is repeated for more than 2 times, namely the flow code sequences of U13, U14, U13 and U14 appear, the diagnostic code corresponding to the flow code sequences of U13, U14, U13 and U14 is U14E 17. (2) If the flow sequences of U11, U12, U15 and U16 appear, that is, the flow code sequences of U11, U12, U15 and U16 appear, the diagnostic code corresponding to the flow code sequences of U11, U12, U15 and U16 is U16E 18. (3) If the U18 flow repeatedly appears for more than 3 times, namely the flow code sequences of U18, U18 and U18 appear, the diagnostic code corresponding to the flow code sequences of U18, U18 and U18 is U21E 19. (4) If the U17 flow repeatedly appears for more than 3 times, namely the flow code sequences of U17, U17 and U17 appear, the diagnostic code corresponding to the flow code sequences of U17, U17 and U17 is U21E 20. (5) If no flow code is printed, the wireless communication module fails in the starting process or cannot normally operate due to other factors. (6) If the flows appear in the order of U10, U11 and U10 during enumeration, that is, the flow code sequences of U10, U11 and U10 appear, the diagnostic code corresponding to the flow code sequences of U10, U11 and U10 is U21E 21.
In one embodiment, the diagnostic code includes a target flow code for indicating a flow step that will eventually stop working if the usb fails and an error code for indicating a cause of the failure.
For example, the target flow code is set to U plus the number, the error code is set to E plus the number, and the partial diagnostic codes are as follows: initializing a diagnosis code corresponding to the failure of the USB bus controller as U1E 1; the diagnosis code corresponding to the failure of the composite equipment object is created as U2E 2; setting a diagnostic code corresponding to the failure of the event notification of the bus controller as U3E 3; the diagnostic code corresponding to the USB work queue failure is established as U4E 4; setting the diagnostic code corresponding to the USB working mode failure or mode error as U5E 5; the diagnostic code corresponding to the failure of starting the USB function is U6E 6; the vbus is only interrupted, and a diagnosis code corresponding to the data connection is checked to be U7E 7; the diagnostic code corresponding to USB access but not enumerated is U9E 8; the diagnosis code corresponding to the vbus stability is U10E 9; the USB tries to enumerate the corresponding diagnostic code as U11E 10; reporting information such as USB configuration equipment descriptors and the like to obtain a corresponding diagnostic code U13E 11; the diagnostic code corresponding to USB suspend is U17E 12; the diagnostic code corresponding to the USB reset is U18E 13; the diagnostic code corresponding to USB wakeup is U19E 14; the diagnostic code corresponding to the disconnected USB is U20E 15; the diagnostic code corresponding to the uninitialized USB is U22E 16; the diagnostic code corresponding to the communication waveform identification abnormality is U14E 17; because the vbus is pulled in advance, the diagnosis code corresponding to subsequent overtime enumeration is U16E 18; the reset signal identifies that the diagnosis code corresponding to the abnormity is U21E 19; the diagnosis code corresponding to the suspension signal identification abnormity is U21E 20; the corresponding diagnostic code for the check data line connection is U21E 21.
The diagnosis code is set to be in a form including a target process code and an error code, the fault reason can be uniquely identified according to the error code, and the process step of finally stopping working when the universal serial bus is in fault can also be visually displayed according to the target process code.
Step 103, outputting the diagnosis code.
In one embodiment, outputting the diagnostic code comprises: acquiring a diagnosis code through an AT instruction; or, the diagnosis code is output through the debugging serial port; alternatively, the diagnostic code is written to a log file.
The AT command is a command applied to connection and communication between the terminal device and the PC application. The debugging serial port refers to a debug interface.
The diagnosis code is obtained through the AT instruction, and the user can send the AT instruction on the mobile terminal or the intelligent terminal to obtain the diagnosis code corresponding to the flow code sequence searched in the wireless communication module.
The diagnostic code is output through the debugging serial port, namely the flow code sequence and the diagnostic code corresponding to the flow code sequence are printed and output through the debug interface, the debug interface printing is a mode of acquiring the diagnostic code in real time, and the flow code sequence acquired each time and the diagnostic code corresponding to the flow code sequence are recorded in the debug log.
The method comprises the steps of writing diagnostic codes into a record file, namely writing a flow code sequence generated in real time and diagnostic codes corresponding to the flow code sequence into the record file, searching in the record file when a certain flow code sequence and the diagnostic codes corresponding to the flow code sequence are needed, reading the needed flow code sequence and the diagnostic codes corresponding to the flow code sequence from the record file, reading the flow code sequence and the diagnostic codes corresponding to the flow code sequence which cannot be operated by the USB due to faults according to the needs of a user without printing all the generated flow code sequences and the diagnostic codes corresponding to the flow code sequences, and ignoring the flow code sequence and the diagnostic codes corresponding to the flow code sequence which have small faults but do not influence the main operation steps of the USB. For example, the flow code sequence may be written in the recording file a, and the diagnostic code may be written in the recording file B.
And step 104, acquiring the fault reason of the universal serial bus according to the diagnosis code.
In one embodiment, obtaining the fault cause of the usb according to the diagnostic code includes: and searching the fault reason corresponding to the diagnosis code according to a second mapping relation between the diagnosis code and the fault reason.
For example, the fault cause is that the communication waveform identifies the abnormal diagnostic code as U14E 17; the failure reason is that the diagnosis code corresponding to subsequent overtime enumeration is U16E18 due to pulling vbus in advance; the fault reason is that the diagnostic code corresponding to the abnormal identification of the reset signal is U21E 19; the diagnosis code corresponding to the abnormal recognition of the hang-up signal as the fault reason is U21E 20; the reason for the failure is that the diagnostic code corresponding to the data line connection needs to be checked is U21E 21.
The second mapping relationship between the diagnosis code and the fault reason can also be dynamically updated, and a technician can add a new diagnosis code, a new fault reason and a second mapping relationship between the diagnosis code and the fault reason at any time.
In one embodiment, as shown in fig. 4, the method for testing the usb includes:
step 401, acquiring a flow code sequence, where the flow code sequence includes at least one flow code ordered according to the acquisition time, and the flow code is used to indicate a flow step of the usb operation.
Step 402, searching a flow code sequence in a preset database, determining that the universal serial bus has a fault if the flow code sequence can be found, and searching a diagnostic code corresponding to the flow code sequence in the preset database according to a first mapping relation between the flow code sequence and the diagnostic code.
The diagnostic codes comprise target process codes and error codes, wherein the target process codes are used for indicating the process steps of finally stopping working when the universal serial bus is in fault, and the error codes are used for indicating the fault reasons.
And 403, acquiring the diagnostic code through the AT instruction, or outputting the diagnostic code through the debugging serial port, or writing the diagnostic code into a record file.
And step 404, searching a fault reason corresponding to the diagnostic code according to a second mapping relation between the diagnostic code and the fault reason.
In one embodiment, as shown in fig. 5, the method for testing the usb includes:
in step 501, a self-diagnostic thread is initiated.
Step 502, creating a message queue, storing the generated flow codes into the message queue, and acquiring the flow codes from the message queue by the self-diagnosis thread.
Step 503, create record file a and record file B.
Step 504, determine whether to obtain the diagnostic code through the AT command, if yes, go to step 505, otherwise go to step 506.
And 505, outputting the diagnosis code through the AT command.
Step 506, determine whether it is a diagnostic code, if yes, go to step 507, otherwise go to step 509.
In step 507, the diagnostic code is written into the record file B.
At step 508, the diagnostic code is printed out and execution returns to step 504.
Step 509, wait for a message.
Step 510, determine whether a USB operation message is received, if yes, go to step 511, otherwise go to step 509.
Step 511, writing the flow code into the record file a.
In step 512, the flow code is printed out, and the process returns to step 506.
In summary, in the embodiment of the present application, a flow code sequence is obtained, where the flow code sequence includes at least one flow code sorted according to an acquisition time, and the flow code is used to indicate a flow step of the usb operation, determine that the usb has a fault according to the flow code sequence, identify a diagnostic code corresponding to the flow code sequence, output the diagnostic code, and obtain a fault cause of the usb according to the diagnostic code. The method can obtain the running sequence of the practical flow steps of the universal serial bus in the running process by obtaining the flow code sequence, furthermore, the fault of the universal serial bus can be determined through the flow code sequence, the diagnostic code corresponding to the flow code sequence can be identified, according to the diagnosis code, the fault reason of the universal serial bus can be obtained, and the front-end technician or client can obtain the fault reason of the universal serial bus without being very familiar with the function or the code of the universal serial bus, quickly locate the fault reason of the universal serial bus, avoid the abnormal condition of the universal serial bus caused by improper operation, or other problems are wrongly classified into the problem of the universal serial bus, so that the time consumed for searching the fault reason of the universal serial bus is saved, the cost of detection equipment investment is reduced, and the problem of long time consumed for searching the fault reason of the universal serial bus is solved.
Based on the same concept, the embodiment of the present application provides a wireless communication module, as shown in fig. 6, including a controller 601, a universal serial bus 602, and at least one universal serial bus interface 603, where the controller 601 and the universal serial bus interface 603 communicate through the universal serial bus 602;
the controller is used for acquiring a flow code sequence, wherein the flow code sequence comprises at least one flow code sequenced according to acquisition time, and the flow code is used for indicating the current operation flow step of the universal serial bus; determining that the universal serial bus has a fault according to the flow code sequence; identifying a diagnostic code corresponding to the flow code sequence; outputting a diagnosis code; and acquiring the fault reason of the universal serial bus according to the diagnosis code.
Based on the same concept, the embodiment of the present application provides a universal serial bus testing apparatus, and the specific implementation of the apparatus may refer to the description of the method embodiment, and repeated descriptions are omitted, as shown in fig. 7, the apparatus mainly includes:
an obtaining module 701, configured to obtain a flow code sequence, where the flow code sequence includes at least one flow code sorted according to an acquisition time, and the flow code is used to indicate a flow step of a universal serial bus operation;
an identifying module 702, configured to determine that the universal serial bus has a fault according to the flow code sequence, and identify a diagnostic code corresponding to the flow code sequence;
an output module 703 for outputting a diagnostic code;
and the processing module 704 is configured to obtain a fault reason of the universal serial bus according to the diagnostic code.
Based on the same concept, an embodiment of the present application further provides an electronic device, as shown in fig. 8, the electronic device mainly includes: a processor 801, a memory 802, and a communication bus 803, wherein the processor 801 and the memory 802 communicate with each other via the communication bus 803. The memory 802 stores a program executable by the processor 801, and the processor 801 executes the program stored in the memory 802, so as to implement the following steps:
acquiring a flow code sequence, wherein the flow code sequence comprises at least one flow code sequenced according to acquisition time, and the flow code is used for indicating a flow step of universal serial bus operation; according to the flow code sequence, determining that the universal serial bus has a fault, and identifying a diagnostic code corresponding to the flow code sequence; outputting a diagnosis code; and acquiring the fault reason of the universal serial bus according to the diagnosis code.
The communication bus 803 mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 803 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The Memory 802 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor 801.
The Processor 801 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc., and may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
In yet another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the universal serial bus test method described in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes, etc.), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A universal serial bus test method is characterized by comprising the following steps:
acquiring a flow code sequence, wherein the flow code sequence comprises at least one flow code sequenced according to acquisition time, and the flow code is used for indicating a flow step of the operation of a universal serial bus;
according to the flow code sequence, determining that the universal serial bus has a fault, and identifying a diagnostic code corresponding to the flow code sequence;
outputting the diagnosis code;
and acquiring the fault reason of the universal serial bus according to the diagnosis code.
2. The method according to claim 1, wherein the determining that the usb is faulty according to the flow code sequence comprises:
searching the flow code sequence in a preset database;
and if the flow code sequence can be found, determining that the universal serial bus has a fault.
3. The method according to claim 2, wherein the identifying the diagnostic code corresponding to the flow code sequence comprises:
and searching the diagnostic code corresponding to the flow code sequence in the preset database according to a first mapping relation between the flow code sequence and the diagnostic code.
4. The method according to claim 1, wherein the diagnostic code comprises a target flow code and an error code, wherein the target flow code is used for indicating a flow step of the usb which finally stops working when the usb fails, and the error code is used for indicating a cause of the failure.
5. The method according to claim 1, wherein the outputting the diagnostic code comprises:
acquiring the diagnosis code through an AT instruction;
or, the diagnosis code is output through a debugging serial port;
or writing the diagnosis code into a record file.
6. The method according to any one of claims 1 to 5, wherein the obtaining the fault cause of the USB according to the diagnostic code comprises:
and searching the fault reason corresponding to the diagnosis code according to a second mapping relation between the diagnosis code and the fault reason.
7. The method of claim 1, wherein the obtaining a flow code sequence comprises:
acquiring each flow code on the universal serial bus in the running process of the universal serial bus;
and sequencing all the flow codes according to the acquisition time to generate the flow code sequence.
8. A wireless communication module is characterized by comprising a controller, a universal serial bus and at least one universal serial bus interface, wherein the controller and the universal serial bus interface are communicated through the universal serial bus;
the controller is configured to acquire a flow code sequence, where the flow code sequence includes at least one flow code ordered according to an acquisition time, and the flow code is used to indicate a flow step in which the universal serial bus is currently operating; determining that the universal serial bus has a fault according to the flow code sequence; identifying a diagnostic code corresponding to the flow code sequence; outputting the diagnosis code; and acquiring the fault reason of the universal serial bus according to the diagnosis code.
9. An electronic device, comprising: the system comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor is used for executing the program stored in the memory and realizing the universal serial bus test method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method for testing a universal serial bus according to any one of claims 1 to 7.
CN202210482404.3A 2022-05-05 2022-05-05 Universal serial bus test method, wireless communication module, device and storage medium Pending CN114840370A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210482404.3A CN114840370A (en) 2022-05-05 2022-05-05 Universal serial bus test method, wireless communication module, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210482404.3A CN114840370A (en) 2022-05-05 2022-05-05 Universal serial bus test method, wireless communication module, device and storage medium

Publications (1)

Publication Number Publication Date
CN114840370A true CN114840370A (en) 2022-08-02

Family

ID=82567962

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210482404.3A Pending CN114840370A (en) 2022-05-05 2022-05-05 Universal serial bus test method, wireless communication module, device and storage medium

Country Status (1)

Country Link
CN (1) CN114840370A (en)

Similar Documents

Publication Publication Date Title
US20080270840A1 (en) Device and method for testing embedded software using emulator
US6532552B1 (en) Method and system for performing problem determination procedures in hierarchically organized computer systems
US20080148238A1 (en) Runtime Analysis of a Computer Program to Identify Improper Memory Accesses that Cause Further Problems
GB2492874A (en) Using the differences between screen images to automate the execution of graphical interface applications
US8752023B2 (en) System, method and program product for executing a debugger
TWI361978B (en) Method for debugging a computer system
CN111258850B (en) Method and device for updating software information based on Linux system
CN110851352A (en) Fuzzy test system and terminal equipment
CN104239174A (en) BMC (baseboard management controller) remote debugging system and method
US9104801B2 (en) Analyzing concurrent debugging sessions
CN109086081B (en) Method, system and medium for instantly prompting in-place change of SATA (Serial advanced technology attachment) and NVMe (network video recorder) equipment
CN113590405A (en) Hard disk error detection method and device, storage medium and electronic device
WO2021056913A1 (en) Fault locating method, apparatus and system based on i2c communication
CN114840370A (en) Universal serial bus test method, wireless communication module, device and storage medium
CN112100048A (en) Self-adaptive routing inspection method and device for server
CN108681506B (en) Pressure testing method and device
CN100498732C (en) Universal serial bus device test system and its method
CN109634796A (en) A kind of method for diagnosing faults of computer, apparatus and system
CN114386045A (en) Web application program vulnerability detection method and device and storage medium
CN115080132A (en) Information processing method, information processing apparatus, server, and storage medium
CN113708986B (en) Server monitoring apparatus, method and computer-readable storage medium
CN112068980A (en) Method and device for sampling information before CPU hang-up, equipment and storage medium
CN111679943A (en) Server test system
CN111858239B (en) Server hard disk monitoring method, device, equipment and medium
CN107122275A (en) It is a kind of to check the device and method that RMT tests information

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