CN114071175B - Method and system for aligning internal memory of message - Google Patents

Method and system for aligning internal memory of message Download PDF

Info

Publication number
CN114071175B
CN114071175B CN202111354795.2A CN202111354795A CN114071175B CN 114071175 B CN114071175 B CN 114071175B CN 202111354795 A CN202111354795 A CN 202111354795A CN 114071175 B CN114071175 B CN 114071175B
Authority
CN
China
Prior art keywords
message
playing
ordered queue
target
new
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111354795.2A
Other languages
Chinese (zh)
Other versions
CN114071175A (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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202111354795.2A priority Critical patent/CN114071175B/en
Publication of CN114071175A publication Critical patent/CN114071175A/en
Application granted granted Critical
Publication of CN114071175B publication Critical patent/CN114071175B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26208Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints
    • H04N21/26241Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints involving the time of distribution, e.g. the best time of the day for inserting an advertisement or airing a children program
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/835Generation of protective data, e.g. certificates
    • H04N21/8352Generation of protective data, e.g. certificates involving content or source identification data, e.g. Unique Material Identifier [UMID]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a memory alignment method of messages, which is used in a server, wherein an ordered queue is configured in a memory of the server and is used for temporarily storing each play message according to time sequence; the method comprises the following steps: acquiring a new play message, wherein the new play message is associated with a target anchor identifier of a target anchor; judging whether a target play message associated with the target anchor identifier exists in the ordered queue; and adding the new play message to the ordered queue according to the judging result, or discarding the new play message. According to the technical scheme, a large number of invalid play messages can be effectively avoided, and state errors in a live broadcast system are avoided.

Description

Method and system for aligning internal memory of message
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method, a system, a computer device, and a computer readable storage medium for aligning a memory of a message.
Background
With the rapid development of internet technology, network live broadcast is beginning to be widely used. Among them, network live broadcast generally involves: the system comprises a live broadcast platform, a live broadcast terminal and a spectator terminal, wherein the live broadcast terminal can provide multimedia content (such as video content) for the spectator terminal through the live broadcast platform, and can also receive the multimedia content (such as comment content) provided by the spectator terminal through the live broadcast platform, so that the effect of live broadcast and interaction is realized. Because of the strong live and interactive nature of webcasting, webcasting is favored by more and more audiences and anchor.
In live systems, it is often necessary to trigger some tasks, such as data statistics, transcoding, or scheduling, etc., based on-air messages/off-air messages. However, the present inventors have found that, due to factors such as stability of the network environment, a plurality of open messages and close messages are easily generated in a short time at the initial stage of pushing data by each anchor terminal. The large amount of on-demand messages/off-demand messages generated in a short time can easily cause errors in the internal state of the live broadcast system.
Disclosure of Invention
In view of the foregoing, it is an object of embodiments of the present application to provide a method, a system, a computer device, and a computer readable storage medium for memory alignment of messages, which can solve the above-mentioned problems.
An aspect of the embodiments of the present application provides a method for aligning a memory of a message, which is used in a server, where an ordered queue is configured in a memory of the server, and the ordered queue is used for temporarily storing each play message according to a time sequence; the method comprises the following steps:
acquiring a new play message, wherein the new play message is associated with a target anchor identifier of a target anchor;
judging whether a target play message associated with the target anchor identifier exists in the ordered queue;
and adding the new playing message to the ordered queue according to the judging result, or discarding the new playing message.
Optionally, the adding the new play message to the ordered queue or discarding the new play message according to the determination result includes:
and if the target playing message does not exist in the ordered queue, adding the new playing message into the ordered queue.
Optionally, the new play message is a new open play message;
and adding the new play message to the ordered queue or discarding the new play message according to the judging result, wherein the method comprises the following steps:
and discarding the new playing message if the target playing message exists in the ordered queue.
Optionally, the new play message is a new play-off message;
and adding the new play message to the ordered queue or discarding the new play message according to the judging result, wherein the method comprises the following steps:
and discarding the new playing message if the target playing message exists in the ordered queue and the target playing message is a target broadcasting-off message.
Optionally, the new play message is a new play-off message;
and adding the new play message to the ordered queue or discarding the new play message according to the judging result, wherein the method comprises the following steps:
and if the target playing message exists in the ordered queue and the target playing message is a target playing message, discarding the new playing message and deleting the target playing message from the ordered queue.
Optionally, the new play message is a new open play message;
and adding the new play message to the ordered queue or discarding the new play message according to the judging result, wherein the method comprises the following steps:
and if the target playing message exists in the ordered queue and the target playing message is a target broadcasting-off message, discarding the new playing message and deleting the target playing message from the ordered queue.
Optionally, the method further comprises:
and taking out part of the playing information from the ordered queue, wherein the part of the playing information is information which is temporarily stored in the ordered queue and exceeds a preset time length, and the preset time length is dynamically adjusted along with the length of the ordered queue.
Optionally, the method further comprises: each play message in the ordered queue is scanned for status correction.
An aspect of the embodiments of the present application further provides a memory alignment system for messages, which is used in a server, where an ordered queue is configured in a memory of the server, and the ordered queue is used for temporarily storing each play message according to a time sequence; the system comprises:
the acquisition module is used for acquiring a new play message, wherein the new play message is associated with a target anchor identifier of a target anchor;
the judging module is used for judging whether the target play message associated with the target anchor identifier exists in the ordered queue; a kind of electronic device with high-pressure air-conditioning system
And the message processing module is used for adding the new playing message into the ordered queue or discarding the new playing message according to the judging result.
An aspect of the embodiments of the present application further provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor for implementing the steps of the memory alignment method of messages as described above when the computer program is executed by the processor.
An aspect of the embodiments of the present application further provides a computer-readable storage medium having stored thereon a computer program executable by at least one processor to cause the at least one processor to perform the steps of a memory alignment method for messages as described above.
The memory alignment method, system, equipment and computer readable storage medium for the message provided by the embodiment of the application have the following technical advantages:
and searching whether the play message of the related anchor exists in the ordered queue or not every time a new play message is acquired. If the ordered queue already has a play message of the relevant anchor, it is indicated that the new play message and the play message before the anchor are generated consecutively in a short time, i.e. the new play message is likely to be an invalid message generated by the anchor terminal due to network instability when the anchor terminal just starts pushing data. Therefore, the new playing information is discarded, so that the memory alignment of one-time information is realized, and the internal state error of the live broadcast system caused by invalid information is avoided.
Drawings
Fig. 1 schematically illustrates an application environment diagram of a memory alignment method of a message according to an embodiment of the present application;
fig. 2 schematically illustrates a flowchart of a method for memory alignment of a message according to an embodiment of the present application;
FIG. 3 schematically illustrates enqueue, dequeue schematics for an ordered queue;
fig. 4 schematically shows a sub-flowchart of step S204 in fig. 2;
fig. 5 schematically shows a sub-flowchart of step S204 in fig. 2;
fig. 6 schematically shows a sub-flowchart of step S204 in fig. 2;
fig. 7 schematically shows a sub-flowchart of step S204 in fig. 2;
fig. 8 schematically shows a sub-flowchart of step S204 in fig. 2;
fig. 9 is a flowchart schematically illustrating the additional steps of a method for memory alignment of a message according to the first embodiment of the present application;
fig. 10 schematically illustrates a flowchart of the new steps of the memory alignment method of the message according to the first embodiment of the present application;
FIG. 11 schematically illustrates a block diagram of a memory alignment system for messages according to a second embodiment of the present application;
fig. 12 schematically illustrates a hardware architecture diagram of a computer device adapted to implement a memory alignment method for messages according to a third embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be noted that the descriptions of "first," "second," etc. in the embodiments of the present application are for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be regarded as not exist and not within the protection scope of the present application.
In the description of the present application, it should be understood that the numerical references before the steps do not identify the order of performing the steps, but are only used for convenience in describing the present application and distinguishing each step, and thus should not be construed as limiting the present application.
Webcasting generally involves: the system comprises a live broadcast platform, a live broadcast terminal and a spectator terminal, wherein the live broadcast terminal can provide multimedia content (such as video content) for the spectator terminal through the live broadcast platform, and can also receive the multimedia content (such as comment content) provided by the spectator terminal through the live broadcast platform, so that the effect of live broadcast and interaction is realized. Because of the strong live and interactive nature of webcasting, webcasting is favored by more and more audiences and anchor.
In live broadcast systems, it is often necessary to trigger tasks such as data statistics, transcoding (based on picture optimization of video data pushing the anchor), or scheduling, etc., based on-off messages. However, the present inventors found that several open messages and close messages are easily generated in a short time at the initial stage of data push by each anchor terminal due to factors such as stability of network environment (this is because anchor terminals are always unstable at the beginning of data push). The large amount of on-demand messages/off-demand messages generated in a short time can easily cause errors in the internal state of the live broadcast system. It also does not know which message to use as a valid message (e.g., transcoding, a large number of on/off messages in a short time would crash the transcoding task) due to an internal state error in the live system.
In summary, the live broadcast system currently has the following problems: at the initial stage of data pushing by the anchor terminal, since the network is generally unstable, a large number of invalid on/off-cast messages are generated, which leads to errors in the internal state of the live broadcast system.
The inventors have found a solution that scans the full data at regular time intervals to correct errors continuously. But this solution can result in state correction for some errors not being timely enough and full scan can consume a significant amount of server performance.
The application provides a technical scheme which solves the problem of error of the internal state of a live broadcast system on the premise of not excessively consuming.
First, a term explanation is provided in relation to the present application:
ordered queue: data arranged in a certain order.
Next, for ease of understanding, a system architecture diagram of a live broadcast system is provided. As shown in fig. 1, the live broadcast system includes a hosting terminal (e.g., 2A, 2B, …), a viewer terminal (e.g., 4A, 4B, …), and a server 6. The anchor terminal 2A, 2B, … may provide live data to the viewer terminal 4A, 4B, … via the server 6.
The anchor terminals 2A, 2B, … are configured to collect and encode live broadcast pictures on the anchor side, and push the collected and encoded live broadcast data to the server 6. Wherein the live data may comprise audio data or video data or a combination of both. The anchor terminals 2A, 2B, … may be electronic devices such as smartphones, tablet computers, etc. The anchor terminals 2A, 2B, … may comprise an anchor APP for generating and pushing live data and receiving interactive information.
The audience terminals 4A, 4B, … may be configured to receive live data of the anchor terminals 2A, 2B, … in real time. The audience terminals 4A, 4B, … may be any type of computing device, such as smartphones, tablet devices, laptop computers, set-top boxes, smart televisions, etc. In particular use, the viewer terminal 4A, 4B, … may incorporate a browser or special program through which the live data is received to output content to the user. Wherein the content may include video, audio, comments, text data, and/or the like.
The audience terminals 4A, 4B, … may include interfaces that may include input elements. For example, the input element may be configured to receive user instructions that may cause the audience terminal to perform various types of operations.
The anchor terminal 2A, 2B, … and the audience terminal 4A, 4B, …, respectively, may establish a network connection with the server 6 via one or more networks. By way of example, the one or more networks may include various network devices such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and/or the like. The one or more networks may include physical links, such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and/or the like. The one or more networks may include wireless links, such as cellular links, satellite links, wi-Fi links, and/or the like.
The server 6 is an interaction medium between the anchor terminals 2A, 2B, … and the audience terminals 4A, 4B, … for push, pull, bullet screen interaction, etc., and may be a rack server, a blade server, a tower server, or a cabinet server (including a stand-alone server, or a server cluster composed of multiple servers), etc.
Based on the above-mentioned exemplary system architecture, the memory alignment scheme of the message provided in the embodiment of the present application will be specifically described below.
Example 1
The present embodiment may be executed in the server 6. An ordered queue is configured in the memory of the server 6, and the ordered queue is used for temporarily storing each play message according to the time sequence. The ordered queue may be a first-in-first-out queue.
Fig. 2 schematically illustrates a flowchart of a method for memory alignment of a message according to an embodiment of the present application.
As shown in fig. 2, the memory alignment method of the message may include steps S200 to S204, wherein:
step S200, a new play message is acquired, wherein the new play message is associated with a target anchor identifier of a target anchor.
Step S202, judging whether a target play message associated with the target anchor identifier exists in the ordered queue.
Step S204, adding the new playing information to the ordered queue or discarding the new playing information according to the judging result.
The new play message is the currently latest acquired play message, and the play message does not determine whether to be added into the ordered queue.
The target play message is a play message in the ordered queue and having a specific characteristic, such as a play message having a target play identifier.
In this embodiment, whether a play message with a target play identifier exists in the ordered queue determines whether a new play message with the target play identifier can be added to the ordered queue, so as to prevent two or more play messages with the same play identifier from simultaneously existing in the ordered queue.
The target playing identifier, which is used for representing or distinguishing the anchor, can be various identifiers such as anchor number, anchor name and the like.
In this embodiment, the server 6 may allocate live channels (live rooms) for each main broadcast, and collect play messages of each live room to monitor whether each live room is in a live state, for example: entering or exiting a live state.
The playing information of each live broadcasting room comprises the following steps: open-cast message and close-cast message. Wherein:
open-cast message: events generated when a link is established with the server 6 when live broadcast is played by the anchor.
And (5) closing a broadcast message: events generated when the live broadcast is disconnected from the server 6 when the live broadcast pushes live broadcast data.
Based on the play messages (on-air messages, off-air messages) of the respective living room, the server 6 may trigger tasks such as data statistics, transcoding (picture optimization based on the video data pushed by the main cast), or scheduling etc.
Since the anchor terminal is usually unstable when it starts pushing data, the following problems may result: at the initial stage of pushing data by each anchor terminal, a plurality of open messages and close messages are easy to generate in a short time. The large amount of on-demand messages/off-demand messages generated in a short time can easily cause errors in the internal state of the live broadcast system.
For this purpose, the server 6 is provided with an ordered queue through which memory latency alignment is performed to solve such problems.
As shown in fig. 3, the server 6 temporarily stores the play message of each anchor terminal through the ordered queue, and performs memory message alignment. The playing information of each anchor terminal can be added into the ordered queue in turn according to the sequence of the information generation time. The earlier messages are generated, the earlier they are added to the ordered queue.
Taking the anchor terminal 2A as an example:
when the anchor terminal 2A starts pushing data, a plurality of open messages and close messages may be generated due to the influence of the network or the like. It is apparent that there are a large number of invalid messages among the plurality of open/close messages generated in the short time.
Thus, each time a new play message a' associated with the anchor terminal 2A is obtained, the server 6 operates as follows:
(1) Judging whether a target playing message A associated with the anchor terminal 2A exists in the ordered queue;
(2) Since the ordered queue can only temporarily store each play message for a short period of time, if the ordered queue has play messages associated with the anchor terminal 2A, it is indicated that the new play message a' and the target play message a are generated consecutively for a short period of time. Thus, the new play message a' may be discarded without being added to the ordered queue.
Discarding a play-once message may be referred to as memory alignment of a play-once message.
In summary, the method for aligning the memory of the message provided in the embodiment of the present application includes the following advantages:
(1) Whenever a new play message is acquired by the server 6, it will look up whether there is a play message of the relevant anchor from the ordered queue. If the ordered queue already has a play message of the relevant anchor, it is indicated that the new play message and the play message before the anchor are generated consecutively in a short time, i.e. the new play message is likely to be an invalid message generated by the anchor terminal due to network instability when the anchor terminal just starts pushing data. Therefore, the server 6 can discard the new play message, thereby realizing the memory alignment of one message.
Based on the memory alignment of the messages, a large number of invalid play messages can be effectively avoided, and state errors in a live broadcast system are avoided.
(2) Because a large number of invalid play messages are effectively avoided, the service of the server is ensured to be more stable as a whole.
(3) The present embodiment can maintain stability of service with less resources and greater limitation by discarding invalid play messages than if each message was valid by default and then dependent on timed task repair data and associated task status.
Several alternative embodiments are provided below.
As an alternative embodiment, as shown in fig. 4, the step S204 may include: step S400, if the target playing message does not exist in the ordered queue, adding the new playing message to the ordered queue.
It should be noted that the new play message may be added according to a time sequence.
If the target playing message does not exist in the ordered queue, the message to be added is not invalid message which is generated repeatedly due to unstable network. Thus, the new play message may be added to the ordered queue. The new play message is temporarily stored in the ordered queue and can be co-verified in conjunction with the subsequent play message of the associated anchor: whether the new play message and the subsequent play message belong to the repeatedly generated invalid message. If it is determined that the new play message does not belong to an invalid message, but is a stable message (valid message), the new play message can be used for task triggering.
As an alternative embodiment, the new play message is a new open play message. As shown in fig. 5, the step S204 may include: step S500, discarding the new play message if the target play message exists in the ordered queue. In this embodiment, when the new play message is a new open play message and the target play message exists in the ordered queue, the new play message is directly discarded, so as to implement memory alignment.
As an alternative embodiment, the new play message is a new play-related message. As shown in fig. 6, the step S204 may include: step S600, if the target play message exists in the ordered queue and the target play message is a target play-off message, discarding the new play message. In this embodiment, if the new play message is a new broadcast-related message and the target broadcast-related message exists in the ordered queue, it is indicated that a plurality of broadcast-related messages are generated in a short time, so that the new play message is directly discarded, and memory alignment is implemented.
As an alternative embodiment, the new play message is a new play-related message. As shown in fig. 7, the step S204 may include: step S700, if the target play message exists in the ordered queue and the target play message is a target open play message, discarding the new play message, and deleting the target play message from the ordered queue. In this embodiment, if the new play message is a new multicast-related message and the target multicast message exists in the ordered queue, it is indicated that the network of the target anchor is unstable, so that the multicast message and the multicast-related message are generated continuously in a short time. Thus, server 6 may discard the new play message directly and delete the target multicast message from the ordered queue. And as the new play message is discarded and the target multicast message is deleted, the cancellation of the message is realized. The cancellation of the messages not only discards the new play messages which do not enter the queue, but also deletes the target play messages in the queue, so that invalid task triggering can be further reduced, and the stability of the service is improved.
As an alternative embodiment, the new play message is a new open play message. As shown in fig. 8, the step S204 may include: step S800, if the target play message exists in the ordered queue and the target play message is a target play-off message, discarding the new play message and deleting the target play message from the ordered queue. In this embodiment, if the new play message is a new open play message and the target broadcast-related message exists in the ordered queue, it is indicated that the network of the target anchor is unstable, so that broadcast-related messages and open play messages are generated in a short time. Thus, the server 6 may discard the new play message directly and delete the target multicast message from the ordered queue. And as the new playing message is discarded, the target related playing message is deleted, namely the cancellation of the message is realized. The cancellation of the message not only discards the new play message which does not enter the queue, but also deletes the target broadcast-off message in the queue, thereby further reducing invalid task trigger and improving the stability of service.
As an alternative embodiment, as shown in fig. 9, the method further includes:
step 900, taking out a part of play information from the ordered queue, wherein the part of play information is information which is temporarily stored in the ordered queue and exceeds a preset time length, and the preset time length is dynamically adjusted along with the queue length of the ordered queue.
The partial play message is fetched, i.e. the partial play message is fetched from the queue and can be used to trigger various tasks or to perform subsequent processing based on the play message.
The server 6 may start a thread by which part of the play message is fetched from the ordered queue. For example, if a play message is buffered for more than X seconds in the ordered queue, the play message may be considered a stable message. That is, the ordered queue ensures that only one open or close message will be generated by the same anchor within X seconds, since redundant messages are all discarded (ignored), resulting in a significant increase in service stability. X is dynamically adjusted according to the length of the ordered queue, and if the ordered queue is currently lengthened, X can be adaptively reduced, so that the processing speed of the message is increased.
As an alternative embodiment, as shown in fig. 10, the method further includes:
step S1000, scanning each play message in the ordered queue for status correction. And the service is more stable as a whole by delaying triggering through the ordered queue and removing a large number of invalid messages before triggering tasks. In this embodiment, the situation of inaccurate remaining states continues to adopt full-scale scan error correction, so as to further reduce state errors.
Example two
Fig. 11 schematically illustrates a block diagram of a memory alignment system for messages according to a second embodiment of the present application, where the memory alignment system for messages is used in a server, and an ordered queue is configured in a memory of the server, where the ordered queue is used to temporarily store each play message according to a chronological order. The memory alignment system for messages may be partitioned into one or more program modules, which are stored in a storage medium and executed by one or more processors to perform embodiments of the present application. Program modules in the embodiments of the present application refer to a series of computer program instruction segments capable of implementing specific functions, and the following description specifically describes the functions of each program module in the embodiment.
As shown in fig. 11, the memory alignment system 1100 of the message may include an acquisition module 1110, a determination module 1120, and a message processing module 1130, where:
an obtaining module 1110, configured to obtain a new play message, where the new play message is associated with a target anchor identifier of a target anchor;
a judging module 1120, configured to judge whether a target play message associated with the target anchor identifier exists in the ordered queue; a kind of electronic device with high-pressure air-conditioning system
And the message processing module 1130 is configured to add the new play message to the ordered queue or discard the new play message according to the determination result.
As an optional embodiment, the message processing module 1130 is further configured to:
and if the target playing message does not exist in the ordered queue, adding the new playing message into the ordered queue.
As an optional embodiment, the new play message is a new open play message;
the message processing module 1130 is further configured to:
and discarding the new playing message if the target playing message exists in the ordered queue.
As an optional embodiment, the new play message is a new play-related message;
the message processing module 1130 is further configured to:
and discarding the new playing message if the target playing message exists in the ordered queue and the target playing message is a target broadcasting-off message.
As an optional embodiment, the new play message is a new play-related message;
the message processing module 1130 is further configured to:
and if the target playing message exists in the ordered queue and the target playing message is a target playing message, discarding the new playing message and deleting the target playing message from the ordered queue.
As an optional embodiment, the new play message is a new open play message;
the message processing module 1130 is further configured to:
and if the target playing message exists in the ordered queue and the target playing message is a target broadcasting-off message, discarding the new playing message and deleting the target playing message from the ordered queue.
As an alternative embodiment, the system further comprises a dequeue module (not identified) for:
and taking out part of the playing information from the ordered queue, wherein the part of the playing information is information which is temporarily stored in the ordered queue and exceeds a preset time length, and the preset time length is dynamically adjusted along with the length of the ordered queue.
As an alternative embodiment, the system further comprises a scanning module (not identified) for:
each play message in the ordered queue is scanned for status correction.
Example III
Fig. 12 schematically illustrates a hardware architecture diagram of a computer device adapted to implement a memory alignment method for messages according to a third embodiment of the present application. The computer device 10000 may be a server 6 or an integral part of the server 6. In this embodiment, the computer device 10000 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and may be, for example, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster formed by a plurality of servers), or the like. As shown in fig. 12, the computer device 10000 includes at least, but is not limited to: the memory 10010, processor 10020, network interface 10030 may be communicatively linked to each other via a system bus. Wherein:
memory 10010 includes at least one type of computer-readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, memory 10010 may be an internal storage module of computer device 10000, such as a hard disk or memory of computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like. Of course, the memory 10010 may also include both an internal memory module of the computer device 10000 and an external memory device thereof. In this embodiment, the memory 10010 is typically used for storing an operating system installed on the computer device 10000 and various application software, such as program codes of a memory alignment method of a message. In addition, the memory 10010 may be used to temporarily store various types of data that have been output or are to be output.
The processor 10020 may be a central processing unit (Central Processing Unit, simply CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 10020 is typically configured to control overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is configured to execute program codes or process data stored in the memory 10010.
The network interface 10030 may comprise a wireless network interface or a wired network interface, which network interface 10030 is typically used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, establish a data transmission channel and a communication link between the computer device 10000 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, abbreviated as GSM), wideband code division multiple access (Wideband Code Division Multiple Access, abbreviated as WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc.
It should be noted that fig. 12 only shows a computer device having components 10010-10030, but it should be understood that not all of the illustrated components are required to be implemented, and more or fewer components may be implemented instead.
In this embodiment, the memory alignment method of the message stored in the memory 10010 may be further divided into one or more program modules and executed by one or more processors (the processor 10020 in this embodiment) to complete the present application.
Example IV
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the memory alignment method of messages in the embodiment.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. that are provided on the computer device. Of course, the computer-readable storage medium may also include both internal storage units of a computer device and external storage devices. In this embodiment, the computer readable storage medium is typically used to store an operating system installed on a computer device and various application software, such as program code of a memory alignment method of a message in the embodiment. Furthermore, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (10)

1. The method is characterized in that the method is used in a server, an ordered queue is configured in the memory of the server, the ordered queue is used for temporarily storing playing messages in a short time according to time sequence, the playing messages in the short time comprise a plurality of playing messages generated by an anchor terminal due to unstable network when the anchor terminal just starts to push data, and the playing messages comprise an open playing message and a close playing message; the method comprises the following steps:
acquiring a new play message, wherein the new play message is associated with a target anchor identifier of a target anchor;
judging whether a target play message associated with the target anchor identifier exists in the ordered queue;
adding the new play message to the ordered queue according to the judging result, or discarding the new play message;
wherein adding the new play message to the ordered queue or discarding the new play message according to the judgment result includes:
if the target playing information does not exist in the ordered queue, adding the new playing information into the ordered queue;
and discarding the new playing message if the target playing message exists in the ordered queue.
2. The method for aligning a memory of a message according to claim 1, wherein the newly played message is a newly opened message;
and if the target playing message exists in the ordered queue, discarding the new playing message, including:
and discarding the new playing message if the target playing message exists in the ordered queue.
3. The method for aligning a memory of a message according to claim 1, wherein the new play message is a new play-related message;
and if the target playing message exists in the ordered queue, discarding the new playing message, including:
and discarding the new playing message if the target playing message exists in the ordered queue and the target playing message is a target broadcasting-off message.
4. The method for aligning a memory of a message according to claim 1, wherein the new play message is a new play-related message;
and if the target playing message exists in the ordered queue, discarding the new playing message, including:
and if the target playing message exists in the ordered queue and the target playing message is a target playing message, discarding the new playing message and deleting the target playing message from the ordered queue.
5. The method for aligning a memory of a message according to claim 1, wherein the newly played message is a newly opened message;
and if the target playing message exists in the ordered queue, discarding the new playing message, including:
and if the target playing message exists in the ordered queue and the target playing message is a target broadcasting-off message, discarding the new playing message and deleting the target playing message from the ordered queue.
6. The method for memory alignment of a message according to any of claims 1 to 5, further comprising:
and taking out part of the playing information from the ordered queue, wherein the part of the playing information is information which is temporarily stored in the ordered queue and exceeds a preset time length, and the preset time length is dynamically adjusted along with the length of the ordered queue.
7. The method for memory alignment of a message according to any of claims 1 to 5, further comprising:
each play message in the ordered queue is scanned for status correction.
8. The memory alignment system of the message is characterized in that the memory alignment system is used in a server, an ordered queue is configured in a memory of the server, the ordered queue is used for temporarily storing playing messages in a short time according to time sequence, the playing messages in the short time comprise a plurality of playing messages generated by an anchor terminal due to unstable network when the anchor terminal just starts to push data, and the playing messages comprise an open playing message and a close playing message; the system comprises:
the acquisition module is used for acquiring a new play message, wherein the new play message is associated with a target anchor identifier of a target anchor;
the judging module is used for judging whether the target play message associated with the target anchor identifier exists in the ordered queue; a kind of electronic device with high-pressure air-conditioning system
The message processing module is used for adding the new play message to the ordered queue or discarding the new play message according to the judging result;
wherein the message processing module is further configured to:
if the target playing information does not exist in the ordered queue, adding the new playing information into the ordered queue;
and discarding the new playing message if the target playing message exists in the ordered queue.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program for performing the steps of the memory alignment method of a message according to any of claims 1 to 7.
10. A computer readable storage medium having stored therein a computer program executable by at least one processor to cause the at least one processor to perform the steps of the memory alignment method of messages according to any of claims 1 to 7.
CN202111354795.2A 2021-11-16 2021-11-16 Method and system for aligning internal memory of message Active CN114071175B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111354795.2A CN114071175B (en) 2021-11-16 2021-11-16 Method and system for aligning internal memory of message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111354795.2A CN114071175B (en) 2021-11-16 2021-11-16 Method and system for aligning internal memory of message

Publications (2)

Publication Number Publication Date
CN114071175A CN114071175A (en) 2022-02-18
CN114071175B true CN114071175B (en) 2023-07-25

Family

ID=80273127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111354795.2A Active CN114071175B (en) 2021-11-16 2021-11-16 Method and system for aligning internal memory of message

Country Status (1)

Country Link
CN (1) CN114071175B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915608A (en) * 2016-04-19 2016-08-31 上海卓易科技股份有限公司 Online and offline notification system and method for communication among equipment
CN109640130A (en) * 2017-10-09 2019-04-16 武汉斗鱼网络科技有限公司 One kind starts broadcasting information push method, server and readable storage medium storing program for executing
CN110191348A (en) * 2018-02-23 2019-08-30 武汉斗鱼网络科技有限公司 The processing method and processing device of interactive message in net cast

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019197B (en) * 2017-09-28 2021-07-30 武汉斗鱼网络科技有限公司 Data writing method, device, server and medium
CN107809494B (en) * 2017-12-14 2021-01-26 深圳市斑点猫信息技术有限公司 Message delay pushing method and system thereof
CN110971939B (en) * 2018-09-30 2022-02-08 武汉斗鱼网络科技有限公司 Illegal picture identification method and related device
CN110856016A (en) * 2019-11-18 2020-02-28 百度在线网络技术(北京)有限公司 Video live broadcast monitoring method and device, electronic equipment and storage medium
CN111277847B (en) * 2020-01-21 2022-02-25 卓米私人有限公司 Method, device, server and system for displaying chat messages in live broadcast
CN113259697B (en) * 2021-05-12 2022-04-08 腾讯科技(深圳)有限公司 Live broadcast state notification method, related device, equipment and storage medium
CN113596501A (en) * 2021-07-30 2021-11-02 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915608A (en) * 2016-04-19 2016-08-31 上海卓易科技股份有限公司 Online and offline notification system and method for communication among equipment
CN109640130A (en) * 2017-10-09 2019-04-16 武汉斗鱼网络科技有限公司 One kind starts broadcasting information push method, server and readable storage medium storing program for executing
CN110191348A (en) * 2018-02-23 2019-08-30 武汉斗鱼网络科技有限公司 The processing method and processing device of interactive message in net cast

Also Published As

Publication number Publication date
CN114071175A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
US11356748B2 (en) Method, apparatus and system for slicing live streaming
CN109089130B (en) Method and device for adjusting timestamp of live video
CN108174226B (en) Transcoding device and method for live video and computer readable storage medium
CN111555963A (en) Message pushing method and device, electronic equipment and storage medium
CN112437329B (en) Method, device and equipment for playing video and readable storage medium
CN112188225A (en) Bullet screen issuing method for live broadcast playback and live broadcast video bullet screen playback method
CN106488273A (en) A kind of method and apparatus of transmission live video
US11863841B2 (en) Video playing control method and system
CN108174267B (en) Device and method for sending interactive information in live broadcast and computer readable storage medium
US11706498B2 (en) Playback method, system, device and readable storage medium of live broadcast content
CN111031376B (en) Bullet screen processing method and system based on WeChat applet
CN110620699B (en) Message arrival rate determination method, device, equipment and computer readable storage medium
CN112312162B (en) Video server for transmitting video stream
CN110022335B (en) Data packet transmitting method, device, server and computer readable storage medium
CN111726641A (en) Live video playing processing method and device and server
CN114071175B (en) Method and system for aligning internal memory of message
CN107124660B (en) Method and device for triggering broadcast information of live broadcast room
CN113360783B (en) User online list updating method and device and computer equipment
US20190227866A1 (en) Information processing device and method
CN113965797A (en) Live broadcast room switching method and system
CN111224756B (en) Method and device for determining data transmission abnormity, storage medium and electronic equipment
CN115278339A (en) Mixed broadcast processing method and system
CN110545237A (en) Instant messaging method, device, system, computer equipment and storage medium
CN110557453A (en) data distribution method, device, equipment and storage medium
CN112511884A (en) Mixed flow control method and system of audio and video stream and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant