CN111177363A - Group message writing method, device, server and storage medium - Google Patents

Group message writing method, device, server and storage medium Download PDF

Info

Publication number
CN111177363A
CN111177363A CN201911400280.4A CN201911400280A CN111177363A CN 111177363 A CN111177363 A CN 111177363A CN 201911400280 A CN201911400280 A CN 201911400280A CN 111177363 A CN111177363 A CN 111177363A
Authority
CN
China
Prior art keywords
group
message
group message
copies
writing
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
CN201911400280.4A
Other languages
Chinese (zh)
Other versions
CN111177363B (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.)
Guangzhou Baiguoyuan Information Technology Co Ltd
Original Assignee
Guangzhou Baiguoyuan 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 Guangzhou Baiguoyuan Information Technology Co Ltd filed Critical Guangzhou Baiguoyuan Information Technology Co Ltd
Priority to CN201911400280.4A priority Critical patent/CN111177363B/en
Publication of CN111177363A publication Critical patent/CN111177363A/en
Application granted granted Critical
Publication of CN111177363B publication Critical patent/CN111177363B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9035Filtering based on additional data, e.g. user or group profiles
    • 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/06Message adaptation to terminal or network requirements
    • 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/52User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail for supporting social networking services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a group message writing method, a group message writing device, a server and a storage medium. Wherein, the method comprises the following steps: respectively converting the group message at the current moment into group message copies forwarded to each member to be issued in the group to which the group message copies belong; if the total amount of the group message copies reaches a preset message service threshold, calculating scores of the group message copies according to group session value information of the group message copies under the group to which the group message copies belong, and sequentially writing the group message copies in a database according to the scores. According to the technical scheme provided by the embodiment of the invention, the group message copies do not need to be written in batch under the write diffusion, and the group message copies are written and sorted by grading the height, so that the condition of database avalanche during batch writing is avoided, the group messages are effectively written under the peak message amount, the writing pressure of the group messages under the peak message amount is reduced, and the writing quality of the group messages is improved.

Description

Group message writing method, device, server and storage medium
Technical Field
The embodiment of the invention relates to the field of message processing, in particular to a writing method and device of group messages, a server and a storage medium.
Background
With the rapid development of the internet technology, a large number of different topic groups are correspondingly opened in the internet aiming at various different discussion topics, and any conversation party participating in a certain topic group can read group messages written in the topic group by other conversation parties; the writing mode of the group message generally includes a read diffusion based on a larger group participation amount and a write diffusion based on a smaller group participation amount.
For read diffusion, when a server receives a group message of a certain conversation party, the server firstly writes the group message into a corresponding group message table, other conversation parties spontaneously pull the group message, and correspondingly updates the read subscript bits of the group message of each other conversation party; for write diffusion, when receiving a group message of a certain session party, the server writes the group message into a corresponding group message table and personal message tables of other session parties, so as to directly issue the group message to other session parties. When the hot topic is faced, the server receives a large number of group messages of conversation parties in different groups at the same time for write diffusion, and writes the group messages into the group message table and the corresponding personal message table in batch, so that the group messages have high-frequency peak flow, great pressure is caused for writing the group messages under the write diffusion, and the problem that a correspondingly written database has cache avalanche is easily caused.
Disclosure of Invention
The embodiment of the invention provides a group message writing method, a group message writing device, a server and a storage medium, which can reduce the writing pressure of a group message under a peak message amount and improve the writing availability of the group message.
In a first aspect, an embodiment of the present invention provides a method for writing a group message, where the method includes:
respectively converting the group message at the current moment into group message copies forwarded to each member to be issued in the group to which the group message copies belong;
if the total amount of the group message copies reaches a preset message service threshold, calculating scores of the group message copies according to group session value information of the group message copies under the group to which the group message copies belong, and sequentially writing the group message copies in a database according to the scores.
In a second aspect, an embodiment of the present invention provides an apparatus for writing a group message, where the apparatus includes:
the message copy conversion module is used for respectively converting the group messages at the current moment into group message copies forwarded to each member to be issued in the affiliated group;
and the message writing module is used for calculating the score of the group message copies according to the group session value information of the group message copies under the group to which the group message copies belong and sequentially writing the group message copies into a database according to the score if the total amount of the group message copies reaches a preset message service threshold.
In a third aspect, an embodiment of the present invention provides a server, where the server includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the group message writing method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a group message writing method according to any embodiment of the present invention.
The group message writing method, the device, the server and the storage medium provided by the embodiment of the invention firstly respectively convert each group message at the current moment into the group message copy forwarded to each member to be issued in the group, then respectively write each group message copy into the corresponding storage area of the database, at the moment, if the total amount of the group message copies reaches the preset message service threshold, judge the group session value information of each group message copy aiming at different members to be issued under the group, and calculate the score of each group message copy, then sequentially write each group message copy in the corresponding storage area of the database according to the score, at the moment, the group message copies are not required to be written in batch under write diffusion, and the condition of database avalanche during batch writing is avoided by writing the score into sequencing of the group message copies, the method and the device ensure the effective writing of the group messages under the peak message volume, reduce the writing pressure of the group messages under the peak message volume and improve the writing quality of the group messages.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1A is a flowchart of a group message writing method according to an embodiment of the present invention;
fig. 1B is a schematic diagram illustrating a writing process of a group message according to an embodiment of the present invention;
fig. 2A is a flowchart of a group message writing method according to a second embodiment of the present invention;
fig. 2B is a schematic diagram illustrating a writing process of a group message according to a second embodiment of the present invention;
fig. 3A is a flowchart of a group message writing method according to a third embodiment of the present invention;
fig. 3B is a schematic diagram illustrating a writing process of a group message according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a writing apparatus for group messages according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures. In addition, the embodiments and features of the embodiments in the present invention may be combined with each other without conflict.
Example one
Fig. 1A is a flowchart of a group message writing method according to an embodiment of the present invention, which can be applied to any case of writing a group message in a database in a write-diffusion manner. The group message writing method provided in this embodiment may be executed by the group message writing device provided in the embodiment of the present invention, and the device may be implemented in a software and/or hardware manner, and is integrated in a server that executes the method, where the server may be a background server corresponding to an application program having a group session function.
Specifically, referring to fig. 1A, the method may include the steps of:
s110, the group messages at the current moment are respectively converted into group message copies forwarded to each member to be issued in the affiliated group.
Specifically, the existing group message writing mode generally includes read diffusion and write diffusion, and for the write diffusion mode, when the server receives a group message reported by any member of a certain group at the current time, the server will correspondingly write the group message to each other member of the group to which the server is required to forward the group message, that is, the write diffusion mode requires that for each group message, multiple copies are correspondingly written to each other member of the group to which the server belongs, and at this time, in the face of a hot topic, a high-frequency write peak occurs in the multiple writes of the group message, thereby causing a large pressure to the writing of the group message, so the present embodiment optimizes the process of writing the group message in the high-peak message amount by using the write diffusion mode.
At this time, since the write-spreading manner requires that a plurality of copies of the group message reported by the reporting member in a certain group are written correspondingly for other members of the belonging group, this embodiment may first obtain a group message copy written for each other member of the belonging group, where the group message copy is consistent with the original message content contained in the received group message, and only additionally carries the member information correspondingly issued in the belonging group for distinguishing each group message copy.
In this embodiment, since multiple groups in the message service system all participate in discussions on a hot topic, a server may receive a large amount of group messages at the current time, and the group messages may be obtained by reporting members in different groups at the current time, as shown in fig. 1B, for each group message, this embodiment first determines that a reporting member of the group message selects a group to which the group message belongs when reporting the group message, and searches for each to-be-issued member in the group to which the group message needs to be forwarded, and further converts the group message into multiple corresponding group message copies under each to-be-issued member, where each group message copy contains the same message content as the group message and additionally carries the to-be-issued member information correspondingly forwarded in the group to which the group message belongs; therefore, the steps are executed for each group message at the current moment, and each group message is converted into a group message copy forwarded to each member to be issued in the group.
And S120, if the total amount of the group message copies reaches a preset message service threshold, calculating scores of the group message copies according to the group session value information of the group message copies in the group to which the group message copies belong, and sequentially writing the group message copies into the database according to the scores.
Specifically, after each group message from different groups at the current time is correspondingly converted into a group message copy forwarded to each to-be-issued member in the belonging group, in order to avoid message write pressure caused by a write diffusion manner under a peak message volume, in this embodiment, before each group message copy is respectively written into a storage area of the to-be-issued member corresponding to the group message copy under the database, it is first required to determine whether the total amount of the group message copy at the current time is within the execution capacity range that can be borne by the server, at this time, the embodiment represents the execution capacity range that can be borne by the server by a preset message service threshold, if the total amount of the group message copy reaches the preset message service threshold, it is described that the processing amount of the group message copy at the current time is too large, which may cause a large message write pressure, the group session value information of each group message copy under the group is used to represent the importance degree of the group message copy relative to the assigned member to be issued in the group, for example, for the group message copy corresponding to each member to be issued in the same group, because the active member to be issued in the group has stronger group influence than the inactive member to be issued, the group message copy corresponding to the active member to be issued has stronger group influence than the inactive member to be issued, and thus the group message copy corresponding to the inactive member to be issued in the group The value information of the group session of the copy is higher, so that the subsequent priority writing of the group message copy corresponding to the active member to be issued in the database is ensured.
It should be noted that the database in this embodiment may be a local database, or may be a database configured on another storage device.
Meanwhile, the embodiment can analyze various types of information carried by the group message copies in advance, which may affect the group session value information of the group message copies under the group to which the group message copies belong, such as the active state of the group to which the group belongs, the active states of the matched message reporting members and the members to be issued in the group to which the group belongs, and the online and offline states, and the like, comprehensively determine the group session value information of each group message copy under the group to which the group message copies correspondingly forwarded to the members to be issued under different groups by uniformly analyzing the value affecting factors in the various types of information carried by each group message copy, respectively evaluate the scores of the group message copies according to the level of the group session value information corresponding to each group message copy, and indicate the importance degree of each group copy message through the scores, and sequentially writing all group message copies in the local database according to the grade, thereby ensuring the ordered writing of the group messages under the peak message volume, reducing the message writing pressure under the peak message volume, simultaneously enabling the group message copies with high group conversation value to be written preferentially, further enabling the group messages to be issued preferentially to the corresponding members to be issued in the group, and ensuring the preferential accessibility of the high-value group messages in a large amount of group messages at the current moment.
Optionally, there are multiple factors that can affect the group session value information of the group message replica under the group to which the group message replica belongs in various types of information carried by the group message replica, in this embodiment, the group session value information of the group message replica under the group to which the group message replica belongs is uniformly analyzed in terms of the activity degree of the group to which each group message replica belongs, the session states of the message reporting members and the members to be issued matched under the group to which the group message replica belongs, and the calculating the score of the group message replica according to the group session value information of the group message replica under the group to which the group message replica belongs may specifically include: respectively calculating the value scores of the group message copies in the corresponding value dimensions according to the activity degree of the group to which the group message copies belong and the session states of the message reporting members and the members to be issued matched with the group message copies under the group to which the group message copies belong; and carrying out weighted summation on the value scores of the group message duplicates under different value dimensions, and calculating the score of the group message duplicate.
Specifically, in this embodiment, different value dimensions included in the value influence factors of each group message copy are respectively set as the active state of the group to which the group belongs, and the session states of the matched message reporting member and the to-be-issued member under the group to which the group belongs, and at this time, because the online and offline states of each to-be-issued member in the group to which the group belongs are different at the current time, the session states may include the active states of the matched message reporting member and the to-be-issued member under the group to which the group belongs, and the online or offline states of the to-be-issued member at the current time; at this time, aiming at each group message copy, analyzing the activity degree of the group to which the group message copy belongs, and scoring the activity degree of the group to which the group message copy belongs, meanwhile, the activity degree of the matched message reporting members of the group message copy under the belonged group is analyzed, the activity degree of the message reporting members corresponding to the group message copy is scored, analyzing the activity degree and online/offline state of the matched members to be issued under the group to which the group message copy belongs, and respectively scoring the activity degree and online/offline state of the members to be issued corresponding to the group message copy, thereby obtaining the value scores of the group message copy under different value dimensions, then, weighting and summing the value scores of the group message copies under different value dimensions by adopting the weight preset for each value dimension to obtain the score of the group message copies; and then, calculating the score of each group message copy by adopting the same steps so as to write each group message copy in the local database sequentially according to the score, thereby ensuring the ordered writing of the group messages under the high message quantity.
The technical solution provided by this embodiment is to first convert each group message at the current time into a group message copy forwarded to each member to be issued in the belonging group, then write each group message copy into the corresponding storage area of the database, at this time, if the total amount of the group message copies reaches a preset message service threshold, determine the group session value information of each group message copy for different members to be issued under the belonging group, and calculate the score of each group message copy, then write each group message copy in the corresponding storage area of the database according to the score, at this time, the group message copies need not be written in batch under write diffusion, and the write ordering of the group message copies is performed by the score, thereby avoiding the occurrence of data base avalanche during batch write, and ensuring the effective write of the group message under the peak message amount, the writing pressure of the group message under the peak message volume is reduced, and the writing quality of the group message is improved.
Example two
Fig. 2A is a flowchart of a group message writing method according to a second embodiment of the present invention, and fig. 2B is a schematic diagram of a writing process of a group message according to the second embodiment of the present invention. The present embodiment is optimized based on the above embodiments, and the present embodiment mainly explains in detail the specific process of sequentially writing each copy of the group message in the database.
Optionally, as shown in fig. 2A, this embodiment may include the following steps:
s210, the group messages at the current moment are respectively converted into group message copies forwarded to each member to be issued in the affiliated group.
S220, judging whether the total amount of the group message copies reaches a preset message service threshold value; if yes, go to S230; if not, go to S260.
And S230, calculating the score of the group message copy according to the group session value information of the group message copy under the group to which the group message copy belongs.
S240, according to the scores of the group message copies, writing the group message copies into message queues under different priorities respectively.
Optionally, in this embodiment, if the total amount of the group message copies reaches a preset message service threshold, and after the score of each group message copy at the current time is calculated, to avoid write omission of the group message copies, the group message copies may be cached in the corresponding message queues in advance according to the score levels, and considering that when one message queue is used to cache all the group message copies, the message queue may have a fault due to an excessively large message caching amount, so that in this embodiment, a plurality of message queues under different priorities may be used to cache each group message copy, as shown in fig. 2B, and corresponding score ranges are set in advance for priorities corresponding to different message queues; furthermore, in this embodiment, first, according to the priority corresponding to the scoring range where the score of each group message copy is located, each group message copy is sequentially divided into message queues under the corresponding priority according to the score, and cached, and then, each group message copy is sequentially read from each message queue according to the priority and written into the local database.
And S250, sequentially reading the group message copies in each message queue at regular time according to the priority of the message queue, and correspondingly writing the read group message copies into a database.
In this embodiment, the reading timing of the message queues is preset, so that when a certain number of group message copies are cached in the message queues under different priorities, the message queues can be sequentially traversed according to the priorities of the message queues at regular time, so as to sequentially read the group message copies in each message queue, and correspondingly write the read and stored group message copies into the local database.
Illustratively, the group message copies cached in the message queue at the highest priority are sequentially read and sequentially written into the corresponding storage areas in the local database, after all the reading is completed, the group message copies cached in the message queue at the next priority are sequentially read and sequentially written into the corresponding storage areas in the local database, and the process is sequentially circulated, at this time, in the worst case, the group message copies cached in the message list at the lowest priority may be written into the corresponding storage areas in the local database after the peak message amount is exceeded.
At this time, in this embodiment, for correspondingly writing the read group message copy into the local database, the method may specifically include: and correspondingly writing the read group message copy into a personal message table distributed by the matched members to be issued under the group to which the group message copy belongs under the local database.
Specifically, since the write diffusion method stores a plurality of copies of the group message, the local database may include a group message table for writing all the group messages and a group message copy distributed to each to-be-issued member of different groups and used for writing the group message copy forwarded to the to-be-issued member in the belonging group; therefore, after receiving group messages of different groups, the present embodiment directly writes the group message into a group message table corresponding to the group in a local database, and writes a group message copy obtained by converting the group message into a personal message table pre-assigned to a member to be issued to which the group message copy matches under the group under the local database according to the reading condition of the message queues with the scores at different priorities, so as to issue the group message copy to the member to be issued in time.
S260, judging whether other unread group message copies of the group message copies matched in the affiliated group and under the to-be-issued members exist in the message queues under each priority level; if yes, go to S270; if not, go to step S280.
Optionally, after receiving group messages from different groups and converting each group message into a group message copy forwarded to each to-be-issued member in the belonging group, if the total amount of the group message copies does not reach a preset message service threshold, it indicates that the processing amount of the group message copies at the current time is not large, and in a message processing range that can be borne by a server, there is no need to limit the writing of the group message copies, and at this time, since a message queue sets a corresponding message reading rate and occupies a part of message services, the message service threshold in this embodiment can be determined by a message service bearing upper limit and the message reading amount of the message queue; in addition, since the current limiting operation may be executed before, so that the group message copies which are reported before the current time and need to be forwarded to each member to be issued may be buffered in the message queues under different priorities, and are not read and written, in order to ensure the time sequence of group message writing, and avoid the problem of disorder when different group messages are next sent to the same member to be issued, in this embodiment, for each group message copy after conversion of each group message under the current time, a group to which each group message copy belongs is first determined, and whether an unread group message copy needs to be forwarded to a member to be issued which is matched in the group to which each group message copy belongs exists in the message queues under each priority is determined, so that different message writing processes are performed subsequently, and the time sequence of group message writing is ensured.
And S270, after the other unread group message copies of the to-be-issued member in the message queues under all priorities are completely read, correspondingly writing the group message copies into the database.
Optionally, if there are other unread group message copies of the group message copy under the matched to-be-issued member in the belonging group in the message queue under a certain priority, it is first necessary to sequentially read the other unread group message copies reported before the current time that need to be forwarded to the matched to-be-issued member in the belonging group, and after the other group message copies are completely read, the group message copies at the current time are correspondingly written into the local database, so as to ensure the order of the group messages in the same to-be-issued member.
In addition, to avoid missing of writing the group message copy at the current time, before the group message copy is correspondingly written into the database after the other unread group message copies of the to-be-issued member in the message queue at each priority are completely read, the method may further include: and adding the group message copy into a preset buffer queue.
Specifically, the group message copy at the current moment is added to a preset cache queue, and after the other unread group message copies of the to-be-issued member in the message queues at the priorities are completely read, the corresponding group message copy is read from the cache queue and written into the corresponding storage area of the local database.
S280, the group message copy is directly and correspondingly written into the database.
Optionally, if there is no other unread group message copy under the matched to-be-issued member in the group to which the group message copy belongs in the message queue under a certain priority, the group message copy at the current time is directly and correspondingly written into the local database.
According to the technical scheme provided by the embodiment, the group message copies are firstly cached in the message queues under different priorities according to the grades, the group message copies in each message queue are sequentially read according to the priorities at a later time, and the read group message copies are correspondingly written into the database, so that the missing of writing of the group message copies is avoided, batch writing of the group message copies is not needed under the condition of write diffusion, and the database avalanche condition during batch writing is avoided through the grade of the writing sequence of the group message copies, the effective writing of the group message under the peak message amount is ensured, the writing pressure of the group message under the peak message amount is reduced, and the writing quality of the group message is improved.
EXAMPLE III
Fig. 3A is a flowchart of a group message writing method according to a third embodiment of the present invention, and fig. 3B is a schematic diagram of a writing process of a group message according to the third embodiment of the present invention. The present embodiment is optimized based on the above embodiments, and the present embodiment mainly explains different processing stages to which the group message belongs in detail.
Optionally, as shown in fig. 3A, this embodiment may include the following steps:
s310, the group message at the current moment is respectively converted into the group message copy corresponding to each member to be issued in the affiliated group through the front end access layer.
Specifically, in this embodiment, a write process of the group message is designed hierarchically in advance for different processing processes of the group message, and at this time, the write process may include a front access layer and a message processing layer.
And S320, if the total amount of the group message copies reaches a preset message service threshold, calculating scores of the group message copies through the message processing layer according to the group session value information of the group message copies under the group to which the group message copies belong, and sequentially writing the group message copies into the database according to the scores.
Specifically, in this embodiment, the message processing layer determines whether the total amount of the group message copies reaches a preset message service threshold, if the total amount of the group message copies reaches the preset message service threshold, the message processing layer calculates scores of the group message copies according to group session value information of the group to which each group message copy belongs, writes each group message copy into the message queues of different priorities according to the scores of the group message copies, sequentially reads the group message copies in each message queue according to the priorities of the message queues at a later time, and correspondingly writes the read group message copies into the local database.
According to the technical scheme provided by the embodiment, the conversion of the group message to the group message copy and the decoupling of the writing of the group message copy are realized in a layered design mode, the timeliness of the group message processing is ensured, the condition of database avalanche during batch writing is avoided, the effective writing of the group message under the peak message volume is ensured, the writing pressure of the group message under the peak message volume is reduced, and the writing quality of the group message is improved.
Example four
Fig. 4 is a schematic structural diagram of a writing apparatus for group messages according to a fourth embodiment of the present invention, and specifically, as shown in fig. 4, the writing apparatus may include:
a message copy conversion module 410, configured to convert the group message at the current time into a group message copy forwarded to each to-be-issued member in the belonging group;
a first message writing module 420, configured to calculate, if the total amount of the group message duplicates reaches a preset message service threshold, a score of the group message duplicates according to the group session value information of the group message duplicates under the group to which the group message duplicates belong, and sequentially write the group message duplicates in the database according to the score.
The technical solution provided by this embodiment is to first convert each group message at the current time into a group message copy forwarded to each member to be issued in the belonging group, then write each group message copy into the corresponding storage area of the database, at this time, if the total amount of the group message copies reaches a preset message service threshold, determine the group session value information of each group message copy for different members to be issued under the belonging group, and calculate the score of each group message copy, then write each group message copy in the corresponding storage area of the database according to the score, at this time, the group message copies need not be written in batch under write diffusion, and the write ordering of the group message copies is performed by the score, thereby avoiding the occurrence of data base avalanche during batch write, and ensuring the effective write of the group message under the peak message amount, the writing pressure of the group message under the peak message volume is reduced, and the writing quality of the group message is improved.
Further, the first message writing module 420 may include:
the value score calculating unit is used for sequentially calculating the value scores of the group message copies in the corresponding value dimensions according to the activity degree of the group to which the group message copies belong and the session states of the message reporting members and the members to be issued matched with the group message copies under the group to which the group message copies belong;
and the score calculating unit is used for carrying out weighted summation on the value scores of the group message duplicates under different value dimensions and calculating the scores of the group message duplicates.
Further, the first message writing module 420 may further include:
the message queue buffer unit is used for respectively writing the group message copies into message queues under different priorities according to the scores of the group message copies;
and the database writing unit is used for sequentially reading the group message copies in each message queue at regular time according to the priority of the message queue and correspondingly writing the read group message copies into the database.
Further, the database writing unit may be specifically configured to:
and correspondingly writing the read group message copy into a personal message table distributed to the matched members to be issued of the group message copy under the affiliated group in the database.
Further, the apparatus for writing the group message may further include:
the message queue detection module is used for judging whether other unread group message copies exist in the message queues under each priority level under the condition that the group message copies are matched in the affiliated group and under the to-be-issued members if the total amount of the group message copies does not reach the message service threshold value;
and the second message writing module is used for correspondingly writing the group message copies into the database after the other unread group message copies of the member to be issued in the message queue under each priority are completely read if the group message copies exist.
Further, the apparatus for writing the group message may further include:
and the message copy caching module is used for adding the group message copies into a preset caching queue.
Further, the message service threshold may be determined by a message service tolerance upper limit and a message reading number of the message queue.
Further, the message copy conversion module 410 may be specifically configured to: respectively converting the group message at the current moment into a group message copy corresponding to each member to be issued in the group to which the group message belongs through a front-end access layer;
the first message writing module 420 may be specifically configured to: if the total amount of the group message copies reaches a preset message service threshold value, calculating scores of the group message copies through a message processing layer according to group session value information of the group message copies under the group to which the group message copies belong, and sequentially writing the group message copies into a database according to the scores.
The writing device for group messages provided by this embodiment is applicable to the writing method for group messages provided by any of the above embodiments, and has corresponding functions and advantages.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a server according to a fifth embodiment of the present invention, and as shown in fig. 5, the server includes a processor 50, a storage device 51, and a communication device 52; the number of the processors 50 in the server may be one or more, and one processor 50 is taken as an example in fig. 5; the processor 50, the storage device 51 and the communication device 52 in the server may be connected by a bus or other means, and the bus connection is taken as an example in fig. 5.
The storage device 51 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the writing method of the group message provided in the embodiment of the present invention. The processor 50 executes various functional applications of the server and data processing, that is, implements the above-described writing method of the group message, by executing software programs, instructions, and modules stored in the storage device 51.
The storage device 51 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage 51 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the storage device 51 may further include memory located remotely from the processor 50, which may be connected to a server over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The communication means 62 may be used to enable a network connection or a mobile data connection between the server and the terminal.
The server provided by this embodiment can be used to execute the group message writing method provided by any of the above embodiments, and has corresponding functions and advantages.
EXAMPLE six
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, can implement the group message writing method in any of the above embodiments.
The method specifically comprises the following steps:
respectively converting the group message at the current moment into group message copies forwarded to each member to be issued in the group to which the group message copies belong;
if the total amount of the group message copies reaches a preset message service threshold, calculating scores of the group message copies according to the group session value information of the group message copies under the group to which the group message copies belong, and writing the group message copies into the database in sequence according to the scores.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the group message writing method provided by any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the writing apparatus for group messages, the units and modules included in the embodiment are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method for writing a group message, comprising:
respectively converting the group message at the current moment into group message copies forwarded to each member to be issued in the group to which the group message copies belong;
if the total amount of the group message copies reaches a preset message service threshold, calculating scores of the group message copies according to group session value information of the group message copies under the group to which the group message copies belong, and sequentially writing the group message copies in a database according to the scores.
2. The method of claim 1, wherein calculating the score of the group message duplicate according to the group session value information of the group message duplicate under the group to which the group message duplicate belongs comprises:
sequentially calculating the value scores of the group message copies in the corresponding value dimensions according to the activity degree of the group to which the group message copies belong and the session states of the message reporting members and the members to be issued matched with the group message copies under the group to which the group message copies belong;
and carrying out weighted summation on the value scores of the group message duplicates under different value dimensions, and calculating the score of the group message duplicate.
3. The method of claim 1, wherein said writing the group message copies sequentially in the database according to the scores comprises:
respectively writing the group message copies into message queues under different priorities according to the scores of the group message copies;
and sequentially reading the group message copies in each message queue at regular time according to the priority of the message queue, and correspondingly writing the read group message copies into a database.
4. The method of claim 3, wherein the writing the read group message copy into a database correspondingly comprises:
and correspondingly writing the read group message copy into a personal message table distributed to the matched members to be issued of the group message copy under the affiliated group in the database.
5. The method of claim 3, further comprising:
if the total amount of the group message copies does not reach the message service threshold, judging whether other unread group message copies of the group message copies under the matched members to be issued in the affiliated group exist in the message queue under each priority;
and if so, after the other unread group message copies of the to-be-issued member in the message queue at each priority are completely read, correspondingly writing the group message copies into the database.
6. The method of claim 5, wherein after the other unread group message copies of the to-be-issued member in the message queue at each priority are completely read, before the group message copies are correspondingly written into the database, the method further comprises:
and adding the group message copy into a preset buffer queue.
7. The method of claim 3, wherein the message service threshold is determined by a message service tolerance ceiling and a number of message reads of a message queue.
8. The method according to any one of claims 1 to 7, comprising in particular:
respectively converting the group message at the current moment into a group message copy corresponding to each member to be issued in the group to which the group message belongs through a front-end access layer;
if the total amount of the group message copies reaches a preset message service threshold, calculating scores of the group message copies through a message processing layer according to group session value information of the group message copies under the group to which the group message copies belong, and sequentially writing the group message copies into a database according to the scores.
9. An apparatus for writing a group message, comprising:
the message copy conversion module is used for respectively converting the group messages at the current moment into group message copies forwarded to each member to be issued in the affiliated group;
and the message writing module is used for calculating the score of the group message copies according to the group session value information of the group message copies under the group to which the group message copies belong and sequentially writing the group message copies into a database according to the score if the total amount of the group message copies reaches a preset message service threshold.
10. A server, characterized in that the server comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of writing a group message as recited in any one of claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of writing a group message according to any one of claims 1 to 8.
CN201911400280.4A 2019-12-30 2019-12-30 Writing method and device of group message, server and storage medium Active CN111177363B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911400280.4A CN111177363B (en) 2019-12-30 2019-12-30 Writing method and device of group message, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911400280.4A CN111177363B (en) 2019-12-30 2019-12-30 Writing method and device of group message, server and storage medium

