CN109413507B - Method, device, terminal and medium for processing reference relationship between barrage library and live broadcast room - Google Patents

Method, device, terminal and medium for processing reference relationship between barrage library and live broadcast room Download PDF

Info

Publication number
CN109413507B
CN109413507B CN201811161670.6A CN201811161670A CN109413507B CN 109413507 B CN109413507 B CN 109413507B CN 201811161670 A CN201811161670 A CN 201811161670A CN 109413507 B CN109413507 B CN 109413507B
Authority
CN
China
Prior art keywords
live broadcast
current
broadcast room
hash value
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
CN201811161670.6A
Other languages
Chinese (zh)
Other versions
CN109413507A (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 CN201811161670.6A priority Critical patent/CN109413507B/en
Publication of CN109413507A publication Critical patent/CN109413507A/en
Application granted granted Critical
Publication of CN109413507B publication Critical patent/CN109413507B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/254Management at additional data server, e.g. shopping server, rights management server

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention discloses a method, a device, a terminal and a medium for processing a reference relation between a barrage library and a live broadcast room. The method comprises the following steps: receiving a target hash value of a context object sent by a target live broadcast room when a page is destroyed; if the target hash value is judged to be the same as the registered current hash value, determining that the current live broadcast room corresponding to the current hash value is a to-be-recovered live broadcast room; deleting the current reference relation of the current live broadcast room so as to recycle the current live broadcast room; and the current reference relation and the current hash value are registered in the bullet screen distribution object when the current live broadcast room is started, and the historical hash value and the corresponding historical reference relation in the bullet screen distribution object are covered. By adopting the technical scheme, the problem of memory leakage is solved while the bullet screen message distribution efficiency is improved.

Description

Method, device, terminal and medium for processing reference relationship between barrage library and live broadcast room
Technical Field
The embodiment of the invention relates to the technical field of barrage, in particular to a method, a device, a terminal and a medium for processing a reference relation between a barrage library and a live broadcast room.
Background
With the development of the network interaction platform, more and more users can communicate by logging in the network interaction platform. Among them, webcast is an application very popular with users. The user can express the emotion of the user by sending the barrage in the live broadcast watching process. The bullet screen service comprises important functions of receiving, processing and pushing bullet screens of users. After receiving the bullet screen message sent by the bullet screen server, the client needs to distribute the bullet screen message to the live broadcast room in which the client is running.
In order to ensure the distribution efficiency of the bullet screen message and the maintainability of the code, a reference relationship between a bullet screen library and a live broadcast room needs to be established to be used as a bullet screen distribution channel. However, after the reference relationship is established, as long as the APP (Application) corresponding to the live broadcast room does not exit, at least one reference relationship is always held in the bullet screen library, so that at least one live broadcast room cannot be released, and the problem of memory leakage is caused.
In order to solve the problem of memory leakage, a clearing function of the reference relation can be added into a destroying function of the live broadcast room, and the reference relation is deleted when the live broadcast room is destroyed. However, because the life cycle of the live broadcast rooms is controlled by the system, the process is uncertain, and if different live broadcast rooms are switched, the destroy function is executed only in the live broadcast room before switching after the switched live broadcast room is registered first, which easily causes that the reference relation of the live broadcast room before switching is removed by the reference relation removing function, so that the barrage message cannot be sent to the switched live broadcast room.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a terminal and a medium for processing a reference relation between a bullet screen library and a live broadcast room, which can improve bullet screen message distribution efficiency and solve the problem of memory leakage.
In a first aspect, an embodiment of the present invention provides a method for processing a reference relationship between a barrage library and a live broadcast room, where the method includes:
receiving a target hash value of a context object sent by a target live broadcast room when a page is destroyed;
if the target hash value is judged to be the same as the registered current hash value, determining that the current live broadcast room corresponding to the current hash value is a to-be-recovered live broadcast room;
deleting the current reference relation of the current live broadcast room so as to recycle the current live broadcast room;
the current reference relation and the current hash value are obtained by sending the current live broadcast room at the starting time so as to cover the historical hash value and the corresponding historical reference relation.
Further, the method further comprises:
if the target hash value is judged to be different from the registered current hash value, determining that the reference relation of the target live broadcast room is deleted;
and distributing the barrage message to the current live broadcast room based on the current reference relation of the current live broadcast room.
Further, the current hash value and the current reference relationship are stored in a preset key-value pair object in the form of a key-value pair.
Further, deleting the current reference relationship of the current live broadcast room, including:
calling an element acquisition method of the preset key value pair object by taking the current hash value as a parameter to acquire a current reference relation of a current live broadcast room;
and calling a null object setting method, and assigning the null object to the current reference relation so as to delete the current reference relation.
Further, after receiving a target hash value of a context object sent by a target live broadcast room during page destruction, the method further includes:
and calling a character string equality judging method by taking the target hash value and the registered current hash value as parameters to judge whether the target hash value and the current hash value are equal or not.
Further, the current reference relationship and the historical reference relationship are initialized by calling a constructor of an implementation class of a preset listener interface protocol, and the implementation class is inherited from the preset listener interface protocol through keyword instances.
In a second aspect, an embodiment of the present invention further provides a device for processing a reference relationship between a barrage library and a live broadcast room, where the device includes:
the target hash value receiving module is used for receiving a target hash value of the context object sent by the target live broadcast room when the page is destroyed;
a to-be-recovered live broadcast room determining module, configured to determine, if it is determined that the target hash value is the same as the registered current hash value, that the current live broadcast room corresponding to the current hash value is a to-be-recovered live broadcast room;
the live broadcast room recovery processing module is used for deleting the current reference relation of the current live broadcast room so as to recover the current live broadcast room;
the current reference relation and the current hash value are obtained by sending the current live broadcast room at the starting time so as to cover the historical hash value and the corresponding historical reference relation.
Further, the apparatus further comprises:
the reference relation judging module is used for determining that the reference relation of the target live broadcast room is deleted if the target hash value is judged to be different from the registered current hash value;
and the bullet screen distribution module is used for distributing bullet screen information to the current live broadcast room based on the current reference relation of the current live broadcast room.
Further, the current hash value and the current reference relationship are stored in a preset key-value pair object in the form of a key-value pair.
Further, the live broadcast room recycling module is specifically configured to:
calling an element acquisition method of the preset key value pair object by taking the current hash value as a parameter to acquire a current reference relation of a current live broadcast room;
calling a null object setting method, assigning the null object to the current reference relation to delete the current reference relation so as to recycle the current live broadcast room;
further, the method further comprises:
and the hash value judging module is used for calling a character string equality judging method by taking the target hash value and the registered current hash value as parameters after receiving the target hash value of the context object sent by the target live broadcast room during page destruction, and judging whether the target hash value and the current hash value are equal.
Further, the current reference relationship and the historical reference relationship are initialized by calling a constructor of an implementation class of a preset listener interface protocol, and the implementation class is inherited from the preset listener interface protocol through keyword instances.
In a third aspect, an embodiment of the present invention further provides a terminal, where the terminal 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 processing method of the reference relationship between the barrage library and the live broadcast room provided by any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements a processing method for a reference relationship between a barrage library and a live broadcast room, which is provided in any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, when the live broadcast room is started, the hash value of the context object of the live broadcast room and the reference relation corresponding to the hash value are registered in the bullet screen distribution object, and the reference relation corresponding to the historical hash value of the historical hash value in the bullet screen distribution object is covered, so that the bullet screen distribution object only maintains the reference relation of the current live broadcast room in operation, namely, the bullet screen distribution object is ensured to always point to the current live broadcast room in operation. When a target live broadcast room for executing page destruction exists subsequently, the target live broadcast room sends a target hash value of a context object thereof to the bullet screen distribution object. If the bullet screen distribution object judges that the target hash value is the same as the current hash value, the target live broadcast room for executing page destruction is determined to be the current live broadcast room, namely the current live broadcast room is the live broadcast room to be recovered, and the setting solves the problem that in the live broadcast room switching process, the reference relation of the live broadcast room before switching can be cut off by the reference relation clearing function of the live broadcast room before switching due to the uncertainty of the life cycle of the live broadcast room, so that bullet screen information can be distributed to the live broadcast room in operation. In addition, after the current live broadcast room is determined to be the live broadcast room to be recovered, the current reference relation of the current live broadcast room is deleted, and the current live broadcast room can be recovered to solve the problem of memory leakage.
Drawings
Fig. 1 is a flowchart of a processing method for reference relationship between a barrage library and a live broadcast room according to an embodiment of the present invention;
fig. 2 is a flowchart of a processing method for reference relationship between a barrage library and a live broadcast room according to a second embodiment of the present invention;
fig. 3 is a block diagram of a processing apparatus for processing a reference relationship between a barrage library and a live broadcast room according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to a 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
Fig. 1 is a flowchart of a processing method for reference relationship between a barrage library and a live broadcast room according to an embodiment of the present invention, where the method may be executed by a processing device for reference relationship between the barrage library and the live broadcast room, the device may be implemented in a software and/or hardware manner, and the device may be integrated in a terminal such as a mobile phone or a tablet computer. Referring to fig. 1, the method of the present embodiment specifically includes:
s110, receiving a target hash value of the context object sent by the target live broadcast room when the page is destroyed.
It is mainly explained that, since the creation function onCreate of the life cycle needs to be called when the live broadcast room is created, the destruction function onstore of the life cycle needs to be called when the live broadcast room is destroyed, and both the creation function and the destruction function are system functions, and the execution flow is uncontrollable, there is a possibility that the live broadcast room after switching is registered first and then the live broadcast room before switching executes the destruction function. Therefore, the target live broadcast room for executing the page destruction in this embodiment may be the previous live broadcast room before the current live broadcast room is switched to, or may also be the current live broadcast room currently running. If the current live broadcast is currently running, the page destruction of the current live broadcast can be the destruction when a closing or exiting instruction triggered by a user is received.
In this embodiment, each live broadcast room has a unique identifier, which may be a context object context of the live broadcast room. However, because the context object occupies a large memory space, the technical scheme of this embodiment sets a unique hash value hashId for the context object, and pre-constructs a mapping relationship between the hash value and a reference relationship between live broadcasts.
In this embodiment, the live broadcast room that executes the page destruction is taken as a target live broadcast room, each target live broadcast room calls a destruction function onDestory when the page is destroyed, and when the destruction function is executed, the target live broadcast room sends the hash value of the context object thereof to the bullet screen distribution object.
Illustratively, when a page is destroyed, the target live broadcast room may obtain target hash value information of a context object by calling a hash value obtaining function context.
And S120, if the target hash value is judged to be the same as the registered current hash value, determining the current live broadcast room corresponding to the current hash value as the live broadcast room to be recovered.
In this embodiment, the current hash value is a hash value of a live broadcast room currently running. And each live broadcast room registers the hash value and the corresponding reference relation thereof into the bullet screen distribution object when being started, and covers the historical hash value and the corresponding historical reference relation in the bullet screen distribution object. The live broadcast method has the advantages that in the switching process of different live broadcast rooms, the reference relation of the switched live broadcast rooms covers the reference relation of the live broadcast rooms before switching, so that only the hash value and the reference relation of the current live broadcast room in operation are maintained in the bullet screen distribution object, and the bullet screen distribution object is ensured to always point to the current live broadcast room in operation. When a target live broadcast room for executing page destruction is available subsequently, if the hash value of the target sent to the bullet screen distributor is the same as the current hash value, the current live broadcast room is the live broadcast room to be recovered.
Illustratively, if it is determined that the target hash value is different from the registered current hash value, it indicates that the reference relationship of the target live broadcast room has been replaced by the current reference relationship when the current live broadcast room is started, that is, it may be determined that the reference relationship of the target live broadcast room has been deleted, and the current live broadcast room is an operating live broadcast room. At this time, if the user does not receive the hash value of the context object sent by the current live broadcast room when the page is destroyed, the reference relation of the current live broadcast room does not need to be deleted, and the received barrage message can be sent to the current live broadcast room based on the current reference relation.
Specifically, the judgment of whether the target hash value and the current hash value are the same may be performed by calling a string equality judgment method textutils.
And S130, deleting the current reference relation of the current live broadcast room so as to recycle the current live broadcast room.
In this embodiment, the reference relationship of the live broadcast room is a channel between the bullet screen distribution object and the live broadcast room, and the bullet screen distribution object can distribute and process the bullet screen message by using the bullet screen receiving method in the reference relationship.
The reference relation can be defined as a monitor interface type, and the reference relation corresponding to the live broadcast room can have the barrage receiving method by inheriting the class corresponding to the live broadcast room to a preset monitor interface protocol.
Specifically, the definition method of the preset listener interface protocol is as follows:
Public interface DanmuRouterListener{
Public void onReceiveGiftBean(GiftBean giftBean);
Public void onReceiveTipsBean(TipsBean tipsBean)
}
as shown in the above program segment, the preset listener interface protocol danmurouterelistener includes some columns of receiving methods of bullet screen messages, and each method corresponds to one type of bullet screen information. That is to say, a bullet screen message becomes a unique Bean object after being parsed, and then the Bean object is sent to the live broadcast room through the defined receiving methods.
Illustratively, the reference relationship in the class corresponding to the current live broadcast room is initialized, and the initialization of the reference relationship can be completed by inheriting the current class corresponding to the live broadcast room to the predefined preset listener interface protocol, so that the current listener interface object has the receiving method of each barrage message in the preset listener interface protocol.
Preferably, the current listener interface object may further complete initialization by calling a constructor of an implementation class of the preset listener interface protocol, where the implementation class inherits from the preset listener interface protocol through keyword instances.
Specifically, the method for defining the preset listener interface protocol to realize the DanmuRouterListenerImp class includes:
Public class DanmuRouterListenerImp implements DanmuRouterListener{
@override
Public void onReceiveGiftBean(GiftBean giftBean){}
@override
Public void onReceiveTipsBean(TipsBean tipsBean){}
}
after the realization type DanmuRouterListenerImp inherits the preset listener interface protocol DanmuRouterListener through keywords, all the bullet screens in the protocol DanmuRouterListener can realize the onReceiver receiving method. The function of each implementation is added with an @ override mark for indicating that the function is a duplicate of a method in the preset listener interface protocol.
In this embodiment, deleting the current reference relationship may be performed by setting the reference relationship to null, that is, deleting the current reference relationship in the current live broadcast room by calling a null object assignment function mdanmum router ═ null, so as to perform recycling processing on the current live broadcast room, thereby solving the problem of memory leakage.
According to the technical scheme, when the live broadcast room is started, the hash value of the context object of the live broadcast room and the reference relation corresponding to the hash value are registered in the bullet screen distribution object, and the reference relation corresponding to the historical hash value of the historical hash value in the bullet screen distribution object is covered, so that the bullet screen distribution object only maintains the reference relation of the current live broadcast room in operation, namely, the bullet screen distribution object is ensured to always point to the current live broadcast room in operation. When a target live broadcast room for executing page destruction exists subsequently, the target live broadcast room sends a target hash value of a context object thereof to the bullet screen distribution object. If the bullet screen distribution object judges that the target hash value is the same as the current hash value, the target live broadcast room for executing page destruction is determined to be the current live broadcast room, namely the current live broadcast room is the live broadcast room to be recovered, and the setting solves the problem that in the live broadcast room switching process, the reference relation of the live broadcast room before switching can be cut off by the reference relation clearing function of the live broadcast room before switching due to the uncertainty of the life cycle of the live broadcast room, so that bullet screen information can be distributed to the live broadcast room in operation. In addition, after the current live broadcast room is determined to be the live broadcast room to be recovered, the current reference relation of the current live broadcast room is deleted, and the current live broadcast room can be recovered to solve the problem of memory leakage.
Example two
Fig. 2 is a flowchart of a processing method for reference relationship between a barrage library and a live broadcast room according to a second embodiment of the present invention, which is optimized based on the second embodiment, and explanations of terms that are the same as or corresponding to the second embodiment are not repeated herein. Referring to fig. 2, the method provided in this embodiment includes:
s200, when the current live broadcast room is started, the current live broadcast room registers the current hash value and the current reference relation of the context object into the bullet screen distribution object, and covers the historical hash value and the corresponding reference relation in the bullet screen distribution object.
It should be noted that each live broadcast room calls a creation function onCreate of a life cycle when starting up, and the function mainly performs some necessary initialization work when starting up the live broadcast room.
The current live broadcast room in this embodiment may be any type of live broadcast room supported by the application program for display, such as a half-screen live broadcast room, a color value live broadcast room, a game live broadcast room, and the like. When the current live broadcast room is detected to be started, the bullet screen distribution object of the preset bullet screen distribution class can be obtained by calling an object obtaining method Danmu client.
The method for acquiring the object in the bullet screen distribution class is a singleton mode, namely, the same object is returned each time the method is called. In this embodiment, for any type of live broadcast room, the method is called to obtain the bullet screen distribution object mDanmuClient in the preset bullet screen distribution class.
In this embodiment, after the bullet screen distribution object is obtained, a function in the bullet screen distribution object may be called to transfer parameters to the bullet screen distribution object, so as to establish a reference relationship between the live broadcast room and the bullet screen distribution object.
In this embodiment, a listener registration function is defined in the bullet screen distribution object and is used to store the current hash value and reference relationship of the live broadcast room. The live broadcast room can transfer the hash value and the reference relation into the bullet screen distribution object by calling the listener registration function.
Specifically, the listener registration function is as follows:
public void setListener(String hashId,MyInterface myInterface)
inside the function, a set of hash values and a reference relationship can be stored in a preset key-value pair object by calling a key-value pair storing method mmap.
In this embodiment, the first parameter of the listener registration function is the current hash value hashId, and the second parameter is the current reference relationship myInterface. In this embodiment, by setting the two variables, the hash value and the reference relationship transmitted by the live broadcast room after switching can be overwritten by the hash value and the reference relationship transmitted by the live broadcast room before switching in a manner of assigning values to the variables.
S210, receiving a target hash value of the context object sent by the target live broadcast room when the page is destroyed.
S220, calling a character string equality judging method by taking the target hash value and the registered current hash value as parameters, judging whether the target hash value and the current hash value are equal, and if so, executing the step S230; otherwise, step S260 is performed.
And S230, determining that the current live broadcast room corresponding to the current hash value is the live broadcast room to be recovered, and continuing to execute the step S240.
S240, taking the current hash value as a parameter, calling an element acquisition method of the preset key value pair object, acquiring the current reference relation of the current live broadcast room, and continuing to execute the step S250.
Get (), and the hash value and the reference relation thereof are stored in a key-value pair form, so that the current reference relation of the current live broadcast room can be obtained by using the current hash value as a parameter and calling the element obtaining method of the preset key-value pair object.
And S250, calling a null object setting method, and assigning a null object to the current reference relationship so as to delete the current reference relationship.
And S260, determining that the reference relation of the target live broadcast room is deleted, wherein the current live broadcast room is the live broadcast room in operation, and distributing the barrage message to the current live broadcast room based on the current reference relation of the current live broadcast room.
Based on the content of step S130, it can be known that the preset listener interface protocol includes a method for receiving the bullet screen message, and therefore, after the reference relationship of the live broadcast is initialized by using the preset listener interface protocol, the listener interface object of the live broadcast room also has the method for receiving the bullet screen message. Therefore, when the barrage message is sent to the current live broadcast room in operation, the barrage message receiving method can be called based on the current reference relation, the barrage message is sent to the current live broadcast room in operation, and the barrage distribution efficiency is improved.
On the basis of the foregoing embodiment, in this embodiment, a preset listener interface protocol including a bullet screen receiving method is designed in advance in a bullet screen distribution object, and a reference relationship between live broadcast rooms is initialized by using the preset listener interface protocol, so that the initialized reference relationship has a bullet screen receiving method. After the current reference relationship of the live broadcast room currently running is determined, the bullet screen message can be sent to the target live broadcast room currently running by using the reference relationship and the bullet screen receiving method in the reference relationship after the live broadcast room currently running is determined, and therefore the bullet screen distribution efficiency is improved.
EXAMPLE III
Fig. 3 is a block diagram of a structure of a processing apparatus for referencing a barrage library and a live broadcast room according to a third embodiment of the present invention, as shown in fig. 3, the apparatus includes: the system comprises a target hash value receiving module 310, a to-be-recovered live broadcast room determining module 320 and a live broadcast room recovery processing module 330. Wherein,
a target hash value receiving module 310, configured to receive a target hash value of a context object sent by a target live broadcast room when a page is destroyed;
a to-be-recovered live broadcast room determining module 320, configured to determine, if it is determined that the target hash value is the same as the registered current hash value, that the current live broadcast room corresponding to the current hash value is a to-be-recovered live broadcast room;
the live broadcast room recovery processing module 330 is configured to delete the current reference relationship of the current live broadcast room, so as to perform recovery processing on the current live broadcast room;
the current reference relation and the current hash value are obtained by sending the current live broadcast room at the starting time so as to cover the historical hash value and the corresponding historical reference relation.
According to the technical scheme, when the live broadcast room is started, the hash value of the context object of the live broadcast room and the reference relation corresponding to the hash value are registered in the bullet screen distribution object, and the reference relation corresponding to the historical hash value of the historical hash value in the bullet screen distribution object is covered, so that the bullet screen distribution object only maintains the reference relation of the current live broadcast room in operation, namely, the bullet screen distribution object is ensured to always point to the current live broadcast room in operation. When a target live broadcast room for executing page destruction exists subsequently, the target live broadcast room sends a target hash value of a context object thereof to the bullet screen distribution object. If the bullet screen distribution object judges that the target hash value is the same as the current hash value, the target live broadcast room for executing page destruction is determined to be the current live broadcast room, namely the current live broadcast room is the live broadcast room to be recovered, and the setting solves the problem that in the live broadcast room switching process, the reference relation of the live broadcast room before switching can be cut off by the reference relation clearing function of the live broadcast room before switching due to the uncertainty of the life cycle of the live broadcast room, so that bullet screen information can be distributed to the live broadcast room in operation. In addition, after the current live broadcast room is determined to be the live broadcast room to be recovered, the current reference relation of the current live broadcast room is deleted, and the current live broadcast room can be recovered to solve the problem of memory leakage.
On the basis of the above embodiment, the apparatus further includes:
the reference relation judging module is used for determining that the reference relation of the target live broadcast room is deleted if the target hash value is judged to be different from the registered current hash value;
and the bullet screen distribution module is used for distributing bullet screen information to the current live broadcast room based on the current reference relation of the current live broadcast room.
On the basis of the above embodiment, the current hash value and the current reference relationship are stored in a preset key-value pair object in the form of a key-value pair.
On the basis of the above embodiment, the live broadcast room recycling processing module is specifically configured to:
calling an element acquisition method of the preset key value pair object by taking the current hash value as a parameter to acquire a current reference relation of a current live broadcast room;
calling a null object setting method, assigning the null object to the current reference relation to delete the current reference relation so as to recycle the current live broadcast room;
on the basis of the above embodiment, the method further includes:
and the hash value judging module is used for calling a character string equality judging method by taking the target hash value and the registered current hash value as parameters after receiving the target hash value of the context object sent by the target live broadcast room during page destruction, and judging whether the target hash value and the current hash value are equal.
On the basis of the above embodiment, the current reference relationship and the historical reference relationship are initialized by calling a constructor of an implementation class of a preset listener interface protocol, and the implementation class is inherited from the preset listener interface protocol by keyword instances.
The processing device for the reference relationship between the bullet screen library and the live broadcast room, provided by the embodiment of the invention, can execute the processing method for the reference relationship between the bullet screen library and the live broadcast room, provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the technology that are not described in detail in the above embodiments, reference may be made to a processing method of a reference relationship between a bullet screen library and a live broadcast room provided in any embodiment of the present invention.
Example four
Fig. 4 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary terminal 12 suitable for use in implementing embodiments of the present invention. The terminal 12 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 4, the terminal 12 is embodied in the form of a general purpose computing device. The components of the terminal 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Terminal 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by terminal 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The terminal 12 can further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The terminal 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the terminal 12, and/or any devices (e.g., network card, modem, etc.) that enable the terminal 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the terminal 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the terminal 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the terminal 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a processing method of reference relationship between the bullet screen library and the live broadcast provided by the embodiment of the present invention, where the method includes:
receiving a target hash value of a context object sent by a target live broadcast room when a page is destroyed;
if the target hash value is judged to be the same as the registered current hash value, determining that the current live broadcast room corresponding to the current hash value is a to-be-recovered live broadcast room;
deleting the current reference relation of the current live broadcast room so as to recycle the current live broadcast room;
the current reference relation and the current hash value are obtained by sending the current live broadcast room at the starting time so as to cover the historical hash value and the corresponding historical reference relation.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for processing a reference relationship between a bullet screen library and a live broadcast provided in any embodiment of the present invention is implemented, where the method includes:
receiving a target hash value of a context object sent by a target live broadcast room when a page is destroyed;
if the target hash value is judged to be the same as the registered current hash value, determining that the current live broadcast room corresponding to the current hash value is a to-be-recovered live broadcast room;
deleting the current reference relation of the current live broadcast room so as to recycle the current live broadcast room;
the current reference relation and the current hash value are obtained by sending the current live broadcast room at the starting time so as to cover the historical hash value and the corresponding historical reference relation.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
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 processing method for reference relationship between a barrage library and a live broadcast room is characterized by comprising the following steps:
receiving a target hash value of a context object sent by a target live broadcast room when a page is destroyed;
if the target hash value is judged to be the same as the registered current hash value, determining that the current live broadcast room corresponding to the current hash value is a to-be-recovered live broadcast room;
deleting the current reference relation of the current live broadcast room so as to recycle the current live broadcast room;
the current reference relation and the current hash value are obtained by sending the current live broadcast room at the starting time so as to cover a historical hash value and a corresponding historical reference relation;
if the target hash value is judged to be different from the registered current hash value, determining that the reference relation of the target live broadcast room is deleted;
and distributing the barrage message to the current live broadcast room based on the current reference relation of the current live broadcast room.
2. The method of claim 1, wherein the current hash value and the current reference relationship are stored in a preset key-value pair object in the form of a key-value pair.
3. The method of claim 2, wherein deleting the current reference relationship of the current live broadcast room comprises:
calling an element acquisition method of the preset key value pair object by taking the current hash value as a parameter to acquire a current reference relation of a current live broadcast room;
and calling a null object setting method, and assigning the null object to the current reference relation so as to delete the current reference relation.
4. The method of claim 1, wherein after receiving a target hash value of a context object sent by a target live broadcast upon page destruction, the method further comprises:
and calling a character string equality judging method by taking the target hash value and the registered current hash value as parameters to judge whether the target hash value and the current hash value are equal or not.
5. The method of claim 1, wherein the current reference relationship and the historical reference relationship are initialized by calling a constructor of an implementation class of a pre-set listener interface protocol, the implementation class inherited from the pre-set listener interface protocol by keyword instances.
6. A processing device for reference relationship between a barrage library and a live broadcast room is characterized by comprising:
the target hash value receiving module is used for receiving a target hash value of the context object sent by the target live broadcast room when the page is destroyed;
a to-be-recovered live broadcast room determining module, configured to determine, if it is determined that the target hash value is the same as the registered current hash value, that the current live broadcast room corresponding to the current hash value is a to-be-recovered live broadcast room;
the live broadcast room recovery processing module is used for deleting the current reference relation of the current live broadcast room so as to recover the current live broadcast room;
the current reference relation and the current hash value are obtained by sending the current live broadcast room at the starting time so as to cover the historical hash value and the corresponding historical reference relation.
7. The apparatus of claim 6, further comprising:
the reference relation judging module is used for determining that the reference relation of the target live broadcast room is deleted if the target hash value is judged to be different from the registered current hash value;
and the bullet screen distribution module is used for distributing bullet screen information to the current live broadcast room based on the current reference relation of the current live broadcast room.
8. A terminal, characterized in that the terminal comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more programs, cause the one or more processors to implement a method for processing a live broadcast-live broadcast reference relationship and a bullet screen library as recited in any one of claims 1-5.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements a method for processing a reference relationship between a bullet screen library and a live broadcast according to any one of claims 1 to 5.
CN201811161670.6A 2018-09-30 2018-09-30 Method, device, terminal and medium for processing reference relationship between barrage library and live broadcast room Active CN109413507B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811161670.6A CN109413507B (en) 2018-09-30 2018-09-30 Method, device, terminal and medium for processing reference relationship between barrage library and live broadcast room

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811161670.6A CN109413507B (en) 2018-09-30 2018-09-30 Method, device, terminal and medium for processing reference relationship between barrage library and live broadcast room

Publications (2)

Publication Number Publication Date
CN109413507A CN109413507A (en) 2019-03-01
CN109413507B true CN109413507B (en) 2021-05-25

Family

ID=65465939

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811161670.6A Active CN109413507B (en) 2018-09-30 2018-09-30 Method, device, terminal and medium for processing reference relationship between barrage library and live broadcast room

Country Status (1)

Country Link
CN (1) CN109413507B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442404B (en) * 2019-08-13 2022-07-05 武汉斗鱼鱼乐网络科技有限公司 Object release method, device, equipment and storage medium
CN110597737B (en) * 2019-08-22 2022-03-08 腾讯音乐娱乐科技(深圳)有限公司 Data processing method, data processing device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104661096A (en) * 2013-11-21 2015-05-27 深圳市快播科技有限公司 Video barrage adding method and device, video playing method and video player
CN106028166A (en) * 2016-06-24 2016-10-12 北京小米移动软件有限公司 Method and device for switching live broadcasting rooms in live broadcasting process
CN108270667A (en) * 2018-01-22 2018-07-10 赵宇航 A kind of Internet education platform and its multiuser interactive method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106412681B (en) * 2015-07-31 2019-12-24 腾讯科技(深圳)有限公司 Live bullet screen video broadcasting method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104661096A (en) * 2013-11-21 2015-05-27 深圳市快播科技有限公司 Video barrage adding method and device, video playing method and video player
CN106028166A (en) * 2016-06-24 2016-10-12 北京小米移动软件有限公司 Method and device for switching live broadcasting rooms in live broadcasting process
CN108270667A (en) * 2018-01-22 2018-07-10 赵宇航 A kind of Internet education platform and its multiuser interactive method

Also Published As

Publication number Publication date
CN109413507A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN109275042B (en) Bullet screen message distribution method, bullet screen message distribution device, terminal and storage medium
EP3340063A1 (en) Method, device, terminal, server, and system for accessing usb device
US9549036B2 (en) Network injected storage redirection for embedded applications
CN106098061B (en) Voice interaction method and device based on android system
US9275238B2 (en) Method and apparatus for data security reading
US8893272B2 (en) Method and device for recombining runtime instruction
CN112118459A (en) Method for realizing common live broadcast of multiple apps by sharing camera data and readable medium
CN109302639B (en) Bullet screen message distribution method, bullet screen message distribution device, terminal and storage medium
CN111954072B (en) Multimedia playing method, device, multimedia player and medium
CN109413507B (en) Method, device, terminal and medium for processing reference relationship between barrage library and live broadcast room
CN106550030B (en) A kind of data sharing method, apparatus and system
CN110780871A (en) Negative one-screen loading method and device, terminal and computer readable storage medium
CN107908957B (en) Safe operation management method and system of intelligent terminal
US8966068B2 (en) Selective logging of network requests based on subsets of the program that were executed
CN109327726B (en) Barrage message processing method and device, terminal and storage medium
US11431795B2 (en) Method, apparatus and storage medium for resource configuration
CN109348303B (en) Bullet screen message distribution method, bullet screen message distribution device, terminal and storage medium
CN109068170B (en) Storage method, device, terminal and storage medium for barrage message
CN110096543B (en) Data operation method, device, server and medium of application program
CN109413498B (en) Bullet screen message distribution method, bullet screen message distribution device, terminal and storage medium
CN113986995A (en) Request distribution method and device, storage medium and electronic equipment
CN108959955B (en) File processing method and device
CN109101253B (en) Management method and device for host in cloud computing system
CN112988426A (en) Message processing method and device
CN112291584A (en) Dynamic effect file processing method and device and electronic 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