WO2019023972A1 - Multi-terminal message synchronization method and system, server and computer processing device - Google Patents

Multi-terminal message synchronization method and system, server and computer processing device Download PDF

Info

Publication number
WO2019023972A1
WO2019023972A1 PCT/CN2017/095591 CN2017095591W WO2019023972A1 WO 2019023972 A1 WO2019023972 A1 WO 2019023972A1 CN 2017095591 W CN2017095591 W CN 2017095591W WO 2019023972 A1 WO2019023972 A1 WO 2019023972A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
user account
mobile terminal
logged
detected
Prior art date
Application number
PCT/CN2017/095591
Other languages
French (fr)
Chinese (zh)
Inventor
薛春
Original Assignee
深圳市创富港商务服务股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市创富港商务服务股份有限公司 filed Critical 深圳市创富港商务服务股份有限公司
Priority to CN201780093116.6A priority Critical patent/CN111095889A/en
Priority to PCT/CN2017/095591 priority patent/WO2019023972A1/en
Publication of WO2019023972A1 publication Critical patent/WO2019023972A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the parsed message is sent to the PC.
  • the stored message is sent to the PC.
  • the stored message is sent to the PC.
  • a server that includes:
  • the message can be sent to the mobile terminal when the mobile terminal logs in, so that the user can view the message; when the user account is detected on the PC side When logging in, the message can be sent to the PC so that the user can view the message; thus, the message can be sent according to the login status of the user account, so that the user can view the message in time, and the message is sent to different terminals, and the user can be in different terminals. View the message.
  • the message is sent to the corresponding login end of the user, so that the user can receive the message and read the message in time.
  • the parsed message is sent to the PC; if it is detected that the user account is not logged in the PC, the parsed message is stored; if the user account is detected on the PC side Log in to send the stored message to the PC.
  • Xmpp calls webim through the http interface to send a message to the pc user
  • the heartbeat indicates that I have switched, and the original theme and chat object information is taken and deleted.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Provided is a multi-terminal message synchronization method. The method comprises: acquiring a message and parsing the acquired message; detecting a login state of a user account, and sending the parsed message to a mobile terminal if it is detected that the user account is logged in to on the mobile terminal; and sending the parsed message to a PC end if it is detected that the user account is logged in to on the PC end. A message can be sent according to login states at a mobile terminal and a PC end, and when it is detected that a user account is logged in to on the mobile terminal, the message can be sent to the mobile terminal, such that a user views the message; when it is detected that the user account is logged in to on the PC end, the message can be sent to the PC end, such that a user views the message; and in this way, the message can be sent according to the login state of the user account, such that the user can view the message in a timely manner, and when the message is sent to different terminals, the user can view the message on different terminals.

Description

多终端消息同步方法、系统、服务器和计算机处理设备Multi-terminal message synchronization method, system, server and computer processing device 技术领域Technical field
本发明涉及互联网技术领域,尤其涉及一种多终端消息同步方法、系统和计算机处理设备。The present invention relates to the field of Internet technologies, and in particular, to a multi-terminal message synchronization method, system, and computer processing device.
背景技术Background technique
即时通讯(Instant Message,IM)是一种可以让使用者在网络上建立某种私人聊天室的实时通讯服务。随着IM技术的迅速发展,极大的改善了用户的沟通体验,与此同时,用户拥有的移动终端的数量也越来越多,类型也越来越丰富,沟通方式也逐渐趋于多屏化,比如用户可以在移动终端如手机、平板等上发送和接收消息,也可以在PC端例如笔记本电脑、台式电脑上发送和接收消息。Instant Message (IM) is a real-time communication service that allows users to create a private chat room on the network. With the rapid development of IM technology, the communication experience of users has been greatly improved. At the same time, the number of mobile terminals owned by users is increasing, the types are becoming more and more abundant, and the communication methods are gradually becoming multi-screen. For example, users can send and receive messages on mobile terminals such as mobile phones, tablets, etc., and can also send and receive messages on PCs such as laptops and desktop computers.
用户经常会出现有时在移动终端上登录账号,有时在PC端上登录的情况,例如用户在办公室中时就会在使用PC登录账号,接收消息,处理工作等等。而当用户外出时,使用移动终端接收消息会更加方便,以便及时进行工作沟通,处理事务等等。然而,例如用户在PC端登录后,过了一段时间在移动终端上登录账号,此时经常会出现在PC端上的消息无法同步到移动终端上,造成用户使用不方便的情况。Users often appear to log in to the account on the mobile terminal sometimes, and sometimes log in on the PC. For example, when the user is in the office, he or she will use the PC to log in to the account, receive messages, process work, and so on. When the user goes out, it is more convenient to use the mobile terminal to receive the message, so that the work communication, the transaction, and the like can be performed in time. However, for example, after the user logs in on the PC, after a period of time, the account is logged in on the mobile terminal. At this time, the message that appears on the PC cannot be synchronized to the mobile terminal, which may cause inconvenience to the user.
因此,如何提供一种多终端消息同步方法,成为本领域亟需解决的问题。Therefore, how to provide a multi-terminal message synchronization method has become an urgent problem in the art.
发明内容Summary of the invention
本发明的目的是一种多终端消息同步方法、系统和计算机处理设备,能够及时将不同终端的消息进行实时同步。The object of the present invention is a multi-terminal message synchronization method, system and computer processing device, which can timely synchronize messages of different terminals in real time.
本发明的目的是通过以下技术方案来实现的:The object of the present invention is achieved by the following technical solutions:
一种多终端消息同步方法,该方法包括:A multi-terminal message synchronization method, the method comprising:
获取消息,并对获取的消息进行解析;Get the message and parse the obtained message;
检测用户账号的登录状态,若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;以及Detecting the login status of the user account, and if detecting that the user account is logged in at the mobile terminal, transmitting the parsed message to the mobile terminal;
若检测到用户账号在PC端登录,则将经过解析后的消息发送给PC端。 If the user account is detected to log in on the PC, the parsed message is sent to the PC.
优选的,所述方法进一步包括:Preferably, the method further comprises:
若检测到用户账号未在移动终端登录,则检测用户账号是否在PC端登录,若是,则将消息发送至PC端。If it is detected that the user account is not logged in at the mobile terminal, it is detected whether the user account is logged in on the PC, and if so, the message is sent to the PC.
优选的,在若检测到用户账号未在移动终端登录,则检测用户账号是否在PC端登录的步骤之后,所述方法进一步包括:Preferably, after detecting that the user account is not logged in at the mobile terminal, and detecting whether the user account is logged in at the PC, the method further includes:
若检测到用户账号未在PC端登录,则将经过解析的消息进行存储。If it is detected that the user account is not logged in on the PC, the parsed message is stored.
优选的,在将经过解析的消息进行存储的步骤之后,所述方法进一步包括:Preferably, after the step of storing the parsed message, the method further comprises:
若检测到用户账号在移动终端登录,则将存储的消息发送至移动终端。If it is detected that the user account is logged in at the mobile terminal, the stored message is sent to the mobile terminal.
优选的,在将经过解析的消息进行存储的步骤之后,所述方法进一步包括:Preferably, after the step of storing the parsed message, the method further comprises:
若检测到用户账号在PC端登录,则将存储的消息发送至PC端。If it is detected that the user account is logged in on the PC, the stored message is sent to the PC.
优选的,所述方法进一步包括:若检测到用户账号未在PC端登录,则将经过解析的消息进行存储。Preferably, the method further comprises: if it is detected that the user account is not logged in at the PC, storing the parsed message.
优选的,在若检测到用户账号未在PC端登录,则将经过解析的消息进行存储的步骤之后,所述方法进一步包括:Preferably, after the step of storing the parsed message after detecting that the user account is not logged in at the PC, the method further includes:
若检测到用户账号在PC端登录,则将存储的消息发送至PC端。If it is detected that the user account is logged in on the PC, the stored message is sent to the PC.
一种计算机处理设备,包括处理器及计算机可读存储介质,所述处理器获取所述计算机可读存储介质上的计算机程序,并执行上述任一所述方法的步骤。A computer processing apparatus comprising a processor and a computer readable storage medium, the processor acquiring a computer program on the computer readable storage medium and performing the steps of any of the methods described above.
一种服务器,包括:A server that includes:
获取模块,用于获取消息,并对获取的消息进行解析;Obtaining a module, which is used to obtain a message and parse the obtained message;
处理发送模块,用于若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;若检测到用户账号在PC端登录,则将经过解析后的消息发送给PC端。The processing sending module is configured to: if the user account is detected to log in to the mobile terminal, send the parsed message to the mobile terminal; if the user account is detected to log in to the PC, the parsed message is sent to the PC.
一种多终端消息同步系统,包括移动终端、PC端和如上述所述的服务器,所述服务器与移动终端通讯连接,所述服务器与所述PC端通讯连接,所述服务器用户接收消息,并向所述移动终端或/和PC端发送经过解析后的消息。A multi-terminal message synchronization system includes a mobile terminal, a PC end, and a server as described above, the server is in communication connection with a mobile terminal, the server is in communication connection with the PC end, and the server user receives a message, and The parsed message is sent to the mobile terminal or/and the PC.
本发明的多终端消息同步方法由于包括:获取消息,并对获取的消息进行解析;检测用户账号的登录状态,若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;以及若检测到用户账号在PC端登 录,则将经过解析后的消息发送给PC端。采用这种方式,就可以根据移动终端和PC端的登录状态进行消息发送,当检测用户账号在移动终端登录时就可以将消息发送到移动终端,以便用户查看消息;当检测到用户账号在PC端登录时就可以将消息发送到PC端,以便用户查看消息;这样就可以根据用户账户的登录状态发送消息,从而让用户及时查看消息,并且消息发送到不同的终端,可以让用户在不同的终端查看消息。The multi-terminal message synchronization method of the present invention includes: acquiring a message and parsing the obtained message; detecting a login status of the user account, and detecting that the user account is logged in at the mobile terminal, transmitting the parsed message to the mobile terminal ; and if the user account is detected on the PC side Record, the parsed message is sent to the PC. In this way, the message can be sent according to the login status of the mobile terminal and the PC. When the user account is detected, the message can be sent to the mobile terminal when the mobile terminal logs in, so that the user can view the message; when the user account is detected on the PC side When logging in, the message can be sent to the PC so that the user can view the message; thus, the message can be sent according to the login status of the user account, so that the user can view the message in time, and the message is sent to different terminals, and the user can be in different terminals. View the message.
附图说明DRAWINGS
图1是本发明实施例的一多终端消息同步方法的流程图;1 is a flowchart of a multi-terminal message synchronization method according to an embodiment of the present invention;
图2是本发明实施例的一种服务器的示意图。2 is a schematic diagram of a server according to an embodiment of the present invention.
具体实施方式Detailed ways
虽然流程图将各项操作描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。各项操作的顺序可以被重新安排。当其操作完成时处理可以被终止,但是还可以具有未包括在附图中的附加步骤。处理可以对应于方法、函数、规程、子例程、子程序等等。Although the flowcharts describe various operations as a sequential process, many of the operations can be implemented in parallel, concurrently or concurrently. The order of the operations can be rearranged. Processing may be terminated when its operation is completed, but may also have additional steps not included in the figures. Processing can correspond to methods, functions, procedures, subroutines, subroutines, and the like.
计算机设备包括用户设备与网络设备。其中,用户设备或客户端包括但不限于电脑、智能手机、PDA等;网络设备包括但不限于单个网络服务器、多个网络服务器组成的服务器组或基于云计算的由大量计算机或网络服务器构成的云。计算机设备可单独运行来实现本发明,也可接入网络并通过与网络中的其他计算机设备的交互操作来实现本发明。计算机设备所处的网络包括但不限于互联网、广域网、城域网、局域网、VPN网络等。Computer devices include user devices and network devices. The user equipment or the client includes but is not limited to a computer, a smart phone, a PDA, etc.; the network device includes but is not limited to a single network server, a server group composed of multiple network servers, or a cloud computing-based computer or network server. cloud. The computer device can operate alone to carry out the invention, and can also access the network and implement the invention through interoperation with other computer devices in the network. The network in which the computer device is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, and the like.
在这里可能使用了术语“第一”、“第二”等等来描述各个单元,但是这些单元不应当受这些术语限制,使用这些术语仅仅是为了将一个单元与另一个单元进行区分。这里所使用的术语“和/或”包括其中一个或更多所列出的相关联项目的任意和所有组合。当一个单元被称为“连接”或“耦合”到另一单元时,其可以直接连接或耦合到所述另一单元,或者可以存在中间单元。The terms "first," "second," and the like may be used herein to describe the various elements, but the elements should not be limited by these terms, and the terms are used only to distinguish one element from another. The term "and/or" used herein includes any and all combinations of one or more of the associated listed items. When a unit is referred to as being "connected" or "coupled" to another unit, it can be directly connected or coupled to the other unit, or an intermediate unit can be present.
这里所使用的术语仅仅是为了描述具体实施例而不意图限制示例性实施例。除非上下文明确地另有所指,否则这里所使用的单数形式“一个”、“一项”还意图包括复数。还应当理解的是,这里所使用的术语“包括”和/或“包含”规定所陈述的特征、整数、步骤、操作、单元和/或组件的 存在,而不排除存在或添加一个或更多其他特征、整数、步骤、操作、单元、组件和/或其组合。The terminology used herein is for the purpose of describing the particular embodiments, The singular forms "a", "an", It will also be understood that the terms "comprising" and / or "comprising", as used herein, are intended to mean the stated features, integers, steps, operations, units and/or components. The existence or addition of one or more other features, integers, steps, operations, units, components and/or combinations thereof may be present.
下面结合附图和较佳的实施例对本发明作进一步说明。The invention will now be further described with reference to the drawings and preferred embodiments.
如图1所示,本实施例中公开一种多终端消息同步方法,该方法包括:As shown in FIG. 1 , a multi-terminal message synchronization method is disclosed in this embodiment, and the method includes:
S101、获取消息,并对获取的消息进行解析;S101. Acquire a message, and parse the obtained message.
S102、检测用户账号的登录状态,若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;以及S102. Detecting a login status of the user account, and if detecting that the user account is logged in at the mobile terminal, sending the parsed message to the mobile terminal;
S103、若检测到用户账号在PC端登录,则将经过解析后的消息发送给PC端。S103. If the user account is detected to log in on the PC, the parsed message is sent to the PC.
本发明的多终端消息同步方法由于包括:获取消息,并对获取的消息进行解析;检测用户账号的登录状态,若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;以及若检测到用户账号在PC端登录,则将经过解析后的消息发送给PC端。采用这种方式,就可以根据移动终端和PC端的登录状态进行消息发送,当检测用户账号在移动终端登录时就可以将消息发送到移动终端,以便用户查看消息;当检测到用户账号在PC端登录时就可以将消息发送到PC端,以便用户查看消息;这样就可以根据用户账户的登录状态发送消息,从而让用户及时查看消息,并且消息发送到不同的终端,可以让用户在不同的终端查看消息。The multi-terminal message synchronization method of the present invention includes: acquiring a message and parsing the obtained message; detecting a login status of the user account, and detecting that the user account is logged in at the mobile terminal, transmitting the parsed message to the mobile terminal And if the user account is detected to log in on the PC, the parsed message is sent to the PC. In this way, the message can be sent according to the login status of the mobile terminal and the PC. When the user account is detected, the message can be sent to the mobile terminal when the mobile terminal logs in, so that the user can view the message; when the user account is detected on the PC side When logging in, the message can be sent to the PC so that the user can view the message; thus, the message can be sent according to the login status of the user account, so that the user can view the message in time, and the message is sent to different terminals, and the user can be in different terminals. View the message.
本实施例中,例如用户A发送消息给用户B,服务器在接收到这个指令后,获取消息并进行解析,例如分析消息类型,是文字还是图片或语音等等,然后检测用户B账号的登录状态,如果检测到用户B在移动终端登录,则将消息发送到移动终端;同时服务器还会继续检测用户B账号是否在PC端登录,如果登录则也会将消息发送到PC端,从而让消息在移动终端和PC端都存在,方便用户在移动终端和PC端查看消息。In this embodiment, for example, user A sends a message to user B. After receiving the instruction, the server acquires the message and parses it, for example, analyzes the message type, whether it is text or picture or voice, etc., and then detects the login status of the user B account. If it is detected that the user B logs in to the mobile terminal, the message is sent to the mobile terminal; at the same time, the server continues to detect whether the user B account is logged in on the PC, and if the login, the message is also sent to the PC, so that the message is Both the mobile terminal and the PC end exist, which is convenient for the user to view messages on the mobile terminal and the PC side.
本实施例中,在将消息发送给PC端后,PC端在收到之后可以回复一封回执给服务器,服务器就知道该用户的PC端收到了消息,服务器还可以把回执发送给原消息的发送者,例如上述案例的用户A。在将消息发送给移动终端后,移动终端在收到之后可以回复一封回执给服务器,服务器就知道该用户的移动终端收到了消息,服务器还可以把回执发送给原消息的发送者,例如上述案例的用户A。In this embodiment, after the message is sent to the PC, the PC can reply to the server after receiving the receipt, and the server knows that the user's PC receives the message, and the server can also send the receipt to the original message. The sender, such as user A of the above case. After the message is sent to the mobile terminal, the mobile terminal can reply a receipt to the server after receiving the server, and the server knows that the user's mobile terminal has received the message, and the server can also send the receipt to the sender of the original message, for example, the above. User A of the case.
本实施例中,所述方法进一步包括:若检测到用户账号未在移动终端登录,则检测用户账号是否在PC端登录,若是,则将消息发送至PC端。 In this embodiment, the method further includes: if it is detected that the user account is not logged in at the mobile terminal, detecting whether the user account is logged in on the PC, and if yes, sending the message to the PC.
采用这种方式就可以在检测到用户账号没有在移动终端登录时,检测用户账号是否在PC端登录,若在PC端登录就可以将账号发送到PC端。In this way, when it is detected that the user account is not logged in at the mobile terminal, it is detected whether the user account is logged in on the PC. If the user logs in, the account can be sent to the PC.
本实施例中,在若检测到用户账号未在移动终端登录,则检测用户账号是否在PC端登录的步骤之后,所述方法进一步包括:若检测到用户账号未在PC端登录,则将经过解析的消息进行存储。In this embodiment, after detecting that the user account is not logged in at the mobile terminal, and detecting whether the user account is logged in on the PC, the method further includes: if detecting that the user account is not logged in the PC, The parsed message is stored.
这样就可以将消息存储,等到检测到用户账号上线的时候将消息发送出去。This allows the message to be stored and sent to the message when it is detected that the user's account is online.
本实施例中,在将经过解析的消息进行存储的步骤之后,所述方法进一步包括:若检测到用户账号在移动终端登录,则将存储的消息发送至移动终端。In this embodiment, after the step of storing the parsed message, the method further comprises: if detecting that the user account is logged in at the mobile terminal, transmitting the stored message to the mobile terminal.
本实施例中,在将经过解析的消息进行存储的步骤之后,所述方法进一步包括:若检测到用户账号在PC端登录,则将存储的消息发送至PC端。In this embodiment, after the step of storing the parsed message, the method further includes: if detecting that the user account is logged in at the PC, sending the stored message to the PC.
这样就可以在检测到用户在哪里登录、上线的时候,将消息发送到用户相应的登录端,从而让用户及时收到消息,阅读消息。In this way, when the user is detected to log in and go online, the message is sent to the corresponding login end of the user, so that the user can receive the message and read the message in time.
本实施例中,所述方法进一步包括:若检测到用户账号未在PC端登录,则将经过解析的消息进行存储。In this embodiment, the method further includes: if it is detected that the user account is not logged in at the PC, the parsed message is stored.
本实施例中,在若检测到用户账号未在PC端登录,则将经过解析的消息进行存储的步骤之后,所述方法进一步包括:In this embodiment, after the step of storing the parsed message after detecting that the user account is not logged in on the PC, the method further includes:
若检测到用户账号在PC端登录,则将存储的消息发送至PC端。If it is detected that the user account is logged in on the PC, the stored message is sent to the PC.
本实施例中,完整步骤如下:In this embodiment, the complete steps are as follows:
获取消息,并对获取的消息进行解析;Get the message and parse the obtained message;
检测用户账号的登录状态,若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;若检测到用户账号未在移动终端登录,则检测用户账号是否在PC端登录,若是则将消息发送至PC端,若否则将经过解析的消息进行存储;若检测到用户账号在移动终端登录,则将存储的消息发送至移动终端,若检测到用户账号在PC端登录,则将存储的消息发送至PC端;Detecting the login status of the user account, if the user account is detected to log in to the mobile terminal, the parsed message is sent to the mobile terminal; if it is detected that the user account is not logged in at the mobile terminal, it is detected whether the user account is logged in on the PC. If yes, the message is sent to the PC, if otherwise, the parsed message is stored; if the user account is detected to log in to the mobile terminal, the stored message is sent to the mobile terminal, and if the user account is detected to log in on the PC, Send the stored message to the PC;
若检测到用户账号在PC端登录,则将经过解析后的消息发送给PC端;若检测到用户账号未在PC端登录,则将经过解析的消息进行存储;若检测到用户账号在PC端登录,则将存储的消息发送至PC端。If it is detected that the user account is logged in on the PC, the parsed message is sent to the PC; if it is detected that the user account is not logged in the PC, the parsed message is stored; if the user account is detected on the PC side Log in to send the stored message to the PC.
本实施例中,具体实施中可采用下面的方式:在PC端安装即时通讯软 件webim,在移动终端上安装移动端的通讯软件xmpp。In this embodiment, the following manner can be adopted in the specific implementation: installing instant messaging soft on the PC side Webim, install the mobile communication software xmpp on the mobile terminal.
接收消息:Receive message:
接收pc消息:回执一条消息到pc客户端,让pc客户端知道消息发送状态;Receive pc message: return a message to the pc client, let the pc client know the message sending status;
接收xmpp消息:Receive xmpp message:
xmpp通过http接口调用webim给pc用户发消息;Xmpp calls webim through the http interface to send a message to the pc user;
接收消息队列:系统通知消息会插入到消息队列,webim监听队列变化获取需要发送的消息。Receive Message Queue: The system notification message is inserted into the message queue, and the webim listens to the queue change to get the message that needs to be sent.
转发消息:Forward the message:
webim(通过上面三种方式)接收到消息后,将进行以下处理:After webim (through the above three methods) receives the message, the following processing will be performed:
将消息转发给xmpp;Forward the message to xmpp;
(除了从xmpp发送过来的消息)需要将消息转发给xmpp,保证app和pc的消息是同步的.同时获取返回的消息id的message_id,用于pc数据操作。(In addition to the message sent from xmpp), the message needs to be forwarded to xmpp to ensure that the message of the app and pc are synchronized. At the same time, the message_id of the returned message id is obtained for the pc data operation.
将消息转发pc对应在线用户:Forward the message to the corresponding online user:
组装message_id到消息体后,依据用户在线状态缓存信息决定消息是否已读.然后找到pc对应在线用户发消息,如果是用户是离线的,则根据app是否在线状态累加离线数量。After the message_id is assembled to the message body, the message is determined according to the user's online state cache information. Then the PC is found to correspond to the online user, and if the user is offline, the offline number is accumulated according to whether the app is online.
在线状态缓存规则及未读状态规则:Online state caching rules and unread status rules:
用户所在当前聊天对象及聊天主题redis存储信息(过期:20秒):User's current chat object and chat topic redis storage information (expiration: 20 seconds):
群聊:"group_"+from+"_"+gid+"_"+subject_idGroup chat: "group_"+from+"_"+gid+"_"+subject_id
单聊:"chat_"+from+"_"+to_uid+"_"+subject_id。Single chat: "chat_"+from+"_"+to_uid+"_"+subject_id.
更新情况:Update:
a).一直在线时,每隔15s,发心跳说明还在当前主题或聊天对象a). When you are online, every 15s, the heartbeat indicates that the current topic or chat object is still present.
b).切换主题或聊天对象时,发心跳说明我已经切换了,并带上原来主题和聊天对象信息,并删除。b). When switching the theme or chat object, the heartbeat indicates that I have switched, and the original theme and chat object information is taken and deleted.
消息状态:Message status:
新消息来临时,判断上面在线状态是否存在.如果存在则为已读状态.客户端判断为已读状态不会累加未读数量。When the new message comes, it is judged whether the above online status exists. If it exists, it is the read status. The client judges that the read status does not accumulate the unread quantity.
累加数量:Accumulated quantity:
pc用户离线后,如果app也同时离线(及上面的在线状态不存在),新消息来临时,会累加未读消息数量。 After the pc user is offline, if the app is also offline (and the online status does not exist), the new message will accumulate the number of unread messages.
redis存储规则:Redis storage rules:
群聊:"MsgCnt_"+from_str+"_group_"+gid_str+"_"+subject_strGroup chat: "MsgCnt_"+from_str+"_group_"+gid_str+"_"+subject_str
单聊:"MsgCnt_"+from_str+"_chat_"+uid_str+"_"+subject_str。Single chat: "MsgCnt_"+from_str+"_chat_"+uid_str+"_"+subject_str.
清除数量:Clear quantity:
a).用户登录pc后,会将离线期间的未读数量发送过去,并且清除当前用户的所有未读主题及聊天对象;a). After the user logs in to the pc, the unread number during the offline period is sent, and all unread topics and chat objects of the current user are cleared;
b).当前用户app上切换聊天主题(聊天对象)时,会调用webim清除已读状态接口,pc对象主题立即清除;b). When the current user app switches the chat topic (chat object), webim will be called to clear the read status interface, and the pc object theme is immediately cleared;
c).pc切换主题时,也会调用xmpp接口,达到清除当前主题数量的目的。c) When the .pc switch topic, the xmpp interface is also called to achieve the purpose of clearing the current number of topics.
本实施例中,消息类型定义(media_type)如下表1:In this embodiment, the message type definition (media_type) is as follows:
名称name 标识Identification 说明Description
普通文本Ordinary text text或空Text or empty  
富文本Rich text htmlHtml  
图片image picturePicture  
文件file fileFile  
视频video videoVideo 最长10秒Up to 10 seconds
音频Audio audioAudio 最长60秒Up to 60 seconds
表2扩展消息类型定义Table 2 Extended Message Type Definition
Figure PCTCN2017095591-appb-000001
Figure PCTCN2017095591-appb-000001
表3结构定义(message表) Table 3 structure definition (message table)
Figure PCTCN2017095591-appb-000002
Figure PCTCN2017095591-appb-000002
PC端向移动终端发消息接口The PC sends a message interface to the mobile terminal.
接口功能:将消息发送到appInterface function: send a message to the app
表4接口参数:Table 4 interface parameters:
Figure PCTCN2017095591-appb-000003
Figure PCTCN2017095591-appb-000003
返回结果:message_idReturn result: message_id
移动终端向PC端发消息接口The mobile terminal sends a message interface to the PC
接口功能:将消息发送到PC端Interface function: send a message to the PC
表5接口参数:Table 5 interface parameters:
Figure PCTCN2017095591-appb-000004
Figure PCTCN2017095591-appb-000004
Figure PCTCN2017095591-appb-000005
Figure PCTCN2017095591-appb-000005
返回结果:空或missing信息Return result: empty or missing information
PC端向移动终端报告已切换聊天The PC side reports to the mobile terminal that the chat has been switched.
接口功能:清除app当前聊天主题未读数量为0Interface function: Clear the current number of unread topics in the app is 0.
表6接口参数:Table 6 interface parameters:
参数parameter 必须have to 说明Description
fromFrom 发送者idSender id  
groupchatGroupchat 1或01 or 0 如果1,则是群聊If 1, it is a group chat
uidUid 接收者idReceiver id  
gidGid 群idGroup id  
subjectidSubjectid 主题idSubject id  
移动终端向PC端报告已切换聊天The mobile terminal reports the switched chat to the PC
接口功能:清除pc当前聊天主题未读数量为0Interface function: Clear the current unwritten number of pc chat topics to 0
表7接口参数:Table 7 interface parameters:
参数parameter 必须have to 说明Description
fromFrom 发送者idSender id  
groupchatGroupchat 1或01 or 0 如果1,则是群聊If 1, it is a group chat
uidUid 接收者idReceiver id  
gidGid 群idGroup id  
subjectidSubjectid 主题idSubject id  
一种计算机处理设备,包括处理器及计算机可读存储介质,所述处理器获取所述计算机可读存储介质上的计算机程序,并执行上述任一所述方法的步骤。A computer processing apparatus comprising a processor and a computer readable storage medium, the processor acquiring a computer program on the computer readable storage medium and performing the steps of any of the methods described above.
如图2所示,本实施例中公开一种服务器,包括:As shown in FIG. 2, a server is disclosed in this embodiment, including:
获取模块201,用于获取消息,并对获取的消息进行解析;The obtaining module 201 is configured to acquire a message and parse the obtained message;
处理发送模块202,用于若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;若检测到用户账号在PC端登录,则将经过解析后的消息发送给PC端。The processing sending module 202 is configured to: if the user account is detected to log in to the mobile terminal, send the parsed message to the mobile terminal; if the user account is detected to log in to the PC, the parsed message is sent to the PC. .
采用这种方式,就可以根据移动终端和PC端的登录状态进行消息发送,当检测用户账号在移动终端登录时就可以将消息发送到移动终端,以便用户查看消息;当检测到用户账号在PC端登录时就可以将消息发送到PC端,以便用户查看消息;这样就可以根据用户账户的登录状态发送消息,从而让用户及时查看消息,并且消息发送到不同的终端,可以让用户在不同的终端查看消息。In this way, the message can be sent according to the login status of the mobile terminal and the PC. When the user account is detected, the message can be sent to the mobile terminal when the mobile terminal logs in, so that the user can view the message; when the user account is detected on the PC side When logging in, the message can be sent to the PC so that the user can view the message; thus, the message can be sent according to the login status of the user account, so that the user can view the message in time, and the message is sent to different terminals, and the user can be in different terminals. View the message.
本实施例中,例如用户A发送消息给用户B,服务器在接收到这个指令后,获取消息并进行解析,例如分析消息类型,是文字还是图片或语音等等,然后检测用户B账号的登录状态,如果检测到用户B在移动终端登录,则将消息发送到移动终端;同时服务器还会继续检测用户B账号是否在PC端登录,如果登录则也会将消息发送到PC端,从而让消息在移动终端和PC端都存在,方便用户在移动终端和PC端查看消息。In this embodiment, for example, user A sends a message to user B. After receiving the instruction, the server acquires the message and parses it, for example, analyzes the message type, whether it is text or picture or voice, etc., and then detects the login status of the user B account. If it is detected that the user B logs in to the mobile terminal, the message is sent to the mobile terminal; at the same time, the server continues to detect whether the user B account is logged in on the PC, and if the login, the message is also sent to the PC, so that the message is Both the mobile terminal and the PC end exist, which is convenient for the user to view messages on the mobile terminal and the PC side.
本实施例中,在将消息发送给PC端后,PC端在收到之后可以回复一封回执给服务器,服务器就知道该用户的PC端收到了消息,服务器还可以把回执发送给原消息的发送者,例如上述案例的用户A。在将消息发送给移动终端后,移动终端在收到之后可以回复一封回执给服务器,服务器就知道该用户的移动终端收到了消息,服务器还可以把回执发送给原消息的发送者,例如上述案例的用户A。In this embodiment, after the message is sent to the PC, the PC can reply to the server after receiving the receipt, and the server knows that the user's PC receives the message, and the server can also send the receipt to the original message. The sender, such as user A of the above case. After the message is sent to the mobile terminal, the mobile terminal can reply a receipt to the server after receiving the server, and the server knows that the user's mobile terminal has received the message, and the server can also send the receipt to the sender of the original message, for example, the above. User A of the case.
本实施例中公开一种多终端消息同步系统,包括移动终端、PC端和如上述所述的服务器,所述服务器与移动终端通讯连接,所述服务器与所述PC端通讯连接,所述服务器用户接收消息,并向所述移动终端或/和PC端发送经过解析后的消息。In this embodiment, a multi-terminal message synchronization system is disclosed, including a mobile terminal, a PC end, and a server as described above, the server is in communication connection with a mobile terminal, and the server is in communication connection with the PC end, and the server The user receives the message and sends the parsed message to the mobile terminal or/and the PC.
以上内容是结合具体的优选实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术 领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。 The above is a further detailed description of the present invention in connection with the specific preferred embodiments, and the specific embodiments of the present invention are not limited to the description. For the technology of the present invention A person skilled in the art can make some simple deductions or substitutions without departing from the inventive concept, and should be considered as belonging to the scope of the present invention.

Claims (10)

  1. 一种多终端消息同步方法,其特征在于,该方法包括:A multi-terminal message synchronization method, the method comprising:
    获取消息,并对获取的消息进行解析;Get the message and parse the obtained message;
    检测用户账号的登录状态,若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;以及Detecting the login status of the user account, and if detecting that the user account is logged in at the mobile terminal, transmitting the parsed message to the mobile terminal;
    若检测到用户账号在PC端登录,则将经过解析后的消息发送给PC端。If the user account is detected to log in on the PC, the parsed message is sent to the PC.
  2. 根据权利要求1所述的多终端消息同步方法,其特征在于,所述方法进一步包括:The multi-terminal message synchronization method according to claim 1, wherein the method further comprises:
    若检测到用户账号未在移动终端登录,则检测用户账号是否在PC端登录,若是,则将消息发送至PC端。If it is detected that the user account is not logged in at the mobile terminal, it is detected whether the user account is logged in on the PC, and if so, the message is sent to the PC.
  3. 根据权利要求2所述的多终端消息同步方法,其特征在于,在若检测到用户账号未在移动终端登录,则检测用户账号是否在PC端登录的步骤之后,所述方法进一步包括:The multi-terminal message synchronization method according to claim 2, wherein, after detecting that the user account is not logged in at the mobile terminal, and detecting whether the user account is logged in at the PC, the method further comprises:
    若检测到用户账号未在PC端登录,则将经过解析的消息进行存储。If it is detected that the user account is not logged in on the PC, the parsed message is stored.
  4. 根据权利要求3所述的多终端消息同步方法,其特征在于,在将经过解析的消息进行存储的步骤之后,所述方法进一步包括:The multi-terminal message synchronization method according to claim 3, wherein after the step of storing the parsed message, the method further comprises:
    若检测到用户账号在移动终端登录,则将存储的消息发送至移动终端。If it is detected that the user account is logged in at the mobile terminal, the stored message is sent to the mobile terminal.
  5. 根据权利要求3所述的多终端消息同步方法,其特征在于,在将经过解析的消息进行存储的步骤之后,所述方法进一步包括:The multi-terminal message synchronization method according to claim 3, wherein after the step of storing the parsed message, the method further comprises:
    若检测到用户账号在PC端登录,则将存储的消息发送至PC端。If it is detected that the user account is logged in on the PC, the stored message is sent to the PC.
  6. 根据权利要求1所述的多终端消息同步方法,其特征在于,所述方法进一步包括:若检测到用户账号未在PC端登录,则将经过解析的消息进行存储。The multi-terminal message synchronization method according to claim 1, wherein the method further comprises: if it is detected that the user account is not logged in at the PC, storing the parsed message.
  7. 根据权利要求6所述的多终端消息同步方法,其特征在于,在若检测到用户账号未在PC端登录,则将经过解析的消息进行存储的步骤之后,所述方法进一步包括:The multi-terminal message synchronization method according to claim 6, wherein after the step of storing the parsed message after detecting that the user account is not logged in at the PC, the method further comprises:
    若检测到用户账号在PC端登录,则将存储的消息发送至PC端。If it is detected that the user account is logged in on the PC, the stored message is sent to the PC.
  8. 一种计算机处理设备,包括处理器及计算机可读存储介质,其特征在于,所述处理器获取所述计算机可读存储介质上的计算机程序,并执行如权利要求1-7任一所述方法的步骤。A computer processing apparatus comprising a processor and a computer readable storage medium, wherein the processor acquires a computer program on the computer readable storage medium and performs the method of any of claims 1-7 A step of.
  9. 一种服务器,其特征在于,包括:A server, comprising:
    获取模块,用于获取消息,并对获取的消息进行解析; Obtaining a module, which is used to obtain a message and parse the obtained message;
    处理发送模块,用于若检测到用户账号在移动终端登录,则将经过解析后的消息发送给移动终端;若检测到用户账号在PC端登录,则将经过解析后的消息发送给PC端。The processing sending module is configured to: if the user account is detected to log in to the mobile terminal, send the parsed message to the mobile terminal; if the user account is detected to log in to the PC, the parsed message is sent to the PC.
  10. 一种多终端消息同步系统,其特征在于,包括移动终端、PC端和如权利要求9所述的服务器,所述服务器与移动终端通讯连接,所述服务器与所述PC端通讯连接,所述服务器用户接收消息,并向所述移动终端或/和PC端发送经过解析后的消息。 A multi-terminal message synchronization system, comprising: a mobile terminal, a PC end, and the server according to claim 9, wherein the server is in communication connection with the mobile terminal, and the server is in communication connection with the PC end, The server user receives the message and sends the parsed message to the mobile terminal or/and the PC.
