CN113867625A - Communication method, device, equipment and medium for non-inductive drive-free equipment - Google Patents

Communication method, device, equipment and medium for non-inductive drive-free equipment Download PDF

Info

Publication number
CN113867625A
CN113867625A CN202110995070.5A CN202110995070A CN113867625A CN 113867625 A CN113867625 A CN 113867625A CN 202110995070 A CN202110995070 A CN 202110995070A CN 113867625 A CN113867625 A CN 113867625A
Authority
CN
China
Prior art keywords
data
terminal equipment
fifo queue
queue cache
communication
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
CN202110995070.5A
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.)
Fujian Centerm Information Co Ltd
Original Assignee
Fujian Centerm Information 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 Fujian Centerm Information Co Ltd filed Critical Fujian Centerm Information Co Ltd
Priority to CN202110995070.5A priority Critical patent/CN113867625A/en
Publication of CN113867625A publication Critical patent/CN113867625A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0664Virtualisation aspects at device level, e.g. emulation of a storage device or system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/06Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor
    • G06F5/065Partitioned buffers, e.g. allowing multiple independent queues, bidirectional FIFO's

Abstract

The invention provides a communication method, a device, equipment and a medium for non-inductive drive-free equipment, wherein the method comprises the following steps: connecting the terminal equipment in a non-inductive way, namely virtualizing the terminal equipment into a magnetic disk in a non-standard format, so that windows cannot be loaded normally, and a disk identifier cannot be added; the data communication of the non-standard formatted disk is realized, namely, the non-standard SCSI read-write command is customized in a driver of the terminal equipment and a transceiver of the office upper computer in advance, and the non-standard SCSI read-write command is adopted for data communication between the terminal equipment and the office upper computer. On the basis of virtualizing the terminal equipment into the massstorage large-capacity storage equipment conventionally, the invention does not generate the disk symbol to cause the perception to the user, realizes the data communication of the non-standard formatted disk and improves the safety of the data communication.

Description

