[go: up one dir, main page]

CN106844662A - The recording method of instant message read state and device - Google Patents

The recording method of instant message read state and device Download PDF

Info

Publication number
CN106844662A
CN106844662A CN201710051105.3A CN201710051105A CN106844662A CN 106844662 A CN106844662 A CN 106844662A CN 201710051105 A CN201710051105 A CN 201710051105A CN 106844662 A CN106844662 A CN 106844662A
Authority
CN
China
Prior art keywords
message
group
bitmap data
members
receiving end
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710051105.3A
Other languages
Chinese (zh)
Other versions
CN106844662B (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201710051105.3A priority Critical patent/CN106844662B/en
Publication of CN106844662A publication Critical patent/CN106844662A/en
Application granted granted Critical
Publication of CN106844662B publication Critical patent/CN106844662B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种即时消息阅读状态的记录方法及装置。其中方法包括:接收发送端向接收端发送的消息,为消息生成消息标识;根据接收端的记录生成第一位图数据,存储消息标识与第一位图数据;将消息发送给接收端;接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据;根据第二位图数据,向发送端返回消息的阅读状态。本发明利用位图记录每个接收端的阅读状态,将每个接收端的阅读状态的记录压缩为1bit,与现有技术至少占用16字节的一条记录相比,大大节省了数据存储空间,由此解决了给数据库带来巨大的数据写入压力及信息存储压力的问题。

The invention discloses a method and device for recording instant message reading status. The method includes: receiving the message sent by the sending end to the receiving end, and generating a message identifier for the message; generating the first bitmap data according to the record of the receiving end, storing the message identifier and the first bitmap data; sending the message to the receiving end; receiving According to the message reading notification returned by the terminal, the first bitmap data is modified according to the message reading notification to obtain the second bitmap data; according to the second bitmap data, the reading status of the message is returned to the sending terminal. The present invention uses a bitmap to record the reading state of each receiving end, and compresses the record of the reading state of each receiving end into 1 bit, which greatly saves data storage space compared with a record occupying at least 16 bytes in the prior art, thus It solves the problem of bringing huge data writing pressure and information storage pressure to the database.

Description

即时消息阅读状态的记录方法及装置Method and device for recording instant message reading state

技术领域technical field

本发明涉及通讯技术领域,具体涉及一种即时消息阅读状态的记录方法及装置。The invention relates to the technical field of communications, in particular to a method and device for recording instant message reading status.

背景技术Background technique

即时通讯(Instant messaging,简称IM)是一个终端服务,允许两人或多人使用网路即时的传递文字讯息、档案、语音与视频交流。即时通讯不同于e-mail,在于它的交谈是即时的,例如常用的QQ、YY语音、飞信等。在使用这些即时通讯应用进行通讯时,信息发送方需要了解信息接收方是否已阅读过信息,以防止重要信息被遗漏。Instant messaging (IM for short) is a terminal service that allows two or more people to use the Internet to transmit text messages, files, voice and video in real time. Instant messaging is different from e-mail in that its conversation is instant, such as commonly used QQ, YY voice, Fetion and so on. When using these instant messaging applications for communication, the information sender needs to know whether the information receiver has read the information, so as to prevent important information from being missed.

现有技术中即时消息阅读状态的记录方法主要分为以下两类:The methods for recording the reading status of instant messages in the prior art are mainly divided into the following two categories:

方法1、客户端记录方式。信息的每一个接收方阅读完消息后,通过服务端中转,通知信息发送方,此时发送方客户端在本地设备中增加记录,标识信息被谁阅读;Method 1. Client recording method. After each recipient of the information reads the message, it will relay through the server to notify the sender of the information. At this time, the client of the sender will add a record in the local device to identify who has read the information;

方法2、服务端记录方式。信息的每一个接收方阅读完信息后,通知服务端,此时服务端向数据库中插入一条记录,标识该条信息被谁阅读过。Method 2. Server-side recording method. After each receiver of the information reads the information, it notifies the server. At this time, the server inserts a record into the database to identify who has read the information.

在实现本发明实施例过程中,发明人发现现有技术中至少存在如下问题:In the process of implementing the embodiments of the present invention, the inventors found that there are at least the following problems in the prior art:

方法1的缺陷:客户端重装后,所有已读和未读信息将被清除;不同设备同一账户的已读和未读信息均不完整。Defect of method 1: After the client is reinstalled, all read and unread information will be cleared; the read and unread information of the same account on different devices are incomplete.

方法2的缺陷:信息接收人数非常多的时候,例如群聊天时,每条信息的接收人数可能几十甚至上千。每个人的阅读信息都向数据库中插入一条记录,一条记录至少需要存储一个阅读人员的用户标识和信息标识组成的记录元素{“user_id”:int64,“message_id”:int64},至少为16字节,随着接收人数的增多,将给数据库带来巨大的数据写入压力及信息存储压力。The defect of method 2: when there are a lot of message recipients, such as group chat, the number of recipients of each message may be dozens or even thousands. Each person's reading information inserts a record into the database, and a record needs to store at least one record element {"user_id":int64, "message_id":int64} consisting of the reader's user ID and message ID, at least 16 bytes , as the number of recipients increases, it will bring huge data writing pressure and information storage pressure to the database.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的即时消息阅读状态的记录装置和相应的即时消息阅读状态的记录方法。In view of the above problems, the present invention is proposed to provide an instant message reading state recording device and a corresponding instant message reading state recording method that overcome the above problems or at least partially solve the above problems.

根据本发明的一个方面,提供了一种即时消息阅读状态的记录方法,包括:According to one aspect of the present invention, a method for recording instant message reading status is provided, including:

接收发送端向接收端发送的消息,为消息生成消息标识;Receive the message sent from the sender to the receiver, and generate a message identifier for the message;

根据接收端的记录生成第一位图数据,存储消息标识与第一位图数据;Generate the first bitmap data according to the record of the receiving end, and store the message identifier and the first bitmap data;

将消息发送给接收端;send the message to the receiver;

接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据;Receive the message reading notification returned by the receiving end, modify the first bitmap data according to the message reading notification, and obtain the second bitmap data;

根据第二位图数据,向发送端返回消息的阅读状态。According to the second bitmap data, the reading status of the message is returned to the sender.

根据本发明的另一方面,提供了一种即时消息阅读状态的记录装置,包括:According to another aspect of the present invention, a device for recording instant message reading status is provided, including:

接收模块,用于接收发送端向接收端发送的消息,为消息生成消息标识;The receiving module is used to receive the message sent from the sending end to the receiving end, and generate a message identifier for the message;

存储模块,用于根据接收端的记录生成第一位图数据,存储消息标识与第一位图数据;A storage module, configured to generate the first bitmap data according to the record of the receiving end, and store the message identifier and the first bitmap data;

发送模块,用于将消息发送给接收端;A sending module, configured to send the message to the receiving end;

修改模块,用于接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据;The modification module is used to receive the message reading notification returned by the receiving end, and modify the first bitmap data according to the message reading notification to obtain the second bitmap data;

返回模块,用于根据第二位图数据,向发送端返回消息的阅读状态。The return module is used to return the reading status of the message to the sender according to the second bitmap data.

根据本发明的即时消息阅读状态的记录方法及装置,在接收到发送端发送的消息之后,根据接收端的记录生成第一位图数据;在接收到接收端返回的消息阅读通知之后,根据消息阅读通知修改第一位图数据得到第二位图数据,第二位图数据记录了即时消息的阅读状态,以便向发送端返回消息的阅读状态。本发明利用位图记录每个接收端的阅读状态,将每个接收端的阅读状态的记录压缩为1bit,与现有技术至少占用16字节的一条记录相比,大大节省了数据存储空间,由此解决了给数据库带来巨大的数据写入压力及信息存储压力的问题。According to the method and device for recording instant message reading status of the present invention, after receiving the message sent by the sending end, the first bitmap data is generated according to the record of the receiving end; The notification modifies the first bitmap data to obtain the second bitmap data, and the second bitmap data records the reading status of the instant message, so as to return the reading status of the message to the sending end. The present invention uses a bitmap to record the reading state of each receiving end, and compresses the record of the reading state of each receiving end into 1 bit, which greatly saves the data storage space compared with a record occupying at least 16 bytes in the prior art, thus It solves the problem of bringing huge data writing pressure and information storage pressure to the database.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了根据本发明一个实施例的即时消息阅读状态的记录方法的流程图;Fig. 1 shows the flow chart of the method for recording instant message reading state according to one embodiment of the present invention;

图2示出了根据本发明另一个实施例的即时消息阅读状态的记录方法的流程图;FIG. 2 shows a flow chart of a method for recording instant message reading status according to another embodiment of the present invention;

图3示出了根据本发明一个实施例的即时消息阅读状态的记录装置的功能框图;FIG. 3 shows a functional block diagram of an instant message reading state recording device according to an embodiment of the present invention;

图4示出了根据本发明另一个实施例的即时消息阅读状态的记录装置的功能框图。Fig. 4 shows a functional block diagram of an apparatus for recording instant message reading status according to another embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

图1示出了根据本发明一个实施例的即时消息阅读状态的记录方法的流程图。如图1所示,本方法包括以下步骤:Fig. 1 shows a flowchart of a method for recording instant message reading status according to an embodiment of the present invention. As shown in Figure 1, the method includes the following steps:

步骤S101,接收发送端向接收端发送的消息,为消息生成消息标识。Step S101, receiving a message sent from a sending end to a receiving end, and generating a message identifier for the message.

每次发送端在发送消息时,会将发送端信息、消息数据、接收端信息等数据发送给服务端,以便于服务端查询相关数据并进行即时消息的转发。Each time the sender sends a message, it will send data such as sender information, message data, and receiver information to the server, so that the server can query relevant data and forward the instant message.

服务端在接收到发送端信息、消息数据、接收端信息等数据后,都会新生成一条信息记录,每条信息记录都有唯一对应的message_id值,即消息标识,并将该消息标识返回给发送端,用于发送端获取阅读状态的依据,同时,该消息标识也能用于数据表的相关数据查询。After receiving data such as sender information, message data, and receiver information, the server will generate a new message record. Each message record has a unique message_id value, which is the message ID, and returns the message ID to the sender. The terminal is used as the basis for the sender to obtain the reading status. At the same time, the message identifier can also be used for querying related data in the data table.

步骤S102,根据接收端的记录生成第一位图数据,存储消息标识与第一位图数据。Step S102, generating first bitmap data according to the record of the receiving end, and storing the message identifier and the first bitmap data.

其中,接收端的记录记录有接收端的接收者情况,第一位图数据是和消息标识对应的,每一个消息标识都会有一个唯一与之对应的第一位图数据。Wherein, the record at the receiving end records the information of the receiver at the receiving end, the first bitmap data corresponds to the message ID, and each message ID has a unique first bitmap data corresponding to it.

具体地,当接收端为一个接收者时,即一对一形式的私人通讯模式,该情况下,接收者是用户指定选择的,所以接收端的记录记录了该一个接收者的数据,根据此记录,服务端生成的第一位图数据为0x1;当接收端包含多个接收者时,即一对多形式的通讯模式,该情况下,接收端的记录中每一条记录记录有一个接收者的数据,比如接收者对应的序列号。在生成第一位图数据时,将第一位图数据对应接收者的成员序列号的位置为1,表示该位置有成员存在。以接收端包含5名接收者为例,5名接收者的记录中的成员序列号分别为1、2、3、4、5,则第一位图数据的1至5为均置1,所以生成的第一位图数据为0x1F。Specifically, when the receiver is a receiver, it is a one-to-one private communication mode. In this case, the receiver is specified and selected by the user, so the record of the receiver records the data of the receiver. According to this record , the first bitmap data generated by the server is 0x1; when the receiving end contains multiple receivers, it is a one-to-many communication mode. In this case, each record in the receiving end records the data of one receiver , such as the serial number corresponding to the receiver. When generating the first bitmap data, set the position of the first bitmap data corresponding to the receiver's member serial number to 1, indicating that there is a member at this position. Taking the receiving end as an example with 5 receivers, the member serial numbers in the records of the 5 receivers are 1, 2, 3, 4, and 5 respectively, then the first bitmap data 1 to 5 are all set to 1, so The generated first bitmap data is 0x1F.

将消息标识和与之对应的第一位图数据插入到服务端的数据库中。Insert the message identifier and the corresponding first bitmap data into the database of the server.

步骤S103,将消息发送给接收端。Step S103, sending the message to the receiving end.

服务端向接收端的所有接收者发送携带消息数据和消息标识等信息的消息。The server sends messages carrying information such as message data and message identifiers to all receivers at the receiving end.

步骤S104,接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据。Step S104, receiving the message reading notification returned by the receiving end, and modifying the first bitmap data according to the message reading notification to obtain the second bitmap data.

接收端接收到服务端发送的消息后,如果对应的成员阅读了该条消息,则将消息阅读通知返回给服务端,消息阅读通知包括接收端对应的接收者的成员序列号和消息标识,该成员序列号是从1开始编号的,且每一个接收者对应一个唯一的序列号,不重复也不间隔,例如接收端有100个接收者,那么这100个接收者的序列号依次为1、2、3……100。After the receiving end receives the message sent by the server, if the corresponding member reads the message, it will return the message reading notification to the server. The message reading notification includes the member serial number and message ID of the corresponding receiver at the receiving end. The member serial number is numbered from 1, and each receiver corresponds to a unique serial number, which is neither repeated nor spaced. For example, if there are 100 receivers at the receiving end, then the serial numbers of these 100 receivers are 1, 2, 3... 100.

假设服务端接收到的消息阅读通知中的接收者的成员序列号为3,则将第一位图数据的第3位修改为0,因此,原来5个接收者的第一位图数据0x1F被修改为0x1B,该修改后的位图数据称为第二位图数据;同理,如果只有接收者的成员序列号为3的成员未返回消息阅读通知,则第一位图数据只有第3位不修改为0,因此,修改后得到的第二位图数据为0x4。Assuming that the member serial number of the recipient in the message reading notification received by the server is 3, the third bit of the first bitmap data is changed to 0, therefore, the first bitmap data 0x1F of the original 5 recipients is replaced by Change it to 0x1B, and the modified bitmap data is called the second bitmap data; similarly, if only the receiver member whose member serial number is 3 does not return a message reading notification, the first bitmap data only has the 3rd bit It is not modified to 0, therefore, the second bitmap data obtained after modification is 0x4.

上述将第一位图数据对应位修改为0的操作采用对应位的值与0进行按位与操作来实现。The above operation of modifying the corresponding bit of the first bitmap data to 0 is implemented by performing a bitwise AND operation between the value of the corresponding bit and 0.

步骤S105,根据第二位图数据,向发送端返回消息的阅读状态。Step S105: Return the reading status of the message to the sender according to the second bitmap data.

在对第一位图数据的对应所有的消息阅读通知对应的接收者成员序列号的位都进行修改后,得到的位图数据称为第二位图数据,该第二位图数据的每一位表示一个接收者的阅读状态,具体地,若为0,表示该位对应的接收者已阅读消息,若为1,表示该位对应的接收者未阅读消息。After the bits of the first bitmap data corresponding to the receiver member serial numbers corresponding to all the message reading notifications are modified, the obtained bitmap data is called the second bitmap data, and each bitmap data of the second bitmap data The bit indicates the reading status of a receiver. Specifically, if it is 0, it means that the receiver corresponding to this bit has read the message, and if it is 1, it means that the receiver corresponding to this bit has not read the message.

若发送端想了解接收端的成员的阅读状态,则可以通过把消息标识提供给服务端,服务端就能够根据消息标识和第二位图数据的对应关系查询第二位图数据,并返回该第二位图数据给发送端,发送端即可了解到接收端的接收者的阅读状态;或者,直接由服务端将接收端的阅读状态传递给发送端。If the sending end wants to know the reading status of the members of the receiving end, the server can query the second bitmap data according to the correspondence between the message identifier and the second bitmap data by providing the message identifier to the server, and return the first bitmap data Send the bitmap data to the sending end, and the sending end can know the reading status of the receiver at the receiving end; or, the server directly transmits the reading status of the receiving end to the sending end.

下面,以接收端为一个接收者的私人通讯模式为例,说明上述步骤S101到步骤S105的具体实施:Next, taking the private communication mode in which the receiving end is one receiver as an example, the specific implementation of the above steps S101 to S105 will be described:

在步骤S101中,发送端A向接收者B发送消息,服务端接收到发送端A信息、消息数据、接收者B信息后,为该消息生成消息标识mid1,并且将消息标识mid1返回给发送端A。In step S101, the sender A sends a message to the receiver B, and after receiving the information of the sender A, the message data, and the information of the receiver B, the server generates a message identifier mid1 for the message, and returns the message identifier mid1 to the sender a.

在步骤S102中,接收端的记录有一条接收者B的数据记录,根据该记录,服务端生成的第一位图数据rs1为0x1,并将生成的消息标识mid1和第一位图数据rs1插入数据库中。In step S102, the record of the receiver has a data record of receiver B, according to this record, the first bitmap data rs1 generated by the server is 0x1, and the generated message identifier mid1 and the first bitmap data rs1 are inserted into the database middle.

在步骤S103中,服务端向接收者B发送携带消息数据和消息标识mid1等信息的消息。In step S103, the server sends to the receiver B a message carrying information such as message data and message identifier mid1.

在步骤S104中,接收者B接收到消息后,返回消息阅读通知给服务端,包括发送端A信息及消息标识mid1,并将第一位图数据rs1为1的位置为0,记为第二位图数据rs2;如果接收者B未返回消息阅读通知,则该方法终止。In step S104, after receiving the message, the receiver B returns a message reading notification to the server, including the information of the sender A and the message identifier mid1, and sets the position where the first bitmap data rs1 is 1 to 0, which is recorded as the second Bitmap data rs2; if receiver B does not return a message read notification, the method terminates.

在步骤S105中,在得到第二位图数据rs2后,可直接由服务端将接收者B的阅读状态返回给发送端A;或者,发送端A通过提供消息标识mid1给服务端,来获取接收者B的阅读状态。上述阅读状态即第二位图数据rs2对应位的0或1值,若为0,则表示消息mid1已被接收者B阅读,若为1,则表示消息mid1未被接收者B阅读。In step S105, after obtaining the second bitmap data rs2, the server can directly return the reading status of the receiver B to the sender A; or, the sender A obtains the received information by providing the message identifier mid1 to the server. Reader B's reading status. The above read status is the 0 or 1 value of the corresponding bit of the second bitmap data rs2. If it is 0, it means that the message mid1 has been read by the receiver B; if it is 1, it means that the message mid1 has not been read by the receiver B.

根据本实施例提供的即时消息阅读状态的记录方法,在接收到发送端发送的消息之后,根据接收端的记录生成第一位图数据;在接收到接收端返回的消息阅读通知之后,根据消息阅读通知修改第一位图数据得到第二位图数据,第二位图数据记录了即时消息的阅读状态,以便向发送端返回消息的阅读状态。本发明利用位图记录每个接收端的阅读状态,将每个接收端的阅读状态的记录压缩为1bit,与现有技术至少占用16字节的一条记录相比,大大节省了数据存储空间,由此解决了给数据库带来巨大的数据写入压力及信息存储压力的问题。According to the recording method of the instant message reading state provided by this embodiment, after receiving the message sent by the sending end, generate the first bitmap data according to the record of the receiving end; after receiving the message reading notification returned by the receiving end, read the The notification modifies the first bitmap data to obtain the second bitmap data, and the second bitmap data records the reading status of the instant message, so as to return the reading status of the message to the sending end. The present invention uses a bitmap to record the reading state of each receiving end, and compresses the record of the reading state of each receiving end into 1 bit, which greatly saves the data storage space compared with a record occupying at least 16 bytes in the prior art, thus It solves the problem of bringing huge data writing pressure and information storage pressure to the database.

本发明通过位图来对接收端的阅读状态进行记录,将每一个接收者的记录压缩到1bit,解决了给数据库带来巨大的数据写入压力及信息存储压力的问题,取得了节省数据存储空间的有益效果。尤其当接收端为数量庞大的群组成员时,采用本发明进行记录,取得的效果则更为明显。The present invention records the reading state of the receiver through a bitmap, and compresses the record of each receiver to 1 bit, which solves the problem of huge data writing pressure and information storage pressure on the database, and saves data storage space beneficial effect. Especially when the receiving end has a large number of group members, the effect obtained by using the present invention for recording is more obvious.

在对本发明的优选的实施例进行实施之前,通过建立合理的数据结构模型来简化实施过程的记录和查询,本发明建立的数据结构模型有信息数据表模型(message_t)、群成员数据表模型(qun_member_t)和信息相关的群成员快照数据表模型(qun_snapshot_t)。Before the preferred embodiment of the present invention is implemented, the record and query of the implementation process are simplified by setting up a reasonable data structure model. The data structure model established by the present invention has information data table model (message_t), group member data table model ( qun_member_t) and information-related group member snapshot data table model (qun_snapshot_t).

a.信息数据表模型(message_t)主要字段参见表1:a. The main fields of the information data table model (message_t) are shown in Table 1:

表1信息数据表message_t主要字段Table 1 Information data table message_t main fields

字段名field name 字段类型Field Type message_idmessage_id int64int64 read_statusread_status bitmapbitmap

message_id:每次发送一条消息时,服务端都会新生成一条消息记录,每条消息记录都有唯一对应的message_id值,即消息标识,且该message_id值严格单调递增,即:后发送消息的消息id将比先发送的值大。message_id: Every time a message is sent, the server will generate a new message record. Each message record has a unique corresponding message_id value, which is the message ID, and the message_id value is strictly monotonically increasing, that is, the message id of the message sent later Will be greater than the value sent first.

read_status:表示该条消息被接收者阅读的阅读状态,当read_status位图值全为0表示全部接收者都已阅读,否则表示部分接收者已阅读或无人阅读。read_status: Indicates the reading status of the message read by the receiver. When the read_status bitmap value is all 0, it means that all receivers have read it, otherwise it means that some receivers have read it or no one has read it.

b.群成员数据表模型(qun_member_t)主要字段参见表2:b. See Table 2 for the main fields of the group member data table model (qun_member_t):

表2群成员数据表qun_member_t主要字段Table 2 The main fields of the group member data table qun_member_t

字段名field name 字段类型Field Type qun_idqun_id int64int64 member_seqmember_seq int64int64

qun_id:每当用户新创建群组时,服务端都将生成一个新的群组id,即群组标识,不同的群组的群组id值严格单调递增,即:后创建的群组的群组id将比先创建的群组的群组id值大。qun_id: Whenever a user creates a new group, the server will generate a new group id, that is, the group ID. The group id values of different groups are strictly monotonically increasing, that is, the group of the group created later The group id will be greater than the group id value of the first created group.

member_seq:每当向群组中添加新的群组成员时,服务端都将在群组对应的qun_id下,生成新的member_seq值,即群组成员对应的成员序列号。相同qun_id值时,member_seq值严格单调递增且连续。即,已有qun_id值为1的群组,第一个加入该群组的成员member_seq值为1,第二个加入的则为2,以此类推。member_seq: Whenever a new group member is added to the group, the server will generate a new member_seq value under the qun_id corresponding to the group, which is the member sequence number corresponding to the group member. When the qun_id value is the same, the member_seq value is strictly monotonically increasing and continuous. That is, if there is a group with the qun_id value of 1, the member_seq value of the first member who joins the group is 1, and the member_seq value of the second member is 2, and so on.

c.信息相关的群成员快照数据表模型(qun_snapshot_t)主要字段:c. The main fields of the information-related group member snapshot data table model (qun_snapshot_t):

表3群成员快照数据表qun_snapshot_t主要字段Table 3 Group member snapshot data table qun_snapshot_t main fields

qun_id:对应于qun_member_t中的qun_id字段值qun_id: corresponds to the value of the qun_id field in qun_member_t

message_id:对应于message_t中的message_id字段值message_id: corresponds to the message_id field value in message_t

member_bitmap:群组成员快照位图,每当群组成员有人员增加或减少的变动时,都将向该表中添加一条群组成员快照记录,member_bitmap中位图第x位为0表示,member_seq值为x的成员还在群组中,否则表示该成员已经退群。member_bitmap: group member snapshot bitmap, whenever there is a change in the number of members of the group, a group member snapshot record will be added to the table, the xth bit of the bitmap in member_bitmap is 0, and the value of member_seq The member whose value is x is still in the group, otherwise it means that the member has left the group.

图2示出了根据本发明另一个实施例的即时消息阅读状态的记录方法的流程图。本方法是针对于接收端为群组成员的情况,即接收端的多个接收者处于同一个群组中,如图2所示,本方法包括以下步骤:Fig. 2 shows a flowchart of a method for recording instant message reading status according to another embodiment of the present invention. This method is aimed at the situation that the receiving end is a group member, that is, multiple recipients at the receiving end are in the same group, as shown in Figure 2, this method includes the following steps:

步骤S201,接收发送端向接收端发送的消息,为消息生成消息标识。Step S201, receiving a message sent from a sending end to a receiving end, and generating a message identifier for the message.

服务端在接收到发送端发送的信息数据后,都会新生成一条信息记录,每条信息记录都有唯一对应的message_id值,即消息标识。After receiving the message data sent by the sender, the server will generate a new message record, and each message record has a unique corresponding message_id value, that is, the message identifier.

步骤S202,根据群组标识查询群组内有效成员的记录。Step S202, querying the records of valid members in the group according to the group ID.

根据发送消息的群组对应的群组标识qun_id值查询群成员数据表qun_member_t,获取发送消息时群组内的有效成员的记录,该有效成员的记录即未退群的成员记录。Query the group member data table qun_member_t according to the group identifier qun_id value corresponding to the group that sent the message, and obtain the record of the effective member in the group when the message was sent. The record of the effective member is the record of the member who has not left the group.

假设群组标识qun_id值为1,查询群成员数据表qun_member_t获取的有效成员的记录为:Assuming that the value of the group identifier qun_id is 1, the effective member records obtained by querying the group member data table qun_member_t are:

[{“qun_id”:1,“member_seq”:1},{“qun_id”:1,“member_seq”:2},…,][{"qun_id":1,"member_seq":1},{"qun_id":1,"member_seq":2},...,]

{“qun_id”:1,“member_seq”:1}为第1条记录,{“qun_id”:1,“member_seq”:2}为第2条记录。{"qun_id":1, "member_seq":1} is the first record, {"qun_id":1, "member_seq":2} is the second record.

步骤S203,查询群组内有效成员对应的成员序列号。Step S203, query the member serial numbers corresponding to valid members in the group.

根据有效成员的记录可以得到每一条记录记录的有效成员的成员序列号。例如,记录{“qun_id”:1,“member_seq”:4}表示的群组内有效成员对应的成员序列号为4。According to the records of valid members, the member serial number of the valid members recorded in each record can be obtained. For example, the record {"qun_id":1, "member_seq":4} indicates that the valid member in the group corresponds to the member sequence number 4.

步骤S204,将位图中群组内有效成员对应的成员序列号对应的位置的数据置为第一数据,得到第一位图数据。Step S204, setting the data at the position corresponding to the member serial number corresponding to the valid member in the group in the bitmap as the first data, and obtaining the first bitmap data.

其中,第一位图数据的每一位值表示群组内的对应成员序列号的成员是否有效,若为1,则表示对应的成员为有效成员,即该成员仍在群组中;若为0,则表示对应的成员为无效成员,即该成员已退群。第一位图数据是和消息标识对应的,每一个消息标识都会有一个唯一与之对应的第一位图数据。Among them, each bit value of the first bitmap data indicates whether the member corresponding to the member serial number in the group is valid, if it is 1, it means that the corresponding member is a valid member, that is, the member is still in the group; if it is 0, it means that the corresponding member is an invalid member, that is, the member has withdrawn from the group. The first bitmap data corresponds to the message ID, and each message ID has a unique first bitmap data corresponding to it.

查询到群组内有效成员对应的成员序列号member_seq后,将第一位图数据read_status中对应member_seq位设置为1。After querying the member sequence number member_seq corresponding to the valid members in the group, set the corresponding member_seq bit in the first bitmap data read_status to 1.

例如:第1条记录记录的有效成员的成员序列号msx为3,则将第一位图数据rs1的第3位设置为1,即rs1为0x4;第2条记录记录的有效成员的成员序列号msx为5,则将第一位图数据rs1的第5位设置为1,即rs1为0x14……依次将第一位图数据rs1中对应有效成员的成员序列号msx对应位置的数据设置为第一数据,得到第一位图数据rs1。For example: the member sequence number msx of the effective member recorded in the first record is 3, then the third bit of the first bitmap data rs1 is set to 1, that is, rs1 is 0x4; the member sequence of the effective member recorded in the second record number msx is 5, then the fifth bit of the first bitmap data rs1 is set to 1, that is, rs1 is 0x14... and the data at the corresponding position of the member serial number msx corresponding to the valid member in the first bitmap data rs1 is set as The first data, the first bitmap data rs1 is obtained.

由此可见,群组成员的记录生成第一位图数据read_status的具体操作为,根据群组标识qun_id查询群组内有效成员的记录,根据群组内有效成员生成第一位图数据。It can be seen that the specific operation of generating the first bitmap data read_status from the records of group members is to query the records of valid members in the group according to the group identifier qun_id, and generate the first bitmap data according to the valid members in the group.

步骤S205,存储消息标识与第一位图数据。Step S205, storing the message ID and the first bitmap data.

将消息标识message_id和与之对应的第一位图数据read_status插入到服务端的数据库中。Insert the message identifier message_id and the corresponding first bitmap data read_status into the database of the server.

步骤S206,将消息发送给接收端。Step S206, sending the message to the receiving end.

服务端向接收端的所有群组成员发送携带消息数据、成员序列号member_seq和消息标识message_id等信息的消息。The server sends a message carrying information such as message data, member sequence number member_seq, and message identifier message_id to all group members at the receiving end.

步骤S207,接收群组成员返回的消息阅读通知。Step S207, receiving the message reading notification returned by the group members.

对于接收端对应的群组成员为有效成员的情况,阅读状态有已读、未读两种。接收端在接收到服务端发送的消息后,如果接收端的群组成员阅读了该条消息,则将消息阅读通知返回给服务端。For the case that the group member corresponding to the receiving end is a valid member, there are two reading states: read and unread. After the receiving end receives the message sent by the server, if the group members at the receiving end have read the message, the message reading notification will be returned to the server.

步骤S208,根据消息阅读通知确定返回消息阅读通知的群组成员对应的成员序列号。Step S208, according to the message reading notification, determine the member sequence numbers corresponding to the group members who return the message reading notification.

消息阅读通知包括成员序列号member_seq和消息标识message_id,即返回消息阅读通知的成员要将已阅读的消息对应的消息标识message_id和该成员的成员序列号member_seq返回给服务端。根据返回消息阅读通知的成员序列号member_seq即可确定有哪些成员的阅读状态为已读。The message reading notification includes the member sequence number member_seq and the message identifier message_id, that is, the member returning the message reading notification should return the message identifier message_id corresponding to the read message and the member's member sequence number member_seq to the server. According to the member sequence number member_seq of the returned message reading notification, it can be determined which members have read status as read.

步骤S209,将第一位图数据对应的位图中返回消息阅读通知的群组成员对应的成员序列号对应的位置的数据置为第二数据,得到第二位图数据。Step S209, setting the data at the position corresponding to the member serial number corresponding to the group member who returns the message reading notification in the bitmap corresponding to the first bitmap data as the second data, to obtain the second bitmap data.

服务端根据消息阅读通知中的成员序列号member_seq和消息标识message_id的值查询信息数据表message_t,并将第一位图数据的对应成员序列号member_seq的位设置为0,该设置为0的步骤采用对应位的值与0进行与操作来实现,设置后的第一位图数据read_status称为第二位图数据read_status。The server queries the information data table message_t according to the value of the member sequence number member_seq and the message identifier message_id in the message reading notification, and sets the bit of the corresponding member sequence number member_seq of the first bitmap data to 0, and the step of setting it to 0 adopts The value of the corresponding bit is ANDed with 0, and the set first bitmap data read_status is called the second bitmap data read_status.

步骤S210,根据群组标识和消息标识获取群成员快照位图数据,群成员快照位图数据根据群组内的未退群成员与已退群成员的快照记录而设定。Step S210, according to the group identifier and the message identifier, the snapshot bitmap data of the group members is acquired, and the snapshot bitmap data of the group members is set according to the snapshot records of the members who have not left the group and the members who have left the group.

根据群组标识qun_id和消息标识message_id查询群成员快照数据表qun_snapshot_t,获取对应的群成员快照位图数据member_bitmap。Query the group member snapshot data table qun_snapshot_t according to the group identifier qun_id and the message identifier message_id, and obtain the corresponding group member snapshot bitmap data member_bitmap.

其中,群成员快照位图数据member_bitmap根据群组内的未退群成员与已退群成员的快照记录而设定,每当群组成员有人员增加或减少的变动时,都将向群成员快照数据表qun_snapshot_t中添加一条快照记录,群成员快照位图数据member_bitmap中对应成员序列号member_seq的位的值为0表示成员序列号member_seq对应的成员还在群组中,否则表示该成员已经退群。Among them, the group member snapshot bitmap data member_bitmap is set according to the snapshot records of the members who have not left the group and the members who have left the group. Add a snapshot record to the data table qun_snapshot_t. The value of the bit corresponding to the member sequence number member_seq in the group member snapshot bitmap data member_bitmap is 0, indicating that the member corresponding to the member sequence number member_seq is still in the group, otherwise, it indicates that the member has left the group.

以群组中原有10位群组成员为例,成员序列号msx为3和5的两位群组成员中途退群,则最新的群成员快照位图数据mb1的第3位和第5位的值为1,其余各位的值为0,即群成员快照位图数据mb1为0x14。Taking the original 10 group members in the group as an example, two group members with member serial numbers msx of 3 and 5 quit the group halfway, then the 3rd and 5th digits of the latest group member snapshot bitmap data mb1 The value is 1, and the value of other bits is 0, that is, the group member snapshot bitmap data mb1 is 0x14.

步骤S211,将群成员快照位图数据和第二位图数据进行按位操作,得到用来记录群组成员阅读状态的第三位图数据;遍历第三位图数据,向发送端返回消息的阅读状态。Step S211, perform a bitwise operation on the group member snapshot bitmap data and the second bitmap data to obtain the third bitmap data used to record the reading status of the group members; traverse the third bitmap data, and return the information of the message to the sender Read status.

第二位图数据read_status的某一位的值为0有两种情况:该位对应的群组成员已阅读消息标识message_id对应的消息和该位对应的群组成员已退群。A certain bit of the second bitmap data read_status has a value of 0 in two situations: the group member corresponding to this bit has read the message corresponding to the message identifier message_id and the group member corresponding to this bit has left the group.

因此并不能直接确定哪些群组成员已阅读消息标识message_id对应的消息,本发明实施例采用将第二位图数据read_status和群成员快照位图数据member_bitmap按位异或的方法,得到第三位图数据bitmap,这样就能将第二位图数据read_status中对应已退群成员的位为0的值置为1,因而发送端就能了解到哪些成员已经阅读了消息标识message_id对应的消息。Therefore, it is impossible to directly determine which group members have read the message corresponding to the message identifier message_id. The embodiment of the present invention adopts the method of bitwise XORing the second bitmap data read_status and the group member snapshot bitmap data member_bitmap to obtain the third bitmap data bitmap, so that the value of the bit corresponding to the retired member in the second bitmap data read_status that is 0 can be set to 1, so that the sender can know which members have read the message corresponding to the message identifier message_id.

延用上述群组中原有10位群组成员的例子,群组中的无效成员为成员序列号msx为3和5的成员,可得第一位图数据rs1的第3位和第5位置0,其他位置1,因此第一位图数据rs1为0x3EB;假设返回消息阅读通知的成员的成员序列号msx为1、2、4、6、7、9和10,则在第一位图数据rs1的基础上,将除第1、2、4、6、7、9和10位的值与0进行按位与操作,得到修改后的第二位图数据rs2为0x80。该第二位图数据rs2的值只有第8位为1,但实际上成员序列号msx为3和5的成员也没有返回消息通知,因此采用本实施例的方法,将第二位图数据rs2和群成员快照位图数据mb1为0x14进行按位异或操作,得到第三位图数据mp1为0x94,即第1、2、4、6、7、9和10位的值为0,表示对应成员序列号msx为1、2、4、6、7、9和10的成员返回了消息阅读通知。Continuing the example of the original 10 group members in the above group, the invalid members in the group are the members whose member sequence numbers msx are 3 and 5, and the third and fifth positions of the first bitmap data rs1 can be obtained as 0 , and the other bits are 1, so the first bitmap data rs1 is 0x3EB; assuming that the member serial number msx of the member returning the message reading notification is 1, 2, 4, 6, 7, 9 and 10, then the first bitmap data rs1 On the basis of , perform a bitwise AND operation on the values except the 1st, 2nd, 4th, 6th, 7th, 9th and 10th bits and 0, and the modified second bitmap data rs2 is 0x80. Only the 8th bit of the second bitmap data rs2 is 1, but actually the members whose member serial numbers msx are 3 and 5 do not return message notifications, so adopt the method of this embodiment to convert the second bitmap data rs2 Perform a bitwise XOR operation with the group member snapshot bitmap data mb1 of 0x14 to obtain the third bitmap data mp1 of 0x94, that is, the values of the 1st, 2nd, 4th, 6th, 7th, 9th and 10th bits are 0, indicating the corresponding Members with member serial numbers msx of 1, 2, 4, 6, 7, 9 and 10 returned message read notifications.

由此可见,通过得到的第三位图数据bitmap的每一位可以得知每一位成员的消息阅读状态。It can be seen that, through each bit of the obtained third bitmap data bitmap, the message reading status of each member can be known.

根据本实施例提供的即时消息阅读状态的记录方法,在接收到发送端发送的消息之后,根据接收端的记录生成第一位图数据;在接收到接收端返回的消息阅读通知之后,根据消息阅读通知修改第一位图数据得到第二位图数据,第二位图数据记录了即时消息的阅读状态,以便向发送端返回消息的阅读状态。本发明利用位图记录每个接收端的阅读状态,将每个接收端的阅读状态的记录压缩为1bit,与现有技术至少占用16字节的一条记录相比,大大节省了数据存储空间,由此解决了给数据库带来巨大的数据写入压力及信息存储压力的问题;通过获取群成员快照位图数据,确认群组中的有效成员,并采用第三位图数据将已退群成员的阅读状态和有效成员的阅读状态区别标识,这样发送端就能直接通过第三位图数据来判断已经阅读了消息的成员,无须参照其他信息,使发送端获取阅读状态的方式更为简捷。According to the recording method of the instant message reading state provided by this embodiment, after receiving the message sent by the sending end, generate the first bitmap data according to the record of the receiving end; after receiving the message reading notification returned by the receiving end, read the The notification modifies the first bitmap data to obtain the second bitmap data, and the second bitmap data records the reading status of the instant message, so as to return the reading status of the message to the sending end. The present invention uses a bitmap to record the reading state of each receiving end, and compresses the record of the reading state of each receiving end into 1 bit, which greatly saves the data storage space compared with a record occupying at least 16 bytes in the prior art, thus It solves the problem of huge data writing pressure and information storage pressure on the database; by obtaining the snapshot bitmap data of group members, confirm the valid members in the group, and use the third bitmap data to read The status and the reading status of valid members are distinguished, so that the sender can directly judge the members who have read the message through the third bitmap data, without referring to other information, making the way for the sender to obtain the reading status simpler.

图3示出了根据本发明一个实施例的即时消息阅读状态的记录装置的功能框图。如图3所示,本装置包括:接收模块310、生成模块320、发送模块330、修改模块340、返回模块350。Fig. 3 shows a functional block diagram of an apparatus for recording instant message reading status according to an embodiment of the present invention. As shown in FIG. 3 , the device includes: a receiving module 310 , a generating module 320 , a sending module 330 , a modifying module 340 , and a returning module 350 .

接收模块310,用于接收发送端向接收端发送的消息,为消息生成消息标识。The receiving module 310 is configured to receive a message sent from the sending end to the receiving end, and generate a message identifier for the message.

服务端在接收到发送端信息、消息数据、接收端信息等数据后,都会新生成一条信息记录,每条信息记录都有唯一对应的message_id值,即消息标识,并将该消息标识返回给发送端,用于发送端获取阅读状态的依据,同时,该消息标识也能用于数据表的相关数据查询。。After receiving data such as sender information, message data, and receiver information, the server will generate a new message record. Each message record has a unique message_id value, which is the message ID, and returns the message ID to the sender. The terminal is used as the basis for the sender to obtain the reading status. At the same time, the message identifier can also be used for querying related data in the data table. .

生成模块320,用于根据接收端的记录生成第一位图数据,存储消息标识与第一位图数据。The generating module 320 is configured to generate the first bitmap data according to the record of the receiving end, and store the message identifier and the first bitmap data.

其中,接收端的记录记录有接收端的接收者情况,第一位图数据是和消息标识对应的,每一个消息标识都会有一个唯一与之对应的第一位图数据。Wherein, the record at the receiving end records the information of the receiver at the receiving end, the first bitmap data corresponds to the message ID, and each message ID has a unique first bitmap data corresponding to it.

将消息标识和与之对应的第一位图数据插入到服务端的数据库中。Insert the message identifier and the corresponding first bitmap data into the database of the server.

发送模块330,用于将消息发送给接收端。The sending module 330 is configured to send the message to the receiving end.

服务端向接收端的所有接收者发送携带消息数据和消息标识等信息的消息。The server sends messages carrying information such as message data and message identifiers to all receivers at the receiving end.

修改模块340,用于接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据。The modification module 340 is configured to receive the message reading notification returned by the receiving end, modify the first bitmap data according to the message reading notification, and obtain the second bitmap data.

服务端根据消息阅读通知中的成员序列号和消息标识查询到第一位图数据,并将第一位图数据的对应成员序列号的位设置为0,该设置为0的步骤采用该位的值与0进行与操作,修改后的第一位图数据称为第二位图数据。The server queries the first bitmap data according to the member serial number and message identifier in the message reading notification, and sets the bit of the corresponding member serial number of the first bitmap data to 0, and the step of setting to 0 uses the value of this bit The value is ANDed with 0, and the modified first bitmap data is called the second bitmap data.

返回模块350,用于根据第二位图数据,向发送端返回消息的阅读状态。The returning module 350 is configured to return the reading status of the message to the sending end according to the second bitmap data.

在对第一位图数据的对应所有的消息阅读通知对应的接收者成员序列号的位都进行修改后,得到的位图数据称为第二位图数据,该第二位图数据的每一位表示一个接收者的阅读状态,具体地,若为0,表示该位对应的接收者已阅读消息,若为1,表示该位对应的接收者未阅读消息。After the bits of the first bitmap data corresponding to the receiver member serial numbers corresponding to all the message reading notifications are modified, the obtained bitmap data is called the second bitmap data, and each bitmap data of the second bitmap data The bit indicates the reading status of a receiver. Specifically, if it is 0, it means that the receiver corresponding to this bit has read the message, and if it is 1, it means that the receiver corresponding to this bit has not read the message.

根据本实施例提供的即时消息阅读状态的记录装置,在接收到发送端发送的消息之后,根据接收端的记录生成第一位图数据;在接收到接收端返回的消息阅读通知之后,根据消息阅读通知修改第一位图数据得到第二位图数据,第二位图数据记录了即时消息的阅读状态,以便向发送端返回消息的阅读状态。本发明利用位图记录每个接收端的阅读状态,将每个接收端的阅读状态的记录压缩为1bit,与现有技术至少占用16字节的一条记录相比,大大节省了数据存储空间,由此解决了给数据库带来巨大的数据写入压力及信息存储压力的问题。According to the recording device of the instant message reading state provided by this embodiment, after receiving the message sent by the sending end, the first bitmap data is generated according to the record of the receiving end; The notification modifies the first bitmap data to obtain the second bitmap data, and the second bitmap data records the reading status of the instant message, so as to return the reading status of the message to the sending end. The present invention uses a bitmap to record the reading state of each receiving end, and compresses the record of the reading state of each receiving end into 1 bit, which greatly saves the data storage space compared with a record occupying at least 16 bytes in the prior art, thus It solves the problem of bringing huge data writing pressure and information storage pressure to the database.

图4示出了根据本发明另一个实施例的即时消息阅读状态的记录装置的功能框图。如图4所示,本装置在图3提供的即时消息阅读状态的记录装置的功能框图的基础上,还包括:获取模块420和操作模块430,修改模块340进一步包括接收单元411、确定单元412和设置单元413。Fig. 4 shows a functional block diagram of an apparatus for recording instant message reading status according to another embodiment of the present invention. As shown in Figure 4, on the basis of the functional block diagram of the device for recording the instant message reading status provided in Figure 3, this device also includes: an acquisition module 420 and an operation module 430, and the modification module 340 further includes a receiving unit 411 and a determining unit 412 and setting unit 413 .

接收模块310,用于接收发送端向接收端发送的消息,为消息生成消息标识;其中,接收端为群组成员。The receiving module 310 is configured to receive a message sent from the sending end to the receiving end, and generate a message identifier for the message; wherein, the receiving end is a group member.

服务端在接收到发送端发送的信息数据后,都会新生成一条信息记录,每条信息记录都有唯一对应的message_id值,即消息标识。After receiving the message data sent by the sender, the server will generate a new message record, and each message record has a unique corresponding message_id value, that is, the message identifier.

生成模块320,用于根据群组标识查询群组成员的记录,根据群组成员的记录生成第一位图数据。The generating module 320 is configured to query the records of the group members according to the group ID, and generate the first bitmap data according to the records of the group members.

根据发送消息的群组对应的群组标识qun_id值查询群成员数据表qun_member_t,获取发送消息时群组内的有效成员的记录,该有效成员的记录即未退群的成员记录;查询到群组内有效成员对应的成员序列号member_seq后,将第一位图数据read_status中对应member_seq位设置为1。Query the group member data table qun_member_t according to the group identifier qun_id value corresponding to the group that sent the message, and obtain the record of the effective member in the group when the message was sent. The record of the effective member is the record of the member who has not left the group; query the group After the member sequence number member_seq corresponding to the effective member within, set the corresponding member_seq bit in the first bitmap data read_status to 1.

由此可见,生成模块320进一步用于:根据群组标识查询群组内有效成员的记录,根据群组内有效成员生成第一位图数据。It can be seen that the generation module 320 is further configured to: query the records of valid members in the group according to the group ID, and generate the first bitmap data according to the valid members in the group.

具体地,生成模块320进一步用于:根据群组标识查询群组内有效成员的记录;查询群组内有效成员对应的成员序列号;将位图中群组内有效成员对应的成员序列号对应的位置的数据置为第一数据,得到第一位图数据。Specifically, the generation module 320 is further used to: query the records of valid members in the group according to the group ID; query the member serial numbers corresponding to the valid members in the group; correspond to the member serial numbers corresponding to the valid members in the group in the bitmap The data at the position of is set as the first data, and the first bitmap data is obtained.

将消息标识message_id和与之对应的第一位图数据read_status插入到服务端的数据库中。Insert the message identifier message_id and the corresponding first bitmap data read_status into the database of the server.

发送模块330,将消息发送给接收端。The sending module 330, sends the message to the receiving end.

服务端向接收端的所有群组成员发送携带消息数据、成员序列号member_seq和消息标识message_id等信息的消息。The server sends a message carrying information such as message data, member sequence number member_seq, and message identifier message_id to all group members at the receiving end.

修改模块340进一步包括接收单元411、确定单元412和设置单元413。The modifying module 340 further includes a receiving unit 411 , a determining unit 412 and a setting unit 413 .

接收单元411,用于接收群组成员返回的消息阅读通知。The receiving unit 411 is configured to receive message reading notifications returned by group members.

对于接收端对应的群组成员为有效成员的情况,阅读状态有已读、未读两种。接收端在接收到服务端发送的消息后,如果接收端的群组成员阅读了该条消息,则将消息阅读通知返回给服务端。For the case that the group member corresponding to the receiving end is a valid member, there are two reading states: read and unread. After the receiving end receives the message sent by the server, if the group members at the receiving end have read the message, the message reading notification will be returned to the server.

确定单元412,用于根据消息阅读通知确定返回消息阅读通知的群组成员对应的成员序列号。The determining unit 412 is configured to determine, according to the message reading notification, the member sequence numbers corresponding to the group members who return the message reading notification.

消息阅读通知包括成员序列号member_seq和消息标识message_id,即返回消息阅读通知的成员要将已阅读的消息对应的消息标识message_id和该成员的成员序列号member_seq返回给服务端。根据返回消息阅读通知的成员序列号member_seq即可确定有哪些成员的阅读状态为已读。The message reading notification includes the member sequence number member_seq and the message identifier message_id, that is, the member returning the message reading notification should return the message identifier message_id corresponding to the read message and the member's member sequence number member_seq to the server. According to the member sequence number member_seq of the returned message reading notification, it can be determined which members have read status as read.

设置单元413,用于将第一位图数据对应的位图中返回消息阅读通知的群组成员对应的成员序列号对应的位置的数据置为第二数据,得到第二位图数据。The setting unit 413 is configured to set the data in the bitmap corresponding to the first bitmap data at the position corresponding to the member serial number corresponding to the group member who returned the message reading notification as the second data, so as to obtain the second bitmap data.

服务端根据消息阅读通知中的成员序列号member_seq和消息标识message_id的值查询信息数据表message_t,并将第一位图数据对应成员序列号member_seq的位设置为0,该设置为0的步骤采用对应位的值与0进行与操作来实现,设置后的第一位图数据记为read_status,称为第二位图数据read_status。The server queries the information data table message_t according to the value of the member sequence number member_seq and the message identifier message_id in the message reading notification, and sets the bit of the first bitmap data corresponding to the member sequence number member_seq to 0. The step of setting it to 0 adopts the corresponding The value of the bit is ANDed with 0, and the first bitmap data after setting is recorded as read_status, which is called the second bitmap data read_status.

获取模块420,用于根据群组标识和消息标识获取群组成员快照位图数据,群组成员快照位图数据根据群组内的未退群成员与已退群成员的快照记录而设定。The obtaining module 420 is used to obtain the group member snapshot bitmap data according to the group ID and the message ID, and the group member snapshot bitmap data is set according to the snapshot records of the members who have not left the group and the members who have left the group.

根据群组标识qun_id和消息标识message_id查询群成员快照数据表qun_snapshot_t,可以获取对应的群成员快照位图数据member_bitmap。Query the group member snapshot data table qun_snapshot_t according to the group identifier qun_id and the message identifier message_id, and obtain the corresponding group member snapshot bitmap data member_bitmap.

其中,群成员快照位图数据member_bitmap根据群组内的未退群成员与已退群成员的快照记录而设定,每当群组成员有人员增加或减少的变动时,都将向群成员快照数据表qun_snapshot_t中添加一条快照记录,群成员快照位图数据member_bitmap中对应成员序列号member_seq的位的值为0表示成员序列号member_seq对应的成员还在群组中,否则表示该成员已经退群。Among them, the group member snapshot bitmap data member_bitmap is set according to the snapshot records of the members who have not left the group and the members who have left the group. Add a snapshot record to the data table qun_snapshot_t. The value of the bit corresponding to the member sequence number member_seq in the group member snapshot bitmap data member_bitmap is 0, indicating that the member corresponding to the member sequence number member_seq is still in the group, otherwise, it indicates that the member has left the group.

操作模块430,用于将群组成员快照位图数据和第二位图数据进行按位操作,得到用来记录群组成员阅读状态的第三位图数据。The operation module 430 is configured to perform a bitwise operation on the group member snapshot bitmap data and the second bitmap data to obtain the third bitmap data used to record the reading status of the group members.

第二位图数据read_status的某一位的值为0有两种情况:该位对应的群组成员已阅读消息标识message_id对应的消息和该位对应的群组成员已退群。A certain bit of the second bitmap data read_status has a value of 0 in two situations: the group member corresponding to this bit has read the message corresponding to the message identifier message_id and the group member corresponding to this bit has left the group.

因此并不能直接确定哪些群组成员已阅读消息标识message_id对应的消息,本发明实施例采用将第二位图数据read_status和群成员快照位图数据member_bitmap按位异或的方法,得到第三位图数据bitmap,这样就能将第二位图数据read_status中对应已退群成员的位为0的值置为1,因而发送端就能了解到哪些成员已经阅读了消息标识message_id对应的消息。Therefore, it is impossible to directly determine which group members have read the message corresponding to the message identifier message_id. The embodiment of the present invention adopts the method of bitwise XORing the second bitmap data read_status and the group member snapshot bitmap data member_bitmap to obtain the third bitmap data bitmap, so that the value of the bit corresponding to the retired member in the second bitmap data read_status that is 0 can be set to 1, so that the sender can know which members have read the message corresponding to the message identifier message_id.

返回模块350,用于遍历第三位图数据,向发送端返回消息的阅读状态。The return module 350 is configured to traverse the third bitmap data and return the reading status of the message to the sender.

第三位图数据bitmap的每一位代表对应成员序列号的成员的阅读状态,将第三位图数据bitmap返回给发送端,发送端就能了解到每一个成员的消息阅读情况。Each bit of the third bitmap data bitmap represents the reading status of the member corresponding to the member serial number, and the third bitmap data bitmap is returned to the sender, and the sender can know the message reading status of each member.

根据本实施例提供的即时消息阅读状态的记录装置,在接收到发送端发送的消息之后,根据接收端的记录生成第一位图数据;在接收到接收端返回的消息阅读通知之后,根据消息阅读通知修改第一位图数据得到第二位图数据,第二位图数据记录了即时消息的阅读状态,以便向发送端返回消息的阅读状态。本发明利用位图记录每个接收端的阅读状态,将每个接收端的阅读状态的记录压缩为1bit,与现有技术至少占用16字节的一条记录相比,大大节省了数据存储空间,由此解决了给数据库带来巨大的数据写入压力及信息存储压力的问题;通过获取群成员快照位图数据,确认群组中的有效成员,并采用第三位图数据将已退群成员的阅读状态和有效成员的阅读状态区别标识,这样发送端就能直接通过第三位图数据来判断已经阅读了消息的成员,无须参照其他信息,使发送端获取阅读状态的方式更为简捷。。According to the recording device of the instant message reading state provided by this embodiment, after receiving the message sent by the sending end, the first bitmap data is generated according to the record of the receiving end; The notification modifies the first bitmap data to obtain the second bitmap data, and the second bitmap data records the reading status of the instant message, so as to return the reading status of the message to the sending end. The present invention uses a bitmap to record the reading state of each receiving end, and compresses the record of the reading state of each receiving end into 1 bit, which greatly saves the data storage space compared with a record occupying at least 16 bytes in the prior art, thus It solves the problem of huge data writing pressure and information storage pressure on the database; by obtaining the snapshot bitmap data of group members, confirm the valid members in the group, and use the third bitmap data to read The status and the reading status of valid members are distinguished, so that the sender can directly judge the members who have read the message through the third bitmap data, without referring to other information, making the way for the sender to obtain the reading status simpler. .

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的即时消息阅读状态的记录装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) can be used in practice to realize some or all functions of some or all of the components in the device for recording instant message reading status according to the embodiment of the present invention . The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

本发明公开了:A1.一种即时消息阅读状态的记录方法,包括:The invention discloses: A1. A method for recording instant message reading status, comprising:

接收发送端向接收端发送的消息,为所述消息生成消息标识;receiving a message sent from the sending end to the receiving end, and generating a message identifier for the message;

根据所述接收端的记录生成第一位图数据,存储所述消息标识与所述第一位图数据;generating first bitmap data according to the record at the receiving end, storing the message identifier and the first bitmap data;

将所述消息发送给接收端;sending the message to the receiving end;

接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据;Receive the message reading notification returned by the receiving end, modify the first bitmap data according to the message reading notification, and obtain the second bitmap data;

根据所述第二位图数据,向发送端返回消息的阅读状态。According to the second bitmap data, the reading status of the message is returned to the sending end.

A2.根据A1所述的方法,所述接收端为群组成员;A2. According to the method described in A1, the receiving end is a group member;

所述根据所述接收端的记录生成第一位图数据具体为:根据群组标识查询群组成员的记录,根据所述群组成员的记录生成第一位图数据。The generating the first bitmap data according to the records of the receiving end specifically includes: querying the records of the group members according to the group identifier, and generating the first bitmap data according to the records of the group members.

A3.根据A2所述的方法,所述根据群组标识查询群组成员的记录,根据所述群组成员的记录生成第一位图数据具体为:A3. According to the method described in A2, the record of the group member is queried according to the group identifier, and the first bitmap data is generated according to the record of the group member is specifically:

根据群组标识查询群组内有效成员的记录,根据所述群组内有效成员生成第一位图数据。The records of effective members in the group are queried according to the group identifier, and the first bitmap data is generated according to the effective members in the group.

A4.根据A3所述的方法,所述根据群组标识查询群组内有效成员的记录,根据所述群组内有效成员生成第一位图数据进一步包括:A4. According to the method described in A3, the record of valid members in the query group according to the group identifier, generating the first bitmap data according to the valid members in the group further includes:

根据群组标识查询群组内有效成员的记录;Query the records of valid members in the group according to the group ID;

查询群组内有效成员对应的成员序列号;Query the member serial number corresponding to the valid member in the group;

将位图中群组内有效成员对应的成员序列号对应的位置的数据置为第一数据,得到第一位图数据。The data at the position corresponding to the member serial number corresponding to the valid member in the group in the bitmap is set as the first data, and the first bitmap data is obtained.

A5.根据A1所述的方法,所述接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据进一步包括:A5. According to the method described in A1, the message reading notification returned by the receiving end is received, the first bitmap data is modified according to the message reading notification, and the second bitmap data obtained further includes:

接收群组成员返回的消息阅读通知;Receive message reading notifications returned by group members;

根据消息阅读通知确定返回消息阅读通知的群组成员对应的成员序列号;Determine the member serial number corresponding to the group member who returned the message reading notification according to the message reading notification;

将第一位图数据对应的位图中返回消息阅读通知的群组成员对应的成员序列号对应的位置的数据置为第二数据,得到第二位图数据。Set the data at the position corresponding to the member serial number corresponding to the group member who returned the message reading notification in the bitmap corresponding to the first bitmap data as the second data, and obtain the second bitmap data.

A6.根据A1所述的方法,在所述根据所述第二位图数据,向发送端返回消息的阅读状态之前,所述方法还包括:根据群组标识和消息标识获取群组成员快照位图数据,所述群组成员快照位图数据根据群组内的未退群成员与已退群成员的快照记录而设定。A6. According to the method described in A1, before the reading state of the message is returned to the sender according to the second bitmap data, the method further includes: acquiring group member snapshot bits according to the group ID and the message ID Map data, the snapshot bitmap data of the group members is set according to the snapshot records of the members who have not left the group and the members who have left the group.

A7.根据A6所述的方法,所述根据所述第二位图数据,向发送端返回消息的阅读状态进一步包括:A7. According to the method described in A6, according to the second bitmap data, returning the reading status of the message to the sending end further includes:

将所述群组成员快照位图数据和所述第二位图数据进行按位操作,得到用来记录群组成员阅读状态的第三位图数据;performing a bitwise operation on the group member snapshot bitmap data and the second bitmap data to obtain third bitmap data used to record the reading status of the group members;

