CN113254281B - Detection method and detection device of USB controller - Google Patents
Detection method and detection device of USB controller Download PDFInfo
- Publication number
- CN113254281B CN113254281B CN202110472311.8A CN202110472311A CN113254281B CN 113254281 B CN113254281 B CN 113254281B CN 202110472311 A CN202110472311 A CN 202110472311A CN 113254281 B CN113254281 B CN 113254281B
- Authority
- CN
- China
- Prior art keywords
- usb
- controllers
- restarting
- identification codes
- usb controllers
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection 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/221—Detection 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
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)
- Debugging And Monitoring (AREA)
Abstract
The application is applicable to the technical field of computer self-inspection, and provides a detection method and a detection device of a USB controller, wherein the detection method comprises the steps of sequentially reading identification codes of all USB controllers; and returning to the step of sequentially reading the identification codes of all the universal serial bus USB controllers and the subsequent step until the first number of the identification codes is equal to the second number of the USB controllers, and determining that all the USB controllers are started normally. In order to prevent accidental false faults from causing the USB controllers to be unable to start, the application determines that each USB controller is started normally by continuously restarting and detecting the first number of the USB controllers and the second number of the USB controllers which are started normally. The USB controller can be ensured to be normally started in the starting-up stage of the computer system.
Description
Technical Field
The application belongs to the technical field of computer self-checking, and particularly relates to a detection method and a detection device of a USB controller.
Background
The universal serial bus (universal serial bus, USB) is a serial bus standard for connecting a computer system and an external device, and is also a technical specification of an input/output interface, and is widely used in information communication products such as personal computers and mobile devices. For example, a USB flash disk, a mobile hard disk, a mouse and the like which are used in daily life are all required to be accessed into a computer system through a USB interface. And the USB interface needs to handle data transmission between the computer system and the external device through a USB controller (host controller).
The USB controller has the problem that the USB controller cannot be started normally due to the fact that the USB controller cannot use the USB interface corresponding to the USB controller accidentally in the starting stage of the computer system. However, in most cases, the cause of the failure to properly boot the USB controller is not due to a real failure of the USB controller, but is merely sporadic false failure. Therefore, how to ensure that each USB controller in the computer system is normally started in the start-up stage becomes a technical problem to be solved.
Disclosure of Invention
In view of the above, the embodiments of the present application provide a method, a device, a terminal device, and a computer readable storage medium for detecting a USB controller, which can solve the technical problem that each USB controller in a computer system cannot be normally started in a startup phase.
A first aspect of an embodiment of the present application provides a method for detecting a USB controller, where the method includes:
sequentially reading identification codes of all Universal Serial Bus (USB) controllers;
If the first number of the read identification codes is smaller than the second number of the USB controllers, restarting operation is executed;
And returning to the step of sequentially reading the identification codes of the Universal Serial Bus (USB) controllers and the subsequent step until the first number of the identification codes is equal to the second number of the USB controllers, and determining that the USB controllers are normally started.
A second aspect of an embodiment of the present application provides a detection apparatus for a USB controller, the detection apparatus including:
the reading unit is used for sequentially reading the identification codes of the Universal Serial Bus (USB) controllers;
the judging unit is used for executing restarting operation if the first number of the read identification codes is smaller than the second number of the USB controllers;
And the execution unit is used for returning to execute the step and the subsequent step of sequentially reading the identification codes of the Universal Serial Bus (USB) controllers until the first number of the identification codes is equal to the second number of the USB controllers, and determining that the USB controllers are normally started.
A third aspect of the embodiments of the present application provides a terminal device comprising a USB controller, a USB interface, a complex programmable logic device CPLD, a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the method according to the first aspect described above when said computer program is executed.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method of the first aspect.
Compared with the prior art, the embodiment of the application has the beneficial effects that the corresponding identification code can be read when the USB controller is started normally, and the corresponding identification code can not be read when the USB controller is not started. Therefore, the application determines whether each USB controller is started normally or not by reading the identification code of each USB controller. When the first number of the USB controllers which are started normally is smaller than the second number of the USB controllers, the USB controllers which cannot be started normally exist in the USB controllers. In order to prevent accidental false faults from causing the USB controllers to be unable to start, the application determines that each USB controller is started normally by restarting continuously and detecting the first number of the USB controllers and the second number of the USB controllers which are started normally when the first number of the USB controllers which are started normally is equal to the second number of the USB controllers. Therefore, each USB controller in the computer system can be ensured to be normally started in the starting-up stage.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a schematic flow chart of a method for detecting a USB controller according to the present application;
FIG. 2 is a schematic flow chart of another method for detecting a USB controller according to the present application;
FIG. 3 is a schematic flow chart of another method for detecting a USB controller according to the present application;
FIG. 4 is a schematic flow chart of another method for detecting a USB controller according to the present application;
FIG. 5 is a schematic diagram of a detection device of a USB controller according to the present application;
Fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The embodiment of the application provides a detection method and a detection device for a USB controller, terminal equipment and a computer readable storage medium, which can solve the technical problem that each USB controller in a computer system cannot be normally started in a starting stage.
First, the application provides a detection method of a USB controller, which specifically comprises the following steps:
referring to fig. 1, fig. 1 is a schematic flow chart of a detection method of a USB controller according to the present application. As shown in fig. 1, the detection method may include the steps of:
step 101, sequentially reading the identification codes of the Universal Serial Bus (USB) controllers.
The identification code includes, but is not limited to, a serial number of the USB controller, a physical address of the USB controller, PCIe (peripheral component interconnect express) codes, and the like. Preferably, PCIe codes are preferred as identification codes because PCIe codes are codes specific to the universal serial bus standard (universal serial bus, USB).
When the USB controller is started normally, the processor can read the identification code corresponding to the USB controller. When the USB controller is not started normally, the processor cannot read the identification code corresponding to the USB controller. Thus, the identification code may be used to identify whether the USB controller is properly booted.
Step 102, if the first number of the read identification codes is smaller than the second number of the USB controllers, performing a restart operation.
The first number represents the number of identification codes read by the processor and the second number is the total number of USB controllers. When the first number is smaller than the second number, the USB controllers which are not started normally exist in all the USB controllers. For example, if the second number of all USB controllers is 5 and the first number of the read identification codes is 4, it indicates that 1 USB controller out of the 5 USB controllers is not normally started. However, the cause of the USB controller not being normally started is various, but often most of the time, the USB controller is not normally started as a sporadic false failure (i.e., not due to the failure of the USB controller itself, but due to sporadic factors such as unstable current or failed initialization, etc.). Occasional false failures tend to resume normal immediately after a restart (i.e., the USB controller is normally started).
Based on the above rule, in order to avoid sporadic false faults, all USB controllers cannot be started normally, and further, the connected USB interfaces cannot be used, so after determining that the first number is smaller than the second number, the processor executes a restarting operation.
And step 103, returning to execute the step of sequentially reading the identification codes of the Universal Serial Bus (USB) controllers and the subsequent step until the first number of the identification codes is equal to the second number of the USB controllers, and determining that all the USB controllers are normally started.
To ensure that each USB controller is normally started after the restart. Therefore, after the restart operation, it is determined whether each USB controller is started normally (i.e. steps 101 to 103 are executed) again, so that steps 101 to 103 are executed in a loop when it is determined that each USB controller is not started normally, and when it is determined that each USB controller is started normally, the start-up operation is executed.
It is noted that steps 101 to 103 are implemented by a computer program running on a processor. The computer program may be a lower-level firmware or an upper-level application software.
In this embodiment, since the corresponding identification code can be read when the USB controller is normally started, the corresponding identification code cannot be read when the USB controller cannot be started. Therefore, the application determines whether each USB controller is started normally or not by reading the identification code of each USB controller. When the first number of the USB controllers which are started normally is smaller than the second number of the USB controllers, the USB controllers which cannot be started normally exist in the USB controllers. In order to prevent accidental false faults from causing the USB controllers to be unable to start, the application determines that each USB controller is started normally by restarting continuously and detecting the first number of the USB controllers and the second number of the USB controllers which are started normally when the first number of the USB controllers which are started normally is equal to the second number of the USB controllers. Therefore, each USB controller in the computer system can be ensured to be normally started in the starting-up stage.
Optionally, on the basis of the embodiment shown in fig. 1, the detection method further includes the following steps, please refer to fig. 2, fig. 2 shows a schematic flowchart of another detection method of a USB controller provided by the present application. In this embodiment, step 202 and step 205 are the same as step 101 and step 103 in the embodiment shown in fig. 1, and refer to the related descriptions of step 101 and step 103 in the embodiment shown in fig. 1 specifically, and are not repeated here.
Step 201, counting the restarting times of continuous restarting operation, wherein the continuous restarting operation refers to a plurality of restarting operations with the time interval of every two restarting operations being smaller than a first threshold value.
Since the terminal device cannot be used at the time of the restart operation. Frequent restarting operation often causes that the terminal equipment cannot be used for a long time. The processor counts the number of restarting times of the continuous restarting operation to control the number of restarting times within a reasonable range.
It is noted that the restart operation is often a daily operation of the user, so the processor needs to distinguish the restart operation triggered by the daily use of the user from the restart operation triggered by the failure of the USB controller to be started normally. The frequency of the restarting operation triggered by the user is low (often, the number of restarting operations in one day is not more than two), and the frequency of the restarting operation triggered by the fact that the USB controller cannot normally start is high, the time interval is short and continuous, so that the continuous restarting operation is used as screening logic to exclude the restarting operation triggered by the user in the daily use process.
The execution body of the "counting the number of times of restarting the continuous restarting operation" may be a counter running in the processor, or may count through a complex programmable logic device CPLD connected to the processor.
Step 202, sequentially reading the respective corresponding identification codes from each Universal Serial Bus (USB) controller.
In step 203, if the first number of the read identification codes is smaller than the second number of the USB controllers and the number of the reboots is not greater than a second threshold, the reboot operation is performed.
Step 102 differs from step 203 in that step 102 determines whether to perform a restart operation in a single dimension, while step 203 determines whether to perform a restart operation in two dimensions. To control the number of restarts within a reasonable range.
And 204, if the number of restarting times is greater than the second threshold, executing a shutdown operation.
When the number of times of restarting is greater than the second threshold, even if each USB controller is not started normally, the restarting operation is not performed so as to control the number of times of restarting within a reasonable range. In order to prevent abnormal use of the USB controller that is not normally started (for example, in industrial production, the requirements on the operation status of the terminal device are strict, and the USB controller is liable to have a great influence on industrial production), a shutdown operation is required.
It will be appreciated that if the requirements for the operation status of the terminal device are relaxed, then in step 204, a power-on operation (i.e., a power-off operation is replaced by a power-on operation) may also be performed.
And step 205, returning to execute the step of reading the corresponding identification codes from each Universal Serial Bus (USB) controller and the subsequent steps in turn, and determining that each USB controller is normally started until the first number of the identification codes is equal to the second number of the USB controllers.
In step 206, if the first number of the read identification codes is equal to the second number of the USB controllers, a power-on operation is performed.
When the first number of the read identification codes is equal to the second number of the USB controllers, the USB controllers are started normally, and the starting operation can be executed.
In this embodiment, when the processor continuously performs the restart operation, the restart times of the processor are controlled by the restart times, so as to avoid excessive restart operations, which results in that the terminal device cannot be used for a long time.
Optionally, on the basis of the embodiment shown in fig. 1, the detection method further includes the following steps, please refer to fig. 3, fig. 3 shows a schematic flowchart of another detection method of a USB controller provided by the present application. In this embodiment, step 304 and step 307 are the same as step 101 and step 103 in the embodiment shown in fig. 1, and refer to the related descriptions of step 101 to step 103 in the embodiment shown in fig. 1, which are not repeated here.
Step 301, obtaining a historical total duration of continuous restarting operation, wherein the continuous restarting operation refers to multiple restarting operations with a time interval of every two adjacent restarting operations smaller than a first threshold value.
Since the terminal device cannot be used at the time of the restart operation. Frequent restarting operation often causes that the terminal equipment cannot be used for a long time. The processor controls the total restart time period to be within a reasonable range by calculating the estimated total time period for the successive restart operations.
It is noted that the restart operation is often a daily operation of the user, so the processor needs to distinguish the restart operation triggered by the daily use of the user from the restart operation triggered by the failure of the USB controller to be started normally. The frequency of the restarting operation triggered by the user is low (often, the number of restarting operations in one day is not more than two), and the frequency of the restarting operation triggered by the fact that the USB controller cannot normally start is high, the time interval is short and continuous, so that the continuous restarting operation is used as screening logic to exclude the restarting operation triggered by the user in the daily use process.
Step 302, obtaining an average restart time length, wherein the average restart time length is an average value calculated according to the restart time length of a plurality of historical restart operations.
The average restart time length is used for estimating the restart time length of the future restart operation. Illustratively, if the restart time periods of the plurality of historical restart operations are 11 seconds, 12 seconds, 10 seconds, 9 seconds, and 8 seconds, respectively, the average restart time period is 10 seconds. The average restart time period may be a pre-calculated time period (only the pre-stored average restart time period needs to be obtained in step 302), or may be calculated in step 302.
And step 303, adding the historical total time length and the average restarting time length to obtain the estimated total time length.
It will be appreciated that the historical total duration is the duration that has been experienced, and the average restart duration is the estimated duration of the restart operation that is to occur. To determine whether a restart operation is currently performed according to the estimated total time period (i.e., to determine whether the total restart time period exceeds a third threshold value to control the total restart time period within a reasonable range if the restart operation is performed again).
Step 304, the identification codes of the universal serial bus USB controllers are sequentially read.
In step 305, if the first number of the read identification codes is smaller than the second number of the USB controllers and the predicted total duration is smaller than a third threshold, the restart operation is executed.
For example, if the total restart time period is to be controlled within 60 seconds (the third threshold), the historical total time period is 53 seconds (i.e., the time period of the performed restart operation is 53 seconds). If the restart operation is needed at this time, the average restart time length is taken as the estimated time length of the restart operation to be performed, for example, 10 seconds. The historical total duration of 53 seconds is added to the average restart duration of 10 seconds to yield the predicted total duration of 63 seconds. If the total duration 63 seconds is expected to be greater than 60 seconds, then no restart operation is performed.
Step 102 differs from step 305 in that step 102 determines whether to perform a restart operation in a single dimension, while step 305 determines whether to perform a restart operation in two dimensions. To control the duration of the continuous restart operation within a reasonable range.
And 306, if the predicted total duration is not less than the third threshold, executing a shutdown operation.
When the total time period is predicted to be longer than the third threshold value, even if the respective USB controllers are not started normally, the restart operation is not performed to control the restart time period within a reasonable range. In order to prevent abnormal use of the USB controller that is not normally started (for example, in industrial production, the requirements on the operation status of the terminal device are strict, and the USB controller is liable to have a great influence on industrial production), a shutdown operation is required.
Step 307, returning to execute the step of sequentially reading the identification codes of the USB controllers of each universal serial bus and the subsequent steps until the first number of the identification codes is equal to the second number of the USB controllers, and determining that each USB controller is started normally.
Step 308, if the first number of the read identification codes is equal to the second number of the USB controllers, executing a boot operation.
When the first number of the read identification codes is equal to the second number of the USB controllers, the USB controllers are started normally, and the starting operation can be executed.
In this embodiment, when the processor continuously performs the restart operation, the restart duration of the processor is controlled by the restart times, so as to avoid excessive restart operations, which results in that the terminal device cannot be used for a long time.
Optionally, on the basis of the embodiment shown in fig. 1, the detection method further includes the following steps, please refer to fig. 4, fig. 4 shows a schematic flowchart of another detection method of a USB controller provided by the present application. In this embodiment, step 202 and step 206 are the same as step 101 and step 103 in the embodiment shown in fig. 1, and refer to the descriptions related to step 101 to step 103 in the embodiment shown in fig. 1, which are not repeated here.
Step 401, sequentially reading the identification codes of the universal serial bus USB controllers.
In step 402, if the first number of the read identification codes is smaller than the second number of the USB controllers, a reboot operation is performed.
And step 403, returning to execute the step of sequentially reading the identification codes of the Universal Serial Bus (USB) controllers and the subsequent steps until the first number of the identification codes is equal to the second number of the USB controllers, and determining that each USB controller is started normally.
Step 404, counting abnormal times that each USB controller cannot be started in a plurality of restarting operations.
Step 405, dividing the number of abnormal times of each USB controller by the number of times of the multiple restarting operations, to obtain the corresponding abnormal rate of each USB controller.
And step 406, when the abnormality rate is greater than a fourth threshold value, sending alarm information, wherein the alarm information is used for prompting that the USB controller with the abnormality rate greater than the fourth threshold value has faults.
If the abnormality rate of the USB controller is high, the USB controller or the related components of the USB controller are indicated to have faults. Therefore, the application obtains the abnormality rate of the USB control according to the abnormality times and the restarting operation times of the USB controller. To send out alarm information according to the abnormality rate. And the terminal equipment is prevented from performing excessive restarting operation due to the failure of the USB controller or the related components of the USB controller.
In this embodiment, according to the abnormal times and the restarting times of the USB controller, it is determined whether the USB controller has a fault, so as to reduce the influence of the USB controller on the normal operation of the terminal device.
Referring to fig. 5, fig. 5 is a schematic diagram showing a detection device 5 of a USB controller according to the present application, and fig. 5 shows a detection device of a USB controller according to the present application, where the detection device of a USB controller shown in fig. 5 includes:
A reading unit 51 for sequentially reading the identification codes of the respective universal serial bus USB controllers;
a judging unit 52, configured to execute a restart operation if the first number of the read identification codes is smaller than the second number of the USB controllers;
And the execution unit 53 is configured to return to executing the step of sequentially reading the identification codes of the USB controllers of the universal serial bus and the subsequent steps until the first number of the identification codes is equal to the second number of the USB controllers, and determine that each USB controller is started normally.
The detection device of the USB controller provided by the application is used for determining whether each USB controller is normally started or not by reading the identification code of each USB controller. When the first number of the USB controllers which are started normally is smaller than the second number of the USB controllers, the USB controllers which cannot be started normally exist in the USB controllers. In order to prevent accidental false faults from causing the USB controllers to be unable to start, the application determines that each USB controller is started normally by restarting continuously and detecting the first number of the USB controllers and the second number of the USB controllers which are started normally when the first number of the USB controllers which are started normally is equal to the second number of the USB controllers. Therefore, each USB controller in the computer system can be ensured to be normally started in the starting-up stage.
Fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 6, a terminal device 6 of this embodiment includes a USB controller 61, a USB interface 62, a complex programmable logic device CPLD63, a processor 64, a memory 65, and a computer program 66, such as a detection program of a USB controller, stored in the memory 65 and executable on the processor 64. The processor 64, when executing the computer program 66, implements the steps of the above-described embodiments of the detection method of each of the USB controllers, such as steps 101 to 103 shown in fig. 1. Or the processor 64, when executing the computer program 66, performs the functions of the units in the above-described device embodiments, such as the functions of the units 51 to 53 shown in fig. 5.
By way of example, the computer program 66 may be partitioned into one or more units that are stored in the memory 65 and executed by the processor 64 to complete the present invention. The one or more units may be a series of computer program instruction segments capable of performing a specific function describing the execution of the computer program 66 in the one terminal device 6. For example, the computer program 66 may be divided into acquisition units and calculation units, each unit functioning specifically as follows:
the reading unit is used for sequentially reading the identification codes of the Universal Serial Bus (USB) controllers;
the judging unit is used for executing restarting operation if the first number of the read identification codes is smaller than the second number of the USB controllers;
And the execution unit is used for returning to execute the step and the subsequent step of sequentially reading the identification codes of the Universal Serial Bus (USB) controllers until the first number of the identification codes is equal to the second number of the USB controllers, and determining that the USB controllers are normally started.
The one type of terminal device may include, but is not limited to, a processor 64, a memory 65. It will be appreciated by those skilled in the art that fig. 6 is merely an example of one type of terminal device 6 and is not meant to be limiting as to one type of terminal device 6, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the one type of terminal device may also include input and output devices, network access devices, buses, etc.
The Processor 64 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 65 may be an internal storage unit of the terminal device 6, for example a hard disk or a memory of the terminal device 6. The memory 65 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the terminal device 6. Further, the memory 65 may also include both an internal storage unit and an external storage device of the one terminal device 6. The memory 65 is used for storing the computer program and other programs and data required for the one terminal device. The memory 65 may also be used to temporarily store data that has been output or is to be output.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps for implementing the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that enable the implementation of the method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least any entity or device capable of carrying computer program code to a camera device/terminal equipment, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units.
It should 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 should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to a detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is monitored" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon monitoring a [ described condition or event ]" or "in response to monitoring a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The foregoing embodiments are merely illustrative of the technical solutions of the present application, and not restrictive, and although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that modifications may still be made to the technical solutions described in the foregoing embodiments or equivalent substitutions of some technical features thereof, and that such modifications or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims (10)
1. A method for detecting a USB controller, the method comprising:
sequentially reading identification codes of all Universal Serial Bus (USB) controllers;
If the first number of the read identification codes is smaller than the second number of the USB controllers, restarting operation is executed, wherein the second number is the total number of the USB controllers, and when the USB controllers are not started normally, the identification codes corresponding to the USB controllers cannot be read;
And returning to the step of sequentially reading the identification codes of the Universal Serial Bus (USB) controllers and the subsequent step until the first number of the identification codes is equal to the second number of the USB controllers, and determining that the USB controllers are normally started.
2. The method of detection of claim 1, wherein the method of detection further comprises:
counting the restarting times of continuous restarting operation, wherein the continuous restarting operation refers to a plurality of restarting operations of which the time interval between every two adjacent restarting operations is smaller than a first threshold value;
And if the first number of the read identification codes is smaller than the second number of the USB controllers, executing a restarting operation, including:
And if the first number of the read identification codes is smaller than the second number of the USB controllers and the restarting times is not larger than a second threshold value, executing the restarting operation.
3. The method of detecting as claimed in claim 2, further comprising, after said counting the number of restarts of the continuous restart operation:
and if the restarting times are greater than the second threshold value, executing a shutdown operation.
4. The method of detection of claim 1, wherein the method of detection further comprises:
acquiring the historical total time length of continuous restarting operation, wherein the continuous restarting operation refers to multiple restarting operations with the time interval of every two adjacent restarting operations smaller than a first threshold value;
acquiring average restarting time length, wherein the average restarting time length refers to an average value calculated according to restarting time length of multiple historical restarting operations;
adding the historical total time length and the average restarting time length to obtain an estimated total time length;
Correspondingly, if the first number of the read identification codes is smaller than the second number of the USB controllers, a restarting operation is executed, which includes:
and if the first number of the read identification codes is smaller than the second number of the USB controllers and the estimated total duration is smaller than a third threshold value, executing the restarting operation.
5. The method of detecting as in claim 4, further comprising, after said adding said historical total time period to said average restart time period to obtain an estimated total time period:
And if the estimated total duration is not less than the third threshold value, executing a shutdown operation.
6. The method of detection of claim 1, wherein the method of detection further comprises:
Counting abnormal times of the incapability of starting each USB controller in a plurality of restarting operations;
dividing the abnormal times of the USB controllers by the times of the restarting operation to obtain the corresponding abnormal rate of the USB controllers;
and when the abnormality rate is greater than a fourth threshold value, sending alarm information, wherein the alarm information is used for prompting that the USB controller with the abnormality rate greater than the fourth threshold value has faults.
7. The detection method according to any one of claims 1 to 6, characterized in that the detection method further comprises:
And if the first number of the read identification codes is equal to the second number of the USB controllers, executing a starting operation.
8. A detection apparatus for a USB controller, the detection apparatus comprising:
the reading unit is used for sequentially reading the identification codes of all the Universal Serial Bus (USB) controllers, the second number is the total number of the USB controllers, and when the USB controllers are not started normally, the identification codes corresponding to the USB controllers cannot be read;
the judging unit is used for executing restarting operation if the first number of the read identification codes is smaller than the second number of the USB controllers;
And the execution unit is used for returning to execute the step and the subsequent step of sequentially reading the identification codes of the Universal Serial Bus (USB) controllers until the first number of the identification codes is equal to the second number of the USB controllers, and determining that the USB controllers are normally started.
9. Terminal device, characterized in that it comprises a USB controller, a USB interface, a complex programmable logic device CPLD, a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the method according to any one of claims 1 to 7 when said computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110472311.8A CN113254281B (en) | 2021-04-29 | 2021-04-29 | Detection method and detection device of USB controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110472311.8A CN113254281B (en) | 2021-04-29 | 2021-04-29 | Detection method and detection device of USB controller |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113254281A CN113254281A (en) | 2021-08-13 |
CN113254281B true CN113254281B (en) | 2024-11-29 |
Family
ID=77223413
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110472311.8A Active CN113254281B (en) | 2021-04-29 | 2021-04-29 | Detection method and detection device of USB controller |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113254281B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117440088B (en) * | 2023-12-20 | 2024-05-14 | 荣耀终端有限公司 | Calling method and related equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102169442A (en) * | 2011-03-24 | 2011-08-31 | 杭州华三通信技术有限公司 | Method, equipment, device and system for performing system boot by using USB (universal serial bus) device |
CN102446128A (en) * | 2010-10-14 | 2012-05-09 | 鸿富锦精密工业(深圳)有限公司 | I2C interface device test system and test method |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6073193A (en) * | 1997-04-24 | 2000-06-06 | Cypress Semiconductor Corp. | Fail safe method and apparatus for a USB device |
JP5214641B2 (en) * | 2010-01-27 | 2013-06-19 | 東芝テック株式会社 | Universal serial bus host device and program |
CN103049402A (en) * | 2012-11-21 | 2013-04-17 | 大唐移动通信设备有限公司 | Method and device for controlling universal serial bus (USB) device |
CN103955414A (en) * | 2014-04-24 | 2014-07-30 | 深圳市道通科技有限公司 | Self-restoration method and device of USB (universal serial bus) Host fault |
WO2017113185A1 (en) * | 2015-12-30 | 2017-07-06 | 深圳配天智能技术研究院有限公司 | Data processing method and machine control panel (mcp) |
US10708406B2 (en) * | 2018-04-25 | 2020-07-07 | Future Dial, Inc. | Enhanced system and method for fully automated reverse logistics platform |
US10866623B2 (en) * | 2018-11-16 | 2020-12-15 | Dell Products L.P. | Information handling system and method to detect and recover from no power/no post failures |
CN111124517B (en) * | 2019-12-23 | 2023-01-20 | 湖南国科微电子股份有限公司 | Embedded chip boot starting method and device, computer equipment and storage medium |
CN111538539B (en) * | 2020-04-23 | 2022-07-22 | 苏州浪潮智能科技有限公司 | Storage system startup method, device, and computer-readable storage medium |
-
2021
- 2021-04-29 CN CN202110472311.8A patent/CN113254281B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102446128A (en) * | 2010-10-14 | 2012-05-09 | 鸿富锦精密工业(深圳)有限公司 | I2C interface device test system and test method |
CN102169442A (en) * | 2011-03-24 | 2011-08-31 | 杭州华三通信技术有限公司 | Method, equipment, device and system for performing system boot by using USB (universal serial bus) device |
Also Published As
Publication number | Publication date |
---|---|
CN113254281A (en) | 2021-08-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114328102B (en) | Equipment status monitoring method, device, equipment and computer-readable storage medium | |
US9778988B2 (en) | Power failure detection system and method | |
CN104636221B (en) | Computer system fault processing method and device | |
CN109656786B (en) | Log acquisition method and device | |
US20200226262A1 (en) | Firmware security guarding method and electronic system using the same | |
CN109375956B (en) | A method for restarting an operating system, a logical device and a control device | |
CN111475218A (en) | Server starting method, server and computer readable storage medium | |
CN112631820A (en) | Fault recovery method and device of software system | |
US10318731B2 (en) | Detection system and detection method | |
CN113254281B (en) | Detection method and detection device of USB controller | |
CN113641537A (en) | A server startup system, method and medium | |
CN114756406B (en) | Application crash processing method, device and electronic device | |
CN110347558A (en) | A kind of server apparatus method for diagnosing faults and device and equipment | |
CN112395121A (en) | Drive loading processing method and device, storage medium and computer equipment | |
CN107273291B (en) | Processor debugging method and system | |
US11669336B2 (en) | Out-of-band custom baseboard management controller (BMC) firmware stack monitoring system and method | |
CN115904793A (en) | Memory unloading method, system and chip based on multi-core heterogeneous system | |
CN111813600B (en) | Method, device, terminal and medium for recovering controller | |
CN107179911A (en) | A kind of method and apparatus for restarting management engine | |
JP6094685B2 (en) | Information processing apparatus and information processing apparatus control program | |
CN114661500A (en) | Robot fault detection method, system and terminal equipment | |
CN114003461A (en) | Server failure prediction method, system, terminal and storage medium | |
CN112631863A (en) | BMC health state detection method, electronic device and storage medium | |
CN117389658B (en) | Method, device, equipment and medium for optimizing equipment of on-board watchdog | |
CN111813037A (en) | Starting-up control method, starting-up control device and electronic 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |