Data transmission method, device, equipment, system and storage medium

文档序号:1941411 发布日期:2021-12-07 浏览:9次 中文

阅读说明:本技术 数据传输方法、装置、设备、系统及存储介质 (Data transmission method, device, equipment, system and storage medium ) 是由 李弋飞 于 2021-09-09 设计创作,主要内容包括:本发明涉及数据传输技术领域,公开了一种数据传输方法、装置、设备、系统及存储介质,所述方法包括:接收第一外围设备通过外部总线发送的数据包;根据数据包获得以太网数据,以太网数据包括第二端设备的外部总线API的标识;通过以太网向第二端设备发送以太网数据;由于本发明通过将外围设备发送的数据包转换为对应的以太网数据进行发送,相较于现有技术通过集成接口进行数据的传输处理,从而能够实现数据远距离的传输以及扩大外围设备的部署范围。(The invention relates to the technical field of data transmission, and discloses a data transmission method, a device, equipment, a system and a storage medium, wherein the method comprises the following steps: receiving a data packet sent by a first peripheral device through an external bus; acquiring Ethernet data according to the data packet, wherein the Ethernet data comprises an identifier of an external bus API of the second end device; sending Ethernet data to the second end device through the Ethernet; because the data packet sent by the peripheral equipment is converted into the corresponding Ethernet data to be sent, compared with the prior art that the data is transmitted through the integrated interface, the invention can realize the remote transmission of the data and expand the deployment range of the peripheral equipment.)

1. A data transmission method, applied to a first end device, comprising the steps of:

receiving a data packet sent by a first peripheral device through an external bus;

acquiring Ethernet data according to the data packet, wherein the Ethernet data comprises an identifier of an external bus API of the second end device;

and sending the Ethernet data to the second end equipment through Ethernet.

2. The data transmission method according to claim 1, wherein the obtaining ethernet data from the data packet comprises:

carrying out format conversion on the data packet to obtain first virtual bus data;

and encapsulating the first virtual bus data to obtain Ethernet data.

3. The data transmission method according to claim 2, wherein the format conversion of the data packet to obtain the first virtual bus data comprises:

analyzing the data packet, and stripping a data head of the analyzed data packet;

converting the stripped data head according to a preset virtual bus data head;

and encapsulating the data packet of the conversion data head to obtain first virtual bus data.

4. The data transmission method according to claim 3, wherein the flag is a preset flag bit of the preset virtual bus data header.

5. A data transmission apparatus, wherein the data transmission apparatus is configured on a first end device, the data transmission apparatus comprising:

the data packet receiving module is used for receiving a data packet sent by the first peripheral equipment through the external bus;

the data packet receiving module is further configured to obtain ethernet data according to the data packet, where the ethernet data includes an identifier of an external bus API of the second end device;

and the sending module is used for sending the Ethernet data to the second end equipment through Ethernet.

6. A data transmission device, characterized in that the data transmission device comprises: memory, processor, transceiver and a data transmission program stored on the memory and executable on the processor, the data transmission program being configured to implement the data transmission method according to any one of claims 1 to 4.

7. A data transmission method, applied to a second end device, comprising the steps of:

receiving Ethernet data sent by a first end device, wherein the Ethernet data comprises an identifier of an external bus API of a second end device;

analyzing the Ethernet data to obtain the identifier and external bus data;

and calling an external bus API corresponding to the identification, and sending the external bus data to a second peripheral device by the external bus API.

8. The data transmission method according to claim 7, wherein the parsing the ethernet data to obtain the identifier and the external bus data comprises:

analyzing the Ethernet data to obtain the external bus data and a virtual bus data head;

extracting the identification from a preset identification bit of the virtual bus data head;

determining a corresponding connection type according to the virtual bus data head;

the calling an external bus API corresponding to the identification, and the external bus API sending the external bus data to a second peripheral device, including:

and calling an external bus API corresponding to the identifier and the connection type, and sending the external bus data to second peripheral equipment by the external bus API.

9. The data transmission method according to claim 8, wherein the calling the external bus API corresponding to the identification includes:

acquiring a plurality of API sets configured by second-end equipment;

and selecting an external bus API from the API sets through the identification, and calling the external bus API.

