WO2021169369A1 - 一种数据传输方法、装置及系统 - Google Patents

一种数据传输方法、装置及系统 Download PDF

Info

Publication number
WO2021169369A1
WO2021169369A1 PCT/CN2020/125586 CN2020125586W WO2021169369A1 WO 2021169369 A1 WO2021169369 A1 WO 2021169369A1 CN 2020125586 W CN2020125586 W CN 2020125586W WO 2021169369 A1 WO2021169369 A1 WO 2021169369A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
terminal
application
frame
data transmission
Prior art date
Application number
PCT/CN2020/125586
Other languages
English (en)
French (fr)
Inventor
周明
萧毓仁
许浩维
王同波
Original Assignee
荣耀终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Priority to EP20922347.8A priority Critical patent/EP4092917A4/en
Priority to US17/801,545 priority patent/US20230147131A1/en
Publication of WO2021169369A1 publication Critical patent/WO2021169369A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
    • H04W28/065Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information using assembly or disassembly of packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L5/00Arrangements affording multiple use of the transmission path
    • H04L5/003Arrangements for allocating sub-channels of the transmission path
    • H04L5/0044Arrangements for allocating sub-channels of the transmission path allocation of payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W92/00Interfaces specially adapted for wireless communication networks
    • H04W92/16Interfaces between hierarchically similar devices
    • H04W92/18Interfaces between hierarchically similar devices between terminal devices

Definitions

  • This application relates to the field of communications, and in particular to a data transmission method, device and system.
  • Point-to-point (Device to Device, D2D) communication technology refers to a communication method in which two peer user nodes (devices) communicate directly.
  • WiFi Direct is a communication mode that can realize point-to-point services.
  • High-speed data communication is carried out between two devices, and its data transmission is based on the TCP/IP protocol, which has the advantages of fast data transmission speed and long transmission distance.
  • Figure 1 shows a schematic diagram of the existing data transmission process based on the TCP/IP protocol. As shown in Figure 1, when the producer sends a message, the application software performs the data packet that needs to be sent according to the TCP/IP protocol specification.
  • the encapsulated data packet can be forwarded in a local area network (LAN) or a wide area network (WAN) network.
  • the receiver After receiving the data, the receiver also decapsulates the message according to the TCP/IP protocol specification and restores it to the data required by the user.
  • TCP/IP protocol for WiFi message forwarding in point-to-point services requires encapsulation and decapsulation of the messages, which will undoubtedly increase the time consumed by the point-to-point service data transmission, increase the load of the system, and reduce WiFi at the same time. The throughput rate.
  • the present application provides a data transmission method, device and system, which solves the problems of long time consumption for data transmission of point-to-point services, heavy system load, and low WiFi throughput in the prior art.
  • a data transmission method which is applied to a first terminal, and includes:
  • the application data frame in the sending queue is sent to the second terminal in point-to-point communication with the first terminal through the communication port of the first communication module.
  • the application data frame is used to instruct the second terminal to use a data processing method corresponding to the application data frame to perform data processing, and the data processing method corresponding to the application data frame is through the second terminal
  • the data bus copies the application data frame to the system memory of the second terminal for processing.
  • the data in the system memory is copied to the sending queue of the first communication module through the system bus, and then the data is sent to the second terminal based on the first communication module.
  • the communication between devices is carried out directly through system memory copy and MAC/PHY layer two forwarding, which greatly optimizes the load and delay of WiFi packet forwarding, which can effectively reduce the time consumed by point-to-point service data transmission and effectively reduce The load of the system reduces the transmission delay and improves the throughput rate of WiFi.
  • the method before copying the application data frame stored in the system memory to the sending queue of the first communication module through the data bus, the method further includes:
  • the copying the application data frame stored in the system memory to the sending queue of the first communication module via the data bus includes:
  • the sending the application data frame in the sending queue to the second terminal wirelessly connected to the first terminal through the communication port of the first communication module includes:
  • the data fragments are sent to the second terminal sequentially through the communication port of the first communication module based on the sending queue.
  • data fragmentation is performed for application data frames that exceed the fragmentation threshold, and data transmission is performed for the data fragmentation, so that application data larger than the maximum data transmission length of the network can be transmitted.
  • the data transmission method further includes:
  • the data to be retransmitted is determined according to the retransmission request frame, and the data to be retransmitted is sent to the communication port of the first communication module.
  • the second terminal; the retransmission request frame is generated by the second terminal when it is determined that the fragmented data is missing or the reorganized data does not meet a preset condition.
  • the data that needs to be retransmitted is sent based on the retransmission request frame, and data fragments that are missing or do not meet the preset conditions can be retransmitted in time to ensure the integrity and accuracy of the data.
  • the data transmission method further includes:
  • the data confirmation frame sent by the second terminal is received, it is determined that the data transmission is successful; the data confirmation frame is after the second terminal performs data reorganization according to the received data and determines that the data is complete and meets the preset conditions Generated. Based on the confirmation frame, it can quickly confirm whether the data transmission is successful and improve the reliability of the data transmission.
  • the application data frame is fragmented, and system memory is allocated for each data fragment
  • the space includes: if the data size of the application data frame exceeds the fragmentation threshold, dividing the application data frame into several data fragments according to the maximum data transmission length of the network, and adding a data header to each data fragment, the The data header is used to instruct the second terminal to perform data reorganization on each data fragment after receiving each of the data fragments, and restore the application data frame. Adding data headers for each piece of data facilitates data reorganization.
  • a data transmission method is provided, which is applied to a second terminal, including:
  • the application data frame is sent by a first terminal that communicates point-to-point with the second terminal from the system memory of the first terminal to the first communication module of the first terminal through the data bus of the first terminal Queue, and send the application data frame in the sending queue to the second terminal through the communication port of the first communication module;
  • the received data is directly copied to the system memory through the system bus, so that the application software can directly process the data stored in the system memory, effectively reducing the time consumed for data transmission of point-to-point services, and effectively Reduce system load, reduce transmission delay, and improve WiFi throughput.
  • the received application data frame includes several data fragments
  • the method further includes: performing data reorganization on the data fragments . Reorganize the fragmented data to restore the data to the data that can be directly processed by the application software, so that the application software can process the data.
  • the data transmission method further includes: if there is missing data fragmentation or the reorganized data does not meet a preset condition, generating a retransmission request frame according to the data that needs to be retransmitted, and Returning the retransmission request frame to the first terminal, where the retransmission request frame is used to instruct the first terminal to resend the data that needs to be retransmitted.
  • the data that needs to be retransmitted is sent based on the retransmission request frame, and data fragments that are missing or do not meet the preset conditions can be obtained in time to ensure the integrity and accuracy of the data.
  • the data transmission method further includes: if the reorganized data is complete and meets expectations, returning a confirmation frame to the first terminal. Based on the confirmation frame, the first terminal can confirm the success of the data transmission at the first time, thereby improving the reliability of the data transmission.
  • a data transmission device which is applied to a first terminal, and includes:
  • the first system memory copying unit is configured to copy the application data frame stored in the system memory to the sending queue of the first communication module through the data bus;
  • the sending unit is configured to send the application data frame in the sending queue to the second terminal in point-to-point communication with the first terminal through the communication port of the first communication module.
  • the device further includes a fragmentation unit.
  • the fragmentation unit is configured to perform fragmentation processing on the application data frame if the data size of the application data frame exceeds the fragmentation threshold, and store each data fragment in a corresponding system memory space;
  • the first system memory copy unit is configured to copy the fragment data from the system memory space of each data fragment to the sending queue of the first communication module
  • the sending unit is configured to send the data fragments to the second terminal sequentially through the communication port of the first communication module based on the sending queue.
  • the device further includes a retransmission unit.
  • the retransmission unit is configured to, if a retransmission request frame sent by the second terminal is received, determine the data to be retransmitted according to the retransmission request frame, and transmit the data to be retransmitted through the communication port of the first communication module.
  • the retransmission data is sent to the second terminal; the retransmission request frame is generated by the second terminal when it is determined that the fragmented data is missing or the reorganized data does not meet a preset condition.
  • the device further includes a determining unit.
  • the determining unit is configured to determine that the data transmission is successful if the data confirmation frame sent by the second terminal is received; the data confirmation frame is used by the second terminal to perform data reorganization according to the received data and determine that the data is complete and complete Generated after meeting preset conditions.
  • the fragmentation unit is specifically configured to: if the data size of the application data frame exceeds a fragmentation threshold, divide the application data frame into segments according to the maximum network data transmission length Several data fragments, and add a data header to each data fragment.
  • the data header is used to instruct the second terminal to perform data reorganization on each data fragment after receiving each of the data fragments to restore the application Data Frame.
  • a data transmission device which is applied to a second terminal, and includes:
  • the receiving unit is configured to receive an application data frame;
  • the application data frame is the first terminal that is in point-to-point communication with the second terminal and is copied from the system memory of the first terminal to the first terminal through the data bus of the first terminal.
  • the second system memory copy unit is configured to copy the application data frame to the system memory of the second terminal through the data bus of the second terminal.
  • the received application data frame includes several data fragments; correspondingly, the device further includes a recombination unit.
  • the reorganization unit is used to reorganize the data fragments.
  • the apparatus further includes: a confirmation retransmission unit.
  • the confirming retransmission unit is used to generate a retransmission request frame according to the data that needs to be retransmitted if there is missing data fragmentation or the reassembled data does not meet the preset condition, and return the retransmission request frame to the first terminal
  • the retransmission request frame is used to instruct the first terminal to resend the data that needs to be retransmitted.
  • the device further includes: a confirmation return unit.
  • the confirmation returning unit is configured to return a confirmation frame to the first terminal if the reorganized data is complete and in line with expectations.
  • an embodiment of the present application provides a terminal device, including: a memory and a processor, the memory is used to store a computer program; the processor is used to execute the first aspect or the second aspect when the computer program is invoked The method described in the aspect.
  • an embodiment of the present application provides a data transmission system, which is characterized by comprising: a first terminal and a second terminal, wherein the first terminal is configured to execute the method described in the above first aspect, and the second terminal The terminal is used to execute the method described in the second aspect above.
  • an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the method described in the first aspect or the second aspect when the computer program is executed by a processor.
  • embodiments of the present application provide a computer program product, which when the computer program product runs on an electronic device, causes the terminal device to execute the method described in the first aspect or the second aspect.
  • Figure 1 is a schematic diagram of an existing data transmission process based on the TCP/IP protocol
  • FIG. 2 is a schematic structural diagram of a data transmission system provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of the hardware structure of a mobile phone to which a data transmission method according to an embodiment of the application is applicable;
  • FIG. 4 is a schematic diagram of the software structure of a mobile phone to which a data transmission method according to an embodiment of the application is applicable;
  • FIG. 5 is a schematic diagram of a scenario of a data transmission method provided by an embodiment of the application.
  • Figure 6 is a schematic diagram of the display interface of the video playback software on the mobile phone and the display interface after the screen projection function is triggered;
  • FIG. 7 is a schematic diagram of an implementation process of a data transmission method provided by an embodiment of the application.
  • FIG. 8 is a schematic diagram of the structure of a data header of fragmented data in a data transmission method provided by an embodiment of the application;
  • FIG. 9 is a schematic diagram of interaction in the data transmission confirmation process in the data transmission method provided by this application.
  • FIG. 10 is a schematic diagram of interaction of the data transmission and retransmission process in the data transmission method provided by this application;
  • FIG. 11 is a schematic flowchart of the data reorganization process in the data transmission method provided by this application.
  • FIG. 12 is a structural block diagram of a data transmission device provided by an embodiment of this application.
  • FIG. 13 is a structural block diagram of another data transmission device provided by an embodiment of this application.
  • FIG. 14 is a schematic structural diagram of a terminal device provided by an embodiment of the application.
  • the term “if” can be construed as “when” or “once” or “in response to determination” or “in response to detecting “.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • embodiments of the present application provide a login authentication method, system and terminal device, which copy data in system memory to In the sending queue of the first communication module, data is sent to the second terminal based on the first communication module.
  • the communication between devices is carried out directly through system memory copy and MAC/PHY layer two forwarding.
  • the traditional TCP/UDP transport layer protocol and IP network layer protocol are not used, which greatly optimizes the load and delay of WiFi packet forwarding, and can be effective It reduces the time consumed for data transmission of point-to-point services, effectively reduces system load, reduces transmission delay, and improves WiFi throughput.
  • FIG. 2 is a schematic structural diagram of a data transmission system provided by an embodiment of the application.
  • the data transmission system provided in this embodiment may include: a first terminal 100 and a second terminal 200.
  • the first terminal 100 and the second terminal 200 can establish a device-to-device (D2D) communication connection, so that the first terminal 100 and the second terminal 200 can directly share data, such as screen projection, file sharing, and cloning.
  • D2D device-to-device
  • the characteristic of these business scenarios is that WiFi data packets do not need to be forwarded in a local area network (LAN) or a wide area network (WAN) network.
  • the WiFi P2P mode is usually used to establish a point-to-point communication connection between two devices, or to work with a terminal device.
  • AP mode another terminal works in STA mode, associates the STA with the AP, and establishes a WiFI link between the two terminals.
  • the above-mentioned first terminal device 100 may be a non-portable device such as a vehicle-mounted terminal, a television (smart TV), a projector, a smart speaker, a desktop computer, etc., or it may be a mobile phone, a tablet computer, a notebook computer, etc. Portable device.
  • the aforementioned second terminal 200 may also be non-portable devices such as vehicle-mounted terminals, smart TVs, smart speakers, and desktop computers, or portable devices such as mobile phones, tablet computers, notebook computers, smart wearable devices, and the like.
  • the number of the first terminal 100 and the number of the second terminal 200 is at least one, and the specific number is not particularly limited in this embodiment.
  • the first terminal 100 there is no strict distinction between the first terminal 100 and the second terminal 200.
  • the first terminal 100 In some scenarios, and it can also be used in other scenarios.
  • It can be used as the second terminal 200.
  • the data can be transmitted to the TV through the mobile phone; in another scene, the data can also be transmitted to the mobile phone through the tablet.
  • the first terminal 100 may transmit data to the second terminal 200, or the second terminal 200 may transmit data to the first terminal 100.
  • the shared data can be transmitted to the tablet computer through the mobile phone; in another scenario, the shared data can also be transmitted to the mobile phone through the tablet computer. In this embodiment of the application, the shared data is transmitted through the first terminal 100
  • the data transmission process transmitted to the second terminal 200 is taken as an example for illustration.
  • the above-mentioned first terminal 100 may be a mobile phone 100 having a hardware structure as shown in FIG. 3.
  • the mobile phone 100 may specifically include: a radio frequency (RF) circuit 110 and a memory 120 , The input unit 130, the display unit 140, the sensor 150, the audio circuit 160, the short-range wireless communication module 170, the processor 180, and the power supply 190.
  • RF radio frequency
  • the terminal device may include more or less components than shown in the figure, or combine certain components, or different components. Component arrangement.
  • the RF circuit 110 can be used for receiving and sending signals during the process of sending and receiving information or talking. In particular, after receiving the downlink information of the base station, it is processed by the processor 180; in addition, the designed uplink data is sent to the base station.
  • the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like.
  • the RF circuit 110 can also communicate with the network and other devices through wireless communication.
  • the above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE)), Email, Short Messaging Service (SMS), etc.
  • GSM Global System of Mobile Communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • Email Short Messaging Service
  • the memory 120 may be used to store software programs and modules.
  • the processor 180 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 120.
  • the memory 120 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of mobile phones (such as audio data, phone book, etc.), etc.
  • the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 130 may be used to receive inputted numeric or character information, and generate key signal input related to user settings and function control of the mobile phone 100.
  • the input unit 130 may include a touch panel 131 and other input devices 132.
  • the touch panel 131 also known as a touch screen, can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 131 or near the touch panel 131. Operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 131 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 180, and can receive and execute the commands sent by the processor 180.
  • the touch panel 131 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the input unit 130 may also include other input devices 132.
  • the other input device 132 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick.
  • the display unit 140 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 140 may include a display panel 141.
  • the display panel 141 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
  • the touch panel 131 can cover the display panel 141. When the touch panel 131 detects a touch operation on or near it, it transmits it to the processor 180 to determine the type of the touch event, and then the processor 180 responds to the touch event. The type provides corresponding visual output on the display panel 141.
  • the touch panel 131 and the display panel 141 are used as two independent components to realize the input and input functions of the mobile phone, but in some embodiments, the touch panel 131 and the display panel 141 may be integrated. Realize the input and output functions of the mobile phone.
  • the mobile phone 100 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor.
  • the ambient light sensor can adjust the brightness of the display panel 141 according to the brightness of the ambient light.
  • the proximity sensor can close the display panel 141 and/or when the mobile phone is moved to the ear. Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three-axis), and can detect the magnitude and direction of gravity when it is stationary.
  • the audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the mobile phone.
  • the audio circuit 160 can transmit the electrical signal converted from the received audio data to the speaker 161, which is converted into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, and the audio circuit 160 After being received, it is converted into audio data, and then processed by the audio data output processor 180, and then sent to, for example, another mobile phone via the RF circuit 110, or the audio data is output to the memory 120 for further processing.
  • WiFi is a short-distance wireless transmission technology.
  • the mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 170. It provides users with wireless broadband Internet access.
  • the aforementioned WiFi module 170 may include a WiFi chip, and the function of the mobile phone 100 to perform WiFi Direct connection with other terminal devices can be realized through the WiFi chip. It is also possible to make the mobile phone 100 work in the AP mode (Access Point mode) that can provide wireless access services and allow other wireless devices to access, or work in the STA mode (Station mode) that can connect to the AP and not accept wireless device access. Establish point-to-point communication between the mobile phone 100 and other WiFi devices.
  • the processor 180 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. Various functions and processing data of the mobile phone can be used to monitor the mobile phone as a whole.
  • the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, application programs, etc. , The modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 180.
  • the mobile phone 100 also includes a power source 190 (such as a battery) for supplying power to various components.
  • a power source 190 such as a battery
  • the power source can be logically connected to the processor 180 through a power management system, so that functions such as charging, discharging, and power consumption management can be managed through the power management system.
  • the software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present invention takes the layered Android system as an example to illustrate the software structure of the mobile phone 100.
  • FIG. 4 is a block diagram of the software structure of the mobile phone 100 according to an embodiment of the present application.
  • the Android system is divided into four layers, which are application layer, application framework layer (framework, FWK), system layer, and hardware abstraction layer.
  • the layers communicate through software interfaces.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the above-mentioned kernel layer further includes a PCIE driver.
  • the above-mentioned second terminal 200 may also be a mobile phone having a hardware structure as shown in FIG. 3 and a software structure as shown in FIG. 4, which will not be repeated here.
  • the data transmission process can be initiated through application software, and then direct system memory access (Direct Memory Access, DMA) is used to pass through the system bus (such as a high-speed serial computer).
  • the expansion bus Peripheral Component Interconnect Express, PCIE), SDIO bus
  • PCIE Peripheral Component Interconnect Express
  • SDIO Secure Digital Bus
  • the second terminal 200 After receiving the application data frame, the second terminal 200 also uses direct system memory access to directly copy the received data to the system memory through the system bus.
  • the application software of the second terminal 200 can process the data in the system memory.
  • Such a minimal WiFi transmission path can effectively reduce the time consumed for data transmission of point-to-point services, effectively reduce system load, reduce transmission delay, and increase WiFi throughput.
  • the data transmission of the first terminal 100 it can also be monitored whether the confirmation frame or the retransmission request frame returned by the second terminal 200 is received within a preset period of time. If the confirmation frame returned by the second terminal 200 is received, it can be determined that the data transmission is successful. If the retransmission request frame returned by the second terminal 200 is received, the data that needs to be retransmitted can be determined according to the retransmission request frame, and then the data that needs to be retransmitted is sent to the second terminal 200 again to ensure the integrity and accuracy of the data sex.
  • the second terminal 200 may generate a confirmation frame and return the confirmation frame to the first terminal 100 when it is determined that the received data is complete and meet the preset conditions, so that the first terminal 100 can determine whether the data transmission is successful.
  • the second terminal 200 may also return a retransmission request frame to the first terminal 100 after determining that the received data is incomplete or does not meet the preset conditions, so that the first terminal 100 can retransmit the data to the second terminal according to the retransmission request frame. terminal.
  • the first terminal 100 may also return another feedback message to inform the second terminal that the confirmation frame has been received.
  • the peer-to-peer communication network between the first terminal 100 and the second terminal 200 is faulty. It may be instructed to re-establish the point-to-point communication with the second terminal 200. It is understandable that re-establishing the point-to-point communication with the second terminal 200 can be the first terminal 100 automatically reconnecting, or it can return prompt information to the user, and the user can choose whether to reconnect or not, and if the user chooses to reconnect Next, point-to-point communication with the second terminal 200 is established again, which will not be repeated here.
  • FIG. 5 shows a schematic diagram of a scenario of a data transmission method provided by an embodiment of the present application
  • the first terminal 100 includes a user-mode application software layer 151, a D2D service layer 152, and a PCIE driver layer 153.
  • the second terminal 200 also includes a user mode application software layer 251, a D2D service layer 252, a PCIE driver layer 253, and a second communication module 254.
  • the above-mentioned first communication module 154 and second communication module 254 may be WiFi chips, or other communication chips capable of implementing point-to-point wireless communication, such as Bluetooth chips.
  • the above-mentioned communication chip may be integrated in the WiFi module 170 as shown in FIG. 3, which can realize the point-to-point communication between the first terminal 100 and other terminals.
  • the first communication module 154 and the second communication module 254 are WiFi chips as an example for description.
  • the application data in the buffer area containing the data to be sent (ie application data frame) can be used in the D2D service Layer 152 performs fragmentation processing. Add a data header to each data fragment, apply for the fragmentation system memory space for each data fragment, and store each data fragment in the corresponding fragmentation system memory space. Then copy the data slices stored in the memory space of the slice system to the sending queue of the first communication module 154 through the PCIE data bus.
  • the first communication module 154 slices the data in the sending queue based on the 802.11 MAC/PHY layer control protocol The corresponding wireless network field is added to generate a message, and then the message is sent to the second terminal 200 based on the communication port of the first communication module 154.
  • the second communication module 254 of the second terminal 200 receives the message sent by the first communication module 154, it can obtain the application data contained in the message, and the second communication module 254 will directly transfer the received application data
  • the D2D service layer 252 can process the data stored in the system memory, such as data reorganization, and restore the received data to data frames that can be directly processed by user-mode application software.
  • the state application software can directly process the data frame, for example, it can directly read the data in the specified system memory area for display. If some fragments are found to be missing during the data reorganization process, a retransmission request frame may be sent to the first terminal 100 according to the missing fragments to request the first terminal 100 to retransmit the missing fragment data. If an error is found in the recombined data during the data recombination process, it is also possible to request the first terminal 100 to retransmit all the application data by sending a retransmission request frame to the first terminal 100. If the data is complete and meets expectations after the data is reorganized, an acknowledgement frame (ACK frame) is returned to the first terminal 100.
  • ACK frame acknowledgement frame
  • the first terminal 100 When receiving the retransmission request frame, the first terminal 100 determines the data to be retransmitted according to the content of the retransmission request frame, and then sends the data to be retransmitted to the second terminal 200 according to the above-mentioned data transmission process.
  • the first terminal 100 can also return a successful data transmission instruction to the user-mode application software when receiving the confirmation frame returned by the second terminal 200 to indicate that the data transmission is successful.
  • FIG. 6 shows the display interface of the video playback software on the mobile phone and the display interface after the screen projection function is triggered.
  • the video playback software on the mobile phone can have a screen projection function.
  • the user touches the projection control 401 on the touch screen to trigger the projection function.
  • the mobile phone can display a selection list of connected devices for the user to choose.
  • the terminal device that transmits data that is, the user can select the corresponding terminal device in the list, for example, select the living room TV.
  • the mobile phone will establish a point-to-point communication with the living room TV.
  • the mobile phone obtains the video data through the video playback software, and then uses the direct system memory access method to copy the video data frame from the system memory to the video data through the PCIE bus.
  • the WiFi chip of the phone sends the video data to the WiFi chip of the TV (ie the second communication module) based on the 802.11MAC/PHY layer protocol, and the WiFi chip of the TV
  • the direct system memory access method is also adopted, and the received video is copied to the system memory of the TV through its PCIE bus, so that the TV playback application can directly read the video data in the specified system memory area Play it.
  • the WiFi chip does not need to use the complex TCP/IP protocol stack to transmit data. It only needs to communicate between devices through system memory copy and MAC/PHY layer two forwarding, which can effectively reduce the time of data transmission. Delay, reduce system load, and improve WiFi throughput.
  • the WiFi chip can still communicate using the traditional TCP/IP protocol stack, which will not be repeated here.
  • FIG. 7 shows a schematic flowchart of a data transmission method provided by an embodiment of the present application. As shown in FIG. 7, the data transmission method specifically includes the following steps:
  • S110 The first terminal establishes point-to-point communication with the second terminal.
  • the first terminal can use its WiFi chip to connect to the WiFi chip of the second terminal for WiFi Direct, and it can also make the first terminal work in a device that can provide wireless access services and allow other wireless devices to access.
  • the AP mode Access Point mode
  • STA mode Selection mode
  • the user can select the object (that is, the data receiving end) that needs to transmit data.
  • the first terminal can display a selection list of connected devices for the user to select the terminal device that needs to transmit data, and the user can select the second terminal from the list.
  • the first terminal will initiate a connection request to the second terminal, and the second terminal can establish point-to-point communication between the two by responding to the connection request. After the two have established a connection, they can exchange data through the established point-to-point communication.
  • the first terminal obtains the application data frame, and determines whether the data size of the application data frame exceeds the fragmentation threshold; if so, execute S130, otherwise execute S140.
  • the user mode application software of the first terminal can determine the application data frame that needs to be transmitted to the second terminal.
  • the image to be shared to the second terminal is selected from the photo album of the first terminal, and the object selected by the user at this time is the application data frame that needs to be transmitted.
  • the application data frames can be fragmented.
  • the fragmentation threshold can be determined based on the maximum transmission capacity of the transmission link, which is not limited here. If the data size of the application data frame does not exceed the fragmentation threshold, it means that data transmission can be completed by only one wireless message data. If the data size of the application data frame exceeds the fragmentation threshold, it means that the application data frame cannot be transmitted through only one wireless data message. Therefore, the application data frame needs to be fragmented, and then the data fragments are transmitted to the second terminal.
  • the first terminal to perform data fragmentation processing on the application data frame may be implemented in the D2D service layer.
  • the application data frame is fragmented through D2D, and a data header is added to each data fragment.
  • the header is used to instruct the second terminal to perform data reorganization on each data fragment after receiving each of the data fragments, so as to restore the application data frame.
  • the above-mentioned data header may include an identifier field, a flag field, and a slice offset field.
  • the flag field can occupy 3 bits, and the lowest bit, MF (More Fragment), is used to distinguish the last slice of the application data frame from the other previous slices. If the flag bit MF is 0, it indicates that the data fragment is the last data fragment of the application data frame; if the flag MF is 1, it indicates that the data fragment is not the last data fragment of the application data frame.
  • the identifier can occupy 16 bits and is used by the second terminal to reassemble each fragment of the application data frame into the original application data frame.
  • the value of the identifier is copied to all the data fragments.
  • the identifier field of the slice In this way, the second terminal can correctly reassemble the data fragments with the same value of the identifier field into the original data frame.
  • the slice offset field can occupy 13 bits, which represents the offset of the slice in the original data.
  • the data header can also contain the corresponding segment code of each data segment.
  • the aforementioned segment code is used to identify the sequence number of each segment.
  • the D2D service layer directly allocates system memory space for application data frames that do not need to be fragmented, and then stores the application data frame in the corresponding system memory space.
  • DMA direct system memory access
  • PCIE high-speed serial computer expansion bus
  • SDIO Secure Digital Bus
  • the data slicing stored in the memory space of the slicing system can also be copied to the sending queue of the first communication module through the PCIE data bus.
  • S160 Send the data in the sending queue to the second terminal wirelessly connected to the first terminal through the communication port of the first communication module.
  • the first communication module adds corresponding wireless network fields to the data in the sending queue based on the 802.11 MAC/PHY layer control protocol to generate a message, and then sends the message to The second terminal.
  • the corresponding wireless network field can be added to the data to be transmitted through the Media Access Control (MAC) layer to generate a MAC data frame. That is, by adding the MAC header and check tail, and then sending the MAC data frame to the physical layer PHY (Physical), the data from the MAC will be received, and an error detection code will be added for every 4 bits, and then the parallel data will be converted into a string
  • the line data stream data is encoded in accordance with the encoding rules of the physical layer (NRZ encoding or Manchester encoding), and then converted into an analog signal to send the data.
  • the process of receiving data is the opposite, that is, the decoding process. It should also be noted that the specific implementation of adding the corresponding wireless network field to the data to be transmitted to generate the MAC data frame can refer to the 802.11 MAC/PHY layer control protocol, which will not be repeated here.
  • S170 The first terminal monitors whether the confirmation frame returned by the second terminal is received within a preset time interval, if so, it is determined that the data transmission is successful, otherwise, S180 is executed.
  • Figure 9 shows a schematic diagram of the interaction of the data transmission confirmation process.
  • the first terminal sends the data to the second terminal, it must be monitored at a preset time. Whether the confirmation frame returned by the second terminal is received within the interval. If the confirmation frame returned by the second terminal is received, it can be determined that the data has been sent successfully, and the system memory space previously allocated for application data frames or data fragments can be released.
  • the second terminal After the second terminal receives the data sent by the first communication module of the first terminal, the second terminal checks the received data to verify whether the received data is the same as the application data frame sent by the first terminal Consistent, if it is determined that the received data is consistent with the application data frame sent by the first terminal, the second terminal will return an acknowledgement frame to the first terminal to inform the first terminal that the data has been received. It should be noted that the foregoing preset time interval can be set according to actual application scenarios, and is not limited here.
  • the first terminal monitors whether a retransmission request frame returned by the second terminal is received within a preset time interval, and if so, execute S190, otherwise it is determined that the data link is faulty.
  • the first terminal determines the data to be retransmitted according to the retransmission request frame, and sends the data to be retransmitted to the second terminal through the communication port of the first communication module, and returns to execute S170.
  • FIG. 10 shows an interactive schematic diagram of the data transmission and retransmission process.
  • the second terminal when the second terminal detects that the received data is missing or the received data does not meet the preset condition, it will return a retransmission request frame to the first terminal.
  • the first terminal will determine the data that needs to be retransmitted according to the retransmission request frame, and then process the data that needs to be retransmitted according to steps S120 to S160, and send the data that needs to be retransmitted to the second terminal. Then return to S170, that is, continue to monitor whether the confirmation frame returned by the second terminal is received within the preset time interval. To ensure that the data is accurate.
  • FIG. 11 shows a schematic flowchart of the data reorganization process.
  • the above data reorganization process includes the following steps:
  • each data segment has a data header
  • the data header contains a segment code used to distinguish each data segment
  • the data segment of each data segment can be determined by parsing the data header of each data segment. ⁇ coding.
  • S22 Determine whether the received data is complete based on the fragment coding, if yes, perform S23, otherwise, generate a retransmission confirmation frame according to the missing data fragments, and return the retransmission confirmation frame to the first terminal.
  • the first terminal divides the application data frame into 5 data slices, and sets the slice code of the first data slice to 1, and sets the slice code of the second data slice to 2, and sets the slice code of the second data slice to 2, respectively.
  • the slice code of the data slice is set to 3
  • the slice code of the fourth data slice is set to 4
  • the slice code of the fifth data slice is set to 5.
  • the second terminal will generate a corresponding retransmission confirmation frame based on the missing data fragments, and then send the retransmission confirmation frame to the first terminal to request the first terminal to re-encode the fragments into 2 data fragments Send it over.
  • the second terminal receives data fragments whose fragment codes are 1, 2, 3, 4, and 5, it can be determined that the data received by the first terminal is complete, and the received fragments can be The data is reorganized.
  • the process of data reorganization on data fragments may be performed in the D2D service layer of the second terminal.
  • the data is reorganized through the fragment number, identifier field, flag field, and fragment offset field in the data header of each data fragment. Determine the data fragments of the same application data frame based on the flag field, and then concatenate the data fragments in the data fragments sequentially based on the fragment number and fragment offset fields, and then determine whether the current data fragment is the application based on the identifier field If it is the last fragment of the data frame, the data reorganization is completed; if not, continue to restore the data based on the fragment number and the fragment offset field.
  • the data segment that causes the data recombination failure is determined, and then a corresponding retransmission confirmation frame is generated based on the data segment, and the retransmission confirmation frame is sent to the first terminal to instruct the first terminal Send the data fragment again.
  • the data volume of the restored data can be compared with the data volume of the application data frame sent by the first terminal. If they are consistent, it indicates whether the restored data meets the preset conditions.
  • the preset conditions can be set according to actual applications and are not limited here.
  • a confirmation frame can be returned to the first terminal, so that the first terminal can confirm that the data transmission is successful. If the restored data fails the verification (that is, the restored data does not meet the preset conditions), the first terminal can be requested again to retransmit all the data once, that is, a retransmission confirmation frame requesting the retransmission of all data can be generated, and then the retransmission confirmation frame can be generated. The retransmission confirmation frame is returned to the first terminal.
  • Table 1 shows a time-consuming statistical table of the traditional TCP/IP sending and receiving process.
  • Table 1 shows a time-consuming statistical table of the traditional TCP/IP sending and receiving process.
  • Table 1 shows a time-consuming statistical table of the traditional TCP/IP sending and receiving process.
  • Table 1 shows a time-consuming statistical table of the traditional TCP/IP sending and receiving process.
  • Table 1 shows a time-consuming statistical table of the traditional TCP/IP sending and receiving process.
  • Table 1 shows a time-consuming statistical table of the traditional TCP/IP sending and receiving process.
  • the data transmission method provided in this embodiment copies the data in the system memory to the sending queue of the first communication module through the system bus, and then sends the data to the second terminal based on the first communication module.
  • the communication between devices is carried out directly through system memory copy and MAC/PHY layer two forwarding, which greatly optimizes the load and delay of WiFi packet forwarding, which can effectively reduce the time consumed by point-to-point service data transmission and effectively reduce
  • the load of the system reduces the transmission delay and improves the throughput rate of WiFi.
  • an embodiment of the present application provides a data transmission device.
  • This device embodiment corresponds to the foregoing method embodiment.
  • this device embodiment no longer compares the previous method embodiments. The details will be repeated one by one, but it should be clear that the device in this embodiment can correspondingly implement all the content in the foregoing method embodiment.
  • FIG. 12 shows a structural block diagram of a data transmission device provided by an embodiment of the present application.
  • the units included in the data transmission device are used to perform the steps in the foregoing embodiment.
  • the data transmission device 10 includes a first system memory copy unit 11 and a sending unit 12. in:
  • the first system memory copy unit 11 is configured to copy the application data frame stored in the system memory to the sending queue of the first communication module through the data bus.
  • the sending unit 12 is configured to send the application data frame in the sending queue to a second terminal in point-to-point communication with the first terminal through the communication port of the first communication module.
  • the device further includes a fragmentation unit.
  • the fragmentation unit is configured to perform fragmentation processing on the application data frame if the data size of the application data frame exceeds the fragmentation threshold, and store each data fragment in a corresponding system memory space;
  • the first system memory copy unit is configured to copy the fragment data from the system memory space of each data fragment to the sending queue of the first communication module
  • the sending unit is configured to send the data fragments to the second terminal sequentially through the communication port of the first communication module based on the sending queue.
  • the device further includes a retransmission unit.
  • the retransmission unit is configured to, if a retransmission request frame sent by the second terminal is received, determine the data to be retransmitted according to the retransmission request frame, and transmit the data to be retransmitted through the communication port of the first communication module.
  • the retransmission data is sent to the second terminal; the retransmission request frame is generated by the second terminal when it is determined that the fragmented data is missing or the reorganized data does not meet a preset condition.
  • the device further includes a determining unit.
  • the determining unit is configured to determine that the data transmission is successful if the data confirmation frame sent by the second terminal is received; the data confirmation frame is used by the second terminal to perform data reorganization according to the received data and determine that the data is complete and complete Generated after meeting preset conditions.
  • the fragmentation unit is specifically configured to: if the data size of the application data frame exceeds a fragmentation threshold, divide the application data frame into several data fragments according to the maximum data transmission length of the network. And add a data header to each data fragment.
  • the data header is used to instruct the second terminal to perform data reorganization on each data fragment after receiving each of the data fragments to restore the application data frame.
  • the data transmission device provided by the embodiment of the present application can also copy the data in the system memory to the sending queue of the first communication module through the system bus, and then send the data to the second communication module based on the first communication module. terminal.
  • the communication between devices is carried out directly through system memory copy and MAC/PHY layer two forwarding, which greatly optimizes the load and delay of WiFi packet forwarding, which can effectively reduce the time consumed by point-to-point service data transmission and effectively reduce The load of the system reduces the transmission delay and improves the throughput rate of WiFi.
  • FIG. 13 shows a structural block diagram of another data transmission device provided by an embodiment of the present application.
  • the data transmission device 20 includes a receiving unit 21 and a second system memory copying unit 22. in:
  • the receiving unit 21 is configured to receive an application data frame; the application data frame is the first terminal that is in point-to-point communication with the second terminal and is copied from the system memory of the first terminal to the first terminal through the data bus of the first terminal.
  • a sending queue of a communication module and sending the application data frame in the sending queue to the second terminal through the communication port of the first communication module.
  • the second system memory copy unit 22 is configured to copy the application data frame to the system memory of the second terminal through the data bus of the second terminal.
  • the received application data frame includes several data fragments; correspondingly, the device further includes a recombination unit.
  • the reorganization unit is used to reorganize the data fragments.
  • the device further includes: a confirmation retransmission unit.
  • the confirming retransmission unit is used to generate a retransmission request frame according to the data that needs to be retransmitted if there is missing data fragmentation or the reassembled data does not meet the preset condition, and return the retransmission request frame to the first terminal
  • the retransmission request frame is used to instruct the first terminal to resend the data that needs to be retransmitted.
  • the device further includes: a confirmation return unit.
  • the confirmation returning unit is configured to return a confirmation frame to the first terminal if the reorganized data is complete and in line with expectations.
  • the data transmission device provided by the embodiment of the present application can also directly copy the received data to the system memory through the system bus, so that the application software can directly process the data stored in the system memory, effectively Reduce the time consumed by point-to-point service data transmission, effectively reduce system load, reduce transmission delay, and increase WiFi throughput.
  • FIG. 14 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 140 of this embodiment includes: at least one processor 143 (only one is shown in FIG. 14), a memory 141, and is stored in the memory 141 and can be stored in the at least one processor 143.
  • the processor 143 executes the computer program 142, the steps in any of the foregoing data transmission method embodiments are implemented.
  • the terminal device 140 may be a desktop computer, a notebook, a palmtop computer and other devices.
  • the terminal device may include, but is not limited to, a processor 143 and a memory 141.
  • FIG. 14 is only an example of the terminal device 140, and does not constitute a limitation on the terminal device 140. It may include more or less components than shown in the figure, or a combination of certain components, or different components. , For example, can also include input and output devices, network access devices, and so on.
  • the so-called processor 143 may be a central processing unit (CPU), and the processor 143 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 141 may be an internal storage unit of the terminal device 140 in some embodiments, such as a hard disk or system memory of the terminal device 140. In other embodiments, the memory 141 may also be an external storage device of the terminal device 114, such as a plug-in hard disk equipped on the terminal device 140, a smart media card (SMC), and a secure digital (Secure Digital, SD) card, Flash Card, etc. Further, the memory 141 may also include both an internal storage unit of the terminal device 114 and an external storage device. The memory 141 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program. The memory 141 can also be used to temporarily store data that has been output or will be output.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned data transmission method can be realized.
  • the embodiments of the present application provide a computer program product.
  • the computer program product runs on a mobile terminal, the steps in the above data transmission method can be realized when the mobile terminal is executed.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), and random access memory (RAM, Random Access Memory), electric carrier signal, telecommunications signal and software distribution medium.
  • ROM read-only memory
  • RAM random access memory
  • electric carrier signal telecommunications signal and software distribution medium.
  • U disk mobile hard disk, floppy disk or CD-ROM, etc.
  • computer-readable media cannot be electrical carrier signals and telecommunication signals.
  • the disclosed apparatus/network equipment and method may be implemented in other ways.
  • the device/network device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units.
  • components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be separately on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请提供了一种数据传输方法、装置及系统,通过系统总线将系统内存中的数据拷贝到第一通信模块的发送队列中,再基于第一通信模块发送数据到第二终端。直接通过系统内存拷贝和MAC/PHY二层转发的方式进行设备间通信,极大优化了WiFi报文转发的负载和时延,能够有效地减少点对点业务的数据传输所消耗的时间,有效地减少系统的负载,减低传输时延,提高WiFi的吞吐率。

Description

一种数据传输方法、装置及系统
本申请要求于2020年02月24日提交国家知识产权局、申请号为202010115820.0、申请名称为“一种数据传输方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,尤其涉及一种数据传输方法、装置及系统。
背景技术
点对点(Device to Device,D2D)通信技术是指两个对等的用户节点(设备)之间直接进行通信的一种通信方式,WiFi Direct是一种能够实现点对点业务的通信模式,其能够实现两个设备之间进行高速的数据通信,其数据传输基于TCP/IP协议,具有数据传输速度快及传输距离远等优点。图1示出了现有的基于TCP/IP协议进行数据传输的过程示意图,如图1所示,发生方在发送报文时,应用软件对需要发送的数据包,按TCP/IP协议规范进行报文的封装,封装后的数据包可以在局域网(LAN)或广域网(WAN)网中实现转发。接收方在收到数据后,同样按TCP/IP协议规范对报文进行解封装,还原成用户需要的数据。然而在点对点业务中采用TCP/IP协议进行WiFi报文转发需要对报文进行封装和解封,这无疑会增加点对点业务的数据传输所消耗的时间,也会增加系统的负载,同时也降低了WiFi的吞吐率。
发明内容
本申请提供一种数据传输方法、装置及系统,解决了现有技术中点对点业务的数据传输消耗时间长,系统负载大,WiFi的吞吐率低的问题。
为达到上述目的,本申请采用如下技术方案:
第一方面,提供一种数据传输方法,应用于第一终端,包括:
将存储在系统内存中的应用数据帧通过数据总线拷贝至第一通信模块的发送队列;
通过所述第一通信模块的通信端口将所述发送队列中的所述应用数据帧发送至与所述第一终端点对点通信的第二终端。
所述应用数据帧用于指示所述第二终端采用与所述应用数据帧对应的数据处理方式进行数据处理,所述与所述应用数据帧对应的数据处理方法为通过所述第二终端的数据总线将所述应用数据帧拷贝至所述第二终端的系统内存中进行处理。
在本实施例中,通过系统总线将系统内存中的数据拷贝到第一通信模块的发送队列中,再基于第一通信模块发送数据到第二终端。直接通过系统内存拷贝和MAC/PHY二层转发的方式进行设备间通信,极大优化了WiFi报文转发的负载和时延,能够有效地减少点对点业务的数据传输所消耗的时间,有效地减少系统的负载,减低传输时延,提高WiFi的吞吐率。
在第一方面的一种可能的实施方式中,在将存储在系统内存中的应用数据帧通过 数据总线拷贝至第一通信模块的发送队列之前,还包括:
若所述应用数据帧的数据大小超过分片门限,则对所述应用数据帧进行分片处理,并将各个数据分片存储到对应的系统内存空间中;
相应地,所述将存储在系统内存中的应用数据帧通过数据总线拷贝至第一通信模块的发送队列,包括:
分别从各个存储数据分片的系统内存空间中拷贝所述分片数据至所述第一通信模块的发送队列;
相应地,所述通过所述第一通信模块的通信端口将所述发送队列中的应用数据帧发送至与所述第一终端无线连接第二终端,包括:
基于所述发送队列依次通过所述第一通信模块的通信端口将所述数据分片发送至所述第二终端。
在本实施例中,对于超过分片门限的应用数据帧进行数据分片,并针对数据分片进行数据传输,能够传输大于网络最大数据传输长度的应用数据。
在第一方面的一种可能的实施方式中,所述数据传输方法还包括:
若接收到所述第二终端发送的重传请求帧,则根据所述重传请求帧确定待重传数据,并通过所述第一通信模块的通信端口将所述待重传数据发送至所述第二终端;所述重传请求帧是由第二终端在确定分片数据缺失或重组数据不符合预设条件时生成的。基于重传请求帧发送需要重传的数据,能够及时将缺失或不符合预设条件的数据分片进行重发,保证数据的完整性和准确性。
在第一方面的一种可能的实施方式中,所述数据传输方法还包括:
若接收到所述第二终端发送的数据确认帧,则确定数据传输成功;所述数据确认帧是由所述第二终端根据接收到的数据进行数据重组并确定数据完整且符合预设条件后生成的。基于确认帧,能够快速确认数据传输是否成功,提高数据传输的可靠性。
在第一方面的一种可能的实施方式中,所述若所述应用数据帧的数据大小超过分片门限,则对所述应用数据帧进行分片处理,并为各个数据分片分配系统内存空间,包括:若所述应用数据帧的数据大小超过分片门限,则根据网络最大数据传输长度将所述应用数据帧分成若干个数据分片,并为各个数据分片添加数据头,所述数据头用于指示第二终端在接收到各个所述数据分片后,对各个数据分片进行数据重组,还原所述应用数据帧。为各个分片数据添加数据头便于数据重组。
第二方面,提供一种数据传输方法,应用于第二终端,包括:
接收应用数据帧;所述应用数据帧是与所述第二终端点对点通信的第一终端通过第一终端的数据总线从第一终端的系统内存中拷贝至第一终端的第一通信模块的发送队列,并通过所述第一通信模块的通信端口将所述发送队列中的所述应用数据帧发送至所述第二终端的;
将所述应用数据帧通过所述第二终端的数据总线拷贝至所述第二终端的系统内存中。
在本实施例中,通过系统总线将接收到的数据直接拷贝至系统内存中,使得应用软件能够直接处理存储在系统内存中的数据,有效地减少点对点业务的数据传输所消耗的时间,有效地减少系统的负载,减低传输时延,提高WiFi的吞吐率。
在第二方面的一种可能的实现方式中,接收到的所述应用数据帧包括若干数据分片;
相应地,在将所述应用帧通过数据总线拷贝至系统内存,所述系统内存为应用软件能够直接处理存储在里面的数据的系统内存空间之后,还包括:对所述数据分片进行数据重组。对分片数据进行数据重组,还原数据至应用软件能够直接处理的数据,便于应用软件处理该数据。
在第二方面的一种可能的实现方式中,所述数据传输方法还包括:若存在缺失数据分片或重组数据不符合预设条件,则根据需要重传的数据生成重传请求帧,并将所述重传请求帧返回至所述第一终端,所述重传请求帧用于指示所述第一终端重新发送需要重传的数据。基于重传请求帧发送需要重传的数据,能够及时获取到缺失或不符合预设条件的数据分片,保证数据的完整性和准确性。
在第二方面的一种可能的实现方式中,所述数据传输方法还包括:若重组后的数据完整且符合预期,则返回确认帧至所述第一终端。基于确认帧,能够使得第一终端在第一时间确认数据传输成功,提高数据传输的可靠性。
第三方面,提供了一种数据传输装置,应用于第一终端,包括:
第一系统内存拷贝单元,用于将存储在系统内存中的应用数据帧通过数据总线拷贝至第一通信模块的发送队列;
发送单元,用于通过所述第一通信模块的通信端口将所述发送队列中的所述应用数据帧发送至与所述第一终端点对点通信的第二终端。
在第三方面的一种可能的实施方式中,该装置还包括分片单元。
分片单元,用于若所述应用数据帧的数据大小超过分片门限,则对所述应用数据帧进行分片处理,并将各个数据分片存储到对应的系统内存空间中;
相应地,第一系统内存拷贝单元用于分别从各个存储数据分片的系统内存空间中拷贝所述分片数据至所述第一通信模块的发送队列;
相应地,发送单元用于基于所述发送队列依次通过所述第一通信模块的通信端口将所述数据分片发送至所述第二终端。
在第三方面的一种可能的实施方式中,所述装置还包括重传单元。
重传单元用于,若接收到所述第二终端发送的重传请求帧,则根据所述重传请求帧确定待重传数据,并通过所述第一通信模块的通信端口将所述待重传数据发送至所述第二终端;所述重传请求帧是由第二终端在确定分片数据缺失或重组数据不符合预设条件时生成的。
在第三方面的一种可能的实施方式中,所述装置还包括确定单元。
确定单元用于,若接收到所述第二终端发送的数据确认帧,则确定数据传输成功;所述数据确认帧是由所述第二终端根据接收到的数据进行数据重组并确定数据完整且符合预设条件后生成的。
在第三方面的一种可能的实施方式中,所述分片单元具体用于:若所述应用数据帧的数据大小超过分片门限,则根据网络最大数据传输长度将所述应用数据帧分成若干个数据分片,并为各个数据分片添加数据头,所述数据头用于指示第二终端在接收到各个所述数据分片后,对各个数据分片进行数据重组,还原所述应用数据帧。
第四方面,提供一种数据传输装置,应用于第二终端,包括:
接收单元,用于接收应用数据帧;所述应用数据帧是与所述第二终端点对点通信的第一终端通过第一终端的数据总线从第一终端的系统内存中拷贝至第一终端的第一通信模块的发送队列,并通过所述第一通信模块的通信端口将所述发送队列中的所述应用数据帧发送至所述第二终端的;
第二系统内存拷贝单元,用于将所述应用数据帧通过所述第二终端的数据总线拷贝至所述第二终端的系统内存中。
在第四方面的一种可能的实现方式中,接收到的所述应用数据帧包括若干数据分片;相应地,所述装置还包括重组单元。
重组单元用于对所述数据分片进行数据重组。
在第四方面的一种可能的实现方式中,所述装置还包括:确认重传单元。
确认重传单元用于,若存在缺失数据分片或重组数据不符合预设条件,则根据需要重传的数据生成重传请求帧,并将所述重传请求帧返回至所述第一终端,所述重传请求帧用于指示所述第一终端重新发送需要重传的数据。
在第四方面的一种可能的实现方式中,所述装置还包括:确认返回单元。
确认返回单元,用于若重组后的数据完整且符合预期,则返回确认帧至所述第一终端。
第五方面,本申请实施例提供一种终端设备,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在调用所述计算机程序时执行上述第一方面或第二方面所述的方法。
第六方面,本申请实施例提供一种数据传输系统,其特征在于,包括:第一终端和第二终端,其中,第一终端用于执行上述第一方面所述的方法,所述第二终端用于执行上述第二方面所述的方法。
第七方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述第一方面或第二方面所述的方法。
第八方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得终端设备执行上述第一方面或第二方面所述的方法。
可以理解的是,上述第三方面至第八方面的有益效果可以参见上述第一方面或第二方面中的相关描述,在此不再赘述。
附图说明
图1为现有的基于TCP/IP协议进行数据传输的过程示意图;
图2为本申请实施例提供的数据传输系统的结构示意图;
图3为本申请实施例提供的一种数据传输方法所适用于的手机的硬件结构示意图;
图4为本申请实施例提供的一种数据传输方法所适用于的手机的软件结构示意图;
图5为本申请实施例提供的一种数据传输方法的场景示意图;
图6为手机上的视频播放软件的显示界面和触发投屏功能后的显示界面示意图;
图7为本申请实施例提供的一种数据传输方法的实现流程示意图;
图8为本申请实施例提供的数据传输方法中分片数据的数据头的结构示意图;
图9为本申请提供的数据传输方法中数据传输确认过程的交互示意图;
图10为本申请提供的数据传输方法中数据传输重传过程的交互示意图;
图11为本申请提供的数据传输方法中数据重组过程的流程示意图;
图12为本申请实施例提供的一种数据传输装置的结构框图;
图13为本申请实施例提供的另一种数据传输装置的结构框图;
图14为本申请实施例提供的终端设备的结构示意图。
具体实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
针对目前点对点业务的数据传输消耗时间长,系统负载大,WiFi的吞吐率低的问题,本申请实施例提供一种登录认证方法、系统及终端设备,通过系统总线将系统内存中的数据拷贝到第一通信模块的发送队列中,再基于第一通信模块发送数据到第二终端。直接通过系统内存拷贝和MAC/PHY二层转发的方式进行设备间通信,未采用传统TCP/UDP传输层协议与IP网络层协议,极大优化了WiFi报文转发的负载和时延,能够有效地减少点对点业务的数据传输所消耗的时间,有效地减少系统的负载,减低传输时延,提高WiFi的吞吐率。
下面以具体地实施例对本申请的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
图2为本申请实施例提供的数据传输系统的结构示意图,如图2所示,本实施例提供的数据传输系统可以包括:第一终端100和第二终端200。第一终端100和第二终端200可以通过建立点对点(Device to Device,D2D)的通信连接,使得第一终端100和第二终端200能够直接进行数据共享,例如进行投屏演示、分享文件、克隆应用业务场景等。这些业务场景的特点是WiFi数据报文不需要在局域网(LAN)或广域网(WAN)网中转发,通常利用WiFi P2P模式来建立两台设备之间的点对点通信连接,或者将一台终端设备工作在AP模式,另一台终端工作在STA模式,并将STA关联AP,在两个终端间建立起WiFI链路。
在本实施例中,上述第一终端设备100可以是诸如车载终端、电视(智能电视)、投影仪、智能音箱和台式电脑等的非便携设备,也可以是诸如手机、平板电脑、笔记本电脑等的便携设备。上述第二终端200同样也可以是诸如车载终端、智能电视、智能音箱和台式电脑等的非便携设备,也可以是诸如手机、平板电脑、笔记本电脑、智能可穿戴设备等的便携设备。其中,第一终端100和第二终端200的数量均为至少一个,具体数量本实施例不做特别限定。
需要说明的是,本实施例中,第一终端100和第二终端200之间没有严格的区分关系,对于同一终端设备,在一些场景中可以作为第一终端100使用,在另一些场景中也可以作为第二终端200使用。例如:在某场景中,可以通过手机将数据传输给电视;在另一场景中,也可以通过平板电脑将数据传输给手机。
另外,在进行数据传输的过程中,可以是通过第一终端100传输数据给第二终端200,也可以是第二终端200传输数据给第一终端100。例如:在某场景中,可以通过手机将共享数据传输给平板电脑;在另一场景中,也可以通过平板电脑将共享数据传输给手机本申请实施例中是以通过第一终端100将共享数据传输给第二终端200的数据传输过程为例进行示例性说明。
在本实施例中,上述第一终端100可以是具备如图3所示的硬件结构的手机100,如图3所示,手机100具体可以包括:射频(Radio Frequency,RF)电路110、存储器120、输入单元130、显示单元140、传感器150、音频电路160、短距离无线通信模块170、处理器180、以及电源190等部件。本领域技术人员可以理解,图3中示出的手机100的结构并不构成对终端设备的限定,终端设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图3对手机的各个构成部件进行具体的介绍:
RF电路110可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器180处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路110还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。
存储器120可用于存储软件程序以及模块,处理器180通过运行存储在存储器120的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器120可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元130可用于接收输入的数字或字符信息,以及产生与手机100的用户设置以及功能控制有关的键信号输入。具体地,输入单元130可包括触控面板131以及其他输入设备132。触控面板131,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板131上或在触控面板131附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板131可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器180,并能接收处理器180发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板131。除了触控面板131,输入单元130还可以包括其他输入设备132。具体地,其他输入设备132可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元140可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元140可包括显示面板141,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板141。进一步的,触控面板131可覆盖显示面板141,当触控面板131检测到在其上或附近的触摸操作后,传送给处理器180以确定触摸事件的类型,随后处理器180根据触摸事件的类型在显示面板141上提供相应的视觉输出。虽然在图3中,触控面板131与显示面板141是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板131与显示面板141集成而实现手机的输入和输出功能。
手机100还可包括至少一种传感器150,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在手机移动到耳边时,关闭显示面板141和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路160、扬声器161,传声器162可提供用户与手机之间的音频接口。音频电路160可将接收到的音频数据转换后的电信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,传声器162将收集的声音信号转换为电信号,由音 频电路160接收后转换为音频数据,再将音频数据输出处理器180处理后,经RF电路110以发送给比如另一手机,或者将音频数据输出至存储器120以便进一步处理。
WiFi属于短距离无线传输技术,手机通过WiFi模块170可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。上述WiFi模块170可以包括WiFi芯片,通过该WiFi芯片可以实现手机100与其他终端设备进行WiFi Direct连接的功能。也可以使手机100工作在能够提供无线接入服务,允许其它无线设备接入的AP模式(Access Point模式)或工作在可以连接到AP不接受无线设备接入的STA模式(Station模式),从而建立手机100与其他WiFi设备的点对点通信。
处理器180是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器180可包括一个或多个处理单元;优选的,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。
手机100还包括给各个部件供电的电源190(比如电池),优选的,电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
手机100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明手机100的软件结构。
图4是本申请实施例的手机100的软件结构框图。将Android系统分为四层,分别为应用程序层、应用程序框架层(framework,FWK)、系统层以及硬件抽象层,层与层之间通过软件接口通信。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图4所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图4所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。在一些实施例中,上述内核层还包含PCIE驱动。
需要说明的是,上述第二终端200也可以是具有如图3所示的硬件结构和如图4所示的软件结构的手机,在此不再加以赘述。
在本实施例中,对于第一终端100(即发送端),可以通过应用软件启动数据传输的过程,然后采用直接系统内存存取(Direct Memory Access,DMA)通过系统总线(例如高速串行计算机扩展总线(Peripheral Component Interconnect Express,PCIE)、SDIO总线)将需要发送的应用数据帧拷贝到WiFi芯片的发送序列中,然后由WiFi芯片通过802.11MAC/PHY层控制协议将应用数据帧通过通信端口(如空中接口)发送到第二终端200(即接收端),第二终端200在接收到该应用数据帧后,同样采用直接系统内存存取通过系统总线直接将接收到的数据拷贝到系统内存中,第二终端200的应用 软件就能够处理系统内存中的数据。这样极简的WiFi传输通路能够有效地减少点对点业务的数据传输所消耗的时间,有效地减少系统的负载,减低传输时延,提高WiFi的吞吐率。
此外,第一终端100数据发送完成后,还可以监测在一段预设时间内是否接收到第二终端200返回的确认帧或重传请求帧。若接收到第二终端200返回的确认帧,则可以确定数据传输成功。若接收到第二终端200返回的重传请求帧,则可以根据重传请求帧确定需要重传的数据,再将需要重传的数据再次发送给第二终端200以保证数据的完整性和准确性。
此外,第二终端200在确定接收到的数据完整且符合预设条件的情况下,可以生成确认帧并返回该确认帧至第一终端100,以便第一终端100确定数据传输是否成功。第二终端200还可以在确定接收到的数据不完整或者不符合预设条件,则可以返回重传请求帧至第一终端100,以便第一终端100根据重传请求帧重新传输数据至第二终端。第一终端100在接收到第二终端返回的确认帧后,还可以再返回一个反馈信息,以告知第二终端已收到该确认帧。
此外,若第一终端100在一段预设时间段内即没有接收到确认帧,也没有接收到重传确认帧,则可以第一终端100与第二终端200的点对点通信网络存在故障,此时可以指示重新建立与第二终端200的点对点通信。可理解的是,重新建立与第二终端200的点对点通信可以是第一终端100自动重连,也可以是返回提示信息给到用户,由用户选择是否重连,并在用户选择重连的情况下再次建立与第二终端200的点对点通信,在此不再加以赘述。
请参阅图5,图5示出了本申请实施例提供的数据传输方法的场景示意图;如图5所示,第一终端100包括用户态应用软件层151、D2D业务层152、PCIE驱动层153以及第一通信模块154,第二终端200同样包括用户态应用软件层251、D2D业务层252、PCIE驱动层253以及第二通信模块254。上述第一通信模块154和第二通信模块254可以是WiFi芯片,也可以是其他能够实现点对点无线通信的通信芯片,例如蓝牙芯片等。需要说明的是,上述通信芯片可以集成在如图3所示的WiFi模块170中,能够实现第一终端100与其他终端的点对点通信。本申请实施例以第一通信模块154和第二通信模块254为WiFi芯片为例进行说明。
请结合图5,在第一终端100的用户态应用软件确定了需要发送到第二终端200的数据后,可以将包含待发送数据(即应用数据帧)的缓存区中的应用数据在D2D业务层152进行分片处理。为各个数据分片添加数据头,并为各个数据分片申请分片系统内存空间,将每个数据分片存在对应的分片系统内存空间中。再通过PCIE数据总线将分片系统内存空间中存储的数据分片拷贝到第一通信模块154的发送队列中,第一通信模块154基于802.11MAC/PHY层控制协议对发送队列中的数据分片添加相应的无线网络字段,生成报文,然后基于第一通信模块154的通信端口将该报文发送给第二终端200。第二终端200的第二通信模块254在接收到第一通信模块154发送过来的报文后,能够获取到该报文中包含的应用数据,第二通信模块254会直接将接收到的应用数据通过PCIE数据总线拷贝到系统内存中,D2D业务层252可以对存储在系统内存中的数据进行处理,例如进行数据重组,将接收到的数据还原为用户态应用 软件能够直接处理的数据帧,用户态应用软件就能直接处理该数据帧,例如可以直接读取指定系统内存区数据进行显示。若数据重组过程中发现有部分分片缺失,则可以根据缺失的分片向第一终端100发送重传请求帧,请求第一终端100重新传输缺失的分片数据。若数据重组过程中发现重组后的数据有误,也可以通过向第一终端100发送重传请求帧,请求第一终端100重新传输全部应用数据。若数据重组后数据是完整且符合预期,则向第一终端100返回确认帧(ACK帧)。第一终端100在接收到重传请求帧时,会根据重传请求帧的内容确定需要重传的数据,然后按照上述的数据传输过程将需要重传的数据发送给第二终端200。第一终端100还能够在接收到第二终端200返回的确认帧时,返回数据发送成功的指令给到用户态应用软件,以表明数据传输成功。通过对数据进行分片,能够满足数据传输的需求,保证数据完整地传输到对端,并能够通过简易的确认重传机制来保证对端接收到的数据是完整且准确的,有效地提高数据传输的准确性。
示例性的,以由手机将其视频播放软件中的视频数据投屏至电视机进行播放的数据传输过程为例。如图6所示,图6示出了手机上的视频播放软件的显示界面和触发投屏功能后的显示界面。手机上的视频播放软件可以具备投屏功能,用户通过触摸屏触摸投屏控件401以触发投屏功能,用户触摸或按下该投屏控件后,手机可以显示连接设备的选择列表以供用户选择需要传输数据的终端设备,即用户可以在列表中选择对应的终端设备,例如选择客厅电视。此时手机会建立与该客厅电视的点对点通信,手机通过视频播放软件获取视频数据,然后将该视频数据通过PCIE总线采用直接系统内存存取的方式,从系统内存中将该视频数据帧拷贝到手机的WiFi芯片(即第一通信模块)的发送队列中,然后手机的WiFi芯片基于802.11MAC/PHY层协议将该视频数据发送到电视的WiFi芯片(即第二通信模块),电视的WiFi芯片在接收到该视频数据后,同样采用直接系统内存存取的方式,通过其PCIE总线将接收到的视频拷贝到电视的系统内存中,以便电视播放应用程序直接读取指定系统内存区域的视频数据进行播放。WiFi芯片在点对点的应用场景下,不需要利用复杂的TCP/IP协议栈传输数据,只需通过系统内存拷贝和MAC/PHY二层转发的方式进行设备间通信,能够有效地降低数据传输的时延,减少系统负载,提高WiFi吞吐率。
需要说明的是,对于非点对点的通信业务,WiFi芯片仍然可以采用传统的TCP/IP协议栈进行通信,在此不再加以赘述。
请参阅图7,图7示出了本申请实施例提供的数据传输方法的流程示意图,如图7所示,该数据传输方法具体包括以下步骤:
S110、第一终端与第二终端建立点对点通信。
如前述实施例中所述,第一终端可以通过其WiFi芯片与第二终端的WiFi芯片进行WiFi Direct连接,也可以使第一终端工作在能够提供无线接入服务,允许其它无线设备接入的AP模式(Access Point模式),使得第二终端工作在可以连接到AP不接受无线设备接入的STA模式(Station模式),从而建立第一终端与第二终端的点对点通信。在此,可以由用户来选择需要进行传输数据的对象(即数据接收端)。如前述示例中所述,第一终端可以显示连接设备的选择列表以供用户选择需要传输数据的终端设备,用户可以在列表中选择第二终端。此时第一终端就会发起连接请求给到第二终端, 第二终端响应该连接请求,就能够建立两者之间的点对点通信。两者建立连接后,就可以通过建立的点对点通信进行数据交互。
S120、第一终端获取应用数据帧,并判断应用数据帧的数据大小是否超过分片门限;若是,则执行S130,否则执行S140。
具体的,通过第一终端的用户态应用软件可以确定出需要传输给第二终端的应用数据帧。示例性的,通过第一终端的相册中选择要分享到第二终端的图像,此时用户勾选的对象就是需要传输的应用数据帧。而对于无法只通过一个无线数据报文传输的应用数据帧,可以对应用数据帧进行分片处理。在实际应用中,可以基于传输链路的最大传输能力来确定分片门限,在此不加以限制。若应用数据帧的数据大小不超过分片门限,则说明只通过一个无线报文数据就能完成数据传输。若应用数据帧的数据大小超过分片门限,则说明应用数据帧无法只通过一个无线数据报文传输,因此需要对应用数据帧进行分片处理,然后将数据分片传输给第二终端。
S130、对所述应用数据帧进行数据分片处理,并将各个数据分片存储到对应的系统内存空间中。
在本实施例中,第一终端对应用数据帧进行数据分片处理可以是在D2D业务层实现的,通过D2D对应用数据帧进行分片,并为每个数据分片添加数据头,上述数据头用于指示第二终端在接收到各个所述数据分片后,对各个数据分片进行数据重组,以还原该应用数据帧。
在此,如图8所示,上述数据头可以包括标识符字段、标志字段和片偏移量字段。其中,标志字段可以占3位,其最低位MF(More Fragment),用于把应用数据帧的最后一片与前面其它各片区分开来。若该标志位MF为0,则表明该数据分片是应用数据帧的最后一片数据分片;若该标志位MF为1,则表明该数据分片不是应用数据帧的最后一片数据分片。标识符可以占16位,用于第二终端将应用数据帧的各个分片重组成原来的应用数据帧,当对应用数据帧进行分片时,该标识符的值被复制到所有的数据分片的标识符字段中。这样,第二终端就可以正确的将标识符字段的值相同的各数据分片重组成原来的数据帧。片偏移量字段可以占13为,其表示分片在原始数据的偏移量。
此外,该数据头还可以包含各个数据分片对应的分片编码,上述分片编码用于识别各个分片的序号,在进行数据重组时,可以根据分片编码来确定数据是否缺失以及分片的重组顺序。
在为各个数据分片添加了数据头之后,可以为各个数据分片申请系统内存空间,然后将各个数据分片存储到其对应的系统内存空间中。当数据发送成功后就释放对应的系统内存空间,以减少占用。
S140、将所述应用数据帧存储至对应的系统内存中。
在本实施例中,D2D业务层直接为不需要分片的应用数据帧分配系统内存空间,然后将该应用数据帧存储到对应的系统内存空间中。
S150、将存储在系统内存中的数据通过数据总线拷贝至第一通信模块的发送队列。
在本实施例中,采用直接系统内存存取(Direct Memory Access,DMA)通过系统总线(例如高速串行计算机扩展总线(Peripheral Component Interconnect Express,PCIE)、 SDIO总线)将存储在系统内存中的数据拷贝到WiFi芯片的发送序列中。
具体的,对于数据分片,同样可以通过PCIE数据总线将分片系统内存空间中存储的数据分片拷贝到第一通信模块的发送队列。
S160、通过第一通信模块的通信端口将发送队列中的数据发送至与第一终端无线连接第二终端。
在本实施例中,第一通信模块基于802.11MAC/PHY层控制协议对发送队列中的数据添加相应的无线网络字段,生成报文,然后基于第一通信模块的通信端口将该报文发送给第二终端。
具体的,若第一芯片基于802.11MAC/PHY层协议进行数据传输时,可以通过媒体介入控制层(Media Access Control,MAC)在待传输的数据中添加相应的无线网络字段以生成MAC数据帧,即通过添加MAC头部和校验尾部,然后将MAC数据帧发送物理层PHY(Physical),将收到MAC过来的数据,每4位就增加1位检错码,然后把并行数据转化为串行数据流数据,在按照物理层的编码规则(NRZ编码或曼彻斯特编码)把数据编码,再变为模拟信号将数据发送出去。需要说明的是,接收数据的过程则相反,即解码过程。还需要说明的是,在待传输的数据中添加相应的无线网络字段以生成MAC数据帧的具体实现可参见802.11MAC/PHY层控制协议,在此不加以赘述。
S170、第一终端监测在预设时间间隔内是否收到第二终端返回的确认帧,若是,则确定数据传输成功,否则执行S180。
请参见图9,图9示出了数据传输确认过程的交互示意图,在本实施例中,为了保证数据传输无误,第一终端在将数据发送给第二终端后,还要监测在预设时间间隔内是否收到第二终端返回的确认帧。如果收到第二终端返回的确认帧,就可以确定数据已经发送成功,此时可以释放之前为应用数据帧或数据分片分配的系统内存空间。当第二终端接收到第一终端的第一通信模块发送过来的数据后,第二终端会对接收到的数据进行校验,以校验接收到的数据是否与第一终端发送的应用数据帧一致,如果确定接收到的数据与第一终端发送的应用数据帧一致时,则第二终端会向第一终端返回一个确认帧,告知第一终端已收到数据。需要说明的是,上述预设时间间隔可以根据实际应用场景进行设置,在此不加以限制。
S180、第一终端监测在预设时间间隔内是否收到第二终端返回的重传请求帧,若是,则执行S190,否则确定数据链路存在故障。
S190、第一终端根据重传请求帧确定待重传数据,并通过所述第一通信模块的通信端口将所述待重传数据发送至所述第二终端,并返回执行S170。
请参见图10,图10示出了数据传输重传过程的交互示意图。在本实施例中,当第二终端检测到接收到的数据存在缺失或接收到的数据不符合预设条件时,会返回一个重传请求帧给到第一终端。第一终端会根据该重传请求帧确定需要重传的数据,然后再将需要重传的数据按照S120至S160的步骤进行处理,将该需要重传的数据发送给第二终端。然后再返回执行S170,即继续监测在预设时间间隔内是否收到第二终端返回的确认帧。以确保数据准确无误。
在本实施例中,当第二终端接收到数据后,对于分片数据会进行数据重组,请参阅图11,图11示出了数据重组过程的流程示意图。如图11所示,上述数据重组过程 包括以下步骤:
S21、解析数据分片报文,获取分片编码。
在此,由于各个数据分片都有数据头,且数据头中包含用于区分各个数据分片的分片编码,因为通过解析各个分片数据的数据头就能确定出各个数据分片的分片编码。
S22、基于分片编码确定接收到的数据是否完整,若是,则执行S23,否则根据缺失的数据分片生成重传确认帧,并将所述重传确认帧返回至第一终端。
在此,基于分片编码就能够确定接收到的分片数据是否完整。例如,第一终端将应用数据帧分为5个数据分片,并分别将第一数据分片的分片编码设置为1,将第二数据分片的分片编码设置为2,将第三数据分片的分片编码设置为3,将第四数据分片的分片编码设置为4,将第五数据分片的分片编码设置为5。当第二终端接收到分片编码分别为1、3、4、5的数据分片时,就能够确定缺少了分片编码为2的数据分片。此时,第二终端就会根据缺失的数据分片生成对应的重传确认帧,然后将重传确认帧发送至第一终端,以请求第一终端重新将分片编码为2的数据分片发送过来。当第二终端接收到分片编码分别为1、2、3、4、5的数据分片时,就能够确定第一终端接收到的数据是完整的,此时就可以对接收到的分片数据进行重组。
S23、对数据分片进行数据重组,得到还原数据。
具体的,对数据分片进行数据重组的过程可以在第二终端的D2D业务层中进行。通过各个数据分片的数据头中的分片编号、标识符字段、标志字段和片偏移量字段进行数据重组。基于标志字段确定同一应用数据帧的数据分片,然后基于分片编号和片偏移量字段将数据分片中的数据段依次拼接起来,然后基于标识符字段确定当前数据分片是否为该应用数据帧的最后一片分片,若是,则数据重组完成;若不是,则继续基于分片编号和片偏移量字段进行数据还原。
在此,若数据重组失败,则确定导致数据重组失败的数据分片,然后基于该数据分片生成对应的重传确认帧,并将重传确认帧发送至第一终端,以指示第一终端再次发送该数据分片。
S24、校验所述还原数据是否符合预设条件,若是,则返回确认帧至第一终端,否则执行S25。
S25、返回请求重传全部数据的重传确认帧至第一终端。
作为一种实现方式,数据重组后,可以根据还原数据的数据量与第一终端发送的应用数据帧的数据量进行比较,若还原数据的数据量与第一终端发送的应用数据帧的数据量一致,则说明所述还原数据是否符合预设条件。
作为一种实现方式,还可以基于哈希值来校验还原数据是否符合预设条件,若还原数据的哈希值与第一终端发送的应用数据帧的哈希值一致,则说明所述还原数据是否符合预设条件。需要说明的是,预设条件可以根据实际应用进行设置,在此不加以限制。
当还原数据校验通过(即还原数据符合预设条件)后,就能够返回一个确认帧给到第一终端,以便第一终端确认数据传输成功。如果还原数据校验不通过(即还原数据不符合预设条件),则可以再次请求第一终端将全部数据都重传一次,即可以生成请求重传全部数据的重传确认帧,然后将该重传确认帧返回至第一终端。
为了说明本申请实施例的有益效果,表1示出了传统TCP/IP发送和接收流程的耗时统计表。如表1所示,通过对传统TCP/IP发送和接收流程进行时延统计测试发现,一个200KB的报文从发送到接收需要耗时约27ms,其中协议栈部分的开销约7.8ms,约占1/3。而采用申请实施例提供的数据传输方法,由于无需经过TCP/IP协议栈的数据封装和解封,因此,TCP/IP协议栈这一部分的耗时开销将被有效的节省下来。即通过本申请提供的数据传输方法来发送一个200KB的报文平均可以节约7.8ms。
表1:
Figure PCTCN2020125586-appb-000001
由此可知,本实施例提供的数据传输方法,通过系统总线将系统内存中的数据拷贝到第一通信模块的发送队列中,再基于第一通信模块发送数据到第二终端。直接通过系统内存拷贝和MAC/PHY二层转发的方式进行设备间通信,极大优化了WiFi报文转发的负载和时延,能够有效地减少点对点业务的数据传输所消耗的时间,有效地减少系统的负载,减低传输时延,提高WiFi的吞吐率。
可以理解的是,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
基于同一发明构思,作为对上述方法的实现,本申请实施例提供了数据传输装置,该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。
图12示出了本申请实施例提供的一种数据传输装置的结构框图,该数据传输装置包括的各单元用于执行上述实施例中的各步骤,具体请参阅上述实施例中的相关描述,为了便于说明,仅示出了与本申请实施例相关的部分。请参阅图12,该数据传输装置10包括第一系统内存拷贝单元11和发送单元12。其中:
第一系统内存拷贝单元11用于将存储在系统内存中的应用数据帧通过数据总线拷贝至第一通信模块的发送队列。
发送单元12用于通过所述第一通信模块的通信端口将所述发送队列中的所述应用数据帧发送至与所述第一终端点对点通信第二终端。
在一种可能的实施方式中,该装置还包括分片单元。
分片单元用于若所述应用数据帧的数据大小超过分片门限,则对所述应用数据帧进行分片处理,并将各个数据分片存储到对应的系统内存空间中;
相应地,第一系统内存拷贝单元用于分别从各个存储数据分片的系统内存空间中拷贝所述分片数据至所述第一通信模块的发送队列;
相应地,发送单元用于基于所述发送队列依次通过所述第一通信模块的通信端口将所述数据分片发送至所述第二终端。
在一种可能的实施方式中,所述装置还包括重传单元。
重传单元用于,若接收到所述第二终端发送的重传请求帧,则根据所述重传请求帧确定待重传数据,并通过所述第一通信模块的通信端口将所述待重传数据发送至所述第二终端;所述重传请求帧是由第二终端在确定分片数据缺失或重组数据不符合预设条件时生成的。
在一种可能的实施方式中,所述装置还包括确定单元。
确定单元用于,若接收到所述第二终端发送的数据确认帧,则确定数据传输成功;所述数据确认帧是由所述第二终端根据接收到的数据进行数据重组并确定数据完整且符合预设条件后生成的。
在一种可能的实施方式中,所述分片单元具体用于:若所述应用数据帧的数据大小超过分片门限,则根据网络最大数据传输长度将所述应用数据帧分成若干个数据分片,并为各个数据分片添加数据头,所述数据头用于指示第二终端在接收到各个所述数据分片后,对各个数据分片进行数据重组,还原所述应用数据帧。
以上可以看出,本申请实施例提供的一种数据传输装置,同样能够通过系统总线将系统内存中的数据拷贝到第一通信模块的发送队列中,再基于第一通信模块发送数据到第二终端。直接通过系统内存拷贝和MAC/PHY二层转发的方式进行设备间通信,极大优化了WiFi报文转发的负载和时延,能够有效地减少点对点业务的数据传输所消耗的时间,有效地减少系统的负载,减低传输时延,提高WiFi的吞吐率。
图13示出了本申请实施例提供的另一种数据传输装置的结构框图,如图13所示,该该数据传输装置20包括接收单元21和第二系统内存拷贝单元22。其中:
接收单元21用于接收应用数据帧;所述应用数据帧是与所述第二终端点对点通信的第一终端通过第一终端的数据总线从第一终端的系统内存中拷贝至第一终端的第一通信模块的发送队列,并通过所述第一通信模块的通信端口将所述发送队列中的所述应用数据帧发送至所述第二终端的。
第二系统内存拷贝单元22用于将所述应用数据帧通过所述第二终端的数据总线拷贝至所述第二终端的系统内存中。
在一种可能的实现方式中,接收到的所述应用数据帧包括若干数据分片;相应地,所述装置还包括重组单元。重组单元用于对所述数据分片进行数据重组。
在一种可能的实现方式中,所述装置还包括:确认重传单元。
确认重传单元用于,若存在缺失数据分片或重组数据不符合预设条件,则根据需要重传的数据生成重传请求帧,并将所述重传请求帧返回至所述第一终端,所述重传请求帧用于指示所述第一终端重新发送需要重传的数据。
在一种可能的实现方式中,所述装置还包括:确认返回单元。
确认返回单元,用于若重组后的数据完整且符合预期,则返回确认帧至所述第一终端。
以上可以看出,本申请实施例提供的一种数据传输装置,同样能够通过系统总线将接收到的数据直接拷贝至系统内存中,使得应用软件能够直接处理存储在系统内存中的数据,有效地减少点对点业务的数据传输所消耗的时间,有效地减少系统的负载,减低传输时延,提高WiFi的吞吐率。
基于同一发明构思,本申请实施例还提供了一种终端设备。请参阅图14,图14是本申请实施例提供的终端设备的结构示意图。如图14所示,该实施例的终端设备140包括:至少一个处理器143(图14中仅示出一个)、存储器141以及存储在所述存储器141中并可在所述至少一个处理器143上运行的计算机程序142,所述处理器143执行所述计算机程序142时实现上述任意各个数据传输方法实施例中的步骤。
所述终端设备140可以是桌上型计算机、笔记本、掌上电脑等设备。该终端设备可包括,但不仅限于,处理器143、存储器141。本领域技术人员可以理解,图14仅仅是终端设备140的举例,并不构成对终端设备140的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。
所称处理器143可以是中央处理单元(Central Processing Unit,CPU),该处理器143还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器141在一些实施例中可以是所述终端设备140的内部存储单元,例如终端设备140的硬盘或系统内存。所述存储器141在另一些实施例中也可以是所述终端设备114的外部存储设备,例如所述终端设备140上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器141还可以既包括所述终端设备114的内部存储单元也包括外部存储设备。所述存储器141用于存储操作系统、应用程序、引导装载程序(Boot Loader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器141还可以用于暂时地存储已经输出或者将要输出的数据。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一 个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现上述数据传输方法中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时可实现上述数据传输方法中的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分别到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的 保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (13)

  1. 一种数据传输方法,应用于第一终端,其特征在于,包括:
    将存储在系统内存中的应用数据帧通过数据总线拷贝至第一通信模块的发送队列;
    通过所述第一通信模块的通信端口将所述发送队列中的所述应用数据帧发送至与所述第一终端点对点通信的第二终端。
  2. 根据权利要求1所述的数据传输方法,其特征在于,在将存储在系统内存中的应用数据帧通过数据总线拷贝至第一通信模块的发送队列之前,还包括:
    若所述应用数据帧的数据大小超过分片门限,则对所述应用数据帧进行分片处理,并将分片处理后的各个数据分片存储到对应的系统内存空间中;
    相应地,所述将存储在系统内存中的应用数据帧通过数据总线拷贝至第一通信模块的发送队列,包括:
    分别从各个存储数据分片的系统内存空间中拷贝所述分片数据至所述第一通信模块的发送队列;
    相应地,所述通过所述第一通信模块的通信端口将所述发送队列中的应用数据帧发送至与所述第一终端无线连接第二终端,包括:
    基于所述发送队列依次通过所述第一通信模块的通信端口将所述数据分片发送至所述第二终端。
  3. 根据权利要求1或2所述的数据传输方法,其特征在于,所述数据传输方法还包括:
    若接收到所述第二终端发送的重传请求帧,则根据所述重传请求帧确定待重传数据,并通过所述第一通信模块的通信端口将所述待重传数据发送至所述第二终端;所述重传请求帧是由第二终端在确定分片数据缺失或重组数据不符合预设条件时生成的。
  4. 根据权利要求1至3任一项所述的数据传输方法,其特征在于,所述数据传输方法还包括:
    若接收到所述第二终端发送的数据确认帧,则确定数据传输成功;所述数据确认帧是由所述第二终端根据接收到的数据进行数据重组并确定数据完整且符合预设条件后生成的。
  5. 根据权利要求2所述的数据传输方法,其特征在于,所述若所述应用数据帧的数据大小超过分片门限,则对所述应用数据帧进行分片处理,并为各个数据分片分配系统内存空间,包括:
    若所述应用数据帧的数据大小超过分片门限,则根据网络最大数据传输长度将所述应用数据帧分成若干个数据分片,并为各个数据分片添加数据头,所述数据头用于指示第二终端在接收到各个所述数据分片后,对各个数据分片进行数据重组,还原所述应用数据帧。
  6. 一种数据传输方法,应用于第二终端,其特征在于,包括:
    接收应用数据帧;所述应用数据帧是与所述第二终端点对点通信的第一终端通过第一终端的数据总线从第一终端的系统内存中拷贝至第一终端的第一通信模块的发送队列,并通过所述第一通信模块的通信端口将所述发送队列中的所述应用数据帧发送至所述第二终端的;
    将所述应用数据帧通过所述第二终端的数据总线拷贝至所述第二终端的系统内存中。
  7. 根据权利要求6所述的数据传输方法,其特征在于,接收到的所述应用数据帧包括若干数据分片;
    相应地,在将所述应用帧通过数据总线拷贝至系统内存,所述系统内存为应用软件能够直接处理存储在里面的数据的系统内存空间之后,还包括:
    对所述数据分片进行数据重组。
  8. 根据权利要求7所述的数据传输方法,其特征在于,所述数据传输方法还包括:
    若存在缺失数据分片或重组数据不符合预设条件,则根据需要重传的数据生成重传请求帧,并将所述重传请求帧返回至所述第一终端,所述重传请求帧用于指示所述第一终端重新发送需要重传的数据。
  9. 根据权利要求6至8任一项所述的数据传输方法,其特征在于,所述数据传输方法还包括:
    若重组后的数据完整且符合预期,则返回确认帧至所述第一终端。
  10. 一种终端设备,其特征在于,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在调用所述计算机程序时执行如权利要求1-5任一项所述的方法。
  11. 一种终端设备,其特征在于,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在调用所述计算机程序时执行如权利要求6-9任一项所述的方法。
  12. 一种数据传输系统,其特征在于,包括:如权利要求10的终端设备和如权利要求11的终端设备。
  13. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-5任一项所述的方法和/或如权利要求6至9任一项所述的方法。
PCT/CN2020/125586 2020-02-24 2020-10-30 一种数据传输方法、装置及系统 WO2021169369A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20922347.8A EP4092917A4 (en) 2020-02-24 2020-10-30 Data transmission method, apparatus and system
US17/801,545 US20230147131A1 (en) 2020-02-24 2020-10-30 Data transmission method, apparatus, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010115820.0A CN113301535B (zh) 2020-02-24 2020-02-24 一种数据传输方法、装置及系统
CN202010115820.0 2020-02-24

Publications (1)

Publication Number Publication Date
WO2021169369A1 true WO2021169369A1 (zh) 2021-09-02

Family

ID=77317941

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125586 WO2021169369A1 (zh) 2020-02-24 2020-10-30 一种数据传输方法、装置及系统

Country Status (4)

Country Link
US (1) US20230147131A1 (zh)
EP (1) EP4092917A4 (zh)
CN (2) CN115412972B (zh)
WO (1) WO2021169369A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905357A (zh) * 2021-12-09 2022-01-07 深圳软牛科技有限公司 基于WiFi直连的数据迁移方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020156927A1 (en) * 2000-12-26 2002-10-24 Alacritech, Inc. TCP/IP offload network interface device
WO2005017662A2 (en) * 2003-07-10 2005-02-24 Emulex Design & Manufacturing Corporation Methods and apparatus for switching fibre channel arbitrated loop systems
CN109388597A (zh) * 2018-09-30 2019-02-26 杭州迪普科技股份有限公司 一种基于fpga的数据交互方法及装置
CN110147251A (zh) * 2019-01-28 2019-08-20 腾讯科技(深圳)有限公司 用于计算神经网络模型的架构、芯片及计算方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100461770C (zh) * 2007-01-30 2009-02-11 中兴通讯股份有限公司 用于终端无线通信系统分组业务传输链路的数据处理方法
US8725202B2 (en) * 2012-05-29 2014-05-13 Newport Media, Inc. Single transceiver for wireless peer-to-peer connections
US9432872B2 (en) * 2013-11-21 2016-08-30 Qualcomm Incorporated Systems and methods for direct link communication with multi-channel concurrency
US10764961B2 (en) * 2016-03-30 2020-09-01 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Relay transmission method and device
CN107707302A (zh) * 2016-08-08 2018-02-16 镇江明辉光信息科技有限公司 基于led的近距离点对点高速双向数据传输系统
WO2018081928A1 (zh) * 2016-11-01 2018-05-11 达闼科技(北京)有限公司 数据处理方法、装置及终端设备
CN108092745A (zh) * 2017-12-22 2018-05-29 北京东土军悦科技有限公司 点对点设备的数据传输方法、装置、设备及存储介质
CN110505160B (zh) * 2018-05-17 2021-09-14 华为技术有限公司 一种通信方法及装置
US20200029376A1 (en) * 2018-07-19 2020-01-23 Qualcomm Incorporated Selective retransmission procedure

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020156927A1 (en) * 2000-12-26 2002-10-24 Alacritech, Inc. TCP/IP offload network interface device
WO2005017662A2 (en) * 2003-07-10 2005-02-24 Emulex Design & Manufacturing Corporation Methods and apparatus for switching fibre channel arbitrated loop systems
CN109388597A (zh) * 2018-09-30 2019-02-26 杭州迪普科技股份有限公司 一种基于fpga的数据交互方法及装置
CN110147251A (zh) * 2019-01-28 2019-08-20 腾讯科技(深圳)有限公司 用于计算神经网络模型的架构、芯片及计算方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905357A (zh) * 2021-12-09 2022-01-07 深圳软牛科技有限公司 基于WiFi直连的数据迁移方法、装置、设备及存储介质

Also Published As

Publication number Publication date
US20230147131A1 (en) 2023-05-11
EP4092917A1 (en) 2022-11-23
CN113301535A (zh) 2021-08-24
CN113301535B (zh) 2022-08-02
CN115412972B (zh) 2023-10-20
EP4092917A4 (en) 2023-06-28
CN115412972A (zh) 2022-11-29

Similar Documents

Publication Publication Date Title
TWI680664B (zh) 資料處理方法及設備
WO2015058613A1 (zh) 一种检测数据包的方法、装置及存储介质
TWI762686B (zh) 資料傳輸方法及相關產品
TW201902191A (zh) 無線鏈路控制傳輸方法及相關產品
US20160266948A1 (en) Queued Messages Processing Method and Apparatus, Method and Apparatus for Controlling Messages to be Enqueued
WO2018036026A1 (zh) 一种数据传输的方法、基站、目标终端、系统及存储介质
WO2015090250A1 (zh) 一种进程间通讯的方法及装置
WO2017096909A1 (zh) 建立数据连接的方法及装置
WO2014032559A1 (zh) 下载文件的方法和装置
US11368252B2 (en) Data indicating method and related products
WO2022252882A1 (zh) 浏览器网页防劫持的方法、装置、电子设备及存储介质
WO2018049894A1 (zh) 数据传输方法及设备
WO2021018227A1 (zh) 上行控制信息的传输方法、终端设备及存储介质
KR20210137702A (ko) 전자 장치 및 전자 장치에서 수신된 데이터 패킷을 처리하는 방법
WO2015062234A1 (zh) 移动终端资源处理方法、装置和设备
WO2021169369A1 (zh) 一种数据传输方法、装置及系统
TWI766080B (zh) 一種回饋應答資訊的長度確定方法及相關產品
WO2018201352A1 (zh) 数据重传控制方法及相关产品
US20230188270A1 (en) Data Transmission Method, Transmit Device, and Receive Device
WO2019028866A1 (zh) 数据传输方法及相关产品
WO2017166093A1 (zh) 前置系统
WO2018049896A1 (zh) 数据传输方法及设备
WO2019028876A1 (zh) 数据传输方法及相关产品
WO2017166095A1 (zh) 服务器前置方法
WO2017166094A1 (zh) 服务器前置方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20922347

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020922347

Country of ref document: EP

Effective date: 20220815

NENP Non-entry into the national phase

Ref country code: DE