CN114615527A - Hot-plug equipment information transmission method, computer equipment and readable medium - Google Patents

Hot-plug equipment information transmission method, computer equipment and readable medium Download PDF

Info

Publication number
CN114615527A
CN114615527A CN202011339047.2A CN202011339047A CN114615527A CN 114615527 A CN114615527 A CN 114615527A CN 202011339047 A CN202011339047 A CN 202011339047A CN 114615527 A CN114615527 A CN 114615527A
Authority
CN
China
Prior art keywords
information
equipment
hot
operation event
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011339047.2A
Other languages
Chinese (zh)
Inventor
张玉阳
刘逸峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN202011339047.2A priority Critical patent/CN114615527A/en
Priority to PCT/CN2021/129624 priority patent/WO2022111277A1/en
Publication of CN114615527A publication Critical patent/CN114615527A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides a hot-plug equipment information transmission method, which comprises the steps of responding to the hot-plug action of hot-plug equipment in a terminal equipment, and acquiring equipment information of the hot-plug equipment; responding to hot plug and unplug as an inserting action, and sending a first message carrying equipment information to a hot plug processing device so that the hot plug processing device loads an equipment driver and creates an equipment node according to the equipment information; responding to the received operation event information sent by the hot-plug equipment, sending a second message at least carrying the operation event information to the hot-plug processing device, so that the hot-plug processing device writes the operation event information into an equipment node, and the equipment node reports the operation event information to an operating system by utilizing an equipment driver; the application scene of the spice client component can be expanded, the support on the hot-plug equipment is more flexible, and the compatibility of the cloud system on the hot-plug equipment is improved. The present disclosure also provides a computer device and a readable medium.

Description

Hot-plug equipment information transmission method, computer equipment and readable medium
Technical Field
The disclosure relates to the technical field of communication, in particular to a hot-plug device information transmission method, computer equipment and a readable medium.
Background
With the rapid development of cloud computing and virtualization technologies, cloud set-top box products are gradually accepted by users, and the future prospect is promising. With the cloud product, a user can remotely access a virtual desktop for entertainment and office through a physical set top box, a thin client, or a dedicated PC (Personal Computer), but the cloud product is not very friendly to support of hot plug devices compared to a traditional PC physical machine.
In the existing cloud system scheme, a spice (independent computing environment simple protocol) hot plug device, such as a standard USB (Universal Serial Bus) input device, for example, a keyboard, a mouse, etc., is used, and the operation event information can be reported through a spice-defined standard input device channel, and a non-standard USB input device, for example, a wireless bluetooth handle device, can be reported through a spice device redirection channel. Under the two information reporting modes, the information reporting process of the USB input equipment comprises the following steps: USB input device-spice client of terminal equipment-spice server-qemu (virtual operating system simulator) -virtual machine. The information reporting process has the following defects or limitations:
for the USB device reporting information through the device redirection channel, the read-write permission of the node file of the USB input device needs to be opened on the terminal side, for example, version upgrade needs to be performed, and some third-party terminal devices (for example, third-party set-top boxes) need to be set by users to be implemented, which is difficult to implement.
Disclosure of Invention
The disclosure provides a hot-plug device information transmission method, a computer device and a readable medium.
In a first aspect, an embodiment of the present disclosure provides a method for transmitting information of a hot plug device, including:
responding to the hot plugging action of hot plugging equipment detected in the terminal equipment, and acquiring equipment information of the hot plugging equipment;
responding to the hot plug and unplug as an inserting action, and sending a first message carrying the equipment information to a hot plug processing device so that the hot plug processing device loads an equipment driver and creates an equipment node according to the equipment information;
and in response to receiving the operation event information sent by the hot plug device, sending a second message at least carrying the operation event information to the hot plug processing apparatus, so that the hot plug processing apparatus writes the operation event information into the device node, and the device node reports the operation event information to an operating system by using the device driver.
In another aspect, an embodiment of the present disclosure provides a method for transmitting information of a hot plug device, including:
responding to a first message sent by the terminal equipment, and acquiring equipment information of hot-plug equipment carried in the first message;
loading a device driver according to the device information, and creating a device node according to the device information;
responding to a second message sent by the terminal equipment, and acquiring operation event information carried in the second message;
and writing the operation event information into the equipment node so that the equipment node reports the operation event information to an operating system by using the equipment driver.
In another aspect, an embodiment of the present disclosure further provides a computer device, including:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the hot plug device information transfer method as previously described.
In still another aspect, an embodiment of the present disclosure further provides a computer readable medium, on which a computer program is stored, where the program, when executed, implements the hot plug device information transmission method as described above.
The hot-plug equipment information transmission method provided by the embodiment of the disclosure responds to the hot-plug action of hot-plug equipment in the terminal equipment and acquires the equipment information of the hot-plug equipment; responding to hot plug and unplug as an inserting action, and sending a first message carrying equipment information to a hot plug processing device so that the hot plug processing device loads an equipment driver and creates an equipment node according to the equipment information; responding to the received operation event information sent by the hot-plug equipment, sending a second message at least carrying the operation event information to the hot-plug processing device, so that the hot-plug processing device writes the operation event information into an equipment node, and the equipment node reports the operation event information to an operating system by utilizing an equipment driver; after the insertion action of the hot plug device is detected, the device node is established to establish the communication channel between the terminal device spice client component and the virtual machine, so that the existing device redirection channel is replaced, the reporting of the operation event information of the hot plug device is realized, the application scene of the terminal device spice client component can be expanded, the support to the external hot plug device is more flexible, and the compatibility of a cloud system to the hot plug device is improved.
Drawings
Fig. 1 is a schematic diagram of a cloud system architecture provided by an embodiment of the present disclosure;
fig. 2 is a first flowchart illustrating an information transmission method of a terminal-side hot-plug device according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart illustrating filtering operation event information according to an embodiment of the present disclosure;
fig. 4 is a second flowchart illustrating an information transmission method of a terminal-side hot-plug apparatus according to an embodiment of the disclosure;
fig. 5 is a schematic diagram of a message structure of a second message according to the embodiment of the present disclosure;
fig. 6 is a third schematic flowchart of an information transmission method of a terminal-side hot-plug apparatus according to an embodiment of the present disclosure;
fig. 7 is a first flowchart illustrating an information transmission method of a network-side hot-plug device according to an embodiment of the present disclosure;
fig. 8 is a schematic flowchart of a second process for deleting a device node according to the embodiment of the present disclosure;
fig. 9 is a second flowchart illustrating an information transmission method of a network-side hot-plug apparatus according to an embodiment of the disclosure;
fig. 10 is a first schematic structural diagram of a terminal device according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a terminal device according to the second embodiment of the present disclosure;
fig. 12 is a first schematic structural diagram of a hot plug processing apparatus according to an embodiment of the present disclosure;
fig. 13 is a second schematic structural diagram of a hot plug processing apparatus according to an embodiment of the present disclosure;
fig. 14 is a schematic structural diagram of a hot plug processing device according to a third embodiment of the present disclosure.
Detailed Description
Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but which may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising … …, when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Embodiments described herein may be described with reference to plan and/or cross-sectional views in light of idealized schematic illustrations of the disclosure. Accordingly, the example illustrations can be modified in accordance with manufacturing techniques and/or tolerances. Accordingly, the embodiments are not limited to the embodiments shown in the drawings, but include modifications of configurations formed based on a manufacturing process. Thus, the regions illustrated in the figures have schematic properties, and the shapes of the regions shown in the figures illustrate specific shapes of regions of elements, but are not intended to be limiting.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The embodiment of the disclosure provides a method for transmitting information of hot-plug equipment, which is applied to a cloud system. As shown in fig. 1, the clouding system includes: hot plug device, terminal equipment and hot plug processing apparatus (being the virtual machine), wherein, hot plug processing apparatus is cloud end equipment, and hot plug device and terminal equipment are terminal side equipment, and terminal equipment and hot plug processing apparatus communicate through TCP (Transmission Control Protocol) network. The terminal device may be a physical set-top box and the hot-plug device may be a USB hot-plug device, such as a USB wired or wireless bluetooth handle. The hot plug processing device comprises a vdagent (virtual daemon agent) module and a daemon module, wherein the daemon module is used for creating/deleting equipment nodes corresponding to hot plug equipment and loading/unloading corresponding equipment drivers; the terminal equipment comprises a spice client component and is used for reporting hot plugging actions and operation event information of the hot plugging equipment to a vdagent module of the hot plugging processing device.
As shown in fig. 2, the method for transmitting hot plug device information according to the embodiment of the present disclosure includes the following steps:
and 11, responding to the hot plugging action of the hot plugging device in the terminal device, and acquiring the device information of the hot plugging device.
In this step, the spice client component of the terminal device detects whether hot plug action occurs to the hot plug device by calling a Netlink mechanism. Because the terminal device compiles the drive of the related USB hot plug device into the kernel in advance, the terminal device can directly support work after the USB hot plug device is inserted, and therefore, the spice client component of the terminal device can acquire the device information of the USB hot plug device through the sysfs file system when detecting that the hot plug device performs a hot plug action on the terminal device.
In some embodiments, the device information is part of the device descriptor information and may include VID (vendor ID) and PID (product ID) information for USB hot-plugged devices.
And step 12, responding to the hot plug as the plug action, and sending a first message carrying the equipment information to the hot plug processing device, so that the hot plug processing device loads the equipment driver according to the equipment information and creates an equipment node.
The hot plug action comprises a plug-in action or a plug-out action. In this step, after the spice client component of the terminal device determines that the hot plug is taken as the insertion action, the device information of the hot plug device is reported to the hot plug processing apparatus (i.e., the virtual machine), and the daemon module of the virtual machine loads the device driver corresponding to the hot plug device and creates the device node corresponding to the hot plug device.
After the hot plug equipment is inserted into the terminal equipment, the terminal equipment enumerates the inserted hot plug equipment, loads a corresponding equipment driver and initializes the hot plug equipment, and the hot plug equipment can normally work after initialization is completed.
And step 13, receiving the operation event information sent by the hot plug device.
In this step, once the user operates the hot-plug device, for example, clicks a key of the hot-plug device, the hot-plug device reports the operation event information of the "key" to the spice client component of the terminal device.
And step 14, sending a second message at least carrying the operation event information to the hot plug processing device, so that the hot plug processing device writes the operation event information into the equipment node, and the equipment node reports the operation event information to the operating system by using the equipment driver.
After receiving the operation event information sent by the hot-plug device, the spice client component of the terminal device reports the operation event information to the vdagent module of the virtual machine, the vdagent module of the virtual machine writes the operation event information into the device node, and the device node reports the operation event information to the operating system through the device driver.
The hot-plug equipment information transmission method provided by the embodiment of the disclosure responds to the fact that hot-plug action occurs on the hot-plug equipment at the terminal equipment, and obtains equipment information of the hot-plug equipment; responding to hot plug and unplug as an inserting action, and sending a first message carrying equipment information to a hot plug processing device so that the hot plug processing device loads an equipment driver and creates an equipment node according to the equipment information; responding to the received operation event information sent by the hot-plug equipment, sending a second message at least carrying the operation event information to the hot-plug processing device so that the hot-plug processing device writes the operation event information into an equipment node, and reporting the operation event information to an operating system by the equipment node through an equipment driver; after the insertion action of the hot plug device is detected, the device node is established to establish the communication channel between the terminal device spice client component and the virtual machine, so that the existing device redirection channel is replaced, the reporting of the operation event information of the hot plug device is realized, the application scene of the terminal device spice client component can be expanded, the support to the external hot plug device is more flexible, and the compatibility of a cloud system to the hot plug device is improved.
In some embodiments, after obtaining the device information of the hot plug device (i.e., step 11), the method for transmitting the hot plug device information may further include the steps of: and responding to the hot plug as a plug action, and sending a third message carrying equipment information to the hot plug processing device so that the hot plug processing device unloads the equipment drive and deletes the equipment node according to the equipment information. In this step, after the spice client component of the terminal device determines that the hot plug is taken as a pull-out action, the device information of the hot plug device is reported to the vdagent module of the virtual machine, and the vdagent module of the virtual machine instructs the daemon module to unload the device driver of the hot plug device and delete the device node corresponding to the hot plug device.
In some embodiments, the sending a third message carrying device information to the hot-plug processing apparatus includes: and in response to the network state not meeting the first preset condition, suspending sending the third message carrying the equipment information to the hot plug processing device, and sending the third message carrying the equipment information to the hot plug processing device until the network state meets the first preset condition. In some embodiments, satisfying the first preset condition means: the terminal equipment accesses the TCP network, namely, the data transmission condition is met. Correspondingly, the condition that the first preset condition is not met means that the terminal device is disconnected from the TCP network (i.e. does not access the TCP network), i.e. the data transmission condition is not met. That is, before the terminal device sends the third message to the virtual machine, the network state is determined, and the third message is sent after the current network state is confirmed to meet the data transmission condition. And if the current network state does not meet the data transmission condition, the third message is not sent, and the third message is sent after the network state meets the data transmission condition. That is, if the TCP network is not available, the end device cycles waiting until the TCP network is restored or the hot-plugged device is unplugged from the end device.
In some embodiments, the sending a first message carrying device information to the hot-plug processing apparatus (i.e., step 12) includes: and in response to the network state not meeting a first preset condition, suspending sending the first message carrying the equipment information to the hot plug processing device, and sending the first message carrying the equipment information to the hot plug processing device until the network state meets the first preset condition. In some embodiments, satisfying the first preset condition means: the terminal equipment accesses the TCP network, namely, the data transmission condition is met. Correspondingly, the condition that the first preset condition is not met means that the terminal device is disconnected from the TCP network (i.e. does not access the TCP network), i.e. the data transmission condition is not met. That is to say, before the terminal device sends the first message to the virtual machine, the network state is judged, and after the current network state is confirmed to meet the data transmission condition, the first message is sent. And if the current network state does not meet the data transmission condition, the first message is not sent, and the first message is sent after the network state meets the data transmission condition.
Generally, a spice client component of a terminal device sends data to a virtual machine at a cloud end, which is influenced by a network environment, and uncontrollable data transmission delay exists. Moreover, for a data transmission mode of reporting data by using the device redirection channel, the data packet of the operation event information reported by the spice client component of the terminal device is large, and the possibility of TCP network congestion is increased.
In order to solve the above problem, in some embodiments, as shown in fig. 3, the sending a second message carrying at least operation event information to the hot-plug processing apparatus (i.e. step 14) includes the following steps:
step 131, in response to the network status satisfying the first preset condition and not satisfying the second preset condition, filtering the operation event information.
In some embodiments, the first preset condition being met and the second preset condition not being met is: the TCP network is connected but the network condition is not good, and it should be noted that the network condition is not good can be judged by whether the network parameter reaches a threshold, for example, the delay is too large.
In this step, when the spice client component of the terminal device determines that the current network condition is not good, the reported operation event information is filtered, for example, time information and the like can be removed, so as to obtain the filtered operation event information. The filtered operational event information may include: event type, time code, event value.
Step 132, sending a second message carrying at least the filtered operation event information to the hot-plug processing apparatus.
In this step, the spice client component of the terminal device may send the second message to the virtual machine in a segmented transmission manner, that is, send the second message to the spice server, the spice server sends the second message to the vdagent module of the virtual machine, and the spice server sends the operation event information in a segmented transmission manner, so that stability of data transmission of the operation event information can be ensured.
The spice client component of the terminal equipment filters the operation event information, so that the size of a data packet sent to the virtual machine is reduced, the possibility of TCP network congestion can be reduced, the data transmission delay is reduced, and the data transmission efficiency is improved.
In some embodiments, as shown in fig. 4, after receiving operation event information sent by the hot plug device (i.e. step 13), before sending a second message carrying at least the operation event information to the hot plug processing apparatus (step 14), the hot plug device information transmission method may further include the following steps:
and step 13', calculating first check information according to the operation event information.
In this step, the spice client component of the terminal device calculates a checksum according to the operation event information such as the event type, the event code, the event value and the like, wherein the checksum is the first check information and is used for the virtual machine to verify the operation event. In some embodiments, the first check information may be calculated using a Hash algorithm.
Correspondingly, the sending a second message carrying at least operation event information to the hot-plug processing apparatus (i.e. step 14) includes: and sending a second message carrying the operation event information and the first check information to the hot plug processing device, so that the hot plug processing device writes the operation event information into the equipment node after passing the check according to the first check information, and the equipment node reports the operation event information to the operating system by using the equipment driver.
The first check information is sent to the virtual machine, so that the virtual machine can check data conveniently, the reliability of data transmission can be improved, and the reliability of data reporting can be controlled.
In some embodiments, the message format of the second message is as shown in fig. 5, and includes: the system comprises a packet header, a packet length, a packet type, data and a check field, wherein the data field is used for carrying operation event information, and the check field is used for carrying first check information.
In some embodiments, as shown in fig. 6, after sending the second message carrying the operation event information and the first verification information to the hot-plug processing apparatus (i.e. step 14), the hot-plug device information transmission method may further include the following steps:
and step 15, receiving a fourth message sent by the hot plug processing device.
And step 16, calculating first check information according to the operation event information, and sending a second message to the hot plug processing device, wherein the second message carries the operation event information and the currently calculated first check information.
It should be noted that, after receiving the second message, the vdagent module of the virtual machine calculates second check information according to the operation event information therein, and if the second check information is inconsistent with the first check information, sends a fourth message to the terminal device. Correspondingly, the spice client component of the terminal device receives the fourth message sent by the vdagent module of the virtual machine, which indicates that the data verification fails, and therefore the spice client component of the terminal device recalculates the first verification information and resends the second message.
An embodiment of the present disclosure further provides a method for transmitting information of a hot plug device, as shown in fig. 7, the method includes the following steps:
step 21, in response to receiving the first message sent by the terminal device, obtaining the device information of the hot-plug device carried therein.
The first message is sent by the terminal equipment after the terminal equipment detects that the hot-plug equipment is inserted into the terminal equipment. In this step, the vdagent module of the plug processing apparatus (i.e., the virtual machine) receives the first message sent by the terminal device, and analyzes and obtains the device information of the hot-plugged device therein. In some embodiments, the device information is part of the device descriptor information and may include VID (vendor ID) and PID (product ID) information for USB hot-plugged devices.
And step 22, loading the device driver according to the device information, and creating a device node according to the device information.
After receiving the first message reported by the spice client module of the terminal device, the vdagent module of the virtual machine instructs the daemon module of the virtual machine to identify and enumerate the hot-plug device corresponding to the device information and load the corresponding device driver, and then the daemon module creates a device node.
After the device driver is loaded and the device node is created, the binding relationship between the device node and the device driver is already established, so far, an I/O (input/output) channel between a spice client component of the terminal device and the virtual machine is already established, and the hot-plug device can send operation event information to the virtual machine through the I/O channel in the using process of the hot-plug device.
And step 23, in response to receiving the second message sent by the terminal device, acquiring the operation event information carried in the second message.
And 24, writing the operation event information into the equipment node so that the equipment node reports the operation event information to the operating system by using the equipment driver.
In this step, the vdagent module of the virtual machine writes the operation event information into the created device node corresponding to the device information, that is, into the node file of the device node, through the sendent interface, and the device node reports the operation event information to the operating system framework layer by using the corresponding device driver. And the framework layer of the operating system reports the operation event information reported by the device driver to the application layer by adopting a default processing method, and the application layer processes the operation event information.
The hot-plug equipment information transmission method provided by the embodiment of the disclosure responds to the fact that hot-plug action occurs on the hot-plug equipment at the terminal equipment, and obtains equipment information of the hot-plug equipment; responding to hot plug and unplug as an inserting action, and sending a first message carrying equipment information to a hot plug processing device so that the hot plug processing device loads an equipment driver and creates an equipment node according to the equipment information; responding to the received operation event information sent by the hot-plug equipment, sending a second message at least carrying the operation event information to the hot-plug processing device so that the hot-plug processing device writes the operation event information into an equipment node, and reporting the operation event information to an operating system by the equipment node through an equipment driver; after the insertion action of the hot plug device is detected, the device node is established to establish the communication channel between the terminal device spice client component and the virtual machine, so that the existing device redirection channel is replaced, the reporting of the operation event information of the hot plug device is realized, the application scene of the terminal device spice client component can be expanded, the support to the external hot plug device is more flexible, and the compatibility of a cloud system to the hot plug device is improved.
In some embodiments, as shown in fig. 8, further, the method for transmitting hot plug device information may further include the following steps:
and step 31, in response to receiving the third message sent by the terminal device, obtaining the device information of the hot-plug device carried in the third message.
And the third message is sent to the virtual machine after the spice client component of the terminal device determines that the hot-plug device is unplugged from the terminal device. In this step, after receiving the third message sent by the terminal device, the vdagent component of the virtual machine parses the third message to obtain device information of the hot-plug device, where the device information may include VID (vendor ID) and PID (product ID) information of the USB hot-plug device.
And 32, unloading the device driver according to the device information, and deleting the device node according to the device information.
In this step, the vdagent module of the virtual machine instructs the daemon module to unload the device driver according to the device information and delete the corresponding device node, so that the process of pulling out the hot-plugged device is completed.
In some embodiments, further, the second message may also carry the first check information, and correspondingly, as shown in fig. 9, after the operation event information carried in the second message is obtained (that is, step 23) and before the operation event information is written into the device node (that is, step 24), the method for transmitting hot plug device information may further include the following steps:
and step 23', acquiring the first check information in the second message, and calculating the second check information according to the operation event information.
In this step, the vdagent component of the virtual machine calculates a checksum according to the operation event information such as the event type, the event code, and the event value, and the checksum is the second check information. In some embodiments, the second check-up information may be calculated using a Hash algorithm.
Accordingly, the writing of the operational event information to the device node (i.e., step 24) includes the steps of:
and 24', in response to that the second check information is consistent with the first check information, writing the operation event information into the device node so that the device node reports the operation event information to the operating system by using the device driver.
In this step, the vdagent module of the virtual machine compares the second check information with the first check information, and if the two check information are consistent, it indicates that the data check is passed, the vdagent module writes the operation event information obtained in step 23 into the corresponding device node through the send interface, and the device node reports the operation event information to the operating system framework layer by using the corresponding device driver.
In some embodiments, the method for transmitting hot plug device information further includes the following steps: and responding to the inconsistency of the second check information and the first check information, and sending a fourth message to the terminal equipment so that the terminal equipment calculates the first check information again. In this step, if the vdagent module of the virtual machine determines that the second check information is inconsistent with the first check information, which indicates that the data check is not passed, a fourth message is sent to the terminal device to request the terminal device to retransmit the data. The embodiment of the disclosure adopts a checking mechanism to improve the reliability of data transmission and realize the controllable reliability of data reporting.
In some embodiments, the loading device drivers according to the device information and creating device nodes according to the device information includes: in response to determining that the device driver matches the device information, loading the device driver; and acquiring node parameters according to the equipment information, and creating equipment nodes according to the node parameters. In this step, a daemon module of the virtual machine enumerates the hot-plugged device and loads a corresponding device driver, where the enumeration process is a device driver matching process, and if the daemon module of the virtual machine matches the corresponding device driver according to the device information of the hot-plugged device, the matched device driver is loaded, and a device node is created. In some embodiments, a daemon module of the virtual machine calls an mknow (create node) command, obtains a node parameter according to the device information of the hot-plugged device, and creates a device node according to the node parameter. Creating the device node includes creating a node file, where the node parameter may include a node name, a node type, a primary device number, and a secondary device number, where the node name includes a storage path and a file name of the node file, for example, expressed as/dev/input/eventX, dev/input/is a storage path, and eventX is a file name of the node file; the node type is a character equipment node; the value of the main equipment number is determined by the equipment driving type, and for the standard handle equipment, the value of the main equipment number is 13 at present; the value of the secondary device number can be obtained by adding one to the value of the secondary device number of the existing device node of the same type.
The embodiment of the disclosure provides a processing scheme for supporting normal reporting of an operation event message of a USB hot-plug device without modifying the authority of the USB hot-plug device at a device terminal. The method can not only remove the limitation of using the USB hot plug equipment in the cloud scheme, but also improve the transmission efficiency of the hot plug equipment; the scheme of the embodiment of the disclosure realizes message reporting through an upper application interface, and provides a verification mechanism, thereby ensuring the reliability of message reporting; the scheme of the embodiment of the disclosure adopts a mode of filtering and reporting the key data of the operation event, thereby improving the transmission efficiency and reducing the possibility of time delay and TCP network congestion. The scheme of the embodiment of the disclosure can obviously improve the compatibility supported by the hot plug device in the cloud scheme and reduce the time delay of reporting the operation event information of the hot plug device.
Based on the same technical concept, an embodiment of the present disclosure further provides a terminal device, as shown in fig. 10, including an obtaining module 101, a receiving module 102, a first processing module 103, and a sending module 104, where the obtaining module 101 is configured to, in response to detecting that a hot plug action occurs in the terminal device, obtain device information of a hot plug device.
The receiving module 102 is configured to receive operation event information sent by the hot plug device.
The first processing module 103 is configured to, in response to the hot plug being an insertion action, instruct the sending module 104 to send a first message carrying the device information to a hot plug processing apparatus, so that the hot plug processing apparatus loads a device driver according to the device information and creates a device node; in response to the receiving module 102 receiving the operation event information sent by the hot plug device, instructing the sending module 104 to send a second message carrying at least the operation event information to the hot plug processing apparatus, so that the hot plug processing apparatus writes the operation event information into the device node, and the device node reports the operation event information to an operating system by using the device driver.
In some embodiments, the first processing module 103 is further configured to, in response to the hot plug being a unplugging action, instruct the sending module 104 to send a third message carrying the device information to the hot plug processing apparatus, so that the hot plug processing apparatus unloads the device driver and deletes the device node according to the device information.
In some embodiments, the first processing module 103 is configured to, in response to that the network status does not satisfy a first preset condition, suspend sending the first message carrying the device information to the hot-plug processing apparatus, until the network status satisfies the first preset condition, instruct the sending module 104 to send the first message carrying the device information to the hot-plug processing apparatus; and/or, in response to that the network state does not satisfy the first preset condition, suspending sending the third message carrying the device information to the hot-plug processing apparatus, until the network state satisfies the first preset condition, instructing the sending module 104 to send the third message carrying the device information to the hot-plug processing apparatus.
In some embodiments, the first processing module 103 is configured to, in response to the network status satisfying the first preset condition and not satisfying a second preset condition, filter the operation event information; and instructing the sending module 104 to send a second message carrying at least the filtered operation event information to the hot plug processing apparatus.
In some embodiments, as shown in fig. 11, the terminal device further includes a second processing module 105, where the second processing module 105 is configured to calculate first check information according to the operation event information, and instruct the sending module 104 to send a second message carrying the operation event information and the first check information to the hot plug processing apparatus.
In some embodiments, the receiving module 102 is further configured to receive a fourth message sent by the hot plug processing device.
The second processing module 105 is configured to, in response to the receiving module 102 receiving a fourth message sent by the hot plug processing apparatus, calculate first check information according to the operation event information, and instruct the sending module 104 to send a second message to the hot plug processing apparatus, where the second message carries the operation event information and the currently calculated first check information.
It should be noted that the fetching module 101, the receiving module 102, the first processing module 103, the sending module 104, and the second processing module are all sub-modules of a spice client component.
Based on the same technical concept, an embodiment of the present disclosure further provides a hot plug processing apparatus, as shown in fig. 12, including a receiving module 201, an obtaining module 202, a first processing module 203, and a second processing module 204, where the receiving module 201 is configured to receive a first message sent by a terminal device; and receiving a second message sent by the terminal equipment.
The obtaining module 202 is configured to obtain device information of the hot plug device carried in the first message; and acquiring the operation event information carried in the second message.
The first processing module 203 is configured to load a device driver according to the device information, and create a device node according to the device information.
The second processing module 204 is configured to write the operation event information into the device node, so that the device node reports the operation event information to an operating system by using the device driver.
In some embodiments, the receiving module 201 is further configured to receive a third message sent by the terminal device.
The obtaining module 202 is further configured to obtain the device information of the hot plug device carried in the third message.
The first processing module 203 is further configured to unload the device driver according to the device information, and delete the device node according to the device information.
In some embodiments, the second message further carries first verification information, as shown in fig. 13, the hot plug processing apparatus further includes a verification module 205, and the obtaining module 202 is further configured to obtain the first verification information in the second message.
The checking module 205 is configured to calculate second checking information according to the operation event information, and determine whether the second checking information is consistent with the first checking information.
The second processing module 204 is configured to, in response to that the second check information is consistent with the first check information, write the operation event information into the device node.
In some embodiments, as shown in fig. 14, the hot plug processing apparatus further includes a sending module 206, where the sending module 206 is configured to send a fourth message to the terminal device in response to that the second verification information is inconsistent with the first verification information, so that the terminal device calculates the first verification information again.
In some embodiments, the first processing module 203 is configured to, in response to determining that the device driver matches the device information, load the device driver; and acquiring node parameters according to the equipment information, and creating equipment nodes according to the node parameters.
It should be noted that the receiving module 201, the obtaining module 202, the second processing module 204, the verifying module 205, and the sending module 206 are sub-modules of a vdagent module, and the first processing module 203 is a sub-module of a daemon module.
An embodiment of the present disclosure further provides a computer device, including: one or more processors and storage; the storage device stores one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the hot plug device information transmission method provided in the foregoing embodiments.
The embodiment of the present disclosure further provides a computer readable medium, on which a computer program is stored, where the computer program is executed to implement the hot plug device information transmission method provided in the foregoing embodiments.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods disclosed above, functional modules/units in the apparatus, may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted in a generic and descriptive sense only and not for purposes of limitation. In some instances, features, characteristics and/or elements described in connection with a particular embodiment may be used alone or in combination with features, characteristics and/or elements described in connection with other embodiments, unless expressly stated otherwise, as would be apparent to one skilled in the art. It will, therefore, be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the invention encompassed by the appended claims.

Claims (13)

1. A method for transmitting information of hot-plug equipment is characterized by comprising the following steps:
responding to the hot plugging action of hot plugging equipment on the terminal equipment, and acquiring equipment information of the hot plugging equipment;
responding to the hot plug and unplug as an inserting action, and sending a first message carrying the equipment information to a hot plug processing device so that the hot plug processing device loads an equipment driver and creates an equipment node according to the equipment information;
and in response to receiving the operation event information sent by the hot plug device, sending a second message carrying at least the operation event information to the hot plug processing device, so that the hot plug processing device writes the operation event information into the device node, and the device node reports the operation event information to an operating system by using the device driver.
2. The method of claim 1, after obtaining the device information for the hot-plugged device, further comprising:
and responding to the hot plug action as a pull-out action, and sending a third message carrying the equipment information to the hot plug processing device so that the hot plug processing device unloads the equipment drive and deletes the equipment node according to the equipment information.
3. The method of claim 2, wherein sending the first message carrying the device information to the hot-plug processing apparatus comprises: in response to that the network state does not meet a first preset condition, suspending sending the first message carrying the equipment information to a hot plug processing device, and sending the first message carrying the equipment information to the hot plug processing device until the network state meets the first preset condition; and/or
The sending the third message carrying the device information to the hot plug processing apparatus includes: and in response to the network state not meeting a first preset condition, suspending sending the third message carrying the equipment information to the hot plug processing device, and sending the third message carrying the equipment information to the hot plug processing device until the network state meets the first preset condition.
4. The method according to claim 3, wherein the sending the second message carrying at least the operation event information to the hot plug processing device comprises:
responding to the network state meeting the first preset condition and not meeting the second preset condition, and filtering the operation event information;
and sending a second message carrying at least the filtered operation event information to the hot plug processing device.
5. The method according to any of claims 1-4, wherein before sending the second message carrying at least the operation event information to the hot plug processing device, further comprising: calculating first check information according to the operation event information;
the sending, to the hot plug processing device, the second message carrying at least the operation event information includes: and sending a second message carrying the operation event information and the first verification information to the hot plug processing device.
6. The method according to claim 5, wherein after sending the second message carrying the operation event information and the first verification information to the hot plug processing device, further comprising:
and responding to the received fourth message sent by the hot plug processing device, calculating first verification information according to the operation event information, and sending a second message to the hot plug processing device, wherein the second message carries the operation event information and the currently calculated first verification information.
7. A method for transmitting information of hot-plug equipment is characterized by comprising the following steps:
responding to a first message sent by the terminal equipment, and acquiring equipment information of hot-plug equipment carried in the first message;
loading a device driver according to the device information, and creating a device node according to the device information;
responding to a second message sent by the terminal equipment, and acquiring operation event information carried in the second message;
and writing the operation event information into the equipment node so that the equipment node reports the operation event information to an operating system by using the equipment driver.
8. The method of claim 7, wherein the method further comprises:
responding to the received third message sent by the terminal equipment, and acquiring equipment information of the hot-plug equipment carried in the third message;
and unloading the equipment drive according to the equipment information, and deleting the equipment node according to the equipment information.
9. The method as claimed in claim 7, wherein the second message further carries first check information, and after obtaining the operation event information carried in the second message and before writing the operation event information into the device node, the method further includes:
acquiring first check information in the second message, and calculating second check information according to the operation event information;
the writing the operation event information into the device node includes:
in response to the second check-up information being consistent with the first check-up information, writing the operational event information to the device node.
10. The method of claim 9, further comprising:
and responding to the inconsistency of the second check information and the first check information, and sending a fourth message to the terminal equipment so that the terminal equipment calculates the first check information again.
11. The method of any of claims 7-10, wherein the loading device drivers based on the device information and creating device nodes based on the device information comprises:
in response to determining that the device driver matches the device information, loading the device driver;
and acquiring node parameters according to the equipment information, and creating equipment nodes according to the node parameters.
12. A computer device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the hot plug device information transfer method of any of claims 1-11.
13. A computer-readable medium having stored thereon a computer program, wherein the program when executed implements a hot-plug device information transfer method as claimed in any of claims 1-11.
CN202011339047.2A 2020-11-25 2020-11-25 Hot-plug equipment information transmission method, computer equipment and readable medium Pending CN114615527A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011339047.2A CN114615527A (en) 2020-11-25 2020-11-25 Hot-plug equipment information transmission method, computer equipment and readable medium
PCT/CN2021/129624 WO2022111277A1 (en) 2020-11-25 2021-11-09 Hot-plug device information transmission method, computer device and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011339047.2A CN114615527A (en) 2020-11-25 2020-11-25 Hot-plug equipment information transmission method, computer equipment and readable medium

Publications (1)

Publication Number Publication Date
CN114615527A true CN114615527A (en) 2022-06-10

Family

ID=81755352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011339047.2A Pending CN114615527A (en) 2020-11-25 2020-11-25 Hot-plug equipment information transmission method, computer equipment and readable medium

Country Status (2)

Country Link
CN (1) CN114615527A (en)
WO (1) WO2022111277A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116112603B (en) * 2023-02-09 2024-06-11 哲库科技(北京)有限公司 Hot plug identification method and device, electronic equipment and readable storage medium
CN116701274B (en) * 2023-07-26 2023-11-17 武汉能钠智能装备技术股份有限公司 Hot-plug hard disk data transmission system and method

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2454676A4 (en) * 2009-07-17 2014-05-21 Hewlett Packard Development Co Virtual hot inserting functions in a shared i/o environment
US8301818B2 (en) * 2009-12-11 2012-10-30 Oracle America, Inc. Virtual hot plugging of devices and virtual devices
CN104317759A (en) * 2014-10-15 2015-01-28 国云科技股份有限公司 Method for supporting hot plugging of virtual machine USB (universal serial bus) storage equipment
US10437768B2 (en) * 2015-07-09 2019-10-08 Telefonaktiebolaget Lm Ericsson (Publ) Method and host node for configuring a remote node and a host node
CN105354164B (en) * 2015-12-07 2018-06-26 浪潮(北京)电子信息产业有限公司 The method and system of server Multi-Host module hot plugs
WO2017209854A1 (en) * 2016-05-31 2017-12-07 Brocade Communications Systems, Inc. Hot-plug hardware and software implementation
CN108228399A (en) * 2016-12-14 2018-06-29 浙江舜宇智能光学技术有限公司 USB device automatic checkout equipment and its method
CN108738000A (en) * 2018-03-30 2018-11-02 晨星半导体股份有限公司 Based on Android(Android)The bluetooth adaptation method and terminal device of system

Also Published As

Publication number Publication date
WO2022111277A1 (en) 2022-06-02

Similar Documents

Publication Publication Date Title
US9934049B1 (en) Method for creation of device drivers and device objects for peripheral devices
US8468279B2 (en) Platform based verification of contents of input-output devices
WO2022111277A1 (en) Hot-plug device information transmission method, computer device and readable medium
US9032173B2 (en) Automated migration to a new copy services target storage system to manage multiple relationships simultaneously while maintaining disaster recovery consistency
CN107526616B (en) Method and device for writing and reading data of BMC by host
US20090019192A1 (en) Usb transmission system and related method for accessing data in a first usb specification with a speed of a second usb specification
CN113391845A (en) Data interaction method and device and related components
CN107111568A (en) System and method for driver installation file to be presented when enabling USB equipment
CN107277163B (en) Equipment remote mapping method and device
CN111637079B (en) Mainboard, fan control system and method
WO2023151372A1 (en) Module upgrade method and system
US9230121B1 (en) Techniques for persistently toggling a FIPS-140 cryptographic mode of a clustered storage system
AU2021412311B2 (en) Reader device and method of configuring the same
CN113645316B (en) Upgrade data processing method, upper computer, lower computer, device and storage medium
CN113326219B (en) Burning method based on burning system and computer storage medium
WO2017096889A1 (en) Method and device for upgrading and downgrading system
US9390041B2 (en) Method for processing device connection, combination device and host device
US9417863B2 (en) System and method for expedited loading of an image onto a storage device
CN108804068B (en) Client of audio device redirection system and related audio device redirection method
WO2018188404A1 (en) Usb device configuration method and host
CN116048642A (en) LLDP (LLDP) enabled state control method, LLDP enabled state control device and LLDP enabled state control medium
CN104902320A (en) Playing method and playing device for media file
CN115344348A (en) Intelligent network card virtual machine migration method based on libvirt and qemu
CN117290025A (en) Disk redirection method, device, computer equipment and readable medium
CN117389592A (en) Method for realizing automatic upgrade of electronic equipment and upgrade device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination