CN113254375A - Data transmission method and device, electronic equipment and storage medium - Google Patents

Data transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113254375A
CN113254375A CN202011631719.7A CN202011631719A CN113254375A CN 113254375 A CN113254375 A CN 113254375A CN 202011631719 A CN202011631719 A CN 202011631719A CN 113254375 A CN113254375 A CN 113254375A
Authority
CN
China
Prior art keywords
data
real
cache region
systems
target data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011631719.7A
Other languages
Chinese (zh)
Inventor
赵树森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yihua Times Intelligent Automation System Co ltd
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Original Assignee
Shenzhen Yihua Times Intelligent Automation System Co ltd
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yihua Times Intelligent Automation System Co ltd, Shenzhen Yihua Computer Co Ltd, Shenzhen Yihua Time Technology Co Ltd filed Critical Shenzhen Yihua Times Intelligent Automation System Co ltd
Priority to CN202011631719.7A priority Critical patent/CN113254375A/en
Publication of CN113254375A publication Critical patent/CN113254375A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • G06F13/30Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal with priority control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Abstract

The embodiment of the invention provides a data transmission method, a data transmission device, electronic equipment and a storage medium, wherein the method is applied to a real-time system, the real-time system transmits data with other systems through a Universal Serial Bus (USB) link, and the method comprises the following steps: the real-time system caches data to be sent to other systems in a cache region of a USB link; then, sub-packaging the data in the cache region to obtain a plurality of target data packets; and when the data amount cached to the cache region in the preset time length exceeds a threshold value, periodically sending the target data packets to other systems. By performing sub-packet processing on the data in the cache region and periodically sending the sub-packet data to other systems, the occupation of sudden data access with large data volume on system resources is reduced, so that the real-time performance and integrity of real-time system data transmission are ensured, and errors of the real-time system are avoided.

Description

Data transmission method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data transmission method and apparatus, an electronic device, and a storage medium.
Background
The correctness of the real-time system calculation depends not only on the logic correctness of the program but also on the time of the result generation, and if the time constraint condition of the system is not met, a system error will occur. Therefore, to avoid system errors, it is necessary to ensure real-time data transmission of real-time systems.
In the prior art, in order to ensure real-time performance of data transmission of a real-time system, a Universal Serial Bus (USB) link may be established between the real-time system and other systems; data can be transmitted between the real-time system and other systems through the USB link. However, if the data access to the real-time system is a bursty access with a large data volume, a large amount of system resources may be occupied, which may cause data loss during transmission, failure to satisfy time constraint conditions, and further cause an error in the real-time system.
Disclosure of Invention
In view of the above, it is proposed to provide a data transmission method, apparatus, electronic device and storage medium that overcome or at least partially solve the above problems, comprising:
a data transmission method is applied to a real-time system, the real-time system transmits data with other systems through a Universal Serial Bus (USB) link, and the method comprises the following steps:
caching data to be sent to the other systems in a cache region of the USB link;
subpackaging the data in the cache region to obtain a plurality of target data packets;
and when the data amount cached to the cache region in the preset time length exceeds a threshold value, periodically sending the target data packets to the other systems.
Optionally, the real-time system transmits data with other systems in a Direct Memory Access (DMA) transmission mode through a USB link;
the sub-packaging the data in the cache region to obtain a plurality of target data packets comprises:
determining a channel capacity of the DMA;
and performing sub-packaging on the data of the cache region according to the channel capacity to obtain a plurality of target data packets.
Optionally, after the amount of data cached to the cache region within the preset time exceeds a threshold, the method further includes:
determining transmission priorities of the plurality of target data packets;
and adding the target data packets into a queue to be sent according to the transmission priority.
Optionally, the determining the transmission levels of the plurality of target data packets includes:
respectively determining real-time information of applications corresponding to the target data packets;
and determining the transmission priority of the target data packets according to the real-time information.
Optionally, after the amount of data cached to the cache region within the preset time exceeds a threshold, the method further includes:
and expanding the capacity of the buffer area.
A data transmission device is applied to a real-time system, the real-time system transmits data with other systems through a Universal Serial Bus (USB) link, and the device comprises:
the cache module is used for caching the data to be sent to the other systems in a cache region of the USB link;
the sub-packaging module is used for sub-packaging the data in the cache region to obtain a plurality of target data packets;
and the sending module is used for periodically sending the target data packets to other systems after the data amount cached to the cache region in the preset time length exceeds a threshold value.
Optionally, the real-time system transmits data with other systems in a Direct Memory Access (DMA) transmission mode through a USB link;
the subpackage module comprises:
a channel capacity determination submodule for determining the channel capacity of the DMA;
and the data sub-packaging sub-module is used for sub-packaging the data in the cache region according to the channel capacity to obtain a plurality of target data packets.
Optionally, the apparatus further comprises:
the transmission queuing module is used for determining the transmission priority of the target data packets when the data volume cached to the cache region in a preset time length exceeds a threshold value; and adding the target data packets into a queue to be sent according to the transmission priority.
Optionally, the transmission queuing module includes:
the real-time information determining submodule is used for respectively determining the real-time information of the application corresponding to the target data packets;
and the transmission priority determining submodule is used for determining the transmission priority of the target data packets according to the real-time information.
Optionally, the apparatus further comprises:
and the cache region capacity expansion module is used for expanding the capacity of the cache region after the data volume cached to the cache region within the preset time exceeds a threshold value.
An electronic device comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the data transmission method as claimed in any one of the preceding claims.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the data transmission method according to any one of the preceding claims.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, a real-time system caches data to be sent to other systems in a cache region of a USB link; then, sub-packaging the data in the cache region to obtain a plurality of target data packets; and when the data amount cached to the cache region in the preset time length exceeds a threshold value, periodically sending the target data packets to other systems. By performing sub-packet processing on the data in the cache region and periodically sending the sub-packet data to other systems, the occupation of sudden data access with large data volume on system resources is reduced, so that the real-time performance and integrity of real-time system data transmission are ensured, and errors of the real-time system are avoided.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the description of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flow chart illustrating steps of a data transmission method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating steps of another data transmission method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps of a further data transmission method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. 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.
Referring to fig. 1, a flowchart illustrating steps of a data transmission method according to an embodiment of the present invention is shown, where the method may be applied to a real-time system, and the real-time system may transmit data with other systems through a USB link, and specifically includes the following steps:
and step 102, caching data to be sent to other systems in a cache region of the USB link.
In the embodiment of the present invention, the real-time system may implement data transmission with other systems through a USB link, for example: the real-time system may receive data sent by other systems through the USB link, and the real-time system may also send data to other systems through the USB link.
The USB link may be preset with a buffer, and the buffer may be used to buffer data to be transmitted between the real-time system and another system.
As an example, the buffer may include a transmit buffer and a receive buffer; the sending buffer area may be used to buffer data to be sent to other systems by the real-time system, and the receiving buffer area may be used to buffer data to be sent to the real-time system by other systems.
As an example, the sending buffer may be disposed on a side where the USB link is connected to the real-time system, and the receiving buffer may be disposed on a side where the USB link is connected to another system, which is not limited in this embodiment of the present invention.
In the embodiment of the invention, the real-time system can cache the data to be sent to other systems in the cache region; then, the data in the buffer is packetized and sent to other systems periodically, which may refer to the following steps 104 to 106.
And 104, performing sub-packaging on the data in the cache region to obtain a plurality of target data packets.
And 106, periodically sending the target data packets to other systems when the data amount cached to the cache region in the preset time length exceeds a threshold value.
In the embodiment of the present invention, the data cached in the cache region may be subjected to packet processing to control the size of the target data packet.
When a real-time system is subjected to bursty data access with a large data volume, a large amount of system resources may be occupied, and further, data cannot be sent to other systems in real time by the real-time system in the data transmission process, even data loss occurs. Therefore, in the embodiment of the present invention, the data size cached to the cache region within the preset time duration may be detected, so as to discover the bursty data access with a large data size for the real-time system in time. The preset duration and the threshold may be preset according to actual conditions, which is not limited in the embodiment of the present invention.
When the data amount cached to the cache region within the preset time length is detected to exceed the preset threshold value, the real-time system can be considered to suffer from sudden data access with large data amount. At this time, the plurality of target packets may be intermittently transmitted to other systems according to a preset period, so as to reduce occupation of system resources. The preset period may be set to 0.1 μ s, for example, according to practical situations, and the embodiment of the present invention is not limited thereto.
In summary, in the embodiment of the present invention, the real-time system caches the data to be sent to other systems in the cache region of the USB link; then, sub-packaging the data in the cache region to obtain a plurality of target data packets; and when the data amount cached to the cache region in the preset time length exceeds a threshold value, periodically sending the target data packets to other systems. By performing sub-packet processing on the data in the cache region and periodically sending the sub-packet data to other systems, the occupation of sudden data access with large data volume on system resources is reduced, so that the real-time performance and integrity of real-time system data transmission are ensured, and errors of the real-time system are avoided.
Referring to fig. 2, a flowchart illustrating steps of another data transmission method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 202, caching data to be sent to other systems in a cache region of the USB link.
In the embodiment of the present invention, the other system may refer to other types of systems that perform data transmission with a real-time system, and the other types of systems may be determined according to actual situations. Of course, the other system may be another real-time system; furthermore, as an example, data may be sent from one real-time system to another real-time system, and the embodiment of the present invention is not limited thereto.
In this embodiment of the present invention, the data sent by the real-time system to the other systems may be data generated by the real-time system based on information sent by the other systems, or may also be data directly generated inside the real-time system, which is not limited in this embodiment of the present invention.
As an example, the other system may generate a message first and then send it to the real-time system via the USB link; after receiving the information, the real-time system may perform calculation and processing based on the information to obtain data, and send the data back to other systems, which is not limited in the embodiment of the present invention.
As another example, the real-time system may also generate a data directly internally and then send the data to other systems; the data may be used to obtain data in other systems, which is not limited in this embodiment of the present invention.
In an embodiment of the present invention, before the real-time system buffers the data in the buffer, the driver of the USB link may be initialized, which is not limited in this embodiment of the present invention.
Step 204, the real-time system transmits data with other systems by a DMA transmission method through a USB link; determining a channel capacity of the DMA.
In the embodiment of the present invention, the real-time system and the other systems may transmit data in a DMA (Direct Memory Access) transmission manner through a USB link. The DMA transfer mode can copy data from a real-time system to other systems, and when a Central Processing Unit (CPU) initializes the transfer action, the transfer action itself can be executed and completed by the DMA controller, thereby greatly reducing the occupation of the CPU during the data transfer process.
In the embodiment of the present invention, in order to avoid that the size of the target data packet obtained after packetization exceeds the maximum data amount that can be transmitted by the channel of the DMA, the channel capacity of the DMA may be determined before packetization of data; channel capacity may refer to the maximum amount of data that a channel of a DMA can carry.
In an embodiment of the present invention, after initializing the driver of the USB link, the DMA channel may also be initialized, which is not limited in this embodiment of the present invention.
And step 206, performing sub-packaging on the data of the cache region according to the channel capacity to obtain a plurality of target data packets.
In the embodiment of the present invention, after determining the channel capacity of the DMA, the data may be packetized according to the size of the channel capacity, so that the size of the target data packet obtained by packetization does not exceed the channel capacity of the DMA, for example: if the channel capacity is 16k, the data may be packetized into target data packets with a size of 16k, which is not limited in this embodiment of the present invention.
And 208, periodically sending the target data packets to the other systems when the data amount cached to the cache region in the preset time exceeds a threshold value.
Packetizing the data into a plurality of destination packets does not change the total amount of data; at this time, if a plurality of target packets are continuously transmitted, a large amount of system resources may still be occupied due to a large data volume. Therefore, in the embodiment of the present invention, after detecting that the amount of data buffered in the buffer area within the preset duration exceeds the preset threshold, the target data packets may be intermittently sent to other systems according to the preset period. The target data packet is sent intermittently to reduce the occupation of system resources. The period duration may be set to 0.1 μ s, for example, according to practical situations, and the embodiment of the present invention is not limited thereto.
As an example, according to a preset period, when a target data packet needs to be sent to another system, the DMA channel may be started first, which is not limited in this embodiment of the present invention.
In conclusion, in the embodiment of the invention, the data is transmitted by using the DMA transmission mode, so that the occupation of system resources in the data transmission process is further reduced; and the size of the sub-package is determined according to the channel capacity of the DMA, so that the target data package can be sent to other systems through the DMA channel in high density and high smoothness.
Referring to fig. 3, a flowchart illustrating steps of another data transmission method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 302, data to be sent to other systems is cached in a cache region of the USB link.
And step 304, determining the channel capacity of the DMA.
And step 306, performing sub-packaging on the data of the cache region according to the channel capacity to obtain a plurality of target data packets.
Steps 302-306 are similar to steps 202-206 described above and will not be described again.
Step 308, determining the transmission priority of the plurality of target data packets when the amount of data cached to the cache region within the preset time exceeds a threshold.
In the embodiment of the invention, in order to ensure that data with higher real-time requirement can be transmitted to other systems in time when a real-time system is subjected to sudden and large data volume data access, the transmission priority of a plurality of target data packets can be determined after the data volume cached to the cache region within the preset time length is detected to exceed the threshold value; the transmission priority may be used to indicate the priority order of the transmission of the target packet data, for example: the target data packet with the high transmission priority is transmitted preferentially, and the target data packet with the low transmission priority is transmitted later.
In this embodiment of the present invention, this step 308 may include the following steps:
respectively determining real-time information of applications corresponding to the target data packets; and determining the transmission priority of the target data packets according to the real-time information.
The real-time system can comprise a plurality of different applications, and the real-time requirements corresponding to data generated by the different applications are different; for example: the real-time requirement of the real-time video data generated by the video call application is higher, and the real-time requirement of the text data generated by the text reading application is lower, which is not limited in the embodiment of the present invention.
As an example, corresponding real-time information may be set in advance for different applications, and the real-time information may be used to characterize real-time requirements corresponding to data generated by the applications.
In the embodiment of the invention, when the transmission priority of the target data packet needs to be determined, the application corresponding to the target data packet can be determined firstly; then determining real-time information of the application; determining the transmission priority of the target data packet based on the real-time information; the transmission priority is related to the real-time requirements, for example: the real-time requirement is high, the transmission priority is high, the real-time requirement is low, and the transmission priority is low.
As an example, a corresponding relationship between the real-time information and the transmission priority may be preset, and when determining the transmission priority, the transmission priority of the target data packet may be determined according to the preset corresponding relationship between the real-time information and the transmission priority.
Step 310, adding the target data packets to a queue to be sent according to the transmission priority.
And step 312, periodically sending the target data packets to the other systems.
After determining the transmission priorities corresponding to the multiple target data packets, the multiple target data packets may be added to the queue to be sent according to the transmission priorities, for example: there are A, B, C, D four target packets in the buffer, and the transmission priority corresponding to each packet is: high, normal, low, and medium, the target data packet may be added to the queue to be sent in the order of A, D, C, B according to the transmission priority, which is not limited in the embodiment of the present invention.
After the target data packets are added to the queue to be sent, the target data packets in the queue to be sent can be periodically and sequentially sent to other systems. The pending queue in the above example is further exemplified: the target data packet a, then the target data packet D, then the target data packet C, and then the target data packet B may be transmitted at a preset cycle. The target data packet with high transmission priority is sent first, and then the target data packet with low transmission priority is sent, so that the data with high real-time requirement can be transmitted to other systems preferentially.
As an example, the preset period may be set according to real-time information of an application, or may be set according to an operating frequency of a system, which is not limited in this embodiment of the present invention.
In another embodiment of the present invention, when the amount of data cached in the cache region within the preset time exceeds the threshold, the method may further include the following steps:
and expanding the capacity of the buffer area.
In the embodiment of the present invention, after detecting that the amount of data buffered in the buffer memory within the preset duration exceeds the preset threshold, the capacity of the buffer memory may be expanded to buffer more data in the buffer memory, so as to avoid data loss due to insufficient capacity of the buffer memory when accessing data with a sudden and large amount of data.
In another embodiment of the present invention, when it is detected that the amount of data cached to the cache area within the preset time duration does not exceed the preset threshold, it may be considered that the current data access for the real-time system is an access with a small amount of data. At this time, because the amount of data to be sent is small, when the target data packet needs to be sent according to the preset period, the target data packet is not full; therefore, in order to avoid a real-time system error caused by that data in the target data packet is not sent to other systems for a long time, the target data packet that is not full may also be directly sent to other systems at the sending time corresponding to the preset period, which is not limited in this embodiment of the present invention.
In summary, in the embodiment of the present invention, after the plurality of target data packets are added to the queue to be sent according to the transmission priority, the plurality of target data packets are periodically sent to other systems, so that data with a high real-time requirement can be preferentially sent to other systems.
In addition, after the data amount cached to the cache region in the preset time length is detected to exceed the preset threshold value, the capacity of the cache region is expanded, and the occurrence of data loss during sudden data access with large data amount is further avoided.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 4, a schematic structural diagram of a data transmission apparatus according to an embodiment of the present invention is shown, where the apparatus may be applied to a real-time system, and the real-time system may transmit data with other systems through a USB link, and specifically includes the following modules:
a caching module 402, configured to cache data to be sent to the other systems in a cache region of the USB link;
a sub-packaging module 404, configured to sub-package the data in the cache area to obtain multiple target data packets;
a sending module 406, configured to periodically send the multiple target data packets to the other systems after the amount of data cached in the cache region within the preset time exceeds a threshold.
In an embodiment of the present invention, the real-time system transmits data with other systems in a DMA manner through a USB link;
the packetization module 404 includes:
a channel capacity determination submodule for determining the channel capacity of the DMA;
and the data sub-packaging sub-module is used for sub-packaging the data in the cache region according to the channel capacity to obtain a plurality of target data packets.
In an embodiment of the present invention, the apparatus further includes:
the transmission queuing module is used for determining the transmission priority of the target data packets when the data volume cached to the cache region in a preset time length exceeds a threshold value; and adding the target data packets into a queue to be sent according to the transmission priority.
In an embodiment of the present invention, the transmission queuing module includes:
the real-time information determining submodule is used for respectively determining the real-time information of the application corresponding to the target data packets;
and the transmission priority determining submodule is used for determining the transmission priority of the target data packets according to the real-time information.
In an embodiment of the present invention, the apparatus further includes:
and the cache region capacity expansion module is used for expanding the capacity of the cache region after the data volume cached to the cache region within the preset time exceeds a threshold value.
In summary, in the embodiment of the present invention, the real-time system caches the data to be sent to other systems in the cache region of the USB link; then, sub-packaging the data in the cache region to obtain a plurality of target data packets; and when the data amount cached to the cache region in the preset time length exceeds a threshold value, periodically sending the target data packets to other systems. By performing sub-packet processing on the data in the cache region and periodically sending the sub-packet data to other systems, the occupation of sudden data access with large data volume on system resources is reduced, so that the real-time performance and integrity of real-time system data transmission are ensured, and errors of the real-time system are avoided.
An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and when being executed by the processor, the computer program implements the steps of the data transmission method as described above.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the above data transmission method.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The data transmission method, the data transmission device, the electronic device and the storage medium are described in detail, and the principles and embodiments of the present invention are explained herein by using specific examples, which are merely used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A data transmission method is applied to a real-time system, the real-time system transmits data with other systems through a Universal Serial Bus (USB) link, and the method comprises the following steps:
caching data to be sent to the other systems in a cache region of the USB link;
subpackaging the data in the cache region to obtain a plurality of target data packets;
and when the data amount cached to the cache region in the preset time length exceeds a threshold value, periodically sending the target data packets to the other systems.
2. The method of claim 1, wherein the real-time system transfers data with other systems via a USB link in a DMA transfer manner;
the sub-packaging the data in the cache region to obtain a plurality of target data packets comprises:
determining a channel capacity of the DMA;
and performing sub-packaging on the data of the cache region according to the channel capacity to obtain a plurality of target data packets.
3. The method of claim 1, wherein when the amount of data buffered in the buffer exceeds a threshold within a predetermined time period, the method further comprises:
determining transmission priorities of the plurality of target data packets;
and adding the target data packets into a queue to be sent according to the transmission priority.
4. The method of claim 3, wherein determining the transmission level of the plurality of target packets comprises:
respectively determining real-time information of applications corresponding to the target data packets;
and determining the transmission priority of the target data packets according to the real-time information.
5. The method of claim 1, wherein when the amount of data buffered in the buffer exceeds a threshold within a predetermined time period, the method further comprises:
and expanding the capacity of the buffer area.
6. A data transmission apparatus, applied to a real-time system that transmits data with other systems via a USB link, the apparatus comprising:
the cache module is used for caching the data to be sent to the other systems in a cache region of the USB link;
the sub-packaging module is used for sub-packaging the data in the cache region to obtain a plurality of target data packets;
and the sending module is used for periodically sending the target data packets to other systems after the data amount cached to the cache region in the preset time length exceeds a threshold value.
7. The apparatus of claim 6, wherein the real-time system transfers data with other systems via a USB link in a DMA transfer manner;
the subpackage module comprises:
a channel capacity determination submodule for determining the channel capacity of the DMA;
and the data sub-packaging sub-module is used for sub-packaging the data in the cache region according to the channel capacity to obtain a plurality of target data packets.
8. The apparatus of claim 6, further comprising:
the transmission queuing module is used for determining the transmission priority of the target data packets when the data volume cached to the cache region in a preset time length exceeds a threshold value; and adding the target data packets into a queue to be sent according to the transmission priority.
9. An electronic device, comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the data transmission method according to any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the data transmission method according to one of claims 1 to 5.
CN202011631719.7A 2020-12-30 2020-12-30 Data transmission method and device, electronic equipment and storage medium Pending CN113254375A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011631719.7A CN113254375A (en) 2020-12-30 2020-12-30 Data transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011631719.7A CN113254375A (en) 2020-12-30 2020-12-30 Data transmission method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113254375A true CN113254375A (en) 2021-08-13

