CN115037968A - Video playing method and device, storage medium and electronic device - Google Patents

Video playing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN115037968A
CN115037968A CN202210690258.3A CN202210690258A CN115037968A CN 115037968 A CN115037968 A CN 115037968A CN 202210690258 A CN202210690258 A CN 202210690258A CN 115037968 A CN115037968 A CN 115037968A
Authority
CN
China
Prior art keywords
user
target
video
users
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210690258.3A
Other languages
Chinese (zh)
Inventor
李影艳
周兴晨
余乐新
丁昱
陈海军
王昊
史健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202210690258.3A priority Critical patent/CN115037968A/en
Publication of CN115037968A publication Critical patent/CN115037968A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention provides a video playing method, a video playing device, a storage medium and an electronic device, wherein the method comprises the following steps: receiving a video playing request sent by a first user; under the condition that the current service resource occupancy rate is determined to reach a preset threshold value, determining a target user from N other users based on the levels of the N other users except the first user and the picture activity weight of a channel currently occupied by each other user; and closing the target video played through the channel currently occupied by the target user, and returning to the first user and playing the first video requested to be played by the video playing request. According to the invention, the problem of lower accuracy of video resource preemption in the related technology is solved, and the effect of improving the accuracy of video resource preemption is further achieved.

Description

Video playing method and device, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the field of communication, in particular to a video playing method and device, a storage medium and an electronic device.
Background
In the related field, corresponding resources can be allocated according to the uplink and downlink requirements of video services, and under the condition of insufficient resources, the resources occupied by different video services can be adjusted.
In the prior art, under the condition of insufficient resources, high-definition video services and ordinary video services can be separated, the high-definition video services occupy the resources of the ordinary video services by compressing the request bandwidth of the ordinary video services, and the occupied ordinary video services are recovered when the high-definition video exits. However, in the prior art, only for high-definition services and common service scenes, high-definition users seize resources of common users, and the method is not applicable when all the high-definition users are common users, so that the accuracy of video resource seizing is low.
In view of the above problems in the related art, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a video playing method, a video playing device, a storage medium and an electronic device, and at least solves the problem that the accuracy of video resource preemption is low in the related art.
According to an embodiment of the present invention, there is provided a video playing method, including: receiving a video playing request sent by a first user; under the condition that the current service resource occupancy rate is determined to reach a preset threshold value, determining a target user from N other users based on the levels of the N other users except the first user and the picture activity weight of a channel currently occupied by each other user, wherein the picture activity weight is used for indicating the motion degree of a target object in a video picture played through the currently occupied channel; and closing the target video played through the channel currently occupied by the target user, and returning and playing the first video requested to be played by the video playing request to the first user.
Optionally, in a case that it is determined that the current service resource occupancy rate reaches a predetermined threshold, determining a target user from the N other users based on levels of the N other users except the first user and a picture activity weight of a channel currently occupied by each of the other users includes: determining a first user group where the first user is located and a plurality of second user groups where the N other users are located respectively, wherein each user group is divided according to the permission levels of the users, and the permission levels of the users in the same user group are the same; and under the condition that a plurality of second user groups comprise target user groups of which the corresponding permission levels are lower than or equal to the permission level corresponding to the first user group, determining the target users from the target user groups based on the picture activity weights of channels currently occupied by all the users included in the target user groups.
Optionally, when the number of the target user groups is multiple, determining, based on the screen activity weights of channels currently occupied by all users included in the target user groups, that the target user includes: determining the target user group with the lowest corresponding permission level in a plurality of target user groups; and determining the target user from the target user group with the lowest permission level based on the picture activity weights of the channels currently occupied by all users included in the target user group with the lowest permission level.
Optionally, determining the target user from the target user group based on the picture activity weights of channels currently occupied by all users included in the target user group includes: determining a second user as the target user under the condition that the target user group only comprises one second user, wherein the picture activity weight of a channel currently occupied by the second user is smaller than a preset weight threshold; and under the condition that the target user group comprises a plurality of second users, determining the second user with the smallest difference value between the code stream value of the channel currently occupied by the plurality of second users and the current code stream value of the channel currently occupied by the first user as the target user.
Optionally, the following operations are performed for each of the other users to determine the picture activity weight of the channel currently occupied by each of the other users: acquiring the number of target objects and the movement frequency of each target object in a first video picture played by the other users through a currently occupied channel, wherein the movement frequency is used for indicating the movement degree of the target object; and determining the picture activity weight of the channel currently occupied by the other users according to the number of the target objects and the motion frequency of each target object.
Optionally, determining the picture activity weight of the channel currently occupied by the other user according to the number of the target objects and the motion frequency of each target object, includes: determining the number of the target objects and the weight corresponding to the motion frequency respectively; and determining the picture activity weight of the channel currently occupied by the other users by performing weighted summation on the number of the target objects and the sum of the motion frequency of the target objects.
Optionally, after determining the target user from the N other users, the method includes: identifying a target channel currently occupied by the target user as a preempted state; and setting the picture activity weight of the target channel to be zero.
Optionally, after the target video played through the channel currently occupied by the target user is closed, and the first video requested to be played by the video playing request is returned to the first user and played, the method further includes at least one of: resuming playing the target video when the first user closes the first video; and when detecting that the bandwidth resource released by a third user who is currently offline is larger than or equal to the bandwidth required by the target user for playing the target video and/or the processor resource released by the third user is larger than or equal to the processor resource required by the target user for playing the target video, resuming playing the target video.
Optionally, the determining that the current service resource occupancy rate reaches the predetermined threshold includes: and under the condition that the sum of the occupied bandwidth of the N other users and the bandwidth requested by the first user is greater than a preset bandwidth threshold value or the utilization rate of the current processor is greater than a preset utilization rate threshold value, determining that the current occupancy rate of the service resources reaches the preset threshold value.
According to another embodiment of the present invention, there is provided a video playback apparatus including: the receiving module is used for receiving a video playing request sent by a first user; the determining module is used for determining a target user from N other users based on the levels of the N other users except the first user and the picture activity weight of a channel currently occupied by each other user under the condition that the current service resource occupancy rate is determined to reach a preset threshold, wherein the picture activity weight represents the frequency of the motion of a target object in a video picture; and the playing module is used for closing the target video played through the channel currently occupied by the target user, returning the target video to the first user and playing the first video requested to be played by the video playing request.
According to yet another embodiment of the invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by a processor, implements the steps of the method as set forth in any of the above.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
By the invention, the reasonable distribution of the video resources can be realized by receiving the video playing request sent by the first user, determining the target user from the N other users based on the levels of the N other users except the first user and the image activity weight of the channel currently occupied by each other user under the condition that the current service resource occupancy rate is determined to reach the preset threshold value, closing the target video played by the channel occupied by the target user after the target user is determined, returning and playing the first video requested to be played by the video playing request to the first user, determining the target user with lower priority level by the user level and the image activity weight of the channel occupied by the user in the application, and carrying out resource preemption on the target user, thereby solving the problem of lower accuracy of video resource preemption under the condition of insufficient resources, the effect of improving the accuracy of video resource preemption is achieved.
Drawings
Fig. 1 is a block diagram of a hardware configuration of a mobile terminal according to a video playing method of an embodiment of the present invention;
fig. 2 is a flowchart of a video playing method according to an embodiment of the present invention;
FIG. 3 is a flowchart of an overall method of video resource scheduling according to an embodiment of the present invention;
fig. 4 is a block diagram of a video playing method and apparatus according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of running on a mobile terminal, fig. 1 is a hardware structure block diagram of the mobile terminal of a video playing method according to an embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of an application software, such as a computer program corresponding to the video playing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices via a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In this embodiment, a method for playing a video running on the mobile terminal is provided, and fig. 2 is a flowchart of a method for playing a video according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, receiving a video playing request sent by a first user;
step S204, under the condition that the current service resource occupancy rate is determined to reach a preset threshold value, determining a target user from N other users based on the levels of the N other users except the first user and the picture activity weight of the channel currently occupied by each other user, wherein the picture activity weight is used for indicating the motion degree of a target object in a video picture played through the currently occupied channel;
the current service resource may be a bandwidth resource of a user or a processing resource of a processor, where the service resource is not limited, and the N other users may be users sharing the same service resource as the first user, and may determine the target user according to the level of the N other users and the picture activity weight of the channel occupied by the N other users, for example, a user with the lowest level among the N other users and the lowest picture activity weight of the channel occupied by the N other users may be determined as the target user.
Step S206, closing the target video played through the channel currently occupied by the target user, and returning and playing the first video requested to be played by the video playing request to the first user.
The target user may be a user needing to be preempted for the service resource, the first user may be a user who preempts for the service resource, after the target user is determined, the target video played in the channel currently occupied by the target user is closed, and the first video requested to be played by the video playing request is returned to the first user and played.
Optionally, the main body of the above steps may be a background processor, or other devices with similar processing capabilities, and may also be a machine integrated with at least an image acquisition device and a data processing device, where the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a terminal such as a computer and a mobile phone, but is not limited thereto.
Through the steps, by receiving a video playing request sent by a first user, determining a target user from N other users based on the levels of N other users except the first user and the image activity weight of a channel currently occupied by each other user under the condition that the current service resource occupancy rate is determined to reach a preset threshold, closing the target video played in the channel occupied by the target user after the target user is determined, returning and playing the first video requested to be played by the video playing request to the first user, in the application, the target user with lower priority level is determined according to the levels of the other users except the first user currently sending the video request and the image activity weight of the occupied channel, and the reasonable distribution of video resources can be realized by carrying out resource preemption on the target user, so that under the condition of insufficient resources, the video resource preemption accuracy is low, and the effect of improving the video resource preemption accuracy is achieved.
Optionally, in a case that it is determined that the current service resource occupancy rate reaches a predetermined threshold, determining a target user from the N other users based on levels of the N other users except the first user and a picture activity weight of a channel currently occupied by each of the other users includes: determining a first user group where the first user is located and a plurality of second user groups where the N other users are located respectively, wherein each user group is divided according to the permission levels of the users, and the permission levels of the users in the same user group are the same; and under the condition that a plurality of second user groups comprise target user groups of which the corresponding permission levels are lower than or equal to the permission level corresponding to the first user group, determining the target users from the target user groups based on the picture activity weights of channels currently occupied by all the users included in the target user groups.
As an optional embodiment, all users watching the video may be divided into a plurality of user level groups, each user group is divided according to the permission levels of the users, and the permission levels of the users in the same user group are the same. Assuming that users watching a video include user a, user B, user C, and user D, and the corresponding LEVELs are LEVEL2, LEVEL1, LEVEL0, and LEVEL0, respectively, the correspondence between the users and the LEVELs may be pre-configured and stored. Assuming that the user a is a first user, and the users B, C and D are other users, it may be determined that the first user group in which the user a is located is LEVEL2, the second user group in which the user B is located is LEVEL1, the second user group in which the user C is located is LEVEL0, and the second user group in which the user D is located is LEVEL 0. At this time, it may be determined that there are target user groups having user LEVELs lower than LEVEL2 in the second user LEVEL group (LEVEL1 and LEVEL0), i.e., LEVEL1 and LEVEL0, and the target users may be determined based on the screen activity weights of the channels currently occupied by user B, user C and user D in LEVEL1 and LEVEL0, for example, user C having the lowest channel screen activity weight may be determined as the target user.
Assuming that users watching a video include user a, user B, user C, and user D, and the corresponding LEVELs are LEVEL2, LEVEL2, LEVEL2, and LEVEL2, respectively, the correspondence between the users and the LEVELs may be pre-configured and stored. Assuming that user a is a first user, and user B, user C, and user D are other users, it may be determined that the first user group in which user a is located is LEVEL2, and the second user group in which user B, user C, and user D are LEVEL 2. At this time, it may be determined that there is a target user group having a user LEVEL equal to LEVEL2, i.e., LEVEL2, in the second user LEVEL group (LEVEL2), the target user is determined based on the screen activity weights of the channels occupied by user B, user C, and user D in LEVEL2, and user C may be determined as the target user assuming that the screen activity weight of user C is the minimum.
Optionally, when the number of the target user groups is multiple, determining, based on the screen activity weights of the channels currently occupied by all users included in the target user groups, that the target user includes: determining the target user group with the lowest corresponding permission level in the plurality of target user groups; and determining the target user from the target user group with the lowest permission level based on the picture activity weights of the channels currently occupied by all users included in the target user group with the lowest permission level.
As an optional embodiment, assuming that the user a is a first user, and the users B, C and D are other users, it is determined that the first user group in which the user a is located is LEVEL2, the second user group in which the user B is located is LEVEL1, the second user group in which the user C is located is LEVEL0, and the second user group in which the user D is located is LEVEL 0. At this time, it may be determined that target user groups having user LEVELs lower than LEVEL2, i.e., LEVEL1 and LEVEL0, exist in the second user LEVEL group (LEVEL1 and LEVEL0), and it may be determined that the user group LEVEL0 having a lower LEVEL is a target user group, at this time, two users (user C and user D) exist in LEVEL0, and the target user may be determined according to the screen activity weights of the channels occupied by user C and user D.
Optionally, determining the target user from the target user group based on the picture activity weights of channels currently occupied by all users included in the target user group includes: determining a second user as the target user under the condition that the target user group only comprises one second user, wherein the picture activity weight of a channel currently occupied by the second user is smaller than a preset weight threshold; and under the condition that the target user group comprises a plurality of second users, determining a plurality of second users with the smallest difference between the code stream value of the channel currently occupied by the second users and the current code stream value of the channel currently occupied by the first user as the target users.
As an optional embodiment, it is assumed that the target user group is LEVEL0, the LEVEL0 includes user B, user C, and user D, the picture weights corresponding to the occupied channels are 20, 30, and 50, respectively, and the preset weight threshold is 25, at this time, when only one second user (user B) is included in LEVEL0, user B is determined as the target user.
Assuming that the target user group is LEVEL0, the LEVEL0 includes a user B, a user C, and a user D, the picture weights corresponding to the occupied channels are 20, and 20, respectively, assuming that the preset weight threshold is 25, at this time, when only a plurality of second users (user B, user C, and user D) are included in the LEVEL0, the code stream values of the channels occupied by the user B, user C, and user D are calculated to be 100, 200, and 500, respectively, and assuming that the code stream value of the channel occupied by the first user is 300, it can be determined that the differences between the code stream values of the channels occupied by the user B, user C, and user D and the code stream value of the channel occupied by the first user are 200, 100, and 200, respectively, so that the user C with the smallest difference can be determined as the target user.
Optionally, the following operations are performed for each of the other users to determine the picture activity weight of the channel currently occupied by each of the other users: acquiring the number of target objects and the movement frequency of each target object in a first video picture played by the other users through a currently occupied channel, wherein the movement frequency is used for indicating the movement degree of the target object; and determining the picture activity weight of the channel currently occupied by the other users according to the number of the target objects and the motion frequency of each target object.
As an alternative embodiment, assume that other users include user B, user C and user D, the following operations may be performed for each of user B, user C, and user D to determine the picture activity weight for the channel currently occupied by each user, such as the current user being user B, the number of target objects and the motion frequency of each target object in the first video picture played in the channel currently occupied by the user B can be obtained, wherein the motion frequency is used to indicate a degree of motion of the target object, which may be a person, or an animal, where the target object is not limited, assuming that the target object is a person, the number of target objects is 5, the picture activity weight of the channel currently occupied by the user B can be determined according to the number 5 of the target objects and the motion frequency of each target object.
Optionally, determining the picture activity weight of the channel currently occupied by the other user according to the number of the target objects and the motion frequency of each target object, includes: determining the number of the target objects and the weight corresponding to the motion frequency respectively; and determining the picture activity weight of the channel currently occupied by the other users by performing weighted summation on the number of the target objects and the sum of the motion frequency of the target objects.
As an optional embodiment, assuming that the other users are user B, and the number of the target objects and the weights corresponding to the motion frequency are X, Y respectively, the picture activity weight of the channel currently occupied by user B may be determined by the following formula:
the frame motion weight is X + (target a motion frequency + target b motion frequency + … … + target N motion frequency) Y.
Assuming that the number of target objects is 3, which are target a, target B and target c, the motion frequency corresponding to target a, target B and target c is 10, 20 and 30, X is 30% and Y is 70%, respectively, then the picture activity weight of the channel currently occupied by user B is 3 × 30% + (10+20+30) × 70%, which is equal to 42.9.
Optionally, after determining the target user from the N other users, the method includes: identifying a target channel currently occupied by the target user as a preempted state; and setting the picture activity weight of the target channel to be zero.
As an optional implementation, assuming that the target user is user B, the target channel currently occupied by user B is channel 1, and the current picture activity weight of channel 1 is 42.9, then channel 1 is identified as being in a preempted state, and the picture activity weight of channel 1 is set to zero.
Optionally, after closing the target video played through the channel currently occupied by the target user, and returning and playing the first video requested to be played by the video playing request to the first user, the method further includes: saving a first picture activity weight of a channel occupied by the first user; and updating the first picture activity weight according to a preset time interval.
As an optional implementation manner, assuming that the first user is the user a, after the first video requested to be played by the video playing request is returned to the user a and played, the first picture activity weight of the channel 1 occupied by the user a is saved, and assuming that the preset time interval is 5 minutes, the saved first picture activity weight may be updated every 5 minutes, so that the user a may also be preempted by users with higher levels of other users or with higher picture activity weights, and accuracy of video preemption may be further improved.
Optionally, after the target video played through the channel currently occupied by the target user is closed, and the first video requested to be played by the video playing request is returned to the first user and played, the method further includes at least one of: resuming playing the target video when the first user closes the first video; and when detecting that the bandwidth resource released by a third user who is currently offline is larger than or equal to the bandwidth required by the target user for playing the target video and/or the processor resource released by the third user is larger than or equal to the processor resource required by the target user for playing the target video, resuming playing the target video.
As an optional implementation manner, assuming that the target user is user B, the first user is user a, and the third user is user C, after the target video played through the channel currently occupied by user B is closed, and the first video is returned to user a and played, in the case that user a closes the first video, the target video played through the channel currently occupied by user B is resumed to be played.
And under the condition that the bandwidth resource released by the user C who is currently offline is detected to be larger than or equal to the bandwidth required by the user B for playing the target video, and the processor resource released by the user C is detected to be larger than or equal to the processor resource required by the user B for playing the target video, the target video played by the channel currently occupied by the user B is recovered.
And under the condition that the bandwidth resource released by the user C who is currently offline is detected to be larger than or equal to the bandwidth required by the user B for playing the target video, the target video played by the channel currently occupied by the user B is recovered to be played.
And under the condition that the processor resource released by the user C which is currently offline is detected to be larger than or equal to the processor resource required by the user B for playing the target video, the target video played by the channel currently occupied by the user B is recovered.
Optionally, the determining that the current service resource occupancy rate reaches the predetermined threshold includes: and under the condition that the sum of the occupied bandwidth of the N other users and the bandwidth requested by the first user is greater than a preset bandwidth threshold value or the utilization rate of the current processor is greater than a preset utilization rate threshold value, determining that the current occupancy rate of the service resources reaches the preset threshold value.
As an optional implementation manner, assuming that the occupied bandwidth of the N other users is 380Mbps, assuming that the first user is user a, the bandwidth required by the channel occupied by user a is 30Mbps, assuming that the preset bandwidth threshold is 400Mbps, the sum of the occupied bandwidth of the N other users of 380Mbps and the bandwidth applied by user a at this time is 410Mbps, and if the preset bandwidth threshold is greater than 400Mbps, it is determined that the current service resource occupancy rate reaches the predetermined threshold.
Assuming that the current processor utilization rate is 85%, the preset processor utilization rate threshold is 80%, and the current processor utilization rate 85% is greater than the preset processor utilization rate threshold 80%, determining that the current service resource occupancy rate reaches the predetermined threshold.
As an optional embodiment, to better explain the scheme in the present application, the following is an overall flow for implementing video resource scheduling:
the method comprises the following steps: the authority and level of the user to pull the video stream are configured on the platform.
(1) And configuring the permission bit. The authority length is 64 bits, each bit represents one authority, 1 represents the authority, 0 represents the no authority, and 64 authorities can be configured at most. For example, the first bit represents the real-time video rights, the second bit represents the playback rights, and the user rights bits are as follows: 11000000000000000000000000000000000000000000000000000000000000, respectively;
(2) and configuring the user level. The permission level is 0-2 three levels, 0: lowest privilege level 1: the intermediate level of authority 2 is the high level of authority.
Step two: and the platform calculates the resource consumption in real time and counts the activity weight of the video image watched by each user.
(1) And adding equipment on the platform, acquiring the size of the code stream of the channel when the equipment is on line, and calculating the bandwidth occupied by the code stream according to the size of the code stream.
(2) And configuring a server resource occupation threshold value. For example: the bandwidth occupation threshold is 400Mbps, and the CPU occupancy rate threshold is 80%.
(3) Analyzing the number of target objects and the motion degree thereof in a user video picture in real time by using the existing intelligent analysis technology, and calculating a picture motion weight;
the frame motion weight is X + (target 1 motion degree + target 2 motion degree + … … + target N motion degree) Y
Wherein, X marks the percentage that the target quantity accounts for the activity weight of the picture, Y marks the percentage that the movement degree of the target accounts for the activity weight of the picture, the weight is updated and kept in real time, reset once in 5 minutes.
Step three: and according to the resource occupation condition, carrying out sequencing preemption through the user permission level and the picture activity weight.
(1) According to the user permission LEVELs, the users watching the video are divided into three groups, namely a high permission group LEVEL2 group, a middle permission group LEVEL1 group and a low permission group LEVEL0 group.
(2) The user in the authority group saves the number of the watched video channel and the picture activity weight corresponding to the channel;
LEVEL2, [ user 1, [ channel number, picture activity weight ] … … user 9, [ channel number, picture activity weight ] ]
LEVEL1, [ USER 10, [ CHANNEL NUMBER, PICTURE MOTION WEIGHT ] … … USER 19, [ CHANNEL NUMBER, PICTURE MOTION WEIGHT ] ]
LEVEL0, [ USER 20, [ CHANNEL NUMBER, PICTURE MOTION WEIGHT ] … … USER 29, [ CHANNEL NUMBER, PICTURE MOTION WEIGHT ] ]
(3) And (4) requesting a video by the user, and detecting and preempting the resource by the platform according to the rule. Fig. 3 is a flowchart of an overall method for scheduling video resources after a user sends a request video:
step S301: a user requests video preview;
step S302: detecting whether the server resources exceed a threshold value, if so, entering a step S303, and if not, entering a step S306;
step S303: searching a low-level user group, if the low-level user group exists, entering step S305, and if the low-level user group does not exist, entering step S304;
step S304: searching a same-level user group, if the same-level user group exists, entering a step S305, and if the same-level user group does not exist, entering a step S307;
step S305: finding out the channel with the smallest intra-group picture activity weight and the smallest code stream size for preemption, closing the video corresponding to the preempted channel, and entering the step S306;
step S306: opening a video requested by a user;
step S307: and (6) ending.
As an optional embodiment, assuming that a video playing request sent by the user a is received, and the user LEVEL group corresponding to the user a is LEVEL2, the flow of implementing the video playing method is as follows:
(1) user a, with permission LEVEL2, requests a video from the platform.
(2) The platform counts the current resource occupation condition (bandwidth and CPU), and judges whether the video requested by the user A exceeds a threshold value. The judgment conditions are as follows: occupied bandwidth + user a requested video bandwidth > threshold or current CPU usage > -threshold.
(3) And if the threshold value is exceeded, the platform starts to schedule the resources. The method comprises the following specific steps:
1. the group of LEVEL0 with the lowest user LEVEL is queried, if no user is currently in the group of LEVEL0, then the group of LEVEL1 is searched, and if no user is in the group of LEVEL1, then the group of LEVEL2 is searched.
2. And after finding the LEVEL group, searching a channel with the lowest picture activity weight value in the group, and if a plurality of channels with the lowest picture activity weight values exist, selecting the channel with the closest channel code stream size for preemption. The video stream of the channel is disconnected, the channel is identified as a preempted state in the LEVEL group, and the picture activity weight is set to 0.
3. And after the preemption succeeds, adding the information of the user A into a LEVEL2 group, maintaining the picture activity weight of the channel in real time, and resetting the picture activity weight once in 5 minutes.
4. After user a closes the video stream, this user information is purged from the LEVEL2 group.
5. And the platform detects that the preempted user is still in a video preview state, and automatically restores the preempted user to the video if the resource is not exceeded.
The invention can realize the intelligent scheduling of the video resources under the condition of limited server resources, not only can support the simple preemption and recovery of the video resources, but also can support the intelligent analysis of the video pictures, defines the level of the user authority, realizes that important videos are ensured not to be preempted as much as possible, preferentially preempts unimportant videos, and ensures that the resource preemption is more reasonable and more intelligent.
The invention can calculate the video image activity weight of the video channel in real time. And calculating the activity weight of the channel video pictures according to the number and the motion degree of the target objects, such as people, vehicles, objects and the like in the video pictures. And carrying out reasonable video resource scheduling according to the size of the video picture activity weight, the priority level of the user permission and the occupied bandwidth of the channel video, and preferentially ensuring important video pictures.
The invention can carry out real-time intelligent analysis on the video, calculate the video image activity weight in real time according to the target quantity and the target motion degree of the video image, and periodically reset and re-count the image activity weight. Defining user authority and level, and dividing users requesting video service into unavailable authority groups according to the level. According to the method, under the condition of limited resources, video service is reasonably and accurately preempted and scheduled.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a video playing method and apparatus are also provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, which have already been described and are not described again. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of a video playing method and apparatus according to an embodiment of the present invention, as shown in fig. 4, the apparatus includes: a receiving module 42, configured to receive a video playing request sent by a first user; a determining module 44, configured to determine, when it is determined that the current service resource occupancy rate reaches a predetermined threshold, a target user from the N other users based on levels of the N other users except the first user and a picture activity weight of a channel currently occupied by each of the other users, where the picture activity weight represents a frequency of a target object moving in a video picture; and a playing module 46, configured to close the target video played through the channel currently occupied by the target user, and return to the first user and play the first video requested to be played by the video playing request.
Optionally, the determining module 44 further includes: a first determining unit, configured to determine a first user group where the first user is located and a plurality of second user groups where the N other users are located, where each user group is divided according to a permission level of the user, and permission levels of the users in the same user group are the same; and a second determining unit, configured to determine, when it is determined that a plurality of the second user groups include a target user group whose corresponding permission level is lower than or equal to the permission level corresponding to the first user group, the target user from the target user group based on the screen activity weights of channels currently occupied by all users included in the target user group.
Optionally, the second determining unit includes: a first determining subunit, configured to determine the target user group with a lowest permission level, where the target user group includes a plurality of target user groups; and the second determining subunit is configured to determine, based on the picture activity weights of channels currently occupied by all users included in the target user group with the lowest corresponding permission level, the target user from the target user group with the lowest corresponding permission level.
Optionally, the second determining unit further includes: a third determining subunit, configured to determine, when only one second user is included in the target user group, the second user as the target user, where the picture activity weight of a channel currently occupied by the second user is smaller than a preset weight threshold; and a fourth determining subunit, configured to determine, as the target user, a second user whose difference between the code stream value of the currently occupied channel included in the plurality of second users and the current code stream value of the currently occupied channel of the first user is the smallest, when the target user group includes the plurality of second users.
Optionally, the apparatus further includes an execution module, configured to execute the following operations for each of the other users to determine the picture activity weight of the channel currently occupied by each of the other users; the execution module comprises an acquisition subunit, configured to acquire the number of target objects and the motion frequency of each target object in a first video picture played by the other user through a currently occupied channel, where the motion frequency is used to indicate the motion degree of the target object; and a fifth determining subunit, configured to determine, according to the number of the target objects and the motion frequency of each target object, the picture activity weight of the channel currently occupied by the other user.
Optionally, the fifth determining subunit includes: the first determining submodule is used for determining the number of the target objects and the weight corresponding to the motion frequency respectively; and the second determining submodule is used for determining the picture activity weight of the channel currently occupied by the other users by performing weighted summation on the number of the target objects and the sum of the motion frequency of the plurality of target objects.
Optionally, the apparatus is further configured to, after determining a target user from the N other users, identify a target channel currently occupied by the target user as a preempted state; and setting the picture activity weight of the target channel to be zero.
Optionally, the apparatus is further configured to close a target video played through a channel currently occupied by the target user, return to the first user and play the first video requested to be played by the video play request, and resume playing the target video when the first user closes the first video; and when detecting that the bandwidth resource released by a third user who is currently offline is larger than or equal to the bandwidth required by the target user for playing the target video and/or the processor resource released by the third user is larger than or equal to the processor resource required by the target user for playing the target video, resuming playing the target video.
Optionally, the determining module 44 further includes a sixth determining subunit, configured to determine that the current occupancy rate of the service resource reaches the predetermined threshold value when a sum of the occupied bandwidth of the N other users and the bandwidth requested by the first user is greater than a preset bandwidth threshold value, or when the current utilization rate of the processor is greater than a preset utilization rate threshold value.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention further provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the above.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, receiving a video playing request sent by a first user;
s2, under the condition that the current service resource occupancy rate is determined to reach a preset threshold value, determining a target user from N other users based on the levels of the N other users except the first user and the picture activity weight of the channel currently occupied by each other user, wherein the picture activity weight is used for indicating the motion degree of a target object in a video picture played through the currently occupied channel;
and S3, closing the target video played through the channel currently occupied by the target user, and returning and playing the first video requested to be played by the video playing request to the first user.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, receiving a video playing request sent by a first user;
s2, under the condition that the current service resource occupancy rate is determined to reach a preset threshold value, determining a target user from N other users based on the levels of N other users except the first user and the picture activity weight of the channel currently occupied by each other user, wherein the picture activity weight is used for indicating the motion degree of a target object in a video picture played through the currently occupied channel;
and S3, closing the target video played through the channel currently occupied by the target user, and returning and playing the first video requested to be played by the video playing request to the first user.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method for playing a video, comprising:
receiving a video playing request sent by a first user;
under the condition that the current service resource occupancy rate is determined to reach a preset threshold value, determining a target user from N other users based on the levels of the N other users except the first user and the picture activity weight of a channel currently occupied by each other user, wherein the picture activity weight is used for indicating the motion degree of a target object in a video picture played through the currently occupied channel;
and closing the target video played through the channel currently occupied by the target user, and returning and playing the first video requested to be played by the video playing request to the first user.
2. The method according to claim 1, wherein in a case that it is determined that the current service resource occupancy rate reaches a predetermined threshold, determining a target user from the N other users based on the levels of the N other users except the first user and the screen activity weight of the channel currently occupied by each of the other users comprises:
determining a first user group where the first user is located and a plurality of second user groups where the N other users are located respectively, wherein each user group is divided according to the permission levels of the users, and the permission levels of the users in the same user group are the same;
and under the condition that a plurality of second user groups comprise target user groups of which the corresponding permission levels are lower than or equal to the permission level corresponding to the first user group, determining the target users from the target user groups based on the picture activity weights of channels currently occupied by all the users included in the target user groups.
3. The method according to claim 2, wherein in a case that the number of the target user groups is multiple, determining the target user from the target user groups based on the screen activity weights of channels currently occupied by all users included in the target user groups comprises:
determining the target user group with the lowest corresponding permission level in the plurality of target user groups;
and determining the target user from the target user group with the lowest permission level based on the picture activity weights of the channels currently occupied by all users included in the target user group with the lowest permission level.
4. The method according to claim 2, wherein determining the target user from the target user group based on the picture activity weights of channels currently occupied by all users included in the target user group comprises:
determining a second user as the target user under the condition that the target user group only comprises one second user, wherein the picture activity weight of a channel currently occupied by the second user is smaller than a preset weight threshold;
and under the condition that the target user group comprises a plurality of second users, determining the second user with the smallest difference value between the code stream value of the channel currently occupied by the plurality of second users and the current code stream value of the channel currently occupied by the first user as the target user.
5. The method of claim 1, further comprising:
and executing the following operations for each other user to determine the picture activity weight of the channel currently occupied by each other user:
acquiring the number of target objects and the movement frequency of each target object in a first video picture played by the other users through a currently occupied channel, wherein the movement frequency is used for indicating the movement degree of the target object;
and determining the picture activity weight of the channel currently occupied by the other users according to the number of the target objects and the motion frequency of each target object.
6. The method according to claim 5, wherein determining the picture activity weight of the channel currently occupied by the other users according to the number of the target objects and the motion frequency of each target object comprises:
determining the number of the target objects and the weight corresponding to the motion frequency respectively;
and determining the picture activity weight of the channel currently occupied by the other users by performing weighted summation on the number of the target objects and the sum of the motion frequency of the target objects.
7. The method according to claim 1, wherein after determining the target user from the N other users, the method comprises:
identifying a target channel currently occupied by the target user as a preempted state;
and setting the picture activity weight of the target channel to be zero.
8. The method of claim 1, wherein after closing the target video played through the channel currently occupied by the target user and returning and playing the first video requested to be played by the video playing request to the first user, the method further comprises at least one of:
resuming playing the target video when the first user closes the first video;
and when detecting that the bandwidth resource released by a currently offline third user is larger than or equal to the bandwidth required by the target user for playing the target video and/or the processor resource released by the third user is larger than or equal to the processor resource required by the target user for playing the target video, resuming playing the target video.
9. The method of claim 1, wherein the determining that the current occupancy of the service resource has reached a predetermined threshold comprises:
and under the condition that the sum of the occupied bandwidth of the N other users and the bandwidth requested by the first user is greater than a preset bandwidth threshold value or the utilization rate of the current processor is greater than a preset utilization rate threshold value, determining that the current occupancy rate of the service resources reaches the preset threshold value.
10. A video playback apparatus, comprising:
the receiving module is used for receiving a video playing request sent by a first user;
the determining module is used for determining a target user from N other users based on the levels of the N other users except the first user and the picture activity weight of a channel currently occupied by each other user under the condition that the current service resource occupancy rate is determined to reach a preset threshold, wherein the picture activity weight represents the frequency of the motion of a target object in a video picture;
and the playing module is used for closing the target video played through the channel currently occupied by the target user, returning the target video to the first user and playing the first video requested to be played by the video playing request.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 9.
12. An electronic device comprising a memory and a processor, wherein the memory has a computer program stored therein, and the processor is configured to execute the computer program to perform the method of any of claims 1 to 9.
CN202210690258.3A 2022-06-17 2022-06-17 Video playing method and device, storage medium and electronic device Pending CN115037968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210690258.3A CN115037968A (en) 2022-06-17 2022-06-17 Video playing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210690258.3A CN115037968A (en) 2022-06-17 2022-06-17 Video playing method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN115037968A true CN115037968A (en) 2022-09-09

Family

ID=83124736

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210690258.3A Pending CN115037968A (en) 2022-06-17 2022-06-17 Video playing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN115037968A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115460451A (en) * 2022-09-15 2022-12-09 浙江大华技术股份有限公司 Video playing method and device, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801813A (en) * 2005-09-30 2006-07-12 华为技术有限公司 Dynamic content playing method and apparatus
CN106714318A (en) * 2015-11-12 2017-05-24 北京信威通信技术股份有限公司 Bandwidth allocation method and base station
CN106791679A (en) * 2016-12-30 2017-05-31 东方网力科技股份有限公司 A kind of determination method and device of video transmission path
CN108076438A (en) * 2016-11-17 2018-05-25 普天信息技术有限公司 The dynamic allocation method and system of bearer service in a kind of multi-user's group communication system
CN109862323A (en) * 2019-02-20 2019-06-07 北京旷视科技有限公司 Playback method, device and the processing equipment of multi-channel video

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801813A (en) * 2005-09-30 2006-07-12 华为技术有限公司 Dynamic content playing method and apparatus
CN106714318A (en) * 2015-11-12 2017-05-24 北京信威通信技术股份有限公司 Bandwidth allocation method and base station
CN108076438A (en) * 2016-11-17 2018-05-25 普天信息技术有限公司 The dynamic allocation method and system of bearer service in a kind of multi-user's group communication system
CN106791679A (en) * 2016-12-30 2017-05-31 东方网力科技股份有限公司 A kind of determination method and device of video transmission path
CN109862323A (en) * 2019-02-20 2019-06-07 北京旷视科技有限公司 Playback method, device and the processing equipment of multi-channel video

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115460451A (en) * 2022-09-15 2022-12-09 浙江大华技术股份有限公司 Video playing method and device, storage medium and electronic device
CN115460451B (en) * 2022-09-15 2024-04-26 浙江大华技术股份有限公司 Video playing method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN109787915B (en) Flow control method and device for network access, electronic equipment and storage medium
JP2012090258A (en) Method and apparatus for allocating network rate
CN113630616A (en) Live broadcast edge node resource control method and system
CN113364682B (en) Data transmission method and device, storage medium and electronic device
CN110830964B (en) Information scheduling method, internet of things platform and computer readable storage medium
CN107733805B (en) Service load scheduling method and device
US20200380478A1 (en) Api charging system, api charging management method, and api charging program
CN115037968A (en) Video playing method and device, storage medium and electronic device
CN111432247B (en) Traffic scheduling method, traffic scheduling device, server and storage medium
CN110611831B (en) Video transmission method and device
CN112817753A (en) Task processing method and device, storage medium and electronic device
EP3264696B1 (en) Control device, traffic control method, and recording medium onto which computer program is recorded
CN112003790B (en) Distribution method of network traffic used by intelligent school
CN112104730B (en) Scheduling method and device of storage tasks and electronic equipment
CN107493485B (en) Resource control method and device and IPTV server
US10735891B1 (en) Cognitively controlling data delivery
CN111278039B (en) User perception suppression identification method, device, equipment and medium
JP6276206B2 (en) Bandwidth allocation control device and bandwidth allocation control method
CN114828050B (en) Method, device, equipment and medium for determining service capacity
CN111160283B (en) Data access method, device, equipment and medium
WO2023274508A1 (en) Conflict detection of specific intents in an intent-based network
CN108337634B (en) HAPS call access control method, device, high altitude platform equipment and storage medium
CN101997720A (en) Transregional monitoring flow on demand method and video management server
US8661484B1 (en) Dynamic probability-based admission control scheme for distributed video on demand system
CN115333982B (en) Flow monitoring method, device, equipment and computer readable storage medium

Legal Events

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