CN111740897B - Method for information processing, electronic device, and storage medium - Google Patents

Method for information processing, electronic device, and storage medium Download PDF

Info

Publication number
CN111740897B
CN111740897B CN202010781511.7A CN202010781511A CN111740897B CN 111740897 B CN111740897 B CN 111740897B CN 202010781511 A CN202010781511 A CN 202010781511A CN 111740897 B CN111740897 B CN 111740897B
Authority
CN
China
Prior art keywords
message
terminal device
group
received
sending
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.)
Active
Application number
CN202010781511.7A
Other languages
Chinese (zh)
Other versions
CN111740897A (en
Inventor
严东东
孙金帅
吴宗波
鲁玉成
卢文俊
周南南
邹康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Zhongdan Information Technology Co ltd
Original Assignee
Shanghai Zhongdan Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhongdan Information Technology Co ltd filed Critical Shanghai Zhongdan Information Technology Co ltd
Priority to CN202010781511.7A priority Critical patent/CN111740897B/en
Publication of CN111740897A publication Critical patent/CN111740897A/en
Application granted granted Critical
Publication of CN111740897B publication Critical patent/CN111740897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/19Connection re-establishment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/25Maintenance of established connections

Abstract

Embodiments of the present disclosure relate to a method, apparatus, and storage medium for information processing, and relate to the field of information processing. According to the method, if it is determined that a first message destined for a first group is received from a first terminal device, it is determined whether a type of the first group is a first type; if so, then: adding a first message in a send message queue associated with a first terminal device; and if a message reading request from the second terminal equipment is received, acquiring a first message from the message sending queue; if the determination is not yes, then: adding a first message in a received message queue associated with a second terminal device; and if a message reading request from the second terminal equipment is received, acquiring a first message from the message receiving queue; and sending a second message to the second terminal device based on the first message. Therefore, whether read diffusion or write diffusion is performed can be determined based on the message type, so that efficient message transfer is guaranteed for different scenes.

Description

Method for information processing, electronic device, and storage medium
Technical Field
Embodiments of the present disclosure relate generally to the field of information processing, and more particularly, to a method, an electronic device, and a computer storage medium for information processing.
Background
With the development of technology, instant messaging is becoming more and more popular in various services such as e-commerce. Traditional instant messaging tends to rely more on the underlying TCP protocol to ensure messaging. However, the conventional scheme does not consider the requirements of the service level on message transmission, and it is often difficult to implement timely and accurate delivery of messages. In addition, as the group chat becomes more common and the number of people increases, how to efficiently process the group chat related messages is also an important issue facing the present.
Disclosure of Invention
The method, the electronic equipment and the computer storage medium for information processing are provided, and can operate according to read diffusion under the condition that a group type targeted by a message is ultra-large group chat, so that a large amount of write operations under the condition of ultra-large group chat are avoided, and the efficiency of message processing is improved. In addition, after the retransmission to the terminal equipment is unsuccessful for the preset times, the terminal equipment is reconnected in time and carries out message synchronization through the offline synchronization message.
According to a first aspect of the present disclosure, a method for information processing is provided. The method comprises the following steps: determining whether a type of a first group is a first type if it is determined that a first message originating from the first terminal device, destined to the first group, and including first content is received from the first terminal device; if it is determined that the type of the first group is the first type: adding a first message in a send message queue associated with a first terminal device; sending a notification about the read message to a second terminal device, the second terminal device being associated with the first group; if the message reading request from the second terminal equipment is determined to be received, acquiring a first message from the message sending queue; if it is determined that the type of the first message is not the first type: adding a first message in a received message queue associated with a second terminal device; and if it is determined that a message reading request from the second terminal device is received, acquiring the first message from a received message queue; adding, based on the obtained first message, a second message that originates from the first terminal device, is destined for a first group, and includes the first content, in a retransmission priority queue associated with a second terminal device; sending a second message to the second terminal equipment; if it is determined that an acknowledgement message for the second message from the second terminal device has not been received within a predetermined time interval after the second message is transmitted, determining whether the number of times of transmitting the second message reaches a predetermined number of times; if the number of times of sending the second message reaches the preset number of times, connection is reestablished with the second terminal equipment; and sending an offline synchronization message to the second terminal device via the re-established connection, the offline synchronization message including the second message.
According to a second aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
In a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements a method according to the first aspect of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements.
FIG. 1 is a schematic diagram of an information handling environment 100 according to an embodiment of the present disclosure.
Fig. 2 is a schematic diagram of a method 200 for information processing, according to an embodiment of the present disclosure.
Fig. 3 is a schematic diagram of a method 300 for adding a second message in a retransmission priority queue according to an embodiment of the present disclosure.
Fig. 4 is a schematic diagram of a method 400 for reestablishing a connection with a second terminal device according to an embodiment of the present disclosure.
Fig. 5 is a flow diagram of message interaction in accordance with an embodiment of the present disclosure.
Fig. 6 is a block diagram of an electronic device used to implement the method for information processing of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The term "include" and variations thereof as used herein is meant to be inclusive in an open-ended manner, i.e., "including but not limited to". Unless specifically stated otherwise, the term "or" means "and/or". The term "based on" means "based at least in part on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first," "second," and the like may refer to different or the same object. Other explicit and implicit definitions are also possible below.
As described above, the conventional scheme does not consider the requirements of the service level on message transmission, and it is often difficult to achieve timely and accurate delivery of messages. Specifically, the conventional scheme relies on a retransmission mechanism of TCP to ensure reliable message delivery, but the service level may have different requirements for retransmission times, time delay, and the like, and the retransmission mechanism of TCP cannot meet the requirements of various service levels and cannot meet the reliable message delivery of the service level. In addition, as the group chat becomes more common and the number of people increases, how to efficiently process the group chat related messages is also an important issue facing the present.
To address, at least in part, one or more of the above issues and other potential issues, an example embodiment of the present disclosure proposes a scheme for information processing. In the scheme, if it is determined that a first message which originates from a first terminal device, is destined to a first group, and includes first content is received from the first terminal device, it is determined whether a type of the first group is a first type; if it is determined that the type of the first group is the first type: adding a first message in a send message queue associated with a first terminal device; sending a notification about the read message to a second terminal device, the second terminal device being associated with the first group; if the message reading request from the second terminal equipment is determined to be received, acquiring a first message from the message sending queue; if it is determined that the type of the first message is not the first type: adding a first message in a received message queue associated with a second terminal device; and if it is determined that a message reading request from the second terminal device is received, acquiring the first message from a received message queue; adding, based on the obtained first message, a second message that originates from the first terminal device, is destined for a first group, and includes the first content, in a retransmission priority queue associated with a second terminal device; sending a second message to the second terminal equipment; if it is determined that an acknowledgement message for the second message from the second terminal device has not been received within a predetermined time interval after the second message is transmitted, determining whether the number of times of transmitting the second message reaches a predetermined number of times; if the number of times of sending the second message reaches the preset number of times, connection is reestablished with the second terminal equipment; and sending an offline synchronization message to the second terminal device via the re-established connection, the offline synchronization message including the second message.
Therefore, the operation can be carried out according to the read diffusion under the condition that the group type aimed at by the message is the super-large group chat, a large amount of write operations under the super-large group chat condition are avoided, and the message processing efficiency is improved. In addition, after the retransmission to the terminal equipment is unsuccessful for the preset times, the terminal equipment can be reconnected in time and can carry out message synchronization through the offline synchronization message.
Hereinafter, specific examples of the present scheme will be described in more detail with reference to the accompanying drawings.
FIG. 1 shows a schematic diagram of an example of an information processing environment 100, according to an embodiment of the present disclosure. The information processing environment 100 may include a server 110, a first terminal device 120, and a plurality of second terminal devices 130-1, 130-2, and 130-3 (collectively 130). It should be understood that although 3 second terminal devices are shown in fig. 1, this is for illustration only and the number of second terminal devices 130 may be greater or less. The first terminal device 120 and the second terminal device 130 may be associated with a first group. The first group includes, for example, but is not limited to, an instant messaging group.
The server 110 includes, for example, but is not limited to, a server computer, a multiprocessor system, a mainframe computer, a distributed computing environment including any of the above systems or devices, and the like. In some embodiments, the server 110 may have one or more processing units, including special purpose processing units such as image processing units GPU, field programmable gate arrays FPGA, and application specific integrated circuits ASIC, and general purpose processing units such as central processing units CPU.
The first terminal device 120 and the second terminal device 130 include, for example, but are not limited to, personal computers, desktop computers, laptop computers, tablet computers, smart phones, personal digital assistants, wearable devices, and the like.
The server 110 is configured to determine whether a type of a first group is a first type if it is determined that a first message originating from the first terminal device, destined for the first group, and including first content is received from the first terminal device; if it is determined that the type of the first group is the first type: adding a first message in a send message queue associated with a first terminal device; sending a notification about the read message to a second terminal device, the second terminal device being associated with the first group; if the message reading request from the second terminal equipment is determined to be received, acquiring a first message from the message sending queue; if it is determined that the type of the first message is not the first type: adding a first message in a received message queue associated with a second terminal device; and if it is determined that a message reading request from the second terminal device is received, acquiring the first message from a received message queue; adding, based on the obtained first message, a second message that originates from the first terminal device, is destined for a first group, and includes the first content, in a retransmission priority queue associated with a second terminal device; sending a second message to the second terminal equipment; if it is determined that an acknowledgement message for the second message from the second terminal device has not been received within a predetermined time interval after the second message is transmitted, determining whether the number of times of transmitting the second message reaches a predetermined number of times; if the number of times of sending the second message reaches the preset number of times, connection is reestablished with the second terminal equipment; and sending an offline synchronization message to the second terminal device via the re-established connection, the offline synchronization message including the second message.
Fig. 2 shows a flow diagram of a method 200 for information processing according to an embodiment of the present disclosure. For example, the method 200 may be performed by the server 110 as shown in FIG. 1. It should be understood that method 200 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the present disclosure is not limited in this respect.
At block 202, the server 110 determines whether a first message is received from the first terminal device 120 that originates from the first terminal device 120, is destined for a first group, and includes first content. The first message includes, for example, but is not limited to, a Submit message, such as Submit (from: "first terminal device", to: "first group", payload: { "type": 0, "content": 123 "). The first message may include a header and a data payload. The header may include a message type identifier of a predetermined length and a remaining length field encoded with a variable length. The remaining length field is used to indicate the length of the data payload, which includes the first content. The format of the message will be described in detail below.
If the server 110 determines at block 202 that a first message is received from the first terminal device 120 that originated from the first terminal device 120, is destined for a first group, and includes first content, then at block 204 it is determined whether the type of the first group is a first type. For example, the server 110 may store type information of the first group. The type of the first group includes, for example, but is not limited to, super group chat, normal group chat, and the like. A super group chat is, for example, a group chat in which the number of group members exceeds a predetermined number, such as, but not limited to, 500, 1000, etc., and a normal group chat is, for example, a group chat in which the number of group members is less than or equal to the predetermined number. The first type may be, for example, very large group chat. In some embodiments, it may be determined whether the type of the first group is the first type based on whether the number of members of the first group exceeds a predetermined number. For example, server 110 may store information such as the number of members associated with the first group, which is of the first type if the number of members of the first group exceeds a predetermined number, and which is not of the first type otherwise.
If the server 110 determines at block 204 that the type of the first group is the first type, then at block 206, the first message is added to a send message queue associated with the first terminal device 120.
At block 208, the server 110 sends a notification to the second terminal device 130 regarding the read message. The second terminal device 130 is associated with the first group.
At block 210, the server 110 determines whether a message read request from the second terminal device 130 is received.
If the server 110 determines at block 210 that a message read request from the second terminal device 130 is received, then at block 212 a first message is retrieved from a send message queue associated with the first terminal device 120.
If the server 110 determines at block 204 that the type of the first group is not the first type, then at block 214 the first message is added to a receive message queue associated with the second terminal device 130.
The server 110 determines whether a message read request from the second terminal device 130 is received at block 216.
If the server 110 determines at block 216 that a message read request from the second end device 130 is received, the first message is retrieved from a receive message queue associated with the second end device 130 at block 218.
At block 220, the server 110 adds, based on the obtained first message, a second message originating from the first terminal device 120, destined for a first group and comprising first content in a retransmission priority queue associated with the second terminal device 130. The second message includes, for example, but is not limited to, a Deliver message, such as Deliver (from: "first terminal device", to: "first group", payload { "type": 0, "content": 123 "}, sessionID:" first group ", sequence: 1).
At block 222, the server 110 sends a second message to the second terminal device 130.
At block 224, the server 110 determines whether an acknowledgement message for the second message from the second terminal device 130 has not been received within a predetermined time interval after the second message was sent. The predetermined time interval includes, for example, but is not limited to, 1, 1.5, 2 seconds, etc. The acknowledgement message includes, for example, but is not limited to, a submittack, such as submittack (sessionID: "first group", sequence: 1).
If the server 110 determines at block 224 that an acknowledgement message for the second message has not been received from the second terminal device 130 within a predetermined time interval after the second message is sent, it is determined at block 226 whether the number of times the second message was sent has reached a predetermined number of times. The predetermined number of times includes, for example, but is not limited to, 3, 4, 5 times.
If the server 110 determines at block 226 that the number of times the second message is sent reaches the predetermined number of times, at block 228, the connection is reestablished with the second terminal device 130. The method of re-establishing a connection with the second terminal device 130 will be described in detail below with reference to fig. 3.
If the server 110 determines at block 226 that the number of times the second message was sent has not reached the predetermined number of times, the server 110 may return to block 222 to send the second message to the second terminal device 130.
At block 230, the server 110 sends an offline synchronization message to the second terminal device 130 via the re-established connection, the offline synchronization message including the second message. Offline synchronization messages include, for example, but are not limited to, a Sync message, such as Sync (sessionID: "first group", drivers: [ Deliver (from: "first terminal device", to: "first group", payload: { "type": 0, "content": 123 "}, sessionID:" first group ", sequence: 1) ].
Therefore, when the group type of the message is the ultra-large group chat, the message can be written into the sending queue of the sending party and read (namely read diffusion) from the sending queue of the sending party when the receiving party reads the message, and then the message is sent, so that a large amount of writing operation under the ultra-large group chat is avoided, and the message processing efficiency is improved. In addition, after the retransmission to the terminal equipment is unsuccessful for the preset times, the terminal equipment can be reconnected in time and can carry out message synchronization through the offline synchronization message.
In some embodiments, the server 110 deletes the second message from the retransmission priority queue if it determines that the acknowledgment message is received within a predetermined time interval after sending the second message. Thus, the second message does not need to be retransmitted in case an acknowledgement is received.
Alternatively or additionally, in some embodiments, the server 110 may also determine whether an offline synchronization confirmation message for the offline synchronization message is received from the second terminal device 130. The offline synchronization confirmation message includes, for example, but is not limited to, a SyncAck message, such as SyncAck (sessionID: "first group"). If it is determined that the offline synchronization confirmation message for the offline synchronization message is received from the second terminal device 130, an offline synchronization completion message is transmitted to the second terminal device 130. The offline synchronization complete message includes, for example, but is not limited to, a connecticfm message. Therefore, after receiving the offline synchronization confirmation message, the terminal device is made aware of the completion of offline synchronization through the completion message.
Fig. 3 shows a flow diagram of a method 300 for adding a second message in a retransmission priority queue according to an embodiment of the present disclosure. For example, the method 300 may be performed by the server 110 as shown in FIG. 1. It should be understood that method 300 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the disclosure is not limited in this respect.
At block 302, the server 110 determines whether the size of the retransmission priority queue is less than the size of the receive window associated with the second terminal device 130. Receive window sizes include, for example, but are not limited to, 80, 100, 120, etc. The receive window size is for example received included in the connection request from the second terminal device 130.
If the server 110 determines at block 302 that the size of the retransmission priority queue is less than the receive window size, a second message is added to the retransmission priority queue at block 304.
Therefore, the message loss caused by the fact that the second terminal device receives the messages exceeding the size of the receiving window can be avoided by controlling the number of the messages in the retransmission priority queue not to exceed the size of the receiving window of the second terminal device.
Fig. 4 shows a flow diagram of a method 400 for re-establishing a connection with a second terminal device 130 according to an embodiment of the present disclosure. For example, the method 400 may be performed by the server 110 as shown in FIG. 1. It should be understood that method 400 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the disclosure is not limited in this respect.
At block 402, the server 110 sends a disconnect request to the second terminal device 130. The DISCONNECT request includes, for example, but is not limited to, a DISCONNECT message.
At block 404, the server 110 receives a connection request from the second terminal device 130, the connection request indicating a keep-alive duration. The keep-alive period includes, for example, but is not limited to, 200, 240, 280 seconds. The connection request is, for example, connect { keepalive:240 }.
At block 406, the server 110 sets a message timeout duration associated with the second terminal device 130 based on the keep-alive duration. In some embodiments, the message timeout duration is set, for example, to a keep-alive duration x factor, including, for example, but not limited to 3/2.
At block 408, the server 110 sends a connection confirmation message to the second terminal device 130 to reestablish the connection. The connection confirmation message includes, for example, but is not limited to, a CONNACK message.
Therefore, the keep-alive time length can be specified when the connection is reestablished, the server is prevented from maintaining the connection of the inactive terminal for a long time, and Nat overtime in various operator network environments is resisted.
In some embodiments, the server 110 and the second terminal device 130 may send heartbeat messages, such as PINGREQ, PINGRESP, to each other to remain active. For example, the second terminal device 130 may send a PING message to the server 110 every 2/3 × keep alive duration. In some embodiments, the server 110 may also determine whether a message from the second terminal device 130 was not received within a message timeout period after the last message from the second terminal device 130 was received. If the server 110 determines that the message from the second terminal device 130 is not received within the message timeout period after the message from the second terminal device 130 was received last time, the connection with the second terminal device 130 is released.
Therefore, the connection with the terminal equipment can be released in time when the message of the terminal equipment is not received within the message overtime length, the phenomenon that an inactive terminal occupies connection resources for a long time is avoided, and Nat overtime under various operator network environments is resisted.
The message interaction between the server 110 and the first terminal device 120 and the second terminal device 130 will be described below with reference to fig. 5.
As shown in FIG. 5, the first terminal device 120 sends a first message, such as Submit (from: first terminal device, to: first group, payload: "123"), originating from the first terminal device, destined to a first group, and including first content to the server 110 (501). Subsequently, the server 110 returns an acknowledgement message for the first message, e.g. submittack (sessionID: first group, sequence: 1), to the first terminal device 120 (502).
The server 110 adds a second message (503) in the retransmission priority queue associated with the second end device 130 that is the first end device in origin, is the first group in destination, and includes the first content, such as Deliver (from: "first end device", to: "first group", payload: { "type": 0, "content": "123", sessionID: "first group", sequence: 1), wherein the second end device 130 is associated with the first group. The server 110 then sends a second message to the second terminal device 130 (504).
After transmitting the second message, the server 110 determines whether an acknowledgement message for the second message, e.g. a DeliverAck, is received from the second terminal device 130 within a predetermined time interval (505). If the server 110 determines that the acknowledgment message has not been received within the predetermined time interval, the server 110 determines whether the number of times the second message was sent has reached a predetermined number of times (506). If the server 110 determines that the number of times of transmitting the second message does not reach the predetermined number of times, the server 110 transmits the second message to the second terminal device 130 again (507).
Subsequently, the server 110 determines again whether an acknowledgement message for the second message is received from the second terminal device 130 within a predetermined time interval (508). If the server 110 determines that the acknowledgment message has not been received within the predetermined time interval, the server 110 determines whether the number of times the second message is transmitted reaches a predetermined number of times (509). If the server 110 determines that the number of times the second message is transmitted reaches the predetermined number of times, the server 110 transmits a disconnection request to the second terminal device 130 (510).
Next, the server 110 receives a connection request from the second terminal device 130 (511), the connection request indicating a keep-alive duration. The server 110 sets 512 a message timeout duration associated with the second end device 130 based on the keep-alive duration. After that, the server 110 sends a connection confirmation message to the second terminal device 130 (513) in order to reestablish the connection.
The server 110 then sends 514 an offline synchronization message to the second end device 130 via the re-established connection, the offline synchronization message including a second message, such as Sync (sessionID: "first group", sources: [ Deliver (from: "first end device", to: "first group", payload { "type": 0, "content": 123 "}, sessionID:" first group ", sequence: 1) ]. The second terminal device 130 returns an offline synchronization confirmation message to the server 110 (515), and the server 110 sends an offline synchronization completion message to the second terminal device 130 (516).
The specific format that the messages described herein may take will be described below.
The message herein may be in the format of a header plus a data payload. For some messages, a header and a data payload may be included, and for other messages, only a header may be included.
The header may include 2 to 7 bytes, the 1 st byte may be used to indicate the type of message, and the 2 nd to 5 th bytes may be used to indicate the remaining length.
The 1 st byte may be divided into upper 4 bits and lower 4 bits, which may be used to indicate the type of message, respectively. In some embodiments, the type of the message may be represented by the upper 4 bits, and the extended message type may be represented by the 4 th bit when the message type needs to be extended, or vice versa. Thereby allowing for a continuous extension of message types. In some embodiments, the types of messages may include, but are not limited to, the following types:
table 1:
Figure 693371DEST_PATH_IMAGE001
the remaining length indicates the number of bytes of the remaining portion of the message, including the variable header and payload data. The remaining length does not include the number of bytes used to encode the remaining length field itself.
The remaining length field may use a variable length coding scheme. For values less than 128, single byte coding may be used. Larger values are handled in the following way: the lower 7 significant bits are used to encode data and the most significant bit is used to indicate whether there are more bytes. Each byte can therefore encode 128 values and a continuation bit. In some embodiments, the remaining length field may include 4 bytes at maximum.
For example, a decimal number of 64 would be encoded as one byte, with a value of 64, and a hexadecimal representation of 0x 40. The decimal number 321(=65+2 × 128) is encoded in two bytes with the least significant bit preceding. The first byte is 65+128= 193. Note that the most significant bit of 1 indicates that at least one more byte follows. The second byte is 2.
This allows messages of up to 256MB (268,435,455) size to be sent. The representation of this value in the message is: 0xFF,0x 7F.
Table 2 shows that the value represented by the remaining length field grows with byte.
Table 2:
Figure 548195DEST_PATH_IMAGE002
for some messages, a data payload may be included in the last portion of the message, such as shown in the following table:
table 3:
Figure 265615DEST_PATH_IMAGE003
in some embodiments, the data payload may be encoded using protobuf, such as protobuf 3.
This format of the message thus has the following advantages: the header is simplified, the heartbeat message is only 2 bytes, and the method is friendly to natural support in an online connection scene; the message type extension can reach 256; the message body serialization/deserialization performance is high; the message body is forward compatible, so that the expansion is convenient; comparing XMPP protocol: the protocol is simpler, the transmission bandwidth is saved, and the stability is improved; comparing with MQTT protocol: the simpler the protocol the user has more control.
Fig. 6 illustrates a schematic block diagram of an example device 600 that can be used to implement embodiments of the present disclosure. For example, the server 110 as shown in FIG. 1 may be implemented by the device 600. As shown, device 600 includes a Central Processing Unit (CPU) 601 that may perform various appropriate actions and processes in accordance with computer program instructions stored in a Read Only Memory (ROM) 602 or loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, a microphone, and the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The various processes and processes described above, such as the method 200-400, may be performed by the processing unit 601. For example, in some embodiments, the method 200-400 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into RAM 603 and executed by CPU 601, one or more of the acts of method 200 and 400 described above may be performed.
The present disclosure relates to methods, apparatuses, systems, electronic devices, computer-readable storage media and/or computer program products. The computer program product may include computer-readable program instructions for performing various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (7)

1. A method for information processing, comprising:
in response to determining that a first message is received from a first terminal device that originates from the first terminal device, that is destined for a first group, and that includes first content, determining whether a type of the first group is a first type;
if it is determined that the type of the first group is the first type, then:
adding the first message in a send message queue associated with the first terminal device;
sending a notification regarding a read message to a second terminal device, the second terminal device associated with the first group; and
in response to receiving a message reading request from the second terminal device, obtaining the first message from the message sending queue;
if it is determined that the type of the first group is not the first type:
adding a first message in a received message queue associated with a second terminal device; and
in response to receiving the message reading request from the second terminal device, obtaining the first message from the received message queue;
based on the acquired first message, adding a second message that originates from the first terminal device, is destined for the first group, and includes the first content in a retransmission priority queue associated with a second terminal device;
sending the second message to the second terminal device;
determining whether the number of times of sending the second message reaches a predetermined number of times in response to determining that an acknowledgement message for the second message from the second terminal device has not been received within a predetermined time interval after sending the second message;
in response to determining that the number of times the second message is sent reaches the predetermined number of times, reestablishing a connection with the second terminal device; and
sending an offline synchronization message to the second terminal device via the reestablished connection, the offline synchronization message including the second message;
wherein reestablishing the connection with the second terminal device comprises:
sending a disconnection request to the second terminal equipment;
receiving a connection request from the second terminal device, wherein the connection request indicates a keep-alive duration;
setting a message timeout duration associated with the second terminal device based on the keep-alive duration; and
sending a connection confirmation message to the second terminal device to reestablish the connection; and
the method further comprises releasing the connection in response to determining that no message from the second terminal device was received within the message timeout period after the last receipt of a message from the second terminal device.
2. The method of claim 1, wherein adding the second message in the retransmission priority queue comprises:
determining whether a size of the retransmission priority queue is less than a receive window size associated with the second terminal device; and
in response to determining that the size of the retransmission priority queue is less than the receive window size, adding the second message in the retransmission priority queue.
3. The method of claim 1, further comprising:
deleting the second message from the retransmission priority queue in response to determining that the acknowledgment message was received within the predetermined time interval after sending the second message.
4. The method of claim 1, further comprising:
in response to determining that an offline synchronization confirmation message for the offline synchronization message is received from the second terminal device, sending an offline synchronization completion message to the second terminal device.
5. The method of claim 1, wherein the first message comprises a header and a data payload, the header comprising a message type identifier of a predetermined length and a remaining length field encoded with a variable length, the remaining length field for indicating a length of the data payload, the data payload comprising the first content.
6. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
7. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202010781511.7A 2020-08-06 2020-08-06 Method for information processing, electronic device, and storage medium Active CN111740897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010781511.7A CN111740897B (en) 2020-08-06 2020-08-06 Method for information processing, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010781511.7A CN111740897B (en) 2020-08-06 2020-08-06 Method for information processing, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN111740897A CN111740897A (en) 2020-10-02
CN111740897B true CN111740897B (en) 2020-11-27

Family

ID=72658154

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010781511.7A Active CN111740897B (en) 2020-08-06 2020-08-06 Method for information processing, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN111740897B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114205055A (en) * 2021-12-13 2022-03-18 北京恒安嘉新安全技术有限公司 Data transmission method, device, equipment and storage medium
CN115102912B (en) * 2022-07-28 2023-08-08 北京云中融信网络科技有限公司 Method, device and system for distributing and controlling speed of network group message

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177363A (en) * 2019-12-30 2020-05-19 广州市百果园网络科技有限公司 Group message writing method, device, server and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2003295785A1 (en) * 2002-11-22 2004-06-18 Intellisist Llc System and method for providing multi-party message-based voice communications
CN106487666A (en) * 2016-12-21 2017-03-08 北京奇虎科技有限公司 A kind of instant messaging sending method, control method, transmitting terminal and receiving terminal
CN111147348B (en) * 2018-11-06 2021-08-20 腾讯科技(深圳)有限公司 Instant message sending method, device and readable medium
CN110727507B (en) * 2019-10-21 2022-09-09 广州欢聊网络科技有限公司 Message processing method and device, computer equipment and storage medium
CN111083037B (en) * 2019-10-22 2022-02-01 贝壳技术有限公司 Method, device, medium and electronic equipment for realizing instant messaging

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177363A (en) * 2019-12-30 2020-05-19 广州市百果园网络科技有限公司 Group message writing method, device, server and storage medium

Also Published As

Publication number Publication date
CN111740897A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
US8478890B2 (en) System and method for reliable virtual bi-directional data stream communications with single socket point-to-multipoint capability
US8793384B2 (en) Recovery of disconnected channels over a reliable protocol
CN111740897B (en) Method for information processing, electronic device, and storage medium
WO2020207091A1 (en) Management client, and device monitoring system and method
JP5108778B2 (en) Voice instant messaging between mobile and computing devices
CN101547210A (en) Method and device for processing TCP connection
CN109922144B (en) Method and apparatus for processing data
CN113630465B (en) Message processing method, device, equipment and storage medium
JP2006178961A (en) Reliable one-way messaging by request-response transport protocol
CN103548315A (en) Method and apparatus for high performance low latency real time notification delivery
CN111385068B (en) Data transmission method, device, electronic equipment and communication system
US11444882B2 (en) Methods for dynamically controlling transmission control protocol push functionality and devices thereof
CN113810349B (en) Data transmission method, device, computer equipment and storage medium
EP3920035B1 (en) Message transmission/reception method, communication device, and program
JP4229807B2 (en) Data transfer method, TCP proxy device, and network system using the same
CN102904764A (en) Data transmission device and transmission method thereof
WO2021103822A1 (en) Method for acquiring common maximum segment size (mss), and device
CN110071925B (en) Data transmission method and corresponding server and computer readable storage medium
CN110753043B (en) Communication method, device, server and medium
US10742561B2 (en) Prevention of network retransmission timeout
US9584444B2 (en) Routing communication between computing platforms
CN105230074A (en) Video cache switching handling method, device and system
CN115086263B (en) IM message sending method, system, storage medium and computer equipment of IOS terminal
CN115484210B (en) Congestion window determining method, device and system
KR102184363B1 (en) Communicating method between host and client with network connector, and network connector proceeding the same

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