A method and device for verifying the function of a universal serial bus host controller

By acquiring update log information and matching type keywords, and combining them with preset strategies to automatically verify external devices, the problem of low efficiency in verifying the functions of the Universal Serial Bus host controller is solved, and efficient automated verification is achieved.

CN119494092BActive Publication Date: 2026-03-20SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In the existing technology, the functional verification efficiency of the Universal Serial Bus host controller is low, mainly relying on manual verification of each external device, which leads to low efficiency.

Method used

By obtaining update log information from the enumeration log, matching target type keywords with standard type keywords, determining the type of external device, and automatically performing verification based on a preset function verification strategy, including device node identification and function verification.

Benefits of technology

It has achieved automated functional verification, improved verification efficiency, reduced manual intervention, and enhanced the speed and accuracy of verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494092B_ABST
    Figure CN119494092B_ABST
Patent Text Reader

Abstract

The application provides a universal serial bus host controller function verification method and device, and relates to the technical field of computers.The method comprises the following steps: acquiring update log information of an enumeration log; the update log information comprises at least one standard type keyword; a plurality of type keywords are matched with the update log information respectively, a type keyword matched with the standard type keyword is determined as a target type keyword, and the type of an external universal serial bus device is determined according to the target type keyword; the target type keyword corresponds to the type of the external universal serial bus device; a target function verification strategy is determined from a plurality of preset function verification strategies based on the type of the external universal serial bus device, and the function verification strategy is used to perform function verification on the external universal serial bus device; the preset function verification strategy corresponds to the type of the external universal serial bus device in a one-to-one manner, and the function verification efficiency of the universal serial bus external device can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and particularly relates to a function verification method and device of a universal serial bus host controller. BACKGROUND

[0002] Universal Serial Bus (USB) is a widely used serial communication technology, which is mature in technology, strong in interface function, universal in application and supports many types of devices, so most System on Chip (SOC) contains a universal serial bus host controller. The system on chip includes simple single-chip microcomputers and complex processors.

[0003] In order to ensure that the universal serial bus host controller works stably and efficiently in various environments, the universal serial bus host controller needs to be functionally verified. The function verification mainly includes whether the universal serial bus host controller supports the function implementation of various universal serial bus external devices. At present, when performing function verification, each step of the command for function verification of each universal serial bus external device is executed manually, and the results of the command execution are manually analyzed, resulting in relatively low function verification efficiency of the universal serial bus external device. SUMMARY

[0004] In view of the problems in the prior art, the present application provides a function verification method and device of a universal serial bus host controller.

[0005] The present application provides a function verification method of a universal serial bus host controller, comprising: acquiring update log information of an enumeration log; wherein the update log information comprises at least one standard type keyword; respectively matching a plurality of type keywords with the update log information, determining a type keyword matched with the standard type keyword as a target type keyword, and determining the type of an external universal serial bus device according to the target type keyword; wherein the target type keyword corresponds to the type of the external universal serial bus device; determining a target function verification strategy from a plurality of preset function verification strategies based on the type of the external universal serial bus device, and using the function verification strategy to perform function verification on the external universal serial bus device; wherein the preset function verification strategy corresponds to the type of the external universal serial bus device one by one.

[0006] According to the function verification method of the USB host controller provided in the application, the update log information of the enumeration log is obtained, including: backing up the enumeration log to obtain a backup enumeration log; comparing the current enumeration log with the backup enumeration log in a specified time interval, and obtaining the update log information based on the difference between the current enumeration log and the backup enumeration log in the case that the current enumeration log is different from the backup enumeration log.

[0007] According to the function verification method of the USB host controller provided in the application, before obtaining the update log information of the enumeration log, the method further includes: backing up the device node directory of the external USB device to obtain a backup device node directory; wherein the device node directory includes a node keyword, and the node keyword corresponds to device node information; after determining the type of the external USB device, the method further includes: obtaining an updated device node directory; obtaining a standard node keyword based on the type of the external USB device, searching in the backup device node directory using the standard node keyword, determining that the node keyword matched with the standard node keyword is a first target node keyword, obtaining the backup device node information corresponding to the first target node keyword; searching in the updated device node directory using the standard node keyword, determining that the node keyword matched with the standard node keyword is a second target node keyword, obtaining the updated device node information corresponding to the second target node keyword; comparing the backup device node information with the updated device node information to obtain newly added device node information under the node path; obtaining the device node of the external USB device based on the newly added device node information; and performing function verification on the external USB device using the function verification strategy, specifically including: performing function verification on the corresponding external USB device through the device node using the function verification strategy.

[0008] According to the function verification method of the USB host controller provided in the application, the update log information further comprises at least one node keyword corresponding to a device node name; after determining the type of the external USB device, the method further comprises: obtaining a standard node keyword based on the type of the external USB device, searching in the update log information using the standard node keyword, determining a node keyword matched with the standard node keyword as a target node keyword, and obtaining a device node name corresponding to the target node keyword; obtaining a device node path based on the type of the external USB device; the type of the external USB device corresponds to the device node path one by one; obtaining a device node of the external USB device based on the device node path and the device node name; and performing function verification on the external USB device using the function verification strategy, specifically comprising: performing function verification on the corresponding external USB device through the device node using the function verification strategy.

[0009] According to the function verification method of the USB host controller provided in the application, the external USB device is a flash disk; and performing function verification on the external USB device using the function verification strategy comprises: obtaining a verification file and calculating a verification check value of the verification file; creating a mounting directory and mounting the device node of the flash disk to the mounting directory; writing the verification file to the mounting directory to obtain a written verification file and calculating a write check value of the written verification file; in the case that the write check value is the same as the verification check value, reading the verification file from the mounting directory to obtain a read verification file and calculating a read check value of the read verification file; and in the case that the read check value is the same as the verification check value, determining that the function of the flash disk is normal.

[0010] According to the function verification method of the universal serial bus host controller provided in the application, the external universal serial bus device is a click input device; the function verification method comprises the following steps: backing up event data of the click input device to obtain input backup event data; monitoring the click input device, and obtaining first monitoring event data when the click input device performs click input and generates an interrupt signal; comparing the first monitoring event data with the input backup event data, and determining that the monitoring event data has new data, and then backing up the monitoring event data to obtain no input backup event data; monitoring the click input device, and obtaining second monitoring event data when the click input device does not perform click input and does not generate an interrupt signal; comparing the second monitoring event data with the no input backup event data, and determining that the monitoring event data has no new data, and then determining that the function of the click input device is normal.