PCT/CN2017/095591 2017-08-02 2017-08-02 Multi-terminal message synchronization method and system, server and computer processing device WO2019023972A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780093116.6A CN111095889A (en) 2017-08-02 2017-08-02 Multi-terminal message synchronization method, system, server and computer processing equipment
PCT/CN2017/095591 WO2019023972A1 (en) 2017-08-02 2017-08-02 Multi-terminal message synchronization method and system, server and computer processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/095591 WO2019023972A1 (en) 2017-08-02 2017-08-02 Multi-terminal message synchronization method and system, server and computer processing device

Publications (1)

Publication Number Publication Date
WO2019023972A1 true WO2019023972A1 (en) 2019-02-07

Family

ID=65232244

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/095591 WO2019023972A1 (en) 2017-08-02 2017-08-02 Multi-terminal message synchronization method and system, server and computer processing device

Country Status (2)

Country Link
CN (1) CN111095889A (en)
WO (1) WO2019023972A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112564953A (en) * 2020-11-30 2021-03-26 瑞斯康达科技发展股份有限公司 Method, device and equipment for managing remote equipment of office
CN112929113A (en) * 2021-01-29 2021-06-08 掌握主动科技(北京)有限公司 Emergency broadcasting system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404327A (en) * 2011-11-24 2012-04-04 中国联合网络通信集团有限公司 Method, device and system for updating synchronization
US20130339477A1 (en) * 2012-06-19 2013-12-19 Loment, Inc. Delivery control for http communications among multiple end user communication devices
CN105407086A (en) * 2015-10-28 2016-03-16 腾讯科技(深圳)有限公司 Temporary authorization method, client and server
CN105871785A (en) * 2015-01-22 2016-08-17 阿里巴巴集团控股有限公司 Service processing method, device and system
CN106254560A (en) * 2016-10-12 2016-12-21 腾讯科技(北京)有限公司 Information transferring method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272358B (en) * 2008-05-05 2010-09-22 中国移动通信集团公司 Method, device and system for showing user group communication ability in instant communication
CN102025648B (en) * 2009-09-16 2014-12-03 腾讯科技(深圳)有限公司 Instant messaging method and server
CN102546640B (en) * 2012-01-13 2017-03-01 百度在线网络技术(北京)有限公司 Information flow method when the many equipment of single account logs in and server
CN104022938A (en) * 2013-02-28 2014-09-03 腾讯科技(深圳)有限公司 Message synchronization method, system, server and client end
CN108632130B (en) * 2017-03-16 2021-04-30 北京京东尚科信息技术有限公司 Method and device for multi-terminal chat input transfer, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404327A (en) * 2011-11-24 2012-04-04 中国联合网络通信集团有限公司 Method, device and system for updating synchronization
US20130339477A1 (en) * 2012-06-19 2013-12-19 Loment, Inc. Delivery control for http communications among multiple end user communication devices
CN105871785A (en) * 2015-01-22 2016-08-17 阿里巴巴集团控股有限公司 Service processing method, device and system
CN105407086A (en) * 2015-10-28 2016-03-16 腾讯科技(深圳)有限公司 Temporary authorization method, client and server
CN106254560A (en) * 2016-10-12 2016-12-21 腾讯科技(北京)有限公司 Information transferring method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112564953A (en) * 2020-11-30 2021-03-26 瑞斯康达科技发展股份有限公司 Method, device and equipment for managing remote equipment of office
CN112564953B (en) * 2020-11-30 2023-04-07 瑞斯康达科技发展股份有限公司 Method, device and equipment for managing remote equipment of office
CN112929113A (en) * 2021-01-29 2021-06-08 掌握主动科技(北京)有限公司 Emergency broadcasting system
CN112929113B (en) * 2021-01-29 2023-04-11 掌握主动科技(北京)有限公司 Emergency broadcasting system