遍历所述第三位图数据,向发送端返回消息的阅读状态。Traverse the third bitmap data, and return the reading status of the message to the sender.

本发明还公开了:B8.一种即时消息阅读状态的记录装置,包括:The present invention also discloses: B8. A recording device for instant message reading state, comprising:

接收模块,用于接收发送端向接收端发送的消息,为所述消息生成消息标识;A receiving module, configured to receive a message sent from the sending end to the receiving end, and generate a message identifier for the message;

生成模块,用于根据所述接收端的记录生成第一位图数据,存储所述消息标识与所述第一位图数据;A generating module, configured to generate first bitmap data according to the record at the receiving end, and store the message identifier and the first bitmap data;

发送模块,用于将所述消息发送给接收端;a sending module, configured to send the message to the receiving end;

修改模块,用于接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据;The modification module is used to receive the message reading notification returned by the receiving end, and modify the first bitmap data according to the message reading notification to obtain the second bitmap data;

返回模块,用于根据所述第二位图数据,向发送端返回消息的阅读状态。The returning module is used to return the reading status of the message to the sending end according to the second bitmap data.

B9.根据B8所述的装置,所述接收端为群组成员;B9. According to the device described in B8, the receiving end is a group member;

所述生成模块进一步用于:根据群组标识查询群组成员的记录,根据所述群组成员的记录生成第一位图数据。The generating module is further configured to: query the records of the group members according to the group identifier, and generate the first bitmap data according to the records of the group members.