Publications (2)

Publication Number Publication Date
CN111177363A true CN111177363A (en) 2020-05-19
CN111177363B CN111177363B (en) 2023-07-11

Family

ID=70654187

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911400280.4A Active CN111177363B (en) 2019-12-30 2019-12-30 Writing method and device of group message, server and storage medium

Country Status (1)

Country Link
CN (1) CN111177363B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111669313A (en) * 2020-05-29 2020-09-15 广西东信互联科技有限公司 Method for storing and synchronizing instant communication system message
CN111740897A (en) * 2020-08-06 2020-10-02 上海众旦信息科技有限公司 Method for information processing, electronic device, and storage medium
CN113010297A (en) * 2021-04-23 2021-06-22 北京秒针人工智能科技有限公司 Database write scheduler based on message queue, write method and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102648462A (en) * 2009-11-18 2012-08-22 高通股份有限公司 Methods and systems for managing electronic messages
CN105656763A (en) * 2016-02-03 2016-06-08 浙江翼信科技有限公司 Message pushing method and message pushing device
CN106851597A (en) * 2017-03-21 2017-06-13 北京国交信通科技发展有限公司 Cluster multi call call text messages transmission method
CN108206742A (en) * 2016-12-19 2018-06-26 腾讯科技(深圳)有限公司 A kind of message method, device, server and system
CN110621084A (en) * 2018-06-20 2019-12-27 普天信息技术有限公司 Method and device for establishing pre-established session, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102648462A (en) * 2009-11-18 2012-08-22 高通股份有限公司 Methods and systems for managing electronic messages
CN105656763A (en) * 2016-02-03 2016-06-08 浙江翼信科技有限公司 Message pushing method and message pushing device
CN108206742A (en) * 2016-12-19 2018-06-26 腾讯科技(深圳)有限公司 A kind of message method, device, server and system
CN106851597A (en) * 2017-03-21 2017-06-13 北京国交信通科技发展有限公司 Cluster multi call call text messages transmission method
CN110621084A (en) * 2018-06-20 2019-12-27 普天信息技术有限公司 Method and device for establishing pre-established session, electronic equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111669313A (en) * 2020-05-29 2020-09-15 广西东信互联科技有限公司 Method for storing and synchronizing instant communication system message
CN111740897A (en) * 2020-08-06 2020-10-02 上海众旦信息科技有限公司 Method for information processing, electronic device, and storage medium
CN111740897B (en) * 2020-08-06 2020-11-27 上海众旦信息科技有限公司 Method for information processing, electronic device, and storage medium
CN113010297A (en) * 2021-04-23 2021-06-22 北京秒针人工智能科技有限公司 Database write scheduler based on message queue, write method and storage medium

Also Published As

Publication number Publication date
CN111177363B (en) 2023-07-11

Similar Documents

Publication Publication Date Title
CN111177363A (en) Group message writing method, device, server and storage medium
CN110502494B (en) Log processing method and device, computer equipment and storage medium
CN110096336B (en) Data monitoring method, device, equipment and medium
CN108572970B (en) Structured data processing method and distributed processing system
CN101616083A (en) A kind of message forwarding method and device
CN107888787B (en) Method and device for processing media access request
US8832215B2 (en) Load-balancing in replication engine of directory server
CN111475759A (en) Message pushing platform, method, device, server and storage medium
CN115022318B (en) Message publishing method and system based on micro-service architecture
CN111163118B (en) Message transmission method and device in Kafka cluster
CN112650449B (en) Method and system for releasing cache space, electronic device and storage medium
US8990301B2 (en) Broker designation and selection in a publish-subscription environment
CN111371583B (en) Server capacity expansion method and device, server and storage medium
CN113098763B (en) Instant communication message sending method, device, storage medium and equipment
CN112671636B (en) Group message pushing method and device, computer equipment and storage medium
CN113157465B (en) Message sending method and device based on pointer linked list
CN111813833B (en) Real-time two-degree communication relation data mining method
CN115185658A (en) Task unloading scheduling method based on time and communication reliability and related product
CN114090409A (en) Message processing method and device
CN114546891A (en) Cache capacity reduction method, device, equipment and storage medium
WO2022008261A1 (en) Flexible routing of outbound contacts requests
CN110647493B (en) Data transmission method, processor and PCIE system
CN112118544B (en) PoC signaling processing method, apparatus, electronic device and medium
CN114371810B (en) Data storage method and device of HDFS
CN115827757B (en) Data operation method and device for multi-HBase cluster

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