实时聊天应用程序如何工作_culing2941的博客-程序员宅基地

技术标签: python  java  人工智能  数据库  大数据  

For a long time, exchanging information between two people in different locations has always been central to support relationships in social and business environments. Exchange of information between parties is itself a business on its kind, and the faster the speed to relay information, the higher the efficiency of that communication method. Methods of communication have grown rapidly supported by the extensive development of technology and the spread of the internet.

长期以来,在不同位置的两个人之间交换信息一直是支持社交和商业环境中关系的中心。 各方之间的信息交换本身就是同类事务,并且中继信息的速度越快,该通信方法的效率就越高。 随着技术的广泛发展和互联网的普及,通信方法得到了Swift的发展。

The most significant feature of the chat application is their ability to relay information immediately the information is sent. The data to be transmitted can be as complex as a video or an image or a simple as a 2 letter word. Modern versions of many chat applications can support voice and video calls, text messages, emotion icons, among other types of messages.

聊天应用程序最重要的功能是他们能够立即发送信息来中继信息。 要传输的数据可以像视频或图像一样复杂,也可以像2个字母的单词一样简单。 许多聊天应用程序的现代版本可以支持语音和视频通话,文本消息,情感图标以及其他类型的消息。

This is an article giving a brief explanation of how real time chat API work to relay information between users.

本文简要介绍了实时聊天API如何在用户之间中继信息。

How a Real-Time Chat Application Works

We begin by understanding the major components that support the operations of a chat application.

我们首先了解支持聊天应用程序操作的主要组件。

Main Components That Support the Functioning of a Chat Application

支持聊天应用程序功能的主要组件

There are three main three operating components required for a chat application to function as intended; they include:

聊天应用程序按预期运行需要三个主要的三个操作组件: 它们包括:

  • The Messaging Application

    消息传递应用程序

  • A Dedicated Application Server

    专用应用服务器

  • A Stable, Internet-based Connection

    稳定的基于Internet的连接

消息传递应用程序 (The Messaging Application)

This is the part of the chat system that is accessed by the user of the application from a mobile phone or a personal computer. The messaging application marks the start of the user interface and is usually designed with features to allow the user to type, edit, and send a message.

这是聊天系统的一部分,应用程序的用户可以从移动电话或个人计算机访问该聊天系统。 消息传递应用程序标记了用户界面的开始,通常设计为具有允许用户键入,编辑和发送消息的功能。

To support interaction, the messaging application should offer a text box for the user to compose a text message. The text box typically has a “Send” or “Enter” buttons to initiate the sending of the written message. The user should compose other types of messages using emotion icons and stickers within the messaging application.

为了支持交互,消息传递应用程序应提供一个文本框供用户编写文本消息。 文本框通常具有“发送”或“输入”按钮,以开始发送书面消息。 用户应使用消息传递应用程序中的情感图标和贴纸来编写其他类型的消息。

专用应用服务器 (Dedicated Application Server)

The messaging application must connect to a server for it to function as intended. A server may be a physical or virtual machine automated/programmed to receive and share messages between users who are connected to the server. The user’s connection to a server may be through a computer or a mobile application such as a real time chat API.

消息传递应用程序必须连接到服务器才能使其按预期运行。 服务器可以是自动/编程为在连接到服务器的用户之间接收和共享消息的物理或虚拟机。 用户与服务器的连接可以通过计算机或移动应用程序(例如实时聊天API)进行。

Servers come in different types, sizes, and work efficiency but receive an instant message sent from many computers or mobile applications in diverse places. The server also has the capabilities to separate different messages from different users such that messages are never mixed up, and one user receives the wrong message.

服务器具有不同的类型,大小和工作效率,但会接收从不同地方的许多计算机或移动应用程序发送的即时消息。 服务器还具有将不同用户的不同消息分开的功能,从而永远不会混淆消息,并且一个用户会收到错误的消息。

A server also has the capability of identifying a user using predetermined credentials required to access information stored in the server for a given user. Usually, credentials may be in the form of the name of the user and a password. The user must have first created an account for him/her before accessing information stored in the server. This is an important security feature to safeguard data privacy.

服务器还具有使用访问给定用户的服务器中存储的信息所需的预定凭据来识别用户的能力。 通常,凭据可以采用用户名和密码的形式。 用户必须先为他/她创建一个帐户,然后才能访问服务器中存储的信息。 这是保护数据隐私的重要安全功能

稳定的基于Internet的连接 (A Stable, Internet-based Connection)

The means of connectivity is the power linking a server to a chat application on the mobile phone or the computer. One might have the message already composed of the chat application and also have a dedicated application server. The internet is the connectivity component required to transmit information between the application and the application server.

连接的方法是将服务器链接到手机或计算机上的聊天应用程序的电源。 一个人可能已经拥有由聊天应用程序组成的消息,还拥有一台专用的应用程序服务器。 互联网是在应用程序和应用程序服务器之间传输信息所需的连接性组件。

In this next part, we discuss how information is relayed between the chat application and the application server once a steady internet connection has been established.

在下一部分中,我们讨论一旦建立了稳定的Internet连接,如何在聊天应用程序和应用程序服务器之间中继信息。

The following is the communication process of a chat application:

以下是聊天应用程序的通信过程:

在聊天应用程序和应用程序服务器之间建立连接 (Establishing a Connection between the Chat Application and the Application Server)

The initial connection between the chat application and the application server will have the server identify the new connection as a new user. The user’s identity is still anonymous until the required access-credentials, as generated from the chat application, can be remitted to the server for authentication and storage.

聊天应用程序和应用程序服务器之间的初始连接将使服务器将新连接标识为新用户。 用户的身份仍然是匿名的,直到可以将聊天应用程序生成的所需访问凭据发送到服务器进行身份验证和存储为止。

This user-identification level is sufficient to support communication where the users are many, and their identities need not be revealed to other users/recipients. However, proper identification will be required when the message is exchanged between one user directly to another user as the server would not be able to determine the recipient of the message without proper identification.

用户标识级别足以支持用户很多的通信,并且无需向其他用户/收件人透露其身份。 但是,当消息在一个用户之间直接交换给另一用户时,将需要适当的标识,因为如果没有适当的标识,服务器将无法确定消息的收件人。

用户识别 (Identification of the User)

In this stage, users need to identify themselves to the server by keying credentials of their usernames and passwords. The username and passwords are created during the sign-up stage after the chat application has been installed on the phone or the personal computer.

在此阶段,用户需要通过键入其用户名和密码的凭据来向服务器标识自己。 用户名和密码是在注册阶段在手机或个人计算机上安装了聊天应用程序之后创建的。

The application server gives a unique tracking/mapping code to a user upon correct user identification. Tracking of individual users is uniquely done per user. As more users register and access the server, such that messages are not mixed up, and one user receives information meant for another user.

在正确的用户标识后,应用程序服务器会向用户提供唯一的跟踪/映射代码。 对每个用户的跟踪是唯一完成的。 随着越来越多的用户注册和访问服务器,消息不会混淆,一个用户接收到了另一用户的信息。

通讯 (Communication)

This is the main objective of all other processes. The process of exchanging information begins when the sender types and sends the message from the message application endpoint. The server receives the message. The received message and the sender of the message are also distinctly identified.

这是所有其他过程的主要目标。 当发件人键入消息并从消息应用程序端点发送消息时,信息交换过程即开始。 服务器收到消息。 接收到的消息和消息的发送者也被明确标识。

The server disseminates the received information to the recipient according to commands from the point of sending. The connection to the recipient of the message is identified and labeled differently to the sender’s connection such that the message does not end up in the wrong destinations.

服务器根据从发送点开始的命令将接收到的信息分发给接收者。 标识和消息接收者的连接,并标记为与发送者的连接不同,以使消息不会最终到达错误的目的地。

结论 (Conclusion)

The main limitation of real-time chat applications is that there is limited interoperability between servers belonging to different chat applications. For instance, one cannot send a message from WhatsApp Messenger to Facebook Messenger directly and in real-time. This is because the server for the two chat companies is also different.

实时聊天应用程序的主要局限性在于,属于不同聊天应用程序的服务器之间的互操作性有限。 例如,无法将消息从WhatsApp Messenger直接发送到Facebook Messenger。 这是因为两个聊天公司的服务器也不同。

Exchange of information on chat applications in real-time is very critical for social and business networking. The message is received instantaneously, provided a stable internet connection between the users and the servers. The simplicity of data exchange from chat applications is made possible by a complex network of programs and processes between message applications and application servers.

实时交流聊天应用程序上的信息对于社交和企业网络至关重要。 只要在用户和服务器之间建立稳定的Internet连接,就可以立即接收到该消息。 消息应用程序和应用程序服务器之间复杂的程序和过程网络使聊天应用程序的数据交换变得简单。

翻译自: https://www.thecrazyprogrammer.com/2020/08/how-a-real-time-chat-application-works.html

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/culing2941/article/details/108616914

智能推荐

Chart.js-线形图分析(参数分析+例图)_征途黯然.的博客-程序员宅基地

Chart.js-线形图分析(参数分析+例图)线形图样式总览基本写法参数解析线形图1 - 普通线形图(直线、曲线、虚线)线形图2 - 普通线面图线形图3 - 步进线(像极了哈夫曼编码)线形图4 - 点状线线形图5 - 线形叠加图线形图样式总览基本写法首先在< script >标签里面引入chart.js:<script src="chart.js/Chart.js"></script>然后创建一个画布:<canvas id="myChart" wid

