CN109284148B - Live broadcast room broadcasting reminding method and device, terminal and storage medium - Google Patents

Live broadcast room broadcasting reminding method and device, terminal and storage medium Download PDF

Info

Publication number
CN109284148B
CN109284148B CN201811163472.3A CN201811163472A CN109284148B CN 109284148 B CN109284148 B CN 109284148B CN 201811163472 A CN201811163472 A CN 201811163472A CN 109284148 B CN109284148 B CN 109284148B
Authority
CN
China
Prior art keywords
live broadcast
service program
function
platform server
live
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
CN201811163472.3A
Other languages
Chinese (zh)
Other versions
CN109284148A (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 CN201811163472.3A priority Critical patent/CN109284148B/en
Publication of CN109284148A publication Critical patent/CN109284148A/en
Application granted granted Critical
Publication of CN109284148B publication Critical patent/CN109284148B/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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications

Abstract

The embodiment of the invention discloses a live broadcast room broadcasting reminding method, a live broadcast room broadcasting reminding device, a terminal and a storage medium, wherein the live broadcast room broadcasting reminding method comprises the following steps: and a service program of the operating system is created according to the preset execution logic, after the service program is started, data sent to the service program by the live broadcast platform server is received by using a socket independent thread in the service program, and if the data is determined to be the start-broadcast message of the target live broadcast room, the live broadcast platform client is started by using the service program, so that the live broadcast platform client starts the start-broadcast reminding function of the live broadcast room. The embodiment of the invention can remind a computer user to watch the content of the target live broadcast room in time.

Description

Live broadcast room broadcasting reminding method and device, terminal and storage medium
Technical Field
The embodiment of the invention relates to the technical field of internet live broadcast, in particular to a live broadcast room starting reminding method, a live broadcast room starting reminding device, a terminal and a storage medium.
Background
With the development of computer technology and network technology, more and more users watching live video broadcast are popularized in live network broadcast, and users can log in application programs of live network broadcast, enter interested live broadcast rooms and watch live broadcast programs of anchor broadcasts.
With the increasing popularity of live broadcasting, the demand of users for watching live programs on time is increasing. The computer system can provide a starting function for the live broadcast platform client, so that the function of pushing the start reminding message of the live broadcast room by using the live broadcast platform client is realized. However, once the antivirus software or some startup optimization software disables the startup function of the live broadcast platform client, or the user closes the live broadcast platform client started up with the startup after starting up the computer, the computer system cannot push the live broadcast room start-up reminding message to the user by using the live broadcast platform client.
Disclosure of Invention
In view of this, embodiments of the present invention provide a live broadcast room start-broadcast reminding method, apparatus, terminal and storage medium, so that a computer user can watch content of a target live broadcast room in time.
In a first aspect, an embodiment of the present invention provides a live broadcast room start reminding method, where the method includes:
creating a service program of an operating system according to a preset execution logic;
after the service program is started, receiving data sent to the service program by the live broadcast platform server by using a socket independent thread in the service program;
and if the data is determined to be the start-up message of the target live broadcast room, starting a live broadcast platform client by using the service program so as to enable the live broadcast platform client to start a live broadcast room start-up reminding function.
In a second aspect, an embodiment of the present invention provides a device for reminding a live broadcast in a live broadcast room, where the device includes:
the service program creating module is used for creating a service program of the operating system according to the preset execution logic;
the data receiving module is used for receiving data sent to the service program by the live broadcast platform server by using a socket independent thread in the service program after the service program is started;
and the live broadcast room start reminding module is used for starting a live broadcast platform client by using the service program if the data is determined to be the start broadcast message of the target live broadcast room, so that the live broadcast platform client starts a live broadcast room start reminding function.
In a third aspect, an embodiment of the present invention provides a live broadcast room broadcast reminding terminal, where the terminal includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a live room opening reminder method as in any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a live broadcast reminding method according to any embodiment of the present invention.
According to the live broadcast room start reminding method, the live broadcast room start reminding device, the terminal and the storage medium, the service program of the operating system is created according to the preset execution logic, after the service program is started, the data sent to the service program by the live broadcast platform server are received by using a socket independent thread in the service program, and if the data are determined to be the start broadcast message of the target live broadcast room, the live broadcast platform client is started by using the service program, so that the live broadcast platform client starts a live broadcast room start reminding function, and a computer user can be reminded to watch the content of the target live broadcast room in time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the technical solutions in the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a live broadcast room start reminding method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a live broadcast reminding device provided in a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a live broadcast reminding terminal provided in a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described through embodiments with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Fig. 1 is a flowchart of a live broadcast room start reminding method according to an embodiment of the present invention, where this embodiment is applicable to a situation where a computer user needs to watch content of a concerned live broadcast room in time, and the method may be implemented by a live broadcast room start reminding device, and may be implemented by software and/or hardware in the live broadcast room start reminding device. Referring to fig. 1, the live broadcasting room broadcasting reminding method includes the following steps:
and S110, creating a service program of the operating system according to the preset execution logic.
The operating system may be a windows operating system, and the service program of the operating system may be a type of program programmed to assist a user in using and maintaining a computer, provide a service means, and support development of other software. The system can be started along with the starting of the operating system, does not display any interface, is started as a service, and is suitable for long-time running.
In this embodiment, when the live broadcast platform client cannot be started with the start of the operating system, it is preferable that a service program capable of performing data communication with the live broadcast platform server be created in the computer according to a preset execution logic. The preset execution logic may preferably be the whole process of establishing communication connection between the service program and the live broadcast platform server and receiving data sent by the live broadcast platform server.
And S120, after the service program is started, receiving data sent to the service program by the live broadcast platform server by using a socket independent thread in the service program.
And S130, if the data is determined to be the start-playing message of the target live broadcast room, starting the live broadcast platform client by using the service program so as to enable the live broadcast platform client to start the start-playing reminding function of the live broadcast room.
The live broadcast platform server can be a background server of the live broadcast platform, and the target live broadcast room can be a live broadcast room concerned or collected by the user.
In this embodiment, after the service program of the operating system is started, the service program needs to establish a connection with the live platform server to receive a message pushed by the live platform server. Preferably, a socket can be used to establish a communication connection between the service program and the live platform server. Where socket (also called socket) is used to describe IP address and port, it is a handle of a communication chain. Applications typically make or respond to network requests through a socket.
After the service program establishes communication connection with the live broadcast platform server, a socket independent thread can be preferably created, and the socket independent thread is used for receiving data sent to the service program by the live broadcast platform server. After a service program receives data sent by a live broadcast platform server through a socket independent thread, preferably, whether the data is a broadcast message of a target live broadcast room can be judged, if the data is determined to be the broadcast message of the target live broadcast room, a live broadcast platform client is started, the received broadcast message of the target live broadcast room is sent to the live broadcast platform client, and therefore the live broadcast platform client knows that the target live broadcast room is about to be broadcast. After knowing that the target live broadcast room is about to start broadcasting, the live broadcast platform client starts a live broadcast room starting reminding function so as to remind a user of watching live broadcast contents in time.
For example, after it is determined that the data received by the service program is a broadcast message of the target live broadcast room, the service program may be used to start client software of a live broadcast platform in the computer. Taking a windows operating system as an example, the system provides an API function CreateProcess function which can be used for starting an application program.
Wherein, the CreateProcess function prototype is as follows:
BOOL CreateProcess
(LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes。
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation);
the first parameter LPCTEST lpApplicationName is used for transmitting the full path name of live broadcast platform client software in a computer; the second parameter LPTSTR lpcompmandline is used to transmit information of a target live broadcast room, such as room number of the live broadcast room, current time, and nickname of the room; other parameters may be null information.
The client software of the live platform in the computer can be started by using the Create Process function. And when the service program starts the live broadcast platform client, the start broadcast information of the target live broadcast room is sent to the live broadcast platform client, so that the live broadcast platform client software knows that the target live broadcast room is about to start broadcast, and the live broadcast platform client starts the start broadcast reminding function of the live broadcast room in a preset mode. The preset mode can be that a prompt box about to be played in a target live broadcast room is popped up, or the target live broadcast room directly jumps to a corresponding live broadcast room.
According to the live broadcast room start reminding method provided by the embodiment, the service program of the operating system is created according to the preset execution logic, after the service program is started, the data sent to the service program by the live broadcast platform server is received by using a socket independent thread in the service program, and if the data is determined to be the start message of the target live broadcast room, the live broadcast platform client is started by using the service program, so that the live broadcast platform client starts the live broadcast room start reminding function, and a computer user can be reminded to watch the content of the target live broadcast room in time.
On the basis of the foregoing embodiments, further, creating a service program of an operating system according to a preset execution logic includes:
initializing a forwarding table structure body of a service program, and determining attributes of variables in the forwarding table structure body, wherein the first attribute is the name of the service program, and the second attribute is an entry function of the service program;
initializing an entry function, creating a socket independent thread in the entry function to establish communication between the service program and the live broadcast platform server, and receiving data sent to the service program by the live broadcast platform server by using the socket independent thread.
For example, the following description is specifically given by taking an operating system as a windows operating system: first, a forwarding table structure of a service program may be initialized, where the structure may specifically be as follows:
SERVICE_TABLE_ENTRY ServiceTable;
ServiceTable[0].lpServiceName=_T(SERVICE_NAME);
ServiceTable[0].lpServiceProc=(LPSERVICE_MAIN_FUNCTION)service_main;
the forwarding TABLE structure of the SERVICE program is SERVICE _ TABLE _ ENTRY, and the defined variable is ServiceTable. The variable of the forwarding table has 2 attributes, one attribute being the name of the service program and one attribute being the entry function of the service program. The entry function refers to a function to be executed after the service program is started.
After initializing the forwarding table structure of the service program, it is preferable that an entry function of the service program is initialized. In this embodiment, the entry function of the service program may be preferably initialized by calling the system API function startservicectrldispatccher function. Parameters of the entry function can be transmitted into a forwarding table of the service program, so that a corresponding relation between the name of the service program and the entry function can be created in the operating system. So that when the service program is started, the corresponding entry function logic is called.
Since the service program calls the entry function logic at the time of starting, the entry function includes the execution logic of the service program. Wherein the entry function may be as follows:
void WINAPI service_main(int argc,char**argv)
in this entry function, a socket independent thread may be preferably created to establish communication between the service program and the live platform server, and the socket independent thread may be used to receive data sent to the service program by the live platform server. Specifically, the socket independent Thread may be created by calling a Create Thread function, and the specific implementation manner may be as follows:
HANDLE task_handle=Create Thread(NULL,NULL,Socket_thread,NULL,NULL,NULL);
among them, for the Create Thread function, the most important parameter is the callback execution function Socket _ Thread function. This function performs the entire logical function of the independent thread.
Further, after initializing the entry function, the method further includes:
registering and creating a stopping callback function in the entry function, wherein the stopping callback function comprises a control event type parameter of a service program;
and when the control event type parameter is a parameter representing service program stopping, the stopping callback function calls the socket independent thread stopping function to terminate the socket independent thread.
Illustratively, in the entry function, a stop callback function may preferably be registered. The stop callback function is used for cleaning up the service program when the service program is stopped, and may be, for example, releasing resources. In this embodiment, the stop callback function is configured to terminate execution of the socket independent thread and release the socket independent thread when the service program is stopped. Preferably, the stop callback function may be registered by calling a registersservicectrlhandler function. The code for this register stop callback function is as follows:
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandler(
LPCTSTR lpServiceName,
LPHANDLER_FUNCTION lpHandlerProc);
wherein, the parameter LPCTESTR lpServiceName represents the name of the service program; the parameter LPHANDLER _ FUNCTION lphandlerpec represents a stop callback FUNCTION of the service program.
After the stop callback function is registered in the entry function by using the above logic, a stop callback function may be preferably created in the entry function to call the socket independent thread stop function to terminate the socket independent thread when a service stop is detected. Preferably, the stop callback function of the entry function may be created using the following code:
void WINAPI ServiceHandler(DWORD fdwControl)
wherein the parameter DWORD fdwControl indicates the type of control event of the service program. When the parameters are SERVICE _ CONTROL _ STOP and SERVICE _ CONTROL _ shut down, the SERVICE program is stopped, and at this time, the execution of the socket independent thread also needs to be stopped. In particular, the socket independent thread may be stopped by calling the function TerminateThread, where the created thread handle is passed in.
Further, creating a socket independent thread in the entry function to establish communication between the service program and the live broadcast platform server, and receiving data sent to the service program by the live broadcast platform server by using the socket independent thread, including:
initializing a socket;
setting an address family and a port number of a server;
taking the initialized socket, the address family and the port number as parameters of a connection function and executing the connection function so as to establish communication connection between the service program and the live broadcast platform server;
creating a thread object and a thread execution function corresponding to the thread object, and binding the thread object and the thread execution function to create a socket independent thread;
and calling a Start method to execute a socket independent thread so as to acquire and store the data sent to the service program by the live broadcast platform server.
Illustratively, a connection may first be established with the live platform server by creating the relevant data for the socket. Specifically, the socket may be initialized with int socket fd (AF _ INET, socket _ STREAM,0), and then the address family and the port number (host endian to network endian) of the live platform server may be set with servaddr. After creating the data related to the socket, it may be preferable to call a system function connect function, take the initialized socket, address family, and port number as parameters of the connect function, and execute intnRet ═ connect (sockfd, (struct sockaddr) & servaddr, sizeof (servddr)) to implement a communication connection between the service program and the live platform server.
For example, the process of creating a Socket independent thread by using the callback execution function Socket _ thread function may be: creating a Thread object Thread _; writing a thread execution function void _ RunThread () corresponding to the thread object at the same time; and binding the thread object and the thread execution function based on the Boost base library to complete the establishment of the socket independent thread. Wherein, the concrete binding operation is as follows: thread (boost: (& RunThread, this)). And creating a completed socket independent thread, namely, an executable thread to execute the basic logic of the function RunThread. Then, a Start method can be called to execute a socket independent thread to acquire and store data sent to the service program by the live broadcast platform server, and the specific execution operation is as follows: thread _. start ().
Writing while in a thread execution function RunThread to continuously monitor the state of the socket, and continuously receiving network data sent by the live platform server from the socket. Illustratively, the while loop may be of the form:
while(true){
reading data received by sokcet and sent by a live broadcast platform server; if (select, Read _ FD _ ISSET (socket)) { judging whether the socket can Read the network data of the live broadcast platform server, judging whether the socket is in the Read set Read _ FD _ ISSET through a select object, and further determining whether the current socket can Read the data sent by the live broadcast platform server; onread (); informing a service program that data can be read in the current socket by calling OnRead of an event object, so that network data of a live platform server can be read; ssize _ t ret ═ recv (socket, (char) · buf, len, 0); where buf is used to store the read data, and len is the read length. The completion of this function call will store the network data in buf. }
Further, if it is determined that the data is the broadcast message of the target live broadcast room, the live broadcast platform client is started by using the service program, so that the live broadcast platform client starts the broadcast reminding function of the live broadcast room, including:
analyzing the data by using a service program, and determining whether the data is a broadcast message of a target live broadcast room or not according to the analyzed data;
and if the data is determined to be the start-playing message of the target live broadcast room, starting the live broadcast platform client by using the service program so as to enable the live broadcast platform client to start the start-playing reminding function of the live broadcast room.
In this embodiment, after receiving data sent by a live broadcast platform server through a socket independent thread, a service program may parse the data according to a preset communication protocol format, and may determine whether the data is an initiating message of a target live broadcast room according to the parsed data; and if the data is determined to be the start-playing message of the target live broadcast room, starting the live broadcast platform client by using the service program so as to enable the live broadcast platform client to start the start-playing reminding function of the live broadcast room.
Specifically, the service program may receive data of the server through a system function recv in the socket independent thread, and then, the service program may analyze the data according to a preset communication protocol format, specifically: an instance object DataDecoder pDecoder () of a message parsing class DataDecoder may be created; and then, analyzing the received data by using pDecoder- > Parse (buf), wherein buf represents a piece of received data. And after the data analysis is finished, the data type of the data can be obtained.
Taking the data as the broadcast message of the target live broadcast room as an example, the data analysis process is specifically explained as follows:
string (pDecoder- > GetItem (type)); wherein the type value of the acquisition message field represents the type of data.
If (cmdtype ═ notify ") { indicates that it is a piece of notification data, and then needs to parse other fields.
nroomId ═ pDecoder- > getitemaint ("roomid"); a room number is obtained.
nroomname ═ pDecoder- > getitemaasyint ("roomname"); the room name is obtained.
time ═ pDecoder- > getitemasinot ("time"); and acquiring the time of broadcasting. }
Through the analysis process, the server sends a start-up message of the target live broadcast room, and at the moment, the live broadcast platform client can be started by using the service program, so that the live broadcast platform client starts a start-up reminding function of the live broadcast room.
Further, before receiving data sent to the service program by the live broadcast platform server by using a socket independent thread in the service program, the method further includes:
establishing a protocol format between a service program and a live broadcast platform server, wherein the protocol format is that data sent to the service program by the live broadcast platform server comprises a packet header and a packet body;
the length of the packet header is a preset byte length and is used for recording the length of the protocol content in the packet body, and the packet body is in a character string form and is used for recording the protocol content.
Illustratively, when the service program communicates with the live platform server, a protocol format needs to be established, and protocol content needs to be determined, so that the live platform server sends specific protocol content through the protocol format, so that the service program can receive data sent by the live platform server from the protocol, and parse the protocol content according to the protocol format. Because the communication connection between the service program and the live broadcast platform server is TCP streaming, and there are sub-package and sticky package situations, it is preferable that the protocol format is created such that the data sent from the live broadcast platform server to the service program includes two parts, namely a packet header and a packet body, where the length of the packet header is a preset byte length for recording the length of the protocol content in the packet body, and the packet body is in a character string form for recording the protocol content. Preferably, the preset byte length of the packet header may be 4 bytes long, and it may further include a 2-byte length identifier for a placeholder and also for subsequent extension.
For example, the broadcast message of the live broadcast room may be set as: the message type is type @ ═ notify; room number information roomid @ 356, indicating that the room number is 356; the room name roomname @ is the first outdoors and represents the room nickname. The time of playback @ 1523654894 indicates time stamp information.
Further, after creating the protocol format between the service program and the live platform server, the method further includes:
encoding the protocol content to obtain a character string corresponding to the protocol content, and writing the character string into the bag body;
writing the length of the character string into a packet header based on the character string;
and taking the packet header and the packet body as data sent to the service program by the live broadcast platform server, and sending the data to the service program by the live broadcast platform server by utilizing the socket independent thread.
Illustratively, when it is detected that a live broadcast room is about to be broadcast, the live broadcast platform server obtains a room number corresponding to the live broadcast room, and the live broadcast platform server traverses all users by using the room number and sends a broadcast message of the live broadcast room to a user who concerns or collects the live broadcast room. Before sending, the live platform server encodes the protocol content according to the protocol format, and then sends the broadcast message of the live room through the communication connection. The specific process is as follows:
creating a coding object DataEncoder encodemesg;
type of join message:
encodemeg.additem ("type", "notify"); indicating that the joining protocol type is notify.
encodemeg.additem ("roomid", 356); indicating that the joining room number is 356.
encodemeg.additem ("roomname", "outdoor first"); indicating a joining room nickname.
encodemeg.additem ("time", 1523654894); indicating that the time stamp information was added 1523654894.
And then acquires the encoded character string through an interface thereof.
Char*pData=encodemsg->GetResualt();
The specific protocol content is stored in the pData string.
The live broadcast platform server can send the character string to a service program, and adds packet header information when sending data.
Example two
Fig. 2 is a schematic structural diagram of a live broadcast reminding device in a live broadcast room according to a second embodiment of the present invention. Referring to fig. 2, the device for reminding the live broadcast in the live broadcast room in this embodiment includes:
a service program creating module 210, configured to create a service program of an operating system according to a preset execution logic;
the data receiving module 220 is used for receiving data sent to the service program by the live broadcast platform server by using a socket independent thread in the service program after the service program is started;
and the live broadcast room start reminding module 230 is configured to start the live broadcast platform client by using a service program if it is determined that the data is the start message of the target live broadcast room, so that the live broadcast platform client starts a live broadcast room start reminding function.
According to the live broadcast room start reminding device provided by the embodiment, a service program of an operating system is created by using a service program creating module according to preset execution logic, after the service program is started, data sent to the service program by a live broadcast platform server is received by using a socket independent thread in the service program through a data receiving module, whether the data is a target live broadcast start message or not is determined by using a live broadcast room start reminding module, if the data is determined to be the target live broadcast room start message, a live broadcast platform client is started by using the service program, so that the live broadcast platform client starts a live broadcast room start reminding function, and a computer user can be reminded to watch the content of the target live broadcast room in time.
On the basis of the foregoing embodiments, further, the service creation module 210 may include:
the forwarding table initialization submodule is used for initializing a forwarding table structure body of a service program and determining attributes of variables in the forwarding table structure body, wherein the first attribute is the name of the service program, and the second attribute is an entry function of the service program;
the entry function initialization submodule is used for initializing an entry function;
and the socket independent thread creating submodule is used for creating a socket independent thread in the entry function so as to establish communication between the service program and the live broadcast platform server, and receiving data sent to the service program by the live broadcast platform server by using the socket independent thread.
Further, the service program creating module 210 may further include a stop callback function creating sub-module, configured to register and create a stop callback function in the entry function after the entry function is initialized, where the stop callback function includes a control event type parameter of the service program;
and when the control event type parameter is a parameter representing service program stopping, the stopping callback function calls the socket independent thread stopping function to terminate the socket independent thread.
Further, the socket independent thread creating sub-module may specifically include:
a socket initialization unit for initializing a socket;
the parameter setting unit is used for setting the address family and the port number of the server;
the communication connection establishing unit is used for taking the initialized socket, the address family and the port number as parameters of a connect function and executing the connect function so as to establish communication connection between the service program and the live broadcast platform server;
the socket independent thread creating unit is used for creating a thread object and a thread execution function corresponding to the thread object, and binding the thread object and the thread execution function to create a socket independent thread;
and the socket independent thread execution unit is used for calling the Start method to execute the socket independent thread so as to acquire and store the data sent to the service program by the live broadcast platform server.
Further, the live broadcast reminding module 230 may specifically include:
the broadcast message determining submodule is used for analyzing the data by using the service program and determining whether the data is the broadcast message of the target live broadcast room or not according to the analyzed data;
and if the data is determined to be the start-playing message of the target live broadcast room, starting the live broadcast platform client by using the service program so as to enable the live broadcast platform client to start the start-playing reminding function of the live broadcast room.
Further, the device can also comprise a protocol format creating module which is used for creating a protocol format for the live platform server before receiving the data sent to the service program by the live platform server by utilizing the socket independent thread in the service program,
establishing a protocol format between a service program and a live broadcast platform server, wherein the protocol format is that data sent to the service program by the live broadcast platform server comprises a packet header and a packet body;
the length of the packet header is a preset byte length and is used for recording the length of the protocol content in the packet body, and the packet body is in a character string form and is used for recording the protocol content.
Further, the apparatus may further include a data sending module, and the data sending module may be configured to, after creating the protocol format between the service program and the live platform server, further include:
encoding the protocol content to obtain a character string corresponding to the protocol content, and writing the character string into the bag body;
writing the length of the character string into a packet header based on the character string;
and taking the packet header and the packet body as data sent to the service program by the live broadcast platform server, and sending the data to the service program by the live broadcast platform server by utilizing the socket independent thread.
The live broadcast room broadcasting reminding device provided by the embodiment of the invention can execute the live broadcast room broadcasting reminding method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a live broadcast reminding terminal provided in a third embodiment of the present invention. Fig. 3 illustrates a block diagram of an exemplary live room broadcast reminder terminal 312 suitable for use in implementing embodiments of the present invention. The live broadcast reminder terminal 312 shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 3, the live room announcement terminal 312 is in the form of a general purpose computing device. The components of the live room announcement terminal 312 may include, but are not limited to: one or more processors 316, a memory 328, and a bus 318 that couples the various system components including the memory 328 and the processors 316.
Bus 318 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.
The live room announcement terminal 312 typically includes a variety of computer system readable media. These media may be any available media that can be accessed by the live room start reminder terminal 312 and include both volatile and non-volatile media, removable and non-removable media.
Memory 328 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)330 and/or cache memory 332. The live room announcement reminder terminal 312 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, the storage device 334 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 3, and commonly referred to as a "hard drive"). Although not shown in FIG. 3, 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 318 by one or more data media interfaces. Memory 328 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 340 having a set (at least one) of program modules 342 may be stored, for example, in memory 328, such program modules 342 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 342 generally perform the functions and/or methodologies of the described embodiments of the invention.
The live room announcement terminal 312 may also communicate with one or more external devices 314 (e.g., a keyboard, a pointing device, a display 324, etc., where the display 324 may be configured or not as desired), one or more devices that enable a user to interact with the live room announcement terminal 312, and/or any device (e.g., a network card, a modem, etc.) that enables the live room announcement terminal 312 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 322. Also, the on-air reminder terminal 312 can also 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 320. As shown, the network adapter 320 communicates with the other modules of the on-air reminder terminal 312 via the bus 318. It should be appreciated that although not shown in fig. 3, other hardware and/or software modules may be used in conjunction with the live room on-air reminder terminal 312, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage, among others.
Processor 316 executes programs stored in memory 328 to perform various functional applications and data processing, such as implementing live broadcast reminder methods provided by embodiments of the present invention.
Example four
A fourth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a live broadcast start-up reminding method provided in the embodiment of the present invention, and the method includes:
creating a service program of an operating system according to a preset execution logic;
after the service program is started, receiving data sent to the service program by a live broadcast platform server by using a socket independent thread in the service program;
and if the data is determined to be the start-playing message of the target live broadcast room, starting the live broadcast platform client by using the service program so as to enable the live broadcast platform client to start the start-playing reminding function of the live broadcast room.
Of course, the computer program stored on the computer-readable storage medium provided in the embodiment of the present invention is not limited to execute the method operations described above, and may also execute related operations in the live broadcast room start reminding method based on the live broadcast room start reminding terminal provided in any embodiment of the present invention.
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 (8)

1. A live broadcast room starting reminding method is characterized by comprising the following steps:
initializing a forwarding table structure body of a service program, and determining attributes of variables in the forwarding table structure body, wherein a first attribute is a name of the service program, and a second attribute is an entry function of the service program;
initializing the entry function, creating a socket independent thread in the entry function to establish communication between the service program and a live broadcast platform server, and receiving data sent to the service program by the live broadcast platform server by using the socket independent thread, wherein the service program is positioned in an operating system and is started along with the starting of the operating system;
after the initializing the entry function, further comprising:
registering and creating a stopping callback function in the entry function, wherein the stopping callback function comprises a control event type parameter of the service program;
when the control event type parameter is a parameter representing the service program stopping, the stopping callback function calls a socket independent thread stopping function to terminate the socket independent thread;
after the service program is started, receiving data sent to the service program by the live broadcast platform server by using a socket independent thread in the service program;
and if the data is determined to be the start-up message of the target live broadcast room, starting a live broadcast platform client by using the service program so as to enable the live broadcast platform client to start a live broadcast room start-up reminding function.
2. The method of claim 1, wherein creating a socket independent thread in the entry function to establish communication between the service program and the live platform server, and receiving data sent by the live platform server to the service program using the socket independent thread comprises:
initializing a socket;
setting an address family and a port number of the live broadcast platform server;
taking the initialized socket, the address family and the port number as parameters of a connect function and executing the connect function so as to establish communication connection between the service program and the live broadcast platform server;
creating a thread object and a thread execution function corresponding to the thread object, and binding the thread object and the thread execution function to create a socket independent thread;
and calling a Start method to execute the socket independent thread so as to acquire and store the data sent to the service program by the live broadcast platform server.
3. The method of claim 1, wherein if it is determined that the data is a broadcast message of a target live broadcast room, starting a live broadcast platform client by using the service program, so that the live broadcast platform client starts a live broadcast room broadcast reminding function, including:
analyzing the data by using the service program, and determining whether the data is a broadcast message of a target live broadcast room or not according to the analyzed data;
and if the data is determined to be the start-up message of the target live broadcast room, starting a live broadcast platform client by using the service program so as to enable the live broadcast platform client to start a live broadcast room start-up reminding function.
4. The method of claim 1, further comprising, before receiving data sent by the live platform server to the service program using a socket independent thread in the service program, the method further comprising:
creating a protocol format between the service program and the live broadcast platform server, wherein the protocol format is that data sent to the service program by the live broadcast platform server comprises a packet header and a packet body;
the length of the packet header is a preset byte length and is used for recording the length of the protocol content in the packet body, and the packet body is in a character string form and is used for recording the protocol content.
5. The method of claim 4, further comprising, after the creating a protocol format between the service program and the live platform server:
encoding the protocol content to obtain a character string corresponding to the protocol content, and writing the character string into the bag body;
writing the length of the character string into the packet header based on the character string;
and taking the packet header and the packet body as data sent to the service program by the live broadcast platform server, and sending the data to the service program by the live broadcast platform server by utilizing the socket independent thread.
6. The utility model provides a live room reminding device that broadcasts, its characterized in that includes:
the service program creating module is used for creating a service program of the operating system according to the preset execution logic;
the data receiving module is used for receiving data sent to the service program by a live broadcast platform server by using a socket independent thread in the service program after the service program is started, wherein the service program is positioned in an operating system and is started along with the starting of the operating system;
the live broadcast room broadcasting reminding module is used for starting a live broadcast platform client by using the service program if the data is determined to be the broadcasting message of the target live broadcast room, so that the live broadcast platform client starts a live broadcast room broadcasting reminding function;
the service program creating module includes:
the forwarding table initialization submodule is used for initializing a forwarding table structure body of a service program and determining attributes of variables in the forwarding table structure body, wherein the first attribute is the name of the service program, and the second attribute is an entry function of the service program;
the entry function initialization submodule is used for initializing an entry function;
the socket independent thread creating submodule is used for creating a socket independent thread in an entry function so as to establish communication between the service program and the live broadcast platform server, and receiving data sent to the service program by the live broadcast platform server by using the socket independent thread;
the service creation module further comprises: the stopping callback function creating submodule is used for registering and creating a stopping callback function in the entry function after the entry function is initialized, and the stopping callback function comprises a control event type parameter of the service program;
and when the control event type parameter is a parameter representing service program stopping, the stopping callback function calls the socket independent thread stopping function to terminate the socket independent thread.
7. The utility model provides a live room is opened and is broadcast and remind terminal which characterized in that, the terminal includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the live room break reminder method of any 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 a live room opening reminder method according to any one of claims 1 to 5.
CN201811163472.3A 2018-09-30 2018-09-30 Live broadcast room broadcasting reminding method and device, terminal and storage medium Active CN109284148B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811163472.3A CN109284148B (en) 2018-09-30 2018-09-30 Live broadcast room broadcasting reminding method and device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811163472.3A CN109284148B (en) 2018-09-30 2018-09-30 Live broadcast room broadcasting reminding method and device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109284148A CN109284148A (en) 2019-01-29
CN109284148B true CN109284148B (en) 2020-10-27

Family

ID=65176526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811163472.3A Active CN109284148B (en) 2018-09-30 2018-09-30 Live broadcast room broadcasting reminding method and device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109284148B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101909061A (en) * 2010-08-06 2010-12-08 福建升腾资讯有限公司 Creation and application method of dynamic virtual channel based on remote display protocol
CN106982228A (en) * 2017-05-08 2017-07-25 北京深思数盾科技股份有限公司 One kind realizes identity authentication method and system
CN107229483A (en) * 2016-03-23 2017-10-03 福建福昕软件开发股份有限公司 Local service it is disabled or stop in the case of perform local service function method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391307B (en) * 2012-05-11 2018-03-20 阿里巴巴集团控股有限公司 Offline transparent transmission and display methods, the apparatus and system of off-line data
CN104104524B (en) * 2013-04-09 2019-04-05 广州华多网络科技有限公司 Method, terminal, server and the system of direct broadcast service are provided
CN104618218B (en) * 2014-12-29 2018-07-17 广州酷狗计算机科技有限公司 Message prompt method and device
CN105391785A (en) * 2015-11-25 2016-03-09 广州华多网络科技有限公司 Method for processing service message and server
CN106385636A (en) * 2016-10-08 2017-02-08 武汉斗鱼网络科技有限公司 Live broadcasting room jump method through message pushing and live broadcasting room jump system thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101909061A (en) * 2010-08-06 2010-12-08 福建升腾资讯有限公司 Creation and application method of dynamic virtual channel based on remote display protocol
CN107229483A (en) * 2016-03-23 2017-10-03 福建福昕软件开发股份有限公司 Local service it is disabled or stop in the case of perform local service function method
CN106982228A (en) * 2017-05-08 2017-07-25 北京深思数盾科技股份有限公司 One kind realizes identity authentication method and system

