CN111970340A - Information transmission method, readable storage medium and electronic device - Google Patents
Information transmission method, readable storage medium and electronic device Download PDFInfo
- Publication number
- CN111970340A CN111970340A CN202010752239.XA CN202010752239A CN111970340A CN 111970340 A CN111970340 A CN 111970340A CN 202010752239 A CN202010752239 A CN 202010752239A CN 111970340 A CN111970340 A CN 111970340A
- Authority
- CN
- China
- Prior art keywords
- information transmission
- information
- client
- target information
- target
- 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.)
- Granted
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 313
- 238000000034 method Methods 0.000 title claims abstract description 72
- 230000006854 communication Effects 0.000 claims abstract description 132
- 238000004891 communication Methods 0.000 claims abstract description 129
- 230000004044 response Effects 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 15
- 230000007246 mechanism Effects 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 9
- 230000006870 function Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000012360 testing method Methods 0.000 description 3
- 230000001934 delay Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000008014 freezing Effects 0.000 description 2
- 238000007710 freezing Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000011664 signaling Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
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/14—Session management
- H04L67/141—Setup of application sessions
-
- 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/14—Session management
-
- 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)
- Computer And Data Communications (AREA)
Abstract
本发明实施例公开了一种信息传输方法、可读存储介质和电子设备,通过多个通信方式不同的第一信息传输通道与第一客户端建立通信连接,通过多个通信方式不同的第二信息传输通道与第二客户端建立通信连接。在接收到第一客户端通过至少一个第一信息传输通道发送的目标信息时存储各所述目标信息,并通过与各目标信息对应的第一信息传输通道通信方式相同的第二信息传输通道向第二客户端发送所述目标信息。本发明实施例可以通过多个通信方式不同的信息传输通道进行信息传输,避免在信息传输过程中因掉线、丢包、卡顿、延时等问题导致信息传输失败。
Embodiments of the present invention disclose an information transmission method, a readable storage medium, and an electronic device. A communication connection is established with a first client through a plurality of first information transmission channels with different communication modes, and a communication connection is established with a first client through a plurality of second information transmission channels with different communication modes. The information transmission channel establishes a communication connection with the second client. When receiving the target information sent by the first client through at least one first information transmission channel, each of the target information is stored, and sent to the The second client sends the target information. The embodiments of the present invention can transmit information through multiple information transmission channels with different communication modes, so as to avoid the failure of information transmission due to problems such as disconnection, packet loss, freeze, delay and the like during the information transmission process.
Description
技术领域technical field
本发明涉及计算机技术领域,尤其涉及一种信息传输方法、可读存储介质和电子设备。The present invention relates to the field of computer technology, and in particular, to an information transmission method, a readable storage medium and an electronic device.
背景技术Background technique
随着互联网技术的发展,越来越多的信息可以通过网络在线传输,提高了信息传输过程的速度、效率和质量。但在现有技术中,两个设备之间在进行信息传输时,数据通信过程会受到各种因素的干扰,导致掉线、丢包、卡顿、延时等现象,使得通信质量不高,影响用户体验。With the development of Internet technology, more and more information can be transmitted online through the network, which improves the speed, efficiency and quality of the information transmission process. However, in the prior art, during information transmission between two devices, the data communication process will be interfered by various factors, resulting in dropped calls, packet loss, freezes, delays, etc., resulting in poor communication quality. affect the user experience.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明实施例提供了一种信息传输方法、可读存储介质和电子设备,旨在通过多个通信方式不同的信息传输通道进行信息传输,保证通信过程的可靠性。In view of this, the embodiments of the present invention provide an information transmission method, a readable storage medium, and an electronic device, which aim to transmit information through multiple information transmission channels with different communication modes, so as to ensure the reliability of the communication process.
第一方面,本发明实施例提供了一种信息传输方法,所述方法包括:In a first aspect, an embodiment of the present invention provides an information transmission method, the method includes:
确定待传输的目标信息;Determine the target information to be transmitted;
确定多个第一信息传输通道的当前通信状态,各所述第一信息传输通道对应不同的通信方式;determining the current communication status of a plurality of first information transmission channels, each of the first information transmission channels corresponding to different communication modes;
响应于存在至少一个通信状态正常的第一信息传输通道,通过所述第一信息传输通道发送所述目标信息。In response to the existence of at least one first information transmission channel with a normal communication state, the target information is sent through the first information transmission channel.
进一步地,所述方法还包括:Further, the method also includes:
响应于发送目标信息后预定时间段内未接收到传输成功提醒,通过显示界面显示传输失败提醒,所述传输失败提醒中包括目标信息重新发送控件。In response to not receiving a transmission success reminder within a predetermined period of time after the target information is sent, a transmission failure reminder is displayed on the display interface, and the transmission failure reminder includes a target information resending control.
进一步地,所述方法还包括:Further, the method also includes:
响应于接收到传输失败提醒,通过显示界面显示传输失败提醒,所述传输失败提醒用于表征各第一信息传输通道传输的目标信息均未被成功接收,所述传输失败提醒中包括目标信息重新发送控件。In response to receiving the transmission failure reminder, the transmission failure reminder is displayed through the display interface, and the transmission failure reminder is used to indicate that the target information transmitted by each first information transmission channel has not been successfully received, and the transmission failure reminder includes the target information re-transmission. Send control.
第二方面,本发明实施例提供了一种信息传输方法,所述方法包括:In a second aspect, an embodiment of the present invention provides an information transmission method, the method includes:
通过多个第一信息传输通道与第一客户端建立通信连接,各所述第一信息传输通道对应不同的通信方式;Establish a communication connection with the first client through a plurality of first information transmission channels, each of the first information transmission channels corresponding to different communication modes;
响应于接收到第一客户端通过至少一个第一信息传输通道发送的目标信息,存储各所述第一信息传输通道发送的目标信息;In response to receiving the target information sent by the first client through at least one first information transmission channel, storing the target information sent by each of the first information transmission channels;
通过多个第二信息传输通道与第二客户端建立通信连接,各所述第二信息传输通道对应不同的通信方式;Establish a communication connection with the second client through a plurality of second information transmission channels, each of the second information transmission channels corresponding to different communication modes;
响应于所述第二客户端状态为在线,通过与各目标信息对应的第一信息传输通道通信方式相同的第二信息传输通道向第二客户端发送所述目标信息。In response to the state of the second client being online, the target information is sent to the second client through a second information transmission channel with the same communication mode as the first information transmission channel corresponding to each target information.
进一步地,所述方法包括:Further, the method includes:
对通过各所述第一传输通道接收的目标信息进行计数;Counting the target information received through each of the first transmission channels;
响应于计数结果大于预设阈值,向第一客户端发送传输成功提醒。In response to the counting result being greater than the preset threshold, a transmission success notification is sent to the first client.
第三方面,本发明实施例提供了一种信息传输方法,所述方法包括:In a third aspect, an embodiment of the present invention provides an information transmission method, the method comprising:
确定多个第二信息传输通道的当前通信状态,各所述第二信息传输通道对应不同的通信方式;determining the current communication status of a plurality of second information transmission channels, each of the second information transmission channels corresponding to different communication modes;
响应于存在至少一个通信状态正常的第二信息传输通道,通过所述第二信息传输通道接收目标信息;In response to the existence of at least one second information transmission channel with a normal communication state, receiving target information through the second information transmission channel;
对接收到的目标消息进行去重操作以确定接收消息。A deduplication operation is performed on the received target message to determine the received message.
进一步地,所述通过所述第二信息传输通道接收目标信息具体为:Further, the receiving target information through the second information transmission channel is specifically:
通过所述第二信息传输通道在服务器端主动拉取目标信息。The target information is actively pulled from the server side through the second information transmission channel.
进一步地,所述确定多个第二信息传输通道的当前通信状态具体为:Further, the determining of the current communication status of the plurality of second information transmission channels is specifically:
基于心跳机制判断各所述第二信息传输通道的当前通信状态。The current communication state of each of the second information transmission channels is determined based on the heartbeat mechanism.
第四方面,本发明实施例提供了一种计算机可读存储介质,用于存储计算机程序指令,所述计算机程序指令在被处理器执行时实现如第一方面、第二方面和第三方面中任一项所述的方法。In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium for storing computer program instructions, the computer program instructions implementing the first aspect, the second aspect and the third aspect when executed by a processor The method of any one.
第五方面,本发明实施例提供了一种电子设备,包括存储器和处理器,所述存储器用于存储一条或多条计算机程序指令,其中,所述一条或多条计算机程序指令被所述处理器执行以实现如第一方面、第二方面和第三方面中任一项所述的方法。In a fifth aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are processed by the The machine executes to implement the method of any one of the first, second and third aspects.
本发明实施例中服务器通过多个通信方式不同的第一信息传输通道与第一客户端建立通信连接。同时,通过多个通信方式不同的第二信息传输通道与第二客户端建立通信连接。在接收到第一客户端通过至少一个第一信息传输通道发送的目标信息时存储各所述目标信息,并通过与各目标信息对应的第一信息传输通道通信方式相同的第二信息传输通道向第二客户端发送所述目标信息。由此,本发明实施例可以通过多个通信方式不同的信息传输通道进行信息传输,避免在信息传输过程中因掉线、丢包、卡顿、延时等问题导致信息传输失败,保证通信过程的可靠性。In the embodiment of the present invention, the server establishes a communication connection with the first client through a plurality of first information transmission channels with different communication modes. At the same time, a communication connection is established with the second client through a plurality of second information transmission channels with different communication modes. When receiving the target information sent by the first client through at least one first information transmission channel, each of the target information is stored, and sent to the The second client sends the target information. As a result, the embodiments of the present invention can transmit information through multiple information transmission channels with different communication methods, avoid information transmission failure due to problems such as dropped calls, packet loss, freezes, and delays during the information transmission process, and ensure the communication process. reliability.
附图说明Description of drawings
通过以下参照附图对本发明实施例的描述,本发明的上述以及其它目的、特征和优点将更为清楚,在附图中:The above and other objects, features and advantages of the present invention will become more apparent from the following description of embodiments of the present invention with reference to the accompanying drawings, in which:
图1为应用本发明实施例的信息传输方法的信息传输系统的示意图;1 is a schematic diagram of an information transmission system to which an information transmission method according to an embodiment of the present invention is applied;
图2为本发明实施例第一客户端侧的信息传输方法的流程图;FIG. 2 is a flowchart of a first client-side information transmission method according to an embodiment of the present invention;
图3为本发明实施例的第一客户端侧的信息传输过程的示意图;3 is a schematic diagram of an information transmission process on a first client side according to an embodiment of the present invention;
图4为本发明实施例的服务器侧的信息传输方法的流程图;4 is a flowchart of an information transmission method on a server side according to an embodiment of the present invention;
图5为本发明实施例的服务器侧的信息传输过程的示意图;5 is a schematic diagram of an information transmission process on a server side according to an embodiment of the present invention;
图6为本发明实施例第二客户端侧的信息传输方法的流程图;6 is a flowchart of an information transmission method on a second client side according to an embodiment of the present invention;
图7为本发明实施例的第二客户端侧的信息传输过程的示意图;7 is a schematic diagram of an information transmission process on a second client side according to an embodiment of the present invention;
图8为本发明实施例的信息传输方法的信令流程图;8 is a signaling flowchart of an information transmission method according to an embodiment of the present invention;
图9为本发明实施例的电子设备的示意图。FIG. 9 is a schematic diagram of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
以下基于实施例对本发明进行描述,但是本发明并不仅仅限于这些实施例。在下文对本发明的细节描述中,详尽描述了一些特定的细节部分。对本领域技术人员来说没有这些细节部分的描述也可以完全理解本发明。为了避免混淆本发明的实质,公知的方法、过程、流程、元件和电路并没有详细叙述。The present invention is described below based on examples, but the present invention is not limited to these examples only. In the following detailed description of the invention, some specific details are described in detail. The present invention can be fully understood by those skilled in the art without the description of these detailed parts. Well-known methods, procedures, procedures, components and circuits have not been described in detail in order to avoid obscuring the essence of the present invention.
此外,本领域普通技术人员应当理解,在此提供的附图都是为了说明的目的,并且附图不一定是按比例绘制的。Furthermore, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
除非上下文明确要求,否则在说明书的“包括”、“包含”等类似词语应当解释为包含的含义而不是排他或穷举的含义;也就是说,是“包括但不限于”的含义。Unless clearly required by the context, words such as "including", "comprising" and the like in the specification should be construed in an inclusive rather than an exclusive or exhaustive sense; that is, in the sense of "including but not limited to".
在本发明的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本发明的描述中,除非另有说明,“多个”的含义是两个或两个以上。In the description of the present invention, it should be understood that the terms "first", "second" and the like are used for descriptive purposes only, and should not be construed as indicating or implying relative importance. Also, in the description of the present invention, unless otherwise specified, "plurality" means two or more.
图1为应用本发明实施例的信息传输方法的信息传输系统的示意图。如图1所示,所述信息传输系统包括通过网络连接的服务器10、第一客户端11和第二客户端12。其中,所述服务器10用于通过多个第一信息传输通道接收所述信息发送终端11发送的目标信息,对接收到的至少一个目标信息进行计数并存储,以向所述信息发送终端11返回传输成功提醒。同时,所述服务器10根据各所述目标信息对应的第一信息传输通道确定对应的第二传输通道,以通过对应的第二传输通道将各目标信息发送至第二客户端12。FIG. 1 is a schematic diagram of an information transmission system to which an information transmission method according to an embodiment of the present invention is applied. As shown in FIG. 1 , the information transmission system includes a
本发明实施例可以应用于任何终端之间通过服务器进行信息传输的信息传输系统中。例如社交软件、直播软件以及在线教育网站等应用场景。在本发明实施例中,所述服务器10可以是单个服务器、也可以是以分布式方式配置的服务器集群。所述第一客户端11和第二客户端12可以是能够运行计算机程序的、具有通信功能通用数据处理终端,例如,智能手机或平板电脑等。The embodiments of the present invention can be applied to any information transmission system in which information is transmitted between terminals through a server. For example, application scenarios such as social software, live broadcast software, and online education websites. In this embodiment of the present invention, the
以所述信息传输方法用于在线教育平台的应用场景为例进行说明。所述第一客户端11可以为教师用户使用的教师终端,所述服务器10为在线教育平台服务器,所述第二客户端12可以为学生用户使用的学生终端。当在线教学的过程中,教师用户需要向学生用户发送课件、试题、作业等数据信息时,教师终端先通过多个第一信息传输通道根据不同的通信方式向服务器10发送目标信息。所述服务器10存储接收到的目标信息,并对目标信息的数量进行计数,在计数结果符合预设条件时向教师终端返回传输成功提醒。同时,所述服务器10还根据接收到目标信息对应的第一信息传输通道确定对应的通信方式,通过对应于所述通信方式的第二信息传输通道将所述目标信息传输至学生终端。当所述学生终端通过多个第二信息传输通道接收到一个以上相同的目标信息时,通过去重操作在多个目标信息中确定接收信息。可选地,所述学生终端通过显示界面显示所述接收信息。An application scenario in which the information transmission method is used in an online education platform is taken as an example for description. The
图2为本发明实施例第一客户端侧的信息传输方法的流程图。如图2所示,第一客户端侧的信息传输方法包括以下步骤:FIG. 2 is a flowchart of a first client-side information transmission method according to an embodiment of the present invention. As shown in Figure 2, the information transmission method on the first client side includes the following steps:
步骤S100、确定待传输的目标信息。Step S100: Determine target information to be transmitted.
具体地,所述目标信息通过第一客户端确定,所述第一客户端为信息发送终端。在本发明实施例中,所述目标信息可以为任意能通过信息传输通道进行信息传输的数据信息,例如图片、文本、音频、视频、网页等信息。以所述信息传输方法应用于在线教育平台为例进行说明。所述第一客户端可以为教师用户登录的教师终端或学生用户登录的学生终端。当所述第一客户端为教师终端时,所述目标信息可以为在线教学过程中需要向学生终端发送的课件、试题、作业、课件翻页指令等信息。当所述第一客户端为学生终端时,所述目标信息可以为在线教学过程中学生终端需要向教师终端反馈的答案、笔记、填写完成的试卷页面等信息。Specifically, the target information is determined by a first client, and the first client is an information sending terminal. In this embodiment of the present invention, the target information may be any data information that can transmit information through an information transmission channel, such as information such as pictures, texts, audios, videos, and web pages. The description is given by taking the application of the information transmission method to an online education platform as an example. The first client terminal may be a teacher terminal logged in by a teacher user or a student terminal logged in by a student user. When the first client terminal is a teacher terminal, the target information may be information such as courseware, test questions, homework, and courseware page turning instructions that need to be sent to the student terminal during the online teaching process. When the first client terminal is a student terminal, the target information may be information such as answers, notes, and completed test paper pages that the student terminal needs to feed back to the teacher terminal during the online teaching process.
步骤S200、确定多个第一信息传输通道的当前通信状态。Step S200: Determine the current communication status of the multiple first information transmission channels.
具体地,所述第一客户端通过多个第一信息传输通道与服务器建立通信连接,各所述第一信息传输通道对应不同的通信方式。所述通信方式包括通信协议和通信规则,即各所述第一信息传输通道对应的通信协议或通信规则不同。所述第一客户端在发送目标信息前,需要先确定各所述第一信息传输通道的当前通信状态是否正常。在本发明实施例中,所述第一客户端可以通过检测各所述第一信息传输通道是否开启判断当前通信状态。可选地,所述第一客户端在检测第一信息传输通道开启后,根据各所述第一信息通道的特性,还可以进一步通过与服务器之间进行三次握手等方式判断开启的第一信息传输通道当前的通信状态是否正常。Specifically, the first client establishes a communication connection with the server through a plurality of first information transmission channels, and each of the first information transmission channels corresponds to a different communication mode. The communication modes include communication protocols and communication rules, that is, the communication protocols or communication rules corresponding to each of the first information transmission channels are different. Before sending the target information, the first client needs to determine whether the current communication state of each of the first information transmission channels is normal. In this embodiment of the present invention, the first client can determine the current communication state by detecting whether each of the first information transmission channels is open. Optionally, after detecting that the first information transmission channel is opened, according to the characteristics of each of the first information channels, the first client may further determine the opened first information by performing a three-way handshake with the server or the like. Whether the current communication status of the transmission channel is normal.
例如,所述第一客户端可以通过长连接websocket通道、http(HyperTextTransfer Protocol)长轮询通道、UDP(User Datagram Protocol)无连接通道三种通信方式不同的第一信息传输通道与服务器建立连接。在发送目标信息前,所述第一客户端先判断各所述第一信息传输通道是否开启,直接判断开启的第一信息传输通道通信状态正常。For example, the first client can establish a connection with the server through three first information transmission channels with different communication modes, a long-connection websocket channel, an http (HyperTextTransfer Protocol) long-polling channel, and a UDP (User Datagram Protocol) connectionless channel. Before sending the target information, the first client first determines whether each of the first information transmission channels is open, and directly determines that the communication status of the opened first information transmission channels is normal.
步骤S300、响应于存在至少一个通信状态正常的第一信息传输通道,通过所述第一信息传输通道发送所述目标信息。Step S300: In response to the existence of at least one first information transmission channel with a normal communication state, send the target information through the first information transmission channel.
具体地,在所述第一客户端判断各所述第一信息传输通道当前的通信状态后,当确定至少一个第一信息传输通道的通信状态正常时,开始进行信息传输。其中,通过各所述通信状态正常的第一信息传输通道分别基于对应的通信方式传输所述目标信息,即通过对应的通信协议以及规则对所述目标信息进行打包后传输。可选地,本发明实施例还可以预先设定各所述第一信息传输通道的信息传输优先级,按顺序进行信息传输。在优先级较高的第一信息传输通道信息传输失败时,通过下一个第一信息传输通道传输所述目标信息。Specifically, after the first client determines the current communication state of each of the first information transmission channels, when it is determined that the communication state of at least one of the first information transmission channels is normal, information transmission is started. The target information is transmitted through each of the first information transmission channels in a normal communication state based on a corresponding communication mode, that is, the target information is packaged and transmitted through corresponding communication protocols and rules. Optionally, in this embodiment of the present invention, information transmission priorities of each of the first information transmission channels may be preset, and information transmission is performed in sequence. When the information transmission of the first information transmission channel with a higher priority fails, the target information is transmitted through the next first information transmission channel.
以所述第一客户端通过长连接websocket通道、http长轮询通道、UDP无连接通道三种通信方式不同的第一信息传输通道与服务器建立连接,且各第一信息传输通道通信状态均正常为例进行说明。在所述长连接websocket通道已经在服务器与第一客户端之间建立连接的情况下,不需要重新建立连接,直接根据websocket对应的通信协议将所述目标信息转化成对应的数据帧格式,并通过TCP(Transmission Control Protocol)通道传输至服务器。对于所述http长轮询通道,所述第一客户端向服务器发送信息传输请求(Ajax请求),服务器接到请求后与所述第一客户端建立连接。根据http对应的通信协议将所述目标信息转化成对应的数据帧格式,并通过http通道传输至服务器。所述服务器在接收到所述http长轮询通道发送的目标信息后关闭与所述第一客户端的连接。对于所述UDP无连接通道,所述第一客户端直接根据UDP对应的通信协议将所述目标信息转化成对应的数据帧格式,并通过UDP通道传输至服务器。It is assumed that the first client establishes a connection with the server through three first information transmission channels with different communication modes: a long-connection websocket channel, an http long-polling channel, and a UDP connectionless channel, and the communication status of each first information transmission channel is normal. Take an example to illustrate. In the case that the long connection websocket channel has established a connection between the server and the first client, there is no need to re-establish the connection, and the target information is directly converted into the corresponding data frame format according to the communication protocol corresponding to the websocket, and It is transmitted to the server through the TCP (Transmission Control Protocol) channel. For the http long polling channel, the first client sends an information transmission request (Ajax request) to the server, and the server establishes a connection with the first client after receiving the request. The target information is converted into the corresponding data frame format according to the communication protocol corresponding to http, and transmitted to the server through the http channel. The server closes the connection with the first client after receiving the target information sent by the http long polling channel. For the UDP connectionless channel, the first client directly converts the target information into a corresponding data frame format according to a communication protocol corresponding to UDP, and transmits the target information to the server through the UDP channel.
进一步地,所述目标信息中还包括对应的标识信息。当所述第一客户端通过各所述第一信息传输通道向所述服务器发送目标信息后,所述服务器根据标识信息对接收的目标信息进行计数。当计数结果大于服务器预设的数量阈值时,即判定所述目标信息发送成功,向所述第一客户端返回一个传输成功提醒。同时,当计数结果不大于服务器预设的数量阈值时,判定所述目标信息发送失败,向所述第一客户端返回一个包括目标信息重新发送控件的传输失败提醒。所述第一客户端通过显示界面显示所述传输失败提醒,以在触发所述目标信息重新发送控件时重新发送所述目标信息。其中,所述数量阈值可以为0。在本发明实施例中,所述传输成功提醒和所述传输失败提醒可以通过各所述第一信息传输通道发送至所述第一客户端,或通过预设的提醒信息传输通道返回至所述第一客户端。可选地,所述第一客户端在发送目标信息后预定时间段内未接收到传输成功提醒,即判断所述目标信息传输失败,通过显示界面显示包括目标信息重新发送控件的传输失败提醒。Further, the target information also includes corresponding identification information. After the first client sends the target information to the server through each of the first information transmission channels, the server counts the received target information according to the identification information. When the count result is greater than the number threshold preset by the server, it is determined that the target information is successfully sent, and a transmission success notification is returned to the first client. At the same time, when the count result is not greater than the number threshold preset by the server, it is determined that the transmission of the target information fails, and a transmission failure reminder including a control for resending the target information is returned to the first client. The first client terminal displays the transmission failure reminder through the display interface, so as to resend the target information when the target information resending control is triggered. Wherein, the quantity threshold may be 0. In this embodiment of the present invention, the transmission success reminder and the transmission failure reminder may be sent to the first client through each of the first information transmission channels, or returned to the first client through a preset reminder information transmission channel. first client. Optionally, the first client does not receive a transmission success reminder within a predetermined time period after sending the target information, that is, judges that the target information transmission fails, and displays a transmission failure reminder including a target information resending control through the display interface.
图3为本发明实施例的第一客户端侧的信息传输过程的示意图。如图3所示,所述第一客户端30可以通过多个第一信息传输通道与服务器31建立通信连接。在进行信息传输的过程中,通过开启的各所述第一信息传输通道同时向所述服务器31发送所述目标信息。FIG. 3 is a schematic diagram of an information transmission process on a first client side according to an embodiment of the present invention. As shown in FIG. 3 , the
可选地,所述服务器31在接收至少一个到所述第一客户端30发送的目标信息后,向所述第一客户端30返回一个传输成功提醒,用于提示所述第一客户端信息发送成功。当所述服务器31未接收到所述第一客户端30发送的目标信息后,向所述第一客户端30返回一个传输失败提醒,用于提示所述第一客户端30重新发送所述目标信息。进一步地,所述传输成功提醒和所述传输失败提醒可以通过各所述第一信息传输通道发送至所述第一客户端30,或通过预设的提醒信息传输通道返回至所述第一客户端30。Optionally, after receiving at least one target information sent to the
本发明实施例所述的信息传输方法在发送目标信息时,可以通过多个通信方式不同的信息传输通道进行信息传输,避免在信息传输过程中因掉线、丢包、卡顿、延时等问题导致信息传输失败,保证信息传输过程的可靠性。When sending target information, the information transmission method described in the embodiment of the present invention can transmit information through multiple information transmission channels with different communication modes, so as to avoid disconnection, packet loss, freeze, delay, etc. during the information transmission process. The problem causes the information transmission to fail, ensuring the reliability of the information transmission process.
图4为本发明实施例的服务器侧的信息传输方法的流程图。如图4所示,所述服务器侧的信息传输方法包括以下步骤:FIG. 4 is a flowchart of an information transmission method on a server side according to an embodiment of the present invention. As shown in Figure 4, the information transmission method on the server side includes the following steps:
步骤S400、通过多个第一信息传输通道与第一客户端建立通信连接。Step S400: Establish a communication connection with the first client through multiple first information transmission channels.
具体地,服务器通过多个第一信息传输通道与第一客户端建立通信连接,以与所述第一客户端进行信息传输。其中,各所述第一信息传输通道对应不同的通信方式。所述通信方式包括通信协议和通信规则,即各所述第一信息传输通道对应的通信协议或通信规则不同。可选地,还可以预先设定各所述第一信息传输通道的信息传输优先级,按顺序进行信息传输。在优先级较高的第一信息传输通道信息传输失败时,通过下一个第一信息传输通道传输所述目标信息。所述第一客户端在与服务器进行信息传输前,先确定各所述第一信息传输通道的当前通信状态是否正常。在本发明实施例中,所述当前通信状态可以通过第一客户端检测各所述第一信息传输通道是否开启确定,开启则判断结果为正常,关闭则判断结果为不可用。Specifically, the server establishes a communication connection with the first client through a plurality of first information transmission channels, so as to perform information transmission with the first client. Wherein, each of the first information transmission channels corresponds to different communication modes. The communication modes include communication protocols and communication rules, that is, the communication protocols or communication rules corresponding to each of the first information transmission channels are different. Optionally, information transmission priorities of each of the first information transmission channels may also be preset, and information transmission is performed in sequence. When the information transmission of the first information transmission channel with a higher priority fails, the target information is transmitted through the next first information transmission channel. Before performing information transmission with the server, the first client first determines whether the current communication state of each of the first information transmission channels is normal. In the embodiment of the present invention, the current communication state can be determined by detecting whether each of the first information transmission channels is open by the first client, and the judgment result is normal when the first information transmission channel is opened, and the judgment result is unavailable when it is closed.
例如,所述第一客户端可以通过长连接websocket通道、http长轮询通道、UDP无连接通道三种通信方式不同的第一信息传输通道与服务器建立连接。在发送目标信息前,所述第一客户端先判断各所述第一信息传输通道是否开启,直接判断开启的第一信息传输通道通信状态正常。For example, the first client can establish a connection with the server through three first information transmission channels with different communication modes, a long-connection websocket channel, an http long-polling channel, and a UDP connectionless channel. Before sending the target information, the first client first determines whether each of the first information transmission channels is open, and directly determines that the communication status of the opened first information transmission channels is normal.
步骤S500、响应于接收到第一客户端通过至少一个第一信息传输通道发送的目标信息,存储各所述第一信息传输通道发送的目标信息。Step S500: In response to receiving the target information sent by the first client through at least one first information transmission channel, store the target information sent by each of the first information transmission channels.
具体地,当服务器接收到所述第一客户端通过至少一个第一信息传输通道发送的目标信息时,存储接收到的目标信息。其中,各所述目标信息的存储格式为所述服务器接收到的格式,即传输其的第一信息传输通道对应的通信协议规定的格式。例如,当所述服务器分别通过长连接websocket通道、http长轮询通道、UDP无连接通道三种第一信息传输通道接收到目标信息时,分别存储格式为websocket对应的通信协议中规定的数据帧格式的目标信息、格式为http对应的通信协议中规定的数据帧格式的目标信息以及格式为UDP对应的通信协议中规定的数据帧格式的目标信息。Specifically, when the server receives the target information sent by the first client through at least one first information transmission channel, the server stores the received target information. The storage format of each of the target information is the format received by the server, that is, the format specified by the communication protocol corresponding to the first information transmission channel that transmits the target information. For example, when the server receives the target information through the three first information transmission channels of the long-connection websocket channel, the http long-polling channel, and the UDP connectionless channel, respectively, the storage format is the data frame specified in the communication protocol corresponding to the websocket. The target information in the format, the target information in the data frame format specified in the communication protocol corresponding to http, and the target information in the data frame format specified in the communication protocol corresponding to UDP.
进一步地,所述目标信息中还包括对应的标识信息,服务器根据所述标识信息判断接收到相同目标信息,以对接收到的相同目标信息进行计数。当计数结果达到预设的数量阈值时,所述服务器判定第一客户端的目标信息发送成功,向所述第一客户端返回一个传输成功提醒。同时,当计数结果不大于服务器预设的数量阈值时,所述服务器判定第一客户端的目标信息发送失败,向所述第一客户端返回一个包括目标信息重新发送控件的传输失败提醒。所述第一客户端通过显示界面显示所述传输失败提醒,以在触发所述目标信息重新发送控件时重新发送所述目标信息。在本发明实施例中,所述传输成功提醒和所述传输失败提醒可以通过各所述第一信息传输通道发送至所述第一客户端,或通过预设的提醒信息传输通道返回至所述第一客户端。Further, the target information also includes corresponding identification information, and the server judges that the same target information is received according to the identification information, so as to count the received same target information. When the counting result reaches a preset number threshold, the server determines that the target information of the first client is successfully sent, and returns a transmission success notification to the first client. At the same time, when the count result is not greater than the number threshold preset by the server, the server determines that the transmission of the target information of the first client fails, and returns to the first client a transmission failure reminder including a control for resending the target information. The first client terminal displays the transmission failure reminder through the display interface, so as to resend the target information when the target information resending control is triggered. In this embodiment of the present invention, the transmission success reminder and the transmission failure reminder may be sent to the first client through each of the first information transmission channels, or returned to the first client through a preset reminder information transmission channel. first client.
以所述服务器预设的数量阈值为0,且通过三个第一信息传输通道与第一客户端连接为例进行说明。在所述第一客户端发送目标信息后。所述服务器对根据标识信息对所述目标信息进行计数,当计数结果为0时判定未成功接收到目标信息,即所述第一客户端信息发送失败。通过设的提醒信息传输通道向所述第一客户端发送传输失败提醒,以提醒所述第一客户端重新发送目标信息。当计数结果为1、2、3中任意一个时,判定成功接收到目标信息,即所述第一客户端信息发送成功。通过设的提醒信息传输通道或各所述第一信息传输通道向所述第一客户端发送传输成功提醒,以提醒所述第一客户端完成了目标信息的传输。The description is given by taking the preset number threshold of the server as 0 and connecting with the first client through three first information transmission channels as an example. After the first client sends the target information. The server counts the target information according to the identification information, and when the count result is 0, it is determined that the target information has not been successfully received, that is, the sending of the first client information fails. A transmission failure reminder is sent to the first client through the set reminder information transmission channel, so as to remind the first client to resend the target information. When the count result is any one of 1, 2, and 3, it is determined that the target information is successfully received, that is, the first client information is successfully sent. Send a successful transmission reminder to the first client through the set reminder information transmission channel or each of the first information transmission channels, so as to remind the first client that the transmission of the target information is completed.
步骤S600、通过多个第二信息传输通道与第二客户端建立通信连接。Step S600: Establish a communication connection with the second client through multiple second information transmission channels.
具体地,所述第二客户端为目标信息的接收终端,通过多个第二信息传输通道与服务器连接,用于接收服务器存储的目标信息。其中,各所述第二信息传输通道对应不同的通信方式。所述通信方式包括通信协议和通信规则,即各所述第二信息传输通道对应的通信协议或通信规则不同。可选地,还可以预先设定各所述第二信息传输通道的信息传输优先级,按顺序进行信息传输。在信息传输过程中,当优先级较高的第二信息传输通道信息传输失败时,通过下一个第二信息传输通道传输所述目标信息。Specifically, the second client is a receiving terminal of the target information, and is connected to the server through a plurality of second information transmission channels, and is used for receiving the target information stored by the server. Wherein, each of the second information transmission channels corresponds to different communication modes. The communication mode includes a communication protocol and a communication rule, that is, the communication protocols or communication rules corresponding to each of the second information transmission channels are different. Optionally, information transmission priorities of each of the second information transmission channels may also be preset, and information transmission is performed in sequence. During the information transmission process, when the information transmission of the second information transmission channel with a higher priority fails, the target information is transmitted through the next second information transmission channel.
进一步地,所述第二客户端在接收服务器传输的目标信息前,先确定各所述第二信息传输通道的当前通信状态是否正常,以监听同学状态正常的第二信息传输通道。在本发明实施例中,所述当前通信状态可以通过第二客户端检测各所述第二信息传输通道是否开启确定,开启则判断结果为正常,关闭则判断结果为不可用。Further, before receiving the target information transmitted by the server, the second client first determines whether the current communication state of each of the second information transmission channels is normal, so as to monitor the second information transmission channels whose students are in normal state. In this embodiment of the present invention, the current communication state can be determined by detecting whether each of the second information transmission channels is open by the second client, and if the channel is open, the result of the determination is normal, and if it is closed, the result of the determination is unavailable.
步骤S700、响应于所述第二客户端状态为在线,通过与各目标信息对应的第一信息传输通道通信机制相同的第二信息传输通道向第二客户端发送所述目标信息。Step S700: In response to the state of the second client being online, send the target information to the second client through a second information transmission channel with the same communication mechanism as the first information transmission channel corresponding to each target information.
具体地,所述服务器在向第二客户端传输目标信息之前,还对所述第二客户端的状态进行判定。当所述第二客户端状态为在线时,根据存储的各目标信息对应的数据格式确定对应的第二信息传输通道,以通过对应的第二信息传输通道向所述第二客户端发送目标信息。即通过与各目标信息对应的第一信息传输通道通信机制相同的第二信息传输通道向第二客户端发送所述目标信息。Specifically, before transmitting the target information to the second client, the server further determines the state of the second client. When the state of the second client is online, a corresponding second information transmission channel is determined according to the data format corresponding to each stored target information, so as to send the target information to the second client through the corresponding second information transmission channel . That is, the target information is sent to the second client through a second information transmission channel with the same communication mechanism as the first information transmission channel corresponding to each target information.
以所述服务器中存储的标识信息相同的目标信息格式分别为websocket对应的通信协议中规定的数据帧格式、http对应的通信协议中规定的数据帧格式,以及UDP对应的通信协议中规定的数据帧格式为例进行说明。当所述服务器和第二客户端之间建立连接的第二信息传输通道分别为过长连接websocket通道、http长轮询通道、UDP无连接通道时,通过所述长连接websocket通道向第二客户端发送格式为websocket对应的通信协议中规定数据帧格式的目标信息,通过所述http长轮询通道向第二客户端发送格式为http对应的通信协议中规定数据帧格式的目标信息,通过所述UDP无连接通道向第二客户端发送格式为UDP对应的通信协议中规定数据帧格式的目标信息。The target information format with the same identification information stored in the server is the data frame format specified in the communication protocol corresponding to websocket, the data frame format specified in the communication protocol corresponding to http, and the data specified in the communication protocol corresponding to UDP. The frame format is described as an example. When the second information transmission channel through which the connection is established between the server and the second client is a long-connected websocket channel, an http long-polling channel, and a UDP connectionless channel, respectively, the second information transmission channel is sent to the second client through the long-connected websocket channel. The client sends the target information in the data frame format specified in the communication protocol corresponding to websocket, and sends the target information in the data frame format specified in the communication protocol corresponding to http to the second client through the http long polling channel. The UDP connectionless channel sends the target information in the format of the data frame specified in the communication protocol corresponding to UDP to the second client.
图5为本发明实施例的服务器侧的信息传输过程的示意图。如图5所示,所述服务器50可以通过多个第一信息传输通道与第一客户端51建立通信连接,同时通过多个第二信息传输通道与第二客户端52建立通信连接。在进行信息传输的过程中,所述第一客户端51通过开启的各所述第一信息传输通道同时向所述服务器50发送目标信息,所述服务器50再将接收到的目标信息通过第二客户端52开启的各所述第二信息传输通道同时向所述第二客户端52传输。FIG. 5 is a schematic diagram of an information transmission process on the server side according to an embodiment of the present invention. As shown in FIG. 5 , the
可选地,所述服务器50在接收至少一个到所述第一客户端51发送的目标信息后,存储所述目标信息并向所述第一客户端51返回一个传输成功提醒,用于提示所述第一客户端信息发送成功。当所述服务器50未接收到所述第一客户端51发送的目标信息后,向所述第一客户端51返回一个传输失败提醒,用于提示所述第一客户端51重新发送所述目标信息。进一步地,所述传输成功提醒和所述传输失败提醒可以通过各所述第一信息传输通道发送至所述第一客户端51,或通过预设的提醒信息传输通道返回至所述第一客户端51。所述服务器50在接收到至少一个第一信息传输通道传输的目标信息后,根据传输所述目标信息的第一信息传输通道对应的通信方式确定对应的第二信息传输通道。以通过各所述第二信息传输通道将对应的目标信息传输至第二客户端52。Optionally, after receiving at least one target information sent to the
本发明实施例所述的信息传输方法中第一客户端发送目标信息以及第二客户端接收目标信息的过程均通过多个通信方式不同的信息传输通道进行信息传输,避免在信息传输过程中因某一个信息传输通道发生掉线、丢包、卡顿、延时等问题导致信息传输失败,保证了信息传输过程的可靠性。In the information transmission method described in the embodiment of the present invention, the process of sending the target information by the first client and receiving the target information by the second client is carried out through a plurality of information transmission channels with different communication modes, so as to avoid the information transmission process due to Problems such as disconnection, packet loss, freezing, and delay of a certain information transmission channel lead to information transmission failure, which ensures the reliability of the information transmission process.
图6为本发明实施例第二客户端侧的信息传输方法的流程图。如图6所示,所述第二客户端侧的信息传输方法包括以下步骤:FIG. 6 is a flowchart of a second client-side information transmission method according to an embodiment of the present invention. As shown in FIG. 6 , the information transmission method on the second client side includes the following steps:
步骤S800、确定多个第二信息传输通道的当前通信状态。Step S800: Determine the current communication status of the multiple second information transmission channels.
具体地,所述第二客户端通过多个第二信息传输通道与服务器建立通信连接,各所述第二信息传输通道对应不同的通信方式。所述通信方式包括通信协议和通信规则,即各所述第二信息传输通道对应的通信协议或通信规则不同。所述第二客户端在接收目标信息前,需要先确定各所述第二信息传输通道的当前通信状态是否正常,以监听通信状态正常的第二信息传输通道,获取对应的目标信息。在本发明实施例中,所述第二客户端可以通过检测各所述第二信息传输通道是否开启判断当前通信状态。可选地,所述第二客户端在检测第二信息传输通道开启后,根据各所述第二信息通道的特性,还可以进一步通过与服务器之间进行三次握手等方式判断开启的第二信息传输通道当前的通信状态是否正常。例如,当所述第二信息传输通道为websocket通道或UDP无连接通道时,可以通过心跳机制判断对应第二信息传输通道的通信状态。即第二客户端向服务器发送预设次数的心跳信号后均未接收到反馈信号时,判断所述第二信息传输通道通信故障。Specifically, the second client establishes a communication connection with the server through a plurality of second information transmission channels, and each of the second information transmission channels corresponds to a different communication manner. The communication mode includes a communication protocol and a communication rule, that is, the communication protocols or communication rules corresponding to each of the second information transmission channels are different. Before receiving the target information, the second client needs to determine whether the current communication state of each of the second information transmission channels is normal, so as to monitor the second information transmission channel whose communication state is normal, and obtain corresponding target information. In this embodiment of the present invention, the second client can determine the current communication state by detecting whether each of the second information transmission channels is open. Optionally, after detecting that the second information transmission channel is opened, the second client may further determine the opened second information by performing a three-way handshake with the server according to the characteristics of each second information channel. Whether the current communication status of the transmission channel is normal. For example, when the second information transmission channel is a websocket channel or a UDP connectionless channel, the communication state corresponding to the second information transmission channel may be determined through a heartbeat mechanism. That is, when the second client does not receive a feedback signal after sending a preset number of heartbeat signals to the server, it is determined that the communication of the second information transmission channel is faulty.
在本发明实施例中,还可以预先设定各所述第二信息传输通道的信息传输优先级,按顺序进行信息传输。在信息传输过程中,当优先级较高的第二信息传输通道信息传输失败时,通过下一个第二信息传输通道传输所述目标信息。In this embodiment of the present invention, information transmission priorities of each of the second information transmission channels may also be preset, and information transmission is performed in sequence. During the information transmission process, when the information transmission of the second information transmission channel with a higher priority fails, the target information is transmitted through the next second information transmission channel.
例如,所述第二客户端可以通过长连接websocket通道、http长轮询通道、UDP无连接通道三种通信方式不同的第二信息传输通道与服务器建立连接。在接收目标信息前,所述第二客户端先判断各所述第二信息传输通道是否开启,直接判断开启的第二信息传输通道通信状态正常。For example, the second client can establish a connection with the server through a long-connection websocket channel, an http long-polling channel, and a UDP connectionless channel, three different second information transmission channels with different communication modes. Before receiving the target information, the second client first determines whether each of the second information transmission channels is open, and directly determines that the communication status of the opened second information transmission channels is normal.
步骤S900、响应于存在至少一个通信状态正常的第二信息传输通道,通过所述第二信息传输通道接收目标信息。Step S900, in response to the existence of at least one second information transmission channel with a normal communication state, receive target information through the second information transmission channel.
具体地,所述第二客户端确定存在至少一个通信状态正常的第二信息传输通道时,监听各所述通信状态正常的第二信息传输通道。服务器通过各所述第二信息传输通道向所述第二客户端传输存储的目标信息,其中,各所述第二信息传输通道传输的目标信息格式为对应通信协议中规定的数据帧格式。在本发明实施例中,所述目标信息由第一客户端通过多个第一信息传输通道发送至服务器。Specifically, when the second client determines that there is at least one second information transmission channel in a normal communication state, it monitors each of the second information transmission channels in a normal communication state. The server transmits the stored target information to the second client through each of the second information transmission channels, wherein the format of the target information transmitted by each of the second information transmission channels is the data frame format specified in the corresponding communication protocol. In this embodiment of the present invention, the target information is sent by the first client to the server through multiple first information transmission channels.
由于所述服务器通常需要在第二客户端在线的情况下发送目标信息,为保证所述目标信息的及时发送,所述服务器在第二客户端在线的情况下直接通过各所述第二信息传输通道向所述第二客户端发送目标信息。在本发明实施例的一个可选地实现方式中,服务器有待向第二客户端发送的信息且所述第二客户端不在线的情况下,所述第二客户端重新连接后可以根据不同通道的特性重新获取目标信息。例如,对于http通道,所述第二客户端可以不间断地通过所述第二信息传输通道在服务器端主动拉取目标信息,以防止由于掉线等情况导致的目标信息丢失。所述主动拉取目标信息的过程可以为通过各所述第二信息传输通道向服务器发送信息拉取请求,所述服务器基于所述信息拉取请求返回目标信息。在本发明实施例的另一个可选地实现方式中,可以基于心跳机制定时由所述第二信息传输通道将服务器中存储的目标信息同步到第二客户端。Since the server usually needs to send the target information when the second client is online, in order to ensure the timely sending of the target information, the server directly transmits the second information when the second client is online. The channel sends target information to the second client. In an optional implementation manner of this embodiment of the present invention, when the server has information to be sent to the second client and the second client is not online, after the second client is reconnected, the feature to retrieve target information. For example, for the http channel, the second client can actively pull the target information on the server side through the second information transmission channel without interruption, so as to prevent the target information from being lost due to disconnection or the like. The process of actively pulling the target information may be sending an information pulling request to the server through each of the second information transmission channels, and the server returns the target information based on the information pulling request. In another optional implementation manner of the embodiment of the present invention, the target information stored in the server may be synchronized to the second client through the second information transmission channel at regular intervals based on a heartbeat mechanism.
步骤S1000、对接收到的目标消息进行去重操作以确定接收消息。Step S1000: Perform a deduplication operation on the received target message to determine the received message.
具体地,由于所述第二客户端通过各所述第二信息传输通道可以接收到多个内容相同的目标信息,需要进一步对接收到的目标信息进行去重操作,确定一个目标信息为接收消息。在本发明实施例中,所述第二客户端可以根据目标信息中的信息标识确定接收到的各目标信息是否为相同的信息,在确定接收到内容相同的多个目标信息后,根据预设的优先级顺序对各所述目标信息进行排序,以确定优先级最高的目标信息为接收消息。例如,所述第二客户端可以根据接收到目标信息的时间对内容相同的各所述目标信息进行排序,选择最早接收到的目标信息为接收消息。Specifically, since the second client can receive multiple target information with the same content through each of the second information transmission channels, it is necessary to further perform a deduplication operation on the received target information, and determine one target information as a received message . In the embodiment of the present invention, the second client may determine whether the received target information is the same information according to the information identifier in the target information, and after determining that multiple target information with the same content is received, according to a preset The priority order of each of the target information is sorted to determine the target information with the highest priority as the received message. For example, the second client may sort the target information with the same content according to the time when the target information is received, and select the target information received earliest as the received message.
可选地,所述第二客户端在确定了接收消息后,通过显示界面显示所述接收消息。Optionally, after determining the received message, the second client displays the received message through a display interface.
图7为本发明实施例的第二客户端侧的信息传输过程的示意图。如图7所示,所述第二客户端70可以通过多个第二信息传输通道与服务器71建立通信连接。在进行信息传输的过程中,通过开启的各所述第二信息传输通道监听所述服务器71发送的目标信息。FIG. 7 is a schematic diagram of an information transmission process on a second client side according to an embodiment of the present invention. As shown in FIG. 7 , the
可选地,所述第二客户端70在确定与所述服务器71连接的至少一个第二信息传输通道开启后,监听开启的第二信息传输通道以获取所述服务器71发送的目标信息。所述第二客户端70在接收到所述服务器71通过各所述第二信息传输通道发送的至少一个目标信息后,对内容相同的目标信息进行去重操作以确定接收消息。进一步地还可以通过显示界面显示所述接收消息。Optionally, after determining that at least one second information transmission channel connected to the
本发明实施例所述的信息传输方法在第二客户端接收目标信息时,可以通过多个通信方式不同的信息传输通道进行信息传输,避免了在信息传输过程中因掉线、丢包、卡顿、延时等问题导致信息传输失败,保证信息传输过程的可靠性。同时在接收到多个相同目标信息时进行去重,防止接收到重复的冗余消息。When the second client receives the target information, the information transmission method according to the embodiment of the present invention can transmit information through multiple information transmission channels with different communication modes, so as to avoid disconnection, packet loss, and card loss during the information transmission process. Problems such as delay and delay lead to the failure of information transmission, which ensures the reliability of the information transmission process. At the same time, deduplication is performed when multiple identical target information is received to prevent repeated redundant messages from being received.
图8为本发明实施例的信息传输方法的信令流程图。如图8所示,所述信息传输方法中,以服务器81为中介进行第一客户端80和第二客户端82之间的信息传输。FIG. 8 is a signaling flowchart of an information transmission method according to an embodiment of the present invention. As shown in FIG. 8 , in the information transmission method, the information transmission between the
具体地,所述第一客户端80通过多个第一信息传输通道向所述服务器81发送目标信息83,所述服务器81通过各所述第一信息传输通道接收对应的目标信息后计数并存储84。在所述目标信息数量大于预设数量阈值时,所述服务器81向所述第一客户端80发送传输成功提醒85。同时,所述服务器81还通过多个第二信息传输通道向第二客户端82发送目标信息86。所述第二客户端82对接收到的多个目标信息进行去重87,以确定接收消息。Specifically, the
可选地,所述服务器81可以连接多个第一客户端80和多个第二客户端82,以满足由一个第一客户端向一个第二客户端传输信息、由一个第一客户端向多个第二客户端传输信息、由多个第一客户端向一个第二客户端传输信息以及多个第一客户端向多个第二客户端传输信息等多种信息传输的应用场景。Optionally, the
本发明实施例所述的信息传输方法中第一客户端发送目标信息以及第二客户端接收目标信息的过程均通过多个通信方式不同的信息传输通道进行信息传输,避免在信息传输过程中因某一个信息传输通道发生掉线、丢包、卡顿、延时等问题导致信息传输失败,保证了信息传输过程的可靠性。同时第二客户端在接收到多个相同目标信息时进行去重,避免接收到重复的冗余消息。In the information transmission method described in the embodiment of the present invention, the process of sending the target information by the first client and receiving the target information by the second client is carried out through a plurality of information transmission channels with different communication modes, so as to avoid the information transmission process due to Problems such as disconnection, packet loss, freezing, and delay of a certain information transmission channel lead to information transmission failure, which ensures the reliability of the information transmission process. At the same time, the second client performs deduplication when receiving multiple identical target information, so as to avoid receiving repeated redundant messages.
图9为本发明实施例的电子设备的示意图。如图9所示,图9所示的电子设备为通用地址查询装置,其包括通用的计算机硬件结构,其至少包括处理器90和存储器91。处理器90和存储器91通过总线92连接。存储器91适于存储处理器90可执行的指令或程序。处理器90可以是独立的微处理器,也可以是一个或者多个微处理器集合。由此,处理器90通过执行存储器91所存储的指令,从而执行如上所述的本发明实施例的方法流程实现对于数据的处理和对于其它装置的控制。总线92将上述多个组件连接在一起,同时将上述组件连接到显示控制器93和显示装置以及输入/输出(I/O)装置94。输入/输出(I/O)装置94可以是鼠标、键盘、调制解调器、网络接口、触控输入装置、体感输入装置、打印机以及本领域公知的其他装置。典型地,输入/输出装置94通过输入/输出(I/O)控制器95与系统相连。FIG. 9 is a schematic diagram of an electronic device according to an embodiment of the present invention. As shown in FIG. 9 , the electronic device shown in FIG. 9 is a general address query apparatus, which includes a general computer hardware structure, which at least includes a
本领域的技术人员应明白,本申请的实施例可提供为方法、装置(设备)或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可读存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品。It should be understood by those skilled in the art that the embodiments of the present application may be provided as a method, an apparatus (apparatus) or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may employ a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、装置(设备)和计算机程序产品的流程图来描述的。应理解可由计算机程序指令实现流程图中的每一流程。The present application is described with reference to flowchart illustrations of methods, apparatus (apparatus) and computer program products according to embodiments of the present application. It will be understood that each process in the flowchart can be implemented by computer program instructions.
这些计算机程序指令可以存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现流程图一个流程或多个流程中指定的功能。These computer program instructions may be stored in a computer readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the instruction means Implements the function specified in a flow chart or flows.
也可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程中指定的功能的装置。These computer program instructions may also be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flows of a flowchart.
本发明的另一实施例涉及一种非易失性存储介质,用于存储计算机可读程序,所述计算机可读程序用于供计算机执行上述部分或全部的方法实施例。Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, the computer-readable program being used for a computer to execute some or all of the above method embodiments.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指定相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method of implementing the above embodiments can be completed by specifying relevant hardware through a program, and the program is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: U disk, removable hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.
以上所述仅为本发明的优选实施例,并不用于限制本发明,对于本领域技术人员而言,本发明可以有各种改动和变化。凡在本发明的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010752239.XA CN111970340B (en) | 2020-07-30 | 2020-07-30 | Information transmission method, readable storage medium, and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010752239.XA CN111970340B (en) | 2020-07-30 | 2020-07-30 | Information transmission method, readable storage medium, and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111970340A true CN111970340A (en) | 2020-11-20 |
CN111970340B CN111970340B (en) | 2023-06-16 |
Family
ID=73364079
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010752239.XA Active CN111970340B (en) | 2020-07-30 | 2020-07-30 | Information transmission method, readable storage medium, and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111970340B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112565421A (en) * | 2020-12-03 | 2021-03-26 | 创盛视联数码科技(北京)有限公司 | Information transmission method, system, electronic device and storage medium |
CN116112758A (en) * | 2021-11-11 | 2023-05-12 | 杭州海康威视数字技术股份有限公司 | Interactive video network transmission method, system, recording and playing host and storage medium |
Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120290664A1 (en) * | 2011-05-11 | 2012-11-15 | Tikl, Inc. | Cross-media, cross-channel, cross-protocol, and cross-network capable autoreply within a single application |
US20130201818A1 (en) * | 2010-08-04 | 2013-08-08 | Cassidian Sas | Method for managing a degraded mode of a cell in a radiocommunication network |
US20130332522A1 (en) * | 2012-06-08 | 2013-12-12 | Microsoft Corporation | Fast channel for system management |
CN106027599A (en) * | 2016-04-29 | 2016-10-12 | 掌赢信息科技(上海)有限公司 | Data transmission channel establishing method and system, and server |
CN106357364A (en) * | 2015-07-15 | 2017-01-25 | 腾讯科技(深圳)有限公司 | Data transmission method, device and system |
CN106851600A (en) * | 2017-01-12 | 2017-06-13 | 和创(北京)科技股份有限公司 | Short message distribution method and the server for carrying out short message distribution |
US20180262587A1 (en) * | 2017-03-13 | 2018-09-13 | Microsoft Technology Licensing, Llc. | On-demand push notification mechanism |
CN109936390A (en) * | 2018-12-29 | 2019-06-25 | 京信通信技术(广州)有限公司 | The management system and method for antenna active module |
CN109951260A (en) * | 2018-02-12 | 2019-06-28 | 华为技术有限公司 | A kind of data packet sending method and related equipment |
CN109962953A (en) * | 2017-12-25 | 2019-07-02 | 深圳市优必选科技有限公司 | Client communication establishment method and device |
CN110022369A (en) * | 2019-04-11 | 2019-07-16 | 上海拉扎斯信息科技有限公司 | Message treatment method, device, electronic equipment and computer readable storage medium |
CN110289991A (en) * | 2019-05-31 | 2019-09-27 | 北京大米科技有限公司 | A faulty gateway detection method, device, storage medium and terminal |
CN110300115A (en) * | 2019-07-05 | 2019-10-01 | 腾讯科技(深圳)有限公司 | A kind of data transmission method and relevant apparatus based on multichannel |
CN110365643A (en) * | 2019-06-04 | 2019-10-22 | 菜鸟智能物流控股有限公司 | Communication method and device |
CN110855792A (en) * | 2019-11-19 | 2020-02-28 | 南京领行科技股份有限公司 | Message pushing method, device, equipment and medium |
CN111314433A (en) * | 2020-01-20 | 2020-06-19 | 北京字节跳动网络技术有限公司 | Message transmission method and device and electronic equipment |
-
2020
- 2020-07-30 CN CN202010752239.XA patent/CN111970340B/en active Active
Patent Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130201818A1 (en) * | 2010-08-04 | 2013-08-08 | Cassidian Sas | Method for managing a degraded mode of a cell in a radiocommunication network |
US20120290664A1 (en) * | 2011-05-11 | 2012-11-15 | Tikl, Inc. | Cross-media, cross-channel, cross-protocol, and cross-network capable autoreply within a single application |
US20130332522A1 (en) * | 2012-06-08 | 2013-12-12 | Microsoft Corporation | Fast channel for system management |
CN106357364A (en) * | 2015-07-15 | 2017-01-25 | 腾讯科技(深圳)有限公司 | Data transmission method, device and system |
CN106027599A (en) * | 2016-04-29 | 2016-10-12 | 掌赢信息科技(上海)有限公司 | Data transmission channel establishing method and system, and server |
CN106851600A (en) * | 2017-01-12 | 2017-06-13 | 和创(北京)科技股份有限公司 | Short message distribution method and the server for carrying out short message distribution |
US20180262587A1 (en) * | 2017-03-13 | 2018-09-13 | Microsoft Technology Licensing, Llc. | On-demand push notification mechanism |
CN109962953A (en) * | 2017-12-25 | 2019-07-02 | 深圳市优必选科技有限公司 | Client communication establishment method and device |
CN109951260A (en) * | 2018-02-12 | 2019-06-28 | 华为技术有限公司 | A kind of data packet sending method and related equipment |
CN109936390A (en) * | 2018-12-29 | 2019-06-25 | 京信通信技术(广州)有限公司 | The management system and method for antenna active module |
CN110022369A (en) * | 2019-04-11 | 2019-07-16 | 上海拉扎斯信息科技有限公司 | Message treatment method, device, electronic equipment and computer readable storage medium |
CN110289991A (en) * | 2019-05-31 | 2019-09-27 | 北京大米科技有限公司 | A faulty gateway detection method, device, storage medium and terminal |
CN110365643A (en) * | 2019-06-04 | 2019-10-22 | 菜鸟智能物流控股有限公司 | Communication method and device |
CN110300115A (en) * | 2019-07-05 | 2019-10-01 | 腾讯科技(深圳)有限公司 | A kind of data transmission method and relevant apparatus based on multichannel |
CN110855792A (en) * | 2019-11-19 | 2020-02-28 | 南京领行科技股份有限公司 | Message pushing method, device, equipment and medium |
CN111314433A (en) * | 2020-01-20 | 2020-06-19 | 北京字节跳动网络技术有限公司 | Message transmission method and device and electronic equipment |
Non-Patent Citations (1)
Title |
---|
郭得科等: "数据中心内Incast流量的网内聚合研究", 计算机研究与发展 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112565421A (en) * | 2020-12-03 | 2021-03-26 | 创盛视联数码科技(北京)有限公司 | Information transmission method, system, electronic device and storage medium |
CN116112758A (en) * | 2021-11-11 | 2023-05-12 | 杭州海康威视数字技术股份有限公司 | Interactive video network transmission method, system, recording and playing host and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111970340B (en) | 2023-06-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112738548B (en) | Streaming media scheduling method, device, equipment and storage medium | |
US9609031B1 (en) | Propagating state information to network nodes | |
JP2014523568A (en) | Efficient conditioning | |
WO2021237433A1 (en) | Message pushing method and apparatus, and electronic device and computer-readable medium | |
US10021182B2 (en) | Method and apparatus for data synchronization | |
EP2528397A1 (en) | Method and apparatus for synchronization based on hypertext transfer protocol (http) | |
CN102932352A (en) | Method and server for communicating with client | |
CN111970340B (en) | Information transmission method, readable storage medium, and electronic device | |
US11283725B2 (en) | Event content delivery | |
CN111787345A (en) | Interactive resource processing method and device based on network live broadcast room, server and storage medium | |
US8161113B2 (en) | Rich signaling feedback mechanism for group communication | |
EP2634995A1 (en) | Apparatus and method of displaying contents using key frames in a terminal | |
JP2017163272A (en) | Packet analysis program, packet analysis method, and packet analysis device | |
CN116032998B (en) | Data transmission method, data transmission device, computer readable storage medium and electronic equipment | |
CN118301171B (en) | Multi-terminal synchronous interaction method, interaction device and interaction equipment | |
JP2009110041A (en) | Web screen sharing system, its terminal for sharing, and its sharing program | |
EP3806403B1 (en) | Apparatus and method for managing message transmission delay | |
CN112202616B (en) | Fault processing method, readable storage medium and electronic device | |
CN111600808A (en) | Information processing method and device for instant messaging | |
CN107733979B (en) | Data push method, server and system | |
CN107800754A (en) | Data transfer task processing, data transfer task monitoring method and device | |
CN116308671A (en) | Online bidding method based on MQTT protocol, electronic equipment and storage medium | |
CN113301398B (en) | Information processing method and system, server device and client device | |
CN107979876A (en) | Data transmission method and terminal | |
CN115776527B (en) | Message sending method, device, 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250211 Address after: No. 902, 9th Floor, Unit 2, Building 1, No. 333 Jiqing 3rd Road, Chengdu High tech Zone, Chengdu Free Trade Zone, Sichuan Province 610000 Patentee after: Chengdu Yudi Technology Co.,Ltd. Country or region after: China Address before: 2223, 2nd floor, building 23, 18 anningzhuang East Road, Qinghe, Haidian District, Beijing, 100142 Patentee before: BEIJING DA MI TECHNOLOGY Co.,Ltd. Country or region before: China |