B10.根据B9所述的装置,所述生成模块进一步用于:根据群组标识查询群组内有效成员的记录,根据所述群组内有效成员生成第一位图数据。B10. The device according to B9, the generating module is further configured to: query the records of valid members in the group according to the group identifier, and generate the first bitmap data according to the valid members in the group.

B11.根据B10所述的装置,所述生成模块进一步用于:B11. according to the device described in B10, the generating module is further used for:

根据群组标识查询群组内有效成员的记录;Query the records of valid members in the group according to the group ID;

查询群组内有效成员对应的成员序列号;Query the member serial number corresponding to the valid member in the group;

将位图中群组内有效成员对应的成员序列号对应的位置的数据置为第一数据,得到第一位图数据。The data at the position corresponding to the member serial number corresponding to the valid member in the group in the bitmap is set as the first data, and the first bitmap data is obtained.

B12.根据B8所述的装置,所述修改模块进一步包括:B12. The device according to B8, the modification module further comprising:

接收单元,用于接收群组成员返回的消息阅读通知;The receiving unit is used to receive the message reading notification returned by the group members;

确定单元,用于根据消息阅读通知确定返回消息阅读通知的群组成员对应的成员序列号;A determining unit, configured to determine the member serial number corresponding to the group member returning the message reading notification according to the message reading notification;