[0011] According to the function verification method of the universal serial bus host controller provided in the application, the external universal serial bus device is a video input device; the function verification method comprises the following steps: obtaining, through a device node of the video input device, video formats supported by the video input device and each set of video parameter values supported by the video input device under each video format; the video parameters include resolution, frame rate, image quantity and video file volume; according to each video format and each set of video parameter values corresponding to the video format, obtaining a detection video stream from the video input device through the device node; obtaining detection video parameter values of the detection video stream, and determining that the function of the video input device is normal when a difference degree between the video monitoring parameter values and the video parameter values is within a preset range.

[0012] According to the function verification method of the USB host controller provided in the application, before searching in the update log information through the enumeration type keyword, the method further comprises: searching in the update log information based on an error reporting keyword, and in the case that it is determined that there is no error reporting keyword, performing the step of respectively matching a plurality of type keywords with the update log information. The application further provides a function verification device of a USB host controller, comprising: an update log information acquisition module, configured to acquire update log information of an enumeration log; wherein the update log information comprises at least one standard type keyword; a device type identification module, configured to respectively match a plurality of type keywords with the update log information, determine a type keyword matched with the standard type keyword as a target type keyword, and determine the type of an external USB device according to the target type keyword; wherein the target type keyword corresponds to the type of the external USB device; and a function verification module, configured to determine a target function verification strategy from a plurality of preset function verification strategies based on the type of the external USB device, and perform function verification on the external USB device using the function verification strategy; wherein the preset function verification strategy corresponds to the type of the external USB device in a one-to-one manner.

[0013] The application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the function verification method of the USB host controller according to any one of the above-mentioned embodiments when executing the computer program.

[0014] Compared with manually performing function verification on each USB external device, the function verification method and device of the USB host controller provided in the embodiments of the application can automatically perform function verification on each USB external device by acquiring update log information of an enumeration log, determining a target type keyword from a plurality of type keywords based on a standard type keyword in the update log information to determine the type of an external USB device, and performing function verification on the external USB device using a target function verification strategy, thereby improving verification efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.

[0016] Figure 1is one of flow diagrams of the functional verification method of the USB host controller provided in the present application.

[0017] Figure 2 is one of framework diagrams of the functional verification method of the USB host controller provided in the present application.

[0018] Figure 3 is one of framework diagrams of the functional verification method of the USB host controller provided in the present application.

[0019] Figure 4 is one of framework diagrams of the functional verification method of the USB host controller provided in the present application.

[0020] Figure 5 is one of framework diagrams of the functional verification method of the USB host controller provided in the present application.

[0021] Figure 6 is one of framework diagrams of the functional verification method of the USB host controller provided in the present application.

[0022] Figure 7 is one of framework diagrams of the functional verification method of the USB host controller provided in the present application.

[0023] Figure 8 is one of framework diagrams of the functional verification method of the USB host controller provided in the present application.

[0024] Figure 9 is one of structure diagrams of the functional verification device of the USB host controller provided in the present application.

[0025] Figure 10 is one of structure diagrams of the functional verification device of the USB host controller provided in the present application.

[0026] Figure 11 is one of structure diagrams of the electronic device provided in the present application. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those of ordinary skill in the art without any creative work fall within the scope of protection of the present application.

[0028] The present application will be described below with reference to the drawings. Figures 1-10The application discloses a function verification method and device of a universal serial bus host controller. Figure 1 is a flowchart of the function verification method of the universal serial bus host controller provided by the application, as Figure 1 shown, the method comprises the following steps.

[0029] In step 101, update log information of an enumeration log is acquired; wherein the update log information comprises at least one standard type keyword.

[0030] The enumeration log is a log recording various events and error information in the system startup and running process. The various events in the running process include the identification event of the external universal serial bus device and the function verification event of the external universal serial bus device after the external universal serial bus device is inserted. Exemplarily, in the Linux operating system, the enumeration log can be the kernel log, and the kernel log can be / var / log / kern.log.

[0031] The update log information is the enumeration log after the external universal serial bus device is inserted, and is the newly added log information compared with the enumeration log before the external universal serial bus device is inserted. Therefore, the inserted external universal serial bus device can be identified and function verified based on the update log information. Exemplarily, in the Linux operating system, the newly added log information can be extracted and stored into enum.log to acquire the update log information. On this basis, the update log information can also be called the difference log.

[0032] The standard type keyword is a type keyword in the update log information, and corresponds to the type of the external universal serial bus device inserted into the universal serial bus host. The update log information can comprise one standard type keyword or multiple standard type keywords. For example, in a specified time interval, one external universal serial bus device of different type is inserted, and the update log information records the keyword corresponding to the external universal serial bus device as the standard type keyword; in a specified time interval, two external universal serial bus devices of different types are inserted, and the update log information records the keywords corresponding to the two external universal serial bus devices of different types as the standard type keywords respectively.

[0033] In step 102, multiple type keywords are matched with the update log information respectively, a type keyword matched with the standard type keyword is determined as a target type keyword, and the type of the external universal serial bus device is determined according to the target type keyword; wherein the target type keyword corresponds to the type of the external universal serial bus device.

[0034] The type keyword is a keyword representing the type of the external USB device. The external USB device to be functionally verified can be preconfigured with a corresponding type keyword. Thus, for different types of external USB devices, the corresponding type keyword can be obtained before matching, thereby increasing the expandability of the function verification method of the USB host controller.

[0035] The type keyword can also be referred to as a device keyword. For example, the type keyword can include mass storage, keyboard, mouse, audio, camera, and the like. The type keyword corresponds to the type of the external USB device. For example, mass storage corresponds to a flash disk, keyboard corresponds to a keyboard, and the like.

[0036] The external USB device to be functionally verified includes a flash disk and a keyboard. The type keyword corresponding to the flash disk is mass storage, and the type keyword corresponding to the keyboard is keyboard. The external USB device to be verified is inserted into the USB host. The obtained update log information includes a standard type keyword. The standard type keyword is keyboard. The mass storage and the keyboard are matched with the update log information, respectively. The mass storage fails to match the standard type keyword, and the keyboard succeeds in matching the standard type keyword. It is determined that the keyboard is the target type keyword, and the type of the external USB device is the keyboard.

[0037] In step 103, a target function verification strategy is determined from a plurality of preconfigured function verification strategies based on the type of the external USB device. The function verification strategy is used to functionally verify the external USB device. The preconfigured function verification strategy corresponds to the type of the external USB device in a one-to-one manner.

[0038] For example, the type of the external USB device and the preconfigured function verification strategy can have a mapping relationship. After the type of the external USB device is determined, the target function verification strategy can be determined from the plurality of preconfigured function verification strategies through the mapping relationship. Alternatively, the type keyword corresponding to the type of the external USB device can be used to search in a name list of the plurality of preconfigured function verification strategies to obtain the name of the preconfigured function verification strategy containing the type keyword. The target function verification strategy can be determined from the plurality of preconfigured function verification strategies based on the name of the preconfigured function verification strategy.

[0039] Compared with performing function verification of each USB peripheral device by human, the function verification method of the USB host controller provided in the embodiments of the present application can automatically perform function verification of each USB peripheral device by obtaining update log information of enumeration logs, determining a target type keyword from a plurality of type keywords based on a standard type keyword in the update log information to determine a type of the USB peripheral device, and performing function verification on the USB peripheral device using a target function verification strategy, thereby improving verification efficiency.

[0040] Figure 2 is one of the framework diagrams of the function verification method of the USB host controller provided in the present application. The preset function verification strategy can include a flash disk function verification strategy, an audio function verification strategy, a video function verification strategy, a keyboard function verification strategy, and a mouse function verification strategy. As shown in Figure 2 After starting function verification, waiting for a USB peripheral device to be inserted, determining the type of the USB peripheral device, and performing function verification on the USB peripheral device using a corresponding target function verification strategy, the function verification result can be output based on the above embodiments; the function verification result can include the steps of function verification and the execution result output of each step.

[0041] The steps of function verification and the execution result output of each step can be recorded in the form of a file. The file can include information such as the type of the USB peripheral device and its device node, whether the function verification of the USB peripheral device is abnormal, whether the function verification result of the USB peripheral device needs further manual analysis, and the content that needs manual analysis. If the file includes information such as manual analysis and the content that needs manual analysis, the function verification is ended after manual analysis.

[0042] Based on any of the above embodiments, the update log information of the enumeration logs is obtained, including: backing up the enumeration logs to obtain backup enumeration logs; comparing the current enumeration logs and the backup enumeration logs within a specified time interval, and obtaining the update log information based on the difference between the current enumeration logs and the backup enumeration logs in the case that the current enumeration logs and the backup enumeration logs are different.

[0043] The specified time interval is the time interval for determining whether a USB peripheral device is inserted into the USB host after the enumeration logs are backed up. The specific specified time interval can be determined according to specific needs, which is not limited here.

[0044] The difference between the current enumeration logs and the backup enumeration logs can be log information newly added to the backup enumeration logs by the current enumeration logs.

[0045] In the embodiment, the enumeration log can be backed up before a USB device is plugged into the USB host, and the current enumeration log can be requested multiple times within a specified time interval after the enumeration log is backed up. For example, the current enumeration log can be requested every second within 30 seconds after the enumeration log is backed up.

[0046] The current enumeration log and the backup enumeration log can be compared to determine whether there is a difference between the current enumeration log and the backup enumeration log. If there is a difference, it is determined that the enumeration log is updated, and the update log information can be obtained based on the difference between the current enumeration log and the backup enumeration log. If there is no difference, it is determined that the enumeration log is not updated, for example, after 30 seconds after the enumeration log is backed up, if there is no difference, the waiting is ended, it is determined that the enumeration log is not updated, no USB device is plugged into the USB host, and the function verification is ended.

[0047] After a USB device is plugged into the USB host, if there is a difference between the current enumeration log and the backup enumeration log, the backup enumeration log and the current enumeration log can be compared to obtain the log information newly added to the current enumeration log based on the backup enumeration log, and the update log information obtained based on the newly added log information is the log information related to the USB device. Compared with using the complete enumeration log for function verification of the USB host controller, in the embodiment, only the log information related to the USB device is used for function verification of the USB host controller, which can reduce the amount of data to be analyzed and improve the efficiency of function verification.

[0048] Based on any of the above embodiments, before the update log information of the enumeration log is obtained, the method further includes: backing up a device node directory of the USB device, and obtaining a backup device node directory; wherein the device node directory includes a node keyword, and the node keyword corresponds to device node information.

[0049] The device node directory is a data structure for storing device nodes. The node keyword is a common element of the device nodes of a certain type of USB device. The device node information is a complete element of the device nodes of a certain type of USB device in the USB host.

[0050] For example, the node keyword can be a common part of the device node name of a certain type of USB device, and the device node information can include the device node name including the node keyword. The number of device node names is at least one. Specifically, the node keyword can be event, and the device node information can include eventmouse0, eventmouse1, eventmouse2, and the like.

[0051] After determining the type of the external USB device, the method further comprises: obtaining an updated device node directory; obtaining a standard node keyword based on the type of the external USB device, searching in the backup device node directory using the standard node keyword, determining that a node keyword matched with the standard node keyword is a first target node keyword, and obtaining backup device node information corresponding to the first target node keyword; searching in the updated device node directory using the standard node keyword, determining that a node keyword matched with the standard node keyword is a second target node keyword, and obtaining updated device node information corresponding to the second target node keyword; comparing the backup device node information and the updated device node information to obtain newly added device node information under the node path; and obtaining the device node of the external USB device based on the newly added device node information.

[0052] Unlike the update log information, the updated device node directory is a device node directory obtained after the external USB device is inserted.

[0053] The standard node keyword is a keyword corresponding to the type of the external USB device. A mapping relationship can be established between the standard node keyword and the type of the external USB device, so that the standard node keyword can be directly obtained after the type of the external USB device is determined. For example, after determining that the external USB device is a mouse, the standard node keyword event can be obtained; and after determining that the external USB device is a camera, the standard node keyword video can be obtained.

[0054] Taking the external USB device as a mouse and the standard node keyword as event as an example, after the standard node keyword is obtained, the backup device node directory can be searched to obtain device node information including event, the event file can be generated by the command ls -l / dev / input / event* | awk ‘{print $NF}’>event, the backup device node information including event can be obtained by traversing the event file, and the backup device node information can include eventmouse0 and eventmouse1.

[0055] The updated device node information can be obtained in the same way, and the updated device node information can include eventmouse0, eventmouse1, and eventmouse2. By comparing the backup device node information and the updated device node information, the newly added device node information eventmouse2 under the node path can be obtained, and eventmouse2 is a device node name, and the device node of the mouse can be obtained in the device node directory based on eventmouse2.

[0056] The external USB device can also be a camera, and the standard node keyword can be video. After obtaining the standard node keyword, the backup device node directory can be searched to obtain device node information including video. The video file can be generated by the command ls -l / dev / video* | awk '{print $NF}'>video. The backup device node information including video can be obtained by traversing the video file. The backup device node information can include video0 and video1.

[0057] The updated device node information can be obtained in the same way. The updated device node information can include video0, video1, and video2. By comparing the backup device node information and the updated device node information, the newly added device node information video2 under the node path can be obtained. Video2 is the device node name, and the device node of the mouse can be obtained in the device node directory based on video2.

[0058] The function verification strategy is used to verify the function of the external USB device. Specifically, the function verification strategy is used to verify the function of the corresponding external USB device through the device node. The device node is a bridge for communication between the USB host and the external USB device. In this embodiment, the standard node keyword is obtained, the backup device node directory and the updated device node are searched respectively, the newly added device node information is obtained, and the device node of the external USB device is obtained. The function of the external USB device can be verified through the device node simply and conveniently.

[0059] Based on any of the above embodiments, before searching the update log information through the enumeration type keyword, the method further includes searching the update log information based on an error keyword, and executing the steps of respectively matching the plurality of type keywords with the update log information in the case where it is determined that the error keyword does not exist.

[0060] The error keyword is a keyword corresponding to error information. The error information is information describing problems that occur during the process of inserting the external USB device into the USB host. For example, the error keyword can include error and failed.

[0061] In the case that the error keyword is a set of English letters, the error keyword case-insensitive search in the update log information is performed to determine whether the error keyword exists in the update log information. For example, grep-i error / enum.log and grep -i failed / enum.log can be used to perform the error keyword case-insensitive search in the update log information. If the return value $? is 0, it is determined that the error keyword does not exist. If the return value $? is 1, it is determined that the error keyword exists.

[0062] In some embodiments, in the case that it is determined that the error keyword exists, the function verification of the current external USB device is ended.

[0063] In the embodiment, the specific error information corresponding to the error keyword is not acquired, and only whether the error keyword exists is determined to determine whether to perform the function verification on the external USB device inserted into the USB host, so that the data amount of processing is reduced, and the verification efficiency is improved.

[0064] Specifically, in the case that the error keyword does not exist in the update log information, it is determined that the external USB device is successfully inserted into the USB host, and the function verification of the USB host controller is performed based on the update log information. In the case that the error keyword exists in the update log information, it is determined that the external USB device fails to be inserted into the USB host, and the function verification of the current external USB device is ended, so that the function verification of the remaining external USB devices to be verified can be performed, and the verification efficiency is improved.

[0065] In some embodiments, in the case that it is determined that the error keyword exists, after the function verification is ended, the specific error information corresponding to the error keyword can be further acquired in parallel with the function verification of other external USB devices, and the specific error information is fed back, so that further troubleshooting is performed based on the specific error information without affecting the verification efficiency.

[0066] Figure 3 FIG. 2 is a schematic diagram of another framework of the function verification method of the USB host controller provided in the present application. As shown in FIG. 2, the function verification of the USB host controller includes the following steps. Figure 3As shown, after starting the function verification, the device node directory can be backed up after the enumeration log is backed up, and then waiting for the external USB device to be inserted. The current enumeration log and the backup enumeration log are compared within a specified time interval to determine whether the enumeration log is updated. If not, it is determined that the type of the external USB device fails, and the function verification is ended. If yes, the update log information is obtained. In the update log information, the error reporting keyword is searched to determine whether the update log information is an error. If yes, it is determined that the type of the external USB device fails, and the function verification is ended. If not, the plurality of type keywords are matched with the update log information to determine the type of the external USB device. After determining the type of the external USB device, the device node of the external USB device can be obtained based on the corresponding standard node keyword, the external USB device recognition is completed, and the function verification is ended.

[0067] Based on any of the above embodiments, the update log information further includes at least one node keyword, and the node keyword corresponds to the device node name.

[0068] For example, the node keyword is event. If the node device name is eventmouse1, the node keyword corresponds to the device node name. If the node device name is video1, the node keyword does not correspond to the device node name.

[0069] After determining the type of the external USB device, the method further includes: obtaining a standard node keyword based on the type of the external USB device, searching the update log information using the standard node keyword, determining that the node keyword matched with the standard node keyword is a target node keyword, obtaining the device node name corresponding to the target node keyword, obtaining a device node path based on the type of the external USB device, wherein the type of the external USB device and the device node path correspond to each other, and obtaining the device node of the external USB device based on the device node path and the device node name.

[0070] The update log information is the enumeration log after the external USB device is inserted. The enumeration log records various events in the running process. The device node is a bridge for communication between the USB host and the external USB device. The device node participates in various events in the running process. Therefore, the device node name of the external USB device is included in the update log information.

[0071] For example, the external USB device is a flash disk, and the standard node keyword is sd. The sd can be used to search in the update log information to obtain sdxn. The x in sdxn can be a, b, c, or the like, and the n in sdxn can be 1, 2, 3, or the like. For example, the sd is used to search in the update log information to obtain sda1, and the device node name of the external USB device is sda1.

[0072] For example, the type of the external USB device can have a mapping relationship with the device node path. After the type of the external USB device is determined, the corresponding device node path can be obtained through the mapping relationship.

[0073] The function verification strategy is used to verify the function of the external USB device. Specifically, the function verification strategy is used to verify the function of the corresponding external USB device through the device node.

[0074] In this embodiment, the corresponding relationship between the type of the external USB device and the standard node keyword is determined in advance, and the corresponding relationship between the type of the external USB device and the device node path of the external USB device is determined in advance. Therefore, after the type of the external USB device is determined, the standard node keyword can be obtained through the type of the external USB device, the device node name can be obtained from the update log information through the standard node keyword, the device node path can be obtained according to the corresponding relationship between the type of the external USB device and the device node path, and the device node of the external USB device can be obtained according to the device node name and the device node path. In this way, by determining the corresponding relationship in advance, the device node of the external USB device can be obtained only according to the update log information, without processing the device node directory, thereby reducing the data processing amount and improving the verification efficiency.

[0075] The specific corresponding relationship can be obtained by historical information, and the historical information can be analyzed to determine the corresponding relationship. The historical information can include historical device node directories and historical enumeration logs.

[0076] In some embodiments, after determining that the type of the external USB device is an audio device, the method further includes:

[0077] The audio device list includes a plurality of content blocks, including a content block corresponding to the external USB audio device, and the content block corresponding to the external USB audio device includes a standard number keyword.

[0078] The content block corresponding to the external USB audio device is searched using the number keyword to obtain a standard number keyword corresponding to the external USB audio device number matched with the number keyword; the external USB audio device number is the same as the device node number of the external USB audio device;

[0079] Based on the device node number and the name keyword of the external USB audio device, the device node of the external USB audio device is obtained.

[0080] The audio device can be listed by the aplay -l command, and the content block corresponding to the external USB audio device is determined in the audio device list using the USB Audio keyword. The aplay -l command can be executed in a terminal such as a command line interface. The card can be used to search in the content block to obtain card m, where m can be 1, 2, 3, etc.; the subdev # can be used to search in the content block to obtain subdev #n, where n can be 1, 2, 3, etc. m and n are device node numbers.

