Data transmission method and device, computer equipment and storage medium
By directly interacting with hardware device drivers and network devices in the kernel layer of the data sending end, and transmitting data collected by hardware devices based on the transmission control protocol, the problems of low data transmission efficiency and long response time in traditional technology are solved, achieving a more efficient data transmission.
Patent Information
- Application Number
- CN202310313807.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2024-09-24
AI Technical Summary
The existing technology has problems of low data transmission efficiency and long command response time in hardware device data transmission between computers, mainly because the application program and kernel layer at the data sending end require multiple data copies.
In the kernel layer of the data sending end, the target hardware device driver is started through the hardware device driver initialization instruction, the network device of the data receiving end is located based on the transmission control protocol, the network connection is established, and data interaction is performed directly between the kernel layer and the network device. Transmit raw data collected by hardware devices.
It improves data transmission efficiency, reduces command response time during data transmission, and avoids multiple data copies at the application and kernel layers.
Smart Images

Figure CN118694804A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data transmission method, apparatus, computer equipment and storage medium. Background Art
[0002] At present, when transmitting data collected by hardware devices between different computers, it is necessary to receive the original data collected by the hardware device read by the hardware device driver software installed in the kernel layer of the data sending end through the application in the data sending end, encapsulate the original data collected by the hardware device into a data packet through the network protocol stack in the kernel layer of the data sending end, and finally, based on the network card driver in the kernel layer of the data sending end, instruct the network device at the data sending end to send the data packet to the network device at the data receiving end.
[0003] However, since this data transmission method requires multiple data copies in the application and kernel layers at the data sending end, when transmitting data collected by hardware devices based on the existing technology, there are problems such as low data transmission efficiency and long command response time. Summary of the invention
[0004] Based on this, it is necessary to provide a data transmission method, device, computer equipment and storage medium to address the above technical problems.
[0005] In a first aspect, the present application provides a data transmission method, which is applied to the kernel layer of a data sending end, and the method includes:
[0006] In response to the hardware device driver initialization instruction, the target hardware device driver is started; wherein the hardware device driver initialization instruction is generated when the logical address and port number of the data receiving end and the network device information of the data sending end are obtained;
[0007] Based on the transmission control protocol, the logical address, and the port number, locate the first network device corresponding to the data receiving end, and issue a network connection request; the network connection request is used to establish a network connection between the data sending end and the data receiving end;
[0008] Reading the raw data collected by the corresponding hardware device through the target hardware device driver;
[0009] Determining, according to the network device information, a second network device corresponding to the data sending end;
[0010] Based on the transmission control protocol, the original data is transmitted from the second network device to the first network device.
[0011] In one of the embodiments, the method further includes: upon confirming that the network between the data sending end and the data receiving end is connected, outputting a data collection instruction; the data collection instruction is used to instruct the corresponding hardware device to perform data collection.
[0012] In one embodiment, reading the raw data collected by the corresponding hardware device through the target hardware device driver includes:
[0013] When it is confirmed that the first network device has not received all of the original data, the original data continues to be read through the target hardware device driver.
[0014] In one embodiment, the network device information includes a manufacturer identification number and a network device identification number; and determining the second network device corresponding to the data sending end according to the network device information includes:
[0015] The second network device corresponding to the data sending end is determined according to the manufacturer identification number and the network device identification number.
[0016] In one embodiment, the transmitting the original data from the second network device to the first network device based on the transmission control protocol includes:
[0017] Based on the transmission control protocol, the original data is transmitted from the second network device to the first network device in the form of data packets.
[0018] In a second aspect, the present application further provides a data transmission method, which is applied to a user layer of a data receiving end, and the method comprises:
[0019] In response to a network connection request, a network connection is established between the data receiving end and the data sending end; the network connection request is issued by the data sending end when a first network device corresponding to the data receiving end is located; the first network device is located by the data sending end based on the logical address, port number, and transmission control protocol of the data receiving end;
[0020] The original data is received through the first network device; the original data is the original data collected by the corresponding hardware device and read by the target hardware device driver in the data sending end, and is transmitted to the first network device through the second network device corresponding to the data sending end based on the transmission control protocol; the second network device is determined based on the network device information of the data sending end; the target hardware device driver is started by the data sending end in response to the hardware device driver initialization instruction; the hardware device driver initialization instruction is generated by the data sending end when the logical address, the port number, and the network device information are obtained.
[0021] In a third aspect, the present application further provides a data transmission device, which is applied to the kernel layer of a data sending end, and the device includes:
[0022] A driver startup module, used to start the target hardware device driver in response to a hardware device driver initialization instruction; wherein the hardware device driver initialization instruction is generated when the logical address and port number of the data receiving end and the network device information of the data sending end are obtained;
[0023] A network connection request issuing module, used to locate the first network device corresponding to the data receiving end based on the transmission control protocol, the logical address, and the port number, and issue a network connection request; the network connection request is used to establish a network connection between the data sending end and the data receiving end;
[0024] A data reading module, used to read the original data collected by the corresponding hardware device through the target hardware device driver;
[0025] A network device confirmation module, used to determine the second network device corresponding to the data sending end according to the network device information;
[0026] A data transmission module is used to transmit the original data from the second network device to the first network device based on the transmission control protocol.
[0027] In a fourth aspect, the present application further provides a data transmission device, applied to a user layer of a data receiving end, the device comprising:
[0028] A network connection building module, configured to establish a network connection between the data receiving end and the data sending end in response to a network connection request; the network connection request is issued by the data sending end when the first network device corresponding to the data receiving end is located; the first network device is used to locate the data sending end based on the logical address, port number, and transmission control protocol of the data receiving end;
[0029] A data receiving module, used for receiving original data through the first network device; the original data is the original data collected by the corresponding hardware device read by the target hardware device driver in the data sending end, and is transmitted to the first network device through the second network device corresponding to the data sending end based on the transmission control protocol; the second network device is determined based on the network device information of the data sending end; the target hardware device driver is started by the data sending end in response to the hardware device driver initialization instruction; the hardware device driver initialization instruction is generated by the data sending end when the logical address, the port number, and the network device information are obtained.
[0030] In a fifth aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0031] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0032] In a seventh aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0033] The above-mentioned data transmission method, device, computer equipment and storage medium first start the target hardware device driver in response to the hardware device driver initialization instruction. Then, based on the transmission control protocol, the logical address, and the port number, locate the first network device corresponding to the data receiving end and issue a network connection request. Then, read the original data collected by the corresponding hardware device through the target hardware device driver. After that, determine the second network device corresponding to the data sending end according to the network device information. Finally, based on the transmission control protocol, transmit the original data from the second network device to the first network device. The present application realizes the transmission of the original data collected by the hardware device connected to the data sending end from the network device corresponding to the data sending end to the network device corresponding to the data receiving end based on the transmission control protocol by directly interacting data between the kernel layer of the data sending end and the network device corresponding to the data sending end. This not only solves the problem that the traditional data transmission method needs to perform multiple data copies in the application and kernel layer in the data sending end, but also improves the efficiency of data transmission between the data sending end and the data receiving end, and effectively reduces the command response time during the data transmission process. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 An application environment diagram of a data transmission method provided in an embodiment;
[0035] Figure 2 A schematic diagram of a flow chart of a data transmission method provided in an embodiment;
[0036] Figure 3 A schematic flow chart of a data transmission method provided in another embodiment;
[0037] Figure 4 is a structural block diagram of a data transmission device provided in an embodiment;
[0038] Figure 5 is a structural block diagram of a data transmission device provided in another embodiment;
[0039] Figure 6 A schematic diagram of an application architecture of a data transmission method provided in an embodiment in a practical application;
[0040] Figure 7 A schematic diagram of a specific application architecture of a data transmission method provided in an embodiment in practical application;
[0041] Figure 8 A schematic diagram of a flow chart of a method for communicating between a data transmitting end and a data receiving end using a data transmission method provided in an embodiment;
[0042] Fig. 9 A schematic diagram of an application architecture when a data transmission method is applied to a magnetic resonance system provided in an embodiment;
[0043] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] The data transmission method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the data sending end 110 communicates with the data receiving end 120 through a network; the data storage system can store the data that the data sending end 110 and the data receiving end 120 need to process; the data storage system can be integrated on a server, or placed on a cloud or other network server; the data sending end 110 and the data receiving end 120 can be, but are not limited to, various personal computers, laptops, and tablet computers.
[0046] It should be noted that when an element is considered to be "connected" to another element, it can be directly connected to the other element, or connected to the other element through an intermediate element. In addition, the "connection" in the following embodiments should be understood as "electrical connection", "communication connection", etc. if there is transmission of electrical signals or data between the connected objects.
[0047] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0048] In one embodiment, Figure 2 As shown, a data transmission method is provided, which is applied to the kernel layer of the data sending end and includes the following steps:
[0049] Step S210, in response to the hardware device driver initialization instruction, start the target hardware device driver program; wherein the aforementioned hardware device driver initialization instruction is generated when the logical address and port number of the data receiving end and the network device information of the data sending end are obtained.
[0050] In this step, the hardware device driver initialization instruction refers to the hardware device driver initialization instruction generated by the data sending end when the data sending end obtains the logical address, port number, and network device information of the data sending end, which can be used to start the target hardware device driver program; the logical address is the IP address (Internet Protocol Address) of the data receiving end, also known as the Internet Protocol address; the port number refers to the port number of the data receiving end; the target hardware device driver program can be a target hardware device driver program configured in the device data transmission unit in the kernel layer of the data sending end, which is used to drive the corresponding hardware device connected to the data sending end; the device data transmission unit can be used to configure the TCP client in the kernel layer of the data sending end.
[0051] Step S220, based on the transmission control protocol, logical address, and port number, locate the first network device corresponding to the data receiving end, and issue a network connection request; the aforementioned network connection request is used to establish a network connection between the data sending end and the data receiving end.
[0052] In this step, the transmission control protocol, namely the TCP protocol (TCP, Transmission Control Protocol), refers to a connection-oriented, reliable, byte stream-based transport layer communication protocol, which is defined by IETF's RFC 793; the logical address, namely the IP address (Internet Protocol Address) of the data receiving end, is also called the Internet Protocol address; the port number refers to the port number of the data receiving end; the first network device corresponding to the data receiving end refers to a network device that helps the data receiving end connect to the Internet; the network connection request refers to a network connection request issued by the data sending end based on the TCP protocol for establishing a TCP connection between the data sending end and the data receiving end.
[0053] In actual applications, the specific manifestation of the first network device corresponding to the data receiving end may be a network card corresponding to the data receiving end; the network connection request may be a network card corresponding to the data sending end, which is sent to the network card corresponding to the data receiving end based on the TCP protocol, and is used to establish a TCP connection between the data sending end and the data receiving end (that is, a TCP protocol data packet with a network connection request is sent to the network card corresponding to the data receiving end through the network card corresponding to the data sending end).
[0054] Step S230, reading the original data collected by the corresponding hardware device through the target hardware device driver.
[0055] In this step, the target hardware device driver can be a target hardware device driver configured in the device data transmission unit in the kernel layer of the data sending end, which is used to drive the corresponding hardware device connected to the data sending end; the corresponding hardware device refers to the corresponding hardware device connected to the data sending end and used to collect original data.
[0056] Step S240: Determine the second network device corresponding to the data sending end according to the network device information.
[0057] In this step, the network device information, i.e., the network device information of the data sending end, may include network device information such as a manufacturer ID and a network device ID for identifying the data sending end; the second network device corresponding to the data sending end refers to the second network device corresponding to the data sending end determined based on the network device information such as a manufacturer ID and a network device ID for identifying the data sending end.
[0058] In practical applications, the specific manifestation of the second network device corresponding to the data sending end may be a network card corresponding to the data sending end.
[0059] Step S250: transmitting the original data from the second network device to the first network device based on the transmission control protocol.
[0060] In this step, the transmission control protocol, namely the TCP protocol (TCP, Transmission Control Protocol), refers to a connection-oriented, reliable, byte stream-based transport layer communication protocol, which is defined by RFC 793 of IETF; the original data refers to the original data collected by the corresponding hardware device connected to the data sending end; the second network device is the second network device corresponding to the data sending end; the first network device is the first network device corresponding to the data receiving end.
[0061] In practical applications, the original data may be the original data collected by the corresponding hardware device connected to the data sending end and transmitted from the network card corresponding to the data sending end to the network card corresponding to the data receiving end based on the TCP protocol (that is, the TCP protocol data packet containing the original data collected by the corresponding hardware device connected to the data sending end is transmitted to the network card corresponding to the data receiving end through the network card corresponding to the data sending end).
[0062] In the above data transmission method, first, in response to the hardware device driver initialization instruction, the target hardware device driver is started. Then, based on the transmission control protocol, the logical address, and the port number, the first network device corresponding to the data receiving end is located, and a network connection request is issued. Next, the original data collected by the corresponding hardware device is read through the target hardware device driver. After that, the second network device corresponding to the data sending end is determined according to the network device information. Finally, based on the transmission control protocol, the original data is transmitted from the second network device to the first network device. The present application realizes the transmission of the original data collected by the hardware device connected to the data sending end from the network device corresponding to the data sending end to the network device corresponding to the data receiving end based on the transmission control protocol by performing direct data interaction between the kernel layer of the data sending end and the network device corresponding to the data sending end, which not only solves the problem that the traditional data transmission method needs to perform multiple data copies in the application and kernel layer in the data sending end, but also improves the efficiency of data transmission between the data sending end and the data receiving end, and effectively reduces the command response time during the data transmission process.
[0063] Regarding the specific manner of instructing the corresponding hardware device to collect data, in one embodiment, the method further includes:
[0064] When it is confirmed that the network between the data sending end and the data receiving end is connected, a data collection instruction is output; the aforementioned data collection instruction is used to instruct the corresponding hardware device to perform data collection.
[0065] Among them, the corresponding hardware device refers to the corresponding hardware device connected to the data sending end and used to collect original data; confirming that the network between the data sending end and the data receiving end is connected refers to confirming whether the network connection between the second network device corresponding to the data sending end and the first network device corresponding to the data receiving end has been successfully established; instructing the corresponding hardware device to perform data collection refers to instructing the corresponding hardware device connected to the data sending end to collect original data; the data collection instruction refers to the data collection instruction output when confirming that the network between the data sending end and the data receiving end is connected, which is used to instruct the corresponding hardware device to collect original data.
[0066] In actual applications, the specific way to confirm that the network between the data sending end and the data receiving end is connected may be to confirm whether a TCP connection has been successfully established between the data sending end and the data receiving end; the data acquisition instruction may be a data acquisition instruction output by a device data transmission unit configured in the kernel layer of the data sending end to a corresponding hardware device connected to the data sending end, instructing it to perform raw data acquisition, when confirming that the network between the data sending end and the data receiving end is connected.
[0067] In the above embodiment, by outputting data acquisition instructions for instructing the corresponding hardware device to perform data acquisition when confirming that the network between the data sending end and the data receiving end is connected, the command response time during the data transmission process is reduced, thereby effectively improving the efficiency of data transmission between the data sending end and the data receiving end.
[0068] Regarding the specific method of reading the original data through the target hardware device driver, in one embodiment, the above step S230 specifically includes:
[0069] When it is confirmed that the first network device has not received all the original data, the original data continues to be read through the target hardware device driver.
[0070] Among them, the first network device is the first network device corresponding to the data receiving end; the original data refers to the original data collected by the corresponding hardware device connected to the data sending end; all the original data refers to all the original data collected by the corresponding hardware device connected to the data sending end; the target hardware device driver can be a target hardware device driver configured in the device data transmission unit in the kernel layer of the data sending end, which is used to drive the corresponding hardware device connected to the data sending end.
[0071] In the above embodiment, when it is confirmed that the first network device corresponding to the data receiving end has not received all the original data, the target hardware device driver configured in the kernel layer of the data sending end continues to read the original data, thereby ensuring the data integrity during the data transmission between the data sending end and the data receiving end, thereby effectively improving the efficiency of data transmission between the data sending end and the data receiving end.
[0072] Regarding the specific method of determining the second network device corresponding to the data sending end, in one embodiment, the network device information includes a manufacturer identification number and a network device identification number; the step S240 specifically includes:
[0073] According to the manufacturer identification number and the network device identification number, the second network device corresponding to the data sending end is determined.
[0074] Among them, the manufacturer identification number refers to the manufacturer identification number used to provide the manufacturer information of the second network device corresponding to the data sending end, and its specific form can be the manufacturer ID of the second network device corresponding to the data sending end; the network device identification number refers to the identification number used to provide the device-related information of the second network device corresponding to the data sending end, and its specific form can be the network device ID of the second network device corresponding to the data sending end.
[0075] In actual applications, the specific form of the second network device corresponding to the data sending end may be the network card corresponding to the data sending end. On this basis, the specific method of determining the second network device corresponding to the data sending end according to the manufacturer identification number and the network device identification number may be to determine the network card corresponding to the data sending end based on the manufacturer ID of the network card corresponding to the data sending end and the network device ID of the network card corresponding to the data sending end.
[0076] In the above embodiment, by determining the second network device corresponding to the data sending end according to the manufacturer identification number and the network device identification number, the command response time during the data transmission process is effectively reduced, thereby ensuring the efficiency of data transmission between the data sending end and the data receiving end.
[0077] Regarding the specific method of transmitting the original data from the second network device to the first network device, in one embodiment, the above step S250 specifically includes:
[0078] Based on the transmission control protocol, the original data is transmitted from the second network device to the first network device in the form of data packets.
[0079] Among them, the transmission control protocol is the TCP protocol; the data packet refers to the TCP protocol data packet; the original data refers to the original data collected by the corresponding hardware device connected to the data sending end; the second network device is the second network device corresponding to the data sending end; the first network device is the first network device corresponding to the data receiving end.
[0080] In actual applications, the second network device can be the network card corresponding to the data sending end; the first network device can be the network card corresponding to the data receiving end; on this basis, based on the transmission control protocol, the specific method of transmitting the original data in the form of data packets from the second network device to the first network device can be through the network card corresponding to the data sending end, the TCP protocol data packets constructed by the original data collected by the corresponding hardware device connected to the data sending end are transmitted to the network card corresponding to the data receiving end in sequence.
[0081] In the above embodiment, the original data collected by the hardware device is transmitted in the form of data packets from the second network device corresponding to the data sending end to the first network device corresponding to the data receiving end based on the transmission control protocol. This not only solves the problem that the traditional data transmission method requires multiple data copies in the application and kernel layer in the data sending end, but also effectively improves the efficiency of data transmission between the data sending end and the data receiving end.
[0082] In one embodiment, Figure 3 As shown, a data transmission method is provided, which is applied to the user layer of the data receiving end, and includes the following steps:
[0083] Step S310, in response to a network connection request, establish a network connection between the data receiving end and the data sending end; the aforementioned network connection request is issued by the data sending end when the first network device corresponding to the data receiving end is located; the aforementioned first network device is located by the data sending end based on the logical address, port number, and transmission control protocol of the data receiving end.
[0084] In this step, the network connection request can be a network connection request sent by the network card corresponding to the data sending end to the network card corresponding to the data receiving end based on the TCP protocol, which is used to establish a TCP connection between the data sending end and the data receiving end; the network connection between the data receiving end and the data sending end refers to the TCP connection between the data receiving end and the data sending end; the logical address of the data receiving end, that is, the IP address of the data receiving end; the transmission control protocol, that is, the TCP protocol.
[0085] In actual applications, the specific manifestation of the first network device corresponding to the data receiving end may be a network card corresponding to the data receiving end. On this basis, the first network device corresponding to the data receiving end may be a data sending end, which is located based on the logical address of the data receiving end (i.e., the IP address of the data receiving end), the port number, and the transmission control protocol (i.e., the TCP protocol) of the data receiving end, and the network connection request may be a network connection request sent by the network card corresponding to the data sending end to the network card corresponding to the data receiving end based on the TCP protocol, and is used to establish a TCP connection between the data sending end and the data receiving end (i.e., sending a TCP protocol data packet with a network connection request to the network card corresponding to the data receiving end through the network card corresponding to the data sending end).
[0086] Step S320, receiving original data through the first network device; the aforementioned original data is the original data collected by the corresponding hardware device read by the target hardware device driver in the data sending end, and is transmitted to the first network device through the second network device corresponding to the data sending end based on the transmission control protocol; the aforementioned second network device is determined based on the network device information of the data sending end; the aforementioned target hardware device driver is started by the data sending end in response to the hardware device driver initialization instruction; the aforementioned hardware device driver initialization instruction is generated by the data sending end when the logical address, port number, and network device information are obtained.
[0087] In this step, the first network device is the first network device corresponding to the data receiving end; the original data refers to the original data collected by the corresponding hardware device connected to the data sending end, and the original data can be read through the target hardware device driver in the data sending end; the second network device is the second network device corresponding to the data sending end.
[0088] In actual applications, the specific manifestation of the second network device corresponding to the data sending end may be the network card corresponding to the data sending end; the original data may be the original data collected by the corresponding hardware device connected to the data sending end and transmitted to the network card corresponding to the data receiving end based on the TCP protocol by the network card corresponding to the data sending end (that is, the TCP protocol data packet containing the original data collected by the corresponding hardware device connected to the data sending end is transmitted to the network card corresponding to the data sending end through the network card corresponding to the data sending end); the above steps S310 and S320 may be implemented by an application configured in the user layer of the data receiving end.
[0089] The above embodiment effectively ensures the efficiency of data transmission between the data sending end and the data receiving end by configuring an application in the user layer of the data receiving end to respond to the network connection request issued by the kernel layer of the data sending end and to receive and process the original data transmitted by the data sending end.
[0090] In one embodiment, the application architecture of the above data transmission method in practical application can be as follows: Figure 6 The form shown, that is, the data transmission method applied to the kernel layer of the data sending end, can be implemented by a device data transmission unit configured in the kernel layer of the data sending end. The device data transmission unit can transmit the original data collected by the corresponding hardware device connected to the data sending end through the second network device (i.e. Figure 6 2), and transmits the data to the first network device corresponding to the data receiving end (i.e. Figure 6 Furthermore, the device data transmission unit can also transmit the data through the second network device (i.e. Figure 6 2), obtain the first network device corresponding to the data receiving end (i.e. Figure 6 The network card 1) in the data transmission module is used to control the corresponding hardware device connected to the data sending end.
[0091] In one embodiment, the specific application architecture of the above data transmission method in practical application can be as follows: Figure 7 In the form shown, the application program configured in the user layer of the data sending end can communicate with the device data transmission unit in the kernel layer of the data sending end through the interface called by the operating system, thereby realizing the control of the target hardware device driver for driving the corresponding hardware device connected to the data sending end in the device data transmission unit in the kernel layer of the data sending end (including specific operation modes such as reading and writing data to the corresponding hardware device and controlling the corresponding hardware device to perform specific work); the device data transmission unit in the kernel layer of the data sending end can be used to transmit the original data collected by the corresponding hardware device connected to the data sending end through the second network device (i.e. Figure 6 2), and transmits the data to the first network device corresponding to the data receiving end (i.e. Figure 6 The first network device corresponding to the data receiving end (i.e. Figure 6 The network card 1) in the data receiving end can communicate data with the application in the user layer configured at the data receiving end through the network card driver and network protocol stack configured in the kernel layer of the data receiving end after receiving the original data collected by the corresponding hardware device transmitted by the second network device corresponding to the data sending end.
[0092] In one embodiment, the specific process of using the data transmission method to communicate between the data sending end and the data receiving end can be as follows: Figure 8 In the form shown, a TCP server is configured in the user layer of the data receiving end, and a TCP client is configured in the device data network transmission unit in the kernel layer of the data sending end. When the data sending end and the data receiving end communicate using the data transmission method, the socket of the TCP server needs to be initialized first, and then bound to the port of the data receiving end. The port of the data receiving end is listened to, and before receiving the network connection request from the TCP client, the accept function is called to block. Finally, when it is confirmed that the network connection relationship between the TCP server and the TCP client has been successfully established, the original data transmitted by the TCP client and collected by the corresponding hardware device connected to the data sending end is received through the TCP server, and the received original data is processed accordingly.
[0093] In one embodiment, the application architecture of the above data transmission method when applied to a magnetic resonance system may be as follows: Fig. 9 The form shown, that is, in the magnetic resonance system, includes two computers, which are respectively configured with control software for performing magnetic resonance scanning and other operations (i.e., the application program configured in the user layer of the above-mentioned data sending end), a measurement control machine (i.e., the above-mentioned data sending end) that sends magnetic resonance sequence instructions to the spectrometer board (i.e., the above-mentioned corresponding hardware device connected to the data sending end), and obtains the magnetic resonance raw data collected by the spectrometer board, and an image reconstruction computer (i.e., the above-mentioned data receiving end) for reconstructing the magnetic resonance raw data into a grayscale image.
[0094] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0095] Based on the same inventive concept, the embodiment of the present application also provides a data transmission device for implementing the data transmission method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data transmission device embodiments provided below can refer to the limitations on the data transmission method above, and will not be repeated here.
[0096] In one embodiment, Figure 4 As shown, a data transmission device is provided, and the device 400 includes:
[0097] The driver startup module 410 is used to start the target hardware device driver in response to the hardware device driver initialization instruction; wherein the hardware device driver initialization instruction is generated when the logical address and port number of the data receiving end and the network device information of the data sending end are obtained;
[0098] A network connection request issuing module 420 is used to locate the first network device corresponding to the data receiving end based on the transmission control protocol, the logical address, and the port number, and issue a network connection request; the network connection request is used to establish a network connection between the data sending end and the data receiving end;
[0099] The data reading module 430 is used to read the original data collected by the corresponding hardware device through the target hardware device driver;
[0100] A network device confirmation module 440, configured to determine, according to the network device information, a second network device corresponding to the data sending end;
[0101] The data transmission module 450 is used to transmit the original data from the second network device to the first network device based on the transmission control protocol.
[0102] In one of the embodiments, the above-mentioned device also includes: a collection instruction output module, which is used to output a data collection instruction when it is confirmed that the network between the data sending end and the data receiving end is connected; the data collection instruction is used to instruct the corresponding hardware device to perform data collection.
[0103] In one embodiment, the data reading module 430 is specifically configured to continue reading the original data through the target hardware device driver when confirming that the first network device has not received all of the original data.
[0104] In one embodiment, the network device information includes a manufacturer identification number and a network device identification number; the network device confirmation module 440 is specifically used to determine the second network device corresponding to the data sending end according to the manufacturer identification number and the network device identification number.
[0105] In one embodiment, the data transmission module 450 is specifically configured to transmit the original data in the form of data packets from the second network device to the first network device based on the transmission control protocol.
[0106] In one embodiment, Figure 5 As shown, a data transmission device is provided, and the device 500 includes:
[0107] The network connection building module 510 is used to establish a network connection between the data receiving end and the data sending end in response to a network connection request; the network connection request is issued by the data sending end when the first network device corresponding to the data receiving end is located; the first network device is located by the data sending end based on the logical address, port number, and transmission control protocol of the data receiving end;
[0108] The data receiving module 520 is used to receive original data through the first network device; the original data is the original data collected by the corresponding hardware device read by the target hardware device driver in the data sending end, and is transmitted to the first network device through the second network device corresponding to the data sending end based on the transmission control protocol; the second network device is determined based on the network device information of the data sending end; the target hardware device driver is started by the data sending end in response to the hardware device driver initialization instruction; the hardware device driver initialization instruction is generated by the data sending end when the logical address, the port number, and the network device information are obtained.
[0109] Each module in the above data transmission device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0110] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.10As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, the above-mentioned data transmission method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0111] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0112] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0113] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0114] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0115] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0117] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0118] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data transmission method, It is characterized in that Applied to the kernel layer of the data sending end, the method includes: In response to the hardware device driver initialization instruction, the target hardware device driver is started; wherein the hardware device driver initialization instruction is generated when the logical address and port number of the data receiving end and the network device information of the data sending end are obtained; Based on the transmission control protocol, the logical address, and the port number, locate the first network device corresponding to the data receiving end, and issue a network connection request; the network connection request is used to establish a network connection between the data sending end and the data receiving end; Reading the raw data collected by the corresponding hardware device through the target hardware device driver; Determining, according to the network device information, a second network device corresponding to the data sending end; Based on the transmission control protocol, the original data is transmitted from the second network device to the first network device.
2. The method according to claim 1, It is characterized in that The method further comprises: When it is confirmed that the network between the data sending end and the data receiving end is connected, a data collection instruction is output; the data collection instruction is used to instruct the corresponding hardware device to perform data collection.
3. The method according to claim 1, It is characterized in that The step of reading the raw data collected by the corresponding hardware device through the target hardware device driver comprises: When it is confirmed that the first network device has not received all of the original data, the original data continues to be read through the target hardware device driver.
4. The method according to any one of claims 1 to 3, It is characterized in that The network device information includes a manufacturer identification number and a network device identification number; The determining, according to the network device information, a second network device corresponding to the data sending end includes: The second network device corresponding to the data sending end is determined according to the manufacturer identification number and the network device identification number.
5. The method according to claim 1, It is characterized in that The transmitting the original data from the second network device to the first network device based on the transmission control protocol includes: Based on the transmission control protocol, the original data is transmitted from the second network device to the first network device in the form of data packets.
6. A data transmission method, It is characterized in that Applied to the user layer of the data receiving end, the method comprises: In response to a network connection request, a network connection is established between the data receiving end and the data sending end; the network connection request is issued by the data sending end when a first network device corresponding to the data receiving end is located; the first network device is located by the data sending end based on the logical address, port number, and transmission control protocol of the data receiving end; The original data is received through the first network device; the original data is the original data collected by the corresponding hardware device and read by the target hardware device driver in the data sending end, and is transmitted to the first network device through the second network device corresponding to the data sending end based on the transmission control protocol; the second network device is determined based on the network device information of the data sending end; the target hardware device driver is started by the data sending end in response to the hardware device driver initialization instruction; the hardware device driver initialization instruction is generated by the data sending end when the logical address, the port number, and the network device information are obtained.
7. A data transmission device, It is characterized in that Applied to the kernel layer of the data sending end, the device includes: A driver startup module, used to start the target hardware device driver in response to a hardware device driver initialization instruction; wherein the hardware device driver initialization instruction is generated when the logical address and port number of the data receiving end and the network device information of the data sending end are obtained; A network connection request issuing module, used to locate the first network device corresponding to the data receiving end based on the transmission control protocol, the logical address, and the port number, and issue a network connection request; the network connection request is used to establish a network connection between the data sending end and the data receiving end; A data reading module, used to read the original data collected by the corresponding hardware device through the target hardware device driver; A network device confirmation module, used to determine the second network device corresponding to the data sending end according to the network device information; A data transmission module is used to transmit the original data from the second network device to the first network device based on the transmission control protocol.
8. A data transmission device, It is characterized in that Applied to the user layer of the data receiving end, the device comprises: A network connection building module, configured to establish a network connection between the data receiving end and the data sending end in response to a network connection request; the network connection request is issued by the data sending end when the first network device corresponding to the data receiving end is located; the first network device is used to locate the data sending end based on the logical address, port number, and transmission control protocol of the data receiving end; A data receiving module, used for receiving original data through the first network device; the original data is the original data collected by the corresponding hardware device read by the target hardware device driver in the data sending end, and is transmitted to the first network device through the second network device corresponding to the data sending end based on the transmission control protocol; the second network device is determined based on the network device information of the data sending end; the target hardware device driver is started by the data sending end in response to the hardware device driver initialization instruction; the hardware device driver initialization instruction is generated by the data sending end when the logical address, the port number, and the network device information are obtained.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