10. A data transmission apparatus, wherein the data transmission apparatus is configured on a second end device, the data transmission apparatus comprising:

the data receiving module is used for receiving Ethernet data sent by first end equipment, wherein the Ethernet data comprises an identifier of an external bus API of second end equipment;

the analysis module is used for analyzing the Ethernet data to obtain the identifier and the external bus data;

and the calling module is used for calling an external bus API corresponding to the identifier, and the external bus API sends the external bus data to second peripheral equipment.

11. A data transmission device, characterized in that the data transmission device comprises: memory, processor, transceiver and a data transmission program stored on the memory and executable on the processor, the data transmission program being configured to implement the data transmission method according to any one of claims 7 to 9.

12. A data transmission system, characterized in that the system comprises a data transmission device according to claim 6 and a data transmission device according to claim 11.

13. A storage medium having stored thereon a data transmission program which, when executed by a processor, implements the data transmission method according to any one of claims 1 to 4 or 7 to 9.

Technical Field

The present invention relates to the field of data transmission technologies, and in particular, to a data transmission method, apparatus, device, system, and storage medium.

Background

With the continuous development of digital technology, people have increasingly extensive data application, data transmission cannot be separated in data application, namely data of equipment A is transmitted to equipment B, the existing common data transmission scheme is that data transmission is directly carried out between equipment ends of equipment ends, the mode can only realize short-distance data transmission, and if long-distance data transmission is realized, systems running on various gateways need to be adapted, so that the difficulty of adapting peripheral equipment drive is increased, and the difficulty of expanding the peripheral equipment deployment range is increased.

The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.

Disclosure of Invention

The invention mainly aims to provide a data transmission method, a data transmission device, data transmission equipment, a data transmission system and a storage medium, and aims to solve the technical problems that long-distance data transmission cannot be realized and the deployment range of peripheral equipment cannot be effectively expanded in the prior art.

In order to achieve the above object, the present invention provides a data transmission method, which is applied to a first end device, and the data transmission method includes the following steps:

receiving a data packet sent by a first peripheral device through an external bus;

acquiring Ethernet data according to the data packet, wherein the Ethernet data comprises an identifier of an external bus API of the second end device;

and sending the Ethernet data to the second end equipment through Ethernet.

Optionally, the obtaining ethernet data according to the data packet includes:

carrying out format conversion on the data packet to obtain first virtual bus data;

and encapsulating the first virtual bus data to obtain Ethernet data.

Optionally, the performing format conversion on the data packet to obtain first virtual bus data includes:

analyzing the data packet, and stripping a data head of the analyzed data packet;

converting the stripped data head according to a preset virtual bus data head;

and encapsulating the data packet of the conversion data head to obtain first virtual bus data.

Optionally, the identifier is in a preset flag bit of the preset virtual bus data header.

Optionally, the data transmission apparatus is configured on the first end device, and the data transmission apparatus includes:

the receiving module is used for receiving a data packet sent by the first peripheral equipment through an external bus;

the receiving module is further configured to obtain ethernet data according to the data packet, where the ethernet data includes an identifier of an external bus API of the second end device;

and the sending module is used for sending the Ethernet data to the second end equipment through Ethernet.

In addition, to achieve the above object, the present invention further provides a data transmission apparatus, where the data transmission apparatus is disposed on a first end device, and the data transmission apparatus includes:

the data packet receiving module is used for receiving a data packet sent by the first peripheral equipment through the external bus;

the receiving module is further configured to obtain ethernet data according to the data packet, where the ethernet data includes an identifier of an external bus API of the second end device;

and the sending module is used for sending the Ethernet data to the second end equipment through Ethernet.

In order to achieve the above object, the present invention provides a data transmission method, which is applied to a second end device, and the data transmission method includes the following steps:

receiving Ethernet data sent by a first end device, wherein the Ethernet data comprises an identifier of an external bus API of a second end device;

analyzing the Ethernet data to obtain the identifier and external bus data;

and calling an external bus API corresponding to the identification, and sending the external bus data to a second peripheral device by the external bus API.

Optionally, the parsing the ethernet data to obtain the identifier and the external bus data includes:

analyzing the Ethernet data to obtain the external bus data and a virtual bus data head;

extracting the identification from a preset identification bit of the virtual bus data head;

determining a corresponding connection type according to the virtual bus data head;

the calling an external bus API corresponding to the identification, and the external bus API sending the external bus data to a second peripheral device, including:

and calling an external bus API corresponding to the identifier and the connection type, and sending the external bus data to second peripheral equipment by the external bus API.

Optionally, the calling an external bus API corresponding to the identifier includes:

acquiring a plurality of API sets configured by second-end equipment;

and selecting an external bus API from the API sets through the identification, and calling the external bus API.

In addition, to achieve the above object, the present invention further provides a data transmission apparatus, where the data transmission apparatus is disposed on a second end device, and the data transmission apparatus includes:

the data receiving module is used for receiving Ethernet data sent by first end equipment, wherein the Ethernet data comprises an identifier of an external bus API of second end equipment;

the analysis module is used for analyzing the Ethernet data to obtain the identifier and the external bus data;

and the calling module is used for calling an external bus API corresponding to the identifier, and the external bus API sends the external bus data to second peripheral equipment.

In addition, to achieve the above object, the present invention further provides a data transmission device, including: a memory, a processor and a data transfer program stored on the memory and executable on the processor, the data transfer program configured to implement a data transfer method as described above.

Furthermore, to achieve the above object, the present invention also proposes a storage medium having stored thereon a data transmission program which, when executed by a processor, implements the data transmission method as described above.

The data transmission method provided by the invention comprises the steps of receiving a data packet sent by first peripheral equipment through an external bus; acquiring Ethernet data according to the data packet, wherein the Ethernet data comprises an identifier of an external bus API of the second end device; sending Ethernet data to the second end device through the Ethernet; because the data packet sent by the peripheral equipment is converted into the corresponding Ethernet data to be sent, compared with the prior art that the data is transmitted through the integrated interface, the invention can realize the remote transmission of the data and expand the deployment range of the peripheral equipment.

Drawings

Fig. 1 is a schematic structural diagram of a data transmission device in a hardware operating environment according to an embodiment of the present invention;

FIG. 2 is a block diagram of a data transmission system according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating a data transmission method according to a first embodiment of the present invention;

FIG. 4 is a diagram illustrating data format conversion according to an embodiment of the data transmission method of the present invention;

FIG. 5 is a functional block diagram of a data transmission device according to a first embodiment of the present invention;

FIG. 6 is a flowchart illustrating a data transmission method according to a second embodiment of the present invention;

fig. 7 is a functional block diagram of a data transmission device according to a second embodiment of the present invention.

The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.

Detailed Description

It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

Referring to fig. 1, fig. 1 is a schematic structural diagram of a data transmission device in a hardware operating environment according to an embodiment of the present invention.

As shown in fig. 1, the data transmission apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005, and a transceiver 1006. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.

Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the data transmission device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.

As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a data transmission program.

In the data transmission apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the data transmission device of the present invention may be provided in a data transmission device, and the data transmission device calls the data transmission program stored in the memory 1005 through the processor 1001 and executes the data transmission method provided by the embodiment of the present invention.

Referring to fig. 2, fig. 2 is a schematic diagram of an architecture of a data transmission system according to an embodiment of the present invention, the data transmission system including: the embodiment is not limited to this, and takes the USB network card as an example to explain, a specific process of the data transmission system is that the first peripheral device generates a data packet, the data packet is sent to the first end device through the external bus, the first end device receives the data packet sent by the first peripheral device, obtains ethernet data according to the data packet, and the ethernet data at this time includes an identifier of the external bus API of the second end device, and sends the ethernet data to the second end device through the ethernet, the second end device receives the Ethernet data sent by the first end device, analyzes the Ethernet data to obtain the identifier of the external bus API and the external bus data, and sends the external bus data to the second peripheral device by calling the external bus API corresponding to the identifier.

Based on the above hardware structure, the embodiment of the data transmission method of the present invention is provided.

Referring to fig. 3, fig. 3 is a flowchart illustrating a data transmission method according to a first embodiment of the present invention.

In a first embodiment, the data transmission method comprises the steps of:

in step S10, a data packet sent by the first peripheral device through the external bus is received.

It should be noted that the execution main body of this embodiment is the first end device in fig. 2, where the first end device is a terminal device capable of processing and forwarding the received data packet.

It should be understood that the data packet may be a data packet generated by data that needs to be transmitted by the first peripheral device, and the first peripheral device transmits the data packet that needs to be transmitted to the first end device through an external bus, where the external bus is a communication path between the CPU and the RAM, the Read-Only Memory (ROM), and the input/output device interface, and in this embodiment, refers to a data transmission path between the first peripheral device and the first end device.

Step S20, obtaining ethernet data according to the data packet, where the ethernet data includes an identifier of an external bus API of the second end device.

It should be understood that the ethernet data is in a data format capable of being transmitted through an ethernet, and after obtaining the data packet, the corresponding ethernet data is obtained according to the data packet, where the ethernet data includes an identifier of an external bus API of the second end device, and the identifier is used to determine the external bus API of the second peripheral device.

Because the first device end is connected to the second device end through the ethernet, it indicates that the data of the first device end can be transmitted to the second device end through the ethernet only when the data is ethernet data, and the transmission of the ethernet can effectively improve the data transmission efficiency and the data transmission distance, further, step S20 includes: carrying out format conversion on the data packet to obtain first virtual bus data; and encapsulating the first virtual bus data to obtain Ethernet data.

It can be understood that the first virtual bus data may be data that converts a data header of a data packet into a preset virtual bus data header, and after the conversion is completed, format conversion of the data packet is implemented, and the first virtual bus data is encapsulated, and after the encapsulation is completed, ethernet data is obtained, where the encapsulation refers to mapping the first virtual bus data to an encapsulation protocol and filling a packet header corresponding to the encapsulation protocol.

Under the condition of multiple buses, in order to realize fast and accurate conversion of data in a data packet into ethernet data, it is necessary to convert the data into first virtual bus data first, and then obtain corresponding ethernet data through the first virtual bus data, and further, perform format conversion on the data packet to obtain first virtual bus data, including: analyzing the data packet, and stripping a data head of the analyzed data packet; converting the stripped data head according to a preset virtual bus data head; and encapsulating the data packet of the conversion data head to obtain first virtual bus data.

It should be understood that, referring to fig. 4, fig. 4 is a schematic diagram of data format conversion of an embodiment, where a data packet is composed of a data header and data of a data packet, and a first virtual bus data is composed of a preset virtual bus data header and data, after the data packet is obtained, the data header and the data of the data packet are analyzed, the data header is stripped from the data packet, and at this time, only data to be transmitted exists in the data packet, the preset virtual bus data header of the first virtual bus is converted to the data packet with the data header stripped, and the data packet converted into the preset virtual bus data header is encapsulated, so as to obtain the first virtual bus data.

It can be understood that, since the ethernet data includes the identifier of the external bus API of the second end device, and the ethernet data is obtained by encapsulating the first virtual bus data, in order to quickly determine the external bus API of the second peripheral device, the identifier is set to a preset flag bit of the preset virtual bus data header, where the preset flag bit may be at the head position of the preset virtual bus data header.

Step S30, sending the ethernet data to the second end device through ethernet.

It should be understood that, after the ethernet data is obtained, the ethernet data may be sent to the second end device in an ethernet transmission manner, so as to effectively improve the efficiency of data transmission.

The embodiment receives a data packet sent by a first peripheral device through an external bus; acquiring Ethernet data according to the data packet, wherein the Ethernet data comprises an identifier of an external bus API of the second end device; sending Ethernet data to the second end device through the Ethernet; in the embodiment, the data packet sent by the peripheral device is converted into the corresponding ethernet data for sending, so that compared with the prior art in which data is transmitted through the integrated interface, remote data transmission can be realized and the deployment range of the peripheral device can be expanded.

In addition, referring to fig. 5, an embodiment of the present invention further provides a data transmission apparatus, where the data transmission apparatus is configured on a first end device, and the data transmission apparatus includes:

the data packet receiving module 10 is configured to receive a data packet sent by a first peripheral device through an external bus.