Communication method, device, equipment and medium for non-inductive drive-free equipment
Technical Field
The invention relates to the technical field of computers, in particular to a communication method, a device, equipment and a medium of USB non-inductive drive-free equipment between terminal equipment and an office upper computer.
Background
With the rapid development of terminal equipment and the great popularization of environmental protection concepts, more and more mechanisms are popularizing paperless office demands in a large range, improving business efficiency and reducing energy consumption. For banks or security institutions, it is a normal state that data transmission is completed by connecting and communicating a terminal device and an office upper computer through a USB cable, as shown in fig. 1, a communication diagram is shown in which the terminal device and the office upper computer are connected through a USB cable.
At present, a standard mass storage device communication model is generally adopted for USB data communication between a terminal device and an office host computer, as shown in fig. 2, the standard mass storage device communication model is used, the terminal device virtualizes itself into a mass storage device to be connected to the office host computer, which is equivalent to virtualizing a small block of its own storage medium emmc (nand flash) into a USB disk to be inserted into the computer, and a disk identifier is added to the computer under normal conditions. In this case, data interaction is normally performed between the terminal device and the upper computer by reading and writing the disk, and as shown in fig. 3, a flow path of the USB data in the terminal device is composed of four parts, namely, a USB hardware controller, a kernel space, a virtual mass storage block (located in the storage medium), and an application space. It is also clear that such drawbacks, on the one hand, can interfere with office use and, on the other hand, data security is not guaranteed, which is absolutely unacceptable, in particular for banks or security clients. Meanwhile, the organization needs to ensure the safety of user data and enterprise data at the same time, so the drive-free USB mode is mostly adopted to connect external terminal equipment.
At present, all large terminal manufacturers adopt the most effective and safe USB drive-free mode, and basically adopt an HID communication mode to report the terminal equipment attribute to an office host computer. The HID adopts a USB interrupt communication mode, and the communication mode needs a USB controller of a host of an office host computer to reserve certain reserved bandwidth for access equipment. There are significant disadvantages to this approach:
1. the data volume of different service types is greatly different, some video graphic data transmission needs to occupy high bandwidth in order to improve the transmission speed, and some basic services such as key evaluation services only need to occupy the lowest bandwidth because the transmission data volume is very small, so that various manufacturers generally apply for occupying the bandwidth as much as possible in order to ensure the transmission efficiency and the advantage of own equipment;
2. in the last few years, integrated services terminal devices are not common, but with the progressive demand and the updating of technology, more and more types of terminal devices are on the market. At present, a plurality of service terminals with different functions are connected to an office upper computer of one staff often seen in an organization. Under the condition, a plurality of terminal devices can easily occupy the USB bandwidth resource, so that the device works abnormally;
3. office equipment of some organizations is updated slowly, office upper computer computers used are old, systems are also very old, the situation that a USB controller is not compatible with the HID high-bandwidth communication mode of the current new terminal can occur, and HID low-bandwidth version equipment which is specially needed needs to be issued for the organization network points.
In order to overcome the defects of communication between the manufacturer terminal equipment and the office. Such as:
1. and negotiating with the organization, and enabling the service terminal to perform data communication with the organization office upper computer in a non-drive-free mode, for example, changing the HID mode into the ADB mode or the MassStorage mode for communication, under the condition, data can not be transmitted and received through USB interrupt transmission, bandwidth does not need to be reserved by a USB controller of the organization office upper computer, and the condition of multi-terminal bandwidth resource preemption can not occur. However, these approaches either require the installation of customized drivers on the office host computer of the client, or create an external drive letter in the client computer, and the organization is not easy to accept these non-drive-free or perceptible changes from the security point of view;
2. aiming at some organization network points with problems, a special software updating service terminal system is provided, and the USB reserved bandwidth applied by the HID is reduced. Although the method can satisfactorily solve the customer problem, technicians are required to debug different software versions for different office upper computer computers of different institutions, so that the pressure of disordered version control, low development efficiency, high business trip cost and the like easily occurs.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a communication method, apparatus, device and medium for a non-inductive drive-free device, which do not generate a disk identifier to cause perception to a user on the basis of virtualizing a terminal device into a mass storage large-capacity storage device conventionally, and implement data communication of a non-standard formatted disk, thereby improving the security of data communication.
In a first aspect, the present invention provides a communication method for a non-inductive drive-free device, including:
connecting the terminal equipment in a non-inductive way, namely virtualizing the terminal equipment into a magnetic disk in a non-standard format, so that windows cannot be loaded normally, and a disk identifier cannot be added;
the data communication of the non-standard formatted disk is realized, namely, the non-standard SCSI read-write command is customized in a driver of the terminal equipment and a transceiver of the office upper computer in advance, and the non-standard SCSI read-write command is adopted for data communication between the terminal equipment and the office upper computer.
In a second aspect, the present invention provides a communication device for a non-inductive drive-free device, including:
the non-inductive connection terminal equipment module is used for virtualizing the terminal equipment into a non-standard formatted magnetic disk, so that windows cannot be loaded normally, and a disk identifier cannot be added;
the user-defined non-standard SCSI read-write command module is used for pre-defining the non-standard SCSI read-write command in a driving program of the terminal equipment and a receiving and sending program of the office upper computer;
and the data communication module is used for realizing data communication between the terminal equipment and the upper office computer by adopting the non-standard SCSI reading and writing command.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of the first aspect when executing the program.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
1. the terminal equipment is virtualized into a non-standard formatted disk, namely mass storage equipment, so that windows cannot be loaded normally and a new disk identifier cannot be added, all windows computers do not need to additionally install a driving program for the mass storage equipment, plug and play are realized, and the non-inductive connection of the terminal equipment is realized;
2. the non-standard SCSI reading and writing commands are customized in a driver of the terminal equipment and a transceiving program of the office upper computer in advance, and the non-standard SCSI reading and writing commands are adopted between the terminal equipment and the office upper computer for data communication, so that the data communication of a non-standard formatted disk is realized, and the safety of the data communication is greatly improved;
3. the communication isolation storage medium is used for directly transferring data in a ddr memory of the terminal equipment without passing through an emmc (nand flash) storage medium of the terminal equipment, so that the bottleneck caused by the transmission speed limitation of the emmc (nand flash) storage medium is avoided, and high-speed transmission can be realized;
4. double caching: in the ddr memory, two groups of in and out cache queues are developed, different data which are uploaded to an office computer by a terminal and are issued to terminal equipment by the office computer are processed respectively, the data can be transmitted simultaneously, the data are not interfered with each other and can be multiplexed in time, and the transmission speed is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a system framework formed by connecting a conventional terminal device and an office upper computer through a USB data cable;
FIG. 2 is a state diagram of a conventional mass storage device generating a disk signature;
FIG. 3 is a schematic diagram of a communication model of a conventional standard mass storage device;
FIG. 4 is a diagram illustrating a method according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a state where windows of a public host cannot be loaded normally without adding a new drive letter in an embodiment of the present invention;
fig. 6 is a schematic diagram of a flow path of USB data in a terminal device according to an embodiment of the present invention;
FIG. 7 is a flowchart illustrating a communication process from a terminal device to an office host according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating a communication process of data from an office host to a terminal device according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating read and write commands of a conventional standard SCSI;
fig. 10 is a schematic view of a communication state when a terminal device uploads data according to an embodiment of the present invention;
FIG. 11 is a diagram illustrating a communication status of the office host computer during data downloading according to an embodiment of the present invention;
FIG. 12 is a diagram illustrating a state of a debugging office host computer querying terminal device data according to an embodiment of the present invention;
FIG. 13 is a schematic structural diagram of an apparatus according to a second embodiment of the present invention;
fig. 14 is a schematic structural diagram of an electronic device according to a third embodiment of the invention;
fig. 15 is a schematic structural diagram of a medium according to a fourth embodiment of the present invention.
Detailed Description
The embodiment of the application provides a method for virtualizing the terminal equipment into mass storage large-capacity storage equipment in a conventional manner, does not generate a disk symbol to cause perception to a user, realizes data communication of a non-standard formatted disk, and improves the safety of data communication.
The technical scheme in the embodiment of the application has the following general idea: on the basis of the conventional virtualization of the terminal equipment as a mass storage device, the storage medium limitation of the terminal equipment is bypassed, and a data transmission path is re-planned to improve the transmission speed and the safety, and meanwhile, a drive letter is not generated to cause perception to a user. The method comprises the following steps: 1. drive-free: all windows computers do not need to additionally install a driver program for mass storage equipment, and the windows computers can be used in a plug-and-play mode. 2. No sense: the drive letter can not be newly added in the system, and the office computer user can not perceive the drive letter. 3. High-speed transmission: data transmission does not pass through an emmc (nand flash) storage medium of the terminal equipment, and is directly transferred and stored in a ddr memory of the terminal equipment, so that the bottleneck caused by the limitation of the transmission speed of the emmc (nand flash) storage medium is avoided. 4. Double caching: in the ddr memory, two groups of in and out cache queues are opened up, different data which are uploaded to an office computer by a terminal and are issued to terminal equipment by the office computer are processed respectively, and the in and out cache queues are not interfered with each other and can be multiplexed in time.
Example one
As shown in fig. 4, the present embodiment provides a communication method of a non-inductive drive-free device, including:
connecting the terminal equipment in a non-inductive manner, namely virtualizing the terminal equipment into a magnetic disk in a non-standard format, as shown in fig. 5, so that windows cannot be loaded normally, and a drive letter cannot be added;
the data communication of the non-standard formatted disk is realized, namely, the non-standard SCSI read-write command is customized in a driver of the terminal equipment and a transceiver of the office upper computer in advance, and the non-standard SCSI read-write command is adopted for data communication between the terminal equipment and the office upper computer. A new problem is brought about simultaneously by the noninductive connection of the terminal equipment: the disk can not be identified by windows, data communication can not be carried out through a standard windows disk read-write interface, and the mass storage device communication follows the SCSI protocol, so that the invention adopts a mode of self-defining SCSI protocol commands to transmit data.
As a more preferred or more specific implementation manner of this embodiment, the method of this embodiment further includes the following features:
the communication isolation storage medium bypasses the storage medium during data transmission between the terminal equipment and the office upper computer and directly caches the received and transmitted data in the memory;
the data is transmitted and received by using double buffers, namely two FIFO queue buffers which are independent of each other are opened in the kernel space of the terminal equipment and are respectively used for uploading data and downloading data.
As shown in fig. 3, the transmission path of the communication data of the communication model of the existing standard mass storage device is as follows: when the upper computer sends data to the terminal equipment through the USB line, in the terminal equipment, the bottom layer driving program obtains the USB data and writes the USB data into the storage medium for unloading, and the upper layer application program needs to obtain the transmitted USB data and also needs to read the data stored in the storage medium before through the bottom layer driving program. Thus, in a single data receiving process, the storage medium needs to be operated twice as soon as writing and reading are performed. Conversely, the terminal device sends data to the upper computer, and the storage medium needs to be operated twice after writing and reading, which is not described herein.
Most storage media used in banks or security institutions at present are flash memory particles such as nand flash, the transmission speed is high (such as slc particles) and low (such as mlc particles) and can reach dozens of megabits per second, and the service life is consumed quickly due to frequent reading and writing. In addition, the flash memory particles are used for nonvolatile storage, data are still on the chip after power failure, and the whole chip is detached and has a chance to read the data, so that the hidden danger of information leakage exists. In summary, in the mass storage standard communication architecture, the storage medium needs to be used, and this method has three major drawbacks: low speed, short service life and hidden information leakage. In order to solve the above problems, in the transmission method of this embodiment, the storage medium is bypassed, the data is directly cached in the memory for transceiving, and the memory ddr is volatile storage, so that the data is emptied after power failure, the data cannot be read through the chip, and the data security is also highly guaranteed. As shown in fig. 6, the flow path of the USB data in the terminal device is composed of three parts, namely, a USB hardware controller, a kernel space, and an application space, and bypasses the virtual mass storage block on the storage medium.
When the terminal equipment and the office upper computer are connected through the USB data line and then carry out USB data transmission, the USB data transmission method comprises a process of transmitting data from the terminal equipment to the office upper computer and a process of transmitting data from the office upper computer to the terminal equipment.
As shown in fig. 7, the process of the data from the terminal device to the upper office computer includes:
the terminal equipment process: sending data by a terminal equipment application program, inquiring whether the In FIFO queue cache is full, if so, entering blocking waiting, and if not, writing data into the In FIFO queue cache through the SCSI read-write command;
an office upper computer process: the office upper computer tries to read USB data, inquires whether the In FIFO queue cache is empty, if so, the operation is finished, and otherwise, the data cached In the In FIFO queue are read through the SCSI reading and writing command;
as shown in fig. 8, the process of the data from the office host computer to the terminal device includes:
the terminal equipment process: a terminal device application program reads data and inquires whether the Out FIFO queue cache is empty or not, if so, the blocking waiting is carried Out, and if not, the data are read from the Out FIFO queue cache through the SCSI reading and writing command;
an office upper computer process: and the office upper computer tries to send USB data, inquires whether the Out FIFO queue cache is full, if so, the process is finished, and otherwise, data are issued to the Out FIFO queue cache through the SCSI reading and writing command.
As shown in FIG. 9, the read and write commands are standard SCSI, where the read command is 0x28 and the write command is 0x 2A. In this embodiment, referring to this way, we need to customize new read/write commands simultaneously in the driver of the terminal device and the transceiver of the upper computer office computer, that is: the non-standard SCSI read-write commands comprise a read command 0xC8, a write command 0xCA and a query command 0 xCC;
the terminal device driver realizes that the processing branch of the read command 0xC8 is as follows:
Figure BDA0003233558110000071
Figure BDA0003233558110000081
the terminal device driver realizes that the processing branch of the write command 0xCA is as follows:
Figure BDA0003233558110000082
the terminal device driver realizes that the processing branch of the query command 0xCC is as follows:
Figure BDA0003233558110000083
to verify the effect of this embodiment, the following example describes the communication result between the terminal device (denoted as a10) and the office host computer (denoted as PC) in detail as follows:
(1) and (3) brushing the machine:
burning kernel, boot, parameter in the firmware by using terminal equipment A10; pushing the store.img to the position of/data/store.img by using an adb tool; and executing mount partitions after starting the system: echo/data/storage. img >/sys/devices/platform/usb20_ otg/gadget/lun 0/file; for convenience of debugging, the method of simultaneously opening the mass _ storage function and the adb function is as follows:
echo 0>/sys/class/android_usb/android0/enable
echo 2f46>/sys/class/android _ usb/android0/idVendor (where vid of A10 is set, it can be customized)
echo bf16>/sys/class/android _ usb/android0/idProduct (where pid of A10 is set, it can be customized)
echo mass_storage,adb>/sys/class/android_usb/android0/functions
echo 1>/sys/class/android_usb/android0/enable
start adbd
setprop sys.usb.config mass_storage,adb
setprop sys.usb.state mass_storage,adb
(2) Debug PC sends data to A10
Opening a Devices page in a bushed of a PC side tool; double clicking the rockchip _ usb disk device, and opening the SCSI control panel; fill SCSI commands, using custom 0 xCANCENTER _ WRITE (10) commands, and fill 0x00000000 disk offset, specifying the use of 0x0080 disk sectors (65536 bytes, 64 k); fill out data length 65536, which must be the same size as bit7 bit8 sector in CDB, currently 0x0080 × 512 ═ 65536 bytes; selecting outtodevice in the data direction; compiling data to be sent; clicking a run button, and sending data from the PC to an A10 kernel; meanwhile, dd tools are always blocking, when the outfifo queue has a data size greater than a certain value (4096 bytes by default, the size can be set manually, or can be changed to a self-adaptive size); img drags out the data file test _ out with adb to see, and the result is as shown in fig. 10, which is consistent with bushed sent data.
(3) Debug A10 send data, PC grab
Compiling a data file send _ in.img required by uploading the PC; pushing the document into the a10 device with the adb tool; and sending the send _ in.img file to the mass _ storage device node by using the dd tool. Since the usb req buffer opened in kernel has a size of 16384 bytes, the top lattice also sends data with bs per packet being 16384, and the data is written into the in fifo queue buffer. Opening a bushond tool, and selecting a Devices page; double clicking the rockchip _ usb disk device, and opening the SCSI control panel; fill in SCSI commands, using custom 0xC8 CENTERM _ READ (10) command, and fill in 0x00000000 disk offset, specifying the use of 0x0080 disk sectors (65536 bytes, 64 k); fill out data length 65536, which must be the same size as bit7 bit8 sector in CDB, currently 0x0080 × 512 ═ 65536 bytes; selecting an inpc for the data direction; clicking the run button, the PC will take the data from the in fifo queue in batches, up to 16384 bytes each time (usb req's buffer configuration size); as shown in fig. 11, the data received in the bushed tool is checked, and is consistent with the send _ in.
(4) Debug PC query A10 data State:
because data receiving and sending are all initiated by bushed in a unidirectional mode at the PC end, two fifo data states in a kernel need to be polled and inquired at regular time, the CENTERM _ INQUIRY0xCC self-defined command is added: filling in a 0xcc self-defining command, wherein the length of data (the number of sectors is not the number of sectors, namely the length of the data) required to be acquired by writing the bit4 is consistent with the length of a data area of data length; clicking a run button to acquire information, wherein the first 4 bits are the data length of in fifo, and the last 4 bits are the data length of out fifo; it can be queried, as shown in FIG. 12, that it is consistent with the information in the kernel.
Therefore, the self-defined SCSI command communication processing flow between the interrupt device and the upstream and downstream of the upper computer is completed, the two parties can use the non-standard formatted disk as a medium to carry out data communication by using the self-defined command, and the data format is non-standard due to the self-defined command, so that the safety is improved.
Based on the same inventive concept, the application also provides a device corresponding to the method in the first embodiment, which is detailed in the second embodiment.
Example two
As shown in fig. 11, in this embodiment, a communication device of a non-inductive drive-free device is provided, which includes:
the non-inductive connection terminal equipment module is used for virtualizing the terminal equipment into a non-standard formatted magnetic disk, so that windows cannot be loaded normally, and a disk identifier cannot be added;
the user-defined non-standard SCSI read-write command module is used for pre-defining the non-standard SCSI read-write command in a driving program of the terminal equipment and a receiving and sending program of the office upper computer;
and the data communication module is used for realizing data communication between the terminal equipment and the upper office computer by adopting the non-standard SCSI reading and writing command.
This is because the non-inductive connection terminal device brings a new problem at the same time: the disk can not be identified by windows, data communication can not be carried out through a standard windows disk read-write interface, and the mass storage device communication follows the SCSI protocol, so that the invention adopts a mode of self-defining SCSI protocol commands to transmit data.
As a more preferred or specific implementation manner of this embodiment, the apparatus further includes:
the communication isolation storage medium module is used for bypassing the storage medium during data transmission between the terminal equipment and the office upper computer and directly caching the received and transmitted data in the memory;
the double-buffer data receiving and transmitting module is used for opening two FIFO queue buffers which are independent from each other in the kernel space of the terminal equipment and are respectively used for uploading data and downloading data.
As shown in fig. 3, the transmission path of the communication data of the communication model of the existing standard mass storage device is as follows: when the upper computer sends data to the terminal equipment through the USB line, in the terminal equipment, the bottom layer driving program obtains the USB data and writes the USB data into the storage medium for unloading, and the upper layer application program needs to obtain the transmitted USB data and also needs to read the data stored in the storage medium before through the bottom layer driving program. Thus, in a single data receiving process, the storage medium needs to be operated twice as soon as writing and reading are performed. Conversely, the terminal device sends data to the upper computer, and the storage medium needs to be operated twice after writing and reading, which is not described herein.
Most storage media used in banks or security institutions at present are flash memory particles such as nand flash, the transmission speed is high (such as slc particles) and low (such as mlc particles) and can reach dozens of megabits per second, and the service life is consumed quickly due to frequent reading and writing. In addition, the flash memory particles are used for nonvolatile storage, data are still on the chip after power failure, and the whole chip is detached and has a chance to read the data, so that the hidden danger of information leakage exists. In summary, in the mass storage standard communication architecture, the storage medium needs to be used, and this method has three major drawbacks: low speed, short service life and hidden information leakage. In order to solve the above problems, in the transmission method of this embodiment, the storage medium is bypassed, the data is directly cached in the memory for transceiving, and the memory ddr is volatile storage, so that the data is emptied after power failure, the data cannot be read through the chip, and the data security is also highly guaranteed. As shown in fig. 6, the flow path of the USB data in the terminal device is composed of three parts, namely, a USB hardware controller, a kernel space, and an application space, and bypasses the virtual mass storage block on the storage medium.
When the terminal equipment and the office upper computer are connected through the USB data line and then carry out USB data transmission, the USB data transmission method comprises a process of transmitting data from the terminal equipment to the office upper computer and a process of transmitting data from the office upper computer to the terminal equipment.
As shown in fig. 7, the process of uploading data, that is, data from the terminal device to the upper office computer, is specifically divided into a terminal device process and an upper office computer process:
the terminal equipment process: sending data by a terminal equipment application program, inquiring whether the In FIFO queue cache is full, if so, entering blocking waiting, and if not, writing data into the In FIFO queue cache through the SCSI read-write command;
an office upper computer process: the office upper computer tries to read USB data, inquires whether the In FIFO queue cache is empty, if so, the operation is finished, and otherwise, the data cached In the In FIFO queue are read through the SCSI reading and writing command;
as shown in fig. 8, the process of downloading data, that is, data from an office upper computer to a terminal device, is specifically divided into a terminal device process and an office upper computer process:
the terminal equipment process: a terminal device application program reads data and inquires whether the Out FIFO queue cache is empty or not, if so, the blocking waiting is carried Out, and if not, the data are read from the Out FIFO queue cache through the SCSI reading and writing command;
an office upper computer process: and the office upper computer tries to send USB data, inquires whether the Out FIFO queue cache is full, if so, the process is finished, and otherwise, data are issued to the Out FIFO queue cache through the SCSI reading and writing command.
As shown in FIG. 9, the read and write commands are standard SCSI, where the read command is 0x28 and the write command is 0x 2A. In this embodiment, referring to this way, we need to customize new read/write commands simultaneously in the driver of the terminal device and the transceiver of the upper computer office computer, that is: the non-standard SCSI read-write commands comprise a read command 0xC8, a write command 0xCA and a query command 0 xCC;
the terminal device driver realizes that the processing branch of the read command 0xC8 is as follows:
Figure BDA0003233558110000131
the terminal device driver realizes that the processing branch of the write command 0xCA is as follows:
Figure BDA0003233558110000132
the terminal device driver realizes that the processing branch of the query command 0xCC is as follows:
Figure BDA0003233558110000133
Figure BDA0003233558110000141
to verify the effect of this embodiment, the following example describes the communication result between the terminal device (denoted as a10) and the office host computer (denoted as PC) in detail as follows:
(1) and (3) brushing the machine:
burning kernel, boot, parameter in the firmware by A101.6 equipment; pushing the store.img to the position of/data/store.img by using an adb tool; and executing mount partitions after starting the system: echo/data/storage. img >/sys/devices/platform/usb20_ otg/gadget/lun 0/file; for convenience of debugging, the method of simultaneously opening the mass _ storage function and the adb function is as follows:
echo 0>/sys/class/android_usb/android0/enable
echo 2f46>/sys/class/android _ usb/android0/idVendor (where vid of A10 is set, it can be customized)
echo bf16>/sys/class/android _ usb/android0/idProduct (where pid of A10 is set, it can be customized)
echo mass_storage,adb>/sys/class/android_usb/android0/functions
echo 1>/sys/class/android_usb/android0/enable
start adbd
setprop sys.usb.config mass_storage,adb
setprop sys.usb.state mass_storage,adb
(2) Debug PC sends data to A10
Opening a Devices page in a bushed of a PC side tool; double clicking the rockchip _ usb disk device, and opening the SCSI control panel; fill SCSI commands, using custom 0 xCANCENTER _ WRITE (10) commands, and fill 0x00000000 disk offset, specifying the use of 0x0080 disk sectors (65536 bytes, 64 k); fill out data length 65536, which must be the same size as bit7 bit8 sector in CDB, currently 0x0080 × 512 ═ 65536 bytes; data direction selection out to device; compiling data to be sent; clicking a run button, and sending data from the PC to an A10 kernel; meanwhile, dd tools are always blocking, when out fifo queue has a data size greater than a certain value (4096 bytes by default, either manually sized or adaptively sized); img drags out the data file test _ out with adb to see, and the result is as shown in fig. 10, which is consistent with bushed sent data.
(3) Debug a10 sends data, PC fetches:
compiling a data file send _ in.img required by uploading the PC; pushing the document into the a10 device with the adb tool; and sending the send _ in.img file to the mass _ storage device node by using the dd tool. Since the usb req buffer opened in kernel has a size of 16384 bytes, the top lattice also sends data with bs per packet being 16384, and the data is written into the in fifo queue buffer. Opening a bushond tool, and selecting a Devices page; double clicking the rockchip _ usb disk device, and opening the SCSI control panel; fill in SCSI commands, using custom 0xC8 CENTERM _ READ (10) command, and fill in 0x00000000 disk offset, specifying the use of 0x0080 disk sectors (65536 bytes, 64 k); fill out data length 65536, which must be the same size as bit7 bit8 sector in CDB, currently 0x0080 × 512 ═ 65536 bytes; selecting an inpc for the data direction; clicking the run button, the PC will take the data from the in fifo queue in batches, up to 16384 bytes each time (usb req's buffer configuration size); as shown in fig. 11, the data received in the bushed tool is checked, and is consistent with the send _ in.
(4) Debug PC query A10 data State:
because data receiving and sending are all initiated by bushed in a unidirectional mode at the PC end, two fifo data states in a kernel need to be polled and inquired at regular time, the CENTERM _ INQUIRY0xCC self-defined command is added: filling in a 0xcc self-defining command, wherein the length of data (the number of sectors is not the number of sectors, namely the length of the data) required to be acquired by writing the bit4 is consistent with the length of a data area of data length; clicking a run button to acquire information, wherein the first 4 bits are the data length of in fifo, and the last 4 bits are the data length of out fifo; it can be queried, as shown in FIG. 12, that it is consistent with the information in the kernel.
Since the apparatus described in the second embodiment of the present invention is an apparatus used for implementing the method of the first embodiment of the present invention, based on the method described in the first embodiment of the present invention, a person skilled in the art can understand the specific structure and the deformation of the apparatus, and thus the details are not described herein. All the devices adopted in the method of the first embodiment of the present invention belong to the protection scope of the present invention.
Based on the same inventive concept, the application provides an electronic device embodiment corresponding to the first embodiment, which is detailed in the third embodiment.
EXAMPLE III
The present embodiment provides an electronic device, as shown in fig. 13, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any implementation manner of the first embodiment may be implemented.
Since the electronic device described in this embodiment is a device used for implementing the method in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a specific implementation of the electronic device in this embodiment and various variations thereof can be understood by those skilled in the art, and therefore, how to implement the method in the first embodiment of the present application by the electronic device is not described in detail herein. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium, as shown in fig. 14, on which a computer program is stored, and when the computer program is executed by a processor, any one of the first embodiment can be implemented.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages:
1. the terminal equipment is virtualized into a non-standard formatted disk, namely mass storage equipment, so that windows cannot be loaded normally and a new disk identifier cannot be added, all windows computers do not need to additionally install a driving program for the mass storage equipment, plug and play are realized, and the non-inductive connection of the terminal equipment is realized;
2. the non-standard SCSI reading and writing commands are customized in a driver of the terminal equipment and a transceiving program of the office upper computer in advance, and the non-standard SCSI reading and writing commands are adopted between the terminal equipment and the office upper computer for data communication, so that the data communication of a non-standard formatted disk is realized, and the safety of the data communication is greatly improved;
3. the communication isolation storage medium is used for directly transferring data in a ddr memory of the terminal equipment without passing through an emmc (nand flash) storage medium of the terminal equipment, so that the bottleneck caused by the transmission speed limitation of the emmc (nand flash) storage medium is avoided, and high-speed transmission can be realized;
4. double caching: in the ddr memory, two groups of in and out cache queues are developed, different data which are uploaded to an office computer by a terminal and are issued to terminal equipment by the office computer are processed respectively, the data can be transmitted simultaneously, the data are not interfered with each other and can be multiplexed in time, and the transmission speed is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus or system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (12)

1. A communication method of non-inductive drive-free equipment is characterized in that: the method comprises the following steps:
connecting terminal equipment in a non-inductive manner, namely virtualizing the terminal equipment into a magnetic disk in a non-standard format, wherein windows cannot be loaded normally and a disk signature cannot be added;
the data communication of the non-standard formatted disk is realized, namely, the non-standard SCSI read-write command is customized in a driver of the terminal equipment and a transceiver of the office upper computer in advance, and the non-standard SCSI read-write command is adopted for data communication between the terminal equipment and the office upper computer.
2. The communication method of the non-inductive drive-free device as claimed in claim 1, wherein: the non-standard SCSI read write commands include read command 0xC8, write command 0xCA, and query command 0 xCC.
3. The communication method of the non-inductive drive-free device as claimed in claim 1, wherein: further comprising:
the communication isolation storage medium bypasses the storage medium during data transmission between the terminal equipment and the office upper computer, and directly caches the received and transmitted data in the memory.
4. The communication method of the non-inductive drive-free device as claimed in claim 3, wherein: further comprising:
the data is transmitted and received by using double buffers, namely two FIFO queue buffers which are independent of each other are opened in the kernel space of the terminal equipment and are respectively used for uploading data and downloading data.
5. The communication method of the non-inductive drive-free device as claimed in claim 4, wherein:
the uploading data specifically comprises: the terminal equipment sends data through an application program, inquires whether an In FIFO queue cache is full, enters blocking waiting if the In FIFO queue cache is full, and writes data into the In FIFO queue cache through the SCSI read-write command if the In FIFO queue cache is not full; the office upper computer tries to read USB data, inquires whether the In FIFO queue cache is empty, if so, the operation is finished, and otherwise, the data cached In the In FIFO queue are read through the SCSI reading and writing command;
the download data specifically includes: the terminal equipment reads data through an application program, inquires whether the Out FIFO queue cache is empty, enters blocking waiting if the Out FIFO queue cache is empty, and reads data from the Out FIFO queue cache through the SCSI read-write command if the Out FIFO queue cache is empty; and the office upper computer tries to send USB data, inquires whether the Out FIFO queue cache is full, if so, the process is finished, and otherwise, data are issued to the Out FIFO queue cache through the SCSI reading and writing command.
6. A communication device of non-inductive drive-free equipment is characterized in that: the method comprises the following steps:
the non-inductive connection terminal equipment module is used for virtualizing the terminal equipment into a non-standard formatted magnetic disk, so that windows cannot be loaded normally, and a disk identifier cannot be added;
the user-defined non-standard SCSI read-write command module is used for pre-defining the non-standard SCSI read-write command in a driving program of the terminal equipment and a receiving and sending program of the office upper computer;
and the data communication module is used for realizing data communication between the terminal equipment and the upper office computer by adopting the non-standard SCSI reading and writing command.
7. The communication device of claim 6, wherein: the non-standard SCSI read write commands include read command 0xC8, write command 0xCA, and query command 0 xCC.
8. The communication device of claim 6, wherein: further comprising:
and the communication isolation storage medium module is used for bypassing the storage medium during data transmission between the terminal equipment and the office upper computer and directly caching the received and transmitted data in the memory.
9. The communication device of claim 6, wherein: further comprising:
the double-buffer data receiving and transmitting module is used for opening two FIFO queue buffers which are independent from each other in the kernel space of the terminal equipment and are respectively used for uploading data and downloading data.
10. The communication device of claim 9, wherein: the uploading data specifically comprises: the terminal equipment sends data through an application program, inquires whether an In FIFO queue cache is full, enters blocking waiting if the In FIFO queue cache is full, and writes data into the In FIFO queue cache through the SCSI read-write command if the In FIFO queue cache is not full; the office upper computer tries to read USB data, inquires whether the In FIFO queue cache is empty, if so, the operation is finished, and otherwise, the data cached In the In FIFO queue are read through the SCSI reading and writing command;
the download data specifically includes: the terminal equipment reads data through an application program, inquires whether the Out FIFO queue cache is empty, enters blocking waiting if the Out FIFO queue cache is empty, and reads data from the Out FIFO queue cache through the SCSI read-write command if the Out FIFO queue cache is empty; and the office upper computer tries to send USB data, inquires whether the Out FIFO queue cache is full, if so, the process is finished, and otherwise, data are issued to the Out FIFO queue cache through the SCSI reading and writing command.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 5 when executing the program.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN202110995070.5A 2021-08-27 2021-08-27 Communication method, device, equipment and medium for non-inductive drive-free equipment Pending CN113867625A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110995070.5A CN113867625A (en) 2021-08-27 2021-08-27 Communication method, device, equipment and medium for non-inductive drive-free equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110995070.5A CN113867625A (en) 2021-08-27 2021-08-27 Communication method, device, equipment and medium for non-inductive drive-free equipment

Publications (1)

Publication Number Publication Date
CN113867625A true CN113867625A (en) 2021-12-31

Family

ID=78988591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110995070.5A Pending CN113867625A (en) 2021-08-27 2021-08-27 Communication method, device, equipment and medium for non-inductive drive-free equipment

Country Status (1)

Country Link
CN (1) CN113867625A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102654849A (en) * 2011-03-03 2012-09-05 赛酷特(北京)信息技术有限公司 Method for hiding and reading by partitions
CN102681949A (en) * 2011-12-26 2012-09-19 中兴通讯股份有限公司 Terminal equipment and memory card hiding method of terminal equipment
CN103324587A (en) * 2012-03-20 2013-09-25 安凯(广州)微电子技术有限公司 Nandflash equipment encryption and decryption implementation method and system
CN104392179A (en) * 2014-10-08 2015-03-04 四川和芯微电子股份有限公司 Encryption method of USB (universal serial bus) storage device
US9940293B1 (en) * 2015-12-22 2018-04-10 Emc Corporation Method for efficient storage and backup of data via SCSI transport

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102654849A (en) * 2011-03-03 2012-09-05 赛酷特(北京)信息技术有限公司 Method for hiding and reading by partitions
CN102681949A (en) * 2011-12-26 2012-09-19 中兴通讯股份有限公司 Terminal equipment and memory card hiding method of terminal equipment
CN103324587A (en) * 2012-03-20 2013-09-25 安凯(广州)微电子技术有限公司 Nandflash equipment encryption and decryption implementation method and system
CN104392179A (en) * 2014-10-08 2015-03-04 四川和芯微电子股份有限公司 Encryption method of USB (universal serial bus) storage device
US9940293B1 (en) * 2015-12-22 2018-04-10 Emc Corporation Method for efficient storage and backup of data via SCSI transport

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
(美)JAN AXELSON著: "《USB大全》", 31 May 2001, 北京:中国电力出版社, pages: 74 *
刘纯武等: "《嵌入式系统设计与应用》", 31 December 2011, 国防科技大学出版社, pages: 329 *
李爱佳: "基于虚拟磁盘技术的测控数据传输系统的研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》, no. 8, pages 16 - 21 *

Similar Documents

Publication Publication Date Title
US9720844B2 (en) Providing indirect data addressing in an input/output processing system where the indirect data address list is non-contiguous
US9292224B2 (en) Providing indirect data addressing for a control block at a channel subsystem of an I/O processing system
JP5159902B2 (en) Method for processing a variable length device command word (DCW) in a controller configured to communicate with a channel subsystem in an I / O processing system
CA2704133C (en) Bi-directional data transfer within a single i/o operation
CN111198663B (en) Method, system, apparatus and storage medium for controlling data access operation
CN107526616B (en) Method and device for writing and reading data of BMC by host
CN107239321B (en) USB storage device security access control method based on thin virtual machine monitor
CN115344200A (en) Storage system based on NVMe interface
CN111651269A (en) Method, device and computer readable storage medium for realizing equipment virtualization
CN114925012A (en) Ethernet frame issuing method, Ethernet frame uploading method and related devices
CN111399771B (en) Protocol configuration method, device and equipment of MCS storage system
WO2022242665A1 (en) Data storage method and related device
CN113867625A (en) Communication method, device, equipment and medium for non-inductive drive-free equipment
CN101561760B (en) Method for upgrading firmware of interface card
CN208077160U (en) SD card driver based on SPI mode
CN112732176B (en) SSD (solid State disk) access method and device based on FPGA (field programmable Gate array), storage system and storage medium
US10768816B2 (en) Method and apparatus to manipulate customer data without using the host interface
US8095715B1 (en) SCSI HBA management using logical units
JP2017162399A (en) Storage device
CN115586924A (en) Control system and implementation method for controlling low-speed peripheral by single instruction set soft core
KR20170110808A (en) Data processing system including data storage 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