Equipment information acquisition method and device of access equipment, equipment and storage medium
By installing compatible applications in electronic devices and simulating the identification and registration mechanism of the second operating system, the problem that the device running the first operating system cannot interact with the access device is solved, and normal identification and information acquisition of the access device is achieved , meets the needs of electronic equipment.
Patent Information
- Application Number
- CN202411185300.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-20
AI Technical Summary
In the electronic device running the first operating system, the lack of identification service support makes it impossible to interact with the access device, and thus cannot obtain device information of the access device.
By installing compatible applications in electronic devices, running programs of the second operating system, simulating the identification and registration mechanism of the second operating system, and maintaining device information of the access device in the preset data structure, to realize access device access device access device by installing compatible applications in the electronic devices, normal identification and information acquisition.
In the first operating system environment, the full support for access equipment is realized, meeting the needs of electronic devices to identify access equipment and obtain equipment information.
Smart Images

Figure CN119166555A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and apparatus for acquiring device information of an access device, an electronic device, and a computer-readable storage medium. Background Art
[0002] An access device is a small storage device that can be directly connected to an electronic device through a Universal Serial Bus (USB) interface.
[0003] Currently, access devices are often inserted into electronic devices for use. Electronic devices can interact with access devices through identification services (scardsvr) to obtain device information of access devices, thereby meeting the subsequent management needs of access devices.
[0004] However, in the current solution, the electronic device runs a first operating system, and the identification service is a service supported by the second operating system. This results in a lack of support for the identification service in the electronic device and an inability to interact with the access device, and also an inability to obtain device information of the access device. Summary of the invention
[0005] The embodiments of the present application provide a method and apparatus for acquiring device information of an access device to solve the problems in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a method for acquiring device information of an access device, which is applied to an electronic device running a first operating system, and the method includes:
[0007] identifying, in the first operating system, an access device plugged into the electronic device through a compatible application installed in the electronic device;
[0008] Running a second operating system driver in the access device through the compatible application to obtain first device information of the access device identified in the first operating system;
[0009] registering the access device in the compatible application according to the first device information, and adding second device information in a preset data structure, wherein the second device information is information matching a data format of the second operating system;
[0010] In response to the device information acquisition request, the second device information is extracted from the preset data structure by the compatible application and sent.
[0011] In a second aspect, an embodiment of the present application provides a device for acquiring device information of an access device, the device comprising:
[0012] an identification module, configured to identify, in the first operating system, an access device inserted into the electronic device through a compatible application installed in the electronic device;
[0013] An acquisition module, configured to run a second operating system driver in the access device through the compatible application to acquire first device information of the access device identified in the first operating system;
[0014] A registration module, configured to register the access device in the compatible application according to the first device information, and add second device information in a preset data structure, wherein the second device information is information matching a data format of the second operating system;
[0015] The sending module is used to extract the second device information from the preset data structure through the compatible application program and send it in response to a device information acquisition request.
[0016] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor;
[0017] a memory for storing instructions executable by the processor;
[0018] The processor is configured to execute the instructions to implement the method of the first aspect.
[0019] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the method of the first aspect.
[0020] In an embodiment of the present application, a compatible application can be installed in an electronic device. The function of the compatible application is to run the program of the second operating system in the electronic device of the first operating system. Specifically, a driver for identifying related services and running access devices can be constructed in the compatible application. The compatible application simulates the identification and registration mechanism of the access device under the second operating system, and maintains the device information of the access device in a preset data structure, so that the requester program of the electronic device can obtain the device information of the access device from the preset data structure, thereby meeting the requirements of the electronic device of the first operating system for normal identification of the access device and acquisition of device information, and realizing comprehensive support for the access device in the electronic device of the first operating system environment.
[0021] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is an implementation scenario diagram provided by an embodiment of the present application;
[0023] Figure 2 It is a flowchart of the steps of a method for obtaining device information of an access device provided in an embodiment of the present application;
[0024] Figure 3 It is a flowchart of the specific steps of a method for obtaining device information of an access device provided in an embodiment of the present application;
[0025] Figure 4 It is a system block diagram of a method for acquiring device information of an access device provided in an embodiment of the present application;
[0026] Figure 5 It is a block diagram of a device information acquisition apparatus for an access device provided in an embodiment of the present application;
[0027] Figure 6 is a block diagram of an apparatus of the present application;
[0028] Figure 7 It is a schematic diagram of the structure of the server in some embodiments of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three kinds of relationships can exist, for example, A and / or B can be represented: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the front and back associated objects are a kind of "or" relationship. In the embodiment of the present application, the term "multiple" refers to two or more, and other quantifiers are similar.
[0031] Reference Figure 1 , Figure 1 It is an implementation scenario diagram provided in an embodiment of the present application, including: an electronic device 10 and an access device 20.
[0032] Among them, the electronic device 10 runs a first operating system, and the access device 20 stores a driver of the second operating system; the access device 20 can be inserted into the electronic device 10 for use. The compatible application is used to run the application of the second operating system in the electronic device 10. Preferably, the access device can be a smart card device, such as a ukey device, which is a small storage device that is directly connected to the electronic device through a universal serial bus interface, has a password verification function, and is reliable and high-speed.
[0033] In the related art, since the identification service (scardsvr) used to implement interaction with the access device is a service of the second operating system, this conflicts with the electronic device of the first operating system, resulting in the electronic device of the first operating system being unable to interact with the access device due to the lack of the identification service.
[0034] In order to solve the above problems, the embodiment of the present application can install a compatible application in an electronic device. The function of the compatible application is to run the program of the second operating system in the electronic device of the first operating system. Specifically, an identification service and a driver for running the access device can be constructed in the compatible application. The compatible application simulates the identification and registration mechanism of the access device under the second operating system, and maintains the device information of the access device in the identification service, so that the requester program of the electronic device can obtain the device information of the access device from the identification service, thereby meeting the needs of normal identification and device information acquisition of the access device, and realizing comprehensive support for the access device in the electronic device of the first operating system environment.
[0035] Figure 2 , is a flowchart of a method for obtaining device information of an access device provided in an embodiment of the present application, which is applied to an electronic device running a first operating system, such as Figure 2 As shown, the method may include:
[0036] Step 101: Identify an access device inserted into the electronic device in the first operating system through a compatible application installed in the electronic device.
[0037] In the embodiments of this application, refer to Figure 1 The access device 20 can be inserted into the corresponding slot of the electronic device 10 through a connecting plug to achieve hot connection between the two. In one implementation, the access device 20 can be connected to the electronic device 10 via USB.
[0038] In actual applications, there are usually multiple external devices (such as mouse, keyboard, etc.) plugged into the electronic device. In order to identify the inserted access device in the electronic device, it is first necessary to identify the access device from the multiple external devices connected to the first operating system of the electronic device through a compatible application installed in the electronic device. After the access device is identified in the first operating system, the identification and registration mechanism of the access device in the second operating system can be implemented subsequently.
[0039] The compatible application is a compatibility layer that can run a second operating system (such as Windows operating system) application on a variety of first operating systems (such as Linux, Mac OS, Berkeley Software Distribution (BSD)), etc. Preferably, the first operating system can be a Linux system, and the second operating system can be a Windows system.
[0040] Specifically, the compatible application may be a Wine (Wine Is Not an Emulator) application, which can run Windows applications on a variety of first operating systems (such as Linux, macOS, and BSD, etc.) Wine does not imitate the internal Windows logic like a virtual machine or emulator, but translates Windows interface calls into dynamic first operating system calls, eliminating performance and other memory usage of some behaviors, so that Windows applications can be cleanly integrated and run on user devices of the first operating system.
[0041] Furthermore, when the compatible application is started for the first time, a connection can be established between the compatible application and the program of the first operating system, that is, through the compatible application, the first docking interface provided by the first operating system is replaced with a second docking interface corresponding to the second operating system simulated by the compatible application. Since the compatible application simulates the program of the second operating system, and the electronic device runs the first operating system, it is necessary to set the second docking interface between the program of the first operating system and the compatible application due to the difference between the two operating systems. The data conversion method of the first operating system and the second operating system can be defined in the second docking interface, thereby playing the role of data format conversion.
[0042] In an embodiment of the present application, a compatible application can specifically traverse the inf file (Device Information File, which is a format launched by a hardware device driver) of the first operating system, and then find the device list file therein. After that, the first device information of the access device can be identified from the device list of the first operating system, thereby achieving the purpose of identifying the access device inserted into the electronic device in the first operating system.
[0043] Step 102: Run the second operating system driver in the access device through the compatible application to obtain first device information of the access device identified in the first operating system.
[0044] First, the access device has a supported driver on the second operating system side, but not on the first operating system side, resulting in the access device being unable to interact with the first operating system side. Specifically, this is because the second operating system driver provided by the access device does not match the first operating system of the electronic device. The embodiment of the present application can use a compatible application as middleware, and the compatible application runs the second operating system driver to identify the first device information of the access device in the first operating system.
[0045] Specifically, when running a compatible application, a docking interface between the compatible application and the first operating system end can be established, thereby realizing a conversion connection between the compatible application and the first operating system end. Afterwards, after identifying the access device inserted into the electronic device, the second operating system driver in the access device can be run in the compatible application through the interface and dynamic link library of the second operating system simulated by the compatible application, thereby realizing the purpose of running the second operating system driver normally on the electronic device of the first operating system.
[0046] Step 103: register the access device in the compatible application according to the first device information, and add second device information in a preset data structure, where the second device information is information that matches the data format of the second operating system.
[0047] In an embodiment of the present application, since the compatible application realizes the simulation of the second operating system environment through the interface and dynamic link library and other related files of the simulated second operating system, the compatible application can register the access device in the second operating system environment through the second operating system driver of the access device based on the acquired first device information, thereby realizing normal recognition of the access device by the simulated second operating system environment.
[0048] Furthermore, the compatible application can also run an identification service of the second operating system (i.e., a server program, such as the scardsvr service), which can monitor the registry of the second operating system and, when a new access device is generated, convert the information of the new access device in the registry into second device information that matches the data format of the second operating system, and add it to a preset data structure (such as a data queue), thereby maintaining the device information of the access device under the second operating system.
[0049] Step 104: In response to the device information acquisition request, extract the second device information from the preset data structure through the compatible application and send it.
[0050] In the embodiment of the present application, a client program of a second operating system may also be run in the compatible application, and the client program may be a program that has a need to obtain device information of an access device, such as a management program of an access device. The client program may send a device information acquisition request to an identification service (i.e., a server program, such as scardsvr service) so that the identification service can extract the second device information from a preset data structure and send it to the client program for use, thereby satisfying the needs of the electronic device of the first operating system for normal identification of the access device and acquisition of device information, and realizing full support for the access device under the electronic device of the first operating system environment.
[0051] In summary, the embodiments of the present application can install a compatible application in an electronic device. The function of the compatible application is to run the program of the second operating system in the electronic device of the first operating system. Specifically, a driver for identifying related services and running access devices can be constructed in the compatible application. The compatible application simulates the identification and registration mechanism of the access device under the second operating system, and maintains the device information of the access device in a preset data structure, so that the requester program of the electronic device can obtain the device information of the access device from the preset data structure, thereby meeting the requirements of the electronic device of the first operating system for normal identification of the access device and acquisition of device information, and realizing comprehensive support for the access device in the electronic device of the first operating system environment.
[0052] Figure 3 is a flowchart of the specific steps of a method for obtaining device information of an access device provided in an embodiment of the present application, such as Figure 3 As shown, the method may include:
[0053] Step 201: traverse all inf files of the first operating system through the compatible application to obtain the device list.
[0054] Optionally, the first operating system is a Linux operating system, and the second operating system is a Windows operating system.
[0055] In an embodiment of the present application, if the first operating system is a Linux operating system, the device information of the external device inserted into the electronic device will be recorded in the device list of the first operating system. Therefore, by obtaining the device list of the first operating system, the access devices among all external devices can be subsequently identified based on the information in the device list.
[0056] Specifically, when the first operating system is a Linux operating system, the device list file that records the current external devices of the electronic device is an inf file (Device INFormation File). The inf file is a file used to describe data information such as devices or files. The compatible application can obtain a device list that records the device information of external devices by traversing all inf files of the first operating system.
[0057] Step 202: Identify the access device from the device list through the compatible application.
[0058] After the compatible application obtains the device list, it can find information matching the access device from the device information of each external device recorded in the device list. Specifically, this process can be performed by traversing the information of each external device recorded in the device list, finding an external device with an identifier consistent with the access device, and treating it as an access device.
[0059] Optionally, step 202 may specifically include:
[0060] Sub-step 2021: obtaining, through the compatible application, a device descriptor of each external device recorded in the device list.
[0061] Sub-step 2022: Determine a device whose device descriptor is a target device descriptor as the access device, wherein the target device descriptor is a device descriptor preset for the access device.
[0062] In the embodiment of the present application, for sub-steps 2021-2022, the device list records the device descriptors of each external device of the electronic device, and the device descriptors include PID (Product ID) and VID (Vender ID). The access device has its own corresponding target device descriptor, that is, the access device has its own corresponding PID and VID. Therefore, in the process of traversing the device descriptors of each external device recorded in the device list, as long as the target device descriptor is found, that is, the PID and VID of the access device are found, the external device corresponding to the target device descriptor can be identified as the access device.
[0063] Step 203: Run the second operating system driver in the access device through the compatible application, start the access device, and obtain the first device information in the device list.
[0064] Since the access device has a supported driver on the second operating system side, the embodiment of the present application can use a compatible application as middleware, and the compatible application runs the second operating system driver to identify the first device information of the access device in the device list.
[0065] Step 204: According to the first device information, the registration information of the access device is added in a device registration table corresponding to the second operating system through the second operating system driver.
[0066] In the embodiment of the present application, since the compatible application runs the second operating system driver through the interface and dynamic link library of the simulated second operating system, a device registry is set in the second operating system simulated by the compatible application, and the device registry is a file used by the second operating system to record external device information. The compatible application can add the information of the access device previously identified from the device list of the first operating system to the device registry corresponding to the second operating system, thereby completing the registration of the access device and realizing the identification of the access device by the compatible application.
[0067] Furthermore, since a device registry is set in the second operating system simulated by the compatible application, and the device registry is a file used by the second operating system to record external device information, the compatible application can add a target device descriptor of the connected device to the device registry, thereby completing the identification of the connected device by the second operating system simulated by the compatible application.
[0068] Step 205: Convert the registration information into a preset format through the compatible application to obtain the second device information, and add the second device information to the preset data structure.
[0069] In an embodiment of the present application, an identification service of the second operating system (a server-side program, such as a scardsvr service) can be run in a compatible application, and monitoring of the registry of the second operating system can be implemented. In addition, the identification service is defined to maintain and process data in a preset format that meets the requirements of the second operating system, thereby improving operating efficiency through standardized processing of data.
[0070] Therefore, when a new access device is generated, the identification service can convert the information added by the new access device in the registry into second device information in a preset format (a format that matches the data format of the second operating system) and add it to a preset data structure (such as a data queue) to implement maintenance of the device information of the access device under the second operating system.
[0071] Among them, in the management of access devices, the identification service can accurately obtain the device information of the access device through the registry by calling the deviceIoControl function. Once the device information is obtained, the device information will be accurately and efficiently stored in the preset data structure (scardlist) to ensure the integrity and accuracy of the device information.
[0072] Optionally, the compatible application runs a server program of a second operating system, and after step 202, the method further includes:
[0073] Step A1: Create a monitoring service corresponding to the access device through the server program.
[0074] In an embodiment of the present application, the identification service is used to create a monitoring service corresponding to the access device each time an access device is identified. The monitoring service is specifically used to monitor the status of the access devices in the registration table. Once a new access device is added, the monitoring service can work quickly.
[0075] On the basis of step A1, step 205 may specifically include:
[0076] Sub-step 2051: when the registration information in the device registry is detected by the monitoring service, the registration information is converted into a preset format by the monitoring service to obtain the second device information, and the second device information is added to a preset data structure.
[0077] Specifically, when a new access device is added, the monitoring service can extract the registration information of the new access device from the registration table and convert it into a preset format to obtain the second device information, and add the second device information to the preset data structure.
[0078] Optionally, step 205 may further include:
[0079] Sub-step 2052: when the monitoring service determines that the access device is unplugged according to the status of the registration information in the device registration table, the second device information of the access device in the preset data structure is deleted.
[0080] In the embodiment of the present application, the monitoring service can maintain the status of the corresponding access device information in the preset data structure in real time according to the update of the access device information in the registration table, that is, when an access device is deleted or removed, the monitoring service can delete the second device information of the access device in the preset data structure. Among them, the registration information of each access device in the registration table includes the status of the access device (such as plugged in, unplugged, etc.), and according to the status value, it can be determined whether the access device is deleted or removed.
[0081] For example, the registration information includes a state tag of the access device. When the state tag value is 1, it can indicate that the access device is in an inserted state; when the state tag value is 0, it can indicate that the access device is in a deleted or removed state.
[0082] Optionally, the compatible application runs a server program and a client program of a second operating system; after step 204, the method further includes:
[0083] Step 206: In response to the connection request sent by the client program, a transmission channel between the server program and the client program is established through the server program.
[0084] Step 207 : In response to the device information acquisition request sent by the client program, extract the second device information from the preset data structure through the server program, and send the second device information to the client program through the transmission channel.
[0085] In the embodiment of the present application, for steps 206-207, the client program may be a program of the second operating system running in a compatible application, and the client program may specifically be a program associated with the access device, for example, the client program may be a management program of the access device.
[0086] The client program can initiate a connection request to the server program. The connection request sent can be a socket connection request. The server program can create an independent thread to handle the connection request, thereby establishing a long connection transmission channel between the client program and the server program. After that, the client program can send a device information acquisition request (handle) to the server program. After receiving this device information acquisition request, the server program will immediately call the deviceIoControl function to accurately find the second device information of the requested access device according to the handle, and return it to the client program through the transmission channel.
[0087] Among them, the second device information may include a verification certificate. When the client program is a certificate management tool, the client program can display the verification certificate received in the second device information and store the verification certificate in the memory. During subsequent login operations, the verification certificate can be extracted from the memory for login.
[0088] In the embodiments of this application, refer to Figure 4 , which shows an architecture diagram of the device information acquisition process of an access device. A client and a server can run in a compatible application. The server is the server of the identification service. First, the compatible application identifies the access device, and in the process of starting the access device, the device is registered until the identification is completed.
[0089] Afterwards, the monitoring service created by the identification service for the access device can monitor the device status in the registry in real time, and when a new access device is detected, it can process the device information, that is, obtain the device information of the new access device from the registry and store it in the preset data structure. The client can send a connection request to establish a connection channel with the server, and the client can further send a device information acquisition request to, and the server can extract the device information from the preset data structure and return it to the client.
[0090] In summary, the embodiments of the present application can install a compatible application in an electronic device. The function of the compatible application is to run the program of the second operating system in the electronic device of the first operating system. Specifically, a driver for identifying related services and running access devices can be constructed in the compatible application. The compatible application simulates the identification and registration mechanism of the access device under the second operating system, and maintains the device information of the access device in a preset data structure, so that the requester program of the electronic device can obtain the device information of the access device from the preset data structure, thereby meeting the requirements of the electronic device of the first operating system for normal identification of the access device and acquisition of device information, and realizing comprehensive support for the access device in the electronic device of the first operating system environment.
[0091] Figure 5 : is a block diagram of a device information acquisition device for an access device provided in an embodiment of the present application, the device comprising:
[0092] An identification module 301, configured to identify, in the first operating system, an access device inserted into the electronic device through a compatible application installed in the electronic device;
[0093] An acquisition module 302 is used to run a second operating system driver in the access device through the compatible application to acquire first device information of the access device identified in the first operating system;
[0094] A registration module 303, configured to register the access device in the compatible application according to the first device information, and add second device information in a preset data structure, where the second device information is information matching a data format of the second operating system;
[0095] The sending module 304 is used to extract the second device information from the preset data structure through the compatible application program and send it in response to the device information acquisition request.
[0096] Optionally, the identification module 301 includes:
[0097] A device list submodule, configured to traverse all inf files of the first operating system through the compatible application program to obtain the device list;
[0098] an identification submodule, configured to identify the access device from the device list through the compatible application;
[0099] The acquisition module 302 includes:
[0100] The acquisition submodule is used to run the second operating system driver in the access device through the compatible application, start the access device, and obtain the first device information in the device list.
[0101] Optionally, the registration module 303 includes:
[0102] A registration submodule, configured to add the registration information of the access device in a device registration table corresponding to the second operating system through the second operating system driver according to the first device information;
[0103] An adding submodule is used to convert the registration information into a preset format through the compatible application, obtain the second device information, and add the second device information to the preset data structure.
[0104] Optionally, the device further comprises:
[0105] A creation module, used to create a monitoring service corresponding to the access device through the server program;
[0106] The adding submodule includes:
[0107] The adding unit is used to convert the registration information into a preset format through the monitoring service to obtain the second device information when the registration information in the device registration table is detected through the monitoring service.
[0108] Optionally, the device further comprises:
[0109] The deleting module is used to delete the second device information of the access device in the preset data structure when it is determined through the monitoring service according to the status of the registration information in the device registration table that the access device is unplugged.
[0110] Optionally, the compatible application runs a server program and a client program of a second operating system;
[0111] The device also includes:
[0112] An establishing module, configured to establish a transmission channel between the server program and the client program through the server program in response to a connection request sent by the client program;
[0113] The sending module 304 includes:
[0114] The sending submodule is used to respond to the device information acquisition request sent by the client program, extract the second device information from the preset data structure through the server program, and send the second device information to the client program through the transmission channel.
[0115] Optionally, the identification submodule includes:
[0116] A descriptor unit, used to obtain a device descriptor of each external device recorded in the device list through the compatible application;
[0117] The determining unit is used to determine a device whose device descriptor is a target device descriptor as the access device, wherein the target device descriptor is a device descriptor preset for the access device.
[0118] Optionally, the first operating system is a Linux operating system, and the second operating system is a Windows operating system.
[0119] In summary, the embodiments of the present application can install a compatible application in an electronic device. The function of the compatible application is to run the program of the second operating system in the electronic device of the first operating system. Specifically, a driver for identifying related services and running access devices can be constructed in the compatible application. The compatible application simulates the identification and registration mechanism of the access device under the second operating system, and maintains the device information of the access device in a preset data structure, so that the requester program of the electronic device can obtain the device information of the access device from the preset data structure, thereby meeting the requirements of the electronic device of the first operating system for normal identification of the access device and acquisition of device information, and realizing comprehensive support for the access device in the electronic device of the first operating system environment.
[0120] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0121] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0122] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0123] An embodiment of the present application provides a device for acquiring device information of an access device, including a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to include methods for performing one or more of the methods described in the above-mentioned embodiments.
[0124] Figure 6 8 is a block diagram of a device 800 for acquiring device information of an access device according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0125] Reference Figure 6 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0126] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0127] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0128] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0129] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0130] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice information processing mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0131] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0132] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also search for changes in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0133] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency information processing (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0134] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0135] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0136] Figure 71 is a schematic diagram of the structure of the server in some embodiments of the present application. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.
[0137] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0138] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device (server or terminal), enables the device to execute the above-mentioned embodiment method.
[0139] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the device (server or terminal), enables the device to perform the description of the method of the above embodiment, so it will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer program product or computer program embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0140] In addition, it should be noted that: the embodiment of the present application also provides a computer program product or a computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions so that the computer device performs the description of the method of the above embodiment, so it will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer program product or computer program embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0141] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0142] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0143] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
[0144] The above is a detailed introduction to the device information acquisition method, apparatus, electronic device and computer-readable storage medium of an access device provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for acquiring device information of an access device, applied to an electronic device running a first operating system, characterized in that: The method comprises: identifying, in the first operating system, an access device plugged into the electronic device through a compatible application installed in the electronic device; Running a second operating system driver in the access device through the compatible application to obtain first device information of the access device identified in the first operating system; registering the access device in the compatible application according to the first device information, and adding second device information in a preset data structure, wherein the second device information is information matching a data format of the second operating system; In response to the device information acquisition request, the second device information is extracted from the preset data structure by the compatible application and sent.
2. The method for acquiring device information of an access device according to claim 1, characterized in that: The step of identifying, in the first operating system, an access device inserted into the electronic device through a compatible application installed in the electronic device comprises: Traversing all inf files of the first operating system through the compatible application to obtain a device list; identifying, by the compatible application, the access device from the device list; The step of running the second operating system driver in the access device through the compatible application to obtain first device information of the access device identified in the first operating system includes: The second operating system driver in the access device is run through the compatible application, the access device is started, and the first device information is obtained in the device list.
3. The method for acquiring device information of an access device according to claim 1, characterized in that: The step of registering the access device in the compatible application according to the first device information and adding the second device information in a preset data structure includes: According to the first device information, adding the registration information of the access device in a device registration table corresponding to the second operating system through the second operating system driver; The registration information is converted into a preset format through the compatible application to obtain the second device information, and the second device information is added to the preset data structure.
4. The method for acquiring device information of an access device according to claim 3, characterized in that: The compatible application program includes a server program of a second operating system running therein, and after the access device inserted into the electronic device is identified in the first operating system, the method further includes: Creating a monitoring service corresponding to the access device through the server program; The converting the registration information into a preset format by the compatible application to obtain the second device information includes: When the registration information in the device registration table is detected by the monitoring service, the registration information is converted into a preset format by the monitoring service to obtain the second device information.
5. The method for acquiring device information of an access device according to claim 4, characterized in that: Also includes: When the monitoring service determines that the access device is unplugged according to the status of the registration information in the device registration table, the second device information of the access device in the preset data structure is deleted.
6. The method for acquiring device information of an access device according to claim 1, characterized in that: The compatible application program includes a server program and a client program of a second operating system running therein; After registering the access device in the compatible application according to the first device information, the method further includes: In response to a connection request sent by the client program, establishing a transmission channel between the server program and the client program through the server program; The step of extracting the second device information from the preset data structure and sending the second device information by the compatible application in response to the device information acquisition request includes: In response to the device information acquisition request sent by the client program, the server program extracts the second device information from the preset data structure, and sends the second device information to the client program through the transmission channel.
7. The method for acquiring device information of an access device according to claim 2, characterized in that: The step of identifying the access device from the device list by the compatible application comprises: Obtaining, through the compatible application, a device descriptor of each external device recorded in the device list; A device whose device descriptor is a target device descriptor is determined as the access device, wherein the target device descriptor is a device descriptor preset for the access device.
8. The method for acquiring device information of an access device according to any one of claims 1 to 7, characterized in that: The first operating system is a Linux operating system, and the second operating system is a Windows operating system.
9. A device for acquiring device information of an access device, applied to an electronic device running a first operating system, characterized in that: The device comprises: an identification module, configured to identify, in the first operating system, an access device inserted into the electronic device through a compatible application installed in the electronic device; An acquisition module, configured to run a second operating system driver in the access device through the compatible application to acquire first device information of the access device identified in the first operating system; A registration module, configured to register the access device in the compatible application according to the first device information, and add second device information in a preset data structure, wherein the second device information is information matching a data format of the second operating system; The sending module is used to extract the second device information from the preset data structure through the compatible application program and send it in response to a device information acquisition request.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 8.
Citation Information
Cited By
Serial port equipment management method and device, equipment and storage medium
CN119441111A
Serial port device management method, device, equipment and storage medium
CN119441111B
Device driving method, preset driving module, electronic device and storage medium
CN120010934A
Serial port equipment management method and device, equipment and storage medium
CN120407484A