Also Published As

Publication number Publication date
CN111095889A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN105915436B (en) System and method for topic-based instant message isolation
US7953803B2 (en) Multiple login instant messaging
CN104246802B (en) cross-platform message transmission
US9166822B2 (en) Transmission of instant messages according to availability
KR101979535B1 (en) Voice chat mode self adaptation method and device
US20100235758A1 (en) Method, System and Apparatus for Sorting Topics within a Group
US9760865B2 (en) Multi-modal transcript unification in a collaborative environment
CN109067910A (en) A kind of method and device that message pulls
WO2011144167A1 (en) Method, device and system for instant messaging
US20090177743A1 (en) Device, Method and Computer Program Product for Cluster Based Conferencing
US9686214B2 (en) Status and time-based delivery services for instant messengers
US11283725B2 (en) Event content delivery
US20060020677A1 (en) Providing sender-specific notifications of received e-mail messages
US10243895B2 (en) Method of and system for processing an electronic message destined for an electronic device
US9998885B2 (en) Method of and system for processing an electronic message destined for an electronic device
WO2019023972A1 (en) Multi-terminal message synchronization method and system, server and computer processing device
US7853659B2 (en) Method for presenting personalized, voice printed messages from online digital devices to hosted services
US10063648B2 (en) Relaying mobile communications
US20100226486A1 (en) Method of informing a teleconference participant that a person-of-interest has become active within the teleconference
CN103312592B (en) A kind of method that batch sends information to instant communication client on webpage
KR20070075637A (en) Messenger sevice system and method for transmission by subscription of file
JPWO2021148682A5 (en)
CN112217648B (en) Method and related device for group sending of messages
CN108574621A (en) A method of it is interacted in video monitoring
JP6494493B2 (en) Message management system, message management method and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17920026

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17920026

Country of ref document: EP

Kind code of ref document: A1