CN114866564A - Communication optimization method, apparatus, electronic device, and readable storage medium - Google Patents
Communication optimization method, apparatus, electronic device, and readable storage medium Download PDFInfo
- Publication number
- CN114866564A CN114866564A CN202210295635.3A CN202210295635A CN114866564A CN 114866564 A CN114866564 A CN 114866564A CN 202210295635 A CN202210295635 A CN 202210295635A CN 114866564 A CN114866564 A CN 114866564A
- Authority
- CN
- China
- Prior art keywords
- transmission channel
- transmitted
- data
- transmission
- channel unit
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1074—Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请公开了通信优化方法、装置、电子设备及可读存储介质,应用于通信技术领域,所述通信优化方法包括:获取待传输数据以及对应的第一传输通道;若第一传输通道的内存占用超过预设第一内存占用阈值,则发送变更与第一传输通道方向相反的第二传输通道的传输方向的请求至接收方,并通过所述接收方判断第二传输通道的内存占用是否超过预设第二内存占用阈值;若第二传输通道的内存占用不超过预设第二内存占用阈值,则变更第二传输通道中至少一个第二传输通道单元的传输方向;通过第一传输通道以及已变更传输方向的第二传输通道单元共同传输待传输数据。本申请解决了现有技术中非对称通信效率低的技术问题。
The present application discloses a communication optimization method, device, electronic device, and readable storage medium, which are applied in the field of communication technology. The communication optimization method includes: acquiring data to be transmitted and a corresponding first transmission channel; if the memory of the first transmission channel If the occupancy exceeds the preset first memory occupancy threshold, a request to change the transmission direction of the second transmission channel opposite to the first transmission channel is sent to the receiver, and the receiver determines whether the memory occupancy of the second transmission channel exceeds Presetting the second memory occupancy threshold; if the memory occupancy of the second transmission channel does not exceed the preset second memory occupancy threshold, changing the transmission direction of at least one second transmission channel unit in the second transmission channel; through the first transmission channel and The second transmission channel units whose transmission directions have been changed jointly transmit the data to be transmitted. The present application solves the technical problem of low asymmetric communication efficiency in the prior art.
Description
技术领域technical field
本申请涉及通信技术领域,尤其涉及一种通信优化方法、装置、电子设备及可读存储介质。The present application relates to the field of communication technologies, and in particular, to a communication optimization method, apparatus, electronic device, and readable storage medium.
背景技术Background technique
随着科技的高速发展,通信技术也发展地越来越成熟,目前,采用将地址空间映射至内存空间,通过内存空间中的传输通道传输数据,而在通信双方传送数据的数量和大小不相近时,容易出现一方通信内存过于空闲导致资源支配过剩,而另一方通信内存过于拥挤导致传输卡顿的情况,从而导致通信的效率低。With the rapid development of science and technology, the development of communication technology has become more and more mature. At present, the address space is mapped to the memory space, and the data is transmitted through the transmission channel in the memory space, and the quantity and size of the data transmitted between the two sides of the communication are not similar. When the communication memory of one party is too idle, which leads to excess resource allocation, while the communication memory of the other party is too crowded, the transmission is stuck, resulting in low communication efficiency.
发明内容SUMMARY OF THE INVENTION
本申请的主要目的在于提供一种通信优化方法、装置、电子设备及可读存储介质,旨在解决现有技术中非对称通信效率低的技术问题。The main purpose of the present application is to provide a communication optimization method, apparatus, electronic device and readable storage medium, aiming to solve the technical problem of low asymmetric communication efficiency in the prior art.
为实现上述目的,本申请提供一种通信优化方法,应用于通信优化设备,所述通信优化方法包括:In order to achieve the above object, the present application provides a communication optimization method, which is applied to a communication optimization device, and the communication optimization method includes:
获取待传输数据以及所述待传输数据对应的第一传输通道;obtaining the data to be transmitted and the first transmission channel corresponding to the data to be transmitted;
判断所述第一传输通道的内存占用是否超过预设第一内存占用阈值;judging whether the memory occupation of the first transmission channel exceeds a preset first memory occupation threshold;
若所述第一传输通道的内存占用超过所述预设第一内存占用阈值,则发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的内存占用是否超过预设第二内存占用阈值;If the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold, a request for changing the transmission direction of the second transmission channel unit in the second transmission channel opposite to the first transmission channel is sent to The receiver, and judges by the receiver whether the memory occupation of the second transmission channel exceeds the preset second memory occupation threshold;
若所述第二传输通道的内存占用不超过所述预设第二内存占用阈值,则变更所述第二传输通道中至少一个第二传输通道单元的传输方向;If the memory occupation of the second transmission channel does not exceed the preset second memory occupation threshold, changing the transmission direction of at least one second transmission channel unit in the second transmission channel;
通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。The data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed.
可选地,在所述变更所述第二传输通道中至少一个第二传输通道单元的传输方向的步骤之后,所述通信优化方法还包括:Optionally, after the step of changing the transmission direction of at least one second transmission channel unit in the second transmission channel, the communication optimization method further includes:
获取所述第二传输通道中的当前内存占用;obtaining the current memory occupation in the second transmission channel;
若所述当前内存占用超过所述预设第二内存占用阈值,则恢复所述第二传输通道单元的传输方向。If the current memory occupation exceeds the preset second memory occupation threshold, the transmission direction of the second transmission channel unit is restored.
可选地,所述变更所述第二传输通道中至少一个第二传输通道单元的传输方向的步骤包括:Optionally, the step of changing the transmission direction of at least one second transmission channel unit in the second transmission channel includes:
逐个变更所述第二传输通道中与所述第一传输通道相邻的第二传输通道中第二传输通道单元的传输方向。The transmission direction of the second transmission channel units in the second transmission channel adjacent to the first transmission channel in the second transmission channel is changed one by one.
可选地,所述通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据的步骤包括:Optionally, the step of jointly transmitting the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed includes:
对所述待传输数据进行校验,得到校验结果;Verifying the data to be transmitted to obtain a verification result;
当所述校验结果为校验通过时,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。When the verification result is that the verification is passed, the data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed.
可选地,所述当所述校验结果为校验通过时,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据的步骤包括:Optionally, when the verification result is that the verification is passed, the step of jointly transmitting the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed includes:
分别计算所述第一传输通道中第一传输通道单元以及所述第二传输通道单元的数量,得到传输通道单元数量;Calculate the number of the first transmission channel unit and the second transmission channel unit in the first transmission channel respectively to obtain the number of transmission channel units;
将所述待传输数据分为所述传输通道单元数量的子待传输数据,其中,所述子待传输数据的大小不超过各传输通道单元的最大载荷量;dividing the data to be transmitted into sub-data to be transmitted in the number of transmission channel units, wherein the size of the sub-data to be transmitted does not exceed the maximum payload of each transmission channel unit;
分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据。Each of the sub-data to be transmitted is transmitted through the first transmission channel unit and the second transmission channel unit respectively.
可选地,所述分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据的步骤包括Optionally, the step of transmitting each of the sub-to-be-transmitted data through the first transmission channel unit and the second transmission channel unit respectively includes:
在所述第一传输通道单元和所述第二传输通道单元中选取传输所述子待传输数据的目标传输通道单元;Selecting a target transmission channel unit for transmitting the sub-to-be-transmitted data from the first transmission channel unit and the second transmission channel unit;
判断所述子待传输数据是否满足预设分片传输条件;Judging whether the sub-data to be transmitted satisfies the preset fragmentation transmission conditions;
若是,则通过所述目标传输通道单元分片传输所述子待传输数据,其中,所述目标传输通道单元至少包含两个传输通道单元;If so, transmit the sub-data to be transmitted through the target transmission channel unit fragmentation, wherein the target transmission channel unit includes at least two transmission channel units;
若否,则通过所述目标传输通道单元传输所述子待传输数据,其中,所述目标传输通道单元包含一个传输通道单元。If not, the sub-data to be transmitted is transmitted through the target transmission channel unit, wherein the target transmission channel unit includes one transmission channel unit.
可选地,所述通过所述目标传输通道单元分片传输所述子待传输数据的步骤包括:Optionally, the step of transmitting the sub-to-be-transmitted data by fragmenting the target transmission channel unit includes:
将所述子待传输数据分为预设数量的子待传输数据片段;dividing the sub-data to be transmitted into a preset number of sub-data segments to be transmitted;
将各所述子待传输数据片段以及各所述子待传输数据片段对应的序列号发送至所述目标传输通道单元;sending each of the sub-data segments to be transmitted and the sequence numbers corresponding to each of the sub-data segments to be transmitted to the target transmission channel unit;
在检测到所述目标传输通道单元接收到各所述子待传输数据片段以及各所述子待传输数据片段对应的序列号时,将各所述子待传输数据片段根据所述序列号进行拼接,得到所述子待传输数据。When detecting that the target transmission channel unit has received each of the sub-data segments to be transmitted and the sequence numbers corresponding to each of the sub-data segments to be transmitted, splicing the sub-data segments to be transmitted according to the sequence numbers , to obtain the data to be transmitted from the child.
为实现上述目的,本申请还提供一种通信优化装置,所述通信优化装置应用于通信优化设备,所述通信优化装置包括:In order to achieve the above object, the present application also provides a communication optimization device, the communication optimization device is applied to communication optimization equipment, and the communication optimization device includes:
获取模块,用于获取待传输数据以及所述待传输数据对应的第一传输通道;an acquisition module, configured to acquire the data to be transmitted and the first transmission channel corresponding to the data to be transmitted;
判断模块,用于判断所述第一传输通道的当前数据负荷是否超过预设第一数据负荷阈值;a judgment module, configured to judge whether the current data load of the first transmission channel exceeds a preset first data load threshold;
发送模块,用于若所述第一传输通道的内存占用超过所述预设第一内存占用阈值,则发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的当前数据负荷是否超过预设第二数据负荷阈值;The sending module is configured to send the change of the second transmission channel unit in the second transmission channel in the opposite direction to the first transmission channel if the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold. The request in the transmission direction is sent to the receiver, and the receiver determines whether the current data load of the second transmission channel exceeds the preset second data load threshold;
变更模块,用于若所述第二传输通道的内存占用不超过所述预设第二内存占用阈值,则变更所述第二传输通道中至少一个第二传输通道单元的传输方向;a change module, configured to change the transmission direction of at least one second transmission channel unit in the second transmission channel if the memory occupation of the second transmission channel does not exceed the preset second memory occupation threshold;
传输模块,用于通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。The transmission module is configured to jointly transmit the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed.
可选地,在所述变更所述第二传输通道中至少一个第二传输通道单元的传输方向的步骤之后,所述变更模块还用于:Optionally, after the step of changing the transmission direction of at least one second transmission channel unit in the second transmission channel, the changing module is further configured to:
获取所述第二传输通道中的当前内存占用;obtaining the current memory occupation in the second transmission channel;
若所述当前内存占用超过所述预设第二内存占用阈值,则恢复所述第二传输通道单元的传输方向。If the current memory occupation exceeds the preset second memory occupation threshold, the transmission direction of the second transmission channel unit is restored.
可选地,所述变更所述第二传输通道中至少一个第二传输通道单元的传输方向的步骤,所述变更模块还用于:Optionally, in the step of changing the transmission direction of at least one second transmission channel unit in the second transmission channel, the changing module is further configured to:
逐个变更所述第二传输通道中与所述第一传输通道相邻的第二传输通道中第二传输通道单元的传输方向。The transmission direction of the second transmission channel units in the second transmission channel adjacent to the first transmission channel in the second transmission channel is changed one by one.
可选地,所述通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据的步骤,所述传输模块还用于:Optionally, in the step of jointly transmitting the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed, the transmission module is further configured to:
对所述待传输数据进行校验,得到校验结果;Verifying the data to be transmitted to obtain a verification result;
当所述校验结果为校验通过时,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。When the verification result is that the verification is passed, the data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed.
可选地,所述当所述校验结果为校验通过时,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据的步骤,所述传输模块还用于:Optionally, the step of jointly transmitting the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed when the verification result is that the verification is passed, the transmission module Also used for:
分别计算所述第一传输通道中第一传输通道单元以及所述第二传输通道单元的数量,得到传输通道单元数量;Calculate the number of the first transmission channel unit and the second transmission channel unit in the first transmission channel respectively to obtain the number of transmission channel units;
将所述待传输数据分为所述传输通道单元数量的子待传输数据,其中,所述子待传输数据的大小不超过各传输通道单元的最大载荷量;dividing the data to be transmitted into sub-data to be transmitted in the number of transmission channel units, wherein the size of the sub-data to be transmitted does not exceed the maximum payload of each transmission channel unit;
分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据。Each of the sub-data to be transmitted is transmitted through the first transmission channel unit and the second transmission channel unit respectively.
可选地,所述分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据的步骤,所述传输模块还用于:Optionally, in the step of respectively transmitting the data to be transmitted by the first transmission channel unit and the second transmission channel unit, the transmission module is further configured to:
在所述第一传输通道单元和所述第二传输通道单元中选取传输所述子待传输数据的目标传输通道单元;Selecting a target transmission channel unit for transmitting the sub-to-be-transmitted data from the first transmission channel unit and the second transmission channel unit;
判断所述子待传输数据是否满足预设分片传输条件;Judging whether the sub-data to be transmitted satisfies the preset fragmentation transmission conditions;
若是,则通过所述目标传输通道单元分片传输所述子待传输数据,其中,所述目标传输通道单元至少包含两个传输通道单元;If so, transmit the sub-data to be transmitted through the target transmission channel unit fragmentation, wherein the target transmission channel unit includes at least two transmission channel units;
若否,则通过所述目标传输通道单元传输所述子待传输数据,其中,所述目标传输通道单元包含一个传输通道单元。If not, the sub-data to be transmitted is transmitted through the target transmission channel unit, wherein the target transmission channel unit includes one transmission channel unit.
可选地,所述通过所述目标传输通道单元分片传输所述子待传输数据的步骤,所述传输模块还用于:Optionally, in the step of transmitting the sub-data to be transmitted through the target transmission channel unit fragmentation, the transmission module is further used for:
将所述子待传输数据分为预设数量的子待传输数据片段;dividing the sub-data to be transmitted into a preset number of sub-data segments to be transmitted;
将各所述子待传输数据片段以及各所述子待传输数据片段对应的序列号发送至所述目标传输通道单元;sending each of the sub-data segments to be transmitted and the sequence numbers corresponding to each of the sub-data segments to be transmitted to the target transmission channel unit;
在检测到所述目标传输通道单元接收到各所述子待传输数据片段以及各所述子待传输数据片段对应的序列号时,将各所述子待传输数据片段根据所述序列号进行拼接,得到所述子待传输数据。When detecting that the target transmission channel unit has received each of the sub-data segments to be transmitted and the sequence numbers corresponding to each of the sub-data segments to be transmitted, splicing the sub-data segments to be transmitted according to the sequence numbers , to obtain the data to be transmitted from the child.
本申请还提供一种电子设备,所述电子设备包括:存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的所述通信优化方法的程序,所述通信优化方法的程序被处理器执行时可实现如上述的通信优化方法的步骤。The present application also provides an electronic device, the electronic device comprising: a memory, a processor, and a program of the communication optimization method stored on the memory and executable on the processor. When the program is executed by the processor, the steps of the communication optimization method as described above can be implemented.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有实现通信优化方法的程序,所述通信优化方法的程序被处理器执行时实现如上述的通信优化方法的步骤。The present application also provides a computer-readable storage medium on which a program for implementing the communication optimization method is stored, and when the program of the communication optimization method is executed by a processor, the steps of the above-mentioned communication optimization method are implemented .
本申请还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述的通信优化方法的步骤。The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned communication optimization method when the computer program is executed by a processor.
本申请提供了一种通信优化方法、装置、电子设备及可读存储介质,相比于现有技术采用的将地址空间映射至内存空间,通过内存空间中的传输通道传输数据的方法,本申请通过获取待传输数据以及所述待传输数据对应的第一传输通道;判断所述第一传输通道的内存占用是否超过预设第一内存占用阈值;若所述第一传输通道的内存占用超过所述预设第一内存占用阈值,则发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的内存占用是否超过预设第二内存占用阈值;若所述第二传输通道的内存占用不超过所述预设第二内存占用阈值,则变更所述第二传输通道中至少一个第二传输通道单元的传输方向;通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据,通过实时判断第一传输通道和第二传输通道的内存占用情况,当第一传输通道的内存占用过大,而第二传输通道的内存占用较小时,将第二传输通道中部分传输通道单元变更传输方向,以合理调配传输通道,使得两个传输通道实现传输数据的大小和数量相近,从而避免了在通信双方传送数据的数量和大小不相近时,容易出现一方通信内存过于空闲导致资源支配过剩,而另一方通信内存过于拥挤导致传输卡顿的情况的技术缺陷,从而提高了非对称通信效率。The present application provides a communication optimization method, device, electronic device, and readable storage medium. Compared with the method used in the prior art to map an address space to a memory space and transmit data through a transmission channel in the memory space, the present application By acquiring the data to be transmitted and the first transmission channel corresponding to the data to be transmitted; determine whether the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold; if the memory occupation of the first transmission channel exceeds the If the preset first memory occupancy threshold is exceeded, a request for changing the transmission direction of the second transmission channel unit in the second transmission channel opposite to the first transmission channel is sent to the receiver, and the receiver determines the Whether the memory occupation of the second transmission channel exceeds the preset second memory occupation threshold; if the memory occupation of the second transmission channel does not exceed the preset second memory occupation threshold, change at least one of the second transmission channels The transmission direction of the second transmission channel unit; the data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed, and the memory occupation of the first transmission channel and the second transmission channel is judged in real time. In some cases, when the memory usage of the first transmission channel is too large and the memory usage of the second transmission channel is small, the transmission direction of some transmission channel units in the second transmission channel is changed to reasonably allocate the transmission channels, so that the two transmission channels can achieve The size and quantity of the transmitted data are similar, so as to avoid the situation that when the quantity and size of the data transmitted by the two communicating parties are not similar, it is easy to cause the situation that one party's communication memory is too idle, which leads to excess resource allocation, while the other party's communication memory is too crowded, causing the transmission to be stuck. technical defects, thereby improving the efficiency of asymmetric communication.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. In other words, on the premise of no creative labor, other drawings can also be obtained from these drawings.
图1为本申请通信优化方法第一实施例的流程示意图;FIG. 1 is a schematic flowchart of the first embodiment of the communication optimization method of the present application;
图2为本申请通信优化方法第一实施例中的传输通道示意图;2 is a schematic diagram of a transmission channel in the first embodiment of the communication optimization method of the present application;
图3为本申请实施例中通信优化方法涉及的硬件运行环境的设备结构示意图。FIG. 3 is a schematic diagram of a device structure of a hardware operating environment involved in a communication optimization method in an embodiment of the present application.
本申请目的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional features and advantages of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
为使本申请的上述目的、特征和优点能够更加明显易懂,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其它实施例,均属于本申请保护的范围。In order to make the above objects, features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
实施例一Example 1
本申请实施例提供一种通信优化方法,在本申请通信优化方法的第一实施例中,参照图1,所述通信优化方法包括:An embodiment of the present application provides a communication optimization method. In the first embodiment of the communication optimization method of the present application, referring to FIG. 1 , the communication optimization method includes:
步骤S10,获取待传输数据以及所述待传输数据对应的第一传输通道;Step S10, obtaining data to be transmitted and a first transmission channel corresponding to the data to be transmitted;
在本实施例中,需要说明的是,所述传输通道为将通信设备的地址空间映射至内存空间,将所述内存空间划分得到,所述传输通道包括主收从发通道和主发从收通道,所述主收从发通道用于主设备接收来自从设备发送的待传输数据,所述主收从发通道用于从设备接收来自主设备发送的待传输数据,所述通信设备可以为PCI(Peripheral ComponentInterconnect,外设部件互连标准)设备。In this embodiment, it should be noted that the transmission channel is obtained by dividing the memory space by mapping the address space of the communication device to the memory space, and the transmission channel includes a master-transmitting-slave-transmitting channel and a master-transmitting-slave-receiving channel channel, the master-receive-slave-transmit channel is used for the master device to receive the data to be transmitted sent from the slave device, the master-receive-slave-transmit channel is used for the slave device to receive the to-be-transmitted data sent from the master device, and the communication device can be PCI (Peripheral ComponentInterconnect, peripheral component interconnect standard) device.
示例性地,步骤S10包括:获取待传输数据,依据所述待传输数据的收发主体,确定所述待传输数据对应的第一传输通道;Exemplarily, step S10 includes: acquiring data to be transmitted, and determining a first transmission channel corresponding to the data to be transmitted according to the transceiver subject of the data to be transmitted;
作为一种示例,步骤S10包括:获取待传输数据,当所述待传输数据由主设备发送至从设备时,确定所述待传输数据对应的第一传输通道为主发从收通道。As an example, step S10 includes: acquiring the data to be transmitted, and when the data to be transmitted is sent by the master device to the slave device, determining that the first transmission channel corresponding to the data to be transmitted is the primary sending and receiving channel.
作为一种示例,步骤S10包括:获取待传输数据,当所述待传输数据由从设备发送至主设备时,确定所述待传输数据对应的第一传输通道为主收从发通道。As an example, step S10 includes: acquiring data to be transmitted, and when the data to be transmitted is sent by the slave device to the master device, determining that the first transmission channel corresponding to the data to be transmitted is a master receiving and slave sending channel.
步骤S20,判断所述第一传输通道的内存占用是否超过预设第一内存占用阈值;Step S20, judging whether the memory occupation of the first transmission channel exceeds a preset first memory occupation threshold;
步骤S30,若所述第一传输通道的内存占用超过所述预设第一内存占用阈值,则发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的内存占用是否超过预设第二内存占用阈值;Step S30, if the memory occupancy of the first transmission channel exceeds the preset first memory occupancy threshold, send and change the transmission direction of the second transmission channel unit in the second transmission channel opposite to the direction of the first transmission channel The request is sent to the receiver, and the receiver determines whether the memory occupancy of the second transmission channel exceeds the preset second memory occupancy threshold;
在本实施例中,需要说明的是,所述预设第一内存占用阈值为所述第一传输通道中最大可用传输单元所占用内存容量临界值,所述预设第二内存占用阈值为所述第二传输通道中最大可用传输单元所占用内存容量临界值。In this embodiment, it should be noted that the preset first memory occupancy threshold is a critical value of the memory capacity occupied by the largest available transmission unit in the first transmission channel, and the preset second memory occupancy threshold is a The critical value of the memory capacity occupied by the largest available transmission unit in the second transmission channel.
示例性地,步骤S20至步骤S30包括:判断所述第一传输通道的内存占用是否超过预设第一内存占用阈值;若所述第一传输通道的内存占用不超过预设第一内存占用阈值,则判定无需进行传输通道的调配,通过所述第一传输通道传输所述待传输数据;若所述第一传输通道的内存占用超过预设第一内存占用阈值,则判定需要进行传输通道的调配,发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的内存占用是否超过预设第二内存占用阈值。Exemplarily, steps S20 to S30 include: judging whether the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold; if the memory occupation of the first transmission channel does not exceed the preset first memory occupation threshold , then it is determined that there is no need to allocate the transmission channel, and the data to be transmitted is transmitted through the first transmission channel; if the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold, it is determined that the transmission channel needs to be allocated. Allocate, send a request for changing the transmission direction of the second transmission channel unit in the second transmission channel opposite to the first transmission channel to the receiver, and determine whether the memory usage of the second transmission channel is occupied by the receiver. Exceeds the preset second memory usage threshold.
作为一种示例,当所述第一传输通道为主发从收通道时,步骤S20至步骤S30包括:判断所述主发从收通道的内存占用是否超过预设第一内存占用阈值;若所述主发从收通道的内存占用不超过预设第一内存占用阈值,则判定无需进行传输通道的调配,通过所述主发从收通道传输所述待传输数据;若所述主发从收通道的内存占用超过预设第一内存占用阈值,则判定需要进行传输通道的调配,发送变更主收从发通道的传输方向的请求至接收方,并通过所述接收方判断所述主收从发通道的内存占用是否超过预设第二内存占用阈值。As an example, when the first transmission channel is the master sending and slave receiving channels, steps S20 to S30 include: judging whether the memory occupation of the master sending and slave receiving channels exceeds a preset first memory occupation threshold; If the memory occupancy of the primary sending and receiving channels does not exceed the preset first memory occupancy threshold, it is determined that the allocation of transmission channels is unnecessary, and the data to be transmitted is transmitted through the primary sending and receiving channels; If the memory occupancy of the channel exceeds the preset first memory occupancy threshold, it is determined that the allocation of the transmission channel needs to be performed, and a request to change the transmission direction of the master-receive-slave-transmission channel is sent to the receiver, and the receiver determines the master-receiver-slave Whether the memory usage of the sending channel exceeds the preset second memory usage threshold.
步骤S40,若所述第二传输通道的内存占用不超过所述预设第二内存占用阈值,则变更所述第二传输通道中至少一个第二传输通道单元的传输方向;Step S40, if the memory occupation of the second transmission channel does not exceed the preset second memory occupation threshold, then change the transmission direction of at least one second transmission channel unit in the second transmission channel;
示例性地,步骤S40包括:若所述第二传输通道的内存占用超过预设第二内存占用阈值,则由接收方忽略变更传输方向请求;若所述第二传输通道的内存占用不超过预设第二内存占用阈值,则将所述第二传输通道中至少一个第二传输通道单元的传输方向由第二传输通道对应的传输方向改变为第一传输通道对应的传输方向。Exemplarily, step S40 includes: if the memory occupancy of the second transmission channel exceeds a preset second memory occupancy threshold, the receiver ignores the request to change the transmission direction; if the memory occupancy of the second transmission channel does not exceed a predetermined threshold If the second memory occupation threshold is set, the transmission direction of at least one second transmission channel unit in the second transmission channel is changed from the transmission direction corresponding to the second transmission channel to the transmission direction corresponding to the first transmission channel.
作为一种示例,当所述第一传输通道为主发从收通道时,步骤S40包括:若所述主收从发通道的内存占用超过预设第二内存占用阈值,则开启非对称运输流程;若所述主收从发通道的内存占用不超过预设第二内存占用阈值,则将所述主收从发通道中至少一个主收从发传输通道单元的传输方向由主收从方向发改变为主发从收方向。As an example, when the first transmission channel is the master-transmitting-slave-receiving channel, step S40 includes: if the memory occupation of the master-receiving-slave-transmitting channel exceeds a preset second memory occupation threshold, starting an asymmetric transport process ; If the memory occupancy of the main-receive-slave-transmitting channel does not exceed the preset second memory occupancy threshold, then the transmission direction of at least one main-receiving-slave-transmitting transmission channel unit in the main-receiving-slave-transmitting channel is sent by the main-receiving-slave direction. Change the direction of the main sender and the receiver.
其中,在步骤S40中,所述变更所述第二传输通道中至少一个第二传输通道单元的传输方向的步骤包括:Wherein, in step S40, the step of changing the transmission direction of at least one second transmission channel unit in the second transmission channel includes:
步骤S41,逐个变更所述第二传输通道中与所述第一传输通道相邻的第二传输通道中第二传输通道单元的传输方向。Step S41 , changing the transmission direction of the second transmission channel units in the second transmission channel adjacent to the first transmission channel in the second transmission channel one by one.
作为一种示例,参照图2,步骤S41包括:当所述第一传输通道为主发从收通道,所述第二传输通道为主收从发通道时,变更图示主收从发单元N的传输方向为主发从收方向,逐个从左至右依次变更主收从发单元的传输方向,按照所述第一传输通道和所述第二传输通道的列阵顺序依次变更传输方向,使得所述第一传输通道与所述第二传输通道中第二传输通道单元形成更大的环形阵列,避免了随机变更所述第二通道中第二传输通道单元的传输方向时,需额外对所述第二传输通道单元进行定位列队处理,而定位列队的算法复杂且增大系统的占用空间和计算时间的技术缺陷,从而提高了不对称通信的效率。As an example, referring to FIG. 2 , step S41 includes: when the first transmission channel is a master-transmitting-slave-receiving channel, and the second transmission channel is a master-receiving-slave-transmitting channel, changing the diagram of the master-receiving-slave-transmitting unit N The transmission direction of the main transmitter and the subordinate transmitter, the transmission direction of the main transmitter and subordinate transmitter units is changed one by one from left to right, and the transmission direction is sequentially changed according to the array order of the first transmission channel and the second transmission channel, so that The first transmission channel and the second transmission channel unit in the second transmission channel form a larger annular array, which avoids the need to additionally adjust the transmission direction of the second transmission channel unit in the second channel when randomly changing the transmission direction of the second transmission channel unit in the second transmission channel. The second transmission channel unit performs positioning queuing processing, and the algorithm of positioning queuing is complicated and has the technical defects of increasing the occupied space and computing time of the system, thereby improving the efficiency of asymmetric communication.
其中,在步骤S40中,在所述变更所述第二传输通道中至少一个第二传输通道单元的传输方向的步骤之后,所述通信优化方法还包括:Wherein, in step S40, after the step of changing the transmission direction of at least one second transmission channel unit in the second transmission channel, the communication optimization method further includes:
步骤A10,获取所述第二传输通道中的当前内存占用;Step A10, obtaining the current memory occupation in the second transmission channel;
步骤A20,若所述当前内存占用超过所述预设第二内存占用阈值,则恢复所述第二传输通道单元的传输方向。Step A20, if the current memory occupation exceeds the preset second memory occupation threshold, restore the transmission direction of the second transmission channel unit.
示例性地,步骤A10至步骤A20包括:获取所述第二传输通道中的当前内存占用,判断所述当前内存占用是否超过所述预设第二内存占用阈值;若所述当前内存占用超过所述预设第二内存占用阈值,则恢复所述第二传输通道单元的传输方向;若所述当前内存占用不超过所述预设第二内存占用阈值,则保持所述第二传输通道单元的传输方向不变。Exemplarily, steps A10 to A20 include: acquiring the current memory occupancy in the second transmission channel, and judging whether the current memory occupancy exceeds the preset second memory occupancy threshold; The preset second memory occupancy threshold, then restore the transmission direction of the second transmission channel unit; if the current memory occupancy does not exceed the preset second memory occupancy threshold, then keep the second transmission channel unit. The transmission direction does not change.
作为一种示例,当所述第一传输通道为主发从收通道时,步骤A10至步骤A20包括:获取所述主收从发通道中的当前内存占用,判断所述当前内存占用是否超过所述预设第二内存占用阈值;若所述当前内存占用超过所述预设第二内存占用阈值,则将所述主收从发通道单元的传输方向恢复为主收从发方向;若所述当前内存占用不超过所述预设第二内存占用阈值,则保持所述主收从发通道单元的传输方向为主发从收方向。As an example, when the first transmission channel is a master-transmitting-slave-receiving channel, steps A10 to A20 include: acquiring the current memory occupancy in the master-transmitting-slave-transmitting channel, and determining whether the current memory occupancy exceeds all the the preset second memory occupancy threshold; if the current memory occupancy exceeds the preset second memory occupancy threshold, then the transmission direction of the main-receive-slave-transmitting channel unit is restored to the main-receive-slave-transmitting direction; if the The current memory occupancy does not exceed the preset second memory occupancy threshold, and the transmission direction of the master-transmitting-slave-transmitting channel unit is maintained as the master-transmitting-slave-receiving direction.
步骤S50,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。Step S50, the data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed.
本申请实施例提供了一种通信优化方法,相比于现有技术采用的将地址空间映射至内存空间,通过内存空间中的传输通道传输数据的方法,本申请实施例通过获取待传输数据以及所述待传输数据对应的第一传输通道;判断所述第一传输通道的内存占用是否超过预设第一内存占用阈值;若所述第一传输通道的内存占用超过所述预设第一内存占用阈值,则发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的内存占用是否超过预设第二内存占用阈值;若所述第二传输通道的内存占用不超过所述预设第二内存占用阈值,则变更所述第二传输通道中至少一个第二传输通道单元的传输方向;通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据,通过实时判断第一传输通道和第二传输通道的内存占用情况,当第一传输通道的内存占用过大,而第二传输通道的内存占用较小时,将第二传输通道中部分传输通道单元变更传输方向,以合理调配传输通道,使得两个通信通道实现传输数据的大小和数量相近,从而避免了在通信双方传送数据的数量和大小不相近时,容易出现一方通信内存过于空闲导致资源支配过剩,而另一方通信内存过于拥挤导致传输卡顿的情况的技术缺陷,从而提高了非对称通信效率。The embodiment of the present application provides a communication optimization method. Compared with the method of mapping the address space to the memory space and transmitting data through the transmission channel in the memory space adopted in the prior art, the embodiment of the present application obtains the data to be transmitted and the first transmission channel corresponding to the data to be transmitted; determine whether the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold; if the memory occupation of the first transmission channel exceeds the preset first memory If the occupancy threshold is exceeded, a request to change the transmission direction of the second transmission channel unit in the second transmission channel opposite to the first transmission channel is sent to the receiver, and the receiver determines the memory of the second transmission channel. Whether the occupancy exceeds the preset second memory occupancy threshold; if the memory occupancy of the second transmission channel does not exceed the preset second memory occupancy threshold, then change the at least one second transmission channel unit in the second transmission channel. Transmission direction; the data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed, and the memory usage of the first transmission channel and the second transmission channel is judged in real time. When the memory usage of the channel is too large and the memory usage of the second transmission channel is small, change the transmission direction of some transmission channel units in the second transmission channel to reasonably allocate the transmission channels so that the two communication channels can achieve the size and quantity of the transmitted data. It is similar to avoid the technical defect that when the quantity and size of the data transmitted by the two communication parties are not similar, the communication memory of one party is too idle, which leads to excessive resource allocation, while the communication memory of the other party is too crowded, which leads to the situation that the transmission is stuck. Asymmetric communication efficiency.
实施例二Embodiment 2
进一步地,基于本申请第一实施例,在本申请另一实施例中,与上述实施例一相同或相似的内容,可以参考上文介绍,后续不再赘述。在此基础上,Further, based on the first embodiment of the present application, in another embodiment of the present application, for the same or similar content as the above-mentioned first embodiment, reference may be made to the above introduction, and details will not be described in the following. on the basis of,
其中,在步骤S50中,所述通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据的步骤包括:Wherein, in step S50, the step of jointly transmitting the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed includes:
步骤S51,对所述待传输数据进行校验,得到校验结果;Step S51, verifying the data to be transmitted to obtain a verification result;
步骤S52,当所述校验结果为校验通过时,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。Step S52, when the verification result is that the verification is passed, the data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed.
示例性地,步骤S51至步骤S52包括:对所述待传输数据进行校验,得到校验结果,判断所述校验结果是否为校验通过;若所述校验结果为校验通过,则通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据;若所述校验结果为校验不通过,则对所述待传输数据进行修正,并返回执行步骤:对所述待传输数据进行校验,直至输出校验通过结果。Exemplarily, steps S51 to S52 include: verifying the data to be transmitted, obtaining a verification result, and judging whether the verification result is a verification pass; if the verification result is a verification pass, then The data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed; if the verification result is that the verification fails, the data to be transmitted is corrected and returned The execution step is to verify the data to be transmitted until the verification result is output.
在本实施例中,需要说明的是,所述预设校验条件为预先设置的判定校验通过的校验和条件。In this embodiment, it should be noted that the preset verification condition is a preset checksum condition for judging that the verification is passed.
进一步地,对所述待传输数据进行校验包括:从所述待传输数据的字符串中提取关键数据,将所述关键数据发送至接收设备,通过发送设备计算所述关键数据的第一校验和,通过接受设备计算所述关键数据的第二校验和,判断所述第一校验和与所述第二校验和是否一致;若所述第一校验和与所述第二校验和一致,则输出校验通过结果;若所述第一校验和与所述第二校验和不一致,则输出校验未通过结果,对所述关键数据进行修正,并返回执行步骤:计算所述关键数据的校验和,直至输出校验通过结果。Further, verifying the data to be transmitted includes: extracting key data from the character string of the data to be transmitted, sending the key data to the receiving device, and calculating the first calibration value of the key data by the sending device. Checksum, calculate the second checksum of the key data by the receiving device, and judge whether the first checksum is consistent with the second checksum; if the first checksum is consistent with the second checksum If the checksum is consistent, output the result of passing the check; if the first checksum is inconsistent with the second checksum, output the result of failing the check, correct the key data, and return to the execution steps : Calculate the checksum of the key data until the verification result is output.
进一步的,作为一种示例,计算所述第一校验和与所述第二校验和可以为:通过发送设备将所述关键数据分为至少一个16位的位串,将IP(Internet Protocol,互联网协议)、UDP(User Datagram Protocol,用户数据报协议)或TCP(Transmission ControlProtocol,传输控制协议)的PDU(Power Distribution Unit,电源分配单元)首部中的检验和字段置为0,对所述位串进行1的补码和运算得到累加结果,获取所述累加结果的反码,得到所述第一校验和;通过接收设备将所述关键数据分为至少一个16位的位串,对所述位串进行1的补码和运算得到累加结果,获取所述累加结果的反码,得到所述第二校验和。Further, as an example, calculating the first checksum and the second checksum may be: dividing the key data into at least one 16-bit bit string by the sending device, dividing the IP (Internet Protocol) , Internet Protocol), UDP (User Datagram Protocol, User Datagram Protocol) or TCP (Transmission Control Protocol, Transmission Control Protocol) The checksum field in the PDU (Power Distribution Unit, Power Distribution Unit) header is set to 0, for the described The bit string performs 1's complement sum operation to obtain the accumulated result, obtains the complement of the accumulated result, and obtains the first checksum; the key data is divided into at least one 16-bit bit string by the receiving device, and the A 1's complement sum operation is performed on the bit string to obtain an accumulation result, the inverse code of the accumulation result is obtained, and the second checksum is obtained.
其中,在步骤S52中,所述当所述校验结果为校验通过时,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据的步骤包括:Wherein, in step S52, when the verification result is that the verification is passed, the step of jointly transmitting the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed includes:
步骤C10,分别计算所述第一传输通道中第一传输通道单元以及所述第二传输通道单元的数量,得到传输通道单元数量;Step C10, respectively calculating the number of the first transmission channel unit and the second transmission channel unit in the first transmission channel to obtain the number of transmission channel units;
步骤C20,将所述待传输数据分为所述传输通道单元数量的子待传输数据,其中,所述子待传输数据的大小不超过各传输通道单元的最大载荷量;Step C20, dividing the data to be transmitted into sub-data to be transmitted of the number of transmission channel units, wherein the size of the sub-data to be transmitted does not exceed the maximum payload of each transmission channel unit;
步骤C30,分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据。In step C30, the data to be transmitted of each sub-to-be-transmitted is transmitted through the first transmission channel unit and the second transmission channel unit respectively.
示例性地,步骤C10至步骤C30包括:获取所述第一传输通道中的第一传输通道单元数量以及所述第二传输通道单元数量,对所述第一传输通道单元数量和所述第二传输通道单元数量进行求和得到传输通道单元数量;获取所述待传输数据的数据大小,依据所述传输通道单元数量和所述数据大小,将所述待传输数据分为各子待传输数据,并将各子待传输数据与传输通道单元一一对应;分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据。Exemplarily, steps C10 to C30 include: acquiring the first transmission channel unit number and the second transmission channel unit number in the first transmission channel, and comparing the first transmission channel unit number and the second transmission channel unit number. The number of transmission channel units is summed to obtain the number of transmission channel units; the data size of the data to be transmitted is obtained, and the data to be transmitted is divided into sub-data to be transmitted according to the number of transmission channel units and the data size, Each sub-to-be-transmitted data is in a one-to-one correspondence with the transmission channel unit; each of the sub-to-be-transmitted data is transmitted through the first transmission channel unit and the second transmission channel unit respectively.
其中,在步骤C30中,所述分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据的步骤包括:Wherein, in step C30, the step of transmitting each of the sub-to-be-transmitted data through the first transmission channel unit and the second transmission channel unit respectively includes:
步骤C31,在所述第一传输通道单元和所述第二传输通道单元中选取传输所述子待传输数据的目标传输通道单元;Step C31, selecting the target transmission channel unit that transmits the sub-data to be transmitted in the first transmission channel unit and the second transmission channel unit;
步骤C32,判断所述子待传输数据是否满足预设分片传输条件;Step C32, judging whether the sub-data to be transmitted satisfies a preset fragmentation transmission condition;
步骤C33,若是,则通过所述目标传输通道单元分片传输所述子待传输数据,其中,所述目标传输通道单元至少包含两个传输通道单元;Step C33, if yes, then transmit the sub-data to be transmitted through the target transmission channel unit fragmentation, wherein the target transmission channel unit includes at least two transmission channel units;
步骤C34,若否,则通过所述目标传输通道单元传输所述子待传输数据,其中,所述目标传输通道单元包含一个传输通道单元。Step C34, if not, transmit the sub-data to be transmitted through the target transmission channel unit, wherein the target transmission channel unit includes a transmission channel unit.
在本实施例中,需要说明的是,所述预设分片传输条件为预先设置的传输通道单元可传输的数据长度临界值。In this embodiment, it should be noted that the preset fragmented transmission condition is a preset critical value of the data length that can be transmitted by the transmission channel unit.
示例性地,步骤C31至步骤C33包括:在所述第一传输通道单元和所述第二传输通道单元中选取传输所述子待传输数据的目标传输通道单元;获取所述子待传输数据的数据长度,判断所述子待传输数据的数据长度是否满足预设分片传输条件;若所述子待传输数据的数据长度满足预设分片传输条件,则通过所述目标传输通道单元分片传输所述子待传输数据,其中,所述目标传输通道单元至少包含两个传输通道单元;若所述子待传输数据的数据长度不满足预设分片传输条件,则通过所述目标传输通道单元传输所述子待传输数据,其中,所述目标传输通道单元包含一个传输通道单元。Exemplarily, steps C31 to C33 include: selecting a target transmission channel unit for transmitting the sub-data to be transmitted from the first transmission channel unit and the second transmission channel unit; acquiring the sub-data to be transmitted data length, to determine whether the data length of the data to be transmitted satisfies the preset fragmentation transmission conditions; if the data length of the sub-to-be-transmitted data meets the preset fragmentation transmission conditions, the target transmission channel unit is used for fragmentation Transmitting the sub-data to be transmitted, wherein, the target transmission channel unit includes at least two transmission channel units; if the data length of the sub-data to be transmitted does not meet the preset fragmentation transmission conditions, pass the target transmission channel The unit transmits the sub-to-be-transmitted data, wherein the target transmission channel unit includes a transmission channel unit.
其中,在步骤C33中,所述通过所述目标传输通道单元分片传输所述子待传输数据的步骤包括:Wherein, in step C33, the step of transmitting the sub-to-be-transmitted data through the target transmission channel unit fragmentation includes:
步骤D10,将所述子待传输数据分为预设数量的子待传输数据片段;Step D10, dividing the sub-data to be transmitted into a preset number of sub-data segments to be transmitted;
步骤D20,将各所述子待传输数据片段以及各所述子待传输数据片段对应的序列号发送至所述目标传输通道单元;Step D20, sending each of the sub-data segments to be transmitted and the sequence numbers corresponding to each of the sub-data segments to be transmitted to the target transmission channel unit;
步骤D30,在检测到所述目标传输通道单元接收到各所述子待传输数据片段以及各所述子待传输数据片段对应的序列号时,将各所述子待传输数据片段根据所述序列号进行拼接,得到所述子待传输数据。Step D30, when detecting that the target transmission channel unit has received each of the sub-data segments to be transmitted and the sequence numbers corresponding to each of the sub-data segments to be transmitted, assign each of the sub-data segments to be transmitted according to the sequence number. The numbers are spliced to obtain the sub-to-be-transmitted data.
示例性地,步骤D10至步骤D30包括:获取所述子待传输数据的数据长度,依据所述数据长度,将所述子待传输数据均分为预设数量的子待传输数据片段;依据所述预设数量以及各所述子待传输数据片段的顺序,获取各所述子待传输数据片段对应的序列号,将各所述子待传输数据片段以及对应的序列号发送至所述目标传输通道单元;在检测到所述目标传输通道单元接收到各所述子待传输数据片段以及对应的序列号时,将各所述子待传输数据片段根据所述序列号进行拼接,还原得到所述子待传输数据。Exemplarily, steps D10 to D30 include: acquiring the data length of the sub-data to be transmitted, and dividing the sub-data to be transmitted into a preset number of sub-data segments according to the data length; The preset number and the sequence of each of the sub-data segments to be transmitted, obtain the sequence number corresponding to each of the sub-data segments to be transmitted, and send each of the sub-data segments to be transmitted and the corresponding sequence number to the target transmission channel unit; when detecting that the target transmission channel unit has received each of the sub-to-be-transmitted data segments and the corresponding serial numbers, splicing each of the sub-to-be-transmitted data segments according to the sequence numbers, and restoring to obtain the child data to be transmitted.
本申请实施例提供了一种通信优化方法,相比于现有技术采用的将地址空间映射至内存空间,通过内存空间中的传输通道传输数据的方法,本申请实施例通过获取待传输数据以及所述待传输数据对应的第一传输通道;判断所述第一传输通道的内存占用是否超过预设第一内存占用阈值;若所述第一传输通道的内存占用超过所述预设第一内存占用阈值,则发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的内存占用是否超过预设第二内存占用阈值;若所述第二传输通道的内存占用不超过所述预设第二内存占用阈值,则变更所述第二传输通道中至少一个第二传输通道单元的传输方向;通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据,通过实时判断第一传输通道和第二传输通道的内存占用情况,当第一传输通道的内存占用过大,而第二传输通道的内存占用较小时,将第二传输通道中部分传输通道单元变更传输方向,以合理调配传输通道,使得两个传输通道实现传输数据的大小和数量相近,从而避免了在通信双方传送数据的数量和大小不相近时,容易出现一方通信内存过于空闲导致资源支配过剩,而另一方通信内存过于拥挤导致传输卡顿的情况的技术缺陷,从而提高了非对称通信效率。The embodiment of the present application provides a communication optimization method. Compared with the method of mapping the address space to the memory space and transmitting data through the transmission channel in the memory space adopted in the prior art, the embodiment of the present application obtains the data to be transmitted and the first transmission channel corresponding to the data to be transmitted; determine whether the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold; if the memory occupation of the first transmission channel exceeds the preset first memory If the occupancy threshold is exceeded, a request to change the transmission direction of the second transmission channel unit in the second transmission channel opposite to the first transmission channel is sent to the receiver, and the receiver determines the memory of the second transmission channel. Whether the occupancy exceeds the preset second memory occupancy threshold; if the memory occupancy of the second transmission channel does not exceed the preset second memory occupancy threshold, then change the at least one second transmission channel unit in the second transmission channel. Transmission direction; the data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed, and the memory usage of the first transmission channel and the second transmission channel is judged in real time. When the memory usage of the channel is too large and the memory usage of the second transmission channel is small, change the transmission direction of some transmission channel units in the second transmission channel to reasonably allocate the transmission channels, so that the two transmission channels can achieve the size and quantity of the transmitted data It is similar to avoid the technical defect that when the quantity and size of the data transmitted by the two communication parties are not similar, the communication memory of one party is too idle, which leads to excessive resource allocation, while the communication memory of the other party is too crowded, which leads to the situation that the transmission is stuck. Asymmetric communication efficiency.
实施例三Embodiment 3
本申请实施例还提供一种通信优化装置,所述通信优化装置应用于通信优化设备,所述通信优化装置包括:The embodiment of the present application further provides a communication optimization device, the communication optimization device is applied to a communication optimization device, and the communication optimization device includes:
获取模块,用于获取待传输数据以及所述待传输数据对应的第一传输通道;an acquisition module, configured to acquire the data to be transmitted and the first transmission channel corresponding to the data to be transmitted;
判断模块,用于判断所述第一传输通道的当前数据负荷是否超过预设第一数据负荷阈值;a judgment module, configured to judge whether the current data load of the first transmission channel exceeds a preset first data load threshold;
发送模块,用于若所述第一传输通道的内存占用超过所述预设第一内存占用阈值,则发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的当前数据负荷是否超过预设第二数据负荷阈值;The sending module is configured to send the change of the second transmission channel unit in the second transmission channel in the opposite direction to the first transmission channel if the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold. The request in the transmission direction is sent to the receiver, and the receiver determines whether the current data load of the second transmission channel exceeds the preset second data load threshold;
变更模块,用于若所述第二传输通道的内存占用不超过所述预设第二内存占用阈值,则变更所述第二传输通道中至少一个第二传输通道单元的传输方向;a change module, configured to change the transmission direction of at least one second transmission channel unit in the second transmission channel if the memory occupation of the second transmission channel does not exceed the preset second memory occupation threshold;
传输模块,用于通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。The transmission module is configured to jointly transmit the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed.
可选地,在所述变更所述第二传输通道中至少一个第二传输通道单元的传输方向的步骤之后,所述变更模块还用于:Optionally, after the step of changing the transmission direction of at least one second transmission channel unit in the second transmission channel, the changing module is further configured to:
获取所述第二传输通道中的当前内存占用;obtaining the current memory occupation in the second transmission channel;
若所述当前内存占用超过所述预设第二内存占用阈值,则恢复所述第二传输通道单元的传输方向。If the current memory occupation exceeds the preset second memory occupation threshold, the transmission direction of the second transmission channel unit is restored.
可选地,所述变更所述第二传输通道中至少一个第二传输通道单元的传输方向的步骤包括:Optionally, the step of changing the transmission direction of at least one second transmission channel unit in the second transmission channel includes:
逐个变更所述第二传输通道中与所述第一传输通道相邻的第二传输通道中第二传输通道单元的传输方向。The transmission direction of the second transmission channel units in the second transmission channel adjacent to the first transmission channel in the second transmission channel is changed one by one.
可选地,所述通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据的步骤,所述传输模块还用于:Optionally, in the step of jointly transmitting the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed, the transmission module is further configured to:
对所述待传输数据进行校验,得到校验结果;Verifying the data to be transmitted to obtain a verification result;
当所述校验结果为校验通过时,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。When the verification result is that the verification is passed, the data to be transmitted is jointly transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed.
可选地,所述当所述校验结果为校验通过时,通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据的步骤,所述传输模块还用于:Optionally, the step of jointly transmitting the data to be transmitted through the first transmission channel and the second transmission channel unit whose transmission direction has been changed when the verification result is that the verification is passed, the transmission module Also used for:
分别计算所述第一传输通道中第一传输通道单元以及所述第二传输通道单元的数量,得到传输通道单元数量;Calculate the number of the first transmission channel unit and the second transmission channel unit in the first transmission channel respectively to obtain the number of transmission channel units;
将所述待传输数据分为所述传输通道单元数量的子待传输数据,其中,所述子待传输数据的大小不超过各传输通道单元的最大载荷量;dividing the data to be transmitted into sub-data to be transmitted in the number of transmission channel units, wherein the size of the sub-data to be transmitted does not exceed the maximum payload of each transmission channel unit;
分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据。Each of the sub-data to be transmitted is transmitted through the first transmission channel unit and the second transmission channel unit respectively.
可选地,所述分别通过所述第一传输通道单元和所述第二传输通道单元传输各所述子待传输数据的步骤,所述传输模块还用于:Optionally, in the step of respectively transmitting the data to be transmitted by the first transmission channel unit and the second transmission channel unit, the transmission module is further configured to:
在所述第一传输通道单元和所述第二传输通道单元中选取传输所述子待传输数据的目标传输通道单元;Selecting a target transmission channel unit for transmitting the sub-to-be-transmitted data from the first transmission channel unit and the second transmission channel unit;
判断所述子待传输数据是否满足预设分片传输条件;Judging whether the sub-data to be transmitted satisfies the preset fragmentation transmission conditions;
若是,则通过所述目标传输通道单元分片传输所述子待传输数据,其中,所述目标传输通道单元至少包含两个传输通道单元;If so, transmit the sub-data to be transmitted through the target transmission channel unit fragmentation, wherein the target transmission channel unit includes at least two transmission channel units;
若否,则通过所述目标传输通道单元传输所述子待传输数据,其中,所述目标传输通道单元包含一个传输通道单元。If not, the sub-data to be transmitted is transmitted through the target transmission channel unit, wherein the target transmission channel unit includes one transmission channel unit.
可选地,所述通过所述目标传输通道单元分片传输所述子待传输数据的步骤,所述传输模块还用于:Optionally, in the step of transmitting the sub-data to be transmitted through the target transmission channel unit fragmentation, the transmission module is further used for:
将所述子待传输数据分为预设数量的子待传输数据片段;dividing the sub-data to be transmitted into a preset number of sub-data segments to be transmitted;
将各所述子待传输数据片段以及各所述子待传输数据片段对应的序列号发送至所述目标传输通道单元;sending each of the sub-data segments to be transmitted and the sequence numbers corresponding to each of the sub-data segments to be transmitted to the target transmission channel unit;
在检测到所述目标传输通道单元接收到各所述子待传输数据片段以及各所述子待传输数据片段对应的序列号时,将各所述子待传输数据片段根据所述序列号进行拼接,得到所述子待传输数据。When detecting that the target transmission channel unit has received each of the sub-data segments to be transmitted and the sequence numbers corresponding to each of the sub-data segments to be transmitted, splicing the sub-data segments to be transmitted according to the sequence numbers , to obtain the data to be transmitted from the child.
本申请提供的通信优化装置,采用上述实施例中的通信优化方法,解决了非对称通信效率低的技术问题。与现有技术相比,本申请实施例提供的通信优化装置的有益效果与上述实施例提供的通信优化方法的有益效果相同,且该通信优化装置中的其他技术特征与上述实施例方法公开的特征相同,在此不做赘述。The communication optimization apparatus provided by the present application solves the technical problem of low asymmetric communication efficiency by using the communication optimization method in the above embodiment. Compared with the prior art, the beneficial effects of the communication optimization device provided by the embodiments of the present application are the same as those of the communication optimization method provided by the above-mentioned embodiments, and other technical features in the communication optimization device are the same as those disclosed in the methods of the above-mentioned embodiments. The features are the same and will not be repeated here.
实施例四Embodiment 4
本申请实施例提供一种电子设备,所述电子设备包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述实施例中的通信优化方法。An embodiment of the present application provides an electronic device, the electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor. The at least one processor executes to enable the at least one processor to execute the communication optimization method in the above-described embodiments.
下面参考图3,其示出了适于用来实现本公开实施例的电子设备的结构示意图。本公开实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图3示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring next to FIG. 3 , it shows a schematic structural diagram of an electronic device suitable for implementing an embodiment of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (eg, mobile terminals such as in-vehicle navigation terminals), etc., and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in FIG. 3 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
如图3所示,电子设备可以包括处理装置(例如中央处理器、图形处理器等),其可以根据存储在只读存储器(ROM)中的程序或者从存储装置加载到随机访问存储器(RAM)中的程序而执行各种适当的动作和处理。在RAM中,还存储有电子设备操作所需的各种程序和数据。处理装置、ROM以及RAM通过总线彼此相连。输入/输出(I/O)接口也连接至总线。As shown in FIG. 3, an electronic device may include processing means (eg, a central processing unit, a graphics processor, etc.), which may be loaded into a random access memory (RAM) according to a program stored in a read only memory (ROM) or from a storage device to execute various appropriate actions and processes. In the RAM, various programs and data necessary for the operation of the electronic device are also stored. The processing device, the ROM, and the RAM are connected to each other through a bus. Input/output (I/O) interfaces are also connected to the bus.
通常,以下系统可以连接至I/O接口:包括例如触摸屏、触摸板、键盘、鼠标、图像传感器、麦克风、加速度计、陀螺仪等的输入装置;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置;包括例如磁带、硬盘等的存储装置;以及通信装置。通信装置可以允许电子设备与其他设备进行无线或有线通信以交换数据。虽然图中示出了具有各种系统的电子设备,但是应理解的是,并不要求实施或具备所有示出的系统。可以替代地实施或具备更多或更少的系统。Typically, the following systems can be connected to the I/O interface: input devices including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; including, for example, liquid crystal displays (LCDs), speakers, vibrators output devices, etc.; storage devices including, for example, magnetic tapes, hard disks, etc.; and communication devices. Communication means may allow electronic devices to communicate wirelessly or by wire with other devices to exchange data. While the figures show electronic devices having various systems, it should be understood that not all of the systems shown are required to be implemented or available. More or fewer systems may alternatively be implemented or provided.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置从网络上被下载和安装,或者从存储装置被安装,或者从ROM被安装。在该计算机程序被处理装置执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device, or from a storage device, or from a ROM. When the computer program is executed by the processing apparatus, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
本申请提供的电子设备,采用上述实施例中的通信优化方法,解决了非对称通信效率低的技术问题。与现有技术相比,本申请实施例提供的电子设备的有益效果与上述实施例提供的通信优化方法的有益效果相同,且该电子设备中的其他技术特征与上述实施例方法公开的特征相同,在此不做赘述。The electronic device provided by the present application adopts the communication optimization method in the above-mentioned embodiment to solve the technical problem of low asymmetric communication efficiency. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiments of the present application are the same as those of the communication optimization method provided by the above-mentioned embodiments, and other technical features in the electronic device are the same as those disclosed in the methods of the above-mentioned embodiments. , which will not be repeated here.
应当理解,本公开的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式的描述中,具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the foregoing description of the embodiments, the particular features, structures, materials or characteristics may be combined in any suitable manner in any one or more of the embodiments or examples.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
实施例五Embodiment 5
本实施例提供一种计算机可读存储介质,具有存储在其上的计算机可读程序指令,计算机可读程序指令用于执行上述实施例中的通信优化的方法。This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, where the computer-readable program instructions are used to execute the communication optimization method in the foregoing embodiment.
本申请实施例提供的计算机可读存储介质例如可以是U盘,但不限于电、磁、光、电磁、红外线、或半导体的系统、系统或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、系统或者器件使用或者与其结合使用。计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。The computer-readable storage medium provided by the embodiments of the present application may be, for example, a U disk, but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. Program code embodied on a computer-readable storage medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
上述计算机可读存储介质可以是电子设备中所包含的;也可以是单独存在,而未装配入电子设备中。The above-mentioned computer-readable storage medium may be included in the electronic device; or may exist alone without being assembled into the electronic device.
上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被电子设备执行时,使得电子设备:获取待传输数据以及所述待传输数据对应的第一传输通道;判断所述第一传输通道的内存占用是否超过预设第一内存占用阈值;若所述第一传输通道的内存占用超过所述预设第一内存占用阈值,则发送变更与所述第一传输通道方向相反的第二传输通道中第二传输通道单元的传输方向的请求至接收方,并通过所述接收方判断所述第二传输通道的内存占用是否超过预设第二内存占用阈值;若所述第二传输通道的内存占用不超过所述预设第二内存占用阈值,则变更所述第二传输通道中至少一个第二传输通道单元的传输方向;通过所述第一传输通道以及已变更传输方向的第二传输通道单元共同传输所述待传输数据。The above-mentioned computer-readable storage medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the data to be transmitted and the first transmission channel corresponding to the data to be transmitted; Whether the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold; if the memory occupation of the first transmission channel exceeds the preset first memory occupation threshold, send the change and the direction of the first transmission channel On the contrary, the request for the transmission direction of the second transmission channel unit in the second transmission channel is sent to the receiver, and the receiver determines whether the memory occupation of the second transmission channel exceeds the preset second memory occupation threshold; if the The memory occupancy of the second transmission channel does not exceed the preset second memory occupancy threshold, then the transmission direction of at least one second transmission channel unit in the second transmission channel is changed; through the first transmission channel and the changed transmission The second transmission channel units in the direction jointly transmit the to-be-transmitted data.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional Procedural programming language - such as the "C" language or similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该单元本身的限定。The modules involved in the embodiments of the present disclosure may be implemented in software or hardware. Among them, the name of the module does not constitute a limitation of the unit itself under certain circumstances.
本申请提供的计算机可读存储介质,存储有用于执行上述通信优化方法的计算机可读程序指令,解决了非对称通信效率低的技术问题。与现有技术相比,本申请实施例提供的计算机可读存储介质的有益效果与上述实施提供的通信优化方法的有益效果相同,在此不做赘述。The computer-readable storage medium provided by the present application stores computer-readable program instructions for executing the above communication optimization method, and solves the technical problem of low asymmetric communication efficiency. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiments of the present application are the same as the beneficial effects of the communication optimization method provided by the above implementation, which will not be repeated here.
实施例六Embodiment 6
本申请还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述的通信优化方法的步骤。The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned communication optimization method when the computer program is executed by a processor.
本申请提供的计算机程序产品解决了非对称通信效率低的技术问题。与现有技术相比,本申请实施例提供的计算机程序产品的有益效果与上述实施例提供的通信优化方法的有益效果相同,在此不做赘述。The computer program product provided by the present application solves the technical problem of low asymmetric communication efficiency. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiments of the present application are the same as those of the communication optimization method provided by the above-mentioned embodiments, which will not be repeated here.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利处理范围内。The above are only the preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present application, or directly or indirectly applied in other related technical fields , are similarly included within the scope of patent processing of this application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210295635.3A CN114866564A (en) | 2022-03-24 | 2022-03-24 | Communication optimization method, apparatus, electronic device, and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210295635.3A CN114866564A (en) | 2022-03-24 | 2022-03-24 | Communication optimization method, apparatus, electronic device, and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114866564A true CN114866564A (en) | 2022-08-05 |
Family
ID=82629805
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210295635.3A Pending CN114866564A (en) | 2022-03-24 | 2022-03-24 | Communication optimization method, apparatus, electronic device, and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114866564A (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101841447A (en) * | 2010-04-02 | 2010-09-22 | 北京恒光创新科技股份有限公司 | Bus bandwidth adaptive device and method |
JP2011199361A (en) * | 2010-03-17 | 2011-10-06 | Hitachi Ltd | Data transmission system and data transmitter |
CN106302209A (en) * | 2015-06-12 | 2017-01-04 | 华为技术有限公司 | A kind of network-on-chip NoC and the method for data transmission |
CN106453072A (en) * | 2016-06-22 | 2017-02-22 | 中国科学院计算技术研究所 | Greedy distribution method and device of on-chip network router channel resources and router |
CN106559130A (en) * | 2015-09-30 | 2017-04-05 | 电信科学技术研究院 | A kind of data transmission method and device |
CN108777603A (en) * | 2018-04-28 | 2018-11-09 | 出门问问信息科技有限公司 | A kind of data transmission method, device, storage medium and electronic equipment |
CN110659239A (en) * | 2018-06-29 | 2020-01-07 | 英特尔公司 | Dynamically negotiating asymmetric link widths in a multi-lane link |
CN111640314A (en) * | 2020-06-09 | 2020-09-08 | 曾令根 | Intelligent variable lane traffic flow control system based on big data and control method thereof |
CN113315706A (en) * | 2021-04-30 | 2021-08-27 | 上海云轴信息科技有限公司 | Private cloud flow control method, device and system |
CN113556618A (en) * | 2021-07-20 | 2021-10-26 | 北京奇艺世纪科技有限公司 | Data transmission method and device |
CN113570855A (en) * | 2021-06-22 | 2021-10-29 | 阿波罗智联(北京)科技有限公司 | Variable lane control method, device, equipment and storage medium |
-
2022
- 2022-03-24 CN CN202210295635.3A patent/CN114866564A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011199361A (en) * | 2010-03-17 | 2011-10-06 | Hitachi Ltd | Data transmission system and data transmitter |
CN101841447A (en) * | 2010-04-02 | 2010-09-22 | 北京恒光创新科技股份有限公司 | Bus bandwidth adaptive device and method |
CN106302209A (en) * | 2015-06-12 | 2017-01-04 | 华为技术有限公司 | A kind of network-on-chip NoC and the method for data transmission |
CN106559130A (en) * | 2015-09-30 | 2017-04-05 | 电信科学技术研究院 | A kind of data transmission method and device |
CN106453072A (en) * | 2016-06-22 | 2017-02-22 | 中国科学院计算技术研究所 | Greedy distribution method and device of on-chip network router channel resources and router |
CN108777603A (en) * | 2018-04-28 | 2018-11-09 | 出门问问信息科技有限公司 | A kind of data transmission method, device, storage medium and electronic equipment |
CN110659239A (en) * | 2018-06-29 | 2020-01-07 | 英特尔公司 | Dynamically negotiating asymmetric link widths in a multi-lane link |
CN111640314A (en) * | 2020-06-09 | 2020-09-08 | 曾令根 | Intelligent variable lane traffic flow control system based on big data and control method thereof |
CN113315706A (en) * | 2021-04-30 | 2021-08-27 | 上海云轴信息科技有限公司 | Private cloud flow control method, device and system |
CN113570855A (en) * | 2021-06-22 | 2021-10-29 | 阿波罗智联(北京)科技有限公司 | Variable lane control method, device, equipment and storage medium |
CN113556618A (en) * | 2021-07-20 | 2021-10-26 | 北京奇艺世纪科技有限公司 | Data transmission method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114201317B (en) | Data transmission method and device, storage medium and electronic equipment | |
WO2023000888A1 (en) | Cloud application implementing method and apparatus, electronic device, and storage medium | |
WO2020258782A1 (en) | Data transmission method applicable to bluetooth card reader, and electronic apparatus | |
CN115237589A (en) | SR-IOV-based virtualization method, device and equipment | |
CN116668564A (en) | Multi-mode network message processing method, device, equipment and readable storage medium | |
CN113157365B (en) | Program running method, program running device, electronic equipment and computer readable medium | |
CN116070285A (en) | Asynchronous consensus method, device, server and medium based on Bayesian fault tolerance | |
CN114866564A (en) | Communication optimization method, apparatus, electronic device, and readable storage medium | |
CN115589527B (en) | Automatic driving image transmission method, device, electronic equipment and computer medium | |
CN114793227B (en) | Vehicle-mounted software downloading method, electronic equipment and computer readable storage medium | |
CN111756833B (en) | Node processing method, node processing device, electronic equipment and computer readable medium | |
CN111949833B (en) | Index construction method, data processing method, device, electronic equipment and medium | |
CN114780124A (en) | Differential upgrading method, device, medium and electronic equipment | |
WO2022103338A1 (en) | Data processing method and apparatus, and electronic device | |
WO2022108521A1 (en) | Model processing method and system | |
CN112486826B (en) | Test method, test device, electronic equipment and computer readable medium | |
CN114785794B (en) | Resource allocation method, device, equipment, medium and system | |
CN113852484B (en) | Terminal equipment network distribution method, device, electronic equipment and computer readable medium | |
CN115941750B (en) | Calculation force optimization method, equipment and computer medium of automatic driving system chip | |
CN116506112B (en) | Data processing method and device based on privacy calculation and electronic equipment | |
CN115733893B (en) | Touch screen networking monitoring method, device, equipment and readable storage medium | |
CN111626787B (en) | Resource issuing method, device, medium and equipment | |
CN114172946B (en) | Request result sending method, device, electronic equipment and computer readable medium | |
CN111324512B (en) | Method, apparatus, electronic device, and computer-readable medium for generating text | |
CN113778956B (en) | Resource processing method, device, electronic equipment and computer readable 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220805 |
|
RJ01 | Rejection of invention patent application after publication |