Security control method, device, vehicle and system for USB interface

By detecting the identifier value of external devices to identify the serial bus type and dynamically configuring USB functions, the information security risks of USB interfaces in different scenarios are resolved, security control is achieved, and data leakage and system damage are avoided.

CN115828336BActive Publication Date: 2026-06-09GUANGZHOU XIAOPENG MOTORS TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU XIAOPENG MOTORS TECH CO LTD
Filing Date
2022-11-03
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies pose information security risks during the use of USB interfaces, as they cannot dynamically control USB functions in different scenarios, leading to risks such as data leakage, virus propagation, and system damage.

Method used

By detecting the identification value of external devices, their serial bus type can be identified, and the corresponding USB function can be configured according to the type, dynamically enabling or disabling the function to achieve security control.

Benefits of technology

It effectively avoids information security risks during the use of USB interfaces, ensures information security, and realizes security management according to different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115828336B_ABST
    Figure CN115828336B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of information security, and discloses a security control method, device, vehicle and system for a USB interface. The method comprises the following steps: when it is identified that an external device accesses the USB interface, detecting an identification value corresponding to the external device; determining a corresponding serial bus type according to the identification value corresponding to the external device; and configuring a corresponding USB function for the external device according to the serial bus type. In the above manner, the identification value of the external device is identified, different serial bus types are distinguished according to different identification values, and the corresponding USB function is enabled, so that the function that does not need to be enabled for the serial bus type is not configured, the information security hidden danger existing in the use process of the USB interface is avoided, the information security is ensured, and the effect of security control is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and in particular to a security control method, device, vehicle, and system for a USB interface. Background Technology

[0002] With the development of 5G networks and V2X communication technologies, USB interconnection is increasingly used in vehicle control domains, in-vehicle entertainment systems, and autonomous driving systems to establish dedicated high-bandwidth transmission channels. USB is also a crucial debugging interface during research, development, debugging, and diagnostics. However, the following security risks exist: 1) Logging into the system via USB to steal important user data; 2) Transmitting viruses via USB to execute illegal programs; 3) Exporting system logs via USB to illegally obtain vehicle information; 4) Flipping disks via USB to damage the system.

[0003] The information security issues of intelligent vehicles are becoming increasingly serious, with consequences ranging from the leakage of personal privacy and economic losses to potential threats to human lives. Therefore, there is an urgent need to develop security measures for USB interfaces to ensure vehicle information security.

[0004] During product use, only a portion of the USB functionality is actually required, while R&D personnel need all USB functions for debugging and analysis. Existing technology has the following drawbacks:

[0005] 1) Enabling all USB functions fails to meet information security requirements and poses a security risk;

[0006] 2) Only the functions needed after product release are retained, making it impossible to analyze and debug them after product release;

[0007] 3) Only retain the functions needed after product release, and reserve a backdoor. When debugging is required, use the backdoor to enable the USB debugging function, and then locate and analyze the problem. This backdoor may rely on remote access, Ethernet interface, or UART interface, which is very cumbersome to operate. It may require disassembling vehicle parts, and certain network security requirements will disable the backdoor. If the backdoor function itself is abnormal, there will be no way to enable the USB function again.

[0008] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0009] The main objective of this invention is to provide a security control method, device, vehicle, and system for USB interfaces, aiming to solve the technical problem of information security risks existing in the current use of USB interfaces.

[0010] To achieve the above objectives, the present invention provides a security control method for a USB interface, applied to a USB device, wherein the USB device is provided with a USB interface, and the security control method for the USB interface includes:

[0011] When an external device is detected to be connected to the USB interface, the identification value corresponding to the external device is detected;

[0012] The corresponding serial bus type is determined based on the identifier value of the external device.

[0013] Configure the corresponding USB function for the external device according to the serial bus type.

[0014] Optionally, the USB device includes a detection circuit;

[0015] The detection of the identifier value corresponding to the external device includes:

[0016] The voltage value of a preset pin of the USB interface is detected by a detection circuit.

[0017] The voltage value is converted to obtain the identification value corresponding to the external device.

[0018] Optionally, determining the corresponding serial bus type based on the identifier value corresponding to the external device includes:

[0019] The identifier value corresponding to the external device is matched with multiple scene intervals to determine the corresponding target scene interval;

[0020] The corresponding serial bus type is determined based on the target scenario range.

[0021] Optionally, determining the corresponding serial bus type based on the target scenario range includes:

[0022] When the target scenario range is the first range, the corresponding serial bus type is determined to be the debug type;

[0023] The step of configuring the corresponding USB function for the external device according to the serial bus type includes:

[0024] Configure all USB functions for the external device according to the specified debugging type.

[0025] Optionally, determining the corresponding serial bus type based on the target scenario range includes:

[0026] When the target scenario range is the second range, the corresponding serial bus type is determined to be the data transmission type;

[0027] The step of configuring the corresponding USB function for the external device according to the serial bus type includes:

[0028] Configure the external device with GPS data reading and network data reading functions according to the data transmission type.

[0029] Optionally, determining the corresponding serial bus type based on the target scenario range includes:

[0030] When the target scenario range is the third range, the corresponding serial bus type is determined to be disabled.

[0031] After determining the corresponding serial bus type based on the identifier value of the external device, the method further includes:

[0032] Disable all USB functions according to the specified disable type.

[0033] Optionally, configuring the corresponding USB function for the external device according to the serial bus type includes:

[0034] The user-space process calls the configuration interface based on the serial bus type.

[0035] Configure the corresponding USB function through the configuration interface.

[0036] Furthermore, to achieve the above objectives, the present invention also proposes a security control device for a USB interface, applied to a USB device, wherein the USB device is provided with a USB interface, and the security control device for the USB interface includes:

[0037] The detection module is used to detect the identification value corresponding to the external device when it is detected that an external device is connected to the USB interface;

[0038] The determination module is used to determine the corresponding serial bus type based on the identification value of the external device.

[0039] The configuration module is used to configure the corresponding USB function for the external device according to the serial bus type.

[0040] Furthermore, to achieve the above objectives, the present invention also proposes a vehicle equipped with a USB interface, characterized in that the vehicle includes: a memory, a processor, and a USB interface security control program stored in the memory and executable on the processor, wherein the USB interface security control program is configured to implement the USB interface security control method as described above.

[0041] Furthermore, to achieve the above objectives, the present invention also proposes a security control system for a USB interface, wherein the security control system for the USB interface is applied to the security control method for the USB interface described above, and the system includes:

[0042] An external device, wherein the external device is connected to a USB device via a USB connector, and the USB connector includes a resistor unit with a pre-set resistance value;

[0043] A USB device is connected to the external device via a USB interface, wherein the detection circuit included in the USB interface is connected to the resistor unit via a preset pin;

[0044] The USB device is used to detect the identification value corresponding to the external device when it is detected that an external device is connected to the USB interface, determine the corresponding serial bus type according to the identification value corresponding to the external device, and configure the corresponding USB function for the external device according to the serial bus type.

[0045] The USB device is specifically used to detect the voltage value of a preset pin of the USB interface based on the detection circuit, convert the voltage value, and obtain the identification value corresponding to the external device.

[0046] This invention detects the identifier value of an external device when it is connected to a USB interface; determines the corresponding serial bus type based on the identifier value; and configures the corresponding USB function for the external device according to the serial bus type. By identifying the identifier value of the external device and distinguishing different serial bus types based on different identifier values, the corresponding USB functions are enabled. Functions that are not needed for the serial bus type are not configured, thus avoiding information security risks during the use of the USB interface and ensuring information security, achieving the effect of security control. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the vehicle structure in the hardware operating environment involved in the embodiments of the present invention;

[0048] Figure 2 This is a flowchart illustrating the first embodiment of the security control method for the USB interface of the present invention;

[0049] Figure 3 This is a schematic diagram of a USB connection scenario, illustrating an example of the security control method for the USB interface of the present invention.

[0050] Figure 4 This is a flowchart illustrating the second embodiment of the security control method for the USB interface of the present invention;

[0051] Figure 5This is a schematic diagram illustrating the specific process of the security control method for the USB interface of the present invention;

[0052] Figure 6 This is a schematic diagram of the circuit structure of the security control system for the USB interface of the present invention;

[0053] Figure 7 This is a structural block diagram of the first embodiment of the security control device for the USB interface of the present invention.

[0054] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0055] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0056] Reference Figure 1 , Figure 1 This is a schematic diagram of the vehicle structure of the hardware operating environment involved in the embodiments of the present invention.

[0057] like Figure 1 As shown, the vehicle may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0058] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the vehicle and may include more or fewer parts than shown, or combine certain parts, or have different arrangements of parts.

