Video channel allocation management method and related device, and communication system

Embodiments of the present invention disclose a video channel allocation management method and related device, and a communication system. The video channel management method includes: receiving a first video data from a first user; querying a first video channel corresponding to the first user; if the first video channel corresponding to the first user is not found through the querying, allocating a second video to the first user, the second video channel being a channel that is currently timed out; and if the second video channel is allocated to the first user, writing the first video data to the second video channel, and tagging that the second video channel belongs to the first user. Technical solutions provided in the embodiments of the present invention facilitate improvement in video channel utilization efficiency, and then may reduce hardware resource deployment as much as possible.

FIELD OF THE TECHNOLOGY

The present invention relates to the field of computer technologies, and specifically to a video channel allocation management method and related device, and a communication system.

BACKGROUND OF THE DISCLOSURE

Currently, a video channel is a storage resource, in a video server, that is used for storing video data. Information such as a time stamp and a user identifier of a user to which the video channel currently belongs may be recorded in the video channel.

However, the video server generally allocates video channels of a quantity equal to a quantity of concurrent video users according to the quantity of the concurrent video users. As a result, the quantity of video channels that the video server can provide directly limits a maximum concurrent user number allowed by the video server, and therefore, for some specific time periods or scenarios in which a concurrent user number may be relatively large, video servers having more hardware resources are needed to provide corresponding video channels, which inevitably pushes up costs.

BRIEF SUMMARY OF THE DISCLOSURE

Embodiments of the present invention provide a video channel allocation management method and related device, and a communication system, so as to improve video channel utilization efficiency, and then reduce hardware resource deployment as much as possible.

A first aspect of the embodiments of the present invention provides a video channel management method, including: receiving a first video data from a first user; querying a first video channel corresponding to the first user; and if the first video channel corresponding to the first user is not found through the querying, allocating a second video channel to the first user, the second video channel being a channel that is currently timed out; and if the second video channel is allocated to the first user, writing the first video data to the second video channel, and tagging that the second video channel belongs to the first user.

A second aspect of the embodiments of the present invention provides a video server that may include: a receiving unit, configured to receive a first video data from a first user; a query unit, configured to query a first video channel corresponding to the first user; an allocation unit, configured to: if the query unit does not find the first video channel corresponding to the first user through the querying, allocate a second video channel to the first user, the second video channel being a channel that is currently timed out; and a writing unit, configured to: if the allocation unit allocates the second video channel to the first user, write the first video data to the second video channel, and tag that the second video channel belongs to the first user.

A third aspect of the embodiments of the present invention provides a communication system that may include: a user terminal and a video server. The user terminal may be configured to send a first video data from a first user to the video server. The video server may be configured to receive the first video data from the user terminal; query a first video channel corresponding to the first user; and if the first video channel corresponding to the first user is not found through the querying, allocate a second video channel to the first user, the second video channel being a channel that is currently timed out; and if the second video channel that is currently already timed out is allocated to the first user, write the first video data to the second video channel, and tag that the second video channel belongs to the first user, the user terminal belonging to the first user.

It can be seen from above that, in the solutions of the embodiments of the present invention, after receiving a first video data from a first user, a video server first queries a first video channel corresponding to the first user; and if the first video channel corresponding to the first user is not found through the querying, allocates a second video channel to the first user, the second video channel being a channel that is currently timed out; and if the second video channel is allocated to the first user, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user. A video channel time management mechanism is introduced, and a video channel that is currently already timed out may be allocated again to and used by another user, so that at different moments, a same video channel may be allocated repetitively to and used by multiple different users, which greatly improves video channel utilization efficiency, and then may reduce hardware resource deployment as much as possible. Moreover, based on this mechanism, a video channel does not need to be fixedly allocated to each user, and therefore, a conventional video channel allocation mechanism may be abandoned, and the disclosed method and system can facilitate great increase in a quantity of access users allowed by the video server.

DETAILED DESCRIPTION

Embodiments of the present invention provide a video channel allocation management method and related device, and a communication system, so as to improve video channel utilization efficiency, and then reduce hardware resource deployment as much as possible.

To make the solutions of the present invention more comprehensible for persons skilled in the art, the following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are merely a part rather than all of the embodiments of the present invention. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

The following describes each of the embodiments in detail.

In the specification, claims, and accompanying drawings of the present invention, the terms “first”, “second”, “third”, “fourth” (if exists), and so on are intended to distinguish between similar objects but do not necessarily indicate a particular order or sequence. It should be understood that, terms used in this way can be interchanged in an appropriate case, so that the embodiments of the present invention that are described herein can be, for example, implemented in a sequence other than those sequences illustrated or described herein. In addition, terms “include” and “have” and any of their variations are intended to cover nonexclusive including, for example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to those clearly listed steps or units, but may include another step or unit that is not clearly listed or is inherent to the process, method, product, or device.

According to an embodiment, the present invention provides a video channel allocation management method, where the method may include: receiving, by a video server, a first video data from a first user; querying a first video channel corresponding to the first user; and if the first video channel corresponding to the first user is not found successfully through the querying, attempting to allocate a second video channel to the first user, the second video channel being a channel that is currently timed out, and if the second video channel is allocated to the first user successfully, writing the first video data to the second video channel, and tagging that the second video channel belongs to the first user.

First referring toFIG. 1,FIG. 1is a schematic flowchart of a video channel allocation management method according to an embodiment of the present invention. As shown inFIG. 1, the video channel allocation management method provided in this embodiment of the present invention may include the following contents.

101: A video server receives first video data.

For example, after a user terminal (which may be referred to as a first user terminal for convenience of quotation) establishes a connection to a video server, the first user terminal may send a piece of video data (which is referred to as first video data for convenience of quotation) to the video server, and the video server may receive the first video data from the first user terminal. The first user terminal sending the first video data belongs to a user (which may be referred to as a first user). The first video data may be live video data, and certainly may also be another type of video data packet.

A user terminal mentioned in each embodiment the present invention may be a personal computer, a mobile phone, a personal digital processing device or another type of user terminal.

102: The video server queries a first video channel corresponding to a first user to which the first video data belongs.

In some embodiments of the present invention, the first video data may further include, for example, a user identifier of the first user.

In some embodiments of the present invention, before receiving the first video data, the video server may already allocate a video channel to the first user, or may not yet allocate a video channel to the first user. For example, the video server may not allocate a video channel to the first user previously, or the video server may allocate a video channel previously allocated to the first user to another user, or the video server may reset a video channel previously allocated to the first user to an idle video channel, where the idle video channel does not belong to any user.

A video channel is a storage resource, in the video server, that is used for storing video data, such as a memory resource. Information such as a time stamp, and a user identifier of a user to which the video channel currently belongs may be recorded in the video channel.

In some embodiments of the present invention, the querying a first video channel corresponding to a first user to which the first video data belongs may include: searching, based on a multiple-Hash algorithm (or a traversal algorithm or another algorithm), for whether a record used for identifying a mapping relationship between the first user and the first video channel is stored in a mapping record storage area, and if the record used for identifying the mapping relationship between the first user and the first video channel is not found in the mapping record storage area, determining that the first video channel corresponding to the first user is not found through the querying successfully, or if the record used for identifying the mapping relationship between the first user and the first video channel is found in the mapping record storage area, determining that the first video channel corresponding to the first user is found through the querying successfully.

103: If the first video channel corresponding to the first user is not found successfully through the querying, the video server attempts to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user.

In some embodiments of the present invention, a video channel that is timed out may refer to that a time denoted by a time stamp corresponding to the video channel lags behind a current time by over a first time length threshold, where the first time length threshold may be, for example, one second, two seconds, three seconds or another time length that is set according to an actual need. The video channel that is timed out belongs to a specific user (e.g., a second user).

In some embodiments of the present invention, if the first video data is written to the second video channel, a time stamp of the second video channel may be further updated. It can be understood that, a time denoted by the updated time stamp of the second video channel is a time at which the first video data is written to the second video channel.

In some embodiments of the present invention, the video server may further generate a second record used for identifying a mapping relationship between the first user and the second video channel, perform calculation based on the multiple-Hash algorithm to obtain a second storage address, and write the second record to second storage space to which the second storage address points, where the second storage space belongs to the mapping record storage area.

In some embodiments of the present invention, an input of the foregoing multiple-Hash algorithm is, for example, user code of the first user (where the user code is several digits), where the user code of the first user is the user identifier of the first user or is obtained by means of conversion based on the user identifier of the first user.

In some embodiments of the present invention, K≥N*M*P, where K denotes the size of total storage space of the foregoing mapping record storage area, M denotes a total quantity of video channels that the foregoing video server can provide, P denotes the size of storage space occupied by storage of a record used for identifying a mapping relationship between a user and a video channel, and N is a positive integer. For example, N may be equal to, for example, 1, 2, 3, 4, 5, 6 or another value.

For example, assuming that P=10 bytes, M is equal to 100, and N is equal to 6, K may be greater than or equal to 6000 bytes. Because addressing space of the mapping record storage area is greater than or equal to the total quantity of the video channels that the video server can provide, it helps allocate as fully as possible the video channels that the video server can provide, and also facilitates improvement in video channel utilization.

For example, the mapping record storage area may include at least N mapping record storage sub-areas, and the size of storage space of each mapping record storage sub-area is greater than or equal to M*P, where M denotes a total quantity of video channels that the foregoing video server can provide, and P denotes the size of storage space occupied by storage of a record used for identifying a mapping relationship between a user and a video channel. However, in this scenario, each single-Hash algorithm in the multiple-Hash algorithm may correspond to different mapping record storage sub-areas, and denominators of the single-Hash algorithms are different, and may be prime numbers less than M.

In some embodiments of the present invention, if the first video channel corresponding to the first user is found through the querying successfully, the video server may write the first video data to the first video channel.

In some embodiments of the present invention, if the first video data is written to the first video channel, a time stamp of the first video channel may be further updated. It can be understood that, a time denoted by the updated time stamp of the first video channel is a time at which the first video data is written to the first video channel.

In some embodiments of the present invention, the video channel management method may further include: if the second video channel that is currently already timed out is not allocated to the first user successfully, attempting to allocate a third video channel to the first user, the third video channel being a channel that is currently idle, and if the third video channel that is currently idle is allocated to the first user successfully, writing the first video data to the third video channel, and tagging that the third video channel belongs to the first user (for example, writing a user identifier of the first user to the third video channel). Moreover, if the third video channel that is currently idle is not allocated to the first user successfully (currently, there may be no idle video channel), it may be prompted that the first user acquires a video channel unsuccessfully (for example, a prompt message used for prompting that a video channel is acquired unsuccessfully may be sent to the first user terminal).

In some other embodiments of the present invention, before the attempting to allocate a second video channel that is currently already timed out to the first user, the method may further include: if the first video channel corresponding to the first user is not found successfully through the querying, attempting to allocate a third video channel that is currently idle to the first user, and if the third video channel that is currently idle is allocated to the first user successfully, writing the first video data to the third video channel, and tagging that the third video channel belongs to the first user; and if the third video channel that is currently idle fails to be allocated to the first user successfully, performing the step of attempting to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writing the first video data to the second video channel, and tagging that the second video channel belongs to the first user. Moreover, if the second video channel that is currently already timed out is not allocated to the first user successfully (currently, there may be no video channel that currently already times out), it may be prompted that the first user acquires a video channel unsuccessfully (for example, a prompt message used for prompting that a video channel is acquired unsuccessfully may be sent to the first user terminal).

In some embodiments of the present invention, if the third video channel that is currently idle is allocated to the first user successfully, the video server may further generate a third record used for identifying a mapping relationship between the first user and the third video channel, perform calculation based on the multiple-Hash algorithm to obtain a third storage address, and write the third record to third storage space to which the third storage address points, where the third storage space belongs to the mapping record storage area.

In some embodiments of the present invention, if the first video data is written to the third video channel, a time stamp of the third video channel may be further updated. It can be understood that, a time denoted by the updated time stamp of the third video channel is a time at which the first video data is written to the third video channel.

It can be understood that, in some embodiments of the present invention, when a piece of video data (such as the first video data) is written to a video channel, a time stamp of the video channel may be further updated, and a time denoted by the updated time stamp of the video channel is a time at which the video data is written to the video channel.

In some embodiments of the present invention, the video channel management method may further include: resetting, when a channel resetting condition is satisfied, some or all video channels that are currently already timed out to idle video channels.

In some embodiments of the present invention, the channel resetting condition may be various feasible conditions that are set according to actual scenario needs. For example, the channel resetting condition may include at least one of the following conditions: a quantity of video channels that are currently idle is less than a first threshold (such as 10 or another value), a proportion of a quantity of video channels that are currently idle to a total channel quantity is less than a second threshold (such as 15% or another value), a timeout video channel resetting instruction is received, a quantity of video channels that are currently already timed out is greater than a third threshold (such as 20 or another value), a set resetting period (such as 1 minute, two minutes or another value) arrives, a proportion of a quantity of video channels that are currently already timed out to a total channel quantity is greater than a fourth threshold (such as 50% or another value), and a ratio of a quantity of video channels that are currently already timed out to a quantity of video channels that are currently idle is greater than a fifth threshold (such as 100% or another value).

Values of the thresholds (such as the first threshold, the second threshold, the third threshold, the fourth threshold and the fifth threshold) of this embodiment of the present invention may be set according to specific scenario needs, as long as the values can satisfy actual needs.

It can be understood that, when the set channel resetting condition is satisfied, some or all video channels that are currently already timed out are reset to idle video channels, and therefore based on this mechanism, the video server may obtain idle video channels in batches, which lays a foundation for subsequent improvement in video channel utilization efficiency.

In some embodiments of the present invention, the resetting, when a channel resetting condition is satisfied, some or all video channels that are currently already timed out to idle video channels may include: resetting, when a quantity of video channels that are currently idle is less than a first threshold, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a proportion of a quantity of video channels that are currently idle to a total channel quantity is less than a second threshold, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a timeout video channel resetting instruction is received, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a set resetting period arrives, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a quantity of video channels that are currently already timed out is greater than a third threshold, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a proportion of a quantity of video channels that are currently already timed out to a total channel quantity is greater than a fourth threshold, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a ratio of a quantity of video channels that are currently already timed out to a quantity of video channels that are currently idle is greater than a fifth threshold, the some or all video channels that are currently already timed out to idle video channels.

It can be seen from above that, in the solution of this embodiment, after receiving first video data, a video server first queries a first video channel corresponding to a first user to which the first video data belongs; and if the first video channel corresponding to the first user is found through the querying successfully, writes the first video data to the first video channel; or if the first video channel corresponding to the first user is not found successfully through the querying, attempts to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user. A video channel time management mechanism is introduced, and a video channel that is currently already timed out may be allocated again to and used by another user, so that at different moments, a same video channel may be allocated repetitively to and used by multiple different users, which greatly improves video channel utilization efficiency, and then may reduce hardware resource deployment as much as possible. Moreover, based on this mechanism, a video channel does not need to be fixedly allocated to each user. Therefore, a conventional video channel allocation mechanism may be abandoned, and the disclosed video allocation management method can facilitate great increase in a quantity of access users allowed by the video server.

For convenience of better understanding and implementing the foregoing aspect of the embodiments of the present invention, further description is performed below by exemplifying several application scenarios.

Referring toFIG. 2,FIG. 2is a schematic flowchart of another video channel allocation management method according to an embodiment of the present invention. As shown inFIG. 2, the another video channel allocation management method provided in this embodiment of the present invention may include the following contents.

201: A video server receives first video data from a first user terminal.

For example, after a user terminal (which may be referred to as a first user terminal for convenience of quotation) establishes a connection to a video server, the first user terminal may send a piece of video data (which is referred to as first video data for convenience of quotation) to the video server, and the video server may receive the first video data from the first user terminal. The first user terminal sending the first video data belongs to a user (which may be referred to as a first user). The first video data may be live video data, and certainly may also be another type of video data packet.

202: The video server queries whether a first video channel corresponding to a first user to which the first video data belongs exists. When the first video channel corresponding to the first user exist, step203is performed; or when the first video channel corresponding to the first user does not exist, step204is performed.

203: If the first video channel corresponding to the first user is found through the querying successfully, the video server writes the first video data to the first video channel, and updates a time stamp of the first video channel.

It can be understood that, a time denoted by the updated time stamp of the first video channel is a time at which the first video data is written to the first video channel.

204: If the first video channel corresponding to the first user is not found through the querying successfully, the video server attempts to allocate a second video channel that is currently already timed out to the first user. If the video server attempts to allocate the second video channel that is currently already timed out to the first user successfully (if a video channel that is timed out exists currently, the video server may attempt to allocate the second video channel that is currently already timed out to the first user successfully), step205is performed; or if the video server attempts to allocate the second video channel that is currently already timed out to the first user unsuccessfully (if a video channel that is timed out does not exist currently, the video server attempts to allocate the second video channel that is currently already timed out to the first user unsuccessfully), step206is performed.

205: If the second video channel that is currently already timed out is allocated to the first user successfully, the video server writes the first video data to the second video channel, tags that the second video channel belongs to the first user, and updates a time stamp of the second video channel.

206: If the second video channel that is currently already timed out is not allocated to the first user successfully, the video server attempts to allocate a third video channel that is currently idle to the first user. If the video server attempts to allocate the third video channel that is currently idle to the first user successfully (if an idle video channel exists currently, the video server may attempt to allocate the third video channel that is currently idle to the first user successfully), step207is performed; or if the video server attempts to allocate the third video channel that is currently idle to the first user unsuccessfully (if an idle video channel does not exist currently, the video server attempts to allocate the third video channel that is currently idle to the first user unsuccessfully), step208is performed.

207: If the third video channel that is currently idle is allocated to the first user successfully, the video server writes the first video data to the third video channel, tags that the third video channel belongs to the first user, and updates a time stamp of the third video channel.

208: If the third video channel that is currently idle is not allocated to the first user successfully, the video server sends a prompt message used for prompting that a video channel is acquired unsuccessfully to the first user terminal.

It can be seen from above that, in the solution of this embodiment, after receiving first video data, a video server first queries a first video channel corresponding to a first user to which the first video data belongs; and if the first video channel corresponding to the first user is found through the querying successfully, writes the first video data to the first video channel; or if the first video channel corresponding to the first user is not found successfully through the querying, attempts to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user; and if the second video channel that is currently already timed out is not allocated to the first user successfully, the video server attempts to allocate a third video channel that is currently idle to the first user. A video channel time management mechanism based on a time stamp is introduced, and a video channel that is currently already timed out may be allocated again to and used by another user, so that a same video channel may be allocated repetitively to and used by multiple different users, which greatly improves video channel utilization efficiency, and then may reduce hardware resource deployment as much as possible. Moreover, based on this mechanism, a video channel does not need to be fixedly allocated to each user, and therefore, a conventional video channel allocation mechanism may be abandoned, and the disclosed method and system can facilitates great increase in a quantity of access users allowed by the video server.

Referring toFIG. 3,FIG. 3is a schematic flowchart of another video channel allocation management method according to an embodiment of the present invention. As shown inFIG. 3, the another video channel allocation management method provided in this embodiment of the present invention may include the following contents.

301: A video server receives first video data from a first user terminal.

302: The video server queries whether a first video channel corresponding to a first user to which the first video data belongs exists. When the first video channel corresponding to the first user exist, step303is performed; or when the first video channel corresponding to the first user does not exist, step304is performed.

303: If the first video channel corresponding to the first user is found through the querying successfully, the video server writes the first video data to the first video channel, and updates a time stamp of the first video channel.

304: If the first video channel corresponding to the first user is not found through the querying successfully, the video server attempts to allocate a third video channel that is currently idle to the first user. If the video server attempts to allocate the third video channel that is currently idle to the first user successfully, step305is performed; or if the video server attempts to allocate the third video channel that is currently idle to the first user unsuccessfully, step306is performed.

305: If the third video channel that is currently idle is allocated to the first user successfully, the video server writes the first video data to the third video channel, tags that the third video channel belongs to the first user, and updates a time stamp of the third video channel.

306: If the third video channel that is currently idle is not allocated to the first user successfully, the video server attempts to allocate a second video channel that is currently already timed out to the first user. If the video server attempts to allocate the second video channel that is currently already timed out to the first user successfully, step307is performed; or if the video server attempts to allocate the second video channel that is currently already timed out to the first user unsuccessfully, step308is performed.

307: If the second video channel that is currently already timed out is allocated to the first user successfully, the video server writes the first video data to the second video channel, tags that the second video channel belongs to the first user, and updates a time stamp of the second video channel.

308: If the second video channel that is currently already timed out is not allocated to the first user successfully, the video server sends a prompt message used for prompting that a video channel is acquired unsuccessfully to the first user terminal.

It can be seen from above that, in the solution of this embodiment, after receiving first video data, a video server first queries a first video channel corresponding to a first user to which the first video data belongs; and if the first video channel corresponding to the first user is found through the querying successfully, writes the first video data to the first video channel; or if the video channel corresponding to the first user is not found through the querying successfully, attempts to allocate a third video channel that is currently idle to the first user; and if the third video channel that is currently idle is not allocated to the first user successfully, attempts to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user. A video channel time management mechanism based on a time stamp is introduced, and a video channel that is currently already timed out may be allocated again to and used by another user, so that at different moments, a same video channel may be allocated repetitively to and used by multiple different users, which greatly improves video channel utilization efficiency, and then may reduce hardware resource deployment as much as possible. Moreover, based on this mechanism, a video channel does not need to be fixedly allocated to each user, and therefore, a conventional video channel allocation mechanism may be abandoned, and the disclosed method and system can facilitates great increase in a quantity of access users allowed by the video server.

