CN108810043B - Method and device for storing comment information - Google Patents

Method and device for storing comment information Download PDF

Info

Publication number
CN108810043B
CN108810043B CN201710295168.3A CN201710295168A CN108810043B CN 108810043 B CN108810043 B CN 108810043B CN 201710295168 A CN201710295168 A CN 201710295168A CN 108810043 B CN108810043 B CN 108810043B
Authority
CN
China
Prior art keywords
live broadcast
data server
broadcast room
target
comment information
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
CN201710295168.3A
Other languages
Chinese (zh)
Other versions
CN108810043A (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.)
Beijing Yunzhong Rongxin Network Technology Co ltd
Original Assignee
Beijing Yunzhong Rongxin Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yunzhong Rongxin Network Technology Co ltd filed Critical Beijing Yunzhong Rongxin Network Technology Co ltd
Priority to CN201710295168.3A priority Critical patent/CN108810043B/en
Publication of CN108810043A publication Critical patent/CN108810043A/en
Application granted granted Critical
Publication of CN108810043B publication Critical patent/CN108810043B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/1813Arrangements for providing special services to substations for broadcast or conference, e.g. multicast for computer conferences, e.g. chat rooms
    • H04L12/1831Tracking arrangements for later retrieval, e.g. recording contents, participants activities or behavior, network status

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The disclosure relates to a method and a device for storing comment information, and belongs to the technical field of electronics. The method comprises the following steps: receiving comment information of a target live broadcast room sent by a terminal; determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room; if the target data server is determined, sending comment information of the target live broadcast room to the target data server; if the target data server is not determined, determining a target data server for storing comment information of the target live broadcast room in each data server based on a preset server allocation algorithm; and adding the determined target data server and the target live broadcast room into the corresponding relation, and sending comment information of the target live broadcast room to the target data server. By adopting the method and the device, the query failure can be prevented.

Description

Method and device for storing comment information
Technical Field
The present disclosure relates to the field of electronic technologies, and in particular, to a method and an apparatus for storing comment information.
Background
With the development of electronic technology, various terminals are widely used, and the types and functions of application programs on the corresponding terminals are more and more abundant. A webcast application is a very common application.
Spectator can watch the live broadcast video of a certain live broadcast room through the live broadcast class application of network, and watching the in-process of live broadcast video, spectator can be in the comment area input comment information of the live broadcast interface of show live broadcast video to can trigger the terminal through the operation and send this comment information to the live broadcast server, corresponding, the terminal that each account in this live broadcast room can be sent with received comment information to the server, and save it.
Currently, a method for storing comment information of a certain live broadcast room by a live broadcast server generally includes: when the live broadcast server receives comment information of a certain live broadcast room, a data server for storing the comment information of the live broadcast room is determined in all the data servers based on a preset server allocation algorithm, and then the live broadcast server can send the comment information of the live broadcast room to the determined data server for storage. For example, the live server may calculate a hash value of a live room identifier of the live room (where the hash value is an integer), then divide the hash value by the total number of the data servers to obtain a remainder, and further store the comment information in the data server with the remainder as a label. When the live broadcast server receives a query request corresponding to the comment information of the live broadcast room, a data server storing the comment information of the live broadcast room is determined according to the same method, and then the comment information of the live broadcast room is acquired from the determined data server.
In carrying out the present disclosure, the inventors found that at least the following problems exist:
when the data volume is large and the storage space of the originally configured data server is insufficient, several data servers are often added. After a plurality of data servers are added, because the total number of the data servers changes, based on the storage mode, when comment information of a certain live broadcast room is received, the determined data server is probably not the previously determined data server. In this case, when the data server storing the comment information of the live broadcast is determined based on the above-described query method, the data server storing the comment information of the live broadcast cannot be determined, and thus, the query fails.
Disclosure of Invention
In order to overcome the problem of query failure in the related art, the present disclosure provides a method and an apparatus for storing comment information. The technical scheme is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a method of storing comment information, the method including:
receiving comment information of a target live broadcast room sent by a terminal;
determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room;
if the target data server is determined, sending comment information of the target live broadcast room to the target data server;
if the target data server is not determined, determining a target data server for storing comment information of the target live broadcast room in each data server based on a preset server allocation algorithm; and adding the determined target data server and the target live broadcast room into the corresponding relation, and sending comment information of the target live broadcast room to the target data server.
Optionally, the determining, in a correspondence between each pre-stored live broadcast room and a data server for storing comment information of the live broadcast room, a target data server corresponding to the target live broadcast room includes:
sending a query request for a target data server of a target live broadcast room to an index server, so that the index server determines the target data server corresponding to the target live broadcast room in the corresponding relation between each live broadcast room stored locally in advance and the data server used for storing comment information of the live broadcast room.
Optionally, before sending the query request to the index server for the target data server in the target live broadcast room, the method further includes:
determining a target data server corresponding to a target live broadcast room in a corresponding relation between each live broadcast room pre-stored in a local memory and a data server for storing comment information of the live broadcast room;
if the target data server is not determined, executing a step of sending a query request for the target data server of the target live broadcast room to an index server;
adding the determined target data server and the target live broadcast room into the corresponding relation comprises the following steps:
and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the index server, and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the local memory.
Optionally, adding the determined target data server and the target live broadcast room to a corresponding relationship pre-stored in the local memory includes:
and if the number of the corresponding relation items stored in the local memory reaches a preset upper limit, deleting the corresponding relation item with the earliest storage time, and adding the determined target data server and the target live broadcast room into the corresponding relation pre-stored in the local memory.
Optionally, the method further includes:
receiving a comment information query request for the target live broadcast room, which is sent by the terminal, wherein the comment information query request carries query conditions;
determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room;
obtaining comment information meeting the query condition corresponding to the target live broadcast room from the target data server;
and sending the obtained comment information meeting the query condition to the terminal.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for storing comment information, the apparatus including:
the receiving module is used for receiving comment information of a target live broadcast room sent by the terminal;
the system comprises a first determining module, a first display module and a second determining module, wherein the first determining module is used for determining a target data server corresponding to a target live broadcast room in the corresponding relationship between each pre-stored live broadcast room and a data server for storing comment information of the live broadcast room;
the first sending module is used for sending comment information of the target live broadcast room to the target data server if the target data server is determined;
the second determining module is used for determining a target data server for storing comment information of the target live broadcast room in each data server based on a preset server allocation algorithm if the target data server is not determined; adding the determined target data server and the target live broadcast room into the corresponding relation;
and the second sending module is used for sending the comment information of the target live broadcast room to the target data server.
Optionally, the first determining module is configured to:
sending a query request for a target data server of a target live broadcast room to an index server, so that the index server determines the target data server corresponding to the target live broadcast room in the corresponding relation between each live broadcast room stored locally in advance and the data server used for storing comment information of the live broadcast room.
Optionally, the first determining module is further configured to:
determining a target data server corresponding to a target live broadcast room in a corresponding relation between each live broadcast room pre-stored in a local memory and a data server for storing comment information of the live broadcast room;
if the target data server is not determined, executing a step of sending a query request for the target data server of the target live broadcast room to an index server;
the second determining module is configured to:
and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the index server, and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the local memory.
Optionally, the second determining module is configured to:
and if the number of the corresponding relation items stored in the local memory reaches a preset upper limit, deleting the corresponding relation item with the earliest storage time, and adding the determined target data server and the target live broadcast room into the corresponding relation pre-stored in the local memory.
Optionally, the receiving module is further configured to:
receiving a comment information query request for the target live broadcast room, which is sent by the terminal, wherein the comment information query request carries query conditions;
the first determining module is further configured to:
determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room;
the device further comprises:
the acquisition module is used for acquiring comment information which meets the query condition and corresponds to the target live broadcast room from the target data server;
and the third sending module is used for sending the obtained comment information meeting the query condition to the terminal.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the embodiment of the disclosure, when comment information of a target live broadcast room needs to be stored, the server may determine whether a target data server corresponding to the target live broadcast room exists in a pre-stored correspondence relationship between each live broadcast room and the data server, if so, the comment information of the target live broadcast room may be directly stored to the target data server, if not, a target data server for storing the comment information of the target live broadcast room may be determined in each data server, and then, the comment information may be stored to the determined target data server, and the target data server and the target live broadcast room are added to the correspondence relationship. Therefore, when comment information of a target live broadcast room is subsequently stored, the comment information can be stored in the data server determined when the comment information is stored for the first time, whether a new data server is added or not, the comment information of the target live broadcast room can be stored in the same data server, correspondingly, when the comment information of the target live broadcast room is inquired, the data server for storing the comment information of the target live broadcast room can be determined through the corresponding relation, further, all the comment information of the target live broadcast room can be inquired, and therefore, the inquiry failure can be prevented.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. In the drawings:
FIG. 1 is a flow diagram illustrating a method of storing review information in accordance with an exemplary embodiment;
FIG. 2 is a flowchart illustrating a method of storing review information in accordance with an exemplary embodiment;
FIG. 3 is a schematic diagram illustrating an apparatus for storing review information in accordance with one illustrative embodiment;
FIG. 4 is a schematic diagram illustrating an apparatus for storing review information in accordance with one illustrative embodiment;
fig. 5 is a schematic diagram illustrating a configuration of a server according to an example embodiment.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
An exemplary embodiment of the present disclosure provides a method for storing comment information, which may be implemented by a server and an index server, where the server may be a backend server of a webcast application, and may be referred to as a live server, and may also be a server group composed of multiple servers, for example, the server group may be composed of a live server, a storage server, and a distribution server. The live broadcast server can be provided with a processor, a memory and a transceiver, wherein the processor can be used for determining relevant processing for storing comment information of a target live broadcast room, the memory can be used for storing data required and generated in the following processing process, and the transceiver can be used for receiving and sending the data.
The following will describe the process flow shown in fig. 1 in detail by taking the server as a single server in conjunction with the embodiments, and the content may be as follows:
in step 101, comment information of a target live broadcast room sent by a terminal is received.
In the implementation, a viewer can watch live videos of a target live broadcast room (wherein the target live broadcast room can be any live broadcast room) through a network live broadcast application program, and in the process of watching the live videos, the viewer can input comment information in a comment area of a live broadcast interface for displaying the live broadcast videos and can send the comment information to a live broadcast server through an operation trigger terminal. Correspondingly, the live broadcast server can receive comment information of a target live broadcast room, which is sent by the terminal, wherein the comment information can be text information, voice information or picture information.
In step 102, a target data server corresponding to a target live broadcast room is determined from the correspondence between the respective live broadcast rooms stored in advance and the data server for storing comment information of the live broadcast rooms.
In implementation, a mechanism for storing comment information may be preset in the live broadcast server, that is, a storage trigger condition of the comment information may be preset, for example, when the live broadcast server receives comment information of a target live broadcast room sent by the terminal, the comment information may be stored, and for example, every time a preset acquisition period passes, comment information of the target live broadcast room received in the current acquisition period may be stored. According to the scheme, the comment information can be stored by adopting an SSDB (high-performance database server), and the specific storage method is as follows:
when the comment information of the target live broadcast room needs to be stored, the live broadcast server may obtain a correspondence between each of the pre-stored live broadcast rooms and a data server for storing the comment information of the live broadcast room (the pre-stored correspondence may be as shown in table 1, and the stored correspondence is a correspondence between an identifier of the live broadcast room and an identifier of the data server, where the identifier of the data server may be a network address of the data server, for example, an IP (Internet Protocol, Internet Protocol) address), and further, in the correspondence, may determine the target data server corresponding to the target live broadcast room.
TABLE 1
Figure BDA0001282881700000061
Figure BDA0001282881700000071
Optionally, the corresponding relationship may be stored in an index server specially used for storing the corresponding relationship, and correspondingly, the processing procedure of step 102 may be as follows: and sending a query request for a target data server of the target live broadcast room to the index server, so that the index server determines the target data server corresponding to the target live broadcast room in the corresponding relation between each live broadcast room stored in advance locally and the data server for storing the comment information of the live broadcast room.
In implementation, the live broadcast server may send a query request for a target data server in a target live broadcast room to the index server, and accordingly, after receiving the query request for the data server, the index server may determine the target data server corresponding to the target live broadcast room in the pre-stored correspondence. If the index server determines the target data server, a success notification carrying the identifier of the target data server can be sent to the live broadcast server, and correspondingly, after receiving the success notification sent by the index server, the live broadcast server can judge that the target data server corresponding to the target live broadcast room is determined through the corresponding relation. If the corresponding relation stored in the index server does not contain the target data server corresponding to the target live broadcast room, the index server can calculate the target data server of the target live broadcast room, so that the live broadcast server can store the comment information of the target live broadcast room.
Optionally, when determining the target data server, the live broadcast server may determine the target data server in the corresponding relationship stored in the local memory, and then determine the target data server in the corresponding relationship stored in the index server, and accordingly, the processing procedure may be as follows: determining a target data server corresponding to a target live broadcast room in a corresponding relation between each live broadcast room pre-stored in a local memory and a data server for storing comment information of the live broadcast room; and if the target data server is not determined, executing the step of sending a query request for the target data server of the target live broadcast room to the index server.
In implementation, the local memory of the live broadcast server may also store in advance a corresponding relationship between each live broadcast room and the data server for storing the comment information of the live broadcast room, where, due to the influence of the storage space of the memory, each corresponding relationship item in the corresponding relationship between each live broadcast room in the local memory and the data server is less than that stored in the index server, and the index server may store the corresponding relationship in the disk. When the live broadcast server needs to store comment information of a target live broadcast room, a target data server corresponding to the target live broadcast room can be determined in the corresponding relation stored in the local memory, if the live broadcast server does not determine the target data server in the corresponding relation stored in the local memory, the target data server can be determined in the corresponding relation stored in the index server according to the method, and if the live broadcast server determines the target data server in the corresponding relation stored in the local memory, the target data server can be determined without being in the corresponding relation stored in the index server, but the comment information of the target live broadcast room is directly sent to the determined target data server.
In step 103, if the target data server is determined, comment information of the target live broadcast room is sent to the target data server.
In implementation, if the live broadcast server determines the target data server in the corresponding relationship, the comment information of the target live broadcast room can be directly sent to the target data server. That is, as long as the target data server corresponding to the target live broadcast room is recorded in the corresponding relationship stored in the local memory or the corresponding relationship stored in the index server, the live broadcast server can store the comment information of the target live broadcast room in the target data server.
In step 104, if the target data server is not determined, determining a target data server for storing comment information of the target live broadcast room in each data server based on a preset server allocation algorithm; and adding the determined target data server and the target live broadcast room into a corresponding relation, and sending comment information of the target live broadcast room to the target data server.
In implementation, if a target data server is not determined in the corresponding relationship, that is, no target data server corresponding to the target live broadcast room is recorded in the local memory and the index server (in this case, the comment information of the target live broadcast room is stored for the first time), the target data server may be determined in each data server based on a preset server allocation algorithm (for example, a preset load balancing algorithm may be adopted), and then the comment information of the target live broadcast room may be stored in the target data server, and the target live broadcast room and the determined target server may be added to the corresponding relationship, so that the determined target data server is found when the comment information of the target live broadcast room is stored later.
Optionally, for a case that the corresponding relationship is stored in the local memory and the index server, the processing procedure in step 104 may be as follows: and adding the determined target data server and the determined target live broadcast room into a corresponding relation pre-stored in an index server, and adding the determined target data server and the determined target live broadcast room into a corresponding relation pre-stored in a local memory.
In implementation, after the comment information of the target live broadcast room is stored for the first time and the target data server corresponding to the comment information is determined, the target live broadcast room and the determined target data server can be added to the corresponding relationship pre-stored in the local memory, and meanwhile, the target live broadcast room and the determined target data server are added to the corresponding relationship stored in the index server.
Optionally, for the case that the local memory stores the correspondence, correspondingly, the processing procedure may be as follows: and if the number of the corresponding relation items stored in the local memory reaches the preset upper limit, deleting the corresponding relation item with the earliest storage time, and adding the determined target data server and the target live broadcast room into the corresponding relation pre-stored in the local memory.
In implementation, after the live broadcast server determines the target data server through a server allocation algorithm, the number of each corresponding relationship item in the corresponding relationship currently stored in the local memory may be determined, and then, the size relationship between the determined number and the preset number upper limit may be compared, if the determined number reaches the preset number upper limit, the corresponding relationship item with the earliest storage time may be deleted, and then, the determined target data server and the target live broadcast may be added to the corresponding relationship pre-stored in the local memory. And if the determined quantity does not reach the preset quantity upper limit, directly adding the determined target data server and the target live broadcast room into the corresponding relation pre-stored in the local memory.
Optionally, the user may also query the stored comment information, and accordingly, the processing procedure may be as follows: receiving a comment information query request for a target live broadcast room sent by a terminal, wherein the comment information query request carries query conditions; determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room; obtaining comment information meeting the query condition corresponding to the target live broadcast room from a target data server; and sending the obtained comment information meeting the query condition to the terminal.
In implementation, when a user wants to view history information (that is, stored comment information) of a target live broadcast room, a terminal may be triggered to send a comment information query request for the target live broadcast room to a live broadcast server through operation, where the comment information query request may carry a query condition (for example, the query condition may be comment information of a posting time within a certain time period). Correspondingly, after the live broadcast server receives the comment information query request, the live broadcast server can query the target data server corresponding to the target server in the corresponding relation, and then can forward the comment information query request sent by the terminal to the target data server, and the target data server can obtain comment information meeting the query conditions based on the query conditions and send the comment information to the live broadcast server. And after the live broadcast server acquires the comment information which meets the query condition and corresponds to the target live broadcast room, the comment information can be sent to the terminal.
In addition, when the data amount in the pre-deployed number of servers reaches a preset data amount threshold, a new data server can be additionally added. After a new data server is added, when comment information of a certain live broadcast room needs to be stored, if the comment information of the live broadcast room is stored for the first time, a weighted load balancing algorithm can be adopted to determine the data server corresponding to the live broadcast room. If the storage is not the first storage of the comment information of the live broadcast room, the data server corresponding to the live broadcast room can be determined in the corresponding relation, and the comment information is stored in the data server, so that data migration is not needed after the data server is newly added, and waste of flow can be avoided. That is to say, in this scheme, whether a new data server is added or not, the comment information of the same live broadcast room can be stored in the same data server, and when inquiring, the stored comment information of the live broadcast room can be inquired.
In addition, the process flow shown in fig. 2 will be described in detail for the case where the execution agent is a server group, and the contents may be as follows:
in step 201, a live broadcast server receives comment information of a target live broadcast room sent by a terminal;
in step 202, a storage request carrying comment information of the target live broadcast room is sent to a storage server.
Correspondingly, the storage server can receive the storage request which is sent by the live broadcast server and carries the comment information of the target live broadcast room, analyze the storage request and obtain the comment information of the target live broadcast room carried in the storage request.
In step 203, the storage server sends a data server query request corresponding to the target live broadcast room to the distribution server.
Optionally, after receiving the storage request, the storage server may first determine whether a target data server corresponding to the target live broadcast room exists in the correspondence stored in the local memory, and accordingly, the processing procedure in step 202 may be as follows: the storage server determines a target data server corresponding to a target live broadcast room in the corresponding relation between each live broadcast room pre-stored in a local memory and a data server for storing comment information of the live broadcast room; if the storage server does not determine the target data server, sending a data server query request corresponding to the target live broadcast room to the distribution server; and if the storage server determines the target data server, sending comment information of the target live broadcast room to the target data server.
In an implementation, the memory of the storage server may store the corresponding relationship including a certain number of corresponding relationship items in advance. When a storage request of the live broadcast server is received, a target data server corresponding to a target live broadcast room can be determined in the corresponding relation stored in the local memory. If the target data server is determined in the local memory, the storage server can send comment information of the target live broadcast room to the target data server, and processing of subsequent steps is not performed, and if the target data server is not determined in the local memory, the storage server can allocate the server to send a data server query request corresponding to the target live broadcast room.
Correspondingly, the distribution server can receive a data server query request which is sent by the storage server and corresponds to the target live broadcast room.
In step 204, the allocation server determines a target data server corresponding to the target live broadcast room in the correspondence between each live broadcast room pre-stored in the index server and the data server for storing the comment information of the live broadcast room.
In implementation, after receiving a data server query request sent by a storage server and corresponding to a target live broadcast room, an allocation server may determine a target data server corresponding to the target live broadcast room in a correspondence relationship between each live broadcast room pre-stored in an index server and a data server for storing comment information of the live broadcast room, where the index server may also be a server group.
In step 205a, if the distribution server determines the target data server, a success notification carrying the identifier of the target data server is sent to the storage server.
In implementation, if the allocation server determines the target data server in the corresponding relationship stored in the index server, the allocation server may send a success notification carrying an identifier of the target data server to the storage server, where the identifier of the target data server may be an IP address of the target data server.
In step 205b1, if the distribution server does not determine the target data server, determining a target data server for storing the comment information of the target live broadcast room in each data server based on a preset server distribution algorithm; and adding the determined target data server and the target live broadcast room into a corresponding relation.
In step 205b2, the allocation server sends a success notification to the storage server carrying the identification of the target data server.
In implementation, if the allocation server does not determine the target data server in the corresponding relationship stored in the index server, a target data server for storing comment information of the target live broadcast room may be determined in each data server based on a preset server allocation algorithm (for example, based on a preset load balancing algorithm), and then a success notification carrying an identifier of the target data server may be sent to the storage server, and the target live broadcast room and the determined target data server may be stored in the corresponding relationship stored in the index server.
Optionally, for a case that a corresponding relationship is also stored in the local memory of the storage server, the storage server may further add the determined target data server and the target live broadcast room to the corresponding relationship pre-stored in the memory of the storage server.
Optionally, for a case that the number of the corresponding relationship items stored in the memory of the storage server is limited, the processing procedure may be as follows: and if the number of the corresponding relation items stored in the memory of the storage server reaches the preset upper limit, deleting the corresponding relation item with the earliest storage time, and adding the determined target data server and the target live broadcast room into the corresponding relation pre-stored in the memory of the storage server.
In implementation, before the storage server adds the determined target data server and the determined target live broadcast room to the local memory, the number of corresponding relationship items currently stored in the memory of the storage server may be determined, and the determined number may be compared with a preset number upper limit, if the determined number reaches the preset number upper limit, the storage server may delete the corresponding relationship item with the earliest storage time, and further, the determined target data server and the determined target live broadcast room may be added to the corresponding relationship pre-stored in the memory of the storage server.
For the case that the allocation server sends the successful notification carrying the identifier of the target data server to the storage server in steps 205a and 205b2, the storage server may correspondingly receive the successful notification carrying the identifier of the target data server sent by the allocation server.
In step 206, the storage server sends the comment information of the target live broadcast room to the target data server.
In implementation, after receiving the successful notification carrying the identifier of the target data server, the storage server may parse the identifier to obtain the identifier of the target data server carried therein, and further, may send comment information of the target live broadcast room to the target data server.
In step 207, the target data server stores the comment information of the target live broadcast.
In the embodiment of the disclosure, when comment information of a target live broadcast room needs to be stored, the server may determine whether a target data server corresponding to the target live broadcast room exists in a pre-stored correspondence relationship between each live broadcast room and the data server, if so, the comment information of the target live broadcast room may be directly stored to the target data server, if not, a target data server for storing the comment information of the target live broadcast room may be determined in each data server, and then, the comment information may be stored to the determined target data server, and the target data server and the target live broadcast room are added to the correspondence relationship. Therefore, when comment information of a target live broadcast room is subsequently stored, the comment information can be stored in the data server determined when the comment information is stored for the first time, whether a new data server is added or not, the comment information of the target live broadcast room can be stored in the same data server, correspondingly, when the comment information of the target live broadcast room is inquired, the data server for storing the comment information of the target live broadcast room can be determined through the corresponding relation, further, all the comment information of the target live broadcast room can be inquired, and therefore, the inquiry failure can be prevented.
Yet another exemplary embodiment of the present disclosure provides an apparatus for storing comment information, as shown in fig. 3, the apparatus including:
the receiving module 310 is configured to receive comment information of a target live broadcast room sent by a terminal;
a first determining module 320, configured to determine, in a correspondence relationship between pre-stored live broadcast rooms and data servers used for storing comment information of the live broadcast rooms, a target data server corresponding to the target live broadcast room;
a first sending module 330, configured to send comment information of the target live broadcast room to the target data server if the target data server is determined;
a second determining module 340, configured to determine, based on a preset server allocation algorithm, a target data server for storing comment information of the target live broadcast room in each data server if the target data server is not determined; adding the determined target data server and the target live broadcast room into the corresponding relation;
a second sending module 350, configured to send comment information of the target live broadcast to the target data server.
Optionally, the first determining module 320 is configured to:
sending a query request for a target data server of a target live broadcast room to an index server, so that the index server determines the target data server corresponding to the target live broadcast room in the corresponding relation between each live broadcast room stored locally in advance and the data server used for storing comment information of the live broadcast room.
Optionally, the first determining module 320 is further configured to:
determining a target data server corresponding to a target live broadcast room in a corresponding relation between each live broadcast room pre-stored in a local memory and a data server for storing comment information of the live broadcast room;
if the target data server is not determined, executing a step of sending a query request for the target data server of the target live broadcast room to an index server;
the second determining module 340 is configured to:
and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the index server, and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the local memory.
Optionally, the second determining module 340 is configured to:
and if the number of the corresponding relation items stored in the local memory reaches a preset upper limit, deleting the corresponding relation item with the earliest storage time, and adding the determined target data server and the target live broadcast room into the corresponding relation pre-stored in the local memory.
Optionally, the receiving module 310 is further configured to:
receiving a comment information query request for the target live broadcast room, which is sent by the terminal, wherein the comment information query request carries query conditions;
the first determining module 320 is further configured to:
determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room;
as shown in fig. 4, the apparatus further includes:
an obtaining module 360, configured to obtain, from the target data server, comment information that meets the query condition and corresponds to the target live broadcast room;
a third sending module 370, configured to send the obtained comment information meeting the query condition to the terminal.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In the embodiment of the disclosure, when comment information of a target live broadcast room needs to be stored, the server may determine whether a target data server corresponding to the target live broadcast room exists in a pre-stored correspondence relationship between each live broadcast room and the data server, if so, the comment information of the target live broadcast room may be directly stored to the target data server, if not, a target data server for storing the comment information of the target live broadcast room may be determined in each data server, and then, the comment information may be stored to the determined target data server, and the target data server and the target live broadcast room are added to the correspondence relationship. Therefore, when comment information of a target live broadcast room is subsequently stored, the comment information can be stored in the data server determined when the comment information is stored for the first time, whether a new data server is added or not, the comment information of the target live broadcast room can be stored in the same data server, correspondingly, when the comment information of the target live broadcast room is inquired, the data server for storing the comment information of the target live broadcast room can be determined through the corresponding relation, further, all the comment information of the target live broadcast room can be inquired, and therefore, the inquiry failure can be prevented.
It should be noted that: in the above embodiment, when storing comment information, the apparatus for storing comment information is described by way of example only by dividing the above functional modules, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the server is divided into different functional modules to complete all or part of the above described functions. In addition, the device for storing comment information and the method for storing comment information provided by the above embodiment belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment and is not described herein again.
Yet another exemplary embodiment of the present disclosure shows a schematic structural diagram of a server. Fig. 5 is a block diagram illustrating an apparatus 1900 for storing comment information according to an exemplary embodiment. For example, the apparatus 1900 may be provided as a server. Referring to fig. 5, the device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method of storing comment information.
The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Device 1900 may include memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors include instructions for:
receiving comment information of a target live broadcast room sent by a terminal;
determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room;
if the target data server is determined, sending comment information of the target live broadcast room to the target data server;
if the target data server is not determined, determining a target data server for storing comment information of the target live broadcast room in each data server based on a preset server allocation algorithm; and adding the determined target data server and the target live broadcast room into the corresponding relation, and sending comment information of the target live broadcast room to the target data server.
Optionally, the determining, in a correspondence between each pre-stored live broadcast room and a data server for storing comment information of the live broadcast room, a target data server corresponding to the target live broadcast room includes:
sending a query request for a target data server of a target live broadcast room to an index server, so that the index server determines the target data server corresponding to the target live broadcast room in the corresponding relation between each live broadcast room stored locally in advance and the data server used for storing comment information of the live broadcast room.
Optionally, before sending the query request to the index server for the target data server in the target live broadcast room, the method further includes:
determining a target data server corresponding to a target live broadcast room in a corresponding relation between each live broadcast room pre-stored in a local memory and a data server for storing comment information of the live broadcast room;
if the target data server is not determined, executing a step of sending a query request for the target data server of the target live broadcast room to an index server;
adding the determined target data server and the target live broadcast room into the corresponding relation comprises the following steps:
and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the index server, and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the local memory.
Optionally, adding the determined target data server and the target live broadcast room to a corresponding relationship pre-stored in the local memory includes:
and if the number of the corresponding relation items stored in the local memory reaches a preset upper limit, deleting the corresponding relation item with the earliest storage time, and adding the determined target data server and the target live broadcast room into the corresponding relation pre-stored in the local memory.
Optionally, the method further includes:
receiving a comment information query request for the target live broadcast room, which is sent by the terminal, wherein the comment information query request carries query conditions;
determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room;
obtaining comment information meeting the query condition corresponding to the target live broadcast room from the target data server;
and sending the obtained comment information meeting the query condition to the terminal.
In the embodiment of the disclosure, when comment information of a target live broadcast room needs to be stored, the server may determine whether a target data server corresponding to the target live broadcast room exists in a pre-stored correspondence relationship between each live broadcast room and the data server, if so, the comment information of the target live broadcast room may be directly stored to the target data server, if not, a target data server for storing the comment information of the target live broadcast room may be determined in each data server, and then, the comment information may be stored to the determined target data server, and the target data server and the target live broadcast room are added to the correspondence relationship. Therefore, when comment information of a target live broadcast room is subsequently stored, the comment information can be stored in the data server determined when the comment information is stored for the first time, whether a new data server is added or not, the comment information of the target live broadcast room can be stored in the same data server, correspondingly, when the comment information of the target live broadcast room is inquired, the data server for storing the comment information of the target live broadcast room can be determined through the corresponding relation, further, all the comment information of the target live broadcast room can be inquired, and therefore, the inquiry failure can be prevented.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (2)

1. A method of storing review information, the method comprising:
receiving comment information of a target live broadcast room sent by a terminal, and executing subsequent storage operation on the comment information of the target live broadcast room received in the current acquisition cycle every time a preset acquisition cycle passes;
in the pre-stored corresponding relationship between each live broadcast room and a data server for storing comment information of the live broadcast room, determining a target data server corresponding to the target live broadcast room, including: determining a target data server corresponding to a target live broadcast room in a corresponding relation between each live broadcast room pre-stored in a local memory and a data server for storing comment information of the live broadcast room; if the target data server is not determined, sending a query request for the target data server of the target live broadcast room to an index server so that the index server determines the target data server corresponding to the target live broadcast room in a corresponding relation between each live broadcast room stored locally in advance and a data server used for storing comment information of the live broadcast room, wherein the data server is a high-performance database server, the corresponding relation between an identifier of the live broadcast room and an identifier of the data server is stored in the corresponding relation, and the identifier of the data server is a network address of the data server;
if the target data server is determined, sending comment information of the target live broadcast room to the target data server;
if the target data server is not determined, determining a target data server for storing comment information of the target live broadcast room in each data server based on a preset server allocation algorithm; adding the determined target data server and the target live broadcast room into the corresponding relationship, and sending comment information of the target live broadcast room to the target data server, wherein the adding the determined target data server and the target live broadcast room into the corresponding relationship comprises: adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the index server, and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the local memory;
adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the local memory comprises:
determining the number of each corresponding relationship item in the corresponding relationship currently stored in the local memory, comparing the determined number with the size relationship of a preset number upper limit, if the number of the corresponding relationship items stored in the local memory reaches the preset number upper limit, deleting the corresponding relationship item with the earliest storage time, adding the determined target data server and the target live broadcast room into the corresponding relationship pre-stored in the local memory, and if the determined number does not reach the preset number upper limit, directly adding the determined target data server and the target live broadcast room into the corresponding relationship pre-stored in the local memory;
the method further comprises the following steps:
receiving a comment information query request for the target live broadcast room, which is sent by the terminal, wherein the comment information query request carries query conditions;
determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room;
obtaining comment information meeting the query condition corresponding to the target live broadcast room from the target data server;
and sending the obtained comment information meeting the query condition to the terminal.
2. An apparatus for storing comment information, the apparatus comprising:
the receiving module is used for receiving comment information of a target live broadcast room sent by a terminal, and executing subsequent storage operation on the comment information of the target live broadcast room received in the current acquisition cycle every time a preset acquisition cycle passes;
the first determining module is used for determining a target data server corresponding to the target live broadcast room in the pre-stored corresponding relation between each live broadcast room and a data server used for storing comment information of the live broadcast room, and comprises: determining a target data server corresponding to a target live broadcast room in a corresponding relation between each live broadcast room pre-stored in a local memory and a data server for storing comment information of the live broadcast room; if the target data server is not determined, sending a query request for the target data server of the target live broadcast room to an index server so that the index server determines the target data server corresponding to the target live broadcast room in a corresponding relation between each live broadcast room stored locally in advance and a data server used for storing comment information of the live broadcast room, wherein the data server is a high-performance database server, the corresponding relation between an identifier of the live broadcast room and an identifier of the data server is stored in the corresponding relation, and the identifier of the data server is a network address of the data server;
the first sending module is used for sending comment information of the target live broadcast room to the target data server if the target data server is determined;
the second determining module is used for determining a target data server for storing comment information of the target live broadcast room in each data server based on a preset server allocation algorithm if the target data server is not determined; adding the determined target data server and the target live broadcast room into the corresponding relation, including: adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the index server, and adding the determined target data server and the target live broadcast room into a corresponding relation pre-stored in the local memory;
the second sending module is used for sending comment information of the target live broadcast room to the target data server;
wherein the second determining module is further configured to:
determining the number of each corresponding relationship item in the corresponding relationship currently stored in the local memory, comparing the determined number with the size relationship of a preset number upper limit, if the number of the corresponding relationship items stored in the local memory reaches the preset number upper limit, deleting the corresponding relationship item with the earliest storage time, adding the determined target data server and the target live broadcast room into the corresponding relationship pre-stored in the local memory, and if the determined number does not reach the preset number upper limit, directly adding the determined target data server and the target live broadcast room into the corresponding relationship pre-stored in the local memory;
the receiving module is further configured to:
receiving a comment information query request for the target live broadcast room, which is sent by the terminal, wherein the comment information query request carries query conditions;
the first determining module is further configured to:
determining a target data server corresponding to a target live broadcast room in a pre-stored corresponding relation between each live broadcast room and a data server for storing comment information of the live broadcast room;
the device further comprises:
the acquisition module is used for acquiring comment information which meets the query condition and corresponds to the target live broadcast room from the target data server;
and the third sending module is used for sending the obtained comment information meeting the query condition to the terminal.
CN201710295168.3A 2017-04-28 2017-04-28 Method and device for storing comment information Active CN108810043B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710295168.3A CN108810043B (en) 2017-04-28 2017-04-28 Method and device for storing comment information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710295168.3A CN108810043B (en) 2017-04-28 2017-04-28 Method and device for storing comment information

Publications (2)

Publication Number Publication Date
CN108810043A CN108810043A (en) 2018-11-13
CN108810043B true CN108810043B (en) 2021-11-02

Family

ID=64069187

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710295168.3A Active CN108810043B (en) 2017-04-28 2017-04-28 Method and device for storing comment information

Country Status (1)

Country Link
CN (1) CN108810043B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130959A (en) * 2011-03-22 2011-07-20 浪潮(北京)电子信息产业有限公司 System and method for scheduling cloud storage resource
CN104618482A (en) * 2015-02-02 2015-05-13 浙江宇视科技有限公司 Cloud data access method, server, traditional storage device and architecture
CN104731516A (en) * 2013-12-18 2015-06-24 腾讯科技(深圳)有限公司 Method and device for accessing files and distributed storage system
WO2017067297A1 (en) * 2015-10-21 2017-04-27 杭州海康威视数字技术股份有限公司 Method and device for reading and writing video data in nas device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510884A (en) * 2009-03-26 2009-08-19 华为技术有限公司 Multimedia conference management method, network device and network system
US9292699B1 (en) * 2014-12-30 2016-03-22 Airwatch Llc Encrypted file storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130959A (en) * 2011-03-22 2011-07-20 浪潮(北京)电子信息产业有限公司 System and method for scheduling cloud storage resource
CN104731516A (en) * 2013-12-18 2015-06-24 腾讯科技(深圳)有限公司 Method and device for accessing files and distributed storage system
CN104618482A (en) * 2015-02-02 2015-05-13 浙江宇视科技有限公司 Cloud data access method, server, traditional storage device and architecture
WO2017067297A1 (en) * 2015-10-21 2017-04-27 杭州海康威视数字技术股份有限公司 Method and device for reading and writing video data in nas device

Also Published As

Publication number Publication date
CN108810043A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
US9559992B2 (en) System and method for updating information in an instant messaging application
US9686329B2 (en) Method and apparatus for displaying webcast rooms
CN110096660B (en) Method and device for loading page pictures and electronic equipment
CN108848401B (en) Video playing starting method and device
CN104539977A (en) Live broadcast previewing method and device
WO2014183427A1 (en) Method and apparatus for displaying webcast rooms
US11310066B2 (en) Method and apparatus for pushing information
WO2016127792A1 (en) User event response method and device
CN106776917B (en) Method and device for acquiring resource file
CN105338564B (en) A kind of client adaptation method, client, server and system
CN110764688B (en) Method and device for processing data
WO2014176896A1 (en) System and method for updating information in an instant messaging application
CN111159269B (en) Data processing method, device and system
CN110311855B (en) User message processing method and device, electronic equipment and storage medium
CN109213955B (en) Data processing method and related equipment
CN110708402A (en) Accessible resource display method and device and resource access system
US20210112025A1 (en) Method and server for processing messages
CN110166823B (en) Screen projection method and related device
CN104917754A (en) Video data sending and receiving methods, servers and clients
CN110838969B (en) Picture transmission method, device, equipment and medium
US10798456B2 (en) Method and device for presenting information
CN108810043B (en) Method and device for storing comment information
CN108959393B (en) Dynamic picture processing method, device and storage medium
CN110928547A (en) Public file extraction method, device, terminal and storage medium
CN109391537B (en) Information processing method and device and computer 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