CN108989184B - Barrage message processing method, device, equipment and storage medium - Google Patents

Barrage message processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN108989184B
CN108989184B CN201810716969.7A CN201810716969A CN108989184B CN 108989184 B CN108989184 B CN 108989184B CN 201810716969 A CN201810716969 A CN 201810716969A CN 108989184 B CN108989184 B CN 108989184B
Authority
CN
China
Prior art keywords
message
processed
array
type
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810716969.7A
Other languages
Chinese (zh)
Other versions
CN108989184A (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810716969.7A priority Critical patent/CN108989184B/en
Publication of CN108989184A publication Critical patent/CN108989184A/en
Application granted granted Critical
Publication of CN108989184B publication Critical patent/CN108989184B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/212Monitoring or handling of messages using filtering or selective blocking
    • 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/21Monitoring or handling of messages
    • H04L51/214Monitoring or handling of messages using selective forwarding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a bullet screen message processing method, a bullet screen message processing device, bullet screen message processing equipment and a storage medium. The method comprises the following steps: acquiring a message to be processed; determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, wherein the abnormal message mapping table stores a mapping relation between an abnormal message and a message type; and if the target message type is the empty type, determining that the message to be processed is a bullet screen message, and distributing the message to be processed to a bullet screen distribution object. Through the technical scheme, the bullet screen information is only distributed to the bullet screen distribution object, the distribution operation of non-bullet screen information is reduced, and therefore the bullet screen distribution efficiency of the Android client is improved.

Description

Barrage message processing method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to computer technology, in particular to a bullet screen message processing method, a bullet screen message processing device, bullet screen message processing equipment and a storage medium.
Background
In a client (which may be referred to as an Android client) with an Android system, a bullet screen message is generally obtained from a server (i.e., a bullet screen server) capable of transmitting and processing the bullet screen message, that is, the bullet screen server sends a message to the Android client.
At present, when receiving a message sent by a bullet screen server, an Android client directly sends the message to a bullet screen distribution object, such as a view object, that needs to receive the bullet screen message through a bullet screen distribution module. However, the message sent by the bullet screen server to the Android client may be a system message, such as a data request message requesting the client to upload a log, except for the bullet screen message, and the system message is a message that the bullet screen distribution object has no authority to process and does not need to process, that is, the bullet screen distribution object does not need to receive the system message. Then, the system message is sent to the bullet screen distribution object according to the existing message distribution method, so that the bullet screen distribution object can receive the useless message, and the message distribution pressure of the bullet screen distribution module can be increased, thereby reducing the bullet screen distribution efficiency.
Disclosure of Invention
The embodiment of the invention provides a bullet screen message processing method, a bullet screen message processing device, bullet screen message processing equipment and a storage medium, which are used for filtering messages received by an Android client, so that bullet screen messages are distributed to bullet screen distribution objects, distribution of useless messages is reduced, and bullet screen distribution efficiency is improved.
In a first aspect, an embodiment of the present invention provides a bullet screen message processing method, including:
acquiring a message to be processed;
determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, wherein the abnormal message mapping table stores a mapping relation between an abnormal message and a message type;
and if the target message type is the empty type, determining that the message to be processed is a bullet screen message, and distributing the message to be processed to a bullet screen distribution object.
In a second aspect, an embodiment of the present invention further provides a bullet screen message processing apparatus, where the apparatus includes:
the message acquisition module is used for acquiring a message to be processed;
the message type determining module is used for determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, wherein the abnormal message mapping table stores the mapping relation between the abnormal message and the message type;
and the message processing module is used for determining that the message to be processed is a bullet screen message if the type of the target message is an empty type, and distributing the message to be processed to a bullet screen distribution object.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
a storage device 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 bullet screen message processing method provided by any embodiment of the invention.
In a fourth aspect, 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, implements the bullet screen message processing method provided in any embodiment of the present invention.
According to the embodiment of the invention, the mapping relation between the non-bullet screen message received by the Android client and the corresponding message processing mode is established by pre-constructing an abnormal message mapping table. The target message type of the message to be processed is determined by comparing the message to be processed received by the Android client with the abnormal message mapping table, and the filtering processing of the message to be processed according to the abnormal message mapping table is realized. When the target message type is the empty type, the message to be processed is determined to be the bullet screen message and is distributed to the bullet screen distribution object, so that the bullet screen message is only distributed to the bullet screen distribution object, the distribution operation of non-bullet screen messages is reduced, and the bullet screen distribution efficiency of the Android client is improved.
Drawings
Fig. 1 is a flowchart of a bullet screen message processing method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a bullet screen message processing method in the second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a bullet screen message processing apparatus in a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus in the fourth 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.
Example one
The bullet screen message processing method provided by the embodiment can be suitable for an Android client to distribute received messages to all bullet screen distribution objects in audio/video playing/live broadcasting application software, and is particularly suitable for the case that the number of messages is large. The method can be executed by a bullet screen message processing device, the device can be realized by software and/or hardware, and the device can be integrated in equipment provided with audio/video playing/live broadcast application software, such as typical user terminal equipment, such as a mobile phone, a tablet computer or a smart television. Referring to fig. 1, the method of the present embodiment specifically includes the following steps:
and S110, acquiring the message to be processed.
The bullet screen message to be processed refers to a message which arrives at the Android client and waits for processing such as filtering or distribution, and the message is obtained from the bullet screen server by the Android client.
Specifically, the to-be-processed message may be obtained by the Android client sending a data obtaining request to the bullet screen server, and the bullet screen server passively responding to the data obtaining request; preferably, a message sent by a callback message transfer function of a bullet screen library object in a bullet screen server is received through a bullet screen monitor interface object and a message transfer function serving as the callback function in the bullet screen monitor interface object, which are pre-established in an Android client, and the bullet screen monitor interface object is used for monitoring the bullet screen library object in the bullet screen server. That is to say, the Android client acquires the message from the bullet screen server by setting a bullet screen monitor interface object in the Android client, monitoring a bullet screen library object in the bullet screen server, providing an interface for the bullet screen server to send a bullet screen message to the Android client, and the bullet screen monitor includes a callback function, and providing a call function pointer for the bullet screen server to send a message to the Android client. When the bullet screen server has a message to be sent, the bullet screen server is triggered to actively call a callback function, the message is sent to the Android client side through an interface of the bullet screen monitor, and the Android client side timely and passively receives the message, namely the message to be processed. The barrage monitor and the callback function are a message acquisition protocol of a message to be processed set in the Android client and a message acquisition function in the protocol, and have a transparent transmission function, that is, no modification in any form is performed on the transmitted message. In this embodiment, the module for the Android client to acquire the to-be-processed message is a message filtering module for performing message processing in audio/video playing/live broadcast application software.
And S120, determining the target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table.
The exception message is a message other than a bullet screen message, for example, a log data acquisition request message or a system message such as a warning message of an exception in a system storage space. The exception message mapping table is a list for storing mapping relationships between exception messages and message types, which is pre-constructed before the step, i.e., a list is pre-defined, and corresponding exception messages and message types are stored in the defined list according to a list storage form. The message type refers to a type capable of representing a message processing mode, for example, when the processing mode is bullet screen distribution, the message type is a bullet screen type; when the processing mode is direct discarding, the message type is a data discarding type; when the processing mode is system independent processing, the message type is a system processing type and the like. For the convenience of storage, in this embodiment, a corresponding identifier, that is, a category identifier is set for the message category, and the category identifier corresponding to each message category is stored in the abnormal message mapping table. In addition, since the mapping relationship list in this embodiment stores the related information of the exception message and does not store the message of the bullet screen class, the list also does not store the category identifier corresponding to the bullet screen class. The target message type refers to a message type corresponding to the message to be processed. It should be noted that the storage form of the abnormal message mapping table may be determined according to the number of the abnormal messages, for example, when the number is small, the storage form of the abnormal message mapping table may be a form of a plurality of one-dimensional arrays, so that the memory required for storing the mapping relationship may be saved; when the number is large, the storage form of the abnormal message mapping table may be a key-value pair data storage form such as a map data structure, so that the management efficiency of the abnormal message mapping relationship may be improved.
Specifically, the message to be processed is analyzed according to the storage format of the abnormal message in the abnormal message mapping table, and the information to be searched corresponding to the storage format of the abnormal message is obtained and used as the information for traversing the abnormal message mapping table. For example, if the message identifier of the abnormal message is stored in the abnormal message mapping table, the message identifier (i.e., the target message identifier) corresponding to the message to be processed is analyzed and used as the information to be searched; and if the whole abnormal message is stored in the abnormal message mapping table, performing message reconstruction on the message to be processed according to the message structure of the abnormal message, and acquiring the reconstructed message to be processed corresponding to the message structure of the abnormal message as the message to be searched. And then, traversing the abnormal message mapping table by taking the information to be searched as comparison information of array elements or key information of key value pairs, and determining a target message type corresponding to the message to be processed. And if the message type corresponding to the message to be processed is not found in the abnormal message mapping table, determining the target message type as an empty type. Here, the empty category refers to a category of category information that is not recorded in the exception message mapping table, for example, the message category of the subtitle category is not stored in the exception message mapping table in this embodiment, and then the empty category indicates the subtitle category. The message identifier refers to a character capable of identifying the bullet screen message, and may be a number, a letter, a symbol, or any combination of the above characters, and the message identifier should be a unique and global identifier of a bullet screen message.
And S130, if the type of the target message is the empty type, determining that the message to be processed is the bullet screen message, and distributing the message to be processed to a bullet screen distribution object.
The bullet screen distribution object refers to a component object which needs to receive bullet screen messages in audio/video playing/live broadcasting application software, and can be a view object for displaying bullet screen messages, a service controller object for processing data of bullet screen messages, and a data manager object for storing or transmitting bullet screen messages.
Specifically, if it is determined in S120 that the target message category corresponding to the to-be-processed message is the empty category, it may be determined that the to-be-processed message is the bullet screen message, and the to-be-processed bullet screen message is directly sent to the bullet screen distribution module having the bullet screen message distribution function, so that the bullet screen distribution module distributes the to-be-processed message to the bullet screen distribution object.
After acquiring the message to be processed and before distributing the message to be processed to the bullet screen distribution object, the method further includes: calling a pre-created message filtering function to implement the following functions: determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table; and if the target message type is the empty type, determining that the message to be processed is a bullet screen message, and determining that the function return value is a bullet screen identifier, wherein the bullet screen identifier is used for triggering execution of the step of distributing the message to be processed to a bullet screen distribution object.
The message filtering function refers to a function capable of filtering a message to be processed. Illustratively, the message filtering function is created in advance according to a message obtaining function corresponding to the message to be processed, and the type of the function return value of the message filtering function is a boolean type. In order to implement transparent transmission of the message to be processed, in the present embodiment, when the message filtering function is defined, the message filtering function is set as a function having a transparent transmission function. In specific implementation, a Message filter class and an internal function, namely, a Message filtering function public pool onMessage (String type, Message msg), are defined according to a Message obtaining function public void onMessage (String type, Message msg) when an Android client obtains a Message to be processed from a bullet screen server and a requirement that a Message filtering function needs to feed back a return value that whether the Message to be processed can be distributed. Thereafter, a message filter object is constructed by the constructor of the message filter class, which contains the instantiated message filter function.
Specifically, in order to improve portability and easy maintainability of an application software development program, in the embodiment of the present invention, a message filtering function is encapsulated as an abstract class and a message filtering function, so that a function of filtering a message to be processed is realized by directly calling the message filtering function in the following, that is, a target message class corresponding to the message to be processed is determined according to the message to be processed and a pre-constructed abnormal message mapping table; and if the target message type is the empty type, determining that the message to be processed is the bullet screen message. After the above steps are performed, the message filtering function returns a function return value to trigger the execution of the subsequent steps, that is, when the message filtering function determines that the message to be processed is a bullet screen message, the function return value is determined to be an identifier (e.g., a bullet screen identifier, such as true) capable of representing that the message to be processed is the bullet screen message, and the bullet screen identifier is used for triggering the execution of the step of distributing the message to be processed to the bullet screen distribution object.
Based on the message acquisition function, the implementation steps of the bullet screen message processing method in the embodiment include:
acquiring a message to be processed;
based on the message to be processed, calling a message filtering function in the message filter object, and filtering the bullet screen message to be processed to obtain a function return value;
and when the function return value is the bullet screen identification, distributing the message to be processed to a bullet screen distribution object.
According to the technical scheme, the mapping relation between the non-bullet screen message received by the Android client and the corresponding message processing mode is established by constructing an abnormal message mapping table in advance. The target message type of the message to be processed is determined by comparing the message to be processed received by the Android client with the abnormal message mapping table, and the filtering processing of the message to be processed according to the abnormal message mapping table is realized. When the target message type is the empty type, the message to be processed is determined to be the bullet screen message and is distributed to the bullet screen distribution object, so that the bullet screen message is only distributed to the bullet screen distribution object, the distribution operation of non-bullet screen messages is reduced, and the bullet screen distribution efficiency of the Android client is improved.
Example two
In this embodiment, based on the first embodiment, further optimization is performed on "determining the target message type corresponding to the message to be processed according to the message to be processed and the pre-constructed abnormal message mapping table". On the basis, a processing step of 'if the target message type is the data discarding type' can be further added. On the basis, the processing step of 'if the target message type is the system processing type' can be further added. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted. Referring to fig. 2, the bullet screen message processing method provided in this embodiment includes:
s210, obtaining the message to be processed.
S220, determining a target message identifier according to the message to be processed.
Specifically, the message to be processed is analyzed to obtain a message identifier in the message to be processed, which is used as the target message identifier.
S230, determining whether the target message identifier exists in the message identifier array according to the target message identifier and the message identifier array in the abnormal message mapping table.
The message identifier array refers to an array for storing the message identifiers. In this embodiment, the exception message mapping table is stored in the form of two arrays, where one array stores the message identifier of each exception message, and the other array stores the category identifier (i.e., the category identifier array) corresponding to each exception message.
Specifically, the values of the elements of the array of message identifications in the target message identification and the exception message mapping table are compared. That is, the target message identification is compared to each element value in the array of message identifications to determine whether the target message identification is present in the array of message identifications. If not, executing S240; if not, S250 is executed.
Illustratively, the exception message mapping table is pre-constructed by: respectively defining a first array and a second array with consistent array lengths; storing the message identifier sequence of at least one abnormal message into a first array to obtain a message identifier array; storing the category identification sequence corresponding to at least one abnormal message to a second array to obtain a category identification array; and determining the message identification array and the category identification array as an abnormal message mapping table.
The array refers to a set in which elements of the same data type are arranged in a certain order, namely, a limited number of variables of the same type are named by a name, and then the set of each variable is distinguished by a number, wherein the name is called an array name, and the number is called a subscript. The variables that make up the array are referred to as the elements of the array. The array length is the number of elements in the array.
Specifically, two one-dimensional arrays with the same array length, namely a first array and a second array, are predefined. And then, sequentially storing each predetermined message identifier belonging to the abnormal message into the first array to obtain a message identifier array. Similarly, the category identifiers corresponding to the message identifiers in the message identifier array one by one are stored in the second array in sequence, and the category identifier array is obtained. The obtained message identification array and the obtained category identification array jointly form an abnormal message mapping table. It should be noted that the exception message may be determined in advance, that is, each message identifier and category identifier that need to be stored in the exception message mapping table may be known in advance.
S240, determining that the target message type corresponding to the message to be processed is an empty type.
Specifically, if the target message identifier does not exist in the exception message mapping table, which indicates that the message to be processed is not an exception message but a bullet screen message, the target message category is determined as an empty category, and S260 is performed.
And S250, determining the target message category corresponding to the message to be processed according to the subscript of the message to be processed in the message identification array and the category identification array.
Specifically, if the target message identifier exists in the exception message mapping table, which indicates that the message to be processed is an exception message, it needs to be further determined how to process the message to be processed. In specific implementation, a target category identifier is determined from the category identifier array according to the subscript of the message to be processed in the message identifier array, and a target message category corresponding to the message to be processed is determined according to the target identifier category. Because the message identifier array and the category identifier array are two arrays in one-to-one correspondence with the array subscripts, the subscript of the message to be processed in the message identifier array can be determined, then the array element stored at the subscript is obtained from the category identifier array, that is, the category identifier at the subscript in the category identifier array is obtained and used as the target category identifier, the category of the target message corresponding to the target category identifier is determined, and then S270 or S280 is executed.
And S260, determining that the message to be processed is a bullet screen message, and distributing the message to be processed to a bullet screen distribution object.
And S270, if the type of the target message is a data discarding type, discarding the message to be processed.
Specifically, if the target message type is determined to be the data discarding type according to the target type identifier, the message to be processed is directly discarded without any processing. Thereafter, the process may return to step S210 to process the next message to be processed.
And S280, if the type of the target message is the system processing type, a target sub-thread is created again through the communication thread pool, and the message to be processed is sent to the target sub-thread so as to process the message to be processed in the target sub-thread according to the type identification corresponding to the type of the target message.
The target sub-thread is a sub-thread which is newly opened under the main thread for receiving and filtering the message to be processed and is specially used for processing the message to be processed.
Specifically, if the target message class is determined to be the system processing class according to the target class identifier, in order to not block the processing of the next message to be processed in the main thread, in this embodiment, a target sub-thread is newly created through the network thread pool, and the message to be processed is sent to the target sub-thread, so that the message to be processed is processed in the target sub-thread according to the message processing mode corresponding to the system processing class. For example, if the pending message is of the system processing class, the pending message is responded to in the target child thread. If the next message to be processed is obtained at the moment, the next message to be processed is still received and filtered in the main thread, the sub-thread and the main thread are in an isolated state and do not influence each other on the processing progress, and therefore the timeliness of message filtering can be guaranteed.
It should be noted that the system processing category may include a plurality of system processing sub-categories, such as a log uploading category or a warning feedback instruction sending category. In addition, in the embodiment, a new sub thread is developed for each target message type to-be-processed message of the system processing type. For example, in the process of processing the previous message to be processed, the target sub-thread determines that the current message to be processed is a message of a system processing type, and then a new target sub-thread is developed through the communication thread pool to process the current message to be processed, so that the processing efficiency of the abnormal message can be ensured, and the timeliness of message filtering in the main thread is further improved.
Illustratively, the message filtering function is also used to implement the following functions: if the target message type is the data discarding type, discarding the message to be processed, and determining a function return value as an abnormal message identifier; and/or if the type of the target message is the system processing type, a target sub-thread is created again through the communication thread pool, the message to be processed is sent to the target sub-thread, the message to be processed is processed in the target sub-thread according to the type identification corresponding to the type of the target message, and the function return value is determined to be the abnormal message identification.
In particular, the message filtering function may encapsulate the processing procedure of the exception message, which can further improve the usability and portability of the application software program. Specifically, the step functions of S270 and/or S280 are functionally encapsulated. After the above steps are executed, according to the definition of the message filtering function, the message filtering function still needs to return a function return value so as to trigger the execution of the subsequent steps, that is, when the message filtering function determines that the target message type is a data discarding type and/or the target message type is a system processing type, the function return value is determined to be an identifier (that is, an abnormal message identifier, such as false) capable of representing that the message to be processed is an abnormal message, and the abnormal message identifier is used for triggering the return execution of the step of acquiring the message to be processed.
According to the technical scheme of the embodiment, the abnormal message mapping table is set to be in an array storage form, and the type of the target message is determined in an array element traversal mode, so that the filtering efficiency of the message to be processed can be improved. When the target message type is the system processing type, a new sub-thread is opened up to perform system processing on the message to be processed, so that the blocking rate of the message filtering main thread is reduced, and the filtering timeliness of the message to be processed is improved.
The following is an embodiment of a bullet screen message processing apparatus provided in an embodiment of the present invention, and the apparatus and the bullet screen message processing method of the foregoing embodiments belong to the same inventive concept, and reference may be made to the foregoing embodiment of the bullet screen message processing method for details that are not described in detail in the embodiment of the bullet screen message processing apparatus.
EXAMPLE III
The present embodiment provides a bullet screen message processing apparatus, referring to fig. 3, the apparatus specifically includes:
a message obtaining module 310, configured to obtain a message to be processed;
a message type determining module 320, configured to determine a target message type corresponding to the message to be processed according to the message to be processed acquired by the message acquiring module 310 and a pre-constructed abnormal message mapping table, where the abnormal message mapping table stores a mapping relationship between the abnormal message and the message type;
the message processing module 330 is configured to determine that the message to be processed is a bullet screen message and distribute the message to be processed to a bullet screen distribution object if the message type determining module 320 determines that the target message type is the empty type.
Optionally, on the basis of the apparatus, the apparatus further includes a mapping table constructing module, configured to pre-construct an exception message mapping table in the following manner:
respectively defining a first array and a second array with consistent array lengths;
storing the message identifier sequence of at least one abnormal message into a first array to obtain a message identifier array;
storing the category identification sequence corresponding to at least one abnormal message to a second array to obtain a category identification array;
and determining the message identification array and the category identification array as an abnormal message mapping table.
Further, the message category determining module 320 is specifically configured to:
determining a target message identifier according to a message to be processed;
determining whether a target message identifier exists in the message identifier array according to the target message identifier and the message identifier array in the abnormal message mapping table;
if not, determining that the target message type corresponding to the message to be processed is a null type;
if so, determining the target message category corresponding to the message to be processed according to the subscript of the message to be processed in the message identification array and the category identification array.
Optionally, on the basis of the foregoing apparatus, the apparatus further includes a message discard processing module, configured to:
after determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, if the target message type is a data discarding type, discarding the message to be processed.
Optionally, on the basis of the above apparatus, the apparatus further includes a system processing module, configured to:
after determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, if the target message type is a system processing type, a target sub-thread is created again through a communication thread pool, and the message to be processed is sent to the target sub-thread so as to process the message to be processed in the target sub-thread according to a type identifier corresponding to the target message type.
Through the bullet screen message processing device provided by the third embodiment of the invention, the bullet screen message is only distributed to the bullet screen distribution object, and the distribution operation of the non-bullet screen message is reduced, so that the bullet screen distribution efficiency of the Android client is improved.
The bullet screen message processing device provided by the embodiment of the invention can execute the bullet screen message processing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, in the embodiment of the bullet screen message processing apparatus, each included unit and module are only divided according to functional logic, but are not limited to the above division, as long as the corresponding function 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.
Example four
Referring to fig. 4, the present embodiment provides an apparatus 400 comprising: one or more processors 420; the storage device 410 is configured to store one or more programs, and when the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement the bullet screen message processing method provided in the embodiment of the present invention, including:
acquiring a message to be processed;
determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, wherein the abnormal message mapping table stores a mapping relation between the abnormal message and the message type;
and if the target message type is the empty type, determining that the message to be processed is the bullet screen message, and distributing the message to be processed to a bullet screen distribution object.
Of course, those skilled in the art can understand that the processor 420 can also implement the technical solution of the bullet screen message processing method provided in any embodiment of the present invention.
The apparatus 400 shown in fig. 4 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present invention.
As shown in fig. 4, the apparatus 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of the processors 420 in the device may be one or more, and one processor 420 is taken as an example in fig. 4; the processor 420, the storage device 410, the input device 430 and the output device 440 of the apparatus may be connected by a bus or other means, for example, the bus 450 in fig. 4.
The storage device 410 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 bullet screen message processing method in the embodiment of the present invention (for example, a message acquisition module, a message category determination module, and a message processing module in a bullet screen message processing device).
The storage device 410 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 410 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 410 may further include memory located remotely from the processor 420, which may be connected to the device 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 input means 430 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the apparatus. The output device 440 may include a display device such as a display screen.
EXAMPLE five
The present embodiments provide a storage medium containing computer-executable instructions which, when executed by a computer processor, are operable to perform a method of bullet screen message processing, the method comprising:
acquiring a message to be processed;
determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, wherein the abnormal message mapping table stores a mapping relation between the abnormal message and the message type;
and if the target message type is the empty type, determining that the message to be processed is the bullet screen message, and distributing the message to be processed to a bullet screen distribution object.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the bullet screen message processing method provided by any embodiment 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 to enable a computer device (which may be a personal computer, a server, or a network device) to execute the bullet screen message processing method according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A bullet screen message processing method is characterized by comprising the following steps:
acquiring a message to be processed;
determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, wherein the abnormal message mapping table stores a mapping relation between an abnormal message and a message type;
if the target message type is the empty type, determining that the message to be processed is a bullet screen message, and distributing the message to be processed to a bullet screen distribution object;
the storage form of the abnormal message mapping table is a plurality of one-dimensional arrays or a key value pair data storage form of a map-like data structure;
after the target message type corresponding to the message to be processed is determined according to the message to be processed and the pre-constructed abnormal message mapping table, the method further comprises the following steps:
and if the target message type is the data discarding type, discarding the message to be processed.
2. The method of claim 1, wherein the exception message mapping table is pre-constructed by:
respectively defining a first array and a second array with consistent array lengths;
storing the message identification sequence of at least one abnormal message to the first array to obtain a message identification array;
storing the category identification sequence corresponding to at least one abnormal message to the second array to obtain a category identification array;
and determining the message identification array and the category identification array as the abnormal message mapping table.
3. The method according to claim 2, wherein the determining the target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table comprises:
determining a target message identifier according to the message to be processed;
determining whether the target message identifier exists in the message identifier array according to the target message identifier and the message identifier array in the abnormal message mapping table;
if not, determining that the target message type corresponding to the message to be processed is an empty type;
if so, determining the target message category corresponding to the message to be processed according to the subscript of the message to be processed in the message identification array and the category identification array.
4. The method according to claim 1, wherein after determining the target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, the method further comprises:
and if the type of the target message is a system processing type, a target sub-thread is created again through a communication thread pool, and the message to be processed is sent to the target sub-thread so as to process the message to be processed in the target sub-thread according to the type identification corresponding to the type of the target message.
5. A bullet screen message processing device, comprising:
the message acquisition module is used for acquiring a message to be processed;
the message type determining module is used for determining a target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table, wherein the abnormal message mapping table stores the mapping relation between the abnormal message and the message type;
the message processing module is used for determining that the message to be processed is a bullet screen message if the target message type is an empty type, and distributing the message to be processed to a bullet screen distribution object;
the storage form of the abnormal message mapping table is a plurality of one-dimensional arrays or a key value pair data storage form of a map-like data structure;
the device further comprises:
and the message discarding processing module is used for discarding the message to be processed if the target message type is a data discarding type after determining the target message type corresponding to the message to be processed according to the message to be processed and a pre-constructed abnormal message mapping table.
6. The apparatus of claim 5, further comprising a mapping table construction module configured to pre-construct the exception message mapping table by:
respectively defining a first array and a second array with consistent array lengths;
storing the message identification sequence of at least one abnormal message to the first array to obtain a message identification array;
storing the category identification sequence corresponding to at least one abnormal message to the second array to obtain a category identification array;
and determining the message identification array and the category identification array as the abnormal message mapping table.
7. The apparatus of claim 6, wherein the message class determination module is specifically configured to:
determining a target message identifier according to the message to be processed;
determining whether the target message identifier exists in the message identifier array according to the target message identifier and the message identifier array in the abnormal message mapping table;
if not, determining that the target message type corresponding to the message to be processed is an empty type;
if so, determining the target message category corresponding to the message to be processed according to the subscript of the message to be processed in the message identification array and the category identification array.
8. A bullet screen message processing device, characterized in that said device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the bullet screen message processing method of any one of claims 1-4.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the bullet screen message processing method according to any one of claims 1 to 4.
CN201810716969.7A 2018-07-03 2018-07-03 Barrage message processing method, device, equipment and storage medium Active CN108989184B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810716969.7A CN108989184B (en) 2018-07-03 2018-07-03 Barrage message processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810716969.7A CN108989184B (en) 2018-07-03 2018-07-03 Barrage message processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108989184A CN108989184A (en) 2018-12-11
CN108989184B true CN108989184B (en) 2021-06-15

Family

ID=64536518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810716969.7A Active CN108989184B (en) 2018-07-03 2018-07-03 Barrage message processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108989184B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552744A (en) * 2008-04-04 2009-10-07 阿尔卡特朗讯 Method of managing electronic messages on the basis of a messaging client and system for implementing the method
CN105681262A (en) * 2014-11-20 2016-06-15 上海天脉聚源文化传媒有限公司 Interaction message allocating method and system
CN106470357A (en) * 2016-10-11 2017-03-01 北京小米移动软件有限公司 barrage message display method and device
CN106973314A (en) * 2017-03-17 2017-07-21 武汉斗鱼网络科技有限公司 Instruction identification method and system for network interaction
CN108023808A (en) * 2017-12-07 2018-05-11 深圳乐信软件技术有限公司 message distributing method and device in application program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7752272B2 (en) * 2005-01-11 2010-07-06 Research In Motion Limited System and method for filter content pushed to client device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552744A (en) * 2008-04-04 2009-10-07 阿尔卡特朗讯 Method of managing electronic messages on the basis of a messaging client and system for implementing the method
CN105681262A (en) * 2014-11-20 2016-06-15 上海天脉聚源文化传媒有限公司 Interaction message allocating method and system
CN106470357A (en) * 2016-10-11 2017-03-01 北京小米移动软件有限公司 barrage message display method and device
CN106973314A (en) * 2017-03-17 2017-07-21 武汉斗鱼网络科技有限公司 Instruction identification method and system for network interaction
CN108023808A (en) * 2017-12-07 2018-05-11 深圳乐信软件技术有限公司 message distributing method and device in application program

Also Published As

Publication number Publication date
CN108989184A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
US10996878B2 (en) Data pipeline architecture for cloud processing of structured and unstructured data
CN107800565B (en) Inspection method, inspection device, inspection system, computer equipment and storage medium
CA2896865C (en) Method and system for using a recursive event listener on a node in hierarchical data structure
CN111163159B (en) Message subscription method, device, server and computer readable storage medium
CN109618174B (en) Live broadcast data transmission method, device, system and storage medium
CN111698126B (en) Information monitoring method, system and computer readable storage medium
CN112055078B (en) Data transmission method, device, computer equipment and storage medium
CN108882053B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109167819B (en) Data synchronization system, method, device and storage medium
CN111541684B (en) Signaling sending method and device of live broadcast room, server and storage medium
CN114090388A (en) Information acquisition method, server cluster, server and equipment
CN109062650B (en) Bullet screen message distribution method, device, equipment and storage medium
CN108810633B (en) Barrage message transmission method, device, equipment and storage medium
CN114443603A (en) Transaction log playback method and device, computer equipment and medium
CN108810645B (en) Bullet screen message distribution method, device, equipment and storage medium
CN108924653B (en) Bullet screen message distribution method, device, equipment and storage medium
CN108989184B (en) Barrage message processing method, device, equipment and storage medium
CN109005465B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109089163B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109274988B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109005448B (en) Bullet screen message distribution method, device, equipment and storage medium
CN108810644B (en) Bullet screen message distribution method, device, equipment and storage medium
CN112995095B (en) Data processing method, device and computer readable storage medium
CN109086107B (en) Bullet screen message distribution method, device, equipment and storage medium
CN111427710B (en) Communication method, device, equipment and storage medium of components in application program

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