It should be understood that the data packet may be a data set to be transmitted by the first peripheral device, and the first peripheral device transmits the data packet to be transmitted to the first end device through an external bus, where the external bus is a communication path between the CPU and the RAM, the ROM, and the input/output device interface, and in this embodiment, refers to a data transmission path between the first peripheral device and the first end device.

The data packet receiving module 10 is further configured to obtain ethernet data according to the data packet, where the ethernet data includes an identifier of an external bus API of the second end device.

It should be understood that the ethernet data is in a data format capable of being transmitted through an ethernet, and after obtaining the data packet, the corresponding ethernet data is obtained according to the data packet, where the ethernet data includes an identifier of an external bus API of the second end device, and the identifier is used to determine the external bus API of the second peripheral device.

Because the first device end and the second device end are connected through the ethernet, it indicates that the data of the first device end can be transmitted to the second device end through the ethernet only when the data is ethernet data, and the ethernet transmission can effectively improve the data transmission efficiency and the data transmission distance, further, the receiving module 10 is further configured to perform format conversion on the data packet to obtain first virtual bus data; and encapsulating the first virtual bus data to obtain Ethernet data.

It can be understood that the first virtual bus data may be data that converts a data header of a data packet into a preset virtual bus data header, and after the conversion is completed, format conversion of the data packet is implemented, and the first virtual bus data is encapsulated, and after the encapsulation is completed, ethernet data is obtained, where the encapsulation refers to mapping the first virtual bus data to an encapsulation protocol and filling a packet header corresponding to the encapsulation protocol.

Under the condition of multiple buses, in order to realize fast and accurate conversion of data in a data packet into ethernet data, it is necessary to convert the data into first virtual bus data first, and then obtain corresponding ethernet data through the first virtual bus data, and further, perform format conversion on the data packet to obtain first virtual bus data, including: analyzing the data packet, and stripping a data head of the analyzed data packet; converting the stripped data head according to a preset virtual bus data head; and encapsulating the data packet of the conversion data head to obtain first virtual bus data.

It should be understood that, referring to fig. 4, fig. 4 is a schematic diagram of data format conversion of an embodiment, where a data packet is composed of a data header and data of a data packet, and a first virtual bus data is composed of a preset virtual bus data header and data, after the data packet is obtained, the data header and the data of the data packet are analyzed, the data header is stripped from the data packet, and at this time, only data to be transmitted exists in the data packet, the preset virtual bus data header of the first virtual bus is converted to the data packet with the data header stripped, and the data packet converted into the preset virtual bus data header is encapsulated, so as to obtain the first virtual bus data.

It can be understood that, since the ethernet data includes the identifier of the external bus API of the second end device, and the ethernet data is obtained by encapsulating the first virtual bus data, in order to quickly determine the external bus API of the second peripheral device, the identifier is set to a preset flag bit of the preset virtual bus data header, where the preset flag bit may be at the head position of the preset virtual bus data header.

A sending module 20, configured to send the ethernet data to the second end device through an ethernet.

It should be understood that, after the ethernet data is obtained, the ethernet data may be sent to the second end device in an ethernet transmission manner, so as to effectively improve the efficiency of data transmission.

The embodiment receives a data packet sent by a first peripheral device through an external bus; acquiring Ethernet data according to the data packet, wherein the Ethernet data comprises an identifier of an external bus API of the second end device; sending Ethernet data to the second end device through the Ethernet; in the embodiment, the data packet sent by the peripheral device is converted into the corresponding ethernet data for sending, so that compared with the prior art in which data is transmitted through the integrated interface, remote data transmission can be realized and the deployment range of the peripheral device can be expanded.

Further, to achieve the above object, the data transmission device includes: a memory, a processor, a transceiver, and a data transmission program stored on the memory and executable on the processor, the data transmission program configured to implement a data transmission method as described above.

Referring to fig. 6, fig. 6 is a flowchart illustrating a data transmission method according to a second embodiment of the present invention.

In a second embodiment, the data transmission method includes the steps of:

step S40, receiving ethernet data sent by the first end device, where the ethernet data includes an identifier of an external bus API of the second end device.

It should be noted that the execution main body of this embodiment is the second end device in fig. 2, and the second end device is a terminal device capable of analyzing the received ethernet data and calling the external bus API to perform data transmission.

It should be understood that, after receiving the ethernet data sent by the second end device, since the ethernet data at this time is obtained by encapsulating the data packet with the preset virtual bus data header and the stripped data header, and the identifier of the external bus API of the second end device is in the flag bit of the preset virtual bus data header, the received ethernet data also includes the identifier of the external bus API of the second end device.

Step S50, parsing the ethernet data to obtain the identifier and the external bus data.

It can be understood that after the ethernet data is obtained, the ethernet data is analyzed to obtain the identifier of the external bus API of the second end device and the external bus data, in the case of a single bus, the ethernet data is directly analyzed into the external bus data by the second end device, in the case of multiple buses, the ethernet data is analyzed into the first virtual bus data by the second end device, and then the external bus data is obtained by analyzing the first virtual bus data.

In the case of multiple buses, in order to accurately transmit the external bus data to the second peripheral device, the external bus API corresponding to the connection type of the second end device and the second peripheral device needs to be called, otherwise, the external bus data cannot be accurately transmitted to the second peripheral device, and further, step S50 includes: analyzing the Ethernet data to obtain the external bus data and a virtual bus data head; extracting the identification from a preset identification bit of the virtual bus data head; determining a corresponding connection type according to the virtual bus data head; and calling an external bus API corresponding to the identifier and the connection type, and sending the external bus data to second peripheral equipment by the external bus API.

It should be understood that after the ethernet data is obtained, the ethernet data is parsed, where the external Bus data and the preset virtual Bus data header are obtained through parsing, and the identifier is located in the preset flag bit of the preset virtual Bus data header, so that the identifier of the external Bus API of the second end device needs to be extracted from the preset flag bit of the preset virtual Bus data header, where the connection type may be a connection type between the second peripheral device and the second end device, the connection type includes a Universal Serial Bus (USB) connection type, a Secure Digital Input Output (SDIO) connection type, and other connection types, different external Bus APIs corresponding to different connection types, and the corresponding external Bus API is selected according to the identifier of the external Bus API of the second end device and the connection type, the external bus data is sent to the second peripheral device through the external bus API.

It should be noted that, when the API configured by the second end device is unique, the external bus API does not need to be determined by the identifier and connection type of the external bus API of the second end device, but the external bus data is directly sent to the second peripheral device through the unique API, and when the second end device is configured with a plurality of API sets, the corresponding external bus API needs to be selected from the plurality of API sets through the identifier and connection type of the external bus API of the second end device, and the external bus data is transmitted to the second peripheral device through the external bus API.

And step S60, calling an external bus API corresponding to the identifier, and sending the external bus data to a second peripheral device by the external bus API.

In this embodiment, ethernet data sent by a first end device is received, where the ethernet data includes an identifier of an external bus API of a second end device; analyzing the Ethernet data to obtain the identifier and external bus data; calling an external bus API corresponding to the identifier, and sending the external bus data to a second peripheral device by the external bus API; in the embodiment, the identifier of the external bus API of the second end device and the external bus data are obtained by analyzing the ethernet data sent by the first end device, and the external bus data is sent to the second peripheral device by calling the external bus API corresponding to the identifier, so that remote data transmission can be realized and the deployment range of the peripheral device can be expanded.

In addition, referring to fig. 7, an embodiment of the present invention further provides a data transmission apparatus, where the data transmission apparatus is configured on a second end device, and the data transmission apparatus includes:

the data receiving module 30 is configured to receive ethernet data sent by the first end device, where the ethernet data includes an identifier of an external bus API of the second end device.

It should be understood that, after receiving the ethernet data sent by the second end device, since the ethernet data at this time is obtained by encapsulating the data packet with the preset virtual bus data header and the stripped data header, and the identifier of the external bus API of the second end device is in the flag bit of the preset virtual bus data header, the received ethernet data also includes the identifier of the external bus API of the second end device.

And the analyzing module 40 is configured to analyze the ethernet data to obtain the identifier and the external bus data.