[0081] The name keyword of the external USB audio device can be determined as needed, and is not further limited here. Exemplarily, the name keyword of the external USB audio device can be plughw. Thus, the device node of the external USB audio device can be obtained as plughw:m,n, for example, plughw:1,0.

[0082] Based on any of the above embodiments, the external USB device is a flash disk; the flash disk can be a U disk.

[0083] Figure 4 is a third schematic diagram of the framework of the function verification method of the USB host controller provided by the present application. As shown in Figure 4 After starting the function verification, the function verification strategy is used to perform function verification on the external USB device, including: obtaining a verification file and calculating a verification check value of the verification file; creating a mounting directory and mounting the device node of the flash disk to the mounting directory; writing the verification file to the mounting directory to obtain a written verification file and calculating a written check value of the written verification file; in the case where the written check value is the same as the verification check value, reading the verification file from the mounting directory to obtain a read verification file and calculating a read check value of the read verification file; in the case where the read check value is the same as the verification check value, it is determined that the function of the flash disk is normal.

[0084] The verification file is a file used to determine whether the flash disk is functioning properly. The verification file can be a randomly generated file with a specified size, or an existing file obtained from the system within a specified size range. The specified size can be 95 MB, 100 MB, or 105 MB, etc. For example, a large file with a size of 100 MB can be generated by the command dd if= / dev / urandom of= / test.bin bs=1M count=100.

[0085] The verification check value is a value used to determine whether there is data loss in the file during data transmission. For example, the verification check value of the verification file can be calculated by a Cyclic Redundancy Check (CRC) algorithm. For example, the verification check value of the verification file can be calculated by the command crc32 / test.bin. The check value can also be referred to as the file check result.

[0086] The mounting directory is a directory for the device node of the flash disk. For example, the mounting directory u can be created by the command mkdir u. For example, the device node of the flash disk / dev / sda1 can be mounted to the mounting directory by the command mount / dev / sda1 u. Writing the verification file to the mounting directory can write the verification file to the flash disk; reading the verification file from the mounting directory can read the verification file from the flash disk.

[0087] The way of obtaining the write check value and the read check value is basically the same as the way of obtaining the verification check value, which will not be described here.

[0088] Based on any of the above embodiments, the external USB device is a click input device; the click input device can include a mouse, a keyboard, etc.

[0089] The function verification strategy is used to verify the function of the external USB device, including: backing up the event data of the click input device to obtain input backup event data; monitoring the click input device, and obtaining first monitoring event data when the click input device performs click input and generates an interrupt signal; comparing the first monitoring event data and the input backup event data, and determining that there is new data in the monitoring event data, and then backing up the monitoring event data without input backup event data; monitoring the click input device, and obtaining second monitoring event data when the click input device does not perform click input and does not generate an interrupt signal; comparing the second monitoring event data and the no-input backup event data, and determining that there is no new data in the monitoring event data, and then determining that the function of the click input device is normal.

[0090] The event data is information data recording the clicking input device. For example, when the clicking input device is a keyboard, the event data can include the specific key being struck and the order of the keys being struck, etc. When the clicking input device is a mouse, the event data can include the distance the mouse is moved and the speed of the mouse being moved, etc.

[0091] Exemplarily, the event data can be obtained by the command hexdump / dev / input / eventn>hexdump.eventn&and the input backup event data can be obtained by the command hexdump.eventn.bak.

[0092] The first monitoring event data is the event data of the clicking input device obtained after the interrupt signal is generated.

[0093] By comparing the first monitoring event data and the input backup event data, if the first monitoring event data includes new data, it indicates that the USB host controller receives the clicking input device data and the clicking input device functions normally during the input process. On the contrary, if the first monitoring event data does not include new data, the clicking input device functions abnormally during the input process.

[0094] The method of backing up the first monitoring event data as the no-input backup event data is basically the same as the method of backing up the event data as the input backup event data, which will not be described here.

[0095] By comparing the second monitoring event data and the no-input backup event data, if the second monitoring event data does not include new data, it indicates that the USB host controller does not receive the clicking input device data and the clicking input device functions normally during the no-input process. On the contrary, if the second monitoring event data includes new data, the clicking input device functions abnormally during the no-input process.

[0096] In an embodiment, the interrupt signal can be an interrupt occurring on a single-core processor or an interrupt occurring on a multi-core processor. When the interrupt signal is an interrupt occurring on a multi-core processor, it is only necessary to detect that an interrupt occurs on one core to determine that the interrupt signal is generated. For example, the interrupts occurring on all processors can be queried by the command cat / proc / interrupts, and the host controller keyword hcd, such as xhci_hcd, is further determined.

[0097] Figure 5 is the fourth schematic diagram of the framework of the function verification method of the USB host controller provided by the present application, Figure 5 Corresponding to the case that the clicking input device is a keyboard. For example, Figure 5As shown in the figure, after starting the function verification, the input can be monitored, the keyboard keys can be struck, and the first monitoring event data can be acquired. The first monitoring event data is compared with the input backup event data to determine whether the first monitoring event data has new data. If not, it is determined that the keyboard function is abnormal, and the function verification is ended. If yes, the striking of the keyboard keys is stopped, and the second monitoring event data is acquired. It is determined whether the second monitoring event data has new data. If yes, it is determined that the keyboard function is abnormal, and the function verification is ended. If not, it is determined that the keyboard function is normal, and the function verification is ended.

[0098] Figure 6 Figure 5 is a schematic diagram of a framework of a function verification method of a USB host controller provided in the present application. Figure 6 Corresponding to the case that the clicking input device is a mouse. Figure 6 With Figure 5 The function verification is basically the same as shown in the figure, and the main difference is that Figure 6 In the figure, the monitored is not the striking of the keyboard keys, but the movement of the mouse position, which will not be repeated here. Based on any of the above embodiments, the external USB device is an audio input device; the audio input device can be a headset, etc.

[0099] Figure 7 Figure 6 is a schematic diagram of a framework of a function verification method of a USB host controller provided in the present application. As shown in the figure, Figure 7 As shown in the figure, after starting the function verification, the function verification strategy can be used to perform function verification on the external USB device, including: starting recording to acquire audio information input by a user; generating an audio file based on the audio information; playing the audio file in a case where it is determined that the audio file is successfully generated; accepting an audio confirmation operation input by the user, and determining whether the audio in the voice file is clear based on the audio confirmation operation; if yes, it is determined that the function of the audio input device is normal, and the function verification is ended; if not, it is determined that the function of the audio input device is abnormal, and the function verification is ended.

[0100] Based on any of the above embodiments, the external USB device is a video input device; the video input device can be a camera, etc.

[0101] Figure 8 Figure 7 is a schematic diagram of a framework of a function verification method of a USB host controller provided in the present application. As shown in the figure, Figure 8As shown, after starting the function verification, the function verification strategy can be used to verify the function of the external USB device, including: obtaining the video format supported by the video input device through the device node of the video input device, and each set of video parameter values supported by the video input device under each video format; the video parameters include resolution, frame rate, image quantity and video file volume; according to each video format and each set of video parameter values corresponding to the video format, the detection video stream is obtained from the video input device through the device node; the detection video parameter value of the detection video stream is obtained, and in the case that the difference between the video monitoring parameter value and the video parameter value is within the preset range, it is determined that the function of the video input device is normal.

[0102] The detection video parameter value is the video format and the video parameter value of the detection video stream.

[0103] The video format can include YUYV, MJPG, etc. The video input device can support multiple sets of video parameter values under each video format. Taking resolution and frame rate as examples, the video input device can support 720P, 30FPS; 720P, 60FPS; 1080P, 30FPS; 1080P, 60FPS under MJPG. When obtaining the detection video stream from the video input device through the device node, multiple detection video streams of MJPG format, video parameters being 720P, 30FPS; 720P, 60FPS; 1080P, 30FPS; 1080P, 60FPS respectively can be obtained.

[0104] Among them, the video format supported by the video input device and each set of video parameter values supported by the video input device under each video format can be obtained through the command v4l2-ctl --list-formats-ext --device= / dev / video2.

[0105] The detection video stream can be obtained through the command v4l2-ctl, the device node of the video input device is specified through the --device option, the resolution and video format are set through width, height, and pixelformat in --set-fmt-video, the frame rate is set through the --set-parm option, the image quantity is set through the --stream-count option, and the output detection video stream is specified through the --stream-to option. And store these information in the intermediate file, and obtain the video monitoring parameter value by parsing the intermediate file.

[0106] Exemplarily, whether the detected video stream has frame loss and the specific number of frame loss can be determined by retrieving the keyword dropped buffers, based on whether the difference between the dropped buffers value (the number after the dropped buffers) and the set dropped buffers value of the detected video stream is within a preset range. Whether the frame rate is correct can be determined by comparing whether the difference between the calculated frame rate (the number before the FPS) of the detected video stream and the set frame rate is within a preset range.

[0107] In an embodiment, whether the video file size of the detected video stream is 0 can be determined, and if yes, it indicates that the detected video stream capture fails. In the case that the detected video stream capture succeeds, whether the file size is correct can be determined based on whether the difference between the video file size and the estimated video file size is within a preset range. The specific range of the preset range can be set according to actual needs, and the present application does not make further limitation.

[0108] In another embodiment, in the case that the detected video stream capture succeeds and the difference degree between the video monitoring parameter value and the video parameter value is within a preset range, the detected video stream can be played to receive a confirmation operation input by a user, and based on the confirmation operation of the user, whether the function of the video input device is normal is finally determined.

[0109] In order to specifically illustrate the function of the function verification method of the USB host controller provided in the present embodiment, a specific example is provided below.

[0110] The function verification method of the USB host controller provided in the present application comprises:

[0111] Backup the enumeration log to obtain a backup enumeration log;

[0112] Backup the device node directory of the external USB device to obtain a backup device node directory; wherein the device node directory comprises a node keyword, and the node keyword corresponds to device node information;

[0113] Compare the current enumeration log and the backup enumeration log within a specified time interval, and in the case that the current enumeration log and the backup enumeration log are different, obtain update log information based on the difference between the current enumeration log and the backup enumeration log;

[0114] Match the plurality of type keywords with the update log information respectively, determine the type keyword matched with the standard type keyword as a target type keyword, and determine the type of the external USB device according to the target type keyword;

[0115] acquire the backup device node directory; acquire a standard node keyword based on the type of the external USB device, perform a search in the backup device node directory using the standard node keyword, determine that a node keyword matching the standard node keyword is a first target node keyword, and acquire backup device node information corresponding to the first target node keyword; perform a search in the update device node directory using the standard node keyword, determine that a node keyword matching the standard node keyword is a second target node keyword, and acquire update device node information corresponding to the second target node keyword;

[0116] compare the backup device node information and the update device node information, and acquire device node information of a device node added under the node path;

[0117] acquire the device node of the external USB device based on the added device node information, and perform function verification on the corresponding external USB device through the device node using the function verification strategy.

[0118] The function verification device of the USB host controller provided in the present application is described below, and the function verification device of the USB host controller described below can be correspondingly referred to the function verification method of the USB host controller described above.

[0119] Figure 9 is one of the structural diagrams of the function verification device of the USB host controller provided in the present application. As shown in Figure 9 the device includes: an update log information acquisition module 201 configured to acquire update log information of an enumeration log; wherein the update log information includes at least one standard type keyword; a device type identification module 202 configured to respectively match a plurality of type keywords with the update log information, determine that a type keyword matching the standard type keyword is a target type keyword, and determine the type of the external USB device according to the target type keyword; wherein the target type keyword corresponds to the type of the external USB device; and a function verification module 203 configured to determine a target function verification strategy from a plurality of preset function verification strategies based on the type of the external USB device, and perform function verification on the external USB device using the function verification strategy; wherein the preset function verification strategy corresponds to the type of the external USB device in a one-to-one manner.

[0120] Based on any of the above embodiments, the update log information acquisition module 201 is specifically configured to: backup the enumeration log to acquire a backup enumeration log; compare the current enumeration log and the backup enumeration log within a specified time interval, and in a case where the current enumeration log and the backup enumeration log are different, acquire the update log information based on the difference between the current enumeration log and the backup enumeration log.

[0121] Based on any of the above embodiments, the function verification device of the USB host controller further comprises a device node directory backup module and a device node confirmation module 204; the device node directory backup module is configured to backup the device node directory of the external USB device, and obtain the backup device node directory; wherein the device node directory comprises a node keyword, and the node keyword corresponds to device node information; the device node confirmation module 204 is configured to obtain the updated device node directory; based on the type of the external USB device, a standard node keyword is obtained, the standard node keyword is used to search in the backup device node directory, a node keyword matched with the standard node keyword is determined as a first target node keyword, and the backup device node information corresponding to the first target node keyword is obtained; the standard node keyword is used to search in the updated device node directory, a node keyword matched with the standard node keyword is determined as a second target node keyword, and the updated device node information corresponding to the second target node keyword is obtained; the backup device node information and the updated device node information are compared, and newly added device node information under the node path is obtained; based on the newly added device node information, the device node of the external USB device is obtained; and the function verification module 203 is specifically configured to use a function verification strategy to perform function verification on the corresponding external USB device through the device node.

[0122] Based on any of the above embodiments, the update log information further comprises at least one node keyword, and the node keyword corresponds to a device node name; the device node confirmation module 204 is configured to obtain a standard node keyword based on the type of the external USB device, use the standard node keyword to search in the update log information, determine a node keyword matched with the standard node keyword as a target node keyword, and obtain the device node name corresponding to the target node keyword; obtain a device node path based on the type of the external USB device; wherein the type of the external USB device corresponds to the device node path in a one-to-one manner; obtain the device node of the external USB device based on the device node path and the device node name; and the function verification module 203 is specifically configured to use a function verification strategy to perform function verification on the corresponding external USB device through the device node.

[0123] Figure 10 FIG. 2 is a structural schematic diagram of a function verification device of a USB host controller provided by the present application. Figure 10As shown, the function verification module 203 can include a flash disk function verification unit 2021 for performing the aforementioned flash disk function verification method, a keyboard function verification unit 2022 for performing the aforementioned keyboard function verification method, a mouse function verification unit 2023 for performing the aforementioned mouse function verification method, an audio input device function verification unit 2024 for performing the aforementioned audio input device function verification method, and a video input device function verification unit 2025 for performing the aforementioned video input device function verification method.

[0124] The function verification device of the USB host controller further includes a verification result output module 205 for outputting the function verification result after performing the function verification on the external USB device; the function verification result can include the steps of the function verification and the execution result of each step.

[0125] Based on any of the above embodiments, the external USB device is a flash disk; as mentioned before, the flash disk can also be referred to as a U disk; the function verification module 203 includes the flash disk function verification unit 2021 for obtaining the verification file and calculating the verification check value of the verification file; creating a mounting directory and mounting the device node of the flash disk to the mounting directory; writing the verification file to the mounting directory to obtain a written verification file and calculating the write check value of the written verification file; in the case that the write check value is the same as the verification check value, reading the verification file from the mounting directory to obtain a read verification file and calculating the read check value of the read verification file; in the case that the read check value is the same as the verification check value, determining that the function of the flash disk is normal.

[0126] Based on any of the above embodiments, the external USB device is a click input device, and the function verification module 203 includes a click input device function verification unit for: backing up the event data of the click input device to obtain input backup event data; monitoring the click input device, and in the case that the click input device performs click input and generates an interrupt signal, obtaining first monitoring event data; comparing the first monitoring event data and the input backup event data, and in the case that the monitoring event data has new data, backing up the monitoring event data to obtain no input backup event data; monitoring the click input device, and in the case that the click input device does not perform click input and does not generate an interrupt signal, obtaining second monitoring event data; comparing the second monitoring event data and the no input backup event data, and in the case that the monitoring event data has no new data, determining that the function of the click input device is normal.

[0127] For example, the click input device function verification unit can be the keyboard function verification unit 2022, the mouse function verification unit 2023, etc.

[0128] Based on any of the above embodiments, the external USB device is a video input device, the function verification module 203 comprises a video input device function verification unit 2025, configured to: acquire, through a device node of the video input device, video formats supported by the video input device and each set of video parameter values supported by the video input device under each video format; the video parameters comprise resolution, frame rate, image quantity and video file volume; acquire, from the video input device through the device node, a detection video stream according to each video format and each set of video parameter values corresponding to the video format; acquire detection video parameter values of the detection video stream, and determine that the function of the video input device is normal in a case where a difference degree between the video monitoring parameter values and the video parameter values is within a preset range.

[0129] Based on any of the above embodiments, the external USB device is an audio input device, the function verification module 203 comprises an audio input device function verification unit 2024, configured to: start recording to acquire audio information input by a user; generate an audio file based on the audio information; play the audio file in a case where it is determined that the audio file is generated successfully; accept an audio confirmation operation input by the user, and determine whether the audio in the audio file is clear based on the audio confirmation operation; if yes, it is determined that the function of the audio input device is normal, and the function verification is ended; if no, it is determined that the function of the audio input device is abnormal, and the function verification is ended.

[0130] Based on any of the above embodiments, the function verification apparatus of the USB host controller further comprises an error reporting verification unit, configured to: before searching in the update log information through the enumeration type keyword, search in the update log information based on an error reporting keyword, and perform the steps of respectively matching the plurality of type keywords with the update log information in a case where it is determined that the error reporting keyword does not exist.

[0131] Figure 11 An example of a schematic diagram of the physical structure of an electronic device is shown in FIG. 1. Figure 11As shown, the electronic device can include a processor 310, a communications interface 320, a memory 330, and a communications bus 340, wherein the processor 310, the communications interface 320, and the memory 330 complete communication with each other through the communications bus 340. The processor 310 can invoke a logical instruction in the memory 330 to perform a function verification method of a universal serial bus host controller, the method comprising: obtaining update log information of an enumeration log; wherein the update log information includes at least one standard type keyword; respectively matching a plurality of type keywords with the update log information, determining a type keyword matched with the standard type keyword as a target type keyword, and determining a type of an external universal serial bus device according to the target type keyword; wherein the target type keyword corresponds to the type of the external universal serial bus device; determining a target function verification strategy from a plurality of preset function verification strategies based on the type of the external universal serial bus device, and performing function verification on the external universal serial bus device using the function verification strategy; wherein the preset function verification strategy corresponds one-to-one to the type of the external universal serial bus device.

[0132] In addition, the logical instruction in the memory 330 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.

[0133] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements a function verification method of a USB host controller as provided by the above methods, the method comprising: obtaining update log information of an enumeration log; wherein the update log information comprises at least one standard type keyword; respectively matching a plurality of type keywords with the update log information, determining a type keyword matched with the standard type keyword as a target type keyword, and determining a type of an external USB device according to the target type keyword; wherein the target type keyword corresponds to the type of the external USB device; determining a target function verification strategy from a plurality of preset function verification strategies based on the type of the external USB device, and performing function verification on the external USB device using the function verification strategy; wherein the preset function verification strategies correspond one-to-one to the types of the external USB devices.

