CN107656890B - A kind of method and apparatus of data acquisition - Google Patents

A kind of method and apparatus of data acquisition Download PDF

Info

Publication number
CN107656890B
CN107656890B CN201710840668.0A CN201710840668A CN107656890B CN 107656890 B CN107656890 B CN 107656890B CN 201710840668 A CN201710840668 A CN 201710840668A CN 107656890 B CN107656890 B CN 107656890B
Authority
CN
China
Prior art keywords
usb device
acquisition equipment
logical partition
mapped
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.)
Active
Application number
CN201710840668.0A
Other languages
Chinese (zh)
Other versions
CN107656890A (en
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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201710840668.0A priority Critical patent/CN107656890B/en
Publication of CN107656890A publication Critical patent/CN107656890A/en
Application granted granted Critical
Publication of CN107656890B publication Critical patent/CN107656890B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • 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
    • 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)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)

Abstract

The invention discloses a kind of method and apparatus of data acquisition, to solve the problems, such as to support in the prior art the USB device of more Luns functions cause to acquire when being linked into acquisition equipment equipment can not normal acquisition to USB device total data.The quantity information of logical partition is sent to acquisition equipment by preset first message of HID protocol by USB device in the present invention, and acquisition equipment determines the mapping mode of the logical partition of USB device according to logical partition quantity information;Whole logical partitions are mapped in acquisition equipment by the preset second message notifying USB device of HID protocol according to the mapping mode of determining logical partition by acquisition equipment, obtain the data in the logical partition after mapping in USB device.By the way of of the invention, acquisition equipment can be such that whole logical partitions in USB device are mapped in acquisition equipment by determining mapping mode, guarantee to collect the data in USB device in whole logical partitions.

Description

