Disclosure of Invention
Aiming at the defects or the improvement requirements in the prior art, the invention provides a display scheme of a live broadcast room in a live broadcast platform, and aims to enable the display of the live broadcast room to be dynamically changed, so that the technical problem that the live broadcast room displayed in the prior art is not changed for a long time is solved.
To achieve the above object, according to an aspect of the present invention, there is provided a method for displaying a live broadcast room in a live broadcast platform, including:
acquiring a set of live broadcast rooms to be displayed; the live broadcast room set comprises at least one live broadcast room category, each live broadcast room category comprises at least one live broadcast room column, and each live broadcast room column comprises at least one live broadcast room;
and circularly displaying the live broadcast rooms in the live broadcast room set at corresponding live broadcast room display positions according to the preset number of the live broadcast room categories to be displayed, the number of the live broadcast room columns to be displayed under each live broadcast room category and the number of the live broadcast rooms to be displayed under each live broadcast room column.
In an embodiment of the present invention, the circularly displaying live broadcast rooms in the live broadcast room set at corresponding live broadcast room display positions according to preset live broadcast room category number to be displayed, live broadcast room column number to be displayed under each live broadcast room category, and live broadcast room number to be displayed under each live broadcast room column, specifically includes:
acquiring a live broadcast room list, a display room list and a displayed room list in the live broadcast room set to be displayed, wherein the live broadcast room list is a room list in a live broadcast state at present, the display room list is a room list in which a room display position is currently displayed, and the displayed room list is a room list in which the display is completed in the room display position;
judging whether a room currently being displayed in the room list being displayed is expired or changed into a non-live broadcast state, if so, deleting the room currently being displayed from the room list being displayed and adding the room currently being displayed into the room list being displayed, and taking out a first number of rooms from the room list being displayed in a live broadcast manner and adding the rooms into the room list being displayed to generate a new room list being displayed; the room currently being displayed is expired, namely the display time length of the room currently being displayed exceeds a set display time length threshold value, and the number of rooms in the new room list being displayed is less than or equal to the number of live broadcast rooms to be displayed;
and displaying the rooms in the new room-being-displayed list at the corresponding live room display positions.
In an embodiment of the present invention, the method for displaying a live broadcast room in a live broadcast platform further includes: if the live broadcasting room list under a certain live broadcasting column is empty, deleting the live broadcasting room list, the displaying room list and the displayed room list under the column; and if the live broadcasting room lists under all the live broadcasting columns in a certain live broadcasting category are all empty, deleting all the live broadcasting room lists, the displaying room lists and the displayed room lists under all the live broadcasting columns in the live broadcasting category.
In an embodiment of the present invention, the acquiring a set of live broadcast rooms to be displayed specifically includes: and taking out N live broadcast rooms with the highest popularity value in the live broadcast room set to form a live broadcast room set to be displayed, wherein the live broadcast room set is a set of all rooms in a live broadcast state in a live broadcast platform, or a set of rooms in a live broadcast state recommended by the live broadcast platform, and N is a preset value.
In an embodiment of the present invention, the preset number of categories of live broadcast rooms to be displayed, the number of columns of live broadcast rooms to be displayed under each category of live broadcast rooms, and the number of live broadcast rooms to be displayed under each column of live broadcast rooms are fixed values, or values dynamically set in a display process.
According to another aspect of the present invention, there is also provided a display apparatus for live broadcasting rooms in a live broadcasting platform, including a to-be-displayed live broadcasting room set acquisition module and a live broadcasting room display module, wherein:
the to-be-displayed live broadcast room set acquisition module is used for acquiring a to-be-displayed live broadcast room set; the live broadcast room set comprises at least one live broadcast room category, each live broadcast room category comprises at least one live broadcast room column, and each live broadcast room column comprises at least one live broadcast room;
and the live broadcast room display module is used for circularly displaying the live broadcast rooms in the live broadcast room set at corresponding live broadcast room display positions according to the preset number of the live broadcast room categories to be displayed, the number of the live broadcast room columns to be displayed under each live broadcast room category and the number of the live broadcast rooms to be displayed under each live broadcast room column.
In an embodiment of the present invention, the live broadcast room display module specifically includes a list acquisition sub-module, a list update sub-module, and a live broadcast room display sub-module, where:
the list obtaining submodule is used for obtaining a live broadcasting room list, a displaying room list and a displayed room list in the live broadcasting room set to be displayed, wherein the live broadcasting room list is a room list in a live broadcasting state at present, the displaying room list is a room list which is displayed at a room display position at present, and the displayed room list is a room list which is displayed at the room display position;
the list updating submodule is used for judging whether a room currently displayed in the room list being displayed is expired or is changed into a non-live broadcast state, if so, deleting the room currently displayed in the room list being displayed from the room list being displayed and adding the room currently displayed in the room list being displayed, and taking out a first number of rooms from the room list being live broadcast and adding the rooms into the room list being displayed to generate a new room list being displayed; the room currently being displayed is expired, namely the display time length of the room currently being displayed exceeds a set display time length threshold value, and the number of rooms in the new room list being displayed is less than or equal to the number of live broadcast rooms to be displayed;
and the live broadcast room display submodule is used for displaying the new room in the display room list at the corresponding live broadcast room display position.
In an embodiment of the present invention, the live room display module further includes a list deletion sub-module, which is specifically configured to: if the live broadcasting room list under a certain live broadcasting column is empty, deleting the live broadcasting room list, the displaying room list and the displayed room list under the column; and if the live broadcasting room lists under all the live broadcasting columns in a certain live broadcasting category are all empty, deleting all the live broadcasting room lists, the displaying room lists and the displayed room lists under all the live broadcasting columns in the live broadcasting category.
In an embodiment of the present invention, the to-be-displayed live broadcast room set acquiring module is specifically configured to: and taking out N live broadcast rooms with the highest popularity value in the live broadcast room set to form a live broadcast room set to be displayed, wherein the live broadcast room set is a set of all rooms in a live broadcast state in a live broadcast platform, or a set of rooms in a live broadcast state recommended by the live broadcast platform, and N is a preset value.
In an embodiment of the present invention, the preset number of categories of live broadcast rooms to be displayed, the number of columns of live broadcast rooms to be displayed under each category of live broadcast rooms, and the number of live broadcast rooms to be displayed under each column of live broadcast rooms are fixed values, or values dynamically set in a display process.
In the embodiment of the invention, the live broadcast rooms in the live broadcast room set are circularly displayed at the display positions of the corresponding live broadcast rooms according to the preset number of the categories of the live broadcast rooms to be displayed, the number of the columns of the live broadcast rooms to be displayed under each category of the live broadcast rooms and the number of the live broadcast rooms to be displayed under each column of the live broadcast rooms. Therefore, a dynamic live broadcast room display scheme is provided, and the displayed live broadcast room can be dynamically changed. The defect that the live broadcast room displayed in the prior art is not changed greatly for a long time is overcome, the defect of artificial interference on display of the live broadcast room is also avoided, and a fairer and more reasonable scheme is provided for display of the live broadcast room in the live broadcast platform.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
As shown in fig. 1, the present invention provides a method for displaying live broadcast rooms in a live broadcast platform, including:
s1, acquiring a set of live broadcast rooms to be displayed; the live broadcast room set comprises at least one live broadcast room category, each live broadcast room category comprises at least one live broadcast room column, and each live broadcast room column comprises at least one live broadcast room;
in the embodiment of the present invention, the acquiring of the set of live broadcast rooms to be displayed specifically includes: the method includes the steps that N live broadcast rooms with the highest popularity value in a live broadcast room set are taken out to form a live broadcast room set to be displayed, wherein the live broadcast room set is a set of all rooms in a live broadcast state in a live broadcast platform (in the case, all rooms in the live broadcast state in the platform are contained in the set by default), or a set of rooms in the live broadcast state recommended by the live broadcast platform (in the case, the rooms in the set are recommended by staff, users, main broadcasts and the like in the live broadcast platform and are in the live broadcast state), and N is a preset value (for example 100).
The specific implementation can be as follows: sorting the rooms according to the room popularity by using a zAdd technology of redis, and then obtaining and recording the largest popularity of the rooms by using a zRevRange method.
It should be noted that: redis is an open source log-type and Key-Value database which is written by using ANSI C language, supports network, can be based on memory and can also be persistent, and provides API of multiple languages. A description is given of the commands used in the embodiments of the present invention:
zAdd of redis: adding one or more elements and their ranking values to the ordered set;
zRevRange of redis: returning the members in the designated interval in the ordered set;
hset for redis: setting the value of the domain in the hash table combination as a cache;
set of redis: the string values are associated into a set.
And S2, circularly displaying the live broadcast rooms in the live broadcast room set at corresponding live broadcast room display positions according to the preset number of the live broadcast room categories to be displayed, the number of the live broadcast room columns to be displayed under each live broadcast room category and the number of the live broadcast rooms to be displayed under each live broadcast room column.
Specifically, as shown in fig. 2, the step S2 in the embodiment of the present invention includes the following sub-steps:
s21, acquiring a live broadcast room list, a display room list and a displayed room list in the live broadcast room set to be displayed, wherein the live broadcast room list is a room list in a live broadcast state at present, the display room list is a room list displayed at a room display position at present, and the displayed room list is a room list which is displayed at the room display position;
s22, judging whether the room currently being displayed in the room list being displayed is expired or changed into a non-live broadcast state, if so, deleting the room currently being displayed from the room list being displayed and adding the room currently being displayed into the room list being displayed, and taking out a first number of rooms from the room list being live broadcast and adding the rooms into the room list being displayed to generate a new room list being displayed; the room currently being displayed is expired, namely the display time length of the room currently being displayed exceeds a set display time length threshold value, and the number of rooms in the new room list being displayed is less than or equal to the number of live broadcast rooms to be displayed;
further, if the live broadcasting room list under a certain always-broadcasting column is empty, deleting the live broadcasting room list, the displaying room list and the displayed room list under the column; if the live broadcasting room lists under all the live broadcasting columns in a certain live broadcasting type are empty, deleting all the live broadcasting room lists, the displaying room lists and the displayed room lists under all the live broadcasting columns in the live broadcasting type;
further, the preset number of the categories of the live broadcast rooms to be displayed, the number of the columns of the live broadcast rooms to be displayed under each category of the live broadcast rooms and the number of the live broadcast rooms to be displayed under each column of the live broadcast rooms are fixed values or numerical values dynamically set in the display process.
And S23, displaying the new room in the room-displaying list at the corresponding live room display position.
Specifically, as shown in fig. 3, a schematic diagram illustrating an effect of a live room in the embodiment of the present invention is shown. And all the live broadcast room types, the live broadcast room columns in all the live broadcast room types and the live broadcast rooms in all the live broadcast room columns are displayed in a circulating mode.
In the embodiment of the invention, the live broadcast rooms in the live broadcast room set are circularly displayed at the display positions of the corresponding live broadcast rooms according to the preset number of the categories of the live broadcast rooms to be displayed, the number of the columns of the live broadcast rooms to be displayed under each category of the live broadcast rooms and the number of the live broadcast rooms to be displayed under each column of the live broadcast rooms. Therefore, a dynamic live broadcast room display scheme is provided, and the displayed live broadcast room can be dynamically changed. The defect that the live broadcast room displayed in the prior art is not changed greatly for a long time is overcome, the defect of artificial interference on display of the live broadcast room is also avoided, and a fairer and more reasonable scheme is provided for display of the live broadcast room in the live broadcast platform.
Further, as shown in fig. 4, an embodiment of the present invention provides a display apparatus for live broadcasting rooms in a live broadcasting platform, including a to-be-displayed live broadcasting room set obtaining module 1 and a live broadcasting room display module 2, where:
the to-be-displayed live broadcast room set acquisition module 1 is used for acquiring a to-be-displayed live broadcast room set; the live broadcast room set comprises at least one live broadcast room category, each live broadcast room category comprises at least one live broadcast room column, and each live broadcast room column comprises at least one live broadcast room;
specifically, the to-be-displayed live broadcast room set acquisition module is configured to: and taking out N live broadcast rooms with the highest popularity value in the live broadcast room set to form a live broadcast room set to be displayed, wherein the live broadcast room set is a set of all rooms in a live broadcast state in a live broadcast platform, or a set of rooms in a live broadcast state recommended by the live broadcast platform, and N is a preset value.
The live broadcast room display module 2 is used for circularly displaying live broadcast rooms in the live broadcast room set at corresponding live broadcast room display positions according to the preset number of the live broadcast room categories to be displayed, the number of the live broadcast room columns to be displayed under each live broadcast room category and the number of the live broadcast rooms to be displayed under each live broadcast room column;
further, as shown in fig. 5, the live broadcast room display module 2 specifically includes a list obtaining sub-module 21, a list updating sub-module 22, and a live broadcast room display sub-module 23, where:
the list obtaining sub-module 21 is configured to obtain a live broadcasting room list, a displaying room list, and a displayed room list in the live broadcasting room set to be displayed, where the live broadcasting room list is a room list currently in a live broadcasting state, the displaying room list is a room list currently being displayed at a room display position, and the displayed room list is a room list that has been displayed at the room display position;
the list updating submodule 22 is configured to determine whether a room currently being displayed in the room list being displayed is expired or has changed into a non-live broadcast state, delete the room currently being displayed from the room list being displayed and add the room currently being displayed to the room list being displayed if the room currently being displayed is expired or has changed into the non-live broadcast state, and take out a first number of rooms from the room list being live broadcast and add the rooms to the room list being displayed to generate a new room list being displayed; the room currently being displayed is expired, namely the display time length of the room currently being displayed exceeds a set display time length threshold value, and the number of rooms in the new room list being displayed is less than or equal to the number of live broadcast rooms to be displayed;
and the live broadcasting room display submodule 23 is configured to display the new room in the displaying room list at the corresponding live broadcasting room display position.
Further, the live room display module 2 further includes a list deletion submodule 24, specifically configured to: if the live broadcasting room list under a certain live broadcasting column is empty, deleting the live broadcasting room list, the displaying room list and the displayed room list under the column; if the live broadcasting room lists under all the live broadcasting columns in a certain live broadcasting type are empty, deleting all the live broadcasting room lists, the displaying room lists and the displayed room lists under all the live broadcasting columns in the live broadcasting type;
further, the preset number of the categories of the live broadcast rooms to be displayed, the number of the columns of the live broadcast rooms to be displayed under each category of the live broadcast rooms and the number of the live broadcast rooms to be displayed under each column of the live broadcast rooms are fixed values or numerical values dynamically set in the display process.
In the embodiment of the invention, the live broadcast rooms in the live broadcast room set are circularly displayed at the display positions of the corresponding live broadcast rooms according to the preset number of the categories of the live broadcast rooms to be displayed, the number of the columns of the live broadcast rooms to be displayed under each category of the live broadcast rooms and the number of the live broadcast rooms to be displayed under each column of the live broadcast rooms. Therefore, a dynamic live broadcast room display scheme is provided, and the displayed live broadcast room can be dynamically changed. The defect that the live broadcast room displayed in the prior art is not changed greatly for a long time is overcome, the defect of artificial interference on display of the live broadcast room is also avoided, and a fairer and more reasonable scheme is provided for display of the live broadcast room in the live broadcast platform.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.