For convenience of better understanding and implementing the foregoing aspect of the embodiments of the present invention, further description is performed below by exemplifying a more specific application scenario.

In Example 1 and Example 2, it is assumed that the video server may provide at most 100 video channels. It is assumed that a user terminal a used by a user A establishes a connection to a video server.

It is assumed that the video server receives video data s1from the user terminal a, where the video data s1carries a user identifier of the user A; the video server queries, based on the user identifier of the user A, whether a first video channel corresponding to the user A to which the video data s1belongs exists; if the first video channel corresponding to the user A is found through the querying successfully, the video server may write the video data s1to the first video channel, and update a time stamp of the first video channel; or if the first video channel corresponding to the user A is not found through the querying successfully, the video server attempts to allocate a second video channel that is currently already timed out to the user A; if the second video channel that is currently already timed out is allocated to the user A successfully, the video server writes the video data s1to the second video channel, tags that the second video channel belongs to the user A, and updates a time stamp of the second video channel; or if the second video channel that is currently already timed out is not allocated to the user A successfully, the video server may attempt to allocate a third video channel that is currently idle to the user A; and if the third video channel that is currently idle is allocated to the user A successfully, the video server writes the video data s1to the third video channel, tags that the third video channel belongs to the user A, and updates a time stamp of the third video channel; or if the third video channel that is currently idle is not allocated to the user A successfully, the video server may send a prompt message to the user terminal a indicating that acquiring a video channel is failed.

It is assumed that the video server receives video data s1from the user terminal a, where the video data s1carries a user identifier of the user A; the video server queries, based on the user identifier of the user A, whether a first video channel corresponding to the user A to which the video data s1belongs exists; if the first video channel corresponding to the user A is found through the querying successfully, the video server may write the video data s1to the first video channel, and update a time stamp of the first video channel; or if the first video channel corresponding to the user A is not found through the querying successfully, the video server attempts to allocate a third video channel that is currently idle to the user A; if the third video channel that is currently idle is allocated to the user A successfully, the video server writes the video data s1to the third video channel, tags that the third video channel belongs to the user A, and updates a time stamp of the third video channel; or if the third video channel that is currently idle is not allocated to the user A successfully, the video server may attempt to allocate a second video channel that is currently already timed out to the user A; and if the second video channel that is currently already timed out is allocated to the user A successfully, the video server writes the video data s1to the second video channel, tags that the second video channel belongs to the user A, and updates a time stamp of the second video channel; or if the second video channel that is currently already timed out is not allocated to the user A successfully, the video server may send a prompt message used for prompting that a video channel is acquired unsuccessfully to the user terminal a.

It can be seen that, based on the mechanism of this embodiment of the present invention, it becomes possible that one video server may accommodate thousands of users. Indefinite number of users may be added to one video server theoretically. Further, holding a large conference by using one video server may be implemented.

For convenience of better implementing the foregoing solutions of the embodiments of the present invention, a related apparatus for implementing the foregoing solutions is further provided below.

Referring toFIG. 4a, an embodiment of the present invention provides a video server400that may include: a receiving unit410, a query unit420, a writing unit430and an allocation unit440.

The receiving unit410is configured to receive first video data.

In some embodiments of the present invention, the first video data may further include, for example, a user identifier of the first user.

The query unit420is configured to query a first video channel corresponding to a first user to which the first video data belongs.

In some embodiments of the present invention, before the receiving unit410receives the first video data, the allocation unit440may already allocate a video channel to the first user, or may not yet allocate a video channel to the first user, where the allocation unit440may not allocate a video channel to the first user previously, or the allocation unit440may allocate a video channel previously allocated to the first user to another user, or the video server may reset a video channel previously allocated to the first user to an idle video channel, where the idle video channel does not belong to any user.

The allocation unit440is configured to: if the query unit420does not find the first video channel corresponding to the first user through the querying successfully, attempt to allocate a second video channel that is currently already timed out to the first user.

The writing unit430is configured to: if the allocation unit440allocates the second video channel that is currently already timed out to the first user successfully, write the first video data to the second video channel, and tag that the second video channel belongs to the first user.

In some embodiments of the present invention, the writing unit430is further configured to: if the query unit420finds the first video channel corresponding to the first user through the querying successfully, write the first video data to the first video channel.

In some embodiments of the present invention, a video channel that is timed out may refer to that a time denoted by a time stamp corresponding to the video channel lags behind a current time by over a first time length threshold, where the first time length threshold may be, for example, one second, two seconds, three seconds or another time length that is set according to an actual need. The video channel that is timed out belongs to a user.

In some embodiments of the present invention, the allocation unit440is further configured to: if the second video channel that is currently already timed out is not allocated to the first user successfully, attempt to allocate a third video channel that is currently idle to the first user; and the writing unit430is further configured to: if the third video channel that is currently idle is allocated to the first user successfully, write the first video data to the third video channel, and tag that the third video channel belongs to the first user.

In some other embodiments of the present invention, the allocation unit440is specifically configured to: if the query unit420does not find the video channel corresponding to the first user through the querying successfully, attempt to allocate a video channel that is currently idle to the first user; and if the video channel that is currently idle fails to be allocated to the first user successfully, attempt to allocate a video channel that is currently already timed out to the first user.

The writing unit430is further configured to: if the allocation unit440allocates the third video channel that is currently idle to the first user successfully, write the first video data to the third video channel, and tag that the third video channel belongs to the first user.

In some embodiments of the present invention, the query unit420may be specifically configured to: search, based on a multiple-Hash algorithm (or a traversal algorithm or another algorithm), for whether a record used for identifying a mapping relationship between the first user and the first video channel is stored in a mapping record storage area, and if the record used for identifying the mapping relationship between the first user and the first video channel is not found in the mapping record storage area, determine that the first video channel corresponding to the first user is not found through the querying successfully, or if the record used for identifying the mapping relationship between the first user and the first video channel is found in the mapping record storage area, determine that the first video channel corresponding to the first user is found through the querying successfully.

In some embodiments of the present invention, an input of the foregoing multiple-Hash algorithm is, for example, user code of the first user (where the user code is several digits), where the user code of the first user is the user identifier of the first user or is obtained by means of conversion based on the user identifier of the first user.

Referring toFIG. 4b, in some embodiments of the present invention, the video server400may further include: a time stamp updating unit450, configured to: if the writing unit430writes the first video data to the first video channel, update a time stamp of the first video channel; or if the writing unit430writes the first video data to the second video channel, update a time stamp of the second video channel; or if the writing unit430writes the first video data to the third video channel, update a time stamp of the third video channel.

Referring toFIG. 4c, in some embodiments of the present invention, the video server400may further include: a channel resetting unit460, configured to reset, when a channel resetting condition is satisfied, some or all video channels that are currently already timed out to idle video channels.

In some embodiments of the present invention, the channel resetting condition may be various feasible conditions that are set according to actual scenario needs. For example, the channel resetting condition may include at least one of the following conditions: a quantity of video channels that are currently idle is less than a first threshold (such as 10 or another value), a proportion of a quantity of video channels that are currently idle to a total channel quantity is less than a second threshold (such as 15% or another value), a timeout video channel resetting instruction is received, a quantity of video channels that are currently already timed out is greater than a third threshold (such as 20 or another value), a set resetting period (such as 1 minute, two minutes or another value) arrives, a proportion of a quantity of video channels that are currently already timed out to a total channel quantity is greater than a fourth threshold (such as 50% or another value), and a ratio of a quantity of video channels that are currently already timed out to a quantity of video channels that are currently idle is greater than a fifth threshold (such as 100% or another value).

In some embodiments of the present invention, the channel resetting unit460may be specifically configured to reset, when a quantity of video channels that are currently idle is less than a first threshold, the some or all video channels that are currently already timed out to idle video channels; or reset, when a proportion of a quantity of video channels that are currently idle to a total channel quantity is less than a second threshold, the some or all video channels that are currently already timed out to idle video channels; or reset, when a timeout video channel resetting instruction is received, the some or all video channels that are currently already timed out to idle video channels; or reset, when a set resetting period arrives, the some or all video channels that are currently already timed out to idle video channels; or reset, when a quantity of video channels that are currently already timed out is greater than a third threshold, the some or all video channels that are currently already timed out to idle video channels; or reset, when a proportion of a quantity of video channels that are currently already timed out to a total channel quantity is greater than a fourth threshold, the some or all video channels that are currently already timed out to idle video channels; or reset, when a ratio of a quantity of video channels that are currently already timed out to a quantity of video channels that are currently idle is greater than a fifth threshold, the some or all video channels that are currently already timed out to idle video channels.

It can be understood that functions of functional modules of the video server400in this embodiment can be specifically implemented according to the method in the foregoing method embodiments, and reference may be made to a related description of the foregoing method embodiments for a specific implementation process thereof, which is not described herein in detail.

It can be seen from above that, in the solution of this embodiment, after receiving first video data, a video server400first queries a first video channel corresponding to a first user to which the first video data belongs; and if the first video channel corresponding to the first user is found through the querying successfully, writes the first video data to the first video channel; or if the first video channel corresponding to the first user is not found successfully through the querying, attempts to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user. A video channel time management mechanism is introduced, and a video channel that is currently already timed out may be allocated again to and used by another user, so that at different moments, a same video channel may be allocated repetitively to and used by multiple different users, which greatly improves video channel utilization efficiency, and then may reduce hardware resource deployment as much as possible. Moreover, based on this mechanism, a video channel does not need to be fixedly allocated to each user, and therefore, a conventional video channel allocation mechanism may be abandoned, and the disclosed method and system can facilitates great increase in a quantity of access users allowed by the video server.

Referring toFIG. 5, an embodiment of the present invention provides a video server500that may include: a processor510, a memory520, an input apparatus530and an output apparatus540. There may be one or more processors510in the video server500, and inFIG. 5, one processor is used as an example. In some embodiments of the present invention, the processor510, the memory520, the input apparatus530and the output apparatus540may be connected by using a bus or in another manner. InFIG. 5, as an example, the processor510, the memory520, the input apparatus530and the output apparatus540are connected using a bus.

The memory520may be configured to store a software program and module. The processor510runs the software program and module stored in the memory520, to implement various functional applications and data processing of the video server500. The memory520may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (such as a sound playback function and an image display function), and the like. The data storage area may store data (such as audio data and an address book) created according to use of the user terminal, and the like. In addition, the memory520may include a high speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory, or another volatile solid storage device. The input apparatus530may be configured to receive input digit or character information, and generate key signal input related to the user setting and function control of the video server500.

The processor510performs the following steps: receiving first video data; querying a first video channel corresponding to a first user to which the first video data belongs; and if the first video channel corresponding to the first user is not found successfully through the querying, attempting to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writing the first video data to the second video channel, and tagging that the second video channel belongs to the first user.

In some embodiments of the present invention, if the first video channel corresponding to the first user is found through the querying successfully, the processor510may write the first video data to the first video channel.

For example, after a user terminal (which may be referred to as a first user terminal for convenience of quotation) establishes a connection to a video server, the first user terminal may send a piece of video data (which is referred to as first video data for convenience of quotation) to the video server, and the video server may receive the first video data from the first user terminal. The first user terminal sending the first video data belongs to a user (which may be referred to as a first user). The first video data may be live video data, and certainly may also be another type of video data packet.

In some embodiments of the present invention, the first video data may further include, for example, a user identifier of the first user.

In some embodiments of the present invention, before receiving the first video data, the processor510may have already allocated a video channel to the first user, or may not yet allocate a video channel to the first user (the video server may not allocate a video channel to the first user previously, or the processor510may allocate a video channel previously allocated to the first user to another user, or the processor510may reset a video channel previously allocated to the first user to an idle video channel, where the idle video channel does not belong to any user).

A video channel is a storage resource (such as a memory resource), in a video server, that is used for storing video data, and information such as a time stamp, and a user identifier of a user to which the video channel currently belongs may be recorded in the video channel.

In some embodiments of the present invention, if the first video data is written to the first video channel, a time stamp of the first video channel may be further updated. It can be understood that, a time denoted by the updated time stamp of the first video channel is a time at which the first video data is written to the first video channel.

In some embodiments of the present invention, a video channel that is timed out may refer to that a time denoted by a time stamp corresponding to the video channel lags behind a current time by over a first time length threshold, where the first time length threshold may be, for example, one second, two seconds, three seconds or another time length that is set according to an actual need. The video channel that is timed out belongs to a user.

In some embodiments of the present invention, if the first video data is written to the second video channel, a time stamp of the second video channel may be further updated. It can be understood that, a time denoted by the updated time stamp of the second video channel is a time at which the first video data is written to the second video channel.

In some embodiments of the present invention, if the second video channel that is currently already timed out is not allocated to the first user successfully, the processor510may attempt to allocate a third video channel that is currently idle to the first user, and if the third video channel that is currently idle is allocated to the first user successfully, write the first video data to the third video channel, and tag that the third video channel belongs to the first user (for example, write a user identifier of the first user to the third video channel). Moreover, if the third video channel that is currently idle is not allocated to the first user successfully (currently, there may be no idle video channel), it may be prompted that the first user acquires a video channel unsuccessfully (for example, a prompt message used for prompting that a video channel is acquired unsuccessfully may be sent to the first user terminal).

In some other embodiments of the present invention, before the attempting to allocate a second video channel that is currently already timed out to the first user, if the first video channel corresponding to the first user is not found through the querying successfully, the processor510attempts to allocate a third video channel that is currently idle to the first user, and if the third video channel that is currently idle is allocated to the first user successfully, writes the first video data to the third video channel, and tags that the third video channel belongs to the first user; or if the third video channel that is currently idle fails to be allocated to the first user successfully, the processor510then attempts to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user. Moreover, if the second video channel that is currently already timed out is not allocated to the first user successfully (currently, there may be no video channel that currently already times out), the processor510may prompt that the first user acquires a video channel unsuccessfully (for example, a prompt message used for prompting that a video channel is acquired unsuccessfully may be sent to the first user terminal).

In some embodiments of the present invention, if the first video data is written to the third video channel, a time stamp of the third video channel may be further updated. It can be understood that, a time denoted by the updated time stamp of the third video channel is a time at which the first video data is written to the third video channel.