A kind of method and apparatus of data acquisition
Technical field
The present invention relates to field of communication technology, in particular to a kind of method and apparatus of data acquisition.
Background technique
When USB (Universal Serial Bus, the general serial for supporting Mass Storage (massage storage) agreement Bus) equipment by acquisition equipment on USB interface be linked into acquisition equipment after, USB device can acquisition equipment in be mapped as One mobile hard disk drive;If having multiple logical partitions in the USB device, that is, the USB device supports more Luns When (Logical Unit Number, logical unit number) function, it is hard which is mapped as multiple movements in acquisition equipment Disk drive, wherein the corresponding mobile hard disk drive of a logical partition uses different mobile hard disk disks in acquisition equipment Symbol distinguishes different logical partitions.
In general, after supporting the USB device of more Luns functions to be linked into acquisition equipment when one, it is understood that there may be cannot be by USB The USB interface that each logical partition of equipment all maps out in the situation come, such as acquisition equipment accesses one and includes When having the USB device of eight logical partitions, it should then be mapped as 8 mobile hard disk drives at this time, if but acquiring equipment due to Access other equipment make the mobile hard disk drive number for being currently able to display be 2, patrol so that can only have 2 in USB device It collects subregion and is mapped as mobile hard disk drive in acquisition equipment, acquisition equipment can not show whole logical partitions of USB device Data, so cause acquire equipment can not normal acquisition USB device total data.
To sum up, cause acquisition equipment can not be just when the existing USB device for supporting more Luns functions is linked into acquisition equipment Often collect the total data of USB device.
Summary of the invention
The present invention provides a kind of method and apparatus of data acquisition, supports more Luns functions in the prior art to solve USB device be linked into acquisition equipment when cause acquire equipment can not normal acquisition to USB device total data problem.
The present invention provides a kind of methods of data acquisition, this method comprises:
USB device is linked into acquisition equipment by the USB interface in acquisition equipment, wherein the USB device supports Mass Storage agreement and HID protocol;
The USB device passes through preset first message of HID protocol for the quantity information of the logical partition of the USB device It is sent to the acquisition equipment, so that the acquisition equipment determines the USB device according to the logical partition quantity information The mapping mode of logical partition;
After the USB device receives preset second message of the HID protocol that the acquisition equipment is sent, according to institute Whole logical partitions in the USB device are mapped to acquisition and set by the mapping mode for stating the logical partition for including in the second message In standby.
The present invention provides a kind of methods of data acquisition, this method comprises:
After acquisition equipment determines USB device access, preset first report of HID protocol that the USB device is sent is received Text, wherein including the quantity information of the logical partition of the USB device in the first message;
The acquisition equipment determines the mapping of the logical partition of the USB device according to the quantity information of the logical partition Mode;
The acquisition equipment is by USB device described in preset second message notifying of HID protocol according to determining logic point Whole logical partitions are mapped in acquisition equipment by the mapping mode in area, obtain the logical partition after mapping in the USB device In data.
The present invention provides a kind of USB device of data acquisition, which includes:
AM access module, for being linked into acquisition equipment by the USB interface in acquisition equipment, wherein the USB device branch Hold Mass Storage agreement and HID protocol;
First transmission module, for passing through preset first message of HID protocol for the number of the logical partition of the USB device Amount information is sent to the acquisition equipment, so that the acquisition equipment determines the USB according to the logical partition quantity information The mapping mode of the logical partition of equipment;
First processing module, after receiving preset second message of the HID protocol that the acquisition equipment is sent, Whole logical partitions in the USB device are mapped to according to the mapping mode for the logical partition for including in second message It acquires in equipment.
The present invention provides a kind of acquisition equipment of data acquisition, which includes:
It is default to receive the HID protocol that the USB device is sent after determining USB device access for second transmission module The first message, wherein including the quantity information of the logical partition of the USB device in the first message;
Second processing module, for determining the logical partition of the USB device according to the quantity information of the logical partition Mapping mode;
Data acquisition module, for being patrolled by USB device described in preset second message notifying of HID protocol according to determining Whole logical partitions are mapped in acquisition equipment by the mapping mode for collecting subregion, obtain the logic after mapping in the USB device Data in subregion.
USB device is linked into acquisition equipment by the USB interface in acquisition equipment in the present invention, wherein the USB device Support Mass Storage agreement and HID protocol;The USB device is set the USB by preset first message of HID protocol The quantity information of standby logical partition is sent to the acquisition equipment, and the acquisition equipment receives what the USB device was sent Preset first message of HID protocol, the mapping of the logical partition of the USB device is determined according to the logical partition quantity information Mode;The acquisition equipment is by USB device described in preset second message notifying of HID protocol according to determining logical partition Whole logical partitions are mapped in acquisition equipment by mapping mode, are obtained in the logical partition after mapping in the USB device Data.By the way of the embodiment of the present invention, acquisition equipment determines mapping side according to the quantity of the logical partition in USB device Whole logical partitions in USB device can be mapped in acquisition equipment by corresponding mapping mode, guarantee acquisition by formula Equipment can collect the data in the USB device in whole logical partitions.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this For the those of ordinary skill in field, without any creative labor, it can also be obtained according to these attached drawings His attached drawing.
Fig. 1 is the system structure diagram of data of embodiment of the present invention acquisition;
Fig. 2 is the structural schematic diagram of the USB device in the system of data of embodiment of the present invention acquisition;
Fig. 3 is the structural schematic diagram of the acquisition equipment in the system of data of embodiment of the present invention acquisition;
Fig. 4 is the structural schematic diagram of another USB device in the system of data of embodiment of the present invention acquisition;
Fig. 5 is the structural schematic diagram of another acquisition equipment in the system of data of embodiment of the present invention acquisition;
Fig. 6 is the process flow diagram flow chart that the embodiment of the present invention acquires devices collect data;
Fig. 7 is the process flow diagram flow chart of data of embodiment of the present invention acquisition;
Fig. 8 is the schematic diagram of USB device data of embodiment of the present invention acquisition method;
Fig. 9 is the schematic diagram that the embodiment of the present invention acquires device data acquisition method.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into It is described in detail to one step, it is clear that described embodiments are only a part of the embodiments of the present invention, rather than whole implementation Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts All other embodiment, shall fall within the protection scope of the present invention.
The embodiment of the present invention is described in further detail with reference to the accompanying drawings of the specification.
In following declarative procedure, first from (Universal Serial Bus, universal serial bus) the equipment side USB and The cooperation implementation of acquisition equipment side is illustrated, and is finally illustrated respectively from the implementation of USB device side and acquisition equipment side, but This is not meant to that the two must cooperate implementation, in fact, also solving when USB device side and acquisition equipment side are performed separately Respectively in the problems of USB device side and acquisition equipment side.When only the two is used in combination, superior technique can be obtained Effect.
As shown in Figure 1, a kind of data collection system provided in an embodiment of the present invention, the system comprises 10 Hes of USB device Acquire equipment 20.
USB device 10, for being linked into acquisition equipment by the USB interface in acquisition equipment, wherein the USB device branch Hold Mass Storage (massage storage) agreement and HID (Human InterfaceDevice, human-computer interaction) agreement;Pass through The quantity information of the logical partition of the USB device is sent to the acquisition equipment by preset first message of HID protocol, so that The acquisition equipment determines the mapping mode of the logical partition of the USB device according to the logical partition quantity information;It receives After preset second message of the HID protocol sent to the acquisition equipment, according to the logic for including in second message Whole logical partitions in the USB device are mapped in acquisition equipment by the mapping mode of subregion.
Equipment 20 is acquired, after determining USB device access, it is preset to receive the HID protocol that the USB device is sent First message, wherein including the quantity information of the logical partition of the USB device in the first message;According to the logical partition Quantity information determine the USB device logical partition mapping mode;Pass through the preset second message notifying institute of HID protocol It states USB device whole logical partitions are mapped in acquisition equipment according to the mapping mode of determining logical partition, described in acquisition Data in the logical partition of USB device.
Wherein, USB device is the equipment for supporting Mass Storage agreement and HID protocol, and the USB device supports Mass Storage agreement refers to USB device when being linked into acquisition equipment, and logical partition of the meeting in acquisition equipment in USB can reflect It penetrates as a mobile hard disk drive or a USB flash disk drive;The USB device supports HID protocol, refers to that USB device does not need Driving can be communicated by the message that HID protocol defines with acquisition equipment, and the message that wherein HID is defined is privately owned message, That is, the type of message, content etc. can be set according to concrete scene, the first report in the embodiment of the present invention Text, the second message, third message belong to the privately owned message defined by HID protocol.
It is also possible to it should be noted that the logical partition in USB device can be storage card built-in in USB device The virtual logical subregion of disk, the flash memory being also possible in USB device in USB device.
As shown in Fig. 2, the logical partition when USB device is SD card (Secure Digital Memory card, safe number Code card) when, the structure drawing of device of USB device, wherein include USB SLAVE (from equipment) module 201, control module 202 with And multiple SD card modules 203, wherein USB SLAVE module 201 is used to connect with USB HOST (main equipment) interface of acquisition equipment It connects, to carry out data interaction by connection.Control module 202 is SOC CPU (System on Chip, system level chip), is used In the overall scheduling of progress.SD module 203 is used for external SD card, the corresponding SD card of each SD module.
As shown in figure 3, a kind of structural schematic diagram for acquiring equipment of the embodiment of the present invention, including acquisition equipment mainboard 301, multiple USB HOST interfaces 302 are connected on the mainboard, it can be with an external USB HUB on each USB HOST interface (hub) expansion board 303, a USB HUB expansion board 303 can external multiple USB devices.
The USB device USB HUB extension external in the USB interface by USB interface or acquisition equipment in acquisition equipment Plate is linked into acquisition equipment, and the USB device can be pre- by HID protocol by the quantity information of the logical partition of the USB device If the first message be sent to the acquisition equipment, wherein the time that the USB device sends the first message, which can be, to be accessed It is sent after acquisition equipment, is also possible to send out after receiving the message of quantity information for the request logical partition that acquisition equipment is sent It send.
Number comprising logical partition in USB device in the quantity information of the logical partition of the USB device, the USB The quantity information of the logical partition of equipment can be the total number of logical partition in USB device, be also possible to every kind of different type Logical partition number, for example, comprising there are three SD card and a disk in the USB device, the wherein logic of disk point Area is 3, then the quantity information of the logical partition of the USB device can be total number 6 of logical partition in USB device, It is also possible to the number of every kind of different types of logical partition, i.e. SD card, 3, disk logical partition 3.
After acquisition equipment receives preset first message of HID protocol that the USB device is sent, determine wherein included The quantity information of the logical partition of the USB device.
The quantity of the logical partition in the quantity information and the acquisition equipment are currently able to the drive number of display The mode that devices collect data is acquired described in relationship affect between mesh, is greater than by the quantity of the logical partition separately below The acquisition equipment is currently able to the drive number shown and the quantity of the logical partition is current no more than the acquisition equipment Two kinds of situations of the drive number that can be shown are illustrated:
Situation one: the quantity of the logical partition is greater than the drive number that the acquisition equipment is currently able to display, described Acquisition equipment determines the USB device using the mapping mode of mapping by several times, wherein the quantity of the logical partition mapped every time is One;
If the quantity of the logical partition is greater than the drive number that the acquisition equipment is currently able to display, the USB is set Standby logical partition cannot be all mapped to together in acquisition equipment, and the acquisition equipment determines the USB device using by several times The mapping mode of mapping, and by USB device described in preset second message notifying of HID protocol in deterministic fashion by logic Subregion is mapped in acquisition equipment.
Wherein, the drive number that the acquisition equipment is currently able to display refers to that the present collection device removing has been shown The drive number that can also be shown after the drive shown, such as general acquisition equipment can show 26 drives altogether, remove itself It is remaining to show drive number after the drive that the drive and other access devices that the logical partition of equipment occupies occupy, than Drive as the logical partition of current equipment of itself occupies is 6, has 8 other equipment to be linked into acquisition equipment at this time, and Comprising there are two logical partition, then the drive number for being currently able to show is exactly 4 (26-6-8*2=in each other equipment 4)。
The USB device determines that the mapping mode for the logical partition for including in second message is the mapping of mapping by several times Mode, the USB device successively map the logical partition of the USB device according to the mapping order of preset logical partition Into acquisition equipment, wherein the quantity of the logical partition mapped every time is one.
The mapping order of the preset logical partition be to the mapping order of logical partition setting in USB device, can be with It according to the mapping order of Random Maps, can also be mapped according to the label of logical partition in USB device, for example, the USB It include 7 SD cards in equipment, every SD card all corresponds to a number in the usb device, and to distinguish different SD cards, number can To be number, it is also possible to letter.
The acquisition equipment is after the logical partition is mapped to acquisition equipment by each USB device, described in acquisition The data in logical partition after the mapping of USB device;The acquisition equipment is in having obtained the logical partition currently mapped After data, determine that then the acquisition equipment passes through if it exists with the presence or absence of the logical partition not mapped in the USB device USB device described in the preset third message notifying of HID protocol maps next logical partition then to be terminated data and adopts if it does not exist The process of collection can also prompt user data acquisition to finish.
The acquisition equipment can patrol after the data for having obtained the logical partition currently mapped every time what is currently mapped It collects subregion to be identified to indicate that mapping and data acquisition is completed in this logical partition, is in the subsequent judgement USB device It is no to there is the logical partition not mapped, it can be determined by the mark of logical partition.
The acquisition equipment can also judge the USB by the serial number of logical partition and the number of logical partition With the presence or absence of the logical partition not mapped in equipment, for example, the USB device includes 7 logical partitions, respectively in order Marked as 1~7, the USB device successively maps from small to large according to label, and acquisition equipment is obtaining the logic point currently mapped After data in area, the logical partition number currently mapped is determined whether less than 7, if being less than, it is determined that presently described USB device It is middle to there is the logical partition not mapped, it is mapped later by USB device described in the preset third message notifying of HID protocol next A logical partition.
The USB device maps next after receiving the preset third message of HID protocol that the acquisition equipment is sent A logical partition.
Situation two: the quantity of the logical partition is currently able to the drive number of display, institute no more than the acquisition equipment Stating acquisition equipment determines the USB device using the mapping mode all mapped.
If the quantity of the logical partition is currently able to the drive number of display, the USB no more than the acquisition equipment The logical partition of equipment can be all mapped to together in acquisition equipment, and the acquisition equipment determines the USB device using complete The mapping mode of portion's mapping, and will be patrolled in deterministic fashion by USB device described in preset second message notifying of HID protocol Subregion is collected to be mapped in acquisition equipment.
USB device determines that the mapping mode for the logical partition for including in second message is the mode all mapped, institute USB device is stated to be mapped to whole logical partitions of the USB device together in acquisition equipment.
As shown in figure 4, carrying out serial number to every SD card from 1~N is to include N number of SD card in the USB device Example, the embodiment of the present invention acquire the flow chart of devices collect data.
Step 401: acquisition equipment determines that USB device accesses;
Step 402: first SD card is mapped in acquisition equipment by acquisition equipment notice USB device;
Step 403: the number N that acquisition equipment passes through SD card in USB device described in the preset Receive message of HID;
Step 404: acquisition equipment obtains the data in the SD card currently mapped;
Step 405: whether the number of the current mapping SD card of acquisition equipment judgement is less than (N+1), thens follow the steps if being less than 406, it is no to then follow the steps 407;
Step 406: acquisition equipment maps next SD card by USB device described in the preset message notifying of HID protocol, returns Return step 404;
Step 407: acquisition device end data acquisition.
As shown in figure 5, the process flow diagram flow chart of data of embodiment of the present invention acquisition, including the following steps:
Step 501:USB equipment is linked into acquisition equipment by the USB interface in acquisition equipment;
Step 502: the USB device by include the USB device logical partition quantity information HID protocol it is pre- If the first message be sent to the acquisition equipment;
Step 503: acquisition equipment receives preset first message of HID protocol that the USB device is sent;
Step 504: the quantity of the logical partition is greater than the drive number that the acquisition equipment is currently able to display, described Acquisition equipment determines the USB device using the mapping mode of mapping by several times, wherein the quantity of the logical partition mapped every time is One;
Step 505: the acquisition equipment sends USB device described in preset second message notifying of HID protocol according to determination The mapping mode of logical partition whole logical partitions are mapped to acquisition equipment;
Step 506: the USB device receives preset second message of the HID protocol that the acquisition equipment is sent;
Step 507: the USB device is according to the mapping order of preset logical partition, successively patrolling the USB device It collects subregion to be mapped in acquisition equipment, wherein the quantity of the logical partition mapped every time is one;
Step 508: the acquisition equipment after the logical partition is mapped to acquisition equipment by each USB device, The data in logical partition after obtaining the mapping of the USB device;
Step 509: the acquisition equipment determines the logical partition for existing in the USB device and not mapping;
Step 510: it is next that the acquisition equipment sends the mapping of USB device described in the preset third message notifying of HID protocol A logical partition.
Step 511: the USB device is after receiving the preset third message of HID protocol that the acquisition equipment is sent Map next logical partition.
Based on the same inventive concept, this discovery embodiment additionally provides a kind of USB device of data acquisition due to the equipment The principle solved the problems, such as is similar to the system that data of the embodiment of the present invention acquire, therefore the implementation of the equipment may refer to method Implement, overlaps will not be repeated.
As shown in fig. 6, a kind of USB device of data acquisition of the embodiment of the present invention, the USB device include AM access module 601, First transmission module 602 and first processing module 603.
AM access module 601, for being linked into acquisition equipment by the USB interface in acquisition equipment, wherein the USB device Support Mass Storage agreement and HID protocol;
First transmission module 602, for passing through preset first message of HID protocol for the logical partition of the USB device Quantity information be sent to the acquisition equipment so that the acquisition equipment according to the logical partition quantity information determine described in The mapping mode of the logical partition of USB device;
First processing module 603, preset second message of the HID protocol sent for receiving the acquisition equipment Afterwards, whole logical partitions in the USB device are reflected according to the mapping mode for the logical partition for including in second message It is mapped in acquisition equipment.
The first processing module 603, is specifically used for:
If the mapping mode for the logical partition for including in second message is the mapping mode of mapping by several times, according to default Logical partition mapping order, successively by the logical partition of the USB device be mapped to acquisition equipment in, wherein every time mapping Logical partition quantity be one;
If the mapping mode for the logical partition for including in second message is the mode all mapped, the USB is set Standby whole logical partitions are mapped to together in acquisition equipment.
The first processing module 603, is also used to:
Next logical partition is mapped after receiving the preset third message of HID protocol that the acquisition equipment is sent.
Based on the same inventive concept, this discovery embodiment additionally provides a kind of acquisition equipment of data acquisition due to the equipment The principle solved the problems, such as is similar to the system that data of the embodiment of the present invention acquire, therefore the implementation of the equipment may refer to method Implement, overlaps will not be repeated.
As shown in fig. 7, a kind of acquisition equipment of data acquisition of the embodiment of the present invention, the acquisition equipment include the second transmission mould Block 701, Second processing module 702 and data acquisition module 703.
Second transmission module 701 receives the HID protocol that the USB device is sent after determining USB device access Preset first message, wherein including the quantity information of the logical partition of the USB device in the first message;
Second processing module 702, for determining the logic point of the USB device according to the quantity information of the logical partition The mapping mode in area;
Data acquisition module 703, for passing through USB device described in preset second message notifying of HID protocol according to determination Logical partition mapping mode by whole logical partitions be mapped to acquisition equipment in, obtain in the USB device map after Data in logical partition.
The Second processing module 702, is specifically used for:
If the quantity of the logical partition be greater than it is described acquisition equipment be currently able to display drive number, determine described in USB device is using the mapping mode mapped by several times, wherein the quantity of the logical partition mapped every time is one, otherwise determines institute USB device is stated using the mapping mode all mapped.
The data acquisition module 703, is specifically used for:
Use the mapping mode of mapping by several times by logic by USB device described in preset second message notifying of HID protocol Subregion is mapped in acquisition equipment, after the logical partition is mapped to acquisition equipment by each USB device, described in acquisition The data in logical partition after being mapped in USB device.
Second transmission module 701, is also used to:
After there is the logical partition not mapped in determining the USB device, pass through the preset third message of HID protocol The USB device is notified to map next logical partition.
Based on the same inventive concept, this discovery embodiment additionally provides a kind of method of data acquisition due to the equipment, method solution Certainly the principle of problem is similar to the system that data of the embodiment of the present invention acquire, therefore the implementation of the equipment may refer to the reality of method It applies, overlaps will not be repeated.
As shown in figure 8, a kind of method of data acquisition of the embodiment of the present invention, this method comprises:
Step 801:USB equipment is linked into acquisition equipment by the USB interface in acquisition equipment, wherein the USB device Support Mass Storage agreement and HID protocol;
Step 802: the USB device passes through preset first message of HID protocol for the logical partition of the USB device Quantity information is sent to the acquisition equipment, so that the acquisition equipment is according to logical partition quantity information determination The mapping mode of the logical partition of USB device;
Step 803: the USB device receives preset second message of the HID protocol that the acquisition equipment is sent Afterwards, whole logical partitions in the USB device are reflected according to the mapping mode for the logical partition for including in second message It is mapped in acquisition equipment.
If the mapping mode for the logical partition for including in second message is the mode of mapping by several times, the USB device According to the mapping order of preset logical partition, successively the logical partition of the USB device is mapped in acquisition equipment, wherein The quantity of the logical partition mapped every time is one;
If the mapping mode for the logical partition for including in second message is the mode all mapped, the USB device Whole logical partitions of the USB device are mapped to together in acquisition equipment.
The USB device maps next after receiving the preset third message of HID protocol that the acquisition equipment is sent A logical partition.
Based on the same inventive concept, this discovery embodiment additionally provides a kind of method of data acquisition due to the equipment, method solution Certainly the principle of problem is similar to the system that data of the embodiment of the present invention acquire, therefore the implementation of the equipment may refer to the reality of method It applies, overlaps will not be repeated.
As shown in figure 9, a kind of method of data acquisition of the embodiment of the present invention, this method comprises:
Step 901: after acquisition equipment determines USB device access, it is default to receive the HID protocol that the USB device is sent The first message, wherein including the quantity information of the logical partition of the USB device in the first message;
Step 902: acquisition equipment determines the logical partition of the USB device according to the quantity information of the logical partition Mapping mode;
Step 903: acquisition equipment is patrolled by USB device described in preset second message notifying of HID protocol according to determining Whole logical partitions are mapped in acquisition equipment by the mapping mode for collecting subregion, obtain the logic after mapping in the USB device Data in subregion.
If the quantity of the logical partition is greater than the drive number that the acquisition equipment is currently able to display, the acquisition is set It is standby to determine the USB device using the mapping mode of mapping by several times, wherein the quantity of the logical partition mapped every time is one, Otherwise the acquisition equipment determines the USB device using the mapping mode all mapped.
The acquisition equipment reflecting using mapping by several times by USB device described in preset second message notifying of HID protocol It penetrates mode logical partition is mapped in acquisition equipment, the acquisition equipment is in the USB device every time by the logical partition After being mapped to acquisition equipment, the data in the logical partition after mapping in the USB device are obtained.
It is pre- by HID protocol after the acquisition equipment has the logical partition not mapped in determining the USB device If third message notifying described in USB device map next logical partition.
Above by reference to showing according to the method, apparatus (system) of the embodiment of the present application and/or the frame of computer program product Figure and/or flow chart describe the application.It should be understood that can realize that block diagram and or flow chart is shown by computer program instructions The combination of the block of a block and block diagram and or flow chart diagram for figure.These computer program instructions can be supplied to logical With computer, the processor of special purpose computer and/or other programmable data processing units, to generate machine, so that via meter The instruction that calculation machine processor and/or other programmable data processing units execute creates for realizing block diagram and or flow chart block In specified function action method.
Correspondingly, the application can also be implemented with hardware and/or software (including firmware, resident software, microcode etc.).More Further, the application can take computer usable or the shape of the computer program product on computer readable storage medium Formula has the computer realized in the medium usable or computer readable program code, to be made by instruction execution system It is used with or in conjunction with instruction execution system.In the present context, computer can be used or computer-readable medium can be with It is arbitrary medium, may include, stores, communicates, transmits or transmit program, is made by instruction execution system, device or equipment With, or instruction execution system, device or equipment is combined to use.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of method of data acquisition, which is characterized in that this method comprises:
General-purpose serial bus USB equipment is linked into acquisition equipment by the USB interface in acquisition equipment, wherein the USB device Support massage storage Mass Storage agreement and human-computer interaction HID protocol;
The USB device is sent the quantity information of the logical partition of the USB device by preset first message of HID protocol To the acquisition equipment, so that the acquisition equipment determines patrolling for the USB device according to the quantity information of the logical partition Collect the mapping mode of subregion;
After the USB device receives preset second message of the HID protocol that the acquisition equipment is sent, if described second The mapping mode for the logical partition for including in message is the mode of mapping by several times, and the USB device is according to preset logical partition Mapping order, successively by the logical partition of the USB device be mapped to acquisition equipment in, wherein the logical partition mapped every time Quantity be one;
If the mapping mode for the logical partition for including in second message is the mode all mapped, the USB device is by institute The whole logical partitions for stating USB device are mapped to together in acquisition equipment.
2. the method as described in claim 1, which is characterized in that the USB device is suitable according to the mapping of preset logical partition The logical partition of the USB device is mapped in acquisition equipment by sequence several times, further includes:
The USB device maps next patrol after receiving the preset third message of HID protocol that the acquisition equipment is sent Collect subregion.
3. a kind of method of data acquisition, which is characterized in that this method comprises:
After acquisition equipment determines USB device access, preset first message of HID protocol that the USB device is sent is received, In include in the first message the USB device logical partition quantity information;
If the quantity of the logical partition is greater than the drive number that the acquisition equipment is currently able to display, the acquisition equipment is true The fixed USB device is using the mapping mode mapped by several times, wherein the quantity of the logical partition mapped every time is one, otherwise The acquisition equipment determines the USB device using the mapping mode all mapped;
The acquisition equipment is by USB device described in preset second message notifying of HID protocol according to determining logical partition Whole logical partitions are mapped in acquisition equipment by mapping mode, are obtained in the logical partition after mapping in the USB device Data.
4. method as claimed in claim 3, which is characterized in that the acquisition equipment passes through preset second message of HID protocol It notifies the USB device that whole logical partitions are mapped in acquisition equipment in deterministic fashion, obtains in the USB device The data in logical partition after mapping, comprising:
The acquisition equipment is by USB device described in preset second message notifying of HID protocol using the mapping side of mapping by several times Logical partition is mapped in acquisition equipment by formula, and the acquisition equipment maps the logical partition in each USB device To after acquisition equipment, the data in the logical partition after mapping in the USB device are obtained.
5. method as claimed in claim 4, which is characterized in that the acquisition equipment is patrolled in each USB device by described After volume subregion is mapped to the acquisition equipment, after obtaining the data in the logical partition of the USB device, further includes:
It is preset by HID protocol after the acquisition equipment has the logical partition not mapped in determining the USB device USB device described in third message notifying maps next logical partition.
6. a kind of USB device of data acquisition, which is characterized in that the USB device includes:
AM access module, for being linked into acquisition equipment by the USB interface in acquisition equipment, wherein the USB device is supported Mass Storage agreement and HID protocol;
First transmission module, for being believed the quantity of the logical partition of the USB device by preset first message of HID protocol Breath is sent to the acquisition equipment, so that the acquisition equipment determines that the USB is set according to the information of the logical partition quantity The mapping mode of standby logical partition;
First processing module, after receiving preset second message of the HID protocol that the acquisition equipment is sent, if institute The mapping mode for stating the logical partition for including in the second message is the mode of mapping by several times, according to the mapping of preset logical partition Sequentially, successively the logical partition of the USB device is mapped in acquisition equipment, wherein the quantity of the logical partition mapped every time It is one;
If the mapping mode for the logical partition for including in second message is the mode all mapped, by the USB device Whole logical partitions are mapped to together in acquisition equipment.
7. USB device as claimed in claim 6, which is characterized in that the first processing module is also used to:
Next logical partition is mapped after receiving the preset third message of HID protocol that the acquisition equipment is sent.
8. a kind of acquisition equipment of data acquisition, which is characterized in that the acquisition equipment includes:
Second transmission module receives HID protocol that the USB device is sent preset the after determining USB device access One message, wherein including the quantity information of the logical partition of the USB device in the first message;
Second processing module, if the quantity for the logical partition is greater than the drive number that the acquisition equipment is currently able to display Mesh determines the USB device using the mapping mode of mapping by several times, wherein the quantity of the logical partition mapped every time is one, Otherwise determine the USB device using the mapping mode all mapped together;
Data acquisition module, for being divided by USB device described in preset second message notifying of HID protocol according to determining logic Whole logical partitions are mapped in acquisition equipment by the mapping mode in area, obtain the logical partition after mapping in the USB device In data.
9. acquisition equipment as claimed in claim 8, which is characterized in that the data acquisition module is specifically used for:
Use the mapping mode of mapping by several times by logical partition by USB device described in preset second message notifying of HID protocol It is mapped in acquisition equipment, after the logical partition is mapped to acquisition equipment by each USB device, obtains the USB The data in logical partition after being mapped in equipment.
10. acquisition equipment as claimed in claim 9, which is characterized in that second transmission module is also used to:
After there is the logical partition not mapped in determining the USB device, pass through the preset third message notifying of HID protocol The USB device maps next logical partition.
CN201710840668.0A 2017-09-18 2017-09-18 A kind of method and apparatus of data acquisition Active CN107656890B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710840668.0A CN107656890B (en) 2017-09-18 2017-09-18 A kind of method and apparatus of data acquisition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710840668.0A CN107656890B (en) 2017-09-18 2017-09-18 A kind of method and apparatus of data acquisition

