CN109284148A - A kind of direct broadcasting room starts broadcasting based reminding method, device, terminal and storage medium - Google Patents
A kind of direct broadcasting room starts broadcasting based reminding method, device, terminal and storage medium Download PDFInfo
- Publication number
- CN109284148A CN109284148A CN201811163472.3A CN201811163472A CN109284148A CN 109284148 A CN109284148 A CN 109284148A CN 201811163472 A CN201811163472 A CN 201811163472A CN 109284148 A CN109284148 A CN 109284148A
- Authority
- CN
- China
- Prior art keywords
- service routine
- live streaming
- streaming platform
- data
- direct broadcasting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
Abstract
It starts broadcasting based reminding method, device, terminal and storage medium the embodiment of the invention discloses a kind of direct broadcasting room, wherein, the direct broadcasting room based reminding method that starts broadcasting includes: to execute logic according to default, the service routine of creation of operating system, after service routine starting, utilize the socket separate threads in service routine, receive the data that live streaming Platform Server is sent to service routine, if it is determined that data are the message that starts broadcasting of target direct broadcasting room, then using service routine starting live streaming platform client, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.The embodiment of the present invention can remind the content of computer user's viewing target direct broadcasting room in time.
Description
Technical field
The present embodiments relate to internet direct seeding technique field more particularly to a kind of direct broadcasting room start broadcasting based reminding method, dress
It sets, terminal and storage medium.
Background technique
With the development of computer technology and network technology, the user of watching video live broadcast is more and more, and network direct broadcasting obtains
It has arrived and has widely popularized, user can watch the straight of main broadcaster into interested direct broadcasting room with the application program that logging in network is broadcast live
Broadcast program.
As the pouplarity of live streaming is more and more stronger, user is more and more stronger for the demand for watching programme televised live on time
It is strong.Computer system can be by providing starting up's function for live streaming platform client, and then realizes and utilize live streaming platform visitor
Family end push direct broadcasting room starts broadcasting the function of reminder message.But once antivirus software or some starting up's optimization softwares will
The starting up's function disabling or user that platform client is broadcast live close starting up's function of the live streaming platform client
Close or user start computer after will with the live streaming platform client of starting up close, computer system just can not benefit
It is that user pushes direct broadcasting room and starts broadcasting reminder message with live streaming platform client.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of direct broadcasting room start broadcasting based reminding method, device, terminal and storage be situated between
Matter enables computer user to watch the content of target direct broadcasting room in time.
In a first aspect, starting broadcasting based reminding method the embodiment of the invention provides a kind of direct broadcasting room, which comprises
According to default execution logic, the service routine of creation of operating system;
After service routine starting, using the socket separate threads in the service routine, the live streaming is received
Platform Server is sent to the data of the service routine;
If it is determined that the data are the message that starts broadcasting of target direct broadcasting room, then service routine starting live streaming platform visitor is utilized
Family end, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
Second aspect, starts broadcasting alarm set the embodiment of the invention provides a kind of direct broadcasting room, and described device includes:
Service routine creation module, for executing logic, the service routine of creation of operating system according to default;
Data reception module, for utilizing the socket independence in the service routine after service routine starting
Thread receives the data that the live streaming Platform Server is sent to the service routine;
Direct broadcasting room starts broadcasting reminding module, for if it is determined that the data are the message that starts broadcasting of target direct broadcasting room, then utilizing institute
Service routine starting live streaming platform client is stated, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
The third aspect starts broadcasting the embodiment of the invention provides a kind of direct broadcasting room and reminds terminal, and the terminal includes:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes that direct broadcasting room as described in any embodiment of the present invention starts broadcasting based reminding method.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer journey
Sequence realizes that direct broadcasting room as described in any embodiment of the present invention starts broadcasting based reminding method when the program is executed by processor.
A kind of direct broadcasting room provided in an embodiment of the present invention starts broadcasting based reminding method, device, terminal and storage medium, passes through basis
Default to execute logic, the service routine of creation of operating system is only using the socket in service routine after service routine starting
Vertical thread receives the data that live streaming Platform Server is sent to service routine, however, it is determined that data are that starting broadcasting for target direct broadcasting room disappears
Breath, then using service routine starting live streaming platform client, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting,
Computer user can be reminded to watch the content of target direct broadcasting room in time.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to do one simply to introduce, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is that a kind of direct broadcasting room that the embodiment of the present invention one provides starts broadcasting the flow chart of based reminding method;
Fig. 2 is that a kind of direct broadcasting room provided by Embodiment 2 of the present invention starts broadcasting the structural schematic diagram of alarm set;
Fig. 3 is that a kind of direct broadcasting room that the embodiment of the present invention three provides starts broadcasting and reminds the structural schematic diagram of terminal.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, hereinafter with reference to attached in the embodiment of the present invention
Figure, clearly and completely describes technical solution of the present invention by embodiment, it is clear that described embodiment is the present invention one
Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
Embodiment one
Fig. 1 is that a kind of direct broadcasting room that the embodiment of the present invention one provides starts broadcasting based reminding method flow chart, and the present embodiment is applicable
In computer user needs to watch the content of direct broadcasting room of interest in time the case where, this method can be started broadcasting prompting dress by direct broadcasting room
Realization is set, software and/or hardware in the alarm set that can specifically start broadcasting by direct broadcasting room is implemented.Referring to Fig. 1, which is opened
Based reminding method is broadcast to include the following steps:
S110, logic, the service routine of creation of operating system are executed according to default.
Wherein, operating system can be windows operating system, and the service routine of operating system can be to assist using
Family use and maintenance computer provides service means and supports the class method that other software are developed and are worked out.It can be with
The starting of operating system and start, and can not show any interface, start as a service, be suitable for long-play.
It, preferably can basis when platform client, which is broadcast live, to be started with the starting of operating system in the present embodiment
Default to execute logic, creation can carry out the service routine of data communication with live streaming Platform Server in a computer.Wherein, in advance
If executing, logic preferably can be service routine and live streaming Platform Server establishes communication connection and receives live streaming platform service
The whole process for the data that device is sent.
S120, when service routine starting after, utilize the socket separate threads in service routine, receive live streaming platform service
Device is sent to the data of service routine.
S130, if it is determined that data be target direct broadcasting room the message that starts broadcasting, then using service routine starting live streaming platform client
End, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
Wherein, live streaming Platform Server can be the background server of live streaming platform, and target direct broadcasting room can be user institute
The direct broadcasting room of concern or collection.
In the present embodiment, after the service routine starting of operating system, service routine needs to build with live streaming Platform Server
Vertical connection, to receive the message of live streaming Platform Server push.Preferably, it can use socket and establish service routine and live streaming
Communication connection between Platform Server.Wherein, socket (also referred to as socket) is one for describing IP address and port
The handle of communication chain.Application program usually passes through socket and issues request or response network request to network.
After service routine and live streaming Platform Server establish communication connection, a socket independent lines can be preferably created
Journey receives the data that service routine is sent to by live streaming Platform Server using the socket separate threads.When service routine is logical
Cross socket separate threads receive live streaming Platform Server send data after, it is preferred that may determine that the data whether be
The message that starts broadcasting of target direct broadcasting room, if it is determined that the data are the message that starts broadcasting of target direct broadcasting room, then start live streaming platform client
End, and the message that starts broadcasting of the target direct broadcasting room received is sent to live streaming platform client, to make that platform client is broadcast live
Know that the target direct broadcasting room will start broadcasting.Platform client is broadcast live after knowing that target direct broadcasting room will start broadcasting, starting is broadcast live
Between start broadcasting prompting function, to remind user to watch live content in time.
Illustratively, when determine data that service routine receives be target direct broadcasting room start broadcasting message after, can use
Service routine starts the live streaming platform client software in computer.By taking windows operating system as an example, what which provided
Api function CreateProcess function can be used for starting application program.
Wherein, 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);
Wherein, the live streaming platform visitor that first parameter LPCTSTR lpApplicationName is used to be passed in computer
The complete trails title of family end software;Second parameter LPTSTR lpCommandLine is used to be passed to the information of target direct broadcasting room,
Such as can be the room number of direct broadcasting room, and current time, the information such as the pet name in room;Other parameters can be empty information.
Using Create Process function, the live streaming platform client software in computer can be started.And it services
The information that starts broadcasting of target direct broadcasting room is sent to live streaming platform client, so that directly when platform client is broadcast live in starting by program
It broadcasts platform client software and knows that target direct broadcasting room will start broadcasting, and then platform client is broadcast live, direct broadcasting room is started with predetermined manner
Start broadcasting prompting function.Wherein, predetermined manner can be the prompting frame that pop-up target direct broadcasting room will start broadcasting, and be also possible to directly jump
Go to corresponding direct broadcasting room.
A kind of direct broadcasting room provided in this embodiment starts broadcasting based reminding method, by executing logic, creation operation system according to default
The service routine of system, using the socket separate threads in service routine, receives live streaming platform service after service routine starting
Device is sent to the data of service routine, however, it is determined that data are the message that starts broadcasting of target direct broadcasting room, then are started using service routine straight
Platform client is broadcast, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting can remind computer user in time
Watch the content of target direct broadcasting room.
On the basis of the various embodiments described above, further, according to default execution logic, the service journey of creation of operating system
Sequence, comprising:
The forwarding table structural body of service routine is initialized, and determines the attribute of variable in forwarding table structural body, wherein first
Attribute is the title of service routine, and the second attribute is the entrance function of service routine;
Entrance function is initialized, and creates socket separate threads in entrance function, to establish service routine and live streaming
Communication between Platform Server, and received using socket separate threads and service routine is sent to by live streaming Platform Server
Data.
Illustratively, it is specifically described so that operating system is windows operating system as an example: clothes can be initialized first
The forwarding table structural body for program of being engaged in, which specifically can be as follows:
SERVICE_TABLE_ENTRY ServiceTable;
ServiceTable [0] .lpServiceName=_T (SERVICE_NAME);
ServiceTable [0] .lpServiceProc=(LPSERVICE_MAIN_FUNCTION) service_main;
Wherein, the forwarding table structure of service routine is SERVICE_TABLE_ENTRY, and the variable of definition is
ServiceTable.The variable of forwarding table has 2 attributes, and an attribute is the title of service routine, and an attribute is service
The entrance function of program.Wherein, entrance function refers to function to be executed after service routine starting.
After the forwarding table structural body of initialization service routine, the entrance function of service routine can be preferably initialized.
In the present embodiment, it can preferably be initialized by calling system api function StartServiceCtrlDispatcher function
The entrance function of service routine.Wherein it is possible to by the forwarding table of the parameter incoming service program of entrance function, so as to
The corresponding relationship between the title and entrance function of service routine is created in operating system.When so as to service routine starting, call
Corresponding entrance function logic.
Meeting call entry function logics when due to service routine starting, service routine is contained in entrance function
Execute logic.Wherein, entrance function can be as follows:
void WINAPI service_main(int argc,char**argv)
In this entrance function, a socket separate threads can be preferably created to establish service routine and live streaming platform
Communication between server, and the number that service routine is sent to by live streaming Platform Server is received using socket separate threads
According to.Specifically, can create socket separate threads by calling Create Thread function, specific implementation can be with
It is as follows:
HANDLE task_handle=Create Thread (NULL, NULL, Socket_thread, NULL, NULL,
NULL);
Wherein, for Create Thread function, most important parameter is that readjustment executes function Socket_
Thread function.This function executes the entire logic function of the separate threads.
Further, after initializing entrance function, further includes:
Stopping call back function being registered and created in entrance function, stops the control thing in call back function including service routine
Part type parameter;
When controlling type of event parameter is to indicate the parameter of service routine stopping, stopping call back function and call socket only
Vertical thread stops function, to terminate socket separate threads.
Illustratively, in entrance function, stopping call back function can preferably being registered.Wherein, stop call back function being used for
When service routine is stopped, which is cleared up, such as can be release resource etc..In the present embodiment, stop
Call back function is used for when service routine is stopped, and terminates the execution of socket separate threads, and discharges the socket independent lines
Journey.Preferably, stopping call back function being registered by calling RegisterServiceCtrlHandler function.The registration
The code for stopping call back function is as follows:
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandler(
LPCTSTR lpServiceName,
LPHANDLER_FUNCTION lpHandlerProc);
Wherein, parameter LPCTSTR lpServiceName indicates the title of service routine;Parameter LPHANDLER_
The stopping call back function of FUNCTION lpHandlerProc expression service routine.
It, preferably can be in entrance function after registering completion stopping call back function in entrance function using above-mentioned logic only
Middle creation stops call back function, when detecting that service routine stops, calling socket separate threads to stop function to terminate
Socket separate threads.Preferably, it can use the stopping call back function of following code establishing entrance function:
void WINAPI ServiceHandler(DWORD fdwControl)
Wherein, parameter DWORD fdwControl indicates the control event type of service routine.When the parameter is
When SERVICE_CONTROL_STOP, SERVICE_CONTROL_SHUTDOWN, then it represents that service routine is stopped, at this point, together
Sample needs to stop the execution of socket separate threads.Specifically, can be stopped by calling function TerminateThread
Socket separate threads, wherein the thread handle of incoming creation.
Further, socket separate threads are created, in entrance function to establish service routine and live streaming platform service
Communication between device, and the data that service routine is sent to by live streaming Platform Server, packet are received using socket separate threads
It includes:
Initialize socket;
The address family and port numbers of server are set;
The socket of initialization, address family and port numbers as the parameter of connect function and are executed into connect letter
Number, with the communication connection establishing service routine and being broadcast live between Platform Server;
It creates a thread object and thread corresponding with thread object and executes function, and by thread object and thread
It executes function and carries out bindings, to create socket separate threads;
It calls Start method to execute socket separate threads, clothes is sent to by live streaming Platform Server to obtain and save
The data for program of being engaged in.
Illustratively, connection can be established with live streaming Platform Server by creating the related data of socket first.
Socket is initialized specifically, can use int sockfd=socket (AF_INET, SOCK_STREAM, 0), it
After can be utilized respectively servaddr.sin_family=ip and servaddr.sin_port=htons (port) setting live streaming
The address family and port numbers (host byte sequence to network bytes sequence) of Platform Server.The related data for having created socket it
Afterwards, preferably can with calling system function connect function, and using the socket of initialization, address family and port numbers as should
The parameter of connect function, and execute intnRet=connect (sockfd, (struct sockaddr*) &servaddr,
Sizeof (servaddr)), with the communication connection realizing service routine and being broadcast live between Platform Server.
It illustratively, can using the process that readjustment executes function Socket_thread function creation socket separate threads
To be: one thread object Thread thread_ of creation;A thread corresponding with thread object is write simultaneously executes letter
Number void_RunThread ();And thread object and thread are executed by function based on Boost base library and carry out bindings, it is complete
At the creation of socket separate threads.Wherein, specific bindings are as follows: Thread (boost::bind (&RunThread,
this)).Socket separate threads after the completion of creation can execution thread execute the basic logic of function RunThread.Later
Start method can be called to execute socket separate threads, be sent to service routine to obtain and save live streaming Platform Server
Data, specifically execute operation are as follows: thread_.start ().
The state that the continuous monitoring socket of while circulation is write in function RunThread is executed in thread, constantly from
The network data that live streaming Platform Server sends over is received in sokcet.Illustratively, while circulation can be following shape
Formula:
while(true){
Read the data that the live streaming Platform Server that sokcet is received sends over;if(select.Read_FD_
ISSET (socket)) { judges whether socket can read the network data of live streaming Platform Server, pass through select object
Judge socket whether in reading set Read_FD_ISSET, and then whether the current socket of determination can read live streaming
The data that Platform Server is sent;event.OnRead();Service routine is informed by calling the OnRead of event object
Current socket has data that can read, so as to read the network data of live streaming Platform Server;Ssize_t ret=
recv(socket,(char*)buf,len,0);Wherein, buf is the length read for storing the data read, len.This
Function call is completed then store network data into buf.}
Further, however, it is determined that data are the message that starts broadcasting of target direct broadcasting room, then utilize service routine starting live streaming platform
Client, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting, comprising:
Data are parsed using service routine, determine whether data are that starting broadcasting for target direct broadcasting room disappears according to the data after parsing
Breath;
If it is determined that data are the message that starts broadcasting of target direct broadcasting room, then platform client is broadcast live using service routine starting, with
Make platform client starting direct broadcasting room is broadcast live and start broadcasting prompting function.
In the present embodiment, service routine receives the data that live streaming Platform Server is sent by socket separate threads
Afterwards, data can be parsed according to preset communications protocol format, whether can determine data according to the data after parsing
For the message that starts broadcasting of target direct broadcasting room;If it is determined that data are the message that starts broadcasting of target direct broadcasting room, then started using service routine straight
Platform client is broadcast, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
Specifically, service routine can receive the number of server by the system function recv in socket separate threads
According to later, service routine can parse data according to preset communications protocol format, specific: can to create one
The instance objects DataDecoder*pDecoder=new DataDecoder () of message parsing class DataDecoder;Later,
The data received are parsed using pDecoder- > Parse (buf), wherein buf indicates the data received.Number
After being parsed, the data type of the data can be obtained.
By taking data is the message that starts broadcasting of target direct broadcasting room as an example, data resolving is specifically described:
Std::string cmdtype=std::string (pDecoder- > GetItem (" type "));Wherein, it obtains
The type value of message field indicates the type of data.
{ expression is a notification data to If (cmdtype==" notify "), next then needs to parse other fields.
NroomId=pDecoder- > GetItemAsInt (" roomid ");Obtain room number.
Nroomname=pDecoder- > GetItemAsInt (" roomname ");Obtain room title.
Time=pDecoder- > GetItemAsInt (" time ");Obtain the time started broadcasting.}
By server known to above-mentioned resolving send be a target direct broadcasting room the message that starts broadcasting, at this point it is possible to
Start live streaming platform client using service routine, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
Further, it using the socket separate threads in service routine, receives live streaming Platform Server and is sent to clothes
Before the data for program of being engaged in, further includes:
The protocol format for creating service routine and being broadcast live between Platform Server, protocol format are by live streaming Platform Server
The data for being sent to service routine include packet header and backpack body two parts;
Wherein, the length in packet header is preset byte length, and for recording the length of protocol contents in backpack body, backpack body is character
String form is used for record protocol content.
Illustratively, when service routine is communicated with live streaming Platform Server, need to establish protocol format, and determine
Protocol contents enable service routine from association so that live streaming Platform Server sends specific protocol contents by protocol format
The data that live streaming Platform Server is sent are received in view, and according to protocol format analysis protocol content.Due to service routine and directly
The communication connection between Platform Server is broadcast as the transmission of TCP flow formula, there are subpackages and glutinous the case where wrapping, it is therefore preferable that can create
Protocol format is built to include packet header and backpack body two parts by the data that live streaming Platform Server is sent to service routine, wherein packet
The length of head is preset byte length, and for recording the length of protocol contents in backpack body, backpack body is character string forms, for recording
Protocol contents.Preferably, the preset byte length in packet header can be 4 byte lengths, can also include 2 byte long scales
Know, is used for placeholder, can be used for subsequent extension.
Illustratively, the message that starts broadcasting of direct broadcasting room can be set are as follows: type of message is type=notify;Room number letter
@=356 roomid are ceased, indicate that room number is 356;Room title roomname=open air first indicates the room pet name.It starts broadcasting
Time time@=1523654894, indicate timestamp information.
Further, after creation service routine and the protocol format being broadcast live between Platform Server, further includes:
Protocol contents are encoded, obtain character string corresponding with protocol contents, and character string is written in backpack body;
It, will be in the length write-in packet header of character string based on character string;
Using packet header and backpack body as the data for being sent to service routine by live streaming Platform Server, socket independent lines are utilized
Journey is sent to service routine by live streaming Platform Server.
Illustratively, when having detected that direct broadcasting room will start broadcasting, it is corresponding that live streaming Platform Server obtains the direct broadcasting room
Room number, live streaming Platform Server traverses all users using the room number, and the message that starts broadcasting of direct broadcasting room is sent to pass
Infuse or collect the user of the direct broadcasting room.Before sending, then live streaming Platform Server leads to according to protocol format coding protocol content
Cross the message that starts broadcasting that communication connection sends direct broadcasting room.Detailed process is as follows:
Create coded object DataEncoder encodemsg;
Type of message is added:
encodemsg.AddItem("type","notify");Indicate that it is notify that protocol type, which is added,.
encodemsg.AddItem("roomid",356);Indicate that it is 356 that room number, which is added,.
Encodemsg.AddItem (" roomname ", " open air first ");It indicates that the room pet name is added.
encodemsg.AddItem("time",1523654894);Indicate that it is 1523654894 that timestamp information, which is added,.
Then the character string after coding is obtained by its interface.
Char*pData=encodemsg- > GetResualt ();
Specific protocol contents are stored in pData character string.
This character string can be sent to service routine by live streaming Platform Server, and packet header letter is added in while issuing data
Breath.
Embodiment two
Fig. 2 is that a kind of direct broadcasting room provided by Embodiment 2 of the present invention starts broadcasting alarm set structural schematic diagram.Referring to fig. 2, originally
Direct broadcasting room in embodiment starts broadcasting alarm set, comprising:
Service routine creation module 210, for executing logic, the service routine of creation of operating system according to default;
Data reception module 220, for after service routine starts, using the socket separate threads in service routine,
Receive the data that live streaming Platform Server is sent to service routine;
Direct broadcasting room starts broadcasting reminding module 230, for if it is determined that data are the message that starts broadcasting of target direct broadcasting room, then utilizing service
Program starting live streaming platform client, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
A kind of direct broadcasting room provided in this embodiment starts broadcasting alarm set, by using service routine creation module according to presetting
Logic is executed, the service routine of creation of operating system utilizes service routine by data reception module after service routine starting
In socket separate threads, receive live streaming Platform Server and be sent to the data of service routine, recycle direct broadcasting room to start broadcasting and mentions
Awake module determine data whether be target live streaming the message that starts broadcasting, however, it is determined that data are the message that starts broadcasting of target direct broadcasting room, then sharp
Start live streaming platform client with service routine, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting, Neng Gouji
When remind computer user watch target direct broadcasting room content.
On the basis of the various embodiments described above, further, service routine creation module 210 may include:
Forwarding table initialization submodule for initializing the forwarding table structural body of service routine, and determines forwarding table structure
The attribute of variable in body, wherein the first attribute is the title of service routine, and the second attribute is the entrance function of service routine;
Entrance function initialization submodule, for initializing entrance function;
Socket separate threads create submodule, for creating socket separate threads in entrance function, to establish clothes
Program of being engaged in and the communication being broadcast live between Platform Server, and received using socket separate threads and sent by live streaming Platform Server
To the data of service routine.
Further, service routine creation module 210 can also include stopping call back function creating submodule, for first
After beginningization entrance function, stopping call back function being registered and created in entrance function, stops including service journey in call back function
The control type of event parameter of sequence;
When controlling type of event parameter is to indicate the parameter of service routine stopping, stopping call back function and call socket only
Vertical thread stops function, to terminate socket separate threads.
Further, socket separate threads creation submodule can specifically include:
Socket initialization unit, for initializing socket;
Parameter set unit, for the address family and port numbers of server to be arranged;
Communication connection establishment unit, socket, address family and the port numbers for that will initialize are as connect function
Parameter simultaneously executes connect function, with the communication connection establishing service routine and being broadcast live between Platform Server;
Socket separate threads creating unit, for creating a thread object and thread corresponding with thread object
Function is executed, and thread object and thread are executed into function and carry out bindings, to create socket separate threads;
Socket separate threads execution unit, for calling Start method to execute socket separate threads, to obtain and protect
Deposit the data that service routine is sent to by live streaming Platform Server.
Further, the direct broadcasting room reminding module 230 that starts broadcasting can specifically include:
The message that starts broadcasting determines submodule, for parsing data using service routine, determines data according to the data after parsing
Whether be target direct broadcasting room the message that starts broadcasting;
If it is determined that data are the message that starts broadcasting of target direct broadcasting room, then platform client is broadcast live using service routine starting, with
Make platform client starting direct broadcasting room is broadcast live and start broadcasting prompting function.
Further, which can also include protocol format creation module, and protocol format creation module is for utilizing
Socket separate threads in service routine receive live streaming Platform Server and are sent to before the data of service routine,
The protocol format for creating service routine and being broadcast live between Platform Server, protocol format are by live streaming Platform Server
The data for being sent to service routine include packet header and backpack body two parts;
Wherein, the length in packet header is preset byte length, and for recording the length of protocol contents in backpack body, backpack body is character
String form is used for record protocol content.
Further, which can also include data transmission blocks, and data transmission blocks can be used for servicing in creation
After protocol format between program and live streaming Platform Server, further includes:
Protocol contents are encoded, obtain character string corresponding with protocol contents, and character string is written in backpack body;
It, will be in the length write-in packet header of character string based on character string;
Using packet header and backpack body as the data for being sent to service routine by live streaming Platform Server, socket independent lines are utilized
Journey is sent to service routine by live streaming Platform Server.
Direct broadcasting room provided by the embodiment of the present invention start broadcasting alarm set can be performed it is provided by any embodiment of the invention
Direct broadcasting room starts broadcasting based reminding method, has the corresponding functional module of execution method and beneficial effect.
Embodiment three
Fig. 3 starts broadcasting for the direct broadcasting room that the embodiment of the present invention three provides and reminds the structural schematic diagram of terminal.Fig. 3, which is shown, to be suitable for
The block diagram of terminal 312 is reminded for realizing that the exemplary direct broadcasting room of embodiment of the present invention starts broadcasting.The direct broadcasting room that Fig. 3 is shown starts broadcasting
Reminding terminal 312 is only an example, should not function to the embodiment of the present invention and use scope bring any restrictions.
Terminal 312 is reminded to show in the form of universal computing device as shown in figure 3, direct broadcasting room starts broadcasting.Direct broadcasting room, which starts broadcasting, to be mentioned
The component for terminal 312 of waking up can include but is not limited to: one or more processor 316, and memory 328 connects not homologous ray
The bus 318 of component (including memory 328 and processor 316).
Bus 318 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller,
Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.It lifts
For example, these architectures include but is not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC)
Bus, enhanced isa bus, Video Electronics Standards Association (VESA) local bus and peripheral component interconnection (PCI) bus.
Direct broadcasting room, which starts broadcasting, reminds terminal 312 to typically comprise a variety of computer system readable media.These media can be
Any usable medium for reminding terminal 312 to access that can be started broadcasting by direct broadcasting room, including volatile and non-volatile media move
And immovable medium.
Memory 328 may include the computer system readable media of form of volatile memory, such as arbitrary access is deposited
Reservoir (RAM) 330 and/or cache memory 332.Direct broadcasting room start broadcasting remind terminal 312 may further include it is other can
Movement/immovable, volatile/non-volatile computer system storage medium.Only as an example, storage device 334 can be with
For reading and writing immovable, non-volatile magnetic media (Fig. 3 do not show, commonly referred to as " hard disk drive ").Although in Fig. 3 not
It shows, the disc driver for reading and writing to removable non-volatile magnetic disk (such as " floppy disk ") can be provided, and to removable
The CD drive of dynamic anonvolatile optical disk (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these situations
Under, each driver can be connected by one or more data media interfaces with bus 318.Memory 328 may include
At least one program product, the program product have one group of (for example, at least one) program module, these program modules are configured
To execute the function of various embodiments of the present invention.
Program/utility 340 with one group of (at least one) program module 342, can store in such as memory
In 328, such program module 342 includes but is not limited to operating system, one or more application program, other program modules
And program data, it may include the realization of network environment in each of these examples or certain combination.Program module 342
Usually execute the function and/or method in embodiment described in the invention.
Direct broadcasting room start broadcasting remind terminal 312 can also with one or more external equipments 314 (such as keyboard, sensing equipment,
Display 324 etc., wherein display 324 can decide whether to configure according to actual needs) communication, it can also be with one or more
Enable a user to start broadcasting with the direct broadcasting room equipment communication for reminding terminal 312 to interact, and/or starts broadcasting prompting with the direct broadcasting room is made
Any equipment (such as network interface card, modem etc.) that terminal 312 can be communicated with one or more of the other calculating equipment
Communication.This communication can be carried out by input/output (I/O) interface 322.Also, direct broadcasting room, which starts broadcasting, reminds terminal 312 may be used also
To pass through network adapter 320 and one or more network (such as local area network (LAN), wide area network (WAN) and/or public network
Network, such as internet) communication.As shown, network adapter 320 is started broadcasting by bus 318 and direct broadcasting room reminds terminal 312
Other module communications.It should be understood that can starting broadcasting in conjunction with direct broadcasting room, it is other hard to remind terminal 312 to use although being not shown in Fig. 3
Part and/or software module, including but not limited to: microcode, device driver, redundant processing unit, external disk drive array,
RAID system, tape drive and data backup storage device etc..
The program that processor 316 is stored in memory 328 by operation, thereby executing various function application and data
Processing, such as realize that direct broadcasting room provided by the embodiment of the present invention starts broadcasting based reminding method.
Example IV
The embodiment of the present invention four provides a kind of computer readable storage medium, is stored thereon with computer program, the journey
Realize that the direct broadcasting room as provided by the embodiment of the present invention starts broadcasting based reminding method when sequence is executed by processor, comprising:
According to default execution logic, the service routine of creation of operating system;
After service routine starting, using the socket separate threads in service routine, live streaming Platform Server hair is received
It send to the data of service routine;
If it is determined that data are the message that starts broadcasting of target direct broadcasting room, then platform client is broadcast live using service routine starting, with
Make platform client starting direct broadcasting room is broadcast live and start broadcasting prompting function.
Certainly, computer readable storage medium provided by the embodiment of the present invention, the computer program stored thereon are unlimited
In executing method as described above operation, it can also be performed and provided by any embodiment of the invention started broadcasting prompting based on direct broadcasting room
The direct broadcasting room of terminal starts broadcasting the relevant operation in based reminding method.
The computer storage medium of the embodiment of the present invention, can be using any of one or more computer-readable media
Combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readable
Storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device or
Device, or any above combination.The more specific example (non exhaustive list) of computer readable storage medium includes: tool
There are electrical connection, the portable computer diskette, hard disk, random access memory (RAM), read-only memory of one or more conducting wires
(ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-
ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer-readable storage
Medium can be any tangible medium for including or store program, which can be commanded execution system, device or device
Using or it is in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited
In wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
The computer for executing operation of the present invention can be write with one or more programming languages or combinations thereof
Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++,
Further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with
It fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portion
Divide and partially executes or executed on a remote computer or server completely on the remote computer on the user computer.?
Be related in the situation of remote computer, remote computer can pass through the network of any kind --- including local area network (LAN) or
Wide area network (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as mentioned using Internet service
It is connected for quotient by internet).
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.
Claims (10)
- The based reminding method 1. a kind of direct broadcasting room starts broadcasting characterized by comprisingAccording to default execution logic, the service routine of creation of operating system;After service routine starting, using the socket separate threads in the service routine, the live streaming platform is received Server is sent to the data of the service routine;If it is determined that the data are the message that starts broadcasting of target direct broadcasting room, then service routine starting live streaming platform client is utilized End, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
- 2. the method according to claim 1, wherein the basis is default to execute logic, creation of operating system Service routine, comprising:The forwarding table structural body of the service routine is initialized, and determines the attribute of variable in the forwarding table structural body, wherein First attribute is the title of the service routine, and the second attribute is the entrance function of the service routine;The entrance function is initialized, and creates socket separate threads in the entrance function, to establish the service journey Communication between sequence and the live streaming Platform Server, and received using the socket separate threads and taken by the live streaming platform Business device is sent to the data of the service routine.
- 3. method according to claim 2, which is characterized in that after the initialization entrance function, further includes:Stopping call back function being registered and created in the entrance function, includes the service routine in the stopping call back function Control type of event parameter;When the control type of event parameter, which is, indicates the parameter of the service routine stopping, the stopping call back function being called Socket separate threads stop function, to terminate the socket separate threads.
- 4. according to the method described in claim 2, it is characterized in that, in the entrance function create socket separate threads, With the communication established between the service routine and the live streaming Platform Server, and received using the socket separate threads The data of the service routine are sent to by the live streaming Platform Server, comprising:Initialize socket;The address family and port numbers of the live streaming Platform Server are set;Using the socket of initialization, the address family and the port numbers as described in the parameter of connect function and execution Connect function, with the communication connection established between the service routine and the live streaming Platform Server;Create a thread object and thread corresponding with the thread object and execute function, and by the thread object with The thread executes function and carries out bindings, to create socket separate threads;It calls Start method to execute the socket separate threads, is sent with obtaining and saving by the live streaming Platform Server To the data of the service routine.
- 5. the method according to claim 1, wherein described if it is determined that the data are starting broadcasting for target direct broadcasting room Message, then using service routine starting live streaming platform client, so that live streaming platform client starting direct broadcasting room is opened Broadcast prompting function, comprising:The data are parsed using the service routine, determine whether the data are target direct broadcasting room according to the data after parsing The message that starts broadcasting;If it is determined that the data are the message that starts broadcasting of target direct broadcasting room, then service routine starting live streaming platform client is utilized End, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
- 6. the method according to claim 1, wherein utilizing the socket independent lines in the service routine Journey receives the live streaming Platform Server and is sent to before the data of the service routine, further includes:The protocol format between the service routine and the live streaming Platform Server is created, the protocol format is by described straight Broadcasting Platform Server and being sent to the data of the service routine includes packet header and backpack body two parts;Wherein, the length in the packet header is preset byte length, for recording the length of protocol contents in the backpack body, the packet Body is character string forms, for recording the protocol contents.
- 7. according to the method described in claim 6, it is characterized in that, in the creation service routine and the live streaming platform After protocol format between server, further includes:The protocol contents are encoded, obtain character string corresponding with the protocol contents, and the character string is write Enter in the backpack body;Based on the character string, the length of the character string is written in the packet header;Using the packet header and the backpack body as the data for being sent to the service routine by the live streaming Platform Server, utilize The socket separate threads are sent to the service routine by the live streaming Platform Server.
- The alarm set 8. a kind of direct broadcasting room starts broadcasting characterized by comprisingService routine creation module, for executing logic, the service routine of creation of operating system according to default;Data reception module, for after the service routine starts, using the socket separate threads in the service routine, Receive the data that the live streaming Platform Server is sent to the service routine;Direct broadcasting room starts broadcasting reminding module, for if it is determined that the data are the message that starts broadcasting of target direct broadcasting room, then utilizing the clothes Program of being engaged in starting live streaming platform client, the prompting function so that live streaming platform client starting direct broadcasting room starts broadcasting.
- 9. a kind of direct broadcasting room, which starts broadcasting, reminds terminal, which is characterized in that the terminal includes:One or more processors;Memory, for storing one or more programs;When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now the direct broadcasting room as described in any in claim 1-7 starts broadcasting based reminding method.
- 10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor Realize that direct broadcasting room as described in any in claim 1-7 starts broadcasting based reminding method when execution.
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 true CN109284148A (en) | 2019-01-29 |
CN109284148B 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 (8)
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 |
CN103391307A (en) * | 2012-05-11 | 2013-11-13 | 阿里巴巴集团控股有限公司 | Off-line transparent-transmitting and display method, device and system for off-line data |
CN104104524A (en) * | 2013-04-09 | 2014-10-15 | 广州华多网络科技有限公司 | Method and system for providing live broadcast services, terminal, and server |
CN104618218A (en) * | 2014-12-29 | 2015-05-13 | 广州酷狗计算机科技有限公司 | Information reminding 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 |
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 |
-
2018
- 2018-09-30 CN CN201811163472.3A patent/CN109284148B/en active Active
Patent Citations (8)
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 |
CN103391307A (en) * | 2012-05-11 | 2013-11-13 | 阿里巴巴集团控股有限公司 | Off-line transparent-transmitting and display method, device and system for off-line data |
CN104104524A (en) * | 2013-04-09 | 2014-10-15 | 广州华多网络科技有限公司 | Method and system for providing live broadcast services, terminal, and server |
CN104618218A (en) * | 2014-12-29 | 2015-05-13 | 广州酷狗计算机科技有限公司 | Information reminding method and device |
CN105391785A (en) * | 2015-11-25 | 2016-03-09 | 广州华多网络科技有限公司 | Method for processing service message and server |
CN107229483A (en) * | 2016-03-23 | 2017-10-03 | 福建福昕软件开发股份有限公司 | Local service it is disabled or stop in the case of perform local service function method |
CN106385636A (en) * | 2016-10-08 | 2017-02-08 | 武汉斗鱼网络科技有限公司 | Live broadcasting room jump method through message pushing and live broadcasting room jump system thereof |
CN106982228A (en) * | 2017-05-08 | 2017-07-25 | 北京深思数盾科技股份有限公司 | One kind realizes identity authentication method and system |
Non-Patent Citations (1)
Title |
---|
李建成 等: "《Java语言与面向对象程序设计》", 31 October 2004 * |
Also Published As
Publication number | Publication date |
---|---|
CN109284148B (en) | 2020-10-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7409454B2 (en) | Automatic detection of intermediate network device capabilities | |
US7590750B2 (en) | Systems and methods for multimedia remoting over terminal server connections | |
US20050160140A1 (en) | Using an expert proxy server as an agent for wireless devices | |
WO2020177698A1 (en) | Inter-mini program platform communication method and device, and computer storage medium | |
CN102158553A (en) | Method and device for playing multi-media files for remote desktop | |
EP2308023B1 (en) | Virtual media device | |
CN108055304B (en) | Remote data synchronization method, device, server, equipment and storage medium | |
CN113489805B (en) | Butt joint method, device, equipment and storage medium of cloud desktop system | |
WO2020177697A1 (en) | Method for discovery between mini program platforms, device, and computer storage medium | |
US11809380B2 (en) | Information sharing method, apparatus, electronic device, and storage medium | |
CN109275042A (en) | A kind of distribution method, device, terminal and the storage medium of barrage message | |
WO2000073902A1 (en) | Single logical clipboard for multiple computers | |
CN109495549A (en) | Method, equipment and the computer storage medium of work are drawn in a kind of application | |
CN112769876B (en) | Method, device, equipment and medium for acquiring equipment channel information | |
CN108965345B (en) | Method and device for optimizing small signaling network data packet | |
CN114598931A (en) | Streaming method, system, device and medium for multi-open cloud game | |
CN112689020B (en) | Message transmission method, message middleware, electronic equipment and storage medium | |
CN104639501A (en) | Data stream transmission method, equipment and system | |
CN109408255A (en) | A kind of direct broadcasting room starts broadcasting based reminding method, device, terminal and storage medium | |
CN109284148A (en) | A kind of direct broadcasting room starts broadcasting based reminding method, device, terminal and storage medium | |
CN111866544A (en) | Data processing method, device, equipment and computer readable storage medium | |
CN107342981B (en) | Sensor data transmission method and device and virtual reality head-mounted equipment | |
CN114584808B (en) | Video stream acquisition method, device, system, equipment and medium | |
CN110798700B (en) | Video processing method, video processing device, storage medium and electronic equipment | |
CN108259958A (en) | Remote keying response method, device, equipment and storage medium |
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 |