CN113254281A - Detection method and detection device for USB controller - Google Patents
Detection method and detection device for USB controller Download PDFInfo
- Publication number
- CN113254281A CN113254281A CN202110472311.8A CN202110472311A CN113254281A CN 113254281 A CN113254281 A CN 113254281A CN 202110472311 A CN202110472311 A CN 202110472311A CN 113254281 A CN113254281 A CN 113254281A
- Authority
- CN
- China
- Prior art keywords
- usb
- controllers
- identification codes
- restarting
- restart
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 42
- 238000004590 computer program Methods 0.000 claims description 26
- 238000000034 method Methods 0.000 claims description 25
- 230000002159 abnormal effect Effects 0.000 claims description 17
- 238000003860 storage Methods 0.000 claims description 11
- 238000007689 inspection Methods 0.000 abstract 1
- 230000001960 triggered effect Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 238000009776 industrial production Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
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 following steps: sequentially reading the identification codes of the USB controllers; if the first number of the read identification codes is smaller than the second number of the USB controllers, executing restarting operation; and returning to execute the step of sequentially reading the identification codes of all 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 all the USB controllers are normally started. In order to prevent accidental false faults from causing the USB controllers to be incapable of being started, the USB controller is continuously restarted, the first number of the normally started USB controllers and the second number of the normally started USB controllers are detected, and the normally started USB controllers are determined. The USB controller can be ensured to be normally started in the starting stage of each USB controller in 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
A Universal Serial Bus (USB) is a serial bus standard for connecting a computer system and external devices, and is also a technical specification of an input/output interface, and is widely applied to information communication products such as personal computers and mobile devices. For example: the daily used U disk, mobile hard disk, mouse and the like 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).
In the booting stage of the computer system, the USB controller has the following problems that are hard to be noticed: when the computer system is started, the USB controller may be accidentally disabled to start up, so that the USB interface corresponding to the USB controller cannot be used normally. However, in most cases, the reason for the failure to properly start the USB controller is not due to a real failure of the USB controller, but rather a sporadic, false failure. Therefore, how to ensure that each USB controller in the computer system is normally started at the boot stage becomes a technical problem that needs to be solved urgently.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, 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 at a boot stage.
A first aspect of an embodiment of the present application provides a method for detecting a USB controller, where the method includes:
sequentially reading the 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, executing restarting operation;
and returning to execute the step of sequentially reading the identification codes of all 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 all the USB controllers are normally started.
A second aspect of an embodiment of the present application provides a detection apparatus for a USB controller, where the detection apparatus includes:
the reading unit is used for sequentially reading the identification codes of all 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 of sequentially reading the identification codes of all 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 then determining that all the USB controllers are normally started.
A third aspect of the embodiments of the present application provides a terminal device, including a USB controller, a USB interface, a complex programmable logic device CPLD, a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the method according to the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that: 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 USB controller can determine whether the USB controllers are normally started or not by reading the identification codes of the USB controllers. And when the first number of the normally started USB controllers is smaller than the second number of the USB controllers, indicating that the USB controllers which cannot be normally started exist in each USB controller. In order to prevent accidental false faults from causing the USB controllers to be incapable of being started, the USB controller is continuously restarted, the first number of the normally started USB controllers and the second number of the normally started USB controllers are detected, and when the first number of the normally started USB controllers is equal to the second number of the normally started USB controllers, the normally started USB controllers are determined to be all normally started. Therefore, each USB controller in the computer system can be ensured to be normally started in the boot stage.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the related technical descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram illustrating a detection method of a USB controller provided in the present application;
FIG. 2 is a schematic flow chart diagram illustrating another USB controller detection method provided herein;
FIG. 3 is a schematic flow chart diagram illustrating another USB controller detection method provided herein;
FIG. 4 is a schematic flow chart diagram illustrating another USB controller detection method provided herein;
FIG. 5 is a schematic diagram of a detection device of a USB controller provided in 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 particular system structures, 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, a detection device, a terminal device and a computer readable storage medium of a USB controller, which can solve the technical problem that each USB controller in a computer system cannot be normally started in a starting-up stage.
Firstly, the application provides a detection method of a USB controller, which specifically includes the following contents:
referring to fig. 1, fig. 1 shows a schematic flow chart of a detection method of a USB controller provided in the present application. As shown in fig. 1, the detection method may include the steps of:
step 101, reading the identification codes of the universal serial bus USB controllers in sequence.
The identification code includes, but is not limited to, a serial number of the USB controller, a physical address of the USB controller, and a pcie (peripheral component interconnect express) code. Preferably, since the PCIe code is a code specific to a Universal Serial Bus (USB), the PCIe code may be preferentially adopted as the identification code.
When the USB controller is normally started, the processor can read the identification code corresponding to the USB controller. When the USB controller is not normally started, the processor cannot read the identification code corresponding to the USB controller. Therefore, the identification code can be used for identifying whether the USB controller is started normally.
And 102, if the first number of the read identification codes is smaller than the second number of the USB controllers, executing a restarting 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 normally started exist in all the USB controllers. For example: the second number of all the USB controllers is 5, and the first number of the read identification codes is 4, which indicates that 1 USB controller in the 5 USB controllers is not normally started. However, the reason why the USB controller is not normally started is various, but most of the time, the USB controller is not normally started as a sporadic false fault (i.e. not because the USB controller itself has a fault but because of a sporadic factor, such as current instability or initialization failure, etc.). Occasional false failures, often immediately after a reboot, return to normal (i.e., the USB controller starts up normally).
Based on the above rule, in order to avoid accidental false failures, all USB controllers cannot be started normally, and further connected USB interfaces cannot be used, the processor executes a restart operation after determining that the first number is smaller than the second number.
And 103, returning to execute the step of sequentially reading the identification codes of all 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 all the USB controllers are normally started.
In order 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 normally started (i.e., step 101 to step 103 are executed), so that when it is determined that each USB controller is not normally started, step 101 to step 103 are executed in a loop, and when it is determined that each USB controller is normally started, 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 bottom firmware or upper 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 USB controller can determine whether the USB controllers are normally started or not by reading the identification codes of the USB controllers. And when the first number of the normally started USB controllers is smaller than the second number of the USB controllers, indicating that the USB controllers which cannot be normally started exist in each USB controller. In order to prevent accidental false faults from causing the USB controllers to be incapable of being started, the USB controller is continuously restarted, the first number of the normally started USB controllers and the second number of the normally started USB controllers are detected, and when the first number of the normally started USB controllers is equal to the second number of the normally started USB controllers, the normally started USB controllers are determined to be all normally started. Therefore, each USB controller in the computer system can be ensured to be normally started in the boot 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, and fig. 2 shows a schematic flowchart of another detection method for a USB controller provided in this application. Step 202 and step 205 in this embodiment are the same as step 101 and step 103 in the embodiment shown in fig. 1, and please refer to the related description of step 101 and step 103 in the embodiment shown in fig. 1, which is not repeated herein.
Step 201, counting the restart times of continuous restart operation; the continuous restarting operation refers to a plurality of restarting operations, wherein the time interval between every two restarting operations is smaller than a first threshold value.
Since the terminal device is not available when the operation is restarted. And frequent restart operations often cause the terminal equipment to be unusable for a long time. Therefore, the processor controls the restart times within a reasonable range by counting the restart times of continuous restart operations.
It is noted that the restart operation is often a user's daily operation, so the processor needs to distinguish the restart operation triggered daily by the user from the restart operation triggered by the USB controller failing to start normally. The frequency of the restart operation triggered by the user is low (the number of the restart operation in one day is usually not more than two), while the frequency of the restart operation triggered by the failure of the USB controller to normally start is high, and the time interval is short and continuous, so the continuous restart operation is used as the screening logic in the application to eliminate the restart operation triggered by the user in the daily use process.
The execution subject of the "counting the restart times of the continuous restart operation" may be a counter running in the processor, or may be counted by a complex programmable logic device CPLD connected to the processor.
Step 202, reading the corresponding identification codes from the universal serial bus USB controllers in sequence.
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 times of the restart is not greater than a second threshold, the restart operation is executed.
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 restart times are greater than the second threshold, executing shutdown operation.
When the restart times is greater than the second threshold, even if the USB controllers are not normally started, the restart operation is not executed, so that the restart times are controlled within a reasonable range. In order to prevent the abnormal use of the USB controller that is not normally started (for example, in industrial production, the requirement on the operating condition of the terminal device is strict, and the USB controller is liable to cause a large influence on the industrial production), the shutdown operation needs to be performed.
It is understood that if the requirement on the operation state of the terminal device is relaxed, in step 204, a power-on operation may also be performed (i.e., the power-off operation is replaced by the power-on operation).
And step 205, returning to execute the step of sequentially reading the corresponding identification codes from 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 the USB controllers are normally started.
In step 206, if the first number of the read identification codes is equal to the second number of the USB controllers, a boot 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 normally started, and the starting operation can be executed.
In this embodiment, when the processor is continuously performing the restart operation, the number of restart times of the processor is controlled by the number of restart times, so as to avoid excessive restart operations, which may result 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, and fig. 3 shows a schematic flowchart of another detection method for a USB controller provided in this application. Step 304 and step 307 in this embodiment are the same as step 101 and step 103 in the embodiment shown in fig. 1, and specific reference is made to the description related to step 101 to step 103 in the embodiment shown in fig. 1, which is not repeated herein.
Step 301, acquiring the total historical duration of continuous restart operation; the continuous restarting operation refers to a plurality of restarting operations, wherein the time interval between every two adjacent restarting operations is smaller than a first threshold value.
Since the terminal device is not available when the operation is restarted. And frequent restart operations often cause the terminal equipment to be unusable for a long time. The processor controls the total restart duration to be within a reasonable range by calculating the expected total duration of the continuous restart operation.
It is noted that the restart operation is often a user's daily operation, so the processor needs to distinguish the restart operation triggered daily by the user from the restart operation triggered by the USB controller failing to start normally. The frequency of the restart operation triggered by the user is low (the number of the restart operation in one day is usually not more than two), while the frequency of the restart operation triggered by the failure of the USB controller to normally start is high, and the time interval is short and continuous, so the continuous restart operation is used as the screening logic in the application to eliminate the restart operation triggered by the user in the daily use process.
Step 302, obtaining an average restart duration; the average restarting duration is an average value calculated according to the restarting durations of a plurality of historical restarting operations.
The average restart duration is used for estimating the restart duration for which a restart operation will be performed in the future. 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 duration may be a pre-calculated duration (step 302 only needs to obtain a pre-stored average restart duration), or may be calculated in step 302.
And 303, adding the historical total duration and the average restarting duration to obtain the expected total duration.
It will be appreciated that the historical total duration is the duration that has elapsed, while the average restart duration is an estimated duration of restart operations that are about to occur. To determine whether the restart operation is currently performed according to the expected total duration (i.e., to determine whether the total duration exceeds a third threshold if the restart operation is performed again, so as to control the total duration within a reasonable range).
And step 304, sequentially reading the identification codes of the universal serial bus USB controllers.
Step 305, if the first number of the read identification codes is smaller than the second number of the USB controllers, and the expected total duration is smaller than a third threshold, the restart operation is executed.
Illustratively, if the total restart duration is controlled to be within 60 seconds (the third threshold), the historical total duration is 53 seconds (i.e., the duration of the restart operation that has been performed is 53 seconds). If a restart operation is needed at this time, the average restart duration is used as an estimated duration of the restart operation to be performed, for example: for 10 seconds. The historical total duration of 53 seconds is added to the average restart duration of 10 seconds to obtain the expected total duration of 63 seconds. The restart operation is not performed when the expected total time length of 63 seconds is greater than 60 seconds.
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.
Step 306, if the expected total duration is not less than the third threshold, performing shutdown operation.
When the estimated total duration is greater than the third threshold, even if the USB controllers are not all normally started, the restarting operation is not executed, so that the restarting duration is controlled within a reasonable range. In order to prevent the abnormal use of the USB controller that is not normally started (for example, in industrial production, the requirement on the operating condition of the terminal device is strict, and the USB controller is liable to cause a large influence on the industrial production), the shutdown operation needs to be performed.
Step 307, returning to the step of sequentially reading the identification codes of the USB controllers and the subsequent steps, and determining that the USB controllers are normally started until the first number of the identification codes is equal to the second number of the USB controllers.
Step 308, if the first number of the read identification codes is equal to the second number of the USB controllers, then 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 normally started, and the starting operation can be executed.
In this embodiment, when the processor is continuously performing the restart operation, the restart duration of the processor is controlled by the restart times, so as to avoid excessive restart operations, which may result 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, and fig. 4 shows a schematic flowchart of another detection method for a USB controller provided in this application. Step 202 and step 206 in this embodiment are the same as step 101 and step 103 in the embodiment shown in fig. 1, and please refer to the related description of step 101 to step 103 in the embodiment shown in fig. 1, which is not repeated herein.
And step 401, reading the identification codes of the universal serial bus USB controllers in sequence.
Step 402, if the first number of the read identification codes is smaller than the second number of the USB controllers, executing a restart operation.
And 403, returning to execute the step of sequentially reading the identification codes of all 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 all the USB controllers are normally started.
And step 404, counting the abnormal times that each USB controller cannot be started in multiple restart operations.
And 405, dividing the abnormal times of each USB controller by the times of the multiple restarting operations respectively to obtain the abnormal rate corresponding to each USB controller.
Step 406, when the abnormal rate is greater than a fourth threshold, sending alarm information; the alarm information is used for prompting that the USB controller with the abnormal rate larger than the fourth threshold value has a fault.
If the abnormal rate of the USB controller is high, the USB controller or components related to the USB controller are indicated to have faults. Therefore, the abnormal rate of the USB control is obtained according to the abnormal times and the restarting operation times of the USB controller. So as to send out alarm information according to the abnormal rate. The terminal equipment is prevented from carrying out excessive restarting operation due to the faults of the USB controller or components related to the USB controller.
In the embodiment, whether the USB controller has a fault is determined according to the abnormal times and the restarting operation times of the USB controller, so that the influence of the USB controller on the normal operation of the terminal equipment is reduced.
Fig. 5 shows a schematic diagram of a detection apparatus 5 of a USB controller according to the present application, and fig. 5 shows a schematic diagram of a detection apparatus of a USB controller according to the present application, where the detection apparatus of a USB controller shown in fig. 5 includes:
a reading unit 51 for sequentially reading the identification codes of the respective USB controllers;
a determining 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 execute the step of sequentially reading the identification codes of the USB controllers and the subsequent steps, and determine that the USB controllers are normally started until the first number of the identification codes is equal to the second number of the USB controllers.
The application provides a detection device of USB controller, through reading the identification code of each USB controller to confirm whether each USB controller starts normally. And when the first number of the normally started USB controllers is smaller than the second number of the USB controllers, indicating that the USB controllers which cannot be normally started exist in each USB controller. In order to prevent accidental false faults from causing the USB controllers to be incapable of being started, the USB controller is continuously restarted, the first number of the normally started USB controllers and the second number of the normally started USB controllers are detected, and when the first number of the normally started USB controllers is equal to the second number of the normally started USB controllers, the normally started USB controllers are determined to be all normally started. Therefore, each USB controller in the computer system can be ensured to be normally started in the boot 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: USB controller 61, USB interface 62, complex programmable logic device CPLD63, processor 64, memory 65, and computer program 66, such as a USB controller detection program, stored in said memory 65 and executable on said processor 64. The processor 64, when executing the computer program 66, implements the steps in each of the above-mentioned embodiments of the USB controller detection method, such as the steps 101 to 103 shown in fig. 1. Alternatively, the processor 64 implements 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, when executing the computer program 66.
Illustratively, the computer program 66 may be divided into one or more units, which are stored in the memory 65 and executed by the processor 64 to carry out the invention. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 66 in the kind of terminal device 6. For example, the computer program 66 may be divided into an acquisition unit and a calculation unit, each unit having the following specific functions:
the reading unit is used for sequentially reading the identification codes of all 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 of sequentially reading the identification codes of all 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 then determining that all the USB controllers are normally started.
The terminal device may include, but is not limited to, a processor 64, a memory 65. Those skilled in the art will appreciate that fig. 6 is merely an example of one type of terminal device 6 and does not constitute a limitation of one type of terminal device 6, and may include more or fewer components than shown, or some components may be combined, or different components, for example, the one type of terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 64 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, 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, such as 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 Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, 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 kind of terminal device 6. The memory 65 is used for storing the computer program and other programs and data required by the kind of terminal equipment. 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 numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an 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 photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
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 implementation. 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 ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed 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 will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to monitoring ". Similarly, the phrase "if it is determined" or "if [ a described condition or event ] is monitored" may be interpreted depending on the context to mean "upon determining" or "in response to determining" or "upon monitoring [ a described condition or event ]" or "in response to monitoring [ a described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this 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 present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (10)
1. A detection method of a USB controller is characterized by comprising the following steps:
sequentially reading the 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, executing restarting operation;
and returning to execute the step of sequentially reading the identification codes of all 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 all the USB controllers are normally started.
2. The detection method of claim 1, further comprising:
counting the restart times of continuous restart operation; the continuous restarting operation refers to a plurality of times of restarting operations, wherein the time interval between every two adjacent restarting operations is smaller than a first threshold value;
if the first number of the read identification codes is smaller than the second number of the USB controllers, executing a restart operation, including:
and if the read first number of the 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 detection method of claim 2, wherein after counting the number of restarts of the continuous restart operation, further comprising:
and if the restart times are greater than the second threshold value, executing shutdown operation.
4. The detection method of claim 1, further comprising:
acquiring the total historical duration of continuous restart operation; the continuous restarting operation refers to a plurality of times of restarting operations, wherein the time interval between every two adjacent restarting operations is smaller than a first threshold value;
acquiring average restart duration; the average restarting duration is an average value calculated according to the restarting durations of a plurality of historical restarting operations;
adding the historical total duration and the average restarting duration to obtain an estimated total duration;
correspondingly, if the first number of the read identification codes is smaller than the second number of the USB controllers, a restart operation is performed, including:
and if the first number of the read identification codes is smaller than the second number of the USB controllers, and the expected total duration is smaller than a third threshold value, executing the restarting operation.
5. The detection method as claimed in claim 4, wherein after said adding said historical total duration to said average restart duration to obtain an expected total duration, further comprising:
and if the expected total duration is not less than the third threshold, executing shutdown operation.
6. The detection method of claim 1, further comprising:
counting the abnormal times that each USB controller cannot be started in multiple restart operations;
dividing the abnormal times of each USB controller by the times of the repeated restarting operation respectively to obtain the abnormal rate corresponding to each USB controller;
when the abnormal rate is larger than a fourth threshold value, alarm information is sent out; the alarm information is used for prompting that the USB controller with the abnormal rate larger than the fourth threshold value has a fault.
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 the 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 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 of sequentially reading the identification codes of all 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 then determining that all 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 executing said computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out 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 CN113254281A (en) | 2021-04-29 | 2021-04-29 | Detection method and detection device for USB controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110472311.8A CN113254281A (en) | 2021-04-29 | 2021-04-29 | Detection method and detection device for USB controller |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113254281A true CN113254281A (en) | 2021-08-13 |
Family
ID=77223413
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110472311.8A Pending CN113254281A (en) | 2021-04-29 | 2021-04-29 | Detection method and detection device for USB controller |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113254281A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117440088A (en) * | 2023-12-20 | 2024-01-23 | 荣耀终端有限公司 | Conversation method and related equipment |
Citations (11)
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 |
JP2011154549A (en) * | 2010-01-27 | 2011-08-11 | Toshiba Tec Corp | Universal serial bus host device and program |
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 | 鸿富锦精密工业(深圳)有限公司 | System and method for testing I2C interface device |
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 |
CN107615193A (en) * | 2015-12-30 | 2018-01-19 | 深圳配天智能技术研究院有限公司 | A kind of data processing method and machine tools control panel MCP |
US20190335033A1 (en) * | 2018-04-25 | 2019-10-31 | Future Dial, Inc. | Enhanced system and method for fully automated reverse logistics platform |
CN111124517A (en) * | 2019-12-23 | 2020-05-08 | 湖南国科微电子股份有限公司 | Embedded chip boot starting method and device, computer equipment and storage medium |
US20200159302A1 (en) * | 2018-11-16 | 2020-05-21 | Dell Products L.P. | Information Handling System And Method To Detect And Recover From No Power/No Post Failures |
CN111538539A (en) * | 2020-04-23 | 2020-08-14 | 苏州浪潮智能科技有限公司 | Storage system starting method and device and computer readable storage medium |
-
2021
- 2021-04-29 CN CN202110472311.8A patent/CN113254281A/en active Pending
Patent Citations (11)
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 |
JP2011154549A (en) * | 2010-01-27 | 2011-08-11 | Toshiba Tec Corp | Universal serial bus host device and program |
CN102446128A (en) * | 2010-10-14 | 2012-05-09 | 鸿富锦精密工业(深圳)有限公司 | System and method for testing I2C interface device |
CN102169442A (en) * | 2011-03-24 | 2011-08-31 | 杭州华三通信技术有限公司 | Method, equipment, device and system for performing system boot by using USB (universal serial bus) device |
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 |
CN107615193A (en) * | 2015-12-30 | 2018-01-19 | 深圳配天智能技术研究院有限公司 | A kind of data processing method and machine tools control panel MCP |
US20190335033A1 (en) * | 2018-04-25 | 2019-10-31 | Future Dial, Inc. | Enhanced system and method for fully automated reverse logistics platform |
US20200159302A1 (en) * | 2018-11-16 | 2020-05-21 | Dell Products L.P. | Information Handling System And Method To Detect And Recover From No Power/No Post Failures |
CN111124517A (en) * | 2019-12-23 | 2020-05-08 | 湖南国科微电子股份有限公司 | Embedded chip boot starting method and device, computer equipment and storage medium |
CN111538539A (en) * | 2020-04-23 | 2020-08-14 | 苏州浪潮智能科技有限公司 | Storage system starting method and device and computer readable storage medium |
Non-Patent Citations (2)
Title |
---|
ADAM BATES 等: "Leveraging USB to Establish Host Identity Using Commodity Devices", 《21ST ISOC NETWORK AND DISTRIBUTED SYSTEM SECURITY SYMPOSIUM (NDSS\'14)》, 31 December 2014 (2014-12-31), pages 1 - 14 * |
冯光磊 等: "基于ARM和Linux的USB OHCI驱动的设计与实现", 《计算机应用》, vol. 29, no. 1, 31 December 2009 (2009-12-31), pages 53 - 56 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117440088A (en) * | 2023-12-20 | 2024-01-23 | 荣耀终端有限公司 | Conversation method and related equipment |
CN117440088B (en) * | 2023-12-20 | 2024-05-14 | 荣耀终端有限公司 | Conversation method and related equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109542744A (en) | Detect method, apparatus, storage medium and the terminal of terminal booting abnormal problem | |
CN114328102A (en) | Equipment state monitoring method, device, equipment and computer readable storage medium | |
CN109375956B (en) | Method for restarting operating system, logic device and control device | |
CN111694677A (en) | Message queue management method, device, terminal and computer-readable storage medium | |
CN111949457A (en) | Server fault chip detection method and device | |
CN110083491A (en) | A kind of BIOS initialization method, apparatus, equipment and storage medium | |
CN110445932B (en) | Abnormal card dropping processing method and device, storage medium and terminal | |
CN113254281A (en) | Detection method and detection device for USB controller | |
CN113672306B (en) | Server component self-checking abnormity recovery method, device, system and medium | |
CN114756406A (en) | Processing method and device for application program crash and electronic equipment | |
CN112783721B (en) | Method, device and system for monitoring I2C bus and storage medium | |
CN114116276A (en) | BMC hang-up self-recovery method, system, terminal and storage medium | |
CN113641537A (en) | Starting system, method and medium for server | |
CN112395121A (en) | Drive loading processing method and device, storage medium and computer equipment | |
CN107179911B (en) | Method and equipment for restarting management engine | |
CN107273291B (en) | Processor debugging method and system | |
CN115098342A (en) | System log collection method, system, terminal and storage medium | |
CN115269252A (en) | Application program fault processing method, device, equipment and storage medium | |
US20220398105A1 (en) | Out-of-band custom baseboard management controller (bmc) firmware stack monitoring system and method | |
CN114816852A (en) | Method, device and medium for recovering user configuration data | |
CN112631863A (en) | BMC health state detection method, electronic device and storage medium | |
CN114579388A (en) | Vehicle-mounted system state monitoring method and system, storage medium and electronic equipment | |
CN111813037A (en) | Starting-up control method, starting-up control device and electronic equipment | |
CN109408266B (en) | Method and device for determining restart type | |
CN117826685A (en) | System start detection device and method of embedded equipment and embedded 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 |