It can be understood that after the ethernet data is obtained, the ethernet data is analyzed to obtain the identifier of the external bus API of the second end device and the external bus data, in the case of a single bus, the ethernet data is directly analyzed into the external bus data by the second end device, in the case of multiple buses, the ethernet data is analyzed into the first virtual bus data by the second end device, and then the external bus data is obtained by analyzing the first virtual bus data.

Under the condition of multiple buses, in order to accurately send external bus data to second peripheral equipment, an external bus API corresponding to the connection type of the second end equipment and the second peripheral equipment needs to be called, otherwise, the external bus data cannot be accurately sent to the second peripheral equipment, and further, the parsing module 40 is further configured to parse the ethernet data to obtain the external bus data and a virtual bus data header; extracting the identification from a preset identification bit of the virtual bus data head; determining a corresponding connection type according to the virtual bus data head; and calling an external bus API corresponding to the identifier and the connection type, and sending the external bus data to second peripheral equipment by the external bus API.

It should be understood that after the ethernet data is obtained, the ethernet data is parsed, where the external Bus data and the preset virtual Bus data header are obtained through parsing, and the identifier is located in the preset flag bit of the preset virtual Bus data header, so that the identifier of the external Bus API of the second end device needs to be extracted from the preset flag bit of the preset virtual Bus data header, where the connection type may be a connection type between the second peripheral device and the second end device, the connection type includes a Universal Serial Bus (USB) connection type, a Secure Digital Input Output (SDIO) connection type, and other connection types, different external Bus APIs corresponding to different connection types, and the corresponding external Bus API is selected according to the identifier of the external Bus API of the second end device and the connection type, the external bus data is sent to the second peripheral device through the external bus API.

It should be noted that, when the API configured by the second end device is unique, the external bus API does not need to be determined by the identifier and connection type of the external bus API of the second end device, but the external bus data is directly sent to the second peripheral device through the unique API, and when the second end device is configured with a plurality of API sets, the corresponding external bus API needs to be selected from the plurality of API sets through the identifier and connection type of the external bus API of the second end device, and the external bus data is transmitted to the second peripheral device through the external bus API.

And the calling module 50 is used for calling an external bus API corresponding to the identifier, and the external bus API sends the external bus data to a second peripheral device.

In this embodiment, ethernet data sent by a first end device is received, where the ethernet data includes an identifier of an external bus API of a second end device; analyzing the Ethernet data to obtain the identifier and external bus data; calling an external bus API corresponding to the identifier, and sending the external bus data to a second peripheral device by the external bus API; in the embodiment, the identifier of the external bus API of the second end device and the external bus data are obtained by analyzing the ethernet data sent by the first end device, and the external bus data is sent to the second peripheral device by calling the external bus API corresponding to the identifier, so that remote data transmission can be realized and the deployment range of the peripheral device can be expanded.

It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.

In addition, the technical details that are not described in detail in this embodiment may refer to the data transmission method provided in any embodiment of the present invention, and are not described herein again.

In an embodiment, the data packet receiving module 10 is further configured to perform format conversion on the data packet to obtain first virtual bus data; and encapsulating the first virtual bus data to obtain Ethernet data.

In an embodiment, the data packet receiving module 10 is further configured to analyze the data packet, and perform data header stripping on the analyzed data packet; converting the stripped data head according to a preset virtual bus data head; and encapsulating the data packet of the conversion data head to obtain first virtual bus data.

In an embodiment, the receiving module 10 is further configured to identify that the identifier is in a preset flag of the preset virtual bus data header.

In an embodiment, the parsing module 40 is further configured to parse the ethernet data to obtain the external bus data and a virtual bus data header; extracting the identification from a preset identification bit of the virtual bus data head; determining a corresponding connection type according to the virtual bus data head; and calling an external bus API corresponding to the identifier and the connection type, and sending the external bus data to second peripheral equipment by the external bus API.

In an embodiment, the invoking module 50 is further configured to obtain a plurality of API sets configured by the second end device; and selecting an external bus API from the API sets through the identification, and calling the external bus API.

Other embodiments or methods of implementing the data transmission apparatus of the present invention are described with reference to the above method embodiments, and are not intended to be exhaustive.

Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.

The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.

The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:数据传输方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!