A method, apparatus, electronic device, and storage medium for detecting insertion and removal.
By comparing the attribute information of the USB key with the certificate pool information, the problem of misidentification in USB key insertion and removal detection was solved, and accurate insertion and removal detection of USB key was achieved, ensuring the security and stability of the client and improving the user experience.
Patent Information
- Application Number
- CN202511029806.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-07-25
AI Technical Summary
In existing technologies, the insertion and removal detection methods for USB keys cannot accurately identify the devices inserted by the user, leading to the accidental closure of the online banking client, resulting in a poor user experience and security risks.
By comparing the attribute information of the external storage device with that of the target device, and by traversing the certificate information in the certificate pool, the system can accurately determine the insertion or removal status of the device using the certificate's parameter information and validity period, thereby accurately controlling the opening and closing of the client.
It enables precise insertion and removal detection of USB keys, ensuring the security and stability of the client, reducing user risks, and improving the user experience.
Smart Images

Figure CN120523667B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of insertion and removal detection technology, and in particular to a insertion and removal detection method, apparatus, electronic device and storage medium. Background Technology
[0002] A USB key is a hardware encryption device based on a USB interface. It has a built-in security chip and encryption algorithm and is a highly secure identity authentication tool widely used in the banking and financial sector.
[0003] When a user inserts a USB key, the online banking client will open automatically, providing a better user experience. However, for security reasons, if a user removes the USB key after authentication, they must log out of the online banking client or close it completely; otherwise, there may be risks related to their funds.
[0004] Traditional online banking clients can only determine the insertion / removal status of a USB key by listening to system events and parsing the PID (Product Identifier) and VID (Vendor Identifier) attributes of the USB key. However, in actual production applications, USB key manufacturers usually provide customers with hardware attributes that are basically the same. This can lead to the accidental closure of the required client when another customer's USB key is unplugged, resulting in a poor user experience. Summary of the Invention
[0005] This disclosure provides a plugging / removal detection method, apparatus, electronic device, and storage medium to at least solve the above-mentioned technical problems existing in the prior art.
[0006] According to a first aspect of this disclosure, a plugging / removal detection method is provided, wherein the method includes:
[0007] When the terminal detects that the first external storage device is inserted into or removed from the interface, it obtains the attribute information of the first external storage device.
[0008] Determine whether the attribute information of the first external storage device is the same as the attribute information of the target external storage device;
[0009] If they are the same, then obtain the information of each certificate in the certificate pool. The certificate information includes at least parameter information and validity period. Each external storage device inserted into the interface corresponds to a certificate in the certificate pool, and the certificate corresponding to the first external storage device is within its validity period.
[0010] The parameter information of the certificate within its validity period is compared with the parameter information of the certificate corresponding to the target external storage device to obtain the comparison result;
[0011] Based on the comparison results, certificates with the same parameter information as the certificate corresponding to the target external storage device are stored in the certificate information list;
[0012] Based on the changes in the number of certificates in the certificate information list, it is determined whether the first external storage device is the target external storage device, and whether the first external storage device is inserted or removed from the interface.
[0013] In one possible implementation, determining whether the first external storage device is the target external storage device based on changes in the number of certificates in the certificate information list includes:
[0014] If the number of certificates in the certificate information list remains unchanged, then the first external storage device is not the target external storage device;
[0015] If the number of certificates in the certificate information list changes, then the first external storage device is the target external storage device.
[0016] In one possible implementation, determining whether the first external storage device is inserted or removed from the interface includes:
[0017] If the number of certificates in the certificate information list increases, then the first external storage device insertion interface is determined;
[0018] If the number of certificates in the certificate information list decreases, and the certificate information list does not contain the certificate corresponding to the first external storage device, then the first external storage device is determined to be disconnected from the interface.
[0019] In one possible implementation, the method further includes:
[0020] After determining the insertion interface of the first external storage device, it is determined whether the client has been logged in using the certificate corresponding to the first external storage device;
[0021] If the client is already logged in, update the number of certificates in the certificate information list;
[0022] If the client is not logged in, select the certificate corresponding to the first external storage device and enter the password corresponding to the certificate;
[0023] If the password is correct, log in to the client using the certificate corresponding to the first external storage device.
[0024] In one possible implementation, the method further includes:
[0025] After obtaining the information of each certificate in the certificate pool, determine whether each certificate is within its validity period;
[0026] If the certificate is not valid, then the certificate will be added to the certificate expiration list.
[0027] In one possible implementation, the method further includes:
[0028] After confirming that the first external storage device has been unplugged, the user is prompted that the first external storage device has been unplugged and the client is closed.
[0029] In one possible implementation, the attribute information includes the Product Identifier (PID) and the Manufacturer Identifier (VID).
[0030] According to a second aspect of this disclosure, a insertion / removal detection device is provided, wherein the device comprises:
[0031] The first acquisition unit is configured to acquire the attribute information of the first external storage device when the terminal detects that the first external storage device is inserted into or removed from the interface.
[0032] The judgment unit is configured to determine whether the attribute information of the first external storage device is the same as the attribute information of the target external storage device;
[0033] The second acquisition unit is configured to acquire information about each certificate in the certificate pool if they are the same. The certificate information includes at least parameter information and validity period. Each external storage device inserted into the interface corresponds to a certificate in the certificate pool, and the certificate corresponding to the first external storage device is within its validity period.
[0034] The comparison unit is configured to compare the parameter information of a certificate within its validity period with the parameter information of the certificate corresponding to the target external storage device, and obtain the comparison result;
[0035] The storage unit is configured to store certificates with the same parameter information as the certificate corresponding to the target external storage device into the certificate information list based on the comparison result.
[0036] The determining unit is configured to determine whether the first external storage device is the target external storage device based on the change in the number of certificates in the certificate information list, and to determine whether the first external storage device is inserted or removed from the interface.
[0037] According to a third aspect of this disclosure, an electronic device is provided, comprising:
[0038] At least one processor; and a memory communicatively connected to said at least one processor; wherein,
[0039] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the methods described in this disclosure.
[0040] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described in this disclosure.
[0041] The insertion / removal detection method, apparatus, electronic device, and storage medium disclosed herein first compare the attribute information of a first external storage device with the attribute information of a target external storage device. If the attribute information is the same, all certificates in the certificate pool are traversed and their information is compared. By comparing the certificate information, it is determined whether the first external storage device is the target external storage device, and whether the first external storage device is inserted or removed. This allows for the automatic opening of a client corresponding to the first external storage device for the user when the first external storage device is inserted, and the timely closing of the corresponding client when the first external storage device is removed, thereby improving client security and reducing user risks.
[0042] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0043] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:
[0044] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
[0045] Figure 1 A flowchart of the insertion / removal detection method provided in the embodiments of this disclosure;
[0046] Figure 2 Detailed flowchart of the insertion / removal detection method provided in the embodiments of this disclosure Figure 1 ;
[0047] Figure 3 Here is a flowchart of the certificate pool traversal in this disclosure;
[0048] Figure 4 Detailed flowchart of the insertion / removal detection method provided in the embodiments of this disclosure Figure 2 ;
[0049] Figure 5 A flowchart for certificate insertion in this disclosure;
[0050] Figure 6 A flowchart of the certificate removal process in this disclosure;
[0051] Figure 7 This is a schematic diagram of the insertion / removal detection device provided in an embodiment of the present disclosure;
[0052] Figure 8 A schematic diagram of the composition structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0053] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0054] Figure 1 This is a flowchart of the insertion / removal detection method provided in the embodiments of this disclosure. Figure 2 Detailed flowchart of the insertion / removal detection method provided in the embodiments of this disclosure Figure 1 .like Figure 1 and Figure 2 As shown, the method includes:
[0055] Step 101: When the terminal detects that the first external storage device is inserted into or removed from the interface, it obtains the attribute information of the first external storage device.
[0056] The terminal can be a laptop, desktop computer, or other device.
[0057] The terminal has a built-in detection service process, which can either start automatically on boot or be started via the client. This detection service can be used to perform a series of subsequent detection operations.
[0058] After starting the detection service, enable system device event listening and set a callback function to wait for event callbacks.
[0059] The underlying Windows system within the terminal obtains event types, including at least whether an external storage device is plugged in or unplugged.
[0060] When the callback function is called, it is determined whether it is a first external storage device plug-in / plug-out event based on the function parameters.
[0061] When the terminal detects that the first external storage device is inserted into or removed from the interface, it obtains the attribute information of the first external storage device.
[0062] Specifically, the detection service process within the terminal can be used to detect whether an external storage device is inserted into or removed from the interface.
[0063] The first external storage device can be a USB key. The main functions of the USB key include: authentication, which verifies the user's identity by digitally signing the private key in the USB key; data encryption, which encrypts and decrypts data using the key in the USB key to ensure secure data transmission; and certificate management, which stores the user's digital certificate for authentication and data encryption.
[0064] The attribute information includes the Product ID (PID) and the Vendor ID (VID).
[0065] Step 102: Determine whether the attribute information of the first external storage device is the same as the attribute information of the target external storage device.
[0066] The target external storage device is the external storage device that the user currently needs to operate on. For example, if the terminal's interface is currently plugged into external storage devices from Bank A, Bank B, and Bank C, and the user has completed the operation for Bank A's client and wants to exit the operation by unplugging Bank A's external storage device (i.e., the target external storage device), and is now preparing to unplug one of the external storage devices (i.e., the first external storage device), then it is necessary to determine whether the external storage device to be unplugged is the one the user intends to unplug.
[0067] Here, it is determined whether the attribute information of the first external storage device is the same as that of the target external storage device. If they are not the same, the operation ends and returns to wait for the next event callback.
[0068] Step 103: If they are the same, obtain the information of each certificate in the certificate pool. The certificate information includes at least parameter information and validity period. Each external storage device inserted into the interface corresponds to a certificate in the certificate pool, and the certificate corresponding to the first external storage device is within its validity period.
[0069] See Figure 2 If the attribute information of the first external storage device is the same as that of the target external storage device, it can be preliminarily determined that the first external storage device may be the target external storage device. However, since the hardware attributes provided by the first external storage device manufacturers to various banks are basically the same, erroneous operations may occur, so further judgment is required.
[0070] At this point, it's necessary to iterate through the certificates in the certificate pool and compare them with the certificates corresponding to the target external storage device. Specifically, this can be done through the CSP (Cryptographic Service Provider) protocol. The CSP protocol is a combination of hardware and software modules that implement encryption functionality in the Windows operating system, providing key management, encryption algorithm implementation, and certificate configuration services through the CryptoAPI interface (cryptographic programming interface).
[0071] The certificate pool contains certificates for the external storage devices currently plugged into the terminal's interface, with one certificate for each external storage device. The certificate pool may also include certificates for other browsers or clients.
[0072] Figure 3 This is a flowchart of the certificate pool traversal in this disclosure.
[0073] like Figure 3 As shown, the process first opens the certificate pool and retrieves a certificate. It then checks if the retrieval was successful. If unsuccessful, it indicates a system problem, and the operation ends. If successful, it further retrieves the certificate information, which includes at least its parameters and validity period. The certificate's parameters include at least its certificate number and issuer information.
[0074] In one embodiment, after obtaining the information of each certificate in the certificate pool, it is determined whether each certificate is within its validity period; if the certificate is not within its validity period, the certificate is stored in the certificate expiration list.
[0075] If the certificate is valid, the next step of the assessment can be carried out.
[0076] In this disclosure, since the validity of the certificate needs to be determined, the certificate corresponding to the first external storage device must be within its validity period. If the certificate corresponding to the first external storage device has expired, there is no need to perform further determination, and the first external storage device will also be unable to provide services.
[0077] Step 104: Compare the parameter information of the certificate within its validity period with the parameter information of the certificate corresponding to the target external storage device to obtain the comparison result;
[0078] Step 105: Based on the comparison results, store the certificate with the same parameter information as the certificate corresponding to the target external storage device into the certificate information list.
[0079] Here, it is determined whether the parameter information of the certificate within its validity period is the same as the parameter information of the certificate corresponding to the target external storage device. If they are different, the next certificate can be checked; if they are the same, the certificate is stored in the certificate information list, and then the next certificate can be checked.
[0080] Step 106: Based on the changes in the number of certificates in the certificate information list, determine whether the first external storage device is the target external storage device, and determine whether the first external storage device is inserted or removed from the interface.
[0081] In one embodiment, determining whether a first external storage device is a target external storage device based on changes in the number of certificates in the certificate information list includes:
[0082] If the number of certificates in the certificate information list remains unchanged, then the first external storage device is not the target external storage device;
[0083] If the number of certificates in the certificate information list changes, then the first external storage device is the target external storage device.
[0084] Specifically, if the number of certificates in the certificate information list remains unchanged, it means that the parameter information of the certificate corresponding to the first external storage device is different from the parameter information of the certificate corresponding to the target external storage device, and the first external storage device is not the target storage device.
[0085] In one embodiment, determining whether the first external storage device is inserted into or removed from the interface includes:
[0086] If the number of certificates in the certificate information list increases, then determine the first external storage device insertion interface;
[0087] If the number of certificates in the certificate information list decreases, and the certificate information list does not contain the certificate corresponding to the first external storage device, then the first external storage device is determined to be disconnected from the interface.
[0088] Specifically, if the number of certificates in the certificate information list increases, it indicates that new certificates have been added to the list. Since the certificates in the certificate pool correspond to the external storage devices currently plugged into the interface, an increase in the number of certificates in the certificate information list means an external storage device is being inserted into the interface, thus confirming that the first external storage device is inserted. If the number of certificates in the certificate information list decreases, it's necessary to check whether the certificate information list includes the certificate corresponding to the first external storage device. This is because if the number of certificates decreases, but not for the first external storage device, but for other external storage devices, it could also lead to a decrease in the number of certificates. Therefore, checking whether the certificate information list includes the certificate corresponding to the first external storage device is also used to determine whether the first external storage device has been removed.
[0089] Figure 4 Detailed flowchart of the insertion / removal detection method provided in the embodiments of this disclosure Figure 2 .
[0090] like Figure 4As shown, the method further includes: after determining the first external storage device insertion interface, determining whether the first external storage device is the first insertion interface;
[0091] If this is the first time inserting the interface, check if there is any data in the certificate expiration list;
[0092] If the certificate expiration list contains data, a pop-up window will notify the user which certificates have expired.
[0093] Specifically, if there is data in the certificate expiration list, it means that some certificates in the certificate pool have expired. At this time, a pop-up window can be displayed to remind the user that the certificate has expired, providing the user with certificate expiration information so that the user can take some remedial measures for the expired certificate in a timely manner.
[0094] After prompting the user with the certificate expiration information, the certificate for the first external storage device is inserted.
[0095] Figure 5 This is a flowchart of the certificate insertion process in this disclosure.
[0096] like Figure 5 As shown, after determining the insertion interface of the first external storage device, it is determined whether the client has been logged in based on the certificate corresponding to the first external storage device;
[0097] If the client is already logged in, update the number of certificates in the certificate information list;
[0098] If you are not logged into the client, select the certificate corresponding to the first external storage device and enter the password corresponding to the certificate;
[0099] If the password is correct, log in to the client based on the certificate corresponding to the first external storage device.
[0100] Specifically, the system determines whether a certificate corresponding to the first external storage device has been selected and logs into the client based on the certificate. If a certificate corresponding to the first external storage device has been selected, it means the client is already logged in. The number of certificates in the certificate information list is then updated, and subsequent operations are terminated. If the client is not running, it is started first, and then login is attempted. During login, a certificate selection window pops up. The user selects the certificate corresponding to the first external storage device from the certificate selection window and enters the password corresponding to the certificate. The password can be a PIN code. If the password is entered incorrectly, an error message is displayed so that the user can take appropriate action. If the password is entered correctly, the user can log into the client based on the certificate corresponding to the first external storage device, and the certificate number corresponding to the first external storage device is recorded in the certificate information list.
[0101] When multiple external storage devices are inserted simultaneously, the user can select the currently selected certificate for PIN code confirmation during transactions, preventing cross-certificate transactions after login.
[0102] See also Figure 4 If the first external storage device is identified as being unplugged, the unplugging process can be initiated.
[0103] Figure 6 This is a flowchart of the certificate removal process in this disclosure.
[0104] like Figure 6 As shown, the data in the certificate information list is parsed to determine whether the certificate information list contains the certificate corresponding to the first external storage device. If it does, it means that the first external storage device has not been unplugged from the interface. If it does not, it means that the first external storage device has been unplugged from the interface.
[0105] See also Figure 4 The method also includes: after determining that the first external storage device has been unplugged, prompting the user that the first external storage device has been unplugged and closing the client.
[0106] When a user unplugs the first external storage device, the program can immediately detect that the device has been unplugged and notify the user to log out or close the client. This prevents the user from continuing to perform invalid data entry operations and also prevents unauthorized users from continuing to operate, thus protecting the user's funds.
[0107] In this disclosure, external storage device insertion and removal events can be monitored in real time, thereby avoiding errors in interfaces or pages caused by loose or removed external storage devices, and improving the stability and reliability of the system.
[0108] This disclosure also provides a plugging / removal detection device. Figure 7 This is a schematic diagram of the insertion / removal detection device provided in an embodiment of this disclosure. Figure 7 As shown, the device includes:
[0109] The first acquisition unit 701 is configured to acquire the attribute information of the first external storage device when the terminal detects that the first external storage device is inserted into or removed from the interface.
[0110] The judgment unit 702 is configured to determine whether the attribute information of the first external storage device is the same as the attribute information of the target external storage device;
[0111] The second acquisition unit 703 is configured to acquire information about each certificate in the certificate pool if they are the same. The certificate information includes at least parameter information and validity period. Each external storage device inserted into the interface corresponds to a certificate in the certificate pool, and the certificate corresponding to the first external storage device is within its validity period.
[0112] The comparison unit 704 is configured to compare the parameter information of a certificate within its validity period with the parameter information of a certificate corresponding to the target external storage device, and obtain a comparison result;
[0113] Storage unit 705 is configured to store certificates with the same parameter information as the certificate corresponding to the target external storage device into a certificate information list based on the comparison result.
[0114] The determining unit 706 is configured to determine whether the first external storage device is the target external storage device based on the change in the number of certificates in the certificate information list, and to determine whether the first external storage device is inserted or removed from the interface.
[0115] It should be noted here that the above description of the embodiment for the insertion / removal detection device is consistent with the foregoing... Figures 1 to 6 The method embodiments shown are described similarly and have the same characteristics as described above. Figures 1 to 6 The beneficial effects of the method embodiments shown are similar, and therefore will not be described in detail. For technical details not disclosed in the embodiments of the insertion / removal detection device of this disclosure, please refer to the foregoing of this disclosure. Figures 1 to 6 The method embodiments shown are for understanding purposes only and will not be described in detail here for the sake of brevity.
[0116] According to embodiments of this disclosure, this disclosure also provides an electronic device and a readable storage medium.
[0117] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0118] like Figure 8As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0119] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0120] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the plug-in / plug-out detection method. For example, in some embodiments, the plug-in / plug-out detection method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the plug-in / plug-out detection method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the plug-in / plug-out detection method by any other suitable means (e.g., by means of firmware).
[0121] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0122] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0123] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0125] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0126] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0127] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0128] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.
[0129] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A method for detecting insertion and removal, characterized in that, The method includes: When the terminal detects that the first external storage device is inserted into or removed from the interface, it obtains the attribute information of the first external storage device. Determine whether the attribute information of the first external storage device is the same as the attribute information of the target external storage device; If they are the same, then obtain the information of each certificate in the certificate pool. The certificate information includes at least parameter information and validity period. Each external storage device inserted into the interface corresponds to a certificate in the certificate pool, and the certificate corresponding to the first external storage device is within its validity period. The parameter information of the certificate within its validity period is compared with the parameter information of the certificate corresponding to the target external storage device to obtain the comparison result; Based on the comparison results, certificates with the same parameter information as the certificate corresponding to the target external storage device are stored in the certificate information list; Based on the change in the number of certificates in the certificate information list, determine whether the first external storage device is the target external storage device, and determine whether the first external storage device is inserted or removed from the interface. The step of determining whether the first external storage device is the target external storage device based on the change in the number of certificates in the certificate information list includes: if the number of certificates in the certificate information list remains unchanged, then the first external storage device is not the target external storage device; if the number of certificates in the certificate information list changes, then the first external storage device is the target external storage device. Determining whether the first external storage device is inserted or removed from the interface includes: if the number of certificates in the certificate information list increases, then the first external storage device is determined to be inserted; if the number of certificates in the certificate information list decreases, and the certificate information list does not contain a certificate corresponding to the first external storage device, then the first external storage device is determined to be removed.
2. The method according to claim 1, characterized in that, The method further includes: After determining the insertion interface of the first external storage device, it is determined whether the client has been logged in using the certificate corresponding to the first external storage device; If the client is already logged in, update the number of certificates in the certificate information list; If the client is not logged in, select the certificate corresponding to the first external storage device and enter the password corresponding to the certificate; If the password is correct, log in to the client using the certificate corresponding to the first external storage device.
3. The method according to claim 2, characterized in that, The method further includes: After obtaining the information of each certificate in the certificate pool, determine whether each certificate is within its validity period; If the certificate is not valid, it will be added to the certificate expiration list.
4. The method according to claim 1, characterized in that, The method further includes: After confirming that the first external storage device has been unplugged, the user is prompted that the first external storage device has been unplugged and the client is closed.
5. The method according to claim 1, characterized in that, The attribute information includes the Product Identifier (PID) and the Manufacturer Identifier (VID).
6. A insertion / removal detection device, characterized in that, The device includes: The first acquisition unit is configured to acquire the attribute information of the first external storage device when the terminal detects that the first external storage device is inserted into or removed from the interface. The judgment unit is configured to determine whether the attribute information of the first external storage device is the same as the attribute information of the target external storage device; The second acquisition unit is configured to acquire information about each certificate in the certificate pool if they are the same. The certificate information includes at least parameter information and validity period. Each external storage device inserted into the interface corresponds to a certificate in the certificate pool, and the certificate corresponding to the first external storage device is within its validity period. The comparison unit is configured to compare the parameter information of a certificate within its validity period with the parameter information of the certificate corresponding to the target external storage device, and obtain the comparison result; The storage unit is configured to store certificates with the same parameter information as the certificate corresponding to the target external storage device into the certificate information list based on the comparison result. The determining unit is configured to determine whether the first external storage device is the target external storage device based on the change in the number of certificates in the certificate information list, and to determine whether the first external storage device is an inserted or unplugged interface. The determining unit is configured to determine that the first external storage device is not the target external storage device in response to a change in the number of certificates in the certificate information list; and to determine that the first external storage device is the target external storage device in response to a change in the number of certificates in the certificate information list. The determining unit is further configured to determine the first external storage device insertion interface in response to an increase in the number of certificates in the certificate information list; and to determine the first external storage device removal interface in response to a decrease in the number of certificates in the certificate information list and the certificate information list not containing a certificate corresponding to the first external storage device.
7. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-5.
Citation Information
Patent Citations
Public security digital certificate USB Key equipment control method and system
CN115544482A
RFID token with multiple interface controller
US20060208066A1