Also Published As

Publication number Publication date
CN109284148A (en) 2019-01-29

Similar Documents

Publication Publication Date Title
JP4592749B2 (en) Session description message extension
US20040243714A1 (en) Automatic Detection of intermediate network device capabilities
KR20110007114A (en) Systems and methods for managing multimedia operations in remote sessions
WO2020177698A1 (en) Inter-mini program platform communication method and device, and computer storage medium
CN110971922B (en) Live broadcast and microphone connection state monitoring method, client, server, medium and system
US11909799B2 (en) Media playback apparatus and method including delay prevention system
WO2017114190A1 (en) File uploading processing method and device
CN110996160B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN112653700A (en) Website video communication method based on WEBRTC
CN111880865A (en) Multimedia data pushing method and device, electronic equipment and storage medium
WO2020177697A1 (en) Method for discovery between mini program platforms, device, and computer storage medium
CN111163330A (en) Live video rendering method, device, system, equipment and storage medium
CN113132748A (en) Interactive invitation method, device, equipment and storage medium across live broadcast rooms
KR101290977B1 (en) Message transfer method using push server and the system thereby
TWI634784B (en) Digital media content playing transfer method and application device thereof
WO2015035934A1 (en) Methods and systems for facilitating video preview sessions
CN109284148B (en) Live broadcast room broadcasting reminding method and device, terminal and storage medium
CN114285836B (en) Video playing method, device and medium
CN108279855B (en) Method for reading and writing storage device
WO2022028189A1 (en) Screen projection method and apparatus, electronic device, and computer readable storage medium
CN109408255A (en) A kind of direct broadcasting room starts broadcasting based reminding method, device, terminal and storage medium
CN110262912B (en) Calling method and device for procedure call gRPC
CN112532719A (en) Information flow pushing method, device, equipment and computer readable storage medium
CN113852835A (en) Live broadcast audio processing method and device, electronic equipment and storage medium
CN113194277B (en) Method, device and storage medium for multi-screen video of conference terminal

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