设置单元,用于将第一位图数据对应的位图中返回消息阅读通知的群组成员对应的成员序列号对应的位置的数据置为第二数据,得到第二位图数据。The setting unit is used to set the data at the position corresponding to the member serial number corresponding to the group member who returns the message reading notification in the bitmap corresponding to the first bitmap data as the second data to obtain the second bitmap data.

B13.根据B8所述的装置,所述装置进一步包括:获取模块,用于根据群组标识和消息标识获取群组成员快照位图数据,所述群组成员快照位图数据根据群组内的未退群成员与已退群成员的快照记录而设定。B13. According to the device described in B8, the device further includes: an acquisition module, used to obtain group member snapshot bitmap data according to the group identifier and message identifier, and the group member snapshot bitmap data is based on the information in the group It is set based on the snapshot records of members who have not withdrawn from the group and those who have withdrawn from the group.

B14.根据B13所述的装置,所述装置进一步包括:操作模块,用于将所述群组成员快照位图数据和所述第二位图数据进行按位操作,得到用来记录群组成员阅读状态的第三位图数据;B14. according to the device described in B13, the device further includes: an operation module, which is used to perform a bitwise operation on the group member snapshot bitmap data and the second bitmap data to obtain the group member used to record Read the third bitmap data of the state;

所述返回模块进一步用于:遍历所述第三位图数据,向发送端返回消息的阅读状态。The returning module is further configured to: traverse the third bitmap data, and return the reading status of the message to the sending end.

Claims (10)

