CN109062650B - Bullet screen message distribution method, device, equipment and storage medium - Google Patents

Bullet screen message distribution method, device, equipment and storage medium Download PDF

Info

Publication number
CN109062650B
CN109062650B CN201810864347.9A CN201810864347A CN109062650B CN 109062650 B CN109062650 B CN 109062650B CN 201810864347 A CN201810864347 A CN 201810864347A CN 109062650 B CN109062650 B CN 109062650B
Authority
CN
China
Prior art keywords
bullet screen
message
function
distribution
list
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
CN201810864347.9A
Other languages
Chinese (zh)
Other versions
CN109062650A (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 CN201810864347.9A priority Critical patent/CN109062650B/en
Publication of CN109062650A publication Critical patent/CN109062650A/en
Application granted granted Critical
Publication of CN109062650B publication Critical patent/CN109062650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • 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
    • 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/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a bullet screen message distribution method, a bullet screen message distribution device, bullet screen message distribution equipment and a storage medium. The method comprises the following steps: the distribution target object determines a distribution protocol object according to the bullet screen distributor object and the bullet screen message acquisition protocol; when the fact that the previous target bullet screen message is processed is detected, the distribution target object takes the message identification list as a function input parameter, a bullet screen message obtaining function is called through a distribution protocol object, so that a bullet screen distributor object recalls the bullet screen message obtaining function to obtain a function return value, wherein the bullet screen message obtaining function is obtained by the bullet screen distributor object inheriting a bullet screen message obtaining protocol; and if the function return value is not an empty object, the distribution target object determines the function return value as the current target barrage message. Through the technical scheme, the direct distribution of the bullet screen message is realized, and the bullet screen message distribution efficiency is improved. Meanwhile, the distribution state and the processing state of the bullet screen message are kept synchronous, and the performance stability of a distribution target object is improved.

Description

Bullet screen message distribution method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to computer technology, in particular to a bullet screen message distribution method, a bullet screen message distribution device, bullet screen message distribution equipment and a storage medium.
Background
Barrage messages are heavily used in audio-video playback/live broadcast applications, such as fighting fish. Generally, these bullet screen messages are distributed by the av/live application software to various distribution target objects, such as view objects, service controller objects or data manager objects, which need to use the bullet screen messages.
Taking the view object as an example, for the audio/video playing/live broadcasting application software installed in the Android system, the manner of distributing the bullet screen message to each view object is to transmit the bullet screen message to the target view object layer by layer according to the reference relation chain of the view level. Referring to fig. 1, if a view located in the third view layer 104 needs to acquire the bullet screen message 101, the bullet screen message 101 needs to be transmitted to the first view layer 102, then to the second view layer 103 from the first view layer 102, and finally to the third view layer 104 from the second view layer 103 according to the reference relation chain, so that the distribution process of the bullet screen message is complex, time-consuming, and inefficient. In the above process, even if the view objects in the first view layer 102 and the second view layer 103 do not need the bullet screen message, they must receive and transmit the bullet screen message, which will certainly cause waste of system resources. In addition, the bullet screen message distribution operation is triggered in real time, namely, the bullet screen message distribution is triggered to be executed when a new bullet screen message is received. If there is a bullet screen message being processed in the view object receiving the bullet screen message, the view object needs to process multiple bullet screen messages at the same time, which complicates the business logic inside the view object and is easy to introduce a multi-thread problem.
In a word, the existing distribution mode of the bullet screen message in the audio/video playing/live broadcasting application software has the problems of complex distribution process, low distribution efficiency and unstable processing performance of bullet screen distribution target objects.
Disclosure of Invention
The embodiment of the invention provides a bullet screen message distribution method, a bullet screen message distribution device, bullet screen message distribution equipment and a storage medium, which are used for realizing direct distribution of bullet screen messages, simplifying the bullet screen message distribution process and improving bullet screen message distribution efficiency. Meanwhile, the distribution state of the bullet screen message in the bullet screen distributor is kept synchronous with the processing state of the bullet screen message in the distribution target object, and the performance stability of the distribution target object is improved.
In a first aspect, an embodiment of the present invention provides a bullet screen message distribution method, including:
the distribution target object determines a distribution protocol object according to the bullet screen distributor object and the bullet screen message acquisition protocol;
when the fact that the processing of the previous target bullet screen message is finished is detected, the distribution target object takes a message identification list as a function input parameter, and a bullet screen message acquisition function is called through the distribution protocol object, so that the bullet screen distributor object can call back the bullet screen message acquisition function to acquire a function return value, wherein the bullet screen message acquisition function is acquired by the bullet screen distributor object by inheriting the bullet screen message acquisition protocol;
and if the function return value is not an empty object, the distribution target object determines the function return value as the current target barrage message.
In a second aspect, an embodiment of the present invention further provides a bullet screen message distribution apparatus, where the apparatus includes:
the protocol object determining module is used for distributing the target object to obtain a protocol according to the bullet screen distributor object and the bullet screen message and determining a distribution protocol object;
a function return value determining module, configured to, when it is detected that processing of a previous target barrage message is completed, call, by the distribution protocol object, a barrage message obtaining function with a message identifier list as a function input parameter, so that the barrage distributor object recalls the barrage message obtaining function to obtain a function return value, where the barrage message obtaining function is obtained by the barrage distributor object inheriting the barrage message obtaining protocol;
and the bullet screen message determining module is used for determining the function return value as the current target bullet screen message by the distribution target object if the function return value is not an empty 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 distribution 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 distribution method provided in any embodiment of the present invention.
According to the embodiment of the invention, the bullet screen distributor object inheriting the bullet screen message acquisition protocol and the bullet screen message acquisition function contained in the bullet screen message acquisition protocol is acquired through the distribution target object, and the message transmission channel between the bullet screen distributor object and the distribution target object is constructed, so that the bullet screen message can be directly transmitted between the bullet screen distributor object and the distribution target object, the distribution process of the bullet screen message is simplified, and the distribution efficiency of the bullet screen message is improved. When the fact that the processing of the previous target barrage message is completed is detected, the distribution target object obtains the corresponding current target barrage message, the distribution target object actively obtains the current target barrage message according to the processing state of the previous target barrage message inside the distribution target object, the timeliness of barrage message distribution is improved, the distribution state of the barrage message in the barrage distributor and the processing state of the barrage message in the distribution target object are kept synchronous, the barrage message parallel processing service logic inside the distribution target object is reduced, and the performance stability of the distribution target object is improved. By using the message identification list as a function input parameter for the distribution target object, calling a bullet screen message acquisition function as a callback function by the distribution protocol object obtained by converting the bullet screen distributor object, obtaining a function return value fed back by the bullet screen distributor object, and determining the function return value as the current target bullet screen message when the function return value is not an empty object, the distribution target object directly acquires the current target bullet screen message corresponding to the distribution target object, the acquisition process of irrelevant bullet screen messages is reduced, the distribution process of bullet screen messages is further simplified, and the distribution efficiency of bullet screen messages is further improved.
Drawings
FIG. 1 is a diagram illustrating a prior art bullet screen message distribution process;
fig. 2 is a flowchart of a bullet screen message distribution method in the first embodiment of the present invention;
fig. 3 is a schematic process diagram of bullet screen message distribution in the first embodiment of the present invention;
fig. 4 is a flowchart of a bullet screen message distribution method in the second embodiment of the present invention;
fig. 5 is a flowchart of a bullet screen message acquisition function implementation process in the third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a bullet screen message distribution apparatus in the fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an apparatus in the 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.
Example one
The bullet screen message distribution method provided by the embodiment can be applied to the situation that audio and video playing/live broadcast application software in an Android client distributes received bullet screen messages to be distributed to all distribution target objects corresponding to the bullet screen messages to be distributed in the application software, and is particularly suitable for the situation that the number of the bullet screen messages to be distributed is large. The method can be executed by a bullet screen message distribution 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. 2, the method of the present embodiment specifically includes the following steps:
s110, the distribution target object determines a distribution protocol object according to the bullet screen distributor object and the bullet screen message acquisition protocol.
The distribution target object refers to a component object which needs to receive the bullet screen message in the audio/video playing/live broadcasting application software and meets the condition of directly receiving the bullet screen message, and the distribution target object can be, for example, a view object for displaying the bullet screen message, a service controller object for performing data processing on the bullet screen message, or a data manager object for storing or transmitting the bullet screen message. The conditions for the direct receipt of the bullet screen message will be described later. The bullet screen distributor refers to a bullet screen distribution module for distributing bullet screen messages, a bullet screen distributor class is defined in the module for realizing bullet screen message distribution operation, and a bullet screen distributor object is an example of the bullet screen distributor class and is a specific executor of bullet screen message distribution operation.
The bullet screen message acquisition protocol is a predefined communication protocol between components for direct delivery of bullet screen messages. Illustratively, the bullet screen message acquisition protocol is an interface type with a public authority modifier and comprises a bullet screen message acquisition function; the bullet screen message acquisition function has a public authority modifier, and the function return value type is Java-Object data type. The code implementation can be as follows:
public interface IFetchMsg{
public Object fetchMsg(List<String>listType)
}。
public is a public right modifier, so that other classes also have the right to access the bullet screen message acquisition protocol IFetchMsg. interface is an interface type qualifier, which indicates that the bullet screen message acquisition protocol IFetcchMsg is an interface implementation mechanism, and is convenient for multi-state inheritance of other classes. Object is a function return value type of the bullet screen Message obtaining function fetchMsg, which means that the function return value may be any data type, for example, it may be an empty Object void type, a string type, a key value pair map type, a JavaBean type, or a Message type, which depends on the return value return statement in the fetchMsg function. The listType is a function input parameter of the bullet screen message acquisition function fetchMsg, and is a list object with an internal element data type of a string type. The key in the key value pair map type is a bullet screen Message identification type of a String type, and the value is a bullet screen Message body msg of a String type, a Message type or a JavaBean type. Here, the bullet screen message identifier refers to a character capable of identifying a bullet screen message, and may be a number, a letter, a symbol, or any combination of the above characters, and should be a unique and global identifier of a bullet screen message. The bullet screen message body refers to a carrier of the bullet screen message, and the bullet screen message body contains specific bullet screen message contents. And establishing a protocol basis for direct delivery of the bullet screen message through the definition of the bullet screen message acquisition protocol and the bullet screen message acquisition function.
The protocol object refers to an object obtained after the interface protocol is inherited and instantiated, and it should be understood that the object of the inherited interface protocol is both a native object before inheritance and a protocol object after inheritance. The distribution protocol object refers to an object generated by inheriting and instantiating a bullet screen message acquisition protocol, and in this embodiment, the distribution protocol object is a protocol object corresponding to a bullet screen distributor object, and the data type is only a protocol object.
Specifically, in order to achieve synchronization between the distribution state of the bullet screen message in the bullet screen distributor object and the processing state of the bullet screen message in the distribution target object and ensure the timeliness of bullet screen message distribution, in the embodiment of the invention, the bullet screen message distribution process is designed such that the distribution target object actively acquires the bullet screen message from the bullet screen distributor object. In specific implementation, the distribution target object first acquires the bullet screen distributor object, so that the bullet screen information stored in the bullet screen distributor object is acquired subsequently. The direct acquisition process needs to be realized by means of a bullet screen message acquisition protocol, that is, the bullet screen distributor object needs to inherit the bullet screen message acquisition protocol to hold a bullet screen message acquisition interface and a bullet screen message acquisition function, and acquire a distribution protocol object based on the bullet screen message acquisition interface and the bullet screen message acquisition function.
And S120, when the fact that the previous target bullet screen message is processed is detected, the distribution target object takes the message identification list as a function input parameter, and the bullet screen message acquisition function is called through the distribution protocol object, so that the bullet screen distributor object can call back the bullet screen message acquisition function to acquire a function return value.
The target barrage message is a barrage message that can be received by the distribution target object, and has a corresponding relationship with the distribution target object. The last target barrage message refers to a target barrage message obtained by executing the last barrage message distribution operation. The bullet screen message obtaining function is an internal function of the bullet screen message obtaining protocol, which is a callback function, and S110 indicates that the bullet screen message obtaining function is obtained by inheriting the bullet screen message obtaining protocol from the bullet screen distributor object, so that the function executor of the bullet screen message obtaining function is the bullet screen distributor object. The message identifier list is a list storing at least one bullet screen message identifier, and may be a list storing bullet screen message identifiers of all target bullet screen messages corresponding to the distribution target object.
Specifically, in order to achieve synchronization between the distribution state and the processing state of the bullet screen message, the distribution target object needs to detect the processing state of the previous target bullet screen message inside the distribution target object. When it is detected that the previous target bullet screen message is processed, the distribution target object uses the message identifier list listType as a function input parameter to trigger and call the bullet screen message obtaining function fetchmsg (listType) in the distribution protocol object obtained in S110. The trigger call operation causes the bullet screen dispatcher object to execute a bullet screen message retrieval function. The bullet screen message acquisition function is specifically used for traversing a first message list in a bullet screen distributor object and determining a function return value corresponding to the message identification list. Here, the first message list is a list pre-established in the bullet screen distributor object, and is used for storing bullet screen messages acquired from the bullet screen server according to the message acquisition order and for traversing messages during subsequent bullet screen message distribution, so as to effectively prevent the bullet screen messages from being lost due to untimely distribution, and meanwhile, maintain the distribution order of the bullet screen messages. Through the operation of the step, the distribution target object can obtain a new function return value from the bullet screen distributor object in time when the previous target bullet screen message is processed, and further obtain the target bullet screen message (namely the current target bullet screen message) obtained by the bullet screen message distribution operation at this time.
Exemplarily, before the distributing the target object uses the message identifier list as a function input parameter and calls the bullet screen message obtaining function through the distributing protocol object to obtain the current target bullet screen message, the method further includes: constructing a map mapping relation to be added by the bullet screen distributor object according to the bullet screen message to be added; and the bullet screen distributor object takes the map mapping relation to be added as a function input parameter, calls a list element adding function and adds the map mapping relation to be added to a pre-established first message list.
The bullet screen message to be added refers to a bullet screen message which needs to be added to the first message list. map mappings refer to mappings that are stored in key-value versus map data types. And the map mapping relation to be added is a map mapping relation corresponding to the bullet screen message to be added. The list element adding function is a predefined function that can perform an element adding operation on the first message list.
Specifically, in order to facilitate management of the bullet screen messages, the bullet screen messages acquired from the bullet screen server are stored in the bullet screen distributor object by the map data type in the embodiment of the present invention. A first Message list of a map data structure is created and initialized in advance, that is, elements in the first Message list are all stored in a map data type, where a bullet screen Message identification type is a key in the map structure, and a bullet screen Message body msg is a value in the map structure, and similarly, the data type of the value may be a String type, a Message type, or a JavaBean type, which is described in the embodiment of the present invention by taking the Message type as an example. During specific implementation, according to the data type String of the type and the data type Message of the msg, a first Message List listMessage is created through a List class List, and initialization of the first Message List listMessage is performed by using a dynamic array class ArrayList of the Android system, wherein a code of the first Message List listMessage may be List < Map < String, Message > > listMessage ═ new ArrayList < Map < String, Message > > (). After the first message list listMessage is created, it may be subject to element additions.
Firstly, a Map mapping relation to be added is constructed according to the bullet screen Message to be added, for example, a Map object creating function HashMap is called to create a Map object msgMap through a Map class provided by a system, and the code implementation of the Map object msgMap can be Map < String, Message > msgMap ═ new hashmag < String, Message > (). Based on the map object, taking the type and msg in the bullet screen message to be added as function input parameters, calling the element of the map object to insert the function msgMap. And then, calling a list element adding function add () of the first message list, and adding a map mapping relation to be added to the first message list, wherein the code implementation of the map mapping relation can be listmessage.
Here, the acquiring of the bullet screen message from the bullet screen server may be that audio/video playing/live broadcast application software in the Android client sends a data acquisition request to the bullet screen server, and the bullet screen server passively responds to the data acquisition request for acquisition; preferably, the bullet screen information sent by the callback message transfer function of the bullet screen library object in the 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 the Android client, wherein 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 bullet screen 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, and providing an interface for the bullet screen server to send the bullet screen Message to the Android client, wherein the bullet screen monitor includes a callback function onMessage (String type, Message msg) to provide a call function pointer for the bullet screen server to send the bullet screen Message to the Android client. When the bullet screen message reaches the bullet screen server, triggering a bullet screen monitoring event, and then actively calling a callback function onMessage by the bullet screen server, namely, the bullet screen server sends the bullet screen message to the Android client from the bullet screen monitor interface object through a function pointer of the callback function, and a bullet screen distributor object in the Android client can timely and passively receive the bullet screen message.
And S130, if the function return value is not an empty object, the distribution target object determines the function return value as the current target barrage message.
Specifically, if the function return value obtained in S120 is not the null object null, which indicates that the execution of S120 this time obtains the target barrage message corresponding to the distribution target object, the distribution target object determines the obtained function return value as the current target barrage message, and the operation of distributing the barrage message this time is ended.
Referring to fig. 3, by the bullet screen message distribution method in the embodiment of the present invention, a bullet screen message 301 may be directly transmitted to a view object that needs to receive the bullet screen message, that is, a view object located in a third view layer 305, through a bullet screen distributor 302, without passing through an intermediate first view layer 303 and a second view layer 304.
According to the technical scheme of the embodiment, the bullet screen distributor object inheriting the bullet screen message acquisition protocol and the bullet screen message acquisition function contained in the bullet screen message acquisition protocol is acquired through the distribution target object, and the message transmission channel between the bullet screen distributor object and the distribution target object is constructed, so that the bullet screen message can be directly transmitted between the bullet screen distributor object and the distribution target object, the distribution process of the bullet screen message is simplified, and the distribution efficiency of the bullet screen message is improved. When the fact that the processing of the previous target barrage message is completed is detected, the distribution target object obtains the corresponding current target barrage message, the distribution target object actively obtains the current target barrage message according to the processing state of the previous target barrage message inside the distribution target object, the timeliness of barrage message distribution is improved, the distribution state of the barrage message in the barrage distributor and the processing state of the barrage message in the distribution target object are kept synchronous, the barrage message parallel processing service logic inside the distribution target object is reduced, and the performance stability of the distribution target object is improved. By using the message identification list as a function input parameter for the distribution target object, calling a bullet screen message acquisition function as a callback function by the distribution protocol object obtained by converting the bullet screen distributor object, obtaining a function return value fed back by the bullet screen distributor object, and determining the function return value as the current target bullet screen message when the function return value is not an empty object, the distribution target object directly acquires the current target bullet screen message corresponding to the distribution target object, the acquisition process of irrelevant bullet screen messages is reduced, the distribution process of bullet screen messages is further simplified, and the distribution efficiency of bullet screen messages is further improved.
Example two
In this embodiment, based on the first embodiment, further optimization is performed on "the distribution target object obtains the distribution protocol object according to the bullet screen distributor object and the bullet screen message obtaining protocol". On the basis, further optimization can be carried out on the condition that the processing of the previous target barrage message is detected to be completed. On the basis of the above, a step of "when the function return value is an empty object" may be added. The execution subject in this embodiment is a distribution target object. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted. Referring to fig. 4, the bullet screen message distribution method provided in this embodiment includes:
and S210, calling an object obtaining function through the bullet screen distributor class to obtain a bullet screen distributor object.
The object obtaining function is an internal function (also called a member function) in the bullet screen distributor class, and is used for obtaining an instantiation object of the bullet screen distributor class.
Specifically, the premise that the distribution target object acquires the target bullet screen message from the bullet screen distributor object is to acquire the bullet screen distributor object so as to establish a basis for establishing a bridging relationship between the distribution target object and the bullet screen distributor object. In specific implementation, the distribution target object calls an object acquisition function getInstance () through a bullet screen distributor type DanMuManager to acquire a function return value. The code implementation may be: grand Insence (), the function return value is the bullet screen distributor object.
And S220, converting the bullet screen distributor object into a distribution protocol object according to the bullet screen message acquisition protocol.
Specifically, after the distribution target object acquires the bullet screen distributor object which inherits the bullet screen message acquisition protocol, since the bullet screen distributor object has both the functions of the bullet screen distributor class and the function of the distribution protocol object, it is not possible to determine which function the object executes in the subsequent use of the object, that is, it is not possible to directly perform the operation of acquiring the bullet screen message on the bullet screen distributor object. Therefore, in order to make the bullet screen distributor object only have the function of the bullet screen distribution protocol object so as to facilitate the execution of the bullet screen message acquisition protocol, the distribution target object needs to forcibly convert the bullet screen distributor object inheriting the bullet screen message acquisition protocol into the distribution protocol object corresponding to the bullet screen message acquisition protocol, and the code implementation thereof may be: (IFetchMsg) danmumanager. getlnstance ().
And S230, detecting the variable value of the message processing state.
The message processing state variable refers to a processing state variable representing a bullet screen message processing state, and is a message processing identifier used for storing the target bullet screen message processing state in the distribution target object. The message processing identifier is an identifier for representing the processing state of the target bullet screen message by the distribution target object, and the identifier can be letters, numbers, symbols and any combination of the letters, the numbers and the symbols. The message processing identifier may include a completion identifier of the completion of the barrage message processing, such as STATE _ END, and an incomplete identifier of the incomplete completion of the barrage message processing, such as STATE _ ON; the incomplete identifier may specifically include a START identifier for starting the processing of the barrage message, for example, STATE _ START, and an in-process identifier for processing the barrage message, for example, STATE _ HAND. Therefore, the message processing identifier is at least two identifiers, so that the message processing state variable is designed to be an enumeration type for facilitating the management of the message processing identifier.
Specifically, the distribution target object acquires a value of a message processing state variable (i.e., a message processing state variable value).
And S240, when the variable value of the message processing state variable is the completion identifier, determining that the previous target barrage message is processed.
Specifically, when the value of the message processing state variable acquired in S230 is the completion flag, it may be determined that the previous target barrage message processing is completed.
If the message processing state variable value is not the completion identifier, the interval identifier judgment time period returns to the step of detecting the message processing state variable value until the message processing state variable value is the completion identifier. The identifier determination time period is a preset timer duration for triggering and determining whether the message processing identifier is the completion identifier. When the distribution target object detects that the message processing state variable value is not the completion identifier, it indicates that the distribution target object has a previous target barrage message which is started to be processed or is being processed, and the distribution target object cannot receive a new barrage message temporarily and needs to wait for the distribution target object to process the previous target barrage message. In the waiting process, the distribution target object needs to continuously acquire the variable value of the message processing state. In order to balance timeliness of bullet screen message distribution and system memory consumption, in this embodiment, an identifier determination timer is set, and when a timer period reaches, that is, an identifier determination time period reaches, the operation of S230 is executed in a recycling manner until a message processing state variable value is a completion identifier, and it is determined that processing of a previous target bullet screen message is completed.
And S250, calling the bullet screen message acquisition function by using the message identification list as a function input parameter through the distribution protocol object, so that the bullet screen distributor object calls back the bullet screen message acquisition function to acquire a function return value.
And S260, judging whether the function return value is an empty object or not.
Specifically, the distribution target object compares the function return value with the null object null to determine whether the function return value is a null object. If the function return value is not an empty object, S270 is executed; if the function return value is a null object, S280 is performed.
And S270, determining the function return value as the current target bullet screen message.
And S280, separating the message retrieval time period, returning to execute the step of taking the message identification list as a function input parameter, calling the bullet screen message acquisition function through the distribution protocol object so that the bullet screen distributor object recalls the bullet screen message acquisition function and acquires a function return value until the current target bullet screen message is determined.
The message retrieval time period refers to a preset time length of a timer used for triggering the re-execution of the bullet screen message retrieval operation. The message retrieving time period may be a preset fixed time period, or a time period dynamically changed according to a preset time period change rule. The duration change rule can obtain the probability that the next cache bullet screen message is the demand bullet screen message for the distribution target object. For example, setting an initial duration (e.g., 1s) with a fixed numerical value, when the obtained next cache barrage message is not the demand barrage message, and considering that the probability of obtaining the next cache barrage message as the demand barrage message is relatively low, increasing the initial duration by a set time period (e.g., 1s), and determining a first adjustment time period; and when the next cache bullet screen message obtained again is not the demand bullet screen message, increasing the set time period (such as 1s) in the first adjustment time period, obtaining the second adjustment time period, and so on until the next cache bullet screen message obtained is the demand bullet screen message, and the time length of the timer is returned to 0.
Specifically, if the function return value obtained by the distribution target object is a null object, it indicates that the first message list of the bullet screen distributor object temporarily does not have the target bullet screen message corresponding to the distribution target object. Then, the distribution target object needs to wait for the bullet screen distributor object to acquire the target bullet screen message, and then acquire the function return value from the first message list of the bullet screen distributor object again. In order to balance the memory consumption of the system and the timeliness of acquiring the bullet screen message, in this embodiment, a message retrieval time period is set, and when the timer period reaches, that is, the message retrieval time period reaches, the operation of S250 and the subsequent steps is executed again until the current target bullet screen message is acquired.
According to the technical scheme, the distribution protocol object corresponding to the bullet screen distributor object is obtained in an object conversion mode, so that the bullet screen message acquisition protocol is convenient to realize, and the bullet screen message distribution efficiency is further improved. The message processing state variable value is circularly detected through the interval identification judgment time period until the processing of the previous target bullet screen message is completed, so that the system memory consumption of the target object distribution is reduced to a certain extent, and the bullet screen message distribution speed is further improved. And when the function return value is an empty object, returning to execute the step of taking the message identification list as a function input parameter and calling the bullet screen message acquisition function through the distribution protocol object so that the bullet screen distributor object recalls the bullet screen message acquisition function to acquire the function return value until the current target bullet screen message is determined, and further balancing the bullet screen message distribution timeliness and the system memory consumption so as to further improve the bullet screen message distribution efficiency.
EXAMPLE III
On the basis of the foregoing embodiments, the present embodiment further optimizes the function implementation process of the "barrage message obtaining function". The execution subject in this embodiment is a bullet screen dispenser object. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted. Referring to fig. 5, the bullet screen message distribution method provided in this embodiment includes:
s301, one bullet screen message is obtained from the first message list in sequence and serves as the current bullet screen message.
The current bullet screen message refers to a bullet screen message used for bullet screen message screening in the current operation, and is a bullet screen message in the first message list.
Specifically, since the processing of the bullet screen messages is sequential, when the bullet screen distributor object filters the target bullet screen message from the first message list, the bullet screen distributor object also needs to filter according to the acquisition sequence of the bullet screen messages, specifically, the bullet screen message traversal is performed according to the storage sequence of the bullet screen messages in the first message list. In the process, when the current bullet screen messages are acquired from the first message list in sequence, the acquisition sequence of the bullet screen messages in the list needs to be determined according to the data type of the first message list. Taking a queue with a first-in first-out characteristic as an example, the bullet screen distributor object acquires a first bullet screen message at the head of the first message list queue as a current bullet screen message. It should be noted that the barrage messages in the first message list are stored in a mapping relationship of type-msg, preferably in a key-value pair map structure. In addition, in order to maintain the sequence of the bullet screen messages, when one bullet screen message is acquired from the first message list for subsequent operation, the bullet screen message is deleted from the first message list.
S302, determining the current message identification according to the current bullet screen message.
Specifically, the bullet screen distributor object parses the current bullet screen message, and for example, obtains the key information type of the current bullet screen message in a map.
S303, determining whether the message identifier list contains the current message identifier or not according to the current message identifier and the message identifier list.
Specifically, the bullet screen distributor object compares the current bullet screen message identifier with each bullet screen message identifier in the message identifier list to determine whether the current message identifier is included in the message identifier list. If so, executing S304; if not, S305 is executed.
S304, acquiring the residual bullet screen messages in the first message list one by one in sequence, and storing the residual bullet screen messages to the second message list one by one according to the acquisition sequence of the residual bullet screen messages.
The remaining bullet screen messages refer to bullet screen messages stored in the first message list and sequentially following the current bullet screen message. The second message list is a pre-established list in the bullet screen distributor object, is a transition list in the bullet screen message acquisition function, and is used for storing other bullet screen messages except the current target bullet screen message according to the message acquisition sequence. For example, the second message list stores all the bullet screen messages in the first message list except the bullet screen message determined as the function return value in the current operation according to the storage sequence of the bullet screen messages in the first message list. Therefore, the bullet screen messages can be prevented from being lost in the process of operating the first message list, and the distribution sequence of the bullet screen messages can be kept.
Specifically, when it is determined in S303 that the message identifier list includes the current bullet screen message identifier, it indicates that the current bullet screen message belongs to the target bullet screen message corresponding to the distribution target object, and then the current bullet screen message should be returned to the distribution target object as the function return value, and meanwhile, traversal and judgment are not performed on each bullet screen message after the current bullet screen message in the first message list. However, in order to maintain the sequentiality of the bullet screen messages and simplify the program processing logic, in this embodiment, the remaining bullet screen messages in the first message list are sequentially fetched one by one and are sequentially stored in the second message list one by one. According to the following description, it can be known that each bullet screen message before the current bullet screen message in the first message list is already stored in the second message list one by one, at this time, all bullet screen messages except the current bullet screen message in the first message list are stored in the second message list, and the first message list is emptied accordingly. After that, S308 is executed.
S305, storing the current barrage message to a second message list.
Specifically, when it is determined in S303 that the message identifier list does not include the current bullet screen message identifier, which indicates that the current bullet screen message does not belong to the target bullet screen message corresponding to the dispensing target object, the bullet screen dispenser object should determine the next bullet screen message. However, considering that the current bullet screen message may be a target bullet screen message corresponding to other distribution target objects, the bullet screen distributor object should not discard the current bullet screen message, but store it in the second message list in sequence. After that, S306 is executed.
S306, obtaining the next bullet screen message from the first message list in sequence, and updating the current bullet screen message.
Specifically, according to the data type of the first message list, the next bullet screen message after the current bullet screen message is obtained from the first message list in sequence, and the next bullet screen message is used as a new current bullet screen message, that is, the current bullet screen message is updated. After that, S307 is executed.
S307, the step of determining the current message identifier according to the current bullet screen message is returned to be executed until the current message identifier is contained in the message identifier list or the first message list is traversed.
Specifically, after the current bullet screen message is updated, it is necessary to continuously determine whether the current bullet screen message is the target bullet screen message of the distribution target object, that is, the step returns to execute S302 and the subsequent steps until the bullet screen distributor object determines that the message identifier list includes the current message identifier, and then the step executes S304 and the subsequent steps; or until the first message list is traversed, at this time, it is indicated that the target barrage message corresponding to the target object is not distributed in the first message list, and meanwhile, the first message list is also emptied, and the second message list completely stores the barrage message in the first message list. After that, S308 is executed.
And S308, sequentially storing all the bullet screen messages in the second message list to the first message list.
Specifically, each bullet screen distributor object acquires bullet screen messages from the first message list for judgment, so after the first message list is emptied, each bullet screen message in the second message list serving as the transition list needs to be stored in the first message list in sequence according to the sequence of bullet screen message acquisition time. And then, executing the operation of returning the function return value to end the bullet screen message acquisition function. Specifically, if the operation before this step is S304, then S309 is correspondingly executed; if the operation before this step is the operation of traversing the first message list in S307, then S310 is correspondingly executed subsequently.
S309, determining the current bullet screen message as a function return value.
Specifically, for example, the bullet screen message is stored in a map data structure, and map key information corresponding to the current bullet screen message, that is, a bullet screen message body msg, is used as a function return value. The bullet screen message body msg can be a character string type or can be analyzed into a JavaBean object type. Of course, the current barrage message of the whole map structure can be directly used as a function to return the value.
And S310, determining the empty object as a function return value.
Specifically, since the target bullet screen message corresponding to the distribution target object is not found in the whole first message list, the bullet screen message acquisition function directly returns an empty object null as a function return value.
According to the technical scheme, the message identification is used as a medium, instead of the whole bullet screen message, traversal search is conducted on the first message identification, the determination speed of the function return value is improved, and then bullet screen message distribution efficiency is further improved. In the traversal process of the first message list, some bullet screen messages in the first message list are stored in the second message list in sequence, and all bullet screen messages in the second message list are stored in the first message list in sequence before a function return value is returned, so that the sequence and the integrity of the bullet screen messages are ensured.
The following is an embodiment of a bullet screen message distribution apparatus provided in an embodiment of the present invention, and the apparatus and the bullet screen message distribution method in the foregoing embodiments belong to the same inventive concept, and details that are not described in detail in the embodiment of the bullet screen message distribution apparatus may refer to the embodiment of the bullet screen message distribution method described above.
Example four
The present embodiment provides a bullet screen message distribution apparatus, referring to fig. 6, the apparatus specifically includes:
the protocol object determining module 610 is configured to determine a distribution protocol object for the distribution target object according to the bullet screen distributor object and the bullet screen message acquisition protocol;
a function return value determining module 620, configured to, when it is detected that processing of a previous target barrage message is completed, call a barrage message obtaining function through a distribution protocol object by using a message identifier list as a function input parameter for a distribution target object, so that the barrage distributor object recalls the barrage message obtaining function to obtain a function return value, where the barrage message obtaining function is obtained by inheriting a barrage message obtaining protocol for the barrage distributor object;
and a bullet screen message determining module 630, configured to, if the function return value is not an empty object, distribute the target object and determine the function return value as the current target bullet screen message.
Optionally, on the basis of the above apparatus, the apparatus further includes a circulation module, configured to:
after the function return value is obtained, if the function return value is a null object, distributing the target object for a time interval message retrieval period, returning to execute the step of calling the bullet screen message acquisition function through the distribution protocol object by using the message identification list as a function input parameter so as to enable the bullet screen distributor object to call back the bullet screen message acquisition function, and obtaining the function return value until the current target bullet screen message is determined.
Optionally, the function return value determining module 620 includes a function executing submodule for implementing the function of obtaining the function return value by:
the bullet screen distributor object obtains a bullet screen message in sequence from the first message list as a current bullet screen message;
determining a current message identifier by the bullet screen distributor object according to the current bullet screen message;
determining whether the current message identifier is contained in the message identifier list or not by the bullet screen distributor object according to the current message identifier and the message identifier list;
if so, determining the current bullet screen message as a function return value by the bullet screen distributor object;
if not, the bullet screen distributor object sequentially obtains the next bullet screen message from the first message list, updates the current bullet screen message, returns to the step of determining the current message identifier according to the current bullet screen message until the first message list is traversed, and determines the empty object as a function return value.
Further, the function execution sub-module is further specifically configured to:
before the bullet screen distributor object takes the current bullet screen message as a function return value, the bullet screen distributor object acquires the residual bullet screen messages in the first message list one by one in sequence, and stores the residual bullet screen messages to the second message list one by one according to the acquisition sequence of the residual bullet screen messages;
before the bullet screen distributor object obtains the next bullet screen message from the first message list in sequence, the bullet screen distributor object stores the current bullet screen message into the second message list;
and before the bullet screen distributor object determines the function return value, the bullet screen distributor object stores all bullet screen messages in the second message list to the first message list in sequence.
Optionally, the protocol object determining module 610 is specifically configured to:
the method comprises the steps that a distribution target object calls an object obtaining function through a bullet screen distributor class to obtain a bullet screen distributor object;
and the distribution target object converts the bullet screen distributor object into a distribution protocol object according to the bullet screen message acquisition protocol.
Optionally, the function return value determining module 620 is specifically configured to:
the distribution target object detects the value of the message processing state variable;
and when the variable value of the message processing state variable is the completion identifier, the distribution target object determines that the previous target barrage message processing is completed.
Optionally, on the basis of the apparatus, the apparatus further includes a first message list obtaining module, configured to:
the method comprises the steps that when a distribution target object takes a message identification list as a function input parameter, a bullet screen message acquisition function is called through a distribution protocol object, and before a current target bullet screen message is obtained, a bullet screen distributor object constructs a map mapping relation to be added according to the bullet screen message to be added;
and the bullet screen distributor object takes the map mapping relation to be added as a function input parameter, calls a list element adding function and adds the map mapping relation to be added to a pre-established first message list.
Through the bullet screen message distribution device provided by the fourth embodiment of the invention, the direct distribution of bullet screen messages is realized, the bullet screen message distribution process is simplified, and the bullet screen message distribution efficiency is improved. Meanwhile, the distribution state of the bullet screen message in the bullet screen distributor is kept synchronous with the processing state of the bullet screen message in the distribution target object, and the performance stability of the distribution target object is improved.
The bullet screen message distribution device provided by the embodiment of the invention can execute the bullet screen message distribution 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 distribution 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 five
Referring to fig. 7, the present embodiment provides an apparatus 700, which includes: one or more processors 720; the storage device 710 is configured to store one or more programs, and when the one or more programs are executed by the one or more processors 720, the one or more processors 720 implement the bullet screen message distribution method provided in the embodiment of the present invention, including:
the distribution target object determines a distribution protocol object according to the bullet screen distributor object and the bullet screen message acquisition protocol;
when the fact that the previous target bullet screen message is processed is detected, the distribution target object takes the message identification list as a function input parameter, a bullet screen message obtaining function is called through a distribution protocol object, so that a bullet screen distributor object recalls the bullet screen message obtaining function to obtain a function return value, wherein the bullet screen message obtaining function is obtained by the bullet screen distributor object inheriting a bullet screen message obtaining protocol;
and if the function return value is not an empty object, the distribution target object determines the function return value as the current target barrage message.
Of course, those skilled in the art can understand that the processor 720 can also implement the technical solution of the bullet screen message distribution method provided by any embodiment of the present invention.
The device 700 shown in fig. 7 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present invention.
As shown in fig. 7, the apparatus 700 includes a processor 720, a storage device 710, an input device 730, and an output device 740; the number of the processors 720 in the device may be one or more, and one processor 720 is taken as an example in fig. 7; the processor 720, the storage device 710, the input device 730, and the output device 740 of the apparatus may be connected by a bus or other means, such as the bus 750 in fig. 7.
The storage device 710 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 distribution method in the embodiment of the present invention (for example, a protocol object determination module, a function return value determination module, and a bullet screen message determination module in the bullet screen message distribution device).
The storage device 710 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 710 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 710 may further include memory located remotely from the processor 720, 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 device 730 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 740 may include a display device such as a display screen.
EXAMPLE six
The present embodiments provide a storage medium containing computer-executable instructions that, when executed by a computer processor, are operable to perform a bullet screen message distribution method, the method comprising:
the distribution target object determines a distribution protocol object according to the bullet screen distributor object and the bullet screen message acquisition protocol;
when the fact that the previous target bullet screen message is processed is detected, the distribution target object takes the message identification list as a function input parameter, a bullet screen message obtaining function is called through a distribution protocol object, so that a bullet screen distributor object recalls the bullet screen message obtaining function to obtain a function return value, wherein the bullet screen message obtaining function is obtained by the bullet screen distributor object inheriting a bullet screen message obtaining protocol;
and if the function return value is not an empty object, the distribution target object determines the function return value as the current target barrage message.
Of course, the storage medium provided by the embodiment of the present invention includes 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 distribution 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 distribution 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 (8)

1. A bullet screen message distribution method is characterized by comprising the following steps:
the distribution target object determines a distribution protocol object according to the bullet screen distributor object and the bullet screen message acquisition protocol;
when the fact that the processing of the previous target bullet screen message is finished is detected, the distribution target object takes a message identification list as a function input parameter, and a bullet screen message acquisition function is called through the distribution protocol object, so that the bullet screen distributor object can call back the bullet screen message acquisition function to acquire a function return value, wherein the bullet screen message acquisition function is acquired by the bullet screen distributor object by inheriting the bullet screen message acquisition protocol;
if the function return value is not an empty object, the distribution target object determines the function return value as a current target barrage message;
the bullet screen message acquisition function realizes the function of acquiring the function return value through the following steps:
the bullet screen distributor object obtains a bullet screen message in sequence from the first message list as a current bullet screen message;
the bullet screen distributor object determines a current message identifier according to the current bullet screen message;
the bullet screen distributor object determines whether the current message identifier is contained in the message identifier list or not according to the current message identifier and the message identifier list;
if so, the bullet screen distributor object determines the current bullet screen message as the function return value;
if not, the bullet screen distributor object sequentially acquires the next bullet screen message from the first message list, updates the current bullet screen message, returns to execute the step of determining the current message identifier according to the current bullet screen message until the message identifier list is determined to contain the current message identifier or the first message list is traversed, and determines the empty object as the function return value when the first message list is traversed;
before the bullet screen distributor object returns the current bullet screen message as a function return value, the method further comprises the following steps:
the bullet screen distributor object acquires the residual bullet screen messages in the first message list one by one in sequence, and stores the residual bullet screen messages to a second message list one by one according to the acquisition sequence of the residual bullet screen messages;
before the bullet screen distributor object obtains the next bullet screen message from the first message list in sequence, the method further includes:
the bullet screen distributor object stores the current bullet screen message to the second message list;
before the bullet screen distributor object determines a function return value, the method further comprises the following steps:
and the bullet screen distributor object stores all bullet screen messages in the second message list to the first message list in sequence.
2. The method of claim 1, after obtaining the function return value, further comprising:
if the function return value is the empty object, the distribution target object returns to execute the step of taking the message identification list as a function input parameter at intervals of a message retrieval time period, and a bullet screen message acquisition function is called through the distribution protocol object so that the bullet screen distributor object recalls the bullet screen message acquisition function to obtain a function return value until the current target bullet screen message is determined.
3. The method of claim 1, wherein the distribution target object is according to a bullet screen distributor object and a bullet screen message acquisition protocol, and acquiring a distribution protocol object comprises:
the distribution target object calls an object acquisition function through a bullet screen distributor class to acquire a bullet screen distributor object;
and the distribution target object converts the bullet screen distributor object into the distribution protocol object according to the bullet screen message acquisition protocol.
4. The method of claim 1, wherein the detecting that the previous target barrage message processing is complete comprises:
the distribution target object detects a message processing state variable value;
and when the variable value of the message processing state variable is the completion identifier, the distribution target object determines that the previous target barrage message is processed and completed.
5. The method according to any one of claims 1 to 4, wherein before the distributing target object uses the message identifier list as a function input parameter and calls the bullet screen message obtaining function through the distributing protocol object to obtain the current target bullet screen message, the method further comprises:
the bullet screen distributor object constructs a map mapping relation to be added according to the bullet screen message to be added;
and the bullet screen distributor object takes the map mapping relation to be added as a function input parameter, calls a list element adding function, and adds the map mapping relation to be added to the pre-established first message list.
6. A bullet screen message distribution apparatus, comprising:
the protocol object determining module is used for distributing the target object to obtain a protocol according to the bullet screen distributor object and the bullet screen message and determining a distribution protocol object;
a function return value determining module, configured to, when it is detected that processing of a previous target barrage message is completed, call, by the distribution protocol object, a barrage message obtaining function with a message identifier list as a function input parameter, so that the barrage distributor object recalls the barrage message obtaining function to obtain a function return value, where the barrage message obtaining function is obtained by the barrage distributor object inheriting the barrage message obtaining protocol;
the bullet screen message determining module is used for determining the function return value as the current target bullet screen message by the distribution target object if the function return value is not an empty object;
the function return value determining module comprises a function execution submodule and is used for realizing the function of obtaining the function return value through the following steps:
the bullet screen distributor object obtains a bullet screen message in sequence from the first message list as a current bullet screen message;
determining a current message identifier by the bullet screen distributor object according to the current bullet screen message;
determining whether the current message identifier is contained in the message identifier list or not by the bullet screen distributor object according to the current message identifier and the message identifier list;
if so, determining the current bullet screen message as a function return value by the bullet screen distributor object;
if not, the bullet screen distributor object sequentially acquires the next bullet screen message from the first message list, updates the current bullet screen message, returns to the step of determining the current message identifier according to the current bullet screen message until the first message list is traversed, and determines the empty object as a function return value;
the function execution submodule is specifically configured to:
before the bullet screen distributor object takes the current bullet screen message as a function return value, the bullet screen distributor object acquires the residual bullet screen messages in the first message list one by one in sequence, and stores the residual bullet screen messages to the second message list one by one according to the acquisition sequence of the residual bullet screen messages;
before the bullet screen distributor object obtains the next bullet screen message from the first message list in sequence, the bullet screen distributor object stores the current bullet screen message into the second message list;
and before the bullet screen distributor object determines the function return value, the bullet screen distributor object stores all bullet screen messages in the second message list to the first message list in sequence.
7. A bullet screen message distribution device, characterized in that the 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 distribution method of any one of claims 1-5.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the bullet screen message distribution method according to any one of claims 1 to 5.
CN201810864347.9A 2018-08-01 2018-08-01 Bullet screen message distribution method, device, equipment and storage medium Active CN109062650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810864347.9A CN109062650B (en) 2018-08-01 2018-08-01 Bullet screen message distribution method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810864347.9A CN109062650B (en) 2018-08-01 2018-08-01 Bullet screen message distribution method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109062650A CN109062650A (en) 2018-12-21
CN109062650B true CN109062650B (en) 2021-06-15

Family

ID=64832374

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810864347.9A Active CN109062650B (en) 2018-08-01 2018-08-01 Bullet screen message distribution method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109062650B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110324722B (en) * 2019-07-02 2021-07-23 武汉斗鱼鱼乐网络科技有限公司 Method, device, equipment and storage medium for acquiring data in live broadcast room
CN111026558B (en) 2019-11-25 2020-11-17 上海哔哩哔哩科技有限公司 Bullet screen processing method and system based on WeChat applet
CN111782323B (en) * 2020-06-29 2021-06-29 掌阅科技股份有限公司 Bullet screen obtaining method, computing equipment and computer storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775700A (en) * 2016-12-09 2017-05-31 武汉斗鱼网络科技有限公司 A kind of method and apparatus of simplified code
CN107368311A (en) * 2017-07-10 2017-11-21 武汉斗鱼网络科技有限公司 Communication means and system between a kind of more Fragment
CN109086107A (en) * 2018-06-28 2018-12-25 武汉斗鱼网络科技有限公司 Barrage message distributing method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105898375B (en) * 2016-07-01 2019-01-22 上海幻电信息科技有限公司 A kind of barrage supplying system and method for pushing
CN106792034A (en) * 2017-02-10 2017-05-31 深圳创维-Rgb电子有限公司 Live method and mobile terminal is carried out based on mobile terminal
CN107734353B (en) * 2017-10-09 2020-08-04 武汉斗鱼网络科技有限公司 Method and device for recording barrage video, readable storage medium and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775700A (en) * 2016-12-09 2017-05-31 武汉斗鱼网络科技有限公司 A kind of method and apparatus of simplified code
CN107368311A (en) * 2017-07-10 2017-11-21 武汉斗鱼网络科技有限公司 Communication means and system between a kind of more Fragment
CN109086107A (en) * 2018-06-28 2018-12-25 武汉斗鱼网络科技有限公司 Barrage message distributing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN109062650A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109062650B (en) Bullet screen message distribution method, device, equipment and storage medium
JP7100154B2 (en) Processor core scheduling method, equipment, terminals and storage media
CN110753129A (en) Message transmission method, system, device, equipment and computer readable storage medium
CN109413502B (en) Multithreading barrage message distribution method, device, equipment and storage medium
CN108882053B (en) Bullet screen message distribution method, device, equipment and storage medium
CN110324722B (en) Method, device, equipment and storage medium for acquiring data in live broadcast room
CN107391274B (en) Offline message processing method and device
CN108810645B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109302639B (en) Bullet screen message distribution method, bullet screen message distribution device, terminal and storage medium
CN109005465B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109274988B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109089163B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109144639B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109309848B (en) Bullet screen distribution method, device, equipment and storage medium based on retry mechanism
CN109086107B (en) Bullet screen message distribution method, device, equipment and storage medium
CN113127775B (en) Page loading method, device, equipment and storage medium
CN108924653B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109144520B (en) Information interaction method, device, equipment and storage medium among different objects in Android
CN109005468B (en) Bullet screen message distribution method, device, equipment and storage medium
CN108881991B (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
CN109168079B (en) Bullet screen message distribution method, device, equipment and storage medium
CN109246470B (en) Multi-thread synchronous bullet screen distribution method, device, equipment and storage medium
CN109684009B (en) Protocol-based countdown synchronization method, device, storage medium and equipment

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