Publications (2)

Publication Number Publication Date
CN107656890A CN107656890A (en) 2018-02-02
CN107656890B true CN107656890B (en) 2019-11-19

Family

ID=61130600

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710840668.0A Active CN107656890B (en) 2017-09-18 2017-09-18 A kind of method and apparatus of data acquisition

Country Status (1)

Country Link
CN (1) CN107656890B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140552A (en) * 2007-10-30 2008-03-12 江松 Control system of data-transmission through universal serial bus and method thereof
CN101615106A (en) * 2008-06-23 2009-12-30 国际商业机器公司 The method and system that is used for virtualizing SAS storage adapter
CN105892930A (en) * 2014-05-12 2016-08-24 北京同方微电子有限公司 High capacity USIM mass memory subarea mount realizing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9680712B2 (en) * 2014-07-01 2017-06-13 American Megatrends, Inc. Hardware management and control of computer components through physical layout diagrams

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101140552A (en) * 2007-10-30 2008-03-12 江松 Control system of data-transmission through universal serial bus and method thereof
CN101615106A (en) * 2008-06-23 2009-12-30 国际商业机器公司 The method and system that is used for virtualizing SAS storage adapter
CN105892930A (en) * 2014-05-12 2016-08-24 北京同方微电子有限公司 High capacity USIM mass memory subarea mount realizing method

Also Published As

Publication number Publication date
CN107656890A (en) 2018-02-02

Similar Documents

Publication Publication Date Title
CN109766302B (en) Method and device for managing equipment
US8141093B2 (en) Management of an IOV adapter through a virtual intermediary in an IOV management partition
CN105335548B (en) A kind of MCU emulation mode for ICE
CN107491354B (en) Shared memory-based communication method and device between virtual machines
CN109309631A (en) A kind of method and device based on universal network file system write-in data
US8566416B2 (en) Method and system for accessing storage device
CN104298535B (en) Extended read-only memory management system, method and management host thereof
CN105302248A (en) Chip set and server system
CN103176913B (en) Hard disk method for mapping dynamically and the server applying it
CN111901164A (en) Adaptive control method, device, equipment and system for OCP NIC network card
CN105527878A (en) Data acquisition method, data acquisition device and data acquisition and debugging system
CN112395152A (en) Server resource monitoring method and device
CN104915302B (en) Data transmission processing method and data link
CN105786732B (en) Data access method and device
CN107656890B (en) A kind of method and apparatus of data acquisition
CN109375874A (en) A kind of call method of distributed storage, device and equipment
CN204044694U (en) A kind of low cost expanded type GPU blade server
CN116302141B (en) Serial port switching method, chip and serial port switching system
CN110515540B (en) Method and device for topology of hard disk
CN109039765B (en) Network configuration method and device
CN108008908A (en) The method and apparatus of data in a kind of management and control SD card
CN112948300B (en) Server, integrated storage and calculation device, and server system
CN103885813B (en) Packet capturing method in virtual machine environment
CN107302473B (en) High-frequency data transmission pressure testing method and system
CN101937407B (en) Passive hardware device access method and 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
GR01 Patent grant
GR01 Patent grant