strip_tags _java_helpme的博客-程序员宅基地

strip_tags(html)Strips all HTML tags from the html, including comments. This uses the html-scanner tokenizer and so its HTML parsing ability is limited by that of html-scanner. strip_tags...

nginx 安装、Nginx+Keepalived 主备高可用_Elegant_syh的博客-程序员宅基地

centos平台编译环境使用如下指令  安装make:yum -y install gcc automake autoconf libtool make  安装g++:yum install gcc gcc-c++安装pcre库: cd /usr/local/srcwget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcr...

HTML5 UTF-8 中文乱码_lovelyqianqian的博客-程序员宅基地

页面标题我的第一个标题Content of the document......我是用记事本写的,保存后在网页上运行竟然出现了乱码。最后发现代码没有一点问题,问题就出记事本身上。 <meta charste="utf-8"> 只是告诉浏览器要用utf-8来解释,而文档的编码,是在你保存时的选择决定的。如果保存ANSI 然后用utf-8

ADS1232与SPI_MouShengWuDu的博客-程序员宅基地_ads1232

一、试验结果1)ADS1232的输出不能直接被SPI读取,不适合SPI通讯,所以只能以模拟SPI时序来进行计算AD值。2)比如ADS1256,输出脚就是AD芯片已经将结果转换好以后在输出,这样的数值就可以被SPI直接获取。3)暂时计划就是通过定时器来进行实时采样。二、STM32分类软件定义分类,ROM:16-32k为STM32LD,型号6;60-128k为STM32MD,型号8-B;25...

检测图片的完整性_caocaozhuce的博客-程序员宅基地_图片完整性校验

http://soft.zol.com.cn/126/1268197.html JPG/JPEG图片的验证JPEGsnoop图片验证工具早期的互联网是文字时代,读者只能根据自己的经验和意愿来判断消息的真假,但随着信息时代的发展,人们已经不满足于“读字时代”了,“读图时代”悄然走进了我们的生活,可慢慢的有图有真相这句曾经的定理也逐渐变得不再适用了,photoshop已经已惊人的速

随便推点

Jshell_weixin_33862993的博客-程序员宅基地

为什么80%的码农都做不了架构师?&gt;&gt;&gt; ...

Basic knowledge of digital image processing_李伯爵的指间沙的博客-程序员宅基地

1、数字图像:数字图像,又称为数码图像或数位图像,是二维图像用有限数字数值像素的表示。数字图像是由模拟图像数字化得到的、以像素为基本元素的、可以用数字计算机或数字电路存储和处理的图像。 1.The digital ofImageProcessing Digital image, also known as digital image or digital image, is the representation of two-dimensional image with finite..

html页面嵌在安卓app里面出现点击input输入框时被手机键盘遮挡住解决方法_大白菜一个的博客-程序员宅基地_安卓app内嵌网页 输入input的时候被遮住

$('.gunNums input').focus(function(e){ var u = navigator.userAgent; var isAndroid = u.indexOf('Android') &amp;gt; -1 || u.indexOf('Adr') &amp;gt; -1; //android终端 if...

GIS开发:使用earcut生成三角网格_地理信息技术杂谈的博客-程序员宅基地

earcut是由mapbox发布,一个开源生成三角网格的js类库,开源github地址:https://github.com/mapbox/earcut。mapbox-gl是一个基于webgl的地图类库,在webgl中进行面状图层勾画时,是以三角形的形式进行绘制,参见下列网址:https://webglfundamentals.org/webgl/lessons/zh_cn/webgl-points-lines-triangles.html在进行面状图层绘制时,首先要将面状对象进行三角化,生成三角网格

为什么throw null会抛出NullPointerException?_swordinhand的博客-程序员宅基地

看招聘区的联创面试题想到的这个问题,一开始还以为是因为异常链无法获取到null的信息导致的,后来上网搜了一下,有篇帖子[url]http://www.adarshr.com/papers/npe[/url]解释了这个问题,这其实是Java语言规范里指定的内容,在Java Language Specification第三版$14.18 The throw Statement里面提到了“A thr...

真实评测:麒麟985和骁龙865哪个好-麒麟985和骁龙865对比,哪个更强_听教主说的博客-程序员宅基地_麒麟985和骁龙865哪个好

骁龙865和麒麟985配置架构对比2020下半年众多的手机品牌中,最受欢迎的居然是它?!看看内行人怎么说!真有点出乎意外!.点击参考京东最新手机销量排行榜:https://www.jd.shouji.com二、骁龙865和麒麟985详细情况对比骁龙865:采用7nm工艺打造,8核心CPU,由一大核Kryo 495(A77改)+三中核Kryo 495(A77改)+四小核Kryo 495(A55改),GPU为Adreno 650,内存为LPDDR4X-2133 LPDDR5-2750,由于骁龙86

推荐文章

热门文章

相关标签