Family

ID=77181425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011631719.7A Pending CN113254375A (en) 2020-12-30 2020-12-30 Data transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113254375A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114896189A (en) * 2022-05-07 2022-08-12 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Cache method, device, equipment and storage medium of high-speed bus data
CN115225592A (en) * 2022-06-01 2022-10-21 裕太微(上海)电子有限公司 Direct memory access data transmission method and system
CN115664600A (en) * 2022-12-22 2023-01-31 广州市天奕信息技术股份有限公司 Data remote interaction detection and management system based on data analysis
CN116931842A (en) * 2023-09-12 2023-10-24 合肥康芯威存储技术有限公司 Memory, data processing method, electronic equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101162448A (en) * 2007-11-20 2008-04-16 杭州中天微系统有限公司 Hardware transmit method of USB high speed data tunnel
CN102547252A (en) * 2010-12-09 2012-07-04 盛乐信息技术(上海)有限公司 Method and system for multiplexing other data in audio-video code stream by using FPGAs (field programmable gate arrays)
CN102541793A (en) * 2011-12-26 2012-07-04 浙江大学 USB (universal serial bus) based high-speed dual-computer data exchange method and data exchange device
CN104539886A (en) * 2014-12-09 2015-04-22 中国科学院上海技术物理研究所 Infrared digital image acquisition and transmission system and method based on optical fiber communication
CN107703786A (en) * 2017-08-02 2018-02-16 深圳市好盈科技有限公司 Multi-path electricity, which is adjusted, docks conversion monitoring method and apparatus with the data between main control device
CN110532205A (en) * 2019-07-17 2019-12-03 浙江大华技术股份有限公司 Data transmission method, device, computer equipment and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101162448A (en) * 2007-11-20 2008-04-16 杭州中天微系统有限公司 Hardware transmit method of USB high speed data tunnel
CN102547252A (en) * 2010-12-09 2012-07-04 盛乐信息技术(上海)有限公司 Method and system for multiplexing other data in audio-video code stream by using FPGAs (field programmable gate arrays)
CN102541793A (en) * 2011-12-26 2012-07-04 浙江大学 USB (universal serial bus) based high-speed dual-computer data exchange method and data exchange device
CN104539886A (en) * 2014-12-09 2015-04-22 中国科学院上海技术物理研究所 Infrared digital image acquisition and transmission system and method based on optical fiber communication
CN107703786A (en) * 2017-08-02 2018-02-16 深圳市好盈科技有限公司 Multi-path electricity, which is adjusted, docks conversion monitoring method and apparatus with the data between main control device
CN110532205A (en) * 2019-07-17 2019-12-03 浙江大华技术股份有限公司 Data transmission method, device, computer equipment and computer readable storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114896189A (en) * 2022-05-07 2022-08-12 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Cache method, device, equipment and storage medium of high-speed bus data
CN114896189B (en) * 2022-05-07 2023-09-26 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Cache method, device, equipment and storage medium for high-speed bus data
CN115225592A (en) * 2022-06-01 2022-10-21 裕太微(上海)电子有限公司 Direct memory access data transmission method and system
CN115225592B (en) * 2022-06-01 2024-01-12 裕太微(上海)电子有限公司 Direct memory access data transmission method and system
CN115664600A (en) * 2022-12-22 2023-01-31 广州市天奕信息技术股份有限公司 Data remote interaction detection and management system based on data analysis
CN116931842A (en) * 2023-09-12 2023-10-24 合肥康芯威存储技术有限公司 Memory, data processing method, electronic equipment and medium
CN116931842B (en) * 2023-09-12 2023-12-08 合肥康芯威存储技术有限公司 Memory, data processing method, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN113254375A (en) Data transmission method and device, electronic equipment and storage medium
US10291482B2 (en) ECU for transmitting large data in HiL test environment, system including the same and method thereof
CN106603692B (en) Data storage method and device in distributed storage system
CN111683252B (en) Server and output system and method of video compression image
CN113381918B (en) In-vehicle signal transmission method and system
CN107147921A (en) Based on section and the intelligence CDN video playback accelerated methods dispatched and equipment
CN111490947A (en) Data packet transmitting method, data packet receiving method, system, device and medium
CN114221903B (en) Data transmission method and device
CN113452591B (en) Loop control method and device based on CAN bus continuous data frame
US7822040B2 (en) Method for increasing network transmission efficiency by increasing a data updating rate of a memory
CN114338386B (en) Network configuration method and device, electronic equipment and storage medium
JP4212508B2 (en) Packet generator
CN114337938B (en) Data transmission method, data retransmission method, device and related equipment
CN103580976A (en) Method and device for avoiding carrier sensing conflicts
CN113170500B (en) Information transmission method and device
CN110928693B (en) Computing equipment and resource allocation method
CN116112456B (en) BAP protocol-based data caching method, device, equipment and medium
CN114817100B (en) Data reading method and device for single board
JP2019129512A (en) On-vehicle relay device, relay method, information processing device, information processing system, and vehicle
CN114202947B (en) Internet of vehicles data transmission method and device and automatic driving vehicle
CN113099488B (en) Method, device, computing equipment and computer storage medium for solving network congestion
CN111756650A (en) Data processing method and device, operation chip and storage medium
CN116302489A (en) Resource application method, device, electronic equipment and storage medium
CN111105026A (en) Data reading method and data reading system
CN117692111A (en) Data transmission method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination