CN110248211A - Direct broadcasting room message current-limiting method, device, electronic equipment and storage medium - Google Patents
Direct broadcasting room message current-limiting method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN110248211A CN110248211A CN201810189283.7A CN201810189283A CN110248211A CN 110248211 A CN110248211 A CN 110248211A CN 201810189283 A CN201810189283 A CN 201810189283A CN 110248211 A CN110248211 A CN 110248211A
- Authority
- CN
- China
- Prior art keywords
- message
- current limliting
- direct broadcasting
- broadcasting room
- level current
- 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
- 238000000034 method Methods 0.000 title claims abstract description 53
- 230000005611 electricity Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 11
- 230000000694 effects Effects 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000003139 buffering effect Effects 0.000 description 3
- 230000006837 decompression Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/215—Flow control; Congestion control using token-bucket
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/231—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/23406—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving management of server-side video buffer
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/238—Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Information Transfer Between Computers (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The embodiment of the present invention discloses a kind of direct broadcasting room message current-limiting method, device, electronic equipment and storage medium, is related to network direct broadcasting technical field, can improve the stability of direct broadcast service system to a certain extent.The direct broadcasting room message current-limiting method, comprising: receive first order current limliting message and carry out the message obtained after first order current limliting to the direct broadcasting room message when first order current limliting message is that the size of message of direct broadcasting room message is greater than the first preset threshold;If the size of message of the direct broadcasting room message after first order current limliting is greater than the second preset threshold, second level current limliting is carried out to the first order current limliting message received, obtains second level current limliting message;The second level current limliting message is sent to message queue to cache.The present invention is suitable for BroadVision WEBTV.
Description
Technical field
The present invention relates to network direct broadcasting technical fields more particularly to a kind of direct broadcasting room message current-limiting method, device, electronics to set
Standby and storage medium.
Background technique
Under mobile internet environment, generally for burst mass data request, such as the second kill, flash sale, usually
It needs to carry out business current limliting, to avoid service snowslide, i.e., because moment flow leads to the unavailable of integrity service.
In video living transmission system, usual size of message each second reaches million or more, and single direct broadcasting room size of message is maximum close several
100000.In this way, the bandwidth pressure of moment causes greater impact to service for server, it is easy to occur service not
It is unavailable to even result in service for stable situation such as Caton, delay machine etc..
Summary of the invention
It is situated between in view of this, the embodiment of the present invention provides a kind of direct broadcasting room message current-limiting method, device, electronic equipment and storage
Matter can improve the stability of direct broadcast service system to a certain extent.
In a first aspect, the embodiment of the present invention provides a kind of direct broadcasting room message current-limiting method, comprising: receive first order current limliting and disappear
Breath, when the first order current limliting message is that the size of message of direct broadcasting room message is greater than the first preset threshold, to the direct broadcasting room message
Carry out the message obtained after first order current limliting;If it is pre- that the size of message of the direct broadcasting room message after first order current limliting is greater than second
If threshold value, then second level current limliting is carried out to the first order current limliting message received, obtain second level current limliting message, the second level
Current limliting message is to obtain message after carrying out second level current limliting to the direct broadcasting room message after first order current limliting;By the second level
Current limliting message is sent to message queue and is cached.
With reference to first aspect, in the first embodiment of first aspect, the first order current limliting message received
For the message for belonging to same direct broadcasting room;Wherein, the message of the same direct broadcasting room is according to entrained in each direct broadcasting room message
The identification of direct broadcasting room mark obtain, identical direct broadcasting room mark is carried in the message of same direct broadcasting room.
With reference to first aspect, it in second of embodiment of first aspect, is sent by the second level current limliting message
After being cached to message queue, the method also includes: the message of caching is obtained from the message queue, if from institute
The size of message for stating the message of the caching obtained in message queue is greater than third predetermined threshold value, then obtains to from the message queue
The message carry out third level current limliting, obtain third level current limliting message.
Second of embodiment with reference to first aspect, in the third embodiment of first aspect, to acquisition
After the message carries out third level current limliting, the method also includes: the third level current limliting message, which is sent to length, even served business
Device, to push to the terminal device of user by long even server, so that by the first order current limliting, second level current limliting and the
Direct broadcasting room message after three-level current limliting is shown in the direct broadcasting room of the display screen display of terminal device.
With reference to first aspect, in the 4th kind of embodiment of first aspect, the described pair of first order current limliting received disappears
Breath carries out second level current limliting, obtains second level current limliting message, comprising: to the first order current limliting message received, using token bucket
Algorithm carries out second level current limliting, obtains second level current limliting message.
Second of embodiment with reference to first aspect, it is described to from institute in the 5th kind of embodiment of first aspect
It states the message that obtains in message queue and carries out third level current limliting, comprising: to disappearing described in being obtained from the message queue
Breath carries out third level current limliting using token bucket algorithm.
Second aspect, the embodiment of the present invention provide a kind of direct broadcasting room message current-limiting apparatus, comprising: message reception module is used
In receiving first order current limliting message, the first order current limliting message is that the size of message of direct broadcasting room message is greater than the first preset threshold
When, the message obtained after first order current limliting is carried out to the direct broadcasting room message;Second level current limliting module, if for by the first order
The size of message of direct broadcasting room message after current limliting is greater than the second preset threshold, then carries out second to the first order current limliting message received
Grade current limliting, obtains second level current limliting message, and the second level current limliting message is to the direct broadcasting room message after first order current limliting
Message is obtained after carrying out second level current limliting;First message sending module, for the second level current limliting message to be sent to message
Queue is cached.
In conjunction with second aspect, in the first embodiment of second aspect, the first order current limliting message received
For the message for belonging to same direct broadcasting room;Wherein, the message of the same direct broadcasting room is according to entrained in each direct broadcasting room message
The identification of direct broadcasting room mark obtain, identical direct broadcasting room mark is carried in the message of same direct broadcasting room.
In conjunction with second aspect, in second of embodiment of second aspect, described device further include: three-level current limliting mould
Block, if the size of message of the message of the caching for obtaining from the message queue is greater than third predetermined threshold value, to from institute
It states the message obtained in message queue and carries out third level current limliting, obtain third level current limliting message, the third level current limliting is
The message obtained after third level current limliting is carried out to the direct broadcasting room message after the current limliting of the second level.
In conjunction with second of embodiment of second aspect, in the third embodiment of second aspect, described device is also
It include: second message sending module, for the third level current limliting message to be sent to long even server, even served business by length
Device pushes to the terminal device of user, so that the live streaming after the first order current limliting, second level current limliting and third level current limliting
Between message shown in the direct broadcasting room of the display screen display of terminal device.
In conjunction with second aspect, in the 4th kind of embodiment of second aspect, the second level current limliting module, be specifically used for pair
The first order current limliting message received carries out second level current limliting using token bucket algorithm, obtains second level current limliting message.
In conjunction with second of embodiment of second aspect, in the 5th kind of embodiment of second aspect, the three-level limit
Flow module uses token bucket algorithm to the message of acquisition specifically for obtaining the message of caching from the message queue
Carry out third level current limliting.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes: shell, processor, deposits
Reservoir, circuit board and power circuit, wherein circuit board is placed in the space interior that shell surrounds, processor and memory setting
On circuit boards;Power circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is for storing and can hold
Line program code;Processor is run and executable program code pair by reading the executable program code stored in memory
The program answered, for executing aforementioned any method.
Fourth aspect, the embodiment of the present invention also provide a kind of computer readable storage medium, described computer-readable to deposit
Storage media is stored with one or more program, and one or more of programs can be executed by one or more processor,
To realize method described in aforementioned any claim.
5th aspect, the embodiment of the present invention also provide a kind of application program, and the application program is performed to realize this
The method that invention any embodiment provides.
A kind of direct broadcasting room message current-limiting method, device, electronic equipment and storage medium provided in an embodiment of the present invention, if
It is straight to being obtained after the direct broadcasting room message progress first order current limliting when size of message of direct broadcasting room message is greater than the first preset threshold
Broadcast message (i.e. the first current limliting message) size of message be greater than the second preset threshold, then to the first order current limliting message received into
Row second level current limliting obtains second level current limliting message;The second level current limliting message is sent to message queue to cache, this
Sample is easy when the size of message of direct broadcasting room message is larger to straight by the way that the multistage current limliting of direct broadcasting room message progress can be reduced or avoided
The system of broadcasting causes the situation that direct broadcast service is unstable caused by greater impact to occur, and second level current limliting message is sent to message
Queue is simultaneously cached, and buffering peak flow can be further functioned as, and mitigates the effect of direct broadcast service pressure, in this way can be certain
The stability of direct broadcast service system is improved in degree.
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 be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the structural schematic diagram of live broadcast system applied by the embodiment of the present invention;
Fig. 2 is the flow diagram of one embodiment of the invention direct broadcasting room message current-limiting method;
Fig. 3 is the flow diagram of another embodiment of the present invention direct broadcasting room message current-limiting method;
Fig. 4 is the structural schematic diagram of one embodiment of the invention direct broadcasting room message current-limiting apparatus;
Fig. 5 is the structural schematic diagram of another embodiment of the present invention direct broadcasting room message current-limiting apparatus;
Fig. 6 is the structural schematic diagram of electronic equipment one embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described in detail with reference to the accompanying drawing.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its
Its embodiment, shall fall within the protection scope of the present invention.
The present embodiment provides a kind of direct broadcasting room message current-limiting method, device, electronic equipment and storage mediums, are applied to network
Direct broadcasting room server in video living transmission system.Fig. 1 is the structural schematic diagram of live broadcast system applied by the embodiment of the present invention.Ginseng
See that Fig. 1, the live broadcast system include user, long connection server, direct broadcasting room server and Message queue.Wherein, the user
Watch the user of live streaming, mostly mobile phone terminal or web terminal user;In order to be broadcast live the push of message, the terminal of user is set
It is standby to need to be accessed with long connection server, long connection is established, message is committed to first in long connection server when sending.Together
Reason, when message sink are also to be pushed by long connection server.The direct broadcasting room server is the business of direct broadcasting room message
Processing server, message content carry out message in direct broadcasting room server to direct broadcasting room server by growing connection server transport
Anti- yellow filtering and the relevant operations such as storage.The buffer queue of the message queue, that is, message uses in order to avoid pressure is excessive
The effects of caching into message queue to carry out service decompression, flow peak clipping.
In live broadcast system, if live broadcast system size of message per second in terms of 1,000,000, then, such magnanimity message is simultaneously
Long connection server is reported to, long connection server needs while pushing in direct broadcasting room server to be handled, then, no matter
Computer room bandwidth or CPU computing capability are all difficult to bear, for server, the bandwidth pressure of moment, to service cause compared with
Large impact, being easy, which makes service unstable situation occur, such as there is Caton, delay machine.For client direct broadcasting room, moment
Magnanimity message, brush screen is too fast, and to will cause very big puzzlement when user's browsing, cause application message can not normal browsing.
Affect the experience and interaction of product.
Therefore, for safeguards system stability or high availability, the embodiment of the present invention takes multistage current limliting strategy.Current limliting
Mode will not hinder the operation of main thread business that is, during current limliting using non-blocking fashion.
In a first aspect, improving live streaming clothes to a certain extent the present embodiment provides a kind of direct broadcasting room message current-limiting method
The stability of business system.
Fig. 2 is the flow diagram of one embodiment of the invention direct broadcasting room message current-limiting method, referring to Fig. 2, the present embodiment
Method includes:
Step 101 receives first order current limliting message.
In live broadcast system, server end word message amount is usually bigger, reachable million or even ten million item per second, to service
Device bandwidth causes certain impact, simultaneously as the message that client receives simultaneously is excessive, will also read and be caused centainly to user
Puzzlement, affects user experience to a certain extent.For this purpose, message is controlled in certain safety in server end in the present embodiment
In range of flow, that is, carry out message current limliting.
When first order current limliting message is that the size of message of direct broadcasting room message is greater than the first preset threshold, direct broadcasting room message is carried out
The message obtained after first order current limliting.Wherein, direct broadcasting room message refers to the word content in live broadcast system, comprising: barrage and
The contents such as text interactive chat.
In the present embodiment, after the user and long connection server for watching live streaming establish long connection, the message that user sends is first
It is committed in long connection server.Long connection server carries out first order current limliting to the message that user sends first, obtains first
Grade current limliting message, and obtained first order current limliting message is transmitted to direct broadcasting room server (referring to the label 1 in Fig. 1), it is described
Direct broadcasting room server receives first order current limliting message.
In one embodiment, long connection server can be used token bucket algorithm and carry out first order limit to the message that user sends
Stream.
In another embodiment, long connection server can be used token bucket algorithm and carry out first to the message that user sends
Grade current limliting.The principle of token bucket algorithm is to be put into token in token bucket with constant rate, if there is business processing requests to send out
When raw, need to obtain token from token bucket, if it is possible to token is acquired, then continue to operate in next step, otherwise, it means that
It has been more than setting rate, has been more than the business processing request service for setting rate by refusal.In the live streaming application of the present embodiment,
Current limliting is carried out to the message that user sends using token bucket algorithm, the average transmission rate of data can be both limited, may also allow for certain
The burst transfer of degree.
In a specific example, when the size of message of direct broadcasting room message is greater than the first preset threshold such as 1,000,000 per second,
In long connection server, first time current limliting, such as 90% ratio according to size of message per second can be carried out to direct broadcasting room message
Current limliting is carried out, the direct broadcasting room message Jing Guo first order current limliting is pushed to direct broadcasting room server.In the present embodiment, long connection service
Device there remains per second 10 after carrying out current limliting according to 90% ratio of size of message per second to 1,000,000 per second direct broadcasting room message
Ten thousand message need to only be pushed to direct broadcasting room server by 100,000 message per second.
If the size of message of the direct broadcasting room message after first order current limliting is greater than the second preset threshold, then follow the steps
102, the current limliting of a progress otherwise then can be no longer done to direct broadcasting room message, can be sent directly to message queue and be cached.
Step 102 carries out second level current limliting to the first order current limliting message received, obtains second level current limliting message.
In the present embodiment, after direct broadcasting room server receives first order current limliting message, if after first order current limliting
The size of message of direct broadcasting room message is greater than the second preset threshold, then carries out second level current limliting to the first order current limliting message received,
Second level current limliting message is obtained, the second level current limliting message is to carry out second to the direct broadcasting room message after first order current limliting
Message is obtained after grade current limliting.
In one embodiment, direct broadcasting room server can be used token bucket algorithm and carry out the to the first order current limliting message that receives
Second level current limliting.
In another embodiment, token bucket algorithm can be used to the first order current limliting message received in direct broadcasting room server
Carry out second level current limliting.Second level current limliting is carried out to the first order current limliting message using token bucket algorithm, can both limit data
Average transmission rate may also allow for burst transfer to a certain degree.
In above-mentioned specific example, after message reaches direct broadcasting room server, if direct broadcasting room server is pressed to message queue
The size of message of 100,000 message per second is pushed, and size of message is still very big, when being greater than the second preset threshold such as 80,000 per second,
In direct broadcasting room server to before message queue PUSH message, second of current limliting is carried out according to 90% ratio of size of message per second.
After the completion of the current limliting of the second level, it there remains 10,000 message per second and need to push into message queue.
The second level current limliting message is sent to message queue and caches by step 103.
In the present embodiment, the second level current limliting message is sent to message queue (referring in Fig. 1 by direct broadcasting room server
Label 2) it is cached, to play the effects of servicing decompression, flow peak clipping.
The direct broadcasting room message current-limiting method of the present embodiment, if the size of message of direct broadcasting room message is greater than the first preset threshold
When, it is big to the size of message of the direct broadcasting room message (i.e. the first current limliting message) obtained after direct broadcasting room message progress first order current limliting
In the second preset threshold, then second level current limliting is carried out to the first order current limliting message received, obtain second level current limliting message, it will
The second level current limliting message is sent to message queue and is cached, in this way to direct broadcasting room message carry out multistage current limliting can reduce or
Direct broadcast service is unstable caused by avoiding being easy to cause greater impact to live broadcast system when the size of message of direct broadcasting room message is larger
Fixed situation occurs, and second level current limliting message is sent to message queue and is cached, and can further function as buffering peak stream
Amount mitigates the effect of direct broadcast service pressure, improves the stability of direct broadcast service system to a certain extent in this way.
Second aspect, the present embodiment provides a kind of direct broadcasting room message current-limiting methods, improve live streaming clothes to a certain extent
The stability of business system.
Fig. 3 is the flow diagram of another embodiment of the present invention direct broadcasting room message current-limiting method, referring to Fig. 3, the present embodiment
Method include:
Step 201 receives first order current limliting message.
When first order current limliting message is that the size of message of direct broadcasting room message is greater than the first preset threshold, direct broadcasting room message is carried out
The message obtained after first order current limliting.Wherein, direct broadcasting room message refers to the word content in live broadcast system, comprising: barrage and
The contents such as text interactive chat.
In the present embodiment, after the user and long connection server for watching live streaming establish long connection, the message that user sends is first
It is committed in long connection server.Long connection server carries out first order current limliting to the message that user sends first, obtains first
Grade current limliting message, and obtained first order current limliting message is transmitted to direct broadcasting room server (referring to the label 1 in Fig. 1), it is described
Direct broadcasting room server receives first order current limliting message.
In one embodiment, long connection server can be used token bucket algorithm and carry out first order limit to the message that user sends
Stream.
In another embodiment, long connection server can be used token bucket algorithm and carry out first to the message that user sends
Grade current limliting.The principle of token bucket algorithm is to be put into token in token bucket with constant rate, if there is business processing requests to send out
When raw, need to obtain token from token bucket, if it is possible to token is acquired, then continue to operate in next step, otherwise, it means that
It has been more than setting rate, has been more than the business processing request service for setting rate by refusal.In the live streaming application of the present embodiment,
Current limliting is carried out to the message that user sends using token bucket algorithm, the average transmission rate of data can be both limited, may also allow for certain
The burst transfer of degree.
In a specific example, when the size of message of direct broadcasting room message is greater than the first preset threshold such as 1,000,000 per second,
In long connection server, first time current limliting can be carried out to direct broadcasting room message, for example, according to size of message per second 90% ratio into
Direct broadcasting room message Jing Guo first order current limliting is pushed to direct broadcasting room server by row current limliting.In the present embodiment, long connection server
To 1,000,000 per second direct broadcasting room message, it there remains per second 100,000 after carrying out current limliting according to 90% ratio of size of message per second
Message need to only be pushed to direct broadcasting room server by 100,000 message per second.
In one embodiment, live broadcast system is distributed system, while can have more directors and connect server and live streaming
Between server, and the message of direct broadcasting room may be in any director and connect on server.Due in the message of same direct broadcasting room
Identical direct broadcasting room mark is carried, it can be by being identified direct broadcasting room entrained in each direct broadcasting room message to obtain
Belong to the message of same direct broadcasting room.More accurately current limliting is carried out to direct broadcasting room message in order to realize, long even server is used to straight
The strategy that the direct broadcasting room ID (identification number) carried in message carries out Classification and Identification is broadcast only to push the message of same direct broadcasting room
It is handled into a direct broadcasting room server.In this way, the first order current limliting message that direct broadcasting room server receives is to belong to always
Message between broadcasting, in order to carry out more accurately current limliting.
If the size of message of the direct broadcasting room message after first order current limliting is greater than the second preset threshold, then follow the steps
202, the current limliting of a progress otherwise then can be no longer done to direct broadcasting room message, can be sent directly to message queue and be cached.
Step 202 carries out second level current limliting to the first order current limliting message received, obtains second level current limliting message.
In the present embodiment, after direct broadcasting room server receives first order current limliting message, if after first order current limliting
The size of message of direct broadcasting room message is greater than the second preset threshold, then carries out second level current limliting to the first order current limliting message received,
Second level current limliting message is obtained, the second level current limliting message is to carry out second to the direct broadcasting room message after first order current limliting
Message is obtained after grade current limliting.
In one embodiment, direct broadcasting room server can be used token bucket algorithm and carry out the to the first order current limliting message that receives
Second level current limliting.
In another embodiment, token bucket algorithm can be used to the first order current limliting message received in direct broadcasting room server
Carry out second level current limliting.Second level current limliting is carried out to the first order current limliting message using token bucket algorithm, can both limit data
Average transmission rate may also allow for burst transfer to a certain degree.
In above-mentioned specific example, after message reaches direct broadcasting room server, if direct broadcasting room server is pressed to message queue
The size of message of 100,000 message per second is pushed, and size of message is still very big, when being greater than the second preset threshold such as 80,000 per second,
In direct broadcasting room server to before message queue PUSH message, second of current limliting is carried out according to 90% ratio of size of message per second.
After the completion of the current limliting of the second level, it there remains 10,000 message per second and need to push into message queue.
The second level current limliting message is sent to message queue and caches by step 203.
In the present embodiment, the second level current limliting message is sent to message queue (referring in Fig. 1 by direct broadcasting room server
Label 2) it is cached, to play the effects of servicing decompression, flow peak clipping.
Step 204, the message that caching is obtained from the message queue carry out third level current limliting to the message of acquisition, obtain
To third level current limliting message.
In the present embodiment, direct broadcasting room server obtains the message of caching (referring to the label in Fig. 1 from the message queue
3), if the size of message of the message of the caching obtained from the message queue is greater than third predetermined threshold value, disappear to from described
The message obtained in breath queue carries out third level current limliting, and the third level current limliting is to disappear to the direct broadcasting room after the current limliting of the second level
Breath carries out the message obtained after third level current limliting.If the size of message of the message of the caching obtained from the message queue is little
In third predetermined threshold value, then further current limliting no longer can be done to the message obtained from the message queue and handled.
In one embodiment, direct broadcasting room server can be used token bucket algorithm and carry out third level current limliting to the message of acquisition.
In another embodiment, token bucket algorithm can be used to the first order current limliting message received in direct broadcasting room server
Carry out second level current limliting.Third level current limliting is carried out using message of the token bucket algorithm to acquisition, can both limit the average transmission of data
Rate may also allow for burst transfer to a certain degree.
The third level current limliting message is sent to long even server by step 205, to push to use by long even server
The terminal device at family.
In the present embodiment, the third level current limliting message is sent to long even server by direct broadcasting room server, to pass through length
Even server pushes to the terminal device of user, so that after the first order current limliting, second level current limliting and third level current limliting
Direct broadcasting room message shown in the direct broadcasting room of the display screen display of terminal device.
In one embodiment, in order to promote the reading experience of client in terminal device, disappear to what each direct broadcasting room pushed
Breath amount can be 50 per second.
The direct broadcasting room message current-limiting method of the present embodiment, if the size of message of direct broadcasting room message is greater than the first preset threshold
When, it is big to the size of message of the direct broadcasting room message (i.e. the first current limliting message) obtained after direct broadcasting room message progress first order current limliting
In the second preset threshold, then second level current limliting is carried out to the first order current limliting message received, obtain second level current limliting message;It will
The second level current limliting message is sent to message queue and is cached, if the message of the caching obtained from the message queue
Size of message be greater than third predetermined threshold value, then third level current limliting is carried out to the message that obtains from the message queue, obtains the
The size of message in direct broadcasting room message can be reduced or avoided by carrying out multistage current limliting to direct broadcasting room message in this way in three-level current limliting message
It is easy to cause live broadcast system the situation that direct broadcast service is unstable caused by greater impact to occur when larger, by second level current limliting
Message is sent to message queue and is cached, and can further function as buffering peak flow, mitigates the effect of direct broadcast service pressure,
Improve the stability of direct broadcast service system to a certain extent in this way.
It should be understood that in the present embodiment, carrying out third level current limliting to message is optional step, if without the
Three-level current limliting, direct broadcasting room server will then obtain the message of caching from the message queue, be transmitted directly to long even server,
To push to the terminal device of user by long even server, so that message is shown in direct broadcasting room.
Message is during current limliting, if can generate CPU waiting using traditional obstruction mode, cause the Caton of service,
It will affect the normal operation of service.In order to avoid the generation of this problem, in the present embodiment by the way of non-obstruction, i.e. current limliting
It will not influence the execution of main thread business, meanwhile, when carrying out current limliting using token bucket algorithm, obtain current limliting token (Token)
There can also be timeout expirations mechanism, if the waiting time has been more than preset value, also will be considered to current limliting time-out.
The third aspect, the present embodiment provides a kind of direct broadcasting room message current-limiting apparatus, improve live streaming clothes to a certain extent
The stability of business system.
Fig. 4 is the structural schematic diagram of one embodiment of the invention direct broadcasting room message current-limiting apparatus, referring to Fig. 4, the present embodiment
Device includes message reception module 11, second level current limliting module 12 and first message sending module 13;Wherein, the message sink mould
Block 11, for receiving first order current limliting message, the first order current limliting message is that the size of message of direct broadcasting room message is greater than first in advance
If when threshold value, the message obtained after first order current limliting is carried out to the direct broadcasting room message;The second level current limliting module 12, for such as
The size of message of direct broadcasting room message of the fruit after first order current limliting is greater than the second preset threshold, then to the first order current limliting received
Message carries out second level current limliting, obtains second level current limliting message, and the second level current limliting message is to after first order current limliting
Direct broadcasting room message carry out second level current limliting after obtain message;The first message sending module 13 is used for the second level
Current limliting message is sent to message queue and is cached.
The device of the present embodiment can be used for executing the technical solution of embodiment of the method shown in Fig. 2, realization principle and skill
Art effect is similar, and details are not described herein again.
Fourth aspect, the present embodiment provides another direct broadcasting room message current-limiting apparatus, improve live streaming to a certain extent
The stability of service system.
Fig. 5 is the structural schematic diagram of another embodiment of the present invention direct broadcasting room message current-limiting apparatus, referring to Fig. 5, the present embodiment
Device device shown in Fig. 4 on the basis of, the first order current limliting message received is to belong to the message of same direct broadcasting room;
Wherein, the message of the same direct broadcasting room is to be obtained according to the identification to direct broadcasting room mark entrained in each direct broadcasting room message,
Identical direct broadcasting room mark is carried in the message of same direct broadcasting room.
In one embodiment, described device may also include that three-level current limliting module 14, for obtaining from the message queue
The message of caching is right if the size of message of the message of the caching obtained from the message queue is greater than third predetermined threshold value
The message obtained from the message queue carries out third level current limliting, obtains third level current limliting message, the third level current limliting is
The message obtained after third level current limliting is carried out to the direct broadcasting room message after the current limliting of the second level.
In one embodiment, described device may also include that second message sending module 15, be used for the third level current limliting
Message is sent to long even server, to push to the terminal device of user by long even server, so that by the first order
Direct broadcasting room message after current limliting, second level current limliting and third level current limliting in the direct broadcasting room of the display screen display of terminal device into
Row display.
In one embodiment, the second level current limliting module can be specifically used for using the first order current limliting message received
Token bucket algorithm carries out second level current limliting, obtains second level current limliting message.
In one embodiment, the three-level current limliting module can be specifically used for obtaining disappearing for caching from the message queue
Breath carries out third level current limliting using token bucket algorithm to the message of acquisition.
The device of the present embodiment can be used for executing the technical solution of embodiment of the method shown in Fig. 2 or Fig. 3, realize former
Reason is similar with technical effect, and details are not described herein again.
It should be understood that in the present embodiment, the three-level current limliting module to message carry out third level current limliting be it is optional,
If can will obtain the message of caching from the message queue without third level current limliting, being transmitted directly to length even served business
Device, to push to the terminal device of user by long even server, so that message is shown in direct broadcasting room.
The embodiment of the present invention also provides a kind of electronic equipment, and Fig. 6 is that the structure of electronic equipment one embodiment of the present invention is shown
It is intended to, the process of Fig. 2-embodiment illustrated in fig. 3 of the present invention may be implemented, as shown in fig. 6, above-mentioned electronic equipment may include: shell
Body 41, processor 42, memory 43, circuit board 44 and power circuit 45, wherein circuit board 44 is placed in the sky that shell 41 surrounds
Between it is internal, processor 42 and memory 43 are arranged on circuit board 44;Power circuit 45, for for each of above-mentioned electronic equipment
Circuit or device power supply;Memory 43 is for storing executable program code;Processor 42 is stored by reading in memory 43
Executable program code run program corresponding with executable program code, for executing described in aforementioned any embodiment
Current-limiting method.
Processor 42 to the specific implementation procedures of above-mentioned steps and processor 42 by operation executable program code come
The step of further executing may refer to the description of Fig. 1-3 illustrated embodiment of the present invention, and details are not described herein.
The electronic equipment exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data
Communication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and low
Hold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function
Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio,
Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic equipments with data interaction function.
The embodiment of the present invention also provides a kind of computer readable storage medium, and the computer-readable recording medium storage has
One or more program, one or more of programs can be executed by one or more processor, to realize aforementioned
The method that one embodiment provides.
The embodiment of the present invention also provides a kind of application program, and the application program is performed to realize any reality of the present invention
The method that example offer is provided.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence " including one ... ", it is not excluded that
There is also other identical elements in the process, method, article or apparatus that includes the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.
For Installation practice, since it is substantially similar to the method embodiment, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
For convenience of description, description apparatus above is to be divided into various units/modules with function to describe respectively.Certainly, exist
Implement to realize each unit/module function in the same or multiple software and or hardware when the present invention.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by those familiar with the art, all answers
It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.
Claims (10)
1. a kind of direct broadcasting room message current-limiting method characterized by comprising
First order current limliting message is received, the first order current limliting message is that the size of message of direct broadcasting room message is greater than the first preset threshold
When, the message obtained after first order current limliting is carried out to the direct broadcasting room message;
If the size of message of the direct broadcasting room message after first order current limliting is greater than the second preset threshold, to first received
Grade current limliting message carries out second level current limliting, obtains second level current limliting message, and the second level current limliting message is to by the first order
Direct broadcasting room message after current limliting obtains message after carrying out second level current limliting;
The second level current limliting message is sent to message queue to cache.
2. direct broadcasting room message current-limiting method according to claim 1, which is characterized in that the first order current limliting received
Message is to belong to the message of same direct broadcasting room;Wherein, the message of the same direct broadcasting room is according to institute in each direct broadcasting room message
The identification of the direct broadcasting room mark of carrying obtains, and identical direct broadcasting room mark is carried in the message of same direct broadcasting room.
3. direct broadcasting room message current-limiting method according to claim 1, which is characterized in that by the second level current limliting message
It is sent to after message queue cached, the method also includes:
The message of caching is obtained from the message queue;
If the size of message of the message of the caching obtained from the message queue is greater than third predetermined threshold value, disappear to from described
The message obtained in breath queue carries out third level current limliting, obtains third level current limliting message, and the third level current limliting is to warp
Direct broadcasting room message after crossing second level current limliting carries out the message obtained after third level current limliting.
4. direct broadcasting room message current-limiting method according to claim 3, which is characterized in that in the message progress to acquisition
After third level current limliting, the method also includes:
The third level current limliting message is sent to long even server, to set by the terminal that server pushes to user long even
It is standby, so that the direct broadcasting room message after the first order current limliting, second level current limliting and third level current limliting is in the aobvious of terminal device
Show in the direct broadcasting room of screen display and is shown.
5. direct broadcasting room message current-limiting method according to claim 1, which is characterized in that the described pair of first order limit received
Flow message carries out second level current limliting, obtains second level current limliting message, comprising:
To the first order current limliting message received, second level current limliting is carried out using token bucket algorithm, obtains second level current limliting message.
6. direct broadcasting room message current-limiting method according to claim 3, which is characterized in that described to from the message queue
The message obtained carries out third level current limliting, comprising:
Third level current limliting is carried out using token bucket algorithm to the message obtained from the message queue.
7. a kind of direct broadcasting room message current-limiting apparatus characterized by comprising
Message reception module, for receiving first order current limliting message, the first order current limliting message is the message of direct broadcasting room message
When amount is greater than the first preset threshold, the message obtained after first order current limliting is carried out to the direct broadcasting room message;
Second level current limliting module, if the size of message for the direct broadcasting room message after first order current limliting is greater than the second default threshold
Value then carries out second level current limliting to the first order current limliting message received, obtains second level current limliting message, the second level current limliting
Message is to obtain message after carrying out second level current limliting to the direct broadcasting room message after first order current limliting;
First message sending module is cached for the second level current limliting message to be sent to message queue.
8. direct broadcasting room message current-limiting apparatus according to claim 7, which is characterized in that the first order current limliting received
Message is to belong to the message of same direct broadcasting room;Wherein, the message of the same direct broadcasting room is according to institute in each direct broadcasting room message
The identification of the direct broadcasting room mark of carrying obtains, and identical direct broadcasting room mark is carried in the message of same direct broadcasting room.
9. direct broadcasting room message current-limiting apparatus according to claim 7, which is characterized in that described device further include:
Three-level current limliting module, for obtaining the message of caching from the message queue, if obtained from the message queue
The size of message of message of caching be greater than third predetermined threshold value, then the is carried out to the message that obtains from the message queue
Three-level current limliting, obtains third level current limliting message, the third level current limliting be to the direct broadcasting room message after the current limliting of the second level into
The message obtained after row third level current limliting.
10. a kind of electronic equipment, which is characterized in that the electronic equipment includes: shell, processor, memory, circuit board and electricity
Source circuit, wherein circuit board is placed in the space interior that shell surrounds, and processor and memory setting are on circuit boards;Power supply
Circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is for storing executable program code;Processing
Device runs program corresponding with executable program code by reading the executable program code stored in memory, for holding
Method described in the aforementioned any claim of row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810189283.7A CN110248211B (en) | 2018-03-07 | 2018-03-07 | Live broadcast room message current limiting method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810189283.7A CN110248211B (en) | 2018-03-07 | 2018-03-07 | Live broadcast room message current limiting method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110248211A true CN110248211A (en) | 2019-09-17 |
CN110248211B CN110248211B (en) | 2021-08-24 |
Family
ID=67882051
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810189283.7A Active CN110248211B (en) | 2018-03-07 | 2018-03-07 | Live broadcast room message current limiting method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110248211B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110636318A (en) * | 2019-09-23 | 2019-12-31 | 北京达佳互联信息技术有限公司 | Message display method, message display device, client device, server and storage medium |
CN111414516A (en) * | 2020-03-17 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Live broadcast room message processing method and device, electronic equipment and storage medium |
CN113469661A (en) * | 2021-07-21 | 2021-10-01 | 上海浦东发展银行股份有限公司 | Service current limiting method, device, computer equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090164484A1 (en) * | 2007-12-21 | 2009-06-25 | Yahoo! Inc. | Comment Filters for Real-Time Multimedia Broadcast Sessions |
CN104539514A (en) * | 2014-12-17 | 2015-04-22 | 广州酷狗计算机科技有限公司 | Information filtering method and device |
CN105916057A (en) * | 2016-04-18 | 2016-08-31 | 乐视控股(北京)有限公司 | Video barrage display method and device |
CN106993234A (en) * | 2017-03-22 | 2017-07-28 | 北京潘达互娱科技有限公司 | Barrage display methods and device |
WO2017185640A1 (en) * | 2016-04-29 | 2017-11-02 | 乐视控股(北京)有限公司 | Bullet-screen generation and display method, and device, server, and client thereof |
CN107371056A (en) * | 2017-07-18 | 2017-11-21 | 北京蜜莱坞网络科技有限公司 | A kind of method and apparatus for loading barrage |
CN107592578A (en) * | 2017-09-22 | 2018-01-16 | 广东欧珀移动通信有限公司 | Information processing method, device, terminal device and storage medium |
-
2018
- 2018-03-07 CN CN201810189283.7A patent/CN110248211B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090164484A1 (en) * | 2007-12-21 | 2009-06-25 | Yahoo! Inc. | Comment Filters for Real-Time Multimedia Broadcast Sessions |
CN104539514A (en) * | 2014-12-17 | 2015-04-22 | 广州酷狗计算机科技有限公司 | Information filtering method and device |
CN105916057A (en) * | 2016-04-18 | 2016-08-31 | 乐视控股(北京)有限公司 | Video barrage display method and device |
WO2017185640A1 (en) * | 2016-04-29 | 2017-11-02 | 乐视控股(北京)有限公司 | Bullet-screen generation and display method, and device, server, and client thereof |
CN106993234A (en) * | 2017-03-22 | 2017-07-28 | 北京潘达互娱科技有限公司 | Barrage display methods and device |
CN107371056A (en) * | 2017-07-18 | 2017-11-21 | 北京蜜莱坞网络科技有限公司 | A kind of method and apparatus for loading barrage |
CN107592578A (en) * | 2017-09-22 | 2018-01-16 | 广东欧珀移动通信有限公司 | Information processing method, device, terminal device and storage medium |
Non-Patent Citations (1)
Title |
---|
许佳: "基于IPv6的P2P流量识别与控制的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110636318A (en) * | 2019-09-23 | 2019-12-31 | 北京达佳互联信息技术有限公司 | Message display method, message display device, client device, server and storage medium |
CN111414516A (en) * | 2020-03-17 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Live broadcast room message processing method and device, electronic equipment and storage medium |
CN113469661A (en) * | 2021-07-21 | 2021-10-01 | 上海浦东发展银行股份有限公司 | Service current limiting method, device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110248211B (en) | 2021-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2649792B1 (en) | Pre-buffering audio/video stream pairs | |
US8589583B2 (en) | Method and apparatus for adaptive bit rate switching | |
US11290778B2 (en) | Determining a quality of experience metric based on uniform resource locator data | |
CN111135569A (en) | Cloud game processing method and device, storage medium and electronic equipment | |
US9204180B2 (en) | Method, server and terminal for audio and video on demand | |
CN110248211A (en) | Direct broadcasting room message current-limiting method, device, electronic equipment and storage medium | |
CN104219286B (en) | streaming media processing method, device, client, CDN node server and terminal | |
WO2019128800A1 (en) | Content service implementation method and device, and content delivery network node | |
KR20130093675A (en) | Variable bit video streams for adaptive streaming | |
US11979641B2 (en) | Relevance-based search and discovery of media content | |
US11184669B2 (en) | Distribution of network traffic for streaming content | |
CN107147921A (en) | Based on section and the intelligence CDN video playback accelerated methods dispatched and equipment | |
US20120221681A1 (en) | Method, apparatus and system for hierarchically requesting contents in a http streaming system | |
CN205430501U (en) | Mobile terminal network advertisement video and positive video seamless switching device | |
EP2834746B1 (en) | Pipelining for parallel network connections to transmit a digital content stream | |
CN113490055A (en) | Data processing method and device | |
US20170093945A1 (en) | Selecting bitrate to stream encoded media based on tagging of important media segments | |
CN106658113B (en) | Multimedia data processing method and device | |
CN102111617A (en) | Streaming media decoding method and device | |
US9060044B2 (en) | System and method to actively transfer video content across device during video playback (active playback) | |
CN109714352A (en) | Network data transmission method and device and electronic equipment | |
CN114501084B (en) | Play method, device, equipment and medium of player | |
CN102857667B (en) | Realize the method and system of the picture processing to multimedia play equipment | |
US20170289229A1 (en) | Method and terminal device for providing multimedia content | |
CN113824689A (en) | Edge computing network, data transmission 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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210607 Address after: 25, 5th floor, shuangjingfang office building, 3 frisha street, Singapore Applicant after: Zhuomi Private Ltd. Address before: Room 1101, Santai Commercial Building, 139 Connaught Road, Hong Kong, China Applicant before: HONG KONG LIVE.ME Corp.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |