Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a data transmission method, which includes steps S11 to S14.
Step S11, acquiring data to be transmitted between the receiving end chip and the receiving end chip.
In the embodiment of the invention, the chip which transmits the data to be transmitted to the receiving end chip becomes the output end chip. In an actual application scenario, the output end chip and the receiving end chip are relatively speaking, and specifically, the data flow direction between the chips is determined.
Step S12, determining the data type of the data to be transmitted.
In some embodiments, the data to be transmitted is divided into different data types according to different application scenarios. Data generated by a relative digital television or video monitoring device can be roughly divided into: video stream data, audio stream data, platform data, and user data. The video stream data and the audio stream data have high requirements on the real-time property of transmission, but can tolerate certain errors; the platform data and the user data have low requirements on the real-time property of transmission, but have strict requirements on the integrity of the data.
And step S13, acquiring target transmission data corresponding to the data to be transmitted according to the data type.
In the embodiment of the invention, some data to be transmitted can be directly used as target transmission data, and some data to be transmitted need to be correspondingly processed to obtain the target transmission data.
In some embodiments, the data type comprises a video stream data type, and special control words are inserted at the start and end positions of the data to be transmitted to obtain the target transmission data, and the special control words are used for introducing an error correction mechanism. In particular, special meanings may be indicated by the same special control word being repeated multiple times. Because a retransmission mechanism is not introduced, the design is simple, retransmission buffering is saved, the additional cost of bandwidth is reduced, and the real-time requirement is met.
In some embodiments, the data type includes an audio stream data type, and the data to be transmitted corresponding to the audio stream data type is provided with an error correction code, where the error correction code is used to automatically correct data in which an error occurs in data transmission at the receiving-end chip. Specifically, the audio stream data has small bandwidth requirement, the requirement of too much bandwidth cannot be increased due to the fact that the error correcting code is arranged, and a retransmission mechanism is not introduced, so that retransmission buffering is saved, and the real-time requirement is met.
In some embodiments, the data type includes a platform data type and/or a user data type, and an error detection code is inserted into the data to be transmitted to obtain target transmission data, where the error detection code is used to automatically check and find out error data at a receiving end chip. Specifically, the data type has strict requirements on data integrity, so that a retransmission mechanism and an error detection code are required to be introduced, wherein the error detection code may be CRC error detection or other codes. When the data type finds error data through an error detection code in the transmission process, retransmission needs to be carried out.
Step S14, selecting a transmission mechanism corresponding to the data type to transmit the target transmission data to the receiving end chip.
In the embodiment of the present invention, the transmission mechanism includes a unidirectional transmission and a bidirectional transmission, the unidirectional transmission mainly transmits real-time data (i.e., data with high requirement on real-time and certain error tolerance), and the bidirectional transmission mainly transmits integrity data (i.e., data with strict requirement on integrity and certain delay tolerance).
In some embodiments, the transmission mechanism includes unidirectional transmission, and when the data type includes a video stream data type and an audio stream data type, the video stream data type is preferentially transmitted to the receiving end chip in a unidirectional way, that is, the audio stream data needs to be transmitted in a transmission gap of the video stream data.
In some embodiments, the transmission mechanism comprises bidirectional transmission, and when the data type comprises a platform data type and/or a user data type, the target transmission data is divided into a plurality of data packets, wherein each data packet comprises an error detection code. Specifically, first information sent by a receiving end chip is received, and the first information is used for indicating that target transmission data is not correctly received; and/or receiving second information sent by the receiving end chip, wherein the second information is used for indicating that the target transmission data is correctly received. When receiving the first information sent by the receiving end chip, the corresponding data packet needs to be retransmitted to ensure the integrity of the data.
As shown in fig. 2, an embodiment of the present invention provides a data transmission apparatus, which includes a first obtaining module 21, a determining module 22, a second obtaining module 23, and a transmission module 24.
The first obtaining module 21 is configured to obtain data to be transmitted between the receiving end chip and the first obtaining module.
In the embodiment of the invention, the chip which transmits the data to be transmitted to the receiving end chip becomes the output end chip. In an actual application scenario, the output end chip and the receiving end chip are relatively speaking, and specifically, the data flow direction between the chips is determined.
The determining module 22 is configured to determine a data type of the data to be transmitted.
In some embodiments, the data to be transmitted is divided into different data types according to different application scenarios. Data generated by a relative digital television or video monitoring device can be roughly divided into: video stream data, audio stream data, platform data, and user data. The video stream data and the audio stream data have high requirements on the real-time property of transmission, but can tolerate certain errors; the platform data and the user data have low requirements on the real-time property of transmission, but have strict requirements on the integrity of the data.
The second obtaining module 23 is configured to obtain target transmission data corresponding to the data to be transmitted according to the data type.
In the embodiment of the invention, some data to be transmitted can be directly used as target transmission data, and some data to be transmitted need to be correspondingly processed to obtain the target transmission data.
In some embodiments, the data type comprises a video stream data type, and special control words are inserted at the start and end positions of the data to be transmitted to obtain the target transmission data, and the special control words are used for introducing an error correction mechanism. In particular, special meanings may be indicated by the same special control word being repeated multiple times. Because a retransmission mechanism is not introduced, the design is simple, retransmission buffering is saved, the additional cost of bandwidth is reduced, and the real-time requirement is met.
In some embodiments, the data type includes an audio stream data type, and the data to be transmitted corresponding to the audio stream data type is provided with an error correction code, where the error correction code is used to automatically correct data in which an error occurs in data transmission at the receiving-end chip. Specifically, the audio stream data has small bandwidth requirement, the requirement of too much bandwidth cannot be increased due to the fact that the error correcting code is arranged, and a retransmission mechanism is not introduced, so that retransmission buffering is saved, and the real-time requirement is met.
In some embodiments, the data type includes a platform data type and/or a user data type, and an error detection code is inserted into the data to be transmitted to obtain target transmission data, where the error detection code is used to automatically check and find out error data at a receiving end chip. Specifically, the data type has strict requirements on data integrity, so that a retransmission mechanism and an error detection code are required to be introduced, wherein the error detection code may be CRC error detection or other codes. When the data type finds error data through an error detection code in the transmission process, retransmission needs to be carried out.
The transmission module 24 is configured to select a transmission mechanism corresponding to the data type to transmit the target transmission data to the receiving end chip.
In the embodiment of the present invention, the transmission mechanism includes a unidirectional transmission and a bidirectional transmission, the unidirectional transmission mainly transmits real-time data (i.e., data with high requirement on real-time and certain error tolerance), and the bidirectional transmission mainly transmits integrity data (i.e., data with strict requirement on integrity and certain delay tolerance).
In some embodiments, the transmission mechanism includes unidirectional transmission, and when the data type includes a video stream data type and an audio stream data type, the video stream data type is preferentially transmitted to the receiving end chip in a unidirectional way, that is, the audio stream data needs to be transmitted in a transmission gap of the video stream data.
In some embodiments, the transmission mechanism comprises bidirectional transmission, and when the data type comprises a platform data type and/or a user data type, the target transmission data is divided into a plurality of data packets, wherein each data packet comprises an error detection code. In addition, the output end chip receives first information sent by the receiving end chip, and the first information is used for indicating that target transmission data are not correctly received; and/or the output end chip receives second information sent by the receiving end chip, wherein the second information is used for indicating that the target transmission data is correctly received. When receiving the first information sent by the receiving end chip, the output end chip needs to retransmit the corresponding data packet to ensure the integrity of the data.
Referring to fig. 3, an embodiment of the invention provides a path diagram of unidirectional transmission. Device 1 is a sending device controller of an output end chip, device 2 is a serial port physical layer of the output end chip, device 3 is a serial port physical layer of a receiving end chip, and device 4 is a receiving device controller of the receiving end chip.
Referring to fig. 4, an embodiment of the invention provides a path diagram of bidirectional transmission. Device 1 is a sending device controller of an output end chip, device 2 is a serial port physical layer of the output end chip, device 3 is a serial port physical layer of a receiving end chip, and device 4 is a receiving device controller of the receiving end chip.
Referring to fig. 5, an embodiment of the invention provides a data transmission diagram for interconnecting two chips. The chip 1 transmits video stream data and audio stream data to the chip 2 by the transmission method shown in fig. 3, and transmits platform data and user data to the chip 2 by the transmission method shown in fig. 4.
Referring to fig. 6, an embodiment of the present invention provides a data transmission diagram of interconnection of three chips. Chip 3 transmits video stream data and audio stream data to chip 1 and chip 2 by the transmission method shown in fig. 3, and chip 1 transmits platform data and user data to chip 2 by the transmission method shown in fig. 4.
Referring to fig. 7, an embodiment of the invention further provides an electronic device 700, where the electronic device 700 may be a mobile phone, a tablet, a computer, or the like. As shown in fig. 7, the electronic device 700 includes a processor 701, a memory 702. The processor 701 is electrically connected to the memory 702.
The processor 701 is a control center of the electronic device 700, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or loading an application program stored in the memory 702 and calling data stored in the memory 702, thereby integrally monitoring the electronic device.
In this embodiment, the electronic device 700 is provided with a plurality of memory partitions, where the plurality of memory partitions includes a system partition and a target partition, and the processor 701 in the electronic device 700 loads instructions corresponding to processes of one or more application programs into the memory 702 according to the following steps, and the processor 701 runs the application programs stored in the memory 702, so as to implement various functions:
acquiring data to be transmitted between the receiving end chip and the receiving end chip;
determining the data type of the data to be transmitted;
acquiring target transmission data corresponding to the data to be transmitted according to the data type; and
and selecting a transmission mechanism corresponding to the data type to transmit the target transmission data with the receiving end chip.
Referring to fig. 8, fig. 8 is a specific block diagram of an electronic device 800 according to an embodiment of the present invention, where the electronic device 800 may be used to implement the data transmission method provided in the foregoing embodiment. The electronic device 800 may be a mobile phone or a tablet. The electronic device 800 also includes the following components.
The RF circuit 810 is used for receiving and transmitting electromagnetic waves, and performing interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. RF circuit 810 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF circuit 810 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices over a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various Communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (e.g., IEEE802.11a, IEEE802.11 b, IEEE 802.2.access, and/or IEEE802.11 n), Voice over Internet Protocol (VoIP), world wide Internet Microwave Access (Microwave for Wireless Communication), other suitable protocols for short message service (Max), and any other suitable protocols, and may even include those protocols that have not yet been developed.
The memory 820 may be used to store software programs and modules, such as program instructions/modules corresponding to the data transmission method in the above-described embodiments, and the processor 880 executes various functional applications and data processing, i.e., functions of the data transmission method, by operating the software programs and modules stored in the memory 820. The memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 820 may further include memory located remotely from the processor 880, which may be connected to the electronic device 800 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 830 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 830 may include a touch-sensitive surface 831 as well as other input devices 832. The touch-sensitive surface 831, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 831 (e.g., operations by a user on or near the touch-sensitive surface 831 using a finger, a stylus, or any other suitable object or attachment) and drive the corresponding connection device according to a predefined program. Alternatively, the touch-sensitive surface 831 can include two portions, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 880, and can receive and execute commands from the processor 880. In addition, the touch-sensitive surface 831 can be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 830 may include other input devices 832 in addition to the touch-sensitive surface 831. In particular, other input devices 832 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 840 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device 800, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 840 may include a Display panel 841, and the Display panel 841 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like, as an option. Further, touch-sensitive surface 831 can overlay display panel 841 and, upon detecting a touch operation on or near touch-sensitive surface 831, communicate to processor 880 to determine the type of touch event, whereupon processor 880 can provide a corresponding visual output on display panel 841 in accordance with the type of touch event. Although in FIG. 8, touch-sensitive surface 831 and display panel 841 are implemented as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 831 may be integrated with display panel 841 to implement input and output functions.
The electronic device 800 may also include at least one sensor 850, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 841 based on the brightness of ambient light, and a proximity sensor that may turn off the display panel 841 and/or backlight when the electronic device 800 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured to the electronic device 800, detailed descriptions thereof are omitted.
The audio circuitry 860, speaker 861, microphone 862 may provide an audio interface between a user and the electronic device 800. The audio circuit 860 can transmit the electrical signal converted from the received audio data to the speaker 861, and the electrical signal is converted into a sound signal by the speaker 861 and output; on the other hand, the microphone 862 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 860, and outputs the audio data to the processor 880 for processing, and then transmits the audio data to, for example, another terminal via the RF circuit 810, or outputs the audio data to the memory 820 for further processing. The audio circuitry 860 may also include an earbud jack to provide communication of a peripheral headset with the electronic device 800.
The electronic device 800, via the transport module 870 (e.g., a Wi-Fi module), may assist a user in emailing, browsing web pages, accessing streaming media, etc., which provides wireless broadband internet access to the user. Although fig. 8 shows the transmission module 870, it is understood that it does not belong to the essential constitution of the electronic device 800, and may be omitted entirely within the scope not changing the essence of the invention as needed.
The processor 880 is a control center of the electronic device 800, connects various parts of the entire cellular phone using various interfaces and lines, and performs various functions of the electronic device 800 and processes data by operating or executing software programs and/or modules stored in the memory 820 and calling data stored in the memory 820, thereby integrally monitoring the cellular phone. Optionally, processor 880 may include one or more processing cores; in some embodiments, processor 880 may integrate an application processor, which handles primarily the operating system, user interfaces, applications, etc., and a modem processor, which handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 880.
Electronic device 800 also includes a power supply 890 (e.g., a battery) that provides power to various components and, in some embodiments, may be logically coupled to processor 880 via a power management system that provides management of charging, discharging, and power consumption. Power supply 890 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the electronic device 800 may further include a camera (e.g., a front camera, a rear camera), a bluetooth module, and the like, which are not described in detail herein. Specifically, in this embodiment, the display unit of the electronic device is a touch screen display, the electronic device further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
acquiring data to be transmitted between the receiving end chip and the receiving end chip;
determining the data type of the data to be transmitted;
acquiring target transmission data corresponding to the data to be transmitted according to the data type; and
and selecting a transmission mechanism corresponding to the data type to transmit the target transmission data with the receiving end chip.
In specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by instructions controlling associated hardware, and the instructions may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, the present invention provides a readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the data transmission methods provided by the embodiments of the present invention.
Wherein the readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the readable storage medium can execute the steps in any data transmission method provided in the embodiment of the present invention, the beneficial effects that can be achieved by any data transmission method provided in the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again. The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
The invention has the beneficial effects that: the invention classifies different data, transmits different types of data through different transmission mechanisms, improves the transmission speed, ensures the real-time performance and integrity of data transmission, and reduces the design complexity, thereby reducing the design cost and improving the performance of a chip system.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The data transmission method, the data transmission device, the electronic device, and the readable storage medium according to the embodiments of the present invention are described in detail, and a specific example is applied in the description to explain the principle and the implementation of the present invention, and the description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention; those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.