[0134] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0135] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software plus necessary universal hardware platforms, and of course can also be realized by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0136] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for verifying the functionality of a universal serial bus host controller, characterized in that, include: Obtain the update log information of the enumeration log; wherein, the update log information includes at least one standard type keyword; Multiple type keywords are matched with the update log information to determine the type keyword that matches the standard type keyword as the target type keyword, and the type of the external Universal Serial Bus device is determined based on the target type keyword; wherein, the target type keyword corresponds to the type of the external Universal Serial Bus device; Based on the type of the external universal serial bus device, a target function verification strategy is determined from multiple preset function verification strategies, and the function verification strategy is used to perform function verification on the external universal serial bus device; wherein, the preset function verification strategies correspond one-to-one with the type of the external universal serial bus device; Before obtaining the update log information of the enumeration log, the method further includes: The device node directory of the external universal serial bus device is backed up to obtain the backup device node directory; wherein, the device node directory includes node keywords, and the node keywords correspond to the device node information; After determining the type of the external Universal Serial Bus device, the method further includes: Get the updated device node directory; Based on the type of the external universal serial bus device, standard node keywords are obtained. The standard node keywords are then used to search the backup device node directory to determine the node keyword that matches the standard node keyword as the first target node keyword, and the backup device node information corresponding to the first target node keyword is obtained. The standard node keywords are then used to search the update device node directory to determine the node keyword that matches the standard node keyword as the second target node keyword, and the update device node information corresponding to the second target node keyword is obtained. By comparing the backup device node information and the updated device node information, the newly added device node information under the node path is obtained; Based on the newly added device node information, obtain the device node of the external universal serial bus device; The functional verification strategy is used to perform functional verification on the external universal serial bus device, specifically including: Using the aforementioned functional verification strategy, the corresponding external universal serial bus device is functionally verified through the device node.

2. The functional verification method for a universal serial bus host controller according to claim 1, characterized in that, The step of obtaining the update log information of the enumeration log includes: Backup the enumeration log and obtain the backup enumeration log; If the current enumeration log and the backup enumeration log are compared within a specified time interval, and a difference is found between the current enumeration log and the backup enumeration log, update log information is obtained based on the difference between the current enumeration log and the backup enumeration log.

3. The functional verification method for a universal serial bus host controller according to claim 1, characterized in that, The update log information also includes at least one node keyword, which corresponds to the device node name; After determining the type of the external Universal Serial Bus device, the method further includes: Based on the type of the external universal serial bus device, standard node keywords are obtained. The standard node keywords are used to search the update log information to determine the node keywords that match the standard node keywords as target node keywords, and the device node name corresponding to the target node keywords is obtained. The device node path is obtained based on the type of the external Universal Serial Bus device; wherein, the type of the external Universal Serial Bus device corresponds one-to-one with the device node path; The device node of the external universal serial bus device is obtained based on the device node path and the device node name. The functional verification strategy is used to perform functional verification on the external universal serial bus device, specifically including: Using the aforementioned functional verification strategy, the corresponding external universal serial bus device is functionally verified through the device node.

4. The functional verification method for a universal serial bus host controller according to claim 1, characterized in that, The external universal serial bus device is a flash drive; The functional verification strategy is used to perform functional verification on the external universal serial bus device, including: Obtain the verification file and calculate the verification value of the verification file; Create a mount directory and mount the device node of the flash drive to the mount directory; Write the verification file to the mounted directory to obtain a write verification file, and calculate the write verification value of the write verification file; If the written verification value is the same as the verification verification value, the verification file is read from the mounted directory to obtain the read verification file, and the read verification value of the read verification file is calculated. If the read check value is the same as the verification check value, the flash drive is deemed to be functioning normally.

5. The functional verification method for a universal serial bus host controller according to claim 1, characterized in that, The external universal serial bus device is a click input device; The functional verification strategy is used to perform functional verification on the external universal serial bus device, including: Back up the event data of the click input device and obtain the input backup event data; Monitor the click input device, and when the click input device performs a click input and generates an interrupt signal, acquire the first monitoring event data; If the first monitoring event data and the input backup event data are compared, and it is determined that there is new data in the monitoring event data, the monitoring event data is backed up to obtain no input backup event data. Monitor the click input device, and acquire second monitoring event data when the click input device does not perform click input and does not generate an interrupt signal; By comparing the second monitoring event data and the no-input backup event data, and determining that there is no new data in the monitoring event data, it is determined that the click input device is functioning normally.

6. The functional verification method for a universal serial bus host controller according to claim 1, characterized in that, The external universal serial bus device is a video input device; The functional verification strategy is used to perform functional verification on the external universal serial bus device, including: The video input device's supported video formats and the video parameter values ​​supported by the video input device for each video format are obtained through the device node of the video input device; the video parameters include resolution, frame rate, number of images, and video file size; Based on each video format and each set of video parameter values ​​corresponding to that video format, the detection video stream is obtained from the video input device through the device node; The detection video parameter values ​​of the detected video stream are obtained. If the difference between the video monitoring parameter value and the video parameter value is within a preset range, it is determined that the video input device is functioning normally.

7. The functional verification method for a universal serial bus host controller according to claim 1, characterized in that, Before retrieving information from the update log by enumeration type key, the method further includes: Based on the error keywords, a search is performed in the update log information. If it is determined that no error keywords exist, the step of matching multiple types of keywords with the update log information is executed respectively.

8. A functional verification device for a universal serial bus host controller, characterized in that, include: The update log information acquisition module is used to acquire update log information of the enumeration log; wherein, the update log information includes at least one standard type keyword; The device type identification module is used to match multiple type keywords with the update log information, determine the type keyword that matches the standard type keyword as the target type keyword, and determine the type of the external universal serial bus device based on the target type keyword; wherein, the target type keyword corresponds to the type of the external universal serial bus device; The functional verification module is used to determine a target functional verification strategy from multiple preset functional verification strategies based on the type of the external universal serial bus device, and to perform functional verification on the external universal serial bus device using the functional verification strategy; wherein, the preset functional verification strategies correspond one-to-one with the type of the external universal serial bus device; It also includes a device node directory backup module and a device node confirmation module; the device node directory backup module is used to back up the device node directory of external universal serial bus devices and obtain the backup device node directory; wherein, the device node directory includes node keywords, and the node keywords correspond to the device node information; The device node confirmation module is used to obtain the updated device node directory; obtain standard node keywords based on the type of the external universal serial bus device; search the backup device node directory using the standard node keywords to determine the node keyword that matches the standard node keyword as the first target node keyword; obtain the backup device node information corresponding to the first target node keyword; search the updated device node directory using the standard node keywords to determine the node keyword that matches the standard node keyword as the second target node keyword; obtain the updated device node information corresponding to the second target node keyword; compare the backup device node information and the updated device node information to obtain the newly added device node information under the node path; and obtain the device nodes of the external universal serial bus device based on the newly added device node information. The functional verification module is specifically used to: use functional verification strategies to perform functional verification on the corresponding external universal serial bus devices through device nodes.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the functional verification method for the Universal Serial Bus host controller as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Intelligent testing method and system for solid state disk firmware module

    CN114996127A