1.一种即时消息阅读状态的记录方法,包括:1. A method for recording instant message reading status, comprising: 接收发送端向接收端发送的消息,为所述消息生成消息标识;receiving a message sent from the sending end to the receiving end, and generating a message identifier for the message; 根据所述接收端的记录生成第一位图数据,存储所述消息标识与所述第一位图数据;generating first bitmap data according to the record at the receiving end, storing the message identifier and the first bitmap data; 将所述消息发送给接收端;sending the message to the receiving end; 接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据;Receive the message reading notification returned by the receiving end, modify the first bitmap data according to the message reading notification, and obtain the second bitmap data; 根据所述第二位图数据,向发送端返回消息的阅读状态。According to the second bitmap data, the reading status of the message is returned to the sending end. 2.根据权利要求1所述的方法,所述接收端为群组成员;2. The method according to claim 1, wherein the receiving end is a group member; 所述根据所述接收端的记录生成第一位图数据具体为:根据群组标识查询群组成员的记录,根据所述群组成员的记录生成第一位图数据。The generating the first bitmap data according to the records of the receiving end specifically includes: querying the records of the group members according to the group identifier, and generating the first bitmap data according to the records of the group members. 3.根据权利要求2所述的方法,所述根据群组标识查询群组成员的记录,根据所述群组成员的记录生成第一位图数据具体为:3. The method according to claim 2, said querying the record of the group member according to the group identifier, generating the first bitmap data according to the record of the group member is specifically: 根据群组标识查询群组内有效成员的记录,根据所述群组内有效成员生成第一位图数据。The records of effective members in the group are queried according to the group identifier, and the first bitmap data is generated according to the effective members in the group. 4.根据权利要求3所述的方法,所述根据群组标识查询群组内有效成员的记录,根据所述群组内有效成员生成第一位图数据进一步包括:4. The method according to claim 3, said querying the records of valid members in the group according to the group identifier, and generating the first bitmap data according to the valid members in the group further comprising: 根据群组标识查询群组内有效成员的记录;Query the records of valid members in the group according to the group ID; 查询群组内有效成员对应的成员序列号;Query the member serial number corresponding to the valid member in the group; 将位图中群组内有效成员对应的成员序列号对应的位置的数据置为第一数据,得到第一位图数据。The data at the position corresponding to the member serial number corresponding to the valid member in the group in the bitmap is set as the first data, and the first bitmap data is obtained. 5.根据权利要求1所述的方法,所述接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据进一步包括:5. The method according to claim 1, said receiving the message reading notification returned by the receiving end, modifying the first bitmap data according to the message reading notification, and obtaining the second bitmap data further comprising: 接收群组成员返回的消息阅读通知;Receive message reading notifications returned by group members; 根据消息阅读通知确定返回消息阅读通知的群组成员对应的成员序列号;Determine the member serial number corresponding to the group member who returned the message reading notification according to the message reading notification; 将第一位图数据对应的位图中返回消息阅读通知的群组成员对应的成员序列号对应的位置的数据置为第二数据,得到第二位图数据。Set the data at the position corresponding to the member serial number corresponding to the group member who returned the message reading notification in the bitmap corresponding to the first bitmap data as the second data, and obtain the second bitmap data. 6.根据权利要求1所述的方法,在所述根据所述第二位图数据,向发送端返回消息的阅读状态之前,所述方法还包括:根据群组标识和消息标识获取群组成员快照位图数据,所述群组成员快照位图数据根据群组内的未退群成员与已退群成员的快照记录而设定。6. The method according to claim 1, before returning the reading status of the message to the sender according to the second bitmap data, the method further comprises: obtaining group members according to the group ID and the message ID Snapshot bitmap data, the snapshot bitmap data of group members is set according to the snapshot records of members who have not left the group and members who have left the group. 7.根据权利要求6所述的方法,所述根据所述第二位图数据,向发送端返回消息的阅读状态进一步包括:7. The method according to claim 6, wherein according to the second bitmap data, returning the reading status of the message to the sending end further comprises: 将所述群组成员快照位图数据和所述第二位图数据进行按位操作,得到用来记录群组成员阅读状态的第三位图数据;performing a bitwise operation on the group member snapshot bitmap data and the second bitmap data to obtain third bitmap data used to record the reading status of the group members; 遍历所述第三位图数据,向发送端返回消息的阅读状态。Traverse the third bitmap data, and return the reading status of the message to the sender. 8.一种即时消息阅读状态的记录装置,包括:8. A device for recording instant message reading status, comprising: 接收模块,用于接收发送端向接收端发送的消息,为所述消息生成消息标识;A receiving module, configured to receive a message sent from the sending end to the receiving end, and generate a message identifier for the message; 生成模块,用于根据所述接收端的记录生成第一位图数据,存储所述消息标识与所述第一位图数据;A generating module, configured to generate first bitmap data according to the record at the receiving end, and store the message identifier and the first bitmap data; 发送模块,用于将所述消息发送给接收端;a sending module, configured to send the message to the receiving end; 修改模块,用于接收接收端返回的消息阅读通知,根据消息阅读通知对第一位图数据进行修改,得到第二位图数据;The modification module is used to receive the message reading notification returned by the receiving end, and modify the first bitmap data according to the message reading notification to obtain the second bitmap data; 返回模块,用于根据所述第二位图数据,向发送端返回消息的阅读状态。The returning module is used to return the reading status of the message to the sending end according to the second bitmap data. 9.根据权利要求8所述的装置,所述接收端为群组成员;9. The device according to claim 8, wherein the receiving end is a group member; 所述生成模块进一步用于:根据群组标识查询群组成员的记录,根据所述群组成员的记录生成第一位图数据。The generating module is further configured to: query the records of the group members according to the group identifier, and generate the first bitmap data according to the records of the group members. 10.根据权利要求9所述的装置,所述生成模块进一步用于:根据群组标识查询群组内有效成员的记录,根据所述群组内有效成员生成第一位图数据。10. The device according to claim 9, the generating module is further configured to: query records of valid members in the group according to the group ID, and generate first bitmap data according to the valid members in the group.
CN201710051105.3A 2017-01-23 2017-01-23 Method and device for recording instant message reading status Active CN106844662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710051105.3A CN106844662B (en) 2017-01-23 2017-01-23 Method and device for recording instant message reading status

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710051105.3A CN106844662B (en) 2017-01-23 2017-01-23 Method and device for recording instant message reading status

Publications (2)

Publication Number Publication Date
CN106844662A true CN106844662A (en) 2017-06-13
CN106844662B CN106844662B (en) 2020-12-04

Family

ID=59120507

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710051105.3A Active CN106844662B (en) 2017-01-23 2017-01-23 Method and device for recording instant message reading status

Country Status (1)

Country Link
CN (1) CN106844662B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948050A (en) * 2017-11-08 2018-04-20 用友网络科技股份有限公司 A kind of device and method that group message read states are provided
CN108228759A (en) * 2017-12-22 2018-06-29 金蝶软件(中国)有限公司 Storage processing method, device, computer equipment and the storage medium of record set
CN109977117A (en) * 2019-03-18 2019-07-05 广州虎牙信息科技有限公司 The method and device that storage method, the data of status data are sent
CN113645123A (en) * 2021-08-03 2021-11-12 福建天泉教育科技有限公司 A message storage method and terminal
CN113704339A (en) * 2021-08-30 2021-11-26 平安普惠企业管理有限公司 Recording of read information status, apparatus, device and storage medium
CN115955450A (en) * 2023-03-09 2023-04-11 美云智数科技有限公司 Instant message display method, instant message push method, instant message display device, instant message push device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060258336A1 (en) * 2004-12-14 2006-11-16 Michael Sajor Apparatus an method to store and forward voicemail and messages in a two way radio
CN103547342A (en) * 2013-05-14 2014-01-29 华为技术有限公司 Message sending method, message reading notification method, message receiving method and device
CN105024787A (en) * 2014-08-29 2015-11-04 魅族科技(中国)有限公司 Data transmission method, associated device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060258336A1 (en) * 2004-12-14 2006-11-16 Michael Sajor Apparatus an method to store and forward voicemail and messages in a two way radio
CN103547342A (en) * 2013-05-14 2014-01-29 华为技术有限公司 Message sending method, message reading notification method, message receiving method and device
CN105024787A (en) * 2014-08-29 2015-11-04 魅族科技(中国)有限公司 Data transmission method, associated device and system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948050A (en) * 2017-11-08 2018-04-20 用友网络科技股份有限公司 A kind of device and method that group message read states are provided
CN108228759A (en) * 2017-12-22 2018-06-29 金蝶软件(中国)有限公司 Storage processing method, device, computer equipment and the storage medium of record set
CN108228759B (en) * 2017-12-22 2021-07-27 金蝶软件(中国)有限公司 Record set storage processing method and device, computer equipment and storage medium
CN109977117A (en) * 2019-03-18 2019-07-05 广州虎牙信息科技有限公司 The method and device that storage method, the data of status data are sent
CN113645123A (en) * 2021-08-03 2021-11-12 福建天泉教育科技有限公司 A message storage method and terminal
CN113704339A (en) * 2021-08-30 2021-11-26 平安普惠企业管理有限公司 Recording of read information status, apparatus, device and storage medium
CN115955450A (en) * 2023-03-09 2023-04-11 美云智数科技有限公司 Instant message display method, instant message push method, instant message display device, instant message push device, electronic equipment and storage medium
CN115955450B (en) * 2023-03-09 2023-06-30 美云智数科技有限公司 Instant message display and push method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN106844662B (en) 2020-12-04

Similar Documents

Publication Publication Date Title
CN106844662B (en) Method and device for recording instant message reading status
US11134046B2 (en) Apparatus and method for maintaining a message thread with opt-in permanence for entries
EP4184889B1 (en) Apparatus and method for maintaining a message thread with opt-in permanence for entries
US9450902B2 (en) Method and system for marking email threads
CN107465592B (en) Message interaction method and system
US20170041254A1 (en) Contextual content sharing using conversation medium
CN102769687B (en) Information mass sending system and method
CN101350790A (en) File transfer method and device based on instant messaging system
CN103404087B (en) Be used for the method and system of Publish-subscribe environment publisher's coordinate cooperation
CN105515900A (en) Method and device for acquiring on-line state of terminal
CN108429670A (en) Message method, message receival method and terminal
WO2012171404A1 (en) Method, device and system for sharing microblog message
CN105813032A (en) Information sending method and server
JP2013541298A (en) Email address concealment method and apparatus
WO2012022083A1 (en) Method for transmitting expression file and terminal equipment
CN105376137A (en) Instant messaging method and device
CN102387089B (en) Method and server for transporting messages
US20130346520A1 (en) Method, device and email system for providing public email
CN104463556A (en) Tidying and finding method and system for E-mail text citation information
CN109309613B (en) Mail delivery method, device and system
CN102223318A (en) Method and system for processing emails
CN102421073A (en) Method and device for processing short messages
US20110191427A1 (en) Communication method adapted for users using multiple communication facilities
CN103139723B (en) Multimedia message information processing method and system and equipment
CN103297248B (en) A kind of notification method and device of microblogging client-side information

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