It can be understood that, in some embodiments of the present invention, when a piece of video data (such as the first video data) is written to a video channel, a time stamp of the video channel may be further updated, and a time denoted by the updated time stamp of the video channel is a time at which the video data is written to the video channel.

In some embodiments of the present invention, the querying, by the processor510, a first video channel corresponding to a first user to which the first video data belongs may include: searching, based on a multiple-Hash algorithm (or a traversal algorithm or another algorithm), for whether a record used for identifying a mapping relationship between the first user and the first video channel is stored in a mapping record storage area, and if the record used for identifying the mapping relationship between the first user and the first video channel is not found in the mapping record storage area, determining that the first video channel corresponding to the first user is not found through the querying successfully, or if the record used for identifying the mapping relationship between the first user and the first video channel is found in the mapping record storage area, determining that the first video channel corresponding to the first user is found through the querying successfully.

In some embodiments of the present invention, the processor510may further generate a second record used for identifying a mapping relationship between the first user and the second video channel, perform calculation based on the multiple-Hash algorithm to obtain a second storage address, and write the second record to second storage space to which the second storage address points, where the second storage space belongs to the mapping record storage area.

In some embodiments of the present invention, an input of the foregoing multiple-Hash algorithm is, for example, user code of the first user (where the user code is several digits), where the user code of the first user is the user identifier of the first user or is obtained by means of conversion based on the user identifier of the first user.

In some embodiments of the present invention, K≥N*M*P, where K denotes the size of total storage space of the foregoing mapping record storage area, M denotes a total quantity of video channels that the foregoing video server can provide, P denotes the size of storage space occupied by storage of a record used for identifying a mapping relationship between a user and a video channel, and N is a positive integer. For example, N may be equal to, for example, 1, 2, 3, 4, 5, 6 or another value.

For example, assuming that P=10 bytes, M is equal to 100, and N is equal to 6, K may be greater than or equal to 6000 bytes. Because addressing space of the mapping record storage area is greater than or equal to the total quantity of the video channels that the video server can provide, it helps allocate as fully as possible the video channels that the video server can provide, and also facilitates improvement in video channel utilization.

For example, the mapping record storage area may include at least N mapping record storage sub-areas, and the size of storage space of each mapping record storage sub-area is greater than or equal to M*P, where M denotes a total quantity of video channels that the foregoing video server can provide, and P denotes the size of storage space occupied by storage of a record used for identifying a mapping relationship between a user and a video channel. However, in this scenario, each single-Hash algorithm in the multiple-Hash algorithm may correspond to different mapping record storage sub-areas, and denominators of the single-Hash algorithms are different, and may be prime numbers less than M.

In some embodiments of the present invention, when a channel resetting condition is satisfied, the processor510may reset some or all video channels that are currently already timed out to idle video channels.

In some embodiments of the present invention, the channel resetting condition may be various feasible conditions that are set according to actual scenario needs. For example, the channel resetting condition may include at least one of the following conditions: a quantity of video channels that are currently idle is less than a first threshold (such as 10 or another value), a proportion of a quantity of video channels that are currently idle to a total channel quantity is less than a second threshold (such as 15% or another value), a timeout video channel resetting instruction is received, a quantity of video channels that are currently already timed out is greater than a third threshold (such as 20 or another value), a set resetting period (such as 1 minute, two minutes or another value) arrives, a proportion of a quantity of video channels that are currently already timed out to a total channel quantity is greater than a fourth threshold (such as 50% or another value), and a ratio of a quantity of video channels that are currently already timed out to a quantity of video channels that are currently idle is greater than a fifth threshold (such as 100% or another value).

It can be understood that, when the set channel resetting condition is satisfied, some or all video channels that are currently already timed out are reset to idle video channels, and therefore based on this mechanism, the video server may obtain idle video channels in batches, which lays a foundation for subsequent improvement in video channel utilization efficiency.

In some embodiments of the present invention, the resetting, by the processor510, when a channel resetting condition is satisfied, some or all video channels that are currently already timed out to idle video channels may include: resetting, when a quantity of video channels that are currently idle is less than a first threshold, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a proportion of a quantity of video channels that are currently idle to a total channel quantity is less than a second threshold, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a timeout video channel resetting instruction is received, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a set resetting period arrives, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a quantity of video channels that are currently already timed out is greater than a third threshold, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a proportion of a quantity of video channels that are currently already timed out to a total channel quantity is greater than a fourth threshold, the some or all video channels that are currently already timed out to idle video channels; or resetting, when a ratio of a quantity of video channels that are currently already timed out to a quantity of video channels that are currently idle is greater than a fifth threshold, the some or all video channels that are currently already timed out to idle video channels.

It can be seen from above that, in the solution of this embodiment, after receiving first video data, a video server500first queries a first video channel corresponding to a first user to which the first video data belongs; and if the first video channel corresponding to the first user is found through the querying successfully, writes the first video data to the first video channel; or if the first video channel corresponding to the first user is not found successfully through the querying, attempts to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user. A video channel time management mechanism is introduced, and a video channel that is currently already timed out may be allocated again to and used by another user, so that at different moments, a same video channel may be allocated repetitively to and used by multiple different users, which greatly improves video channel utilization efficiency, and then may reduce hardware resource deployment as much as possible. Moreover, based on this mechanism, a video channel does not need to be fixedly allocated to each user, and therefore, a conventional video channel allocation mechanism may be abandoned, and the disclosed method and system can facilitates great increase in a quantity of access users allowed by the video server.

In some embodiments, the video server500may further facilitate multiple users to access video data from one or more video channels. For example, a first user may send the first video data to the video server500. The video server500may successfully allocate a video channel to the first video data, updates the time stamp, and records information about the user identifier of the first user. A second user may query the video server500using the user identifier of the first user. Based on the user identifier, the video server500may find the video channel corresponding to the first user and send the first video data in the video channel allocated to the first user to the second user. Accordingly, the second user may receive and play the first video data.

Referring toFIG. 6, an embodiment of the present invention further provides a communication system, including: a user terminal600and a video server700, where the user terminal600is configured to send first video data to the video server700; and the video server700is configured to receive the first video data from the user terminal600; query a first video channel corresponding to a first user to which the first video data belongs; and if the first video channel corresponding to the first user is not found successfully through the querying, attempt to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, write the first video data to the second video channel, and tag that the second video channel belongs to the first user. In some embodiments, the video server700may have similar configurations as the video server500.

In some embodiments of the present invention, the video server700may be further configured to: if the first video channel corresponding to the first user is found through the querying successfully, write the first video data to the first video channel.

In some embodiments of the present invention, before receiving the first video data, the video server700may already allocate a video channel to the first user, or may not yet allocate a video channel to the first user (the video server700may not allocate a video channel to the first user previously, or the video server700may allocate a video channel previously allocated to the first user to another user, or the video server700may reset a video channel previously allocated to the first user to an idle video channel).

In some embodiments of the present invention, if the first video data is written to the first video channel, the video server700may further update a time stamp of the first video channel. It can be understood that, a time denoted by the updated time stamp of the first video channel is a time at which the first video data is written to the first video channel.

In some embodiments of the present invention, a video channel that is timed out may refer to that a time denoted by a time stamp corresponding to the video channel lags behind a current time by over a first time length threshold, where the first time length threshold may be, for example, one second, two seconds, three seconds or another time length that is set according to an actual need. The video channel that is timed out belongs to a user.

In some embodiments of the present invention, if the first video data is written to the second video channel, the video server700may further update a time stamp of the second video channel. It can be understood that, a time denoted by the updated time stamp of the second video channel is a time at which the first video data is written to the second video channel.

In some embodiments of the present invention, if the second video channel that is currently already timed out is not allocated to the first user successfully, the video server700may attempt to allocate a third video channel that is currently idle to the first user, and if the third video channel that is currently idle is allocated to the first user successfully, write the first video data to the third video channel, and tag that the third video channel belongs to the first user (for example, write a user identifier of the first user to the third video channel). Moreover, if the third video channel that is currently idle is not allocated to the first user successfully (currently, there may be no idle video channel), it may be prompted that the first user acquires a video channel unsuccessfully (for example, a prompt message used for prompting that a video channel is acquired unsuccessfully may be sent to the first user terminal).

In some other embodiments of the present invention, before attempting to allocate a second video channel that is currently already timed out to the first user, if the first video channel corresponding to the first user is not found successfully through the querying, the video server700attempts to allocate a third video channel that is currently idle to the first user, and if the third video channel that is currently idle is allocated to the first user successfully, writes the first video data to the third video channel, and tags that the third video channel belongs to the first user; and if the third video channel that is currently idle fails to be allocated to the first user successfully, then attempts to allocate a second video channel that is currently already timed out to the first user, and if the second video channel that is currently already timed out is allocated to the first user successfully, writes the first video data to the second video channel, and tags that the second video channel belongs to the first user; and if the second video channel that is currently already timed out is not allocated to the first user successfully, may prompt that the first user acquires a video channel unsuccessfully.

In some embodiments of the present invention, if the first video data is written to the third video channel, the video server700may further update a time stamp of the third video channel. It can be understood that, a time denoted by the updated time stamp of the third video channel is a time at which the first video data is written to the third video channel.

In some embodiments of the present invention, when a channel resetting condition is satisfied, the video server700may further reset some or all video channels that are currently already timed out to idle video channels.

In some embodiments of the present invention, the querying, by the video server700, a first video channel corresponding to a first user to which the first video data belongs may include: searching, based on a multiple-Hash algorithm (or a traversal algorithm or another algorithm), for whether a record used for identifying a mapping relationship between the first user and the first video channel is stored in a mapping record storage area, and if the record used for identifying the mapping relationship between the first user and the first video channel is not found in the mapping record storage area, determining that the first video channel corresponding to the first user is not found through the querying successfully, or if the record used for identifying the mapping relationship between the first user and the first video channel is found in the mapping record storage area, determining that the first video channel corresponding to the first user is found through the querying successfully.

In some embodiments of the present invention, the video server700may further generate a second record used for identifying a mapping relationship between the first user and the second video channel, perform calculation based on the multiple-Hash algorithm to obtain a second storage address, and write the second record to second storage space to which the second storage address points, where the second storage space belongs to the mapping record storage area.

In some embodiments of the present invention, an input of the foregoing multiple-Hash algorithm is, for example, user code of the first user (where the user code is several digits), where the user code of the first user is the user identifier of the first user or is obtained by means of conversion based on the user identifier of the first user.

In some embodiments of the present invention, K≥N*M*P, where K denotes the size of total storage space of the foregoing mapping record storage area, M denotes a total quantity of video channels that the foregoing video server can provide, P denotes the size of storage space occupied by storage of a record used for identifying a mapping relationship between a user and a video channel, and N is a positive integer. For example, N may be equal to, for example, 1, 2, 3, 4, 5, 6 or another value.

For example, assuming that P=10 bytes, M is equal to 100, and N is equal to 6, K may be greater than or equal to 6000 bytes. Because addressing space of the mapping record storage area is greater than or equal to the total quantity of the video channels that the video server can provide, it helps allocate as fully as possible the video channels that the video server can provide, and also facilitates improvement in video channel utilization.

For example, the mapping record storage area may include at least N mapping record storage sub-areas, and the size of storage space of each mapping record storage sub-area is greater than or equal to M*P, where M denotes a total quantity of video channels that the foregoing video server can provide, and P denotes the size of storage space occupied by storage of a record used for identifying a mapping relationship between a user and a video channel. However, in this scenario, each single-Hash algorithm in the multiple-Hash algorithm may correspond to different mapping record storage sub-areas, and denominators of the single-Hash algorithms are different, and may be prime numbers less than M.

In some embodiments of the present invention, the channel resetting condition may be various feasible conditions that are set according to actual scenario needs. For example, the channel resetting condition may include at least one of the following conditions: a quantity of video channels that are currently idle is less than a first threshold (such as 10 or another value), a proportion of a quantity of video channels that are currently idle to a total channel quantity is less than a second threshold (such as 15% or another value), a timeout video channel resetting instruction is received, a quantity of video channels that are currently already timed out is greater than a third threshold (such as 20 or another value), a set resetting period (such as 1 minute, two minutes or another value) arrives, a proportion of a quantity of video channels that are currently already timed out to a total channel quantity is greater than a fourth threshold (such as 50% or another value), and a ratio of a quantity of video channels that are currently already timed out to a quantity of video channels that are currently idle is greater than a fifth threshold (such as 100% or another value).

In some embodiments of the present invention, the video server700may reset, for example, when a quantity of video channels that are currently idle is less than a first threshold, the some or all video channels that are currently already timed out to idle video channels; or reset, when a proportion of a quantity of video channels that are currently idle to a total channel quantity is less than a second threshold, the some or all video channels that are currently already timed out to idle video channels; or reset, when a timeout video channel resetting instruction is received, the some or all video channels that are currently already timed out to idle video channels; or reset, when a set resetting period arrives, the some or all video channels that are currently already timed out to idle video channels; or reset, when a quantity of video channels that are currently already timed out is greater than a third threshold, the some or all video channels that are currently already timed out to idle video channels; or reset, when a proportion of a quantity of video channels that are currently already timed out to a total channel quantity is greater than a fourth threshold, the some or all video channels that are currently already timed out to idle video channels; or reset, when a ratio of a quantity of video channels that are currently already timed out to a quantity of video channels that are currently idle is greater than a fifth threshold, the some or all video channels that are currently already timed out to idle video channels.

As shown inFIG. 7, for convenience of description, only a part related to the embodiments of the present invention is shown, and for specific technical details that are not disclosed, refer to the method part of the embodiments of the present invention. A user terminal600shown inFIG. 7may be any terminal device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), or a vehicle-mounted computer, and an example in which the user terminal600is a mobile phone is mainly used below:

FIG. 7shows a block diagram of a partial structure of a mobile phone related to the terminal provided in this embodiment of the present invention. Referring toFIG. 7, the mobile phone includes: components such as a radio frequency (RF) circuit610, a memory620, an input unit630, a wireless fidelity (WiFi) module670, a display unit640, a sensor650, an audio circuit660, a processor680, and a power supply690.

A person skilled in the art may understand that the structure of the mobile phone shown inFIG. 7does not constitute a limitation to the mobile phone, and the mobile phone may include more components or fewer components than those shown in the figure, or some components may be combined, or a different component deployment may be used.

Each component part of the mobile phone is described below in detail with reference toFIG. 7.