[0059] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a security control program for a USB interface.

[0060] exist Figure 1 In the vehicle shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the vehicle of the present invention can be installed in the vehicle, and the vehicle calls the security control program of the USB interface stored in the memory 1005 through the processor 1001 and executes the security control method of the USB interface provided in the embodiment of the present invention.

[0061] This invention provides a security control method for a USB interface, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the security control method for the USB interface of the present invention.

[0062] In this embodiment, the security control method for the USB interface is applied to a USB device, which is equipped with a USB interface. The method includes the following steps:

[0063] Step S10: When an external device is detected to be connected to the USB interface, the identification value corresponding to the external device is detected.

[0064] It should be understood that the execution subject in this embodiment is a USB device. Specifically, the USB device is equipped with a USB interface, which is used to connect with other devices, enter the corresponding working mode, and realize the corresponding USB function. The TOBX device will be used as an example for explanation. Figure 3 , Figure 3 This is a schematic diagram of a USB connection scenario, illustrating an example of the security control method for the USB interface of the present invention. Figure 3 The diagram illustrates the connection between the TOBX and the central domain. The TOBX is responsible for transmitting network data and GPS data to the central domain. To meet bandwidth requirements, a dedicated USB channel is established between the TOBX and the central domain. After product release, only the RNDIS network (network data reading function) and GPS serial (GPS data reading function) are actually used. During debugging and analysis by R&D personnel, almost all USB functions are required, such as RNDIS network, GPS serial, ADB, DIAG serial, AT serial, and modem functions. Existing solutions include two approaches: one is to enable all USB functions, which poses security risks such as information leakage; the other is to disable all USB functions, which fails to provide debugging services after product release and cannot provide security control based on different scenarios.

[0065] It should be noted that, referring to Figure 3The USB device is a TOBX device, and the external device is a central domain or PC debugging device. Optionally, different types of external devices are pre-set with corresponding identification values. After connecting to the USB device, the identification values ​​are transmitted to the USB device, so that the USB device can determine the usage rights of the external device based on the detected identification values, and selectively disable / enable USB functions to achieve the effect of security control.

[0066] Understandably, after detecting the identifier value corresponding to the external device, it determines whether the USB device is a host or a slave. If the identifier value is 0, it enters USB host mode (active working mode). In existing solutions, when a connected external device is detected as a USB host and its USB ID is non-zero, all USB functions are enabled, entering USB slave mode. Furthermore, the enabled USB functions are configured after system startup and cannot be dynamically changed. This approach cannot selectively disable USB functions based on different scenarios to achieve security control. In this embodiment, scenario differentiation based on identifier values ​​ensures information security.

[0067] Furthermore, the USB device includes a detection circuit; the detection of the identification value corresponding to the external device includes: detecting the voltage value of a preset pin of the USB interface based on the detection circuit; and converting the voltage value to obtain the identification value corresponding to the external device.

[0068] It should be noted that this embodiment improves upon both hardware and software aspects. On the hardware side, a detection circuit (ADC module) is included, connected to a preset pin (USB ID pin). The detection circuit detects the voltage value of the preset pin and determines the corresponding identifier value (ID value) after conversion. In the specific implementation, the external device is equipped with a USB Cable (serial bus) with a custom RAID resistance value. Based on the RAID resistance value range, the voltage source and voltage divider resistors on the USB ID pin are appropriately configured. The USB ID pin is connected to the detection circuit. When the external device is connected to the USB interface, different RAID resistance values ​​are set so that the detection circuit detects different voltage values, thereby determining different identifier values.

[0069] Step S20: Determine the corresponding serial bus type based on the identifier value of the external device.

[0070] It should be understood that different ID values ​​correspond to different serial bus types and different usage scenarios. In terms of software, this embodiment implements the detection and judgment of the identifier value. The software detects the precise value of the USB ID through the chip's internal detection circuit, that is, the value converted from the voltage on the USB ID pin by the detection circuit, and determines the corresponding serial bus type based on the ID value. In specific implementation, the external device and USB device are jointly debugged in advance under different usage scenarios. Different RAID resistance values ​​are set on the external device, and the corresponding ID value is detected on the USB device. The mapping relationship between RAID resistance value, ID value, and serial bus type is stored according to the actual usage scenario of the external device. In subsequent use, the external device customizes the RAID resistance value according to the required scenario type based on the stored mapping relationship, and the USB device queries the mapping relationship based on the detected ID value to determine the corresponding serial bus type.

[0071] Step S30: Configure the corresponding USB function for the external device according to the serial bus type.

[0072] It should be noted that a mapping between serial bus types and one or more USB functions is pre-defined. After determining the current serial bus type, the corresponding USB function is configured for the external device. (Refer to...) Figure 3 When the serial bus type is determined to be debug type, configure the PC debugging device with functions such as rndis network, GPS serial, ADB, DIAG serial, ATserial, and modem. When the serial bus type is determined to be data transmission type, configure the central domain with rndis network and GPS serial functions.

[0073] Specifically, step S30 includes: calling the configuration interface based on the serial bus type by the user space process; and configuring the corresponding USB function through the configuration interface.

[0074] In the specific implementation, different usage scenarios are distinguished based on the identified ID values ​​to determine whether to enable USB functions. If USB functions are enabled, the specific USB functions that are enabled are dynamically configured. On the software side, a USB CONFIG user-space process is implemented to monitor changes in USB IDs. The USB CONFIG process is a daemon process; when the software reads different ID values ​​from the detection circuit, it reports to the user-space USB CONFIG process. Then, the USB CONFIG process calls the configfs interface to configure different combinations of USB functions based on the different ID values. After configuration, the USB controller is turned on, the USB enumeration process is executed, and the USB slave working mode (driven working mode) is entered.

[0075] This embodiment detects the identifier value of an external device when it is connected to the USB interface; determines the corresponding serial bus type based on the identifier value; and configures the corresponding USB function for the external device according to the serial bus type. By identifying the identifier value of the external device and distinguishing different serial bus types based on different identifier values, the corresponding USB functions are enabled. Functions that are not needed for the serial bus type are not configured, thus avoiding information security risks during the use of the USB interface and ensuring information security, achieving the effect of security control.

[0076] refer to Figure 4 , Figure 4 This is a flowchart illustrating the second embodiment of the security control method for the USB interface of the present invention.

[0077] Based on the first embodiment described above, step S20 of the security control method for the USB interface in this embodiment includes:

[0078] Step S201: Match the identifier value corresponding to the external device with multiple scene intervals to determine the corresponding target scene interval.

[0079] It should be understood that in this embodiment, multiple scenario ranges are set according to the specific hardware design and the RAID resistance value on the USB serial bus. External devices and USB devices are jointly debugged in advance under different usage scenarios. Different RAID resistance values ​​are set for external devices, and the corresponding ID value is detected on the USB device. The mapping relationship between multiple scenario ranges and serial bus types is stored. After determining the current identifier value, it is matched with multiple scenario ranges to determine the target scenario range to which the identifier value belongs. For example, if three scenario ranges are set as (0, 100), (100, 200), and (200, +∞), and the current identifier value is 50, then the target scenario range is determined to be (0, 100).

[0080] Step S202: Determine the corresponding serial bus type based on the target scene range.

[0081] It should be noted that the serial bus type includes debug type, data transmission type and disabled type. In the specific implementation, multiple scenario ranges and their corresponding serial bus types are stored in the form of key-value pairs. When performing range matching, the flag value is matched with the "key" of multiple key-value pairs to determine the key-value pair corresponding to the flag value, and the "value" of the key-value pair is obtained to get the corresponding serial bus type.

[0082] In practical implementation, different ID values ​​can be designed to meet more functions in different use cases, which is conducive to the expansion of system functions and security.

[0083] In one implementation, the step S202 includes: when the target scene interval is the first interval, determining that the corresponding serial bus type is the debugging type;

[0084] The step S30 includes: configuring all USB functions for the external device according to the debugging type.

[0085] It should be understood that the first interval, the second interval, and the third interval of this embodiment are different pre-set scene intervals for mutual distinction. When it is detected that the serial bus type corresponding to the external device is the debugging type, all USB functions are turned on. Refer to Figure 3 , in the debugging type, the USB device is used for connecting to a PC for debugging and diagnosis. For example, when 0 < ID value < 100, only when this type of USB cable is recognized, all USB debugging functions are turned on for connecting to a PC for debugging and diagnosis.

[0086] In one implementation, the step S202 includes: when the target scene interval is the second interval, determining that the corresponding serial bus type is the data transmission type;

[0087] The step S30 includes: configuring the GPS data reading function and the network data reading function for the external device according to the data transmission type.

[0088] It should be noted that this embodiment is applied to the scenario where the TOBX device is connected to the central domain. When it is detected that the serial bus type corresponding to the external device is the data transmission type, some USB functions are turned on, specifically rndis network (network data reading function) and GPS serial (GPS data reading function). Refer to Figure 3 , in the data transmission type, the USB device is connected to the central domain to transmit network data and GPS data to the central domain. For example, when 100 < ID value < 200, only when this type of USB cable is recognized, the USB functions required by the vehicle's central domain are turned on, including GPS serial and rndisnetwork.

[0089] In one implementation, the step S202 includes: when the target scene interval is the third interval, determining that the corresponding serial bus type is the disabled type;

[0090] After the step S202, the method further includes: disabling all USB functions according to the disabled type.

[0091] It should be understood that when the ID value > 200, the USB controller is disabled and all USB functions are disabled to meet the information security requirements. In specific implementation, the first interval and the second interval represent pre-defined usage scenarios, and the third interval represents that the serial bus type does not carry a custom Rid. After a USB cable without a custom Rid is recognized, all USB functions are disabled.

[0092] It should be noted that referring to Figure 5 , Figure 5 is the specific process schematic diagram of the security prevention and control method for the USB interface of the present invention. In terms of software design, this embodiment includes a kernel space and a user space. After a USB connection, when vbus is detected, the serial bus type is identified based on the detection circuit, and it is judged whether the USB ID is 0. If the USB ID is 0, it enters the USB host working mode; if the USB ID is not 0, the detection circuit is called to further distinguish the exact value of the USB ID; when 0 < ID value < 100, the USB is connected to a PC for debugging and all USB functions are supported, such as rndis network, GPS serial, ADB, DIAG serial, AT serial, modem, etc.; when 100 < ID value < 200, the USB is connected to the central domain and some functions are supported, such as rndis network, GPS serial; when the ID value > 200, the USB controller is disabled and all USB functions are disabled; the USB CONFIG process in the user space is notified, and the USBCONFIG process configures different USB function combinations according to different USB IDs, achieving the effect of dynamically configuring USB functions according to different scenarios; after the configuration is completed, the software opens the USB controller, executes the USB enumeration process, and enters the USB slave working mode.

[0093] In this embodiment, when it is recognized that an external device is connected to the USB interface, the identification value corresponding to the external device is detected; the identification value corresponding to the external device is respectively matched with multiple field intervals to determine the corresponding target field interval; the corresponding serial bus type is determined according to the target field interval; and the corresponding USB function is configured for the external device according to the serial bus type. By the above method, the identification value of the external device is recognized, different serial bus types are distinguished according to different field intervals to which the identification value belongs, so as to enable the corresponding USB functions, and functions that do not need to be enabled for the serial bus type are not configured, avoiding information security risks existing in the use of the USB interface, thus ensuring information security and achieving the effect of security control.

[0094] In addition, referring to Figure 6 , Figure 6 is the circuit structure schematic diagram of the security prevention and control system for the USB interface of the present invention.

[0095] This invention also proposes a security control system for a USB interface, which is applied to the security control method for a USB interface as described above. The system includes:

[0096] External device 01 is connected to USB device 03 via USB connector 02. The USB connector 02 includes a resistor unit 04 with a pre-set resistance value.

[0097] USB device 03 is connected to external device 01 via USB interface 05. The detection circuit 06 included in the USB interface 05 is connected to the resistor unit 04 via a preset pin 07.

[0098] The USB device 03 is used to detect the identification value corresponding to the external device 01 when it is detected that the external device 01 is connected to the USB interface 05, determine the corresponding serial bus type according to the identification value corresponding to the external device 01, and configure the corresponding USB function for the external device 01 according to the serial bus type.

[0099] The USB device 03 is specifically used to detect the voltage value of the preset pin 07 of the USB interface 05 based on the detection circuit 06, convert the voltage value, and obtain the identification value corresponding to the external device 01.

[0100] It should be understood that this embodiment implements a custom RAID resistance value on the USB ID pin based on hardware design, so that the detection circuit 06 can detect different voltage values ​​under different resistance values. That is, USB cables with different RAID values ​​can meet different application scenarios. In specific implementation, the custom RAID is confidential and not disclosed to the public. It can meet the USB use of the in-vehicle system, as well as the internal R&D, debugging and diagnostic use, while disabling the entire USB function externally, achieving the effect of security control according to different scenarios.

[0101] It should be noted that for USB cables without a USB ID, such as USB cables with a Type-C interface, the RAID can be configured using the CC pin or by adding an additional pin. Furthermore, the detection circuit can optionally be an ADC module, or it can be a dedicated detection chip.

[0102] In one embodiment, the USB device 03 is further configured to match the identification value corresponding to the external device with multiple scene intervals to determine the corresponding target scene interval; and determine the corresponding serial bus type based on the target scene interval.

[0103] In one embodiment, the USB device 03 is further configured to determine that the corresponding serial bus type is a debug type when the target scenario range is a first range, and configure all USB functions for the external device according to the debug type.

[0104] In one embodiment, the USB device 03 is further configured to determine the corresponding serial bus type as a data transmission type when the target scene interval is the second interval, and configure the external device to read GPS data and read network data functions according to the data transmission type.

[0105] In one embodiment, the USB device 03 is further configured to determine that the corresponding serial bus type is a disabled type when the target scenario interval is the third interval, and disable all USB functions according to the disabled type.

[0106] In one embodiment, the USB device 03 is further configured to call a configuration interface based on the serial bus type according to a user space process, and configure the corresponding USB function through the configuration interface.

[0107] Since this system adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be described in detail here.

[0108] Reference Figure 7 , Figure 7 This is a structural block diagram of the first embodiment of the security control device for the USB interface of the present invention.

[0109] like Figure 7 As shown, the security control device for a USB interface proposed in this embodiment of the invention is applied to a USB device, the USB device having a USB interface, and the device includes:

[0110] The detection module 10 is used to detect the identification value corresponding to the external device when it is detected that an external device is connected to the USB interface.

[0111] The determination module 20 is used to determine the corresponding serial bus type based on the identification value of the external device.

[0112] Configuration module 30 is used to configure the corresponding USB function for the external device according to the serial bus type.

[0113] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.

[0114] This embodiment detects the identifier value of an external device when it is connected to the USB interface; determines the corresponding serial bus type based on the identifier value; and configures the corresponding USB function for the external device according to the serial bus type. By identifying the identifier value of the external device and distinguishing different serial bus types based on different identifier values, the corresponding USB functions are enabled. Functions that are not needed for the serial bus type are not configured, thus avoiding information security risks during the use of the USB interface and ensuring information security, achieving the effect of security control.

[0115] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0116] In addition, for technical details not described in detail in this embodiment, please refer to the security control method of USB interface provided in any embodiment of the present invention, which will not be repeated here.

[0117] In one embodiment, the USB device includes a detection circuit;

[0118] The detection module 10 is specifically used to detect the voltage value of a preset pin of the USB interface based on the detection circuit; and to convert the voltage value to obtain the identification value corresponding to the external device.

[0119] In one embodiment, the determining module 20 is specifically used to match the identification value corresponding to the external device with multiple scene intervals to determine the corresponding target scene interval; and to determine the corresponding serial bus type based on the target scene interval.

[0120] In one embodiment, the determining module 20 is further configured to determine the corresponding serial bus type as a debugging type when the target scene interval is a first interval;

[0121] The configuration module 30 is also configured to configure all USB functions for the external device according to the debugging type.

[0122] In one embodiment, the determining module 20 is further configured to determine the corresponding serial bus type as a data transmission type when the target scene interval is a second interval;

[0123] The configuration module 30 is also used to configure the external device to read GPS data and read network data functions according to the data transmission type.

[0124] In one embodiment, the determining module 20 is further configured to determine that the corresponding serial bus type is disabled when the target scene interval is the third interval;

[0125] The configuration module 30 is also used to disable all USB functions according to the disable type.

[0126] In one embodiment, the configuration module 30 is specifically used to call the configuration interface based on the serial bus type according to the user space process; and configure the corresponding USB function through the configuration interface.

[0127] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0128] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0129] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0130] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A security control method for a USB interface, applied to a USB device, wherein the USB device is provided with a USB interface, characterized in that, The USB device includes a detection circuit, and the security control method for the USB interface includes: When an external device is detected to be connected to the USB interface, the voltage value of a preset pin of the USB interface is detected by the detection circuit. The voltage value is converted to obtain the identification value corresponding to the external device. The external device has a USB serial bus with a custom RAID value. According to the range of RAID values, the voltage source and voltage divider resistor of the preset pin of the USB interface are set. The preset pin of the USB interface is connected to the detection circuit. When the external device is connected to the USB interface, different RAID values ​​are set so that the detection circuit detects different voltage values ​​to determine different identification values. The corresponding serial bus type is determined based on the identifier value of the external device, wherein the serial bus type includes debug type, data transmission type and disabled type; Configure the corresponding USB function for the external device according to the serial bus type.

2. The security control method for a USB interface as described in claim 1, characterized in that, The step of determining the corresponding serial bus type based on the identifier value of the external device includes: The identifier value corresponding to the external device is matched with multiple scene intervals to determine the corresponding target scene interval; The corresponding serial bus type is determined based on the target scenario range.

3. The security control method for a USB interface as described in claim 2, characterized in that, The step of determining the corresponding serial bus type based on the target scenario range includes: When the target scenario range is the first range, the corresponding serial bus type is determined to be the debug type; The step of configuring the corresponding USB function for the external device according to the serial bus type includes: Configure all USB functions for the external device according to the specified debugging type.

4. The security control method for a USB interface as described in claim 2, characterized in that, The step of determining the corresponding serial bus type based on the target scenario range includes: When the target scenario range is the second range, the corresponding serial bus type is determined to be the data transmission type; The step of configuring the corresponding USB function for the external device according to the serial bus type includes: Configure the external device with GPS data reading and network data reading functions according to the data transmission type.

5. The security control method for a USB interface as described in claim 2, characterized in that, The step of determining the corresponding serial bus type based on the target scenario range includes: When the target scenario range is the third range, the corresponding serial bus type is determined to be disabled. After determining the corresponding serial bus type based on the identifier value of the external device, the method further includes: Disable all USB functions according to the specified disable type.

6. The security control method for a USB interface as described in any one of claims 1-5, characterized in that, The step of configuring the corresponding USB function for the external device according to the serial bus type includes: The user-space process calls the configuration interface based on the serial bus type. Configure the corresponding USB function through the configuration interface.

7. A security control device for a USB interface, applied to a USB device, wherein the USB device is provided with a USB interface, characterized in that, The USB device includes a detection circuit, and the security control device for the USB interface includes: The detection module is used to detect the voltage value of a preset pin of the USB interface based on the detection circuit when an external device is detected connected to the USB interface; convert the voltage value to obtain the identification value corresponding to the external device. The external device is equipped with a USB serial bus with a custom RAID resistance value. According to the range of RAID resistance values, the voltage source and voltage divider resistor of the preset pin of the USB interface are set. The preset pin of the USB interface is connected to the detection circuit. When the external device is connected to the USB interface, different RAID resistance values ​​are set so that the detection circuit detects different voltage values ​​to determine different identification values. The determination module is used to determine the corresponding serial bus type based on the identification value of the external device, wherein the serial bus type includes debug type, data transmission type and disabled type; The configuration module is used to configure the corresponding USB function for the external device according to the serial bus type.

8. A vehicle, wherein the vehicle is equipped with a USB interface, characterized in that, The vehicle includes: a memory, a processor, and a security control program for a USB interface stored in the memory and executable on the processor, the security control program for the USB interface being configured to implement the security control method for the USB interface as described in any one of claims 1 to 6.

9. A security control system for a USB interface, characterized in that, The security control system for the USB interface is applied to the security control method for the USB interface as described in any one of claims 1-6, and the system comprises: An external device, wherein the external device is connected to a USB device via a USB connector, and the USB connector includes a resistor unit with a pre-set resistance value; A USB device is connected to the external device via a USB interface, wherein the detection circuit included in the USB interface is connected to the resistor unit via a preset pin; The USB device is configured to, upon detecting an external device connected to the USB interface, detect the voltage value of a preset pin of the USB interface using a detection circuit; convert the voltage value to obtain an identifier value corresponding to the external device; determine the corresponding serial bus type based on the identifier value; and configure the corresponding USB function for the external device based on the serial bus type. The external device is configured with a USB serial bus having a custom RAID value. Based on the RAID value range, the voltage source and voltage divider resistors of the preset pins of the USB interface are set. The preset pins of the USB interface are connected to the detection circuit. When an external device is connected to the USB interface, different RAID values ​​are set so that the detection circuit detects different voltage values ​​to determine different identifier values. The serial bus type includes debug type, data transmission type, and disabled type. The USB device is specifically used to detect the voltage value of a preset pin of the USB interface based on the detection circuit, convert the voltage value, and obtain the identification value corresponding to the external device.