CN111064976A - Method for sending live broadcast information and server - Google Patents

Method for sending live broadcast information and server Download PDF

Info

Publication number
CN111064976A
CN111064976A CN201811208610.5A CN201811208610A CN111064976A CN 111064976 A CN111064976 A CN 111064976A CN 201811208610 A CN201811208610 A CN 201811208610A CN 111064976 A CN111064976 A CN 111064976A
Authority
CN
China
Prior art keywords
client
data
protocol
sending
encoding
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
Application number
CN201811208610.5A
Other languages
Chinese (zh)
Other versions
CN111064976B (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 CN201811208610.5A priority Critical patent/CN111064976B/en
Publication of CN111064976A publication Critical patent/CN111064976A/en
Application granted granted Critical
Publication of CN111064976B publication Critical patent/CN111064976B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/70Media network packetisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS

Landscapes

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

Abstract

The embodiment of the application discloses a method for sending live broadcast information and a server. The method in the embodiment of the application comprises the following steps: the server acquires data volume of various data types interacted between the server and the client; determining the data proportion of the data type according to the data amount; determining the type of target data according to the data proportion; if the live data belongs to the target data type, encoding the live data according to a first protocol, and encoding the live data according to a second protocol to obtain second encoding information; sending the first coding information to a first client; and sending the second coding information to the second client. The second coding data in the scheme contains less data than the first coding data, and the first coding data is a coding mode in the prior art, so that the flow of the server can be saved when the server sends the second coding data to the second client, the speed of the second server is higher when the second server decodes the second coding statement, and the performance of the client is improved.

Description

Method for sending live broadcast information and server
Technical Field
The present application relates to the field of live broadcast, and in particular, to a method and a server for sending live broadcast information.
Background
With the development of smart devices (such as smart phones, tablet computers, smart televisions, and the like), more and more users use various functions of the smart devices, wherein a video playing Application (App) or a live App (Application) that can watch live videos is one of the applications commonly used by people.
For the existing live broadcast platform, the client and the server communicate with each other through a network protocol to transfer data, including, for example, user information, room information, list information, barrage information, gift information, lottery information, and the like. If the existing protocol is transmitted in a character string form based on the json coding protocol, the protocol is easy to read, but a large amount of useless information and the flow of a server are wasted, and the analysis of the protocol by a client is slow.
Disclosure of Invention
The embodiment of the application provides a method for sending live broadcast information and a server, which are used for improving the performance of a client and saving the flow of the server.
In a first aspect, an embodiment of the present invention provides a method for sending live broadcast information, which specifically includes: the method comprises the steps of obtaining data volumes of various data types interacted between a server and a client, wherein the client comprises a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol; determining the data proportion of the data type according to the data amount; determining the type of target data according to the data proportion; receiving live broadcast data sent by the client; if the live data belongs to the target data type, encoding the live data according to the first protocol to obtain first encoding information; encoding the live broadcast data according to the second protocol to obtain second encoding information; sending the first coding information to the first client; and sending the second coding information to the second client.
In one possible design, the sending the first encoded information to the first client includes: determining the first client according to a preset client database, and sending the first coding information to the first client, wherein a client identifier and a protocol corresponding to the client identifier are stored in the preset client database, and the client identifier comprises a first client identifier and a second client identifier.
In one possible design, the sending the second encoded information to the second client includes:
and determining the second client according to a preset client database, and sending the second coding information to the second client, wherein a client identifier and a protocol corresponding to the client identifier are stored in the preset client database, and the client identifier comprises a first client identifier and a second client identifier.
In one possible design, the method further includes:
receiving a login message sent by the client, wherein the login message carries a client identifier of the client and a protocol corresponding to the client, and the client comprises the first client and the second client;
and storing the client identification and the corresponding protocol thereof into the preset client database.
In one possible design, after sending the second encoded information to the second client, the method further includes: receiving a decoding abnormity feedback message sent by the second client; and sending the first coding information to the second client according to the decoding abnormity feedback message.
In one possible design, the determining a target data type according to the data proportion includes:
judging whether the data proportion is larger than a threshold value;
and if so, determining the data type corresponding to the data proportion as the target data type.
In one possible design, the first protocol includes a json encoding protocol.
In one possible design, the second protocol includes a protobuf encoding protocol.
In a second aspect, an embodiment of the present invention provides a server, which specifically includes: the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring data volumes of various data types interacted between a server and a client, the client comprises a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol;
the first determining unit is used for determining the data proportion of the data type according to the data quantity;
the second determining unit is used for determining the type of the target data according to the data proportion;
the first receiving unit is used for receiving the live broadcast data sent by the client;
the first encoding unit is used for encoding the live data according to the first protocol to obtain first encoding information when the live data belongs to the target data type;
the second encoding unit is used for encoding the live broadcast data according to the second protocol to obtain second encoding information;
the first sending unit is used for sending the first coding information to the first client;
and the second sending unit is used for sending the second coding information to the second client.
In one possible design, the first sending unit is specifically configured to: determining the first client according to a preset client database, and sending the first coding information to the first client, wherein a client identifier and a protocol corresponding to the client identifier are stored in the preset client database, and the client identifier comprises a first client identifier and a second client identifier.
In one possible design, the second sending unit is specifically configured to: and determining the second client according to a preset client database, and sending the second coding information to the second client, wherein a client identifier and a protocol corresponding to the client identifier are stored in the preset client database, and the client identifier comprises a first client identifier and a second client identifier.
In one possible design, the server further includes:
a second receiving unit, configured to receive a login message sent by the client, where the login message carries a client identifier of the client and a protocol corresponding to the client identifier, and the client includes the first client and the second client;
and the storage unit is used for storing the client identifier and the corresponding protocol into the preset client database.
In one possible design, the second determining unit is specifically configured to:
judging whether the data proportion is larger than a threshold value;
and if so, determining the data type corresponding to the data proportion as the target data type.
In one possible design, the server further includes:
a third receiving unit, configured to receive a decoding anomaly feedback message sent by the second client;
and a third sending unit, configured to send the first encoding information to the second client according to the decoding anomaly feedback message.
In one possible design, the first protocol includes a json encoding protocol.
In one possible design, the second protocol includes a protobuf encoding protocol.
Yet another aspect of the present application provides a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform the method of the above-described aspects.
Yet another aspect of the present application provides a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of the above-described aspects.
According to the technical scheme, the embodiment of the application has the following advantages: the method comprises the steps that a server obtains data volumes of various data types interacted between the server and a client, wherein the client comprises a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol; determining the data proportion of the data type according to the data amount; determining the type of target data according to the data proportion; receiving live broadcast data sent by the client; if the live data belongs to the target data type, encoding the live data according to the first protocol to obtain first encoding information; encoding the live broadcast data according to the second protocol to obtain second encoding information; sending the first coding information to the first client; and sending the second coding information to the second client. According to the scheme, the server encodes the live data corresponding to the acquired target data type according to an old protocol (a first protocol) and a new protocol (a second protocol), the second encoded data contain less data than the first encoded data, so that the flow of the server can be saved when the server sends the second encoded data to the second client, the second server is faster in decoding the second encoded statement, and the performance of the client is improved.
Drawings
Fig. 1 is a schematic flowchart of a method for sending live broadcast information according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a server according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a hardware structure of a server according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an embodiment of an electronic device according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an embodiment of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
The embodiment of the application provides a method for sending live broadcast information and a server, which are used for improving the performance of a client and saving the flow of the server.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the server mentioned in the embodiment of the present invention may also be a service unit in the server, and may also be other devices, which is not limited herein.
Referring to fig. 1, fig. 1 is a schematic view of an embodiment of a method for sending live broadcast information according to an embodiment of the present invention, including:
101. and acquiring the data volume of various data types interacted between the server and the client.
Because the server and the client protocol are very wide in related area and function point, and simultaneously, a large number of clients exist in the live broadcast platform, and the old version of the client version cannot be updated, so that a certain old version of the client exists. And for the live broadcast platform, the number of clients is large, and the workload is huge for replacing all protocols. Therefore, the invention considers that based on the key protocol, the first replacement is carried out based on the protocol (the data corresponding to the target data type) with the largest number of data types, and the other protocols (except the data corresponding to the target data type) are replaced step by step subsequently.
Then, the server will count the protocol interaction between the whole platform server and the client, and count the number of protocol interaction in the whole live broadcast watching process of the user.
The client in this implementation includes a first client and a second client, and it should be noted that the first client is an old version client, the old version client corresponds to the first protocol, and the old version client decodes the received live broadcast encoded data by using the first protocol; the second client is a new version client, the new version client corresponds to the second protocol, and the new version client decodes the received live broadcast coded data by using the second protocol.
102. And determining the data proportion of the data type according to the data quantity.
In this implementation, the data proportion of the data volume corresponding to each data type is determined according to the data type of the acquired data volume, for example, according to calculation, where the bullet screen protocol accounts for 60% of the whole protocol (total data), the gift protocol accounts for 33% of the whole protocol, and so on.
103. And determining the type of the target data according to the data proportion.
In this embodiment, after determining the data proportions of the various data types, it is determined whether the data proportions are greater than a threshold, in this embodiment, the threshold is 30%, and the data type corresponding to the data proportion greater than the threshold is determined as the untargeted data type, for example, in this embodiment, the data proportion of the barrage protocol is 60%, the barrage protocol may be determined as the target data type, the data proportion of the gift protocol is 33%, and the gift protocol is also determined as the target data type.
For the gift and barrage protocol, the live broadcast platform broadcasts to all clients in the room, so the server needs to know what protocol content is broadcast to what client, and the server needs to know the client type and the client version number, so that a new protocol can be broadcast to a new version and an old protocol can be broadcast to an old version. Since the client includes a WEB page WEB client, a Personal Computer (PC) client, and an Android client IOS client, the type of the client needs to be considered. The client needs to carry the client type and the version number of the client to the protocol when logging in the bullet screen server. The concrete implementation is as follows:
the present invention uses one enumeration type to represent different client types.
Enum ClientType{
ClientType _ Web is 0,// WEB client is 0 in type
ClientType _ PC is 1,// PC client is 1 type
ClientType _ Android 2,// Android client type 2
ClientType _ Ios is 3,// Ios client type is 3
}
The invention defines an enumeration variable ClientType to represent the types of the clients, and each type of the clients is not repeated.
In order to distinguish whether the client belongs to the first client or the second client, the scheme adds date data to the client as a version number, for example, if the client is a version released today, the date of today can be used as the version number: such as 2018091010 as the client's version number.
By date, the server can easily determine whether the current client version is a new version (second client) or an old version (first client), and if the protocol conversion of the present invention is started based on the 2018081010 version, for example, then the subsequent versions have the function that the server only needs to determine the size of the version number to know whether the client is a new version or an old version.
Specifically, a server receives a login message sent by a client when the client logs in a live platform, wherein the login message carries a client identifier of the client and a protocol (namely, version number) corresponding to the client identifier;
and then, the client identification and the corresponding protocol are stored in the preset client database, and when the server sends the target data type, the server can send new coding information to which clients and send old coding information to which clients according to the preset client database.
104. And receiving the live broadcast data sent by the client.
The live broadcast data sent by the client comprises: user information, room information, list information, barrage information, gift information, lottery drawing information and the like, and the server receives all live broadcast data sent by the client.
105. And judging whether the received live broadcast data belongs to the target data type, if so, executing step 106, and if not, executing step 107.
In this embodiment, when receiving live data, it may be determined first whether the live data is of a data target data type, for example, if the live data is of a bullet screen protocol, it is determined that the live data is of the target data type, and if the live data is of an audio protocol, it is determined that the live data is not of the target data type.
106. And coding the live broadcast data according to the first protocol to obtain first coding information, and coding the live broadcast data according to the second protocol to obtain second coding information.
In this embodiment, the first protocol may be a json encoding protocol, that is, an original, old, and old encoding protocol, and the second protocol may be a protobuf encoding protocol, that is, a new protocol.
Because the barrage message and the gift message are encoded once by the server and then forwarded to all clients in the live broadcast room, the server needs to encode one barrage message (data corresponding to the target data type) for 2 times, wherein once the barrage message is encoded by using a new protocol (second protocol), and once the barrage message is encoded by using an original protocol (first protocol).
In one embodiment, the specific implementation of encoding the bullet screen information using the first protocol is as follows:
firstly, a protocol encoder object StdEncoder t _ req _ msg needs to be created;
the protocol content of the whole bullet screen is encoded as follows:
t_req_msg.AddItem("type",“danmu”);
t_req_msg.AddItem("col",5);
t_req_msg.AddItem("rid",1005);
t_req_msg.AddItem("uid",589746);
t_req_msg.AddItem("nn","nickname");
t_req_msg.AddItem("txt","content");
t_req_msg.AddItem("level",15);
t_req_msg.AddItem("rg",1);
t_req_msg.AddItem("cst",1535422077201);
t_req_msg.AddItem("ic",
"avatar_v320180641d9089344143cbe59646e9004c83b7a");
t_req_msg.AddItem("ct",1);
String*pBuff=t_req_msg.GetData();
the entire protocol content can then be obtained by calling its GetData method.
type@=danmu/col@=5/rid@=1005/uid@=589746/nn@=nickname/txt@=content/level@=15/rg@=1/cst@=1535422077201/ic@=avatar_v320180641d9089344143cbe59646e9004c83b7a/ct@=1/;
It can be seen that when the first protocol is used to encode the bullet screen information, not only the identifier but also information corresponding to the identifier needs to be processed, for example, ("type", "danmu"), ("col",5) ("rid",1005), ("uid",589746), ("nn", "nickname"), and so on.
For the live data corresponding to the target data type, encoding is required 2 times, once using the new protocol (second protocol) for encoding, and once using the original protocol (first protocol) for encoding. The first protocol has been used for encoding in step 106, in this step the live data also needs to be encoded using the second data.
In one embodiment, the specific implementation of encoding the bullet screen information using the second protocol is as follows:
an object message of protocol coding is also defined.
message.set__type("danmu");
message.set__color(5);
message.set__room_id(1005);
message.set__uid(589746);
message.set__nick_name("nickname");
message.set__content("content");
message.set__level(15);
message.set__room_group(1);
message.set__client_send_timestamp(1535422077201);
message.set__icon("avatar_v320180641d9089344143cbe59646e9004c83b7a");
message.set__client_type(1);
std::string pOut;
Then defining a result output object pOut;
message.SerializePartialToString(&pOut);
the result is finally obtained by calling the function serializepartialtorstring.
We can see that when encoding the bullet screen information using the second protocol, only the corresponding information needs to be processed, for example, ("danmu"), (5) (1005), (589746), ("nickname"), etc.
From the data comparison, the encoded data of the second protocol is significantly smaller than the encoded data of the first protocol, reducing the amount of data by approximately 40%.
And because the data volume of the coded data based on the second protocol is smaller, the flow of the server can be saved when the server sends the second coded data, and meanwhile, the decoding speed of the client can be improved when the client receives the second coded data.
107. And coding the live broadcast data according to the first protocol to obtain first coding information.
When the received data does not belong to the target data type, encoding the live data according to the first protocol only without encoding the live data according to a second protocol, where a specific process of encoding the live data according to the first protocol to obtain first encoded information is similar to the step of encoding the live data according to the first protocol mentioned in step 106 to obtain the first encoded information, and details are not repeated here.
108. And sending the first coding information to the first client.
In this embodiment, the first client is determined according to a preset client database, and the first encoding information is sent to the first client, where a client identifier and a protocol corresponding to the client identifier are stored in the preset client database, and the client identifier includes a first client identifier and a second client identifier.
When a preset client database is constructed, firstly, a login message sent by a client is received, wherein the login message carries a client identifier of the client and a protocol corresponding to the client identifier; and then storing the client identification and the corresponding protocol thereof into the preset client database.
Every time the server receives a bullet screen sent by a user (client), the bullet screen needs to be broadcasted to all users in the room, and in the above steps, the server adopts 2 types of encoding. After the server codes a bullet screen message, it needs to broadcast bullet screen messages with different codes depending on the version number of the client (i.e. the protocol corresponding to the client) when broadcasting next. The concrete implementation is as follows:
one using the old coding scheme and one using the new coding scheme.
And in the specific broadcasting, different protocols are broadcasted according to the version number of the client and the type of the client, which are reported by the client logging in the barrage server. The concrete implementation is as follows:
the client will send a login request protocol (login message):
type@=loginreq/username@=xxx/password@=xxx/roomid@=1983057/ct@=0/ver@=2018091010/
wherein the protocol request is a loginreq login request protocol. The room number and the client type are carried according to the version number of the client.
Where roomid @ 1983057 is the room number.
Where ct @ ═ 0 is the client type.
Wherein ver @ 2018091010 is the version number of the client.
The server then distinguishes which clients to send the old protocol to and which clients to send the new protocol to based on the client type and client version number that can be parsed out.
109. And sending the second coding information to the second client.
In this embodiment, the second client is determined according to a preset client database, and the second encoding information is sent to the second client. The server sends the second coding information to the second client when determining which clients are the second client according to the preset client database, and the data volume of the coding data based on the second protocol is small, so that the flow of the server can be saved when the server sends the second coding data, and meanwhile, the decoding speed of the client can be increased when the client receives the second coding data.
For the server, the server can control whether the barrage protocol sent to the client uses the newly encoded protocol or the old encoded protocol content. For the client, the newest client has the capability of decoding 2 types of protocol contents, the old client only has the capability of decoding the old protocol, the new client issues the new protocol to decrypt the new protocol, and the old protocol is decoded when the new client issues the old protocol. Therefore, once the client has protocol decoding abnormity, the server can close down the transmission of the new protocol to use the old protocol through switch control at any time.
Specifically, when the new protocol is decrypted for the client, the decryption state is reported.
In order to guarantee that the client can accurately decode each new coding protocol content without exception, the decryption state of each new coding protocol is added for the client, if some fields are abnormal in decryption, the abnormal state is recorded, the abnormal protocol and the protocol content are recorded and reported to a live broadcast platform server through the protocol, so that the server can monitor whether the decoding problem of the client new coding protocol exists at present, and once the client with the problem reports the whole protocol content to the server, the server checks whether the protocol content has the problem. The concrete implementation is as follows:
in order to prevent the program from generating an exception during the decoding process and causing a crash, the present invention adopts a try catch mechanism to shop for the exception condition in the program.
try{
RoomChatMessage message;
Firstly, the invention defines a decoding object message;
the received barrage protocol is then decoded.
And then calls its interface parsefrom string to parse the protocol for the received protocol.
message.ParseFromString(buff);
Wherein the buff is the new encoded barrage protocol content received from the server.
If the buff has a problem at this time, the analysis is abnormal, and the jump to the catch module is carried out.
The following is the parsing of the protocol content:
Int color=message.__color();
Int room_id=message.__room_id();
Int uid=message.__uid();
String name=message.__nick_name();
String content=message.__content();
Int level=message.__level();
Int roomgroup=message.__room_group();
Uint64_t time=message.__client_send_timestamp();
String icon=message.__icon("avatar_v320180641d9089344143cbe596e9004c83b7a");
Int ct=message.__client_type();
for the resolution of the protocol, if any field has a problem, the exception is caused in the resolution process, and thus the jump to the catch module is carried out.
}
catch(...){
If the code is executed to the point, the protocol analysis is problematic, and at the moment, the client reports the protocol content to the live platform server, so that the server can monitor the problem of the protocol analysis.
type@=decodeerror/data@=buff/ver@=2018081010/ct@=1/;
Wherein the present invention uses the protocol decocodeerror to indicate that it is a protocol parsing error problem.
The barrage protocol content buff broadcasted by the upper server is carried in the barrage protocol content buff.
The invention also carries version number ver field of client end and client end type ct field of client end.
Therefore, after the server receives the protocol, the abnormal condition can be monitored, so that the server can make real-time adjustment, and the risk of protocol replacement is reduced as much as possible.
}
In summary, it can be seen that, in the embodiment of the present invention, a server obtains data volumes of various data types interacted between the server and a client, where the client includes a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol; determining the data proportion of the data type according to the data amount; determining the type of target data according to the data proportion; receiving live broadcast data sent by the client; if the live data belongs to the target data type, encoding the live data according to the first protocol to obtain first encoding information; encoding the live broadcast data according to the second protocol to obtain second encoding information; sending the first coding information to the first client; and sending the second coding information to the second client. According to the scheme, the server encodes the live data corresponding to the acquired target data type according to an old protocol (a first protocol) and a new protocol (a second protocol), the second encoded data contain less data than the first encoded data, so that the flow of the server can be saved when the server sends the second encoded data to the second client, the second server is faster in decoding the second encoded statement, and the performance of the client is improved.
The above describes a method for sending live broadcast information in the embodiment of the present invention, and a server in the embodiment of the present invention is described below.
Referring to fig. 2, an embodiment of a server according to the embodiment of the present invention includes:
a second receiving unit 201, configured to receive a login message sent by the client, where the login message carries a client identifier of the client and a protocol corresponding to the client, and the client includes the first client and the second client;
a storing unit 202, configured to store the client identifier and the protocol corresponding to the client identifier into the preset client database.
An obtaining unit 203, configured to obtain data volumes of various data types interacted between a server and clients, where the clients include a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol;
a first determining unit 204, configured to determine a data proportion of the data type according to the data amount;
a second determining unit 205, configured to determine a target data type according to the data proportion;
the second determining unit 205 is specifically configured to:
judging whether the data proportion is larger than a threshold value;
and if so, determining the data type corresponding to the data proportion as the target data type.
A first receiving unit 206, configured to receive live data sent by the client;
a first encoding unit 207, configured to encode, according to the first protocol, the live data when the live data belongs to the target data type, to obtain first encoding information;
a second encoding unit 208, configured to encode the live data according to the second protocol to obtain second encoding information;
a first sending unit 209, configured to send the first encoded information to the first client;
the first sending unit 209 is specifically configured to: and determining the second client according to a preset client database, and sending the second coding information to the second client, wherein a client identifier and a protocol corresponding to the client identifier are stored in the preset client database, and the client identifier comprises a first client identifier and a second client identifier.
A second sending unit 210, configured to send the second encoded information to the second client.
A third receiving unit 211, configured to receive a decoding exception feedback message sent by the second client;
a third sending unit 212, configured to send the first encoding information to the second client according to the decoding anomaly feedback message.
Fig. 2 above describes a server in an embodiment of the present invention from the perspective of a modular functional entity, and the following describes the server in the embodiment of the present invention in detail from the perspective of hardware processing, referring to fig. 3, an embodiment of a server 300 in the embodiment of the present invention includes:
an input device 301, an output device 302, a processor 303 and a memory 304 (wherein the number of the processor 303 may be one or more, and one processor 303 is taken as an example in fig. 3). In some embodiments of the present invention, the input device 301, the output device 302, the processor 303 and the memory 304 may be connected by a bus or other means, wherein the connection by the bus is exemplified in fig. 3.
Wherein, by calling the operation instruction stored in the memory 304, the processor 303 is configured to perform the following steps:
the method comprises the steps of obtaining data volumes of various data types interacted between a server and a client, wherein the client comprises a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol;
determining the data proportion of the data type according to the data amount;
determining the type of target data according to the data proportion;
receiving live broadcast data sent by the client;
if the live data belongs to the target data type, encoding the live data according to the first protocol to obtain first encoding information;
encoding the live broadcast data according to the second protocol to obtain second encoding information;
sending the first coding information to the first client;
and sending the second coding information to the second client.
Referring to fig. 4, fig. 4 is a schematic view of an embodiment of an electronic device according to an embodiment of the invention.
As shown in fig. 4, an embodiment of the present invention provides an electronic device, which includes a memory 410, a processor 420, and a computer program 411 stored in the memory 420 and running on the processor 420, and when the processor 420 executes the computer program 411, the following steps are implemented:
the method comprises the steps of obtaining data volumes of various data types interacted between a server and a client, wherein the client comprises a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol;
determining the data proportion of the data type according to the data amount;
determining the type of target data according to the data proportion;
receiving live broadcast data sent by the client;
if the live data belongs to the target data type, encoding the live data according to the first protocol to obtain first encoding information;
encoding the live broadcast data according to the second protocol to obtain second encoding information;
sending the first coding information to the first client;
and sending the second coding information to the second client.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating an embodiment of a computer-readable storage medium according to the present invention.
As shown in fig. 5, the present embodiment provides a computer-readable storage medium 500 having a computer program 511 stored thereon, the computer program 511 implementing the following steps when executed by a processor:
the method comprises the steps of obtaining data volumes of various data types interacted between a server and a client, wherein the client comprises a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol;
determining the data proportion of the data type according to the data amount;
determining the type of target data according to the data proportion;
receiving live broadcast data sent by the client;
if the live data belongs to the target data type, encoding the live data according to the first protocol to obtain first encoding information;
encoding the live broadcast data according to the second protocol to obtain second encoding information;
sending the first coding information to the first client;
and sending the second coding information to the second client.
It should be noted that, in the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to relevant descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Embodiments of the present invention further provide a computer program product, where the computer program product includes computer software instructions, and when the computer software instructions are executed on a processing device, the processing device executes a flow in the method for designing a wind farm digital platform in the embodiment corresponding to fig. 1.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for sending live broadcast information, comprising:
the method comprises the steps of obtaining data volumes of various data types interacted between a server and a client, wherein the client comprises a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol;
determining the data proportion of the data type according to the data amount;
determining the type of target data according to the data proportion;
receiving live broadcast data sent by the client;
if the live data belongs to the target data type, encoding the live data according to the first protocol to obtain first encoding information;
encoding the live broadcast data according to the second protocol to obtain second encoding information;
sending the first coding information to the first client;
and sending the second coding information to the second client.
2. The method of claim 1, wherein sending the first encoded information to the first client comprises:
determining the first client according to a preset client database, and sending the first coding information to the first client, wherein a client identifier and a protocol corresponding to the client identifier are stored in the preset client database, and the client identifier comprises a first client identifier and a second client identifier.
3. The method of claim 1, wherein sending the second encoded information to a second client comprises:
and determining the second client according to a preset client database, and sending the second coding information to the second client, wherein a client identifier and a protocol corresponding to the client identifier are stored in the preset client database, and the client identifier comprises a first client identifier and a second client identifier.
4. The method according to any one of claims 2 or 3, further comprising:
receiving a login message sent by the client, wherein the login message carries a client identifier of the client and a protocol corresponding to the client identifier;
and storing the client identification and the corresponding protocol thereof into the preset client database.
5. The method of any of claims 1-3, wherein after sending the second encoded information to the second client, the method further comprises:
receiving a decoding abnormity feedback message sent by the second client;
and sending the first coding information to the second client according to the decoding abnormity feedback message.
6. A method according to any one of claims 1 to 3, wherein the first protocol comprises a json encoding protocol.
7. The method according to any of claims 1 to 3, wherein the second protocol comprises a protobuf encoding protocol.
8. A server, comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring data volumes of various data types interacted between a server and a client, the client comprises a first client and a second client, the first client corresponds to a first protocol, and the second client corresponds to a second protocol;
the first determining unit is used for determining the data proportion of the data type according to the data quantity;
the second determining unit is used for determining the type of the target data according to the data proportion;
the first receiving unit is used for receiving the live broadcast data sent by the client;
the first encoding unit is used for encoding the live data according to the first protocol to obtain first encoding information when the live data belongs to the target data type;
the second encoding unit is used for encoding the live broadcast data according to the second protocol to obtain second encoding information;
the first sending unit is used for sending the first coding information to the first client;
and the second sending unit is used for sending the second coding information to the second client.
9. An electronic device comprising a memory, a processor, wherein the processor is configured to implement the steps of the method for transmitting live information according to any one of claims 1 to 7 when executing a computer management-like program stored in the memory.
10. A computer-readable storage medium having stored thereon a computer management-like program, characterized in that: the computer management class program when executed by a processor implements the steps of transmitting live information as claimed in any one of claims 1 to 7.
CN201811208610.5A 2018-10-17 2018-10-17 Method for sending live broadcast information and server Active CN111064976B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811208610.5A CN111064976B (en) 2018-10-17 2018-10-17 Method for sending live broadcast information and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811208610.5A CN111064976B (en) 2018-10-17 2018-10-17 Method for sending live broadcast information and server

Publications (2)

Publication Number Publication Date
CN111064976A true CN111064976A (en) 2020-04-24
CN111064976B CN111064976B (en) 2022-01-04

Family

ID=70296956

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811208610.5A Active CN111064976B (en) 2018-10-17 2018-10-17 Method for sending live broadcast information and server

Country Status (1)

Country Link
CN (1) CN111064976B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114501049A (en) * 2022-01-18 2022-05-13 上海哔哩哔哩科技有限公司 Method, device and system for establishing live broadcast connection
CN115334331A (en) * 2022-08-23 2022-11-11 苏州青颖飞帆软件科技有限公司 Communication method, equipment and storage medium for teaching live broadcast

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110010417A1 (en) * 2009-07-08 2011-01-13 Shinichiro Yoshida Data transfer system and data transfer method
US20110078254A1 (en) * 2009-09-30 2011-03-31 Nuance Communications, Inc. Method and System for the Conversion and Processing of Documents in a Hybrid Network Environment
CN102469062A (en) * 2010-10-29 2012-05-23 北大方正集团有限公司 Data distributing method and device
CN102546756A (en) * 2011-12-13 2012-07-04 中兴通讯股份有限公司 Data processing method, cloud server and terminal
US20120259872A1 (en) * 2011-04-05 2012-10-11 Beyondcore, Inc. Automatically Generating Data Transformations for Business Process Platforms
CN102752494A (en) * 2011-09-28 2012-10-24 新奥特(北京)视频技术有限公司 Method and system for live broadcast of sports event
CN105046601A (en) * 2015-07-09 2015-11-11 传成文化传媒(上海)有限公司 User data processing method and system
CN105100954A (en) * 2014-05-07 2015-11-25 朱达欣 Interactive response system and method based on Internet communication and streaming media live broadcast
CN105378716A (en) * 2014-03-18 2016-03-02 华为技术有限公司 Method and apparatus for conversion of data storage formats
CN105978926A (en) * 2015-12-03 2016-09-28 乐视致新电子科技(天津)有限公司 Data transmission method and device
CN108021661A (en) * 2017-12-04 2018-05-11 北京锐安科技有限公司 A kind of conversion method of data format and system
CN108271079A (en) * 2017-08-21 2018-07-10 广州市动景计算机科技有限公司 The common method, apparatus and computer equipment for formulating barrage
CN108449415A (en) * 2018-03-27 2018-08-24 深圳中兴网信科技有限公司 Method of data synchronization, data synchronization unit, computer equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110010417A1 (en) * 2009-07-08 2011-01-13 Shinichiro Yoshida Data transfer system and data transfer method
US20110078254A1 (en) * 2009-09-30 2011-03-31 Nuance Communications, Inc. Method and System for the Conversion and Processing of Documents in a Hybrid Network Environment
CN102469062A (en) * 2010-10-29 2012-05-23 北大方正集团有限公司 Data distributing method and device
US20120259872A1 (en) * 2011-04-05 2012-10-11 Beyondcore, Inc. Automatically Generating Data Transformations for Business Process Platforms
CN102752494A (en) * 2011-09-28 2012-10-24 新奥特(北京)视频技术有限公司 Method and system for live broadcast of sports event
CN102546756A (en) * 2011-12-13 2012-07-04 中兴通讯股份有限公司 Data processing method, cloud server and terminal
CN105378716A (en) * 2014-03-18 2016-03-02 华为技术有限公司 Method and apparatus for conversion of data storage formats
CN105100954A (en) * 2014-05-07 2015-11-25 朱达欣 Interactive response system and method based on Internet communication and streaming media live broadcast
CN105046601A (en) * 2015-07-09 2015-11-11 传成文化传媒(上海)有限公司 User data processing method and system
CN105978926A (en) * 2015-12-03 2016-09-28 乐视致新电子科技(天津)有限公司 Data transmission method and device
CN108271079A (en) * 2017-08-21 2018-07-10 广州市动景计算机科技有限公司 The common method, apparatus and computer equipment for formulating barrage
CN108021661A (en) * 2017-12-04 2018-05-11 北京锐安科技有限公司 A kind of conversion method of data format and system
CN108449415A (en) * 2018-03-27 2018-08-24 深圳中兴网信科技有限公司 Method of data synchronization, data synchronization unit, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
聂晓旭等: "基于Protobuf的数据传输协议", 《计算机系统应用》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114501049A (en) * 2022-01-18 2022-05-13 上海哔哩哔哩科技有限公司 Method, device and system for establishing live broadcast connection
CN114501049B (en) * 2022-01-18 2023-10-27 上海哔哩哔哩科技有限公司 Live broadcast connection establishment method, device and system
CN115334331A (en) * 2022-08-23 2022-11-11 苏州青颖飞帆软件科技有限公司 Communication method, equipment and storage medium for teaching live broadcast
CN115334331B (en) * 2022-08-23 2023-09-22 苏州青颖飞帆软件科技股份有限公司 Communication method, equipment and storage medium for teaching live broadcast

Also Published As

Publication number Publication date
CN111064976B (en) 2022-01-04

Similar Documents

Publication Publication Date Title
CN105430534B (en) method and system for reporting data by intelligent equipment
CN106375865B (en) Bullet screen interaction method, system and terminal based on social information
CN110913000A (en) Method, system and computer readable storage medium for processing service information
CN104320679B (en) A kind of user information acquiring method and server based on HLS protocol
CN111064976B (en) Method for sending live broadcast information and server
CN113489805B (en) Butt joint method, device, equipment and storage medium of cloud desktop system
CN110650357B (en) Video decoding method and device
CN108427545B (en) Screenshot data processing method, device and system, storage medium and processor
CN110519607B (en) Video decoding method and device, and video encoding method and device
CN104639904B (en) A kind of monitor video signaling management system
CN109788251B (en) Video processing method, device and storage medium
CN106209942B (en) Data compression transmission method and system, terminal and server thereof
CN113079386B (en) Video online playing method and device, electronic equipment and storage medium
CN104468771A (en) Method and device for determining geographical position
CN105992055B (en) video decoding method and device
CN116260742A (en) Signaling capturing method and device, nonvolatile storage medium and electronic equipment
CN113810781B (en) Video processing method, video processing device, video tracking method, video tracking device and storage medium
CN113162628B (en) Data encoding method, data decoding method, terminal and storage medium
CN110545431B (en) Video decoding method and device, video encoding method and device
CN107306199B (en) Network element data playback method and device
CN113259621A (en) Cloud conference step-by-step recording method and system
CN109981674B (en) Remote procedure calling method, device, equipment and medium
CN106534895B (en) playing method and terminal of encrypted multimedia file
CN113066139A (en) Picture processing method and device, storage medium and electronic equipment
CN103905446A (en) Information reporting method and terminal, and information counting method and server

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