The RF circuit610may be configured to receive and send a signal during an information receiving and sending process or a call process. Specifically, the RF circuit receives downlink information from a base station, then delivers the downlink information to the processor680for processing, and sends related uplink data to the base station. Generally, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), and a duplexer. In addition, the RF circuit60may also communicate with a network and another device by wireless communication. The wireless communication may use any communications standard or protocol, which includes, but is not limited to, Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), and the like.

The memory620may be configured to store a software program and module (e.g., a program for collecting and sending video data). The processor680runs the software program and module stored in the memory620, to implement various functional applications and data processing of the mobile phone. The memory620may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (such as a sound playback function and an image display function), and the like. The data storage area may store data (such as audio data and an address book) created according to use of the mobile phone, and the like. In addition, the memory620may include a high speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory, or another volatile solid storage device.

The input unit630may be configured to receive input digit or character information, and generate key signal input related to the user setting and function control of the mobile phone600. Specifically, the input unit630may include a touch panel631and another input device632. The touch panel631may also be referred to as a touch screen, and may collect a touch operation of a user on or near the touch panel (such as an operation of a user on or near the touch panel631by using any suitable object or attachment, such as a finger or a touch pen), and drive a corresponding connection apparatus according to a preset program. Optionally, the touch panel631may include two parts: a touch detection apparatus and a touch controller. The touch detection apparatus detects a touch position of the user, detects a signal generated by the touch operation, and transfers the signal to the touch controller. The touch controller receives the touch information from the touch detection apparatus, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor680. Moreover, the touch controller can receive and execute a command sent from the processor680. In addition, the touch panel631may be implemented by using various types, such as a resistive type, a capacitance type, an infrared type, and a surface sound wave type. In addition to the touch panel631, the input unit630may further include the another input device632. Specifically, the another input device632may include, but is not limited to, one or more of a physical keyboard, a functional key (such as a volume control key or a switch key), a track ball, a mouse, a joystick, and the like.

The display unit640may be configured to display information input by the user or information provided for the user, and various menus of the mobile phone. The display unit640may include a display panel641. Optionally, the display panel641may be configured by using a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel631may cover the display panel641. After detecting a touch operation on or near the touch panel631, the touch panel631transfers the touch operation to the processor680, so as to determine a type of a touch event. Then, the processor680provides corresponding visual output on the display panel641according to the type of the touch event. Although, inFIG. 7, the touch panel631and the display panel641are used as two separate parts to implement input and output functions of the mobile phone, in some embodiments, the touch panel631and the display panel641may be integrated to implement the input and output functions of the mobile phone.

The mobile phone600may further include at least one sensor650, such as, a light sensor, a motion sensor, or other sensors. Specifically, the optical sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor may adjust luminance of the display panel641according to brightness of the ambient light. The proximity sensor may switch off the display panel641and/or backlight when the mobile phone is moved to the ear. As one type of motion sensor, an accelerometer sensor may detect magnitude of accelerations at various directions (which generally are tri-axial), may detect magnitude and a direction of the gravity when static, and may be configured to identify an application of a mobile phone gesture (such as switchover between horizontal and vertical screens, a related game, and gesture calibration of a magnetometer), a related function of vibration identification (such as a pedometer and a knock). Other sensors, such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be configured in the mobile phone are not further described herein.

The audio circuit660, a loudspeaker661, and a microphone662may provide audio interfaces between the user and the mobile phone. The audio circuit660may transmit, to the loudspeaker661, an electric signal converted from received audio data. The loudspeaker661converts the electric signal into a sound signal for output. On the other hand, the microphone662converts a collected sound signal into an electric signal. The audio circuit660receives the electric signal and converts the electric signal into audio data, and outputs the audio data to the processor680for processing. Then, the processor580sends the audio data to, for example, another mobile phone by using the RF circuit610, or outputs the audio data to the memory620for further processing.

WiFi belongs to a short distance wireless transmission technology. The mobile phone may help, by using the WiFi module670, a user to receive and send an e-mail, browse a webpage, access stream media, and the like, which provides wireless broadband Internet access for the user. AlthoughFIG. 7shows the WiFi module670, it may be understood that, the WiFi module170does not belong to a necessary constitution of the mobile phone600, and can be ignored according to demands without changing the scope of the essence of the present disclosure.

The processor680is a control center of the mobile phone, and connects to various parts of the mobile phone by using various interfaces and lines. By running or executing the software program and/or module stored in the memory620, and invoking data stored in the memory620, the processor580performs various functions and data processing of the mobile phone, thereby performing overall monitoring on the mobile phone. Optionally, the processor680may include one or more processing units. Preferably, the processor680may integrate an application processor and a modem. The application processor mainly processes an operating system, a user interface, an application program, and the like. The modem mainly processes wireless communication. It may be understood that, the foregoing modem may also not be integrated into the processor680.

The mobile phone600further includes the power supply690(such as a battery) for supplying power to the components. Preferably, the power supply may logically connect to the processor680by using a power supply management system, thereby implementing functions, such as charging, discharging, and power consumption management, by using the power supply management system. Although not shown in the figure, the mobile phone600may further include a camera, a Bluetooth module, and the like, which are not further described herein.

In this embodiment of the present invention, the processor680included in the user terminal further has the following function: sending first video data to a video server. For example, an application may be installed on the user terminal600and executed by the processor680to facilitate sending the first video data. The application may provide a user interface for a user to record a video data in real time by the camera and/or audio circuit660and send the real-time video data to the video server700through the WiFi module670or RF circuit610. The user may also select a video data from memory620or cloud storage on the user interface, and the selected video data may be sent to the video server700. When the video server700fails to allocate a video channel for the received video data, the video server700may inform the application to display a failure notice. When the video server700successfully allocates a video channel for the received video data, the video server700may inform the application to display a success message. When the user terminal600is collecting and sending live video data to the video server700, the video server700may continuously use the allocated video channel to receive the live video data.

The application installed on the user terminal600may be further configured to receive and watch video data from one or more other users transmitted by the video server700. The other users may user a user terminal600to send video data to the video server700. For example, the application may facilitate a multi-user video conference hosted by the video server700. The user interface of the application may show icons of multiple participants in the video conference, and display live video data of some or all participants transmitted from the video server700. Each live video data of some or all participants may be allocated with its own video channel by the video server700.

In another example, the application installed on the user terminal600may be a video streaming/sharing software program. The application may connect to the video server700and broadcast/share his/her own video data. Further, the application may connect to the video server700and browse/watch live streaming video data from other users, or browse/watch video data previously streamed or previously uploaded by the user himself or other users.

The embodiments of the present invention further provide a computer storage medium, where the computer storage medium can store a program, and when being executed, the program includes some or all steps of the video channel allocation management method recorded in the method embodiments.

It should be noted that the foregoing method embodiments are expressed as a series of action combinations for the purpose of brief description, but a person of ordinary skills in the art should know that because some steps may be performed in other sequences or simultaneously according to the present disclosure, the present disclosure is not limited to a described action sequence. In addition, a person skilled in the art should also know that the embodiments described in this specification are all preferred embodiments; and therefore, an action and a module involved are not necessarily mandatory in the present disclosure.

In the foregoing embodiments, descriptions of the embodiments have different emphases, and as for parts that are not described in detail in one embodiment, reference can be made to the relevant description of the other embodiments.