CN111930490B - Streaming media task management method and device - Google Patents

Streaming media task management method and device Download PDF

Info

Publication number
CN111930490B
CN111930490B CN202011025608.1A CN202011025608A CN111930490B CN 111930490 B CN111930490 B CN 111930490B CN 202011025608 A CN202011025608 A CN 202011025608A CN 111930490 B CN111930490 B CN 111930490B
Authority
CN
China
Prior art keywords
time
streaming media
media task
task
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011025608.1A
Other languages
Chinese (zh)
Other versions
CN111930490A (en
Inventor
张凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Zhongke Tongda High New Technology Co Ltd
Original Assignee
Wuhan Zhongke Tongda High New 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 Wuhan Zhongke Tongda High New Technology Co Ltd filed Critical Wuhan Zhongke Tongda High New Technology Co Ltd
Priority to CN202011025608.1A priority Critical patent/CN111930490B/en
Publication of CN111930490A publication Critical patent/CN111930490A/en
Application granted granted Critical
Publication of CN111930490B publication Critical patent/CN111930490B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application provides a method and a device for managing streaming media tasks, the method sets the waiting time of the streaming media task at the head position of a waiting queue as absolute time and sets the waiting time of the streaming media task at the non-head position of the waiting queue as relative time, so that when the current time changes, only the waiting time of the streaming media task at the head position needs to be updated, the waiting time of other streaming media tasks does not need to be updated, the data updating amount is reduced, whether the streaming media task is executed overtime or not is judged according to the time interval of the initial time when the streaming media task starts to be executed and the ending time when the streaming media task is executed and the preset time, and an alarm is given after the streaming media task is executed overtime, so that the overtime streaming media task can be searched according to the alarm, the efficiency is higher, and the program can be corrected according to the alarm, so that the subsequent streaming media task can be normally executed.

Description

Streaming media task management method and device
Technical Field
The application relates to the technical field of intelligent traffic, in particular to a streaming media task management method and device.
Background
In the execution process of the streaming media tasks, execution time is allocated to each streaming media task, but when the streaming media tasks are executed, the execution time of the streaming media tasks exceeds preset execution time, so that the execution time of the streaming media tasks is overtime, and the execution time of the streaming media tasks can cause that other streaming media tasks cannot be normally executed.
Therefore, the existing execution process of the streaming media task has the technical problem of low efficiency of searching for the streaming media task which is executed overtime.
Disclosure of Invention
The embodiment of the application provides a method and a device for managing a streaming media task, which are used for solving the technical problem that the efficiency of searching for a streaming media task which is executed overtime is low in the existing execution process of the streaming media task.
The embodiment of the application provides a streaming media task management method, which is applied to a traffic police system, wherein the traffic police system comprises a data server, and the streaming media task management method comprises the following steps:
the data server receives a task execution request carrying streaming media task execution time;
adding each streaming media task into a waiting queue according to a task execution request of the streaming media task and the time sequence of the streaming media task execution time;
setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; the absolute time is a time difference value of the execution time of the streaming media task at the head position relative to the current time;
setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue; the relative time is a time difference value of the execution time of the streaming media task at the non-head position relative to the execution time of the previous streaming media task;
dynamically updating the waiting time of the streaming media task of the head position according to the current time;
when the execution time of the streaming media task is reached, adding the streaming media task into an execution queue from a waiting queue, and recording the initial time for starting execution of the streaming media task;
when the execution of the streaming media task is completed, recording the end time of the completion of the execution of the streaming media task;
judging whether the time interval between the initial time and the end time is greater than a preset time or not according to the initial time and the end time;
and when the time interval between the initial time and the ending time is greater than the preset time, alarming.
Meanwhile, an embodiment of the present application further provides a streaming media task management device, where the streaming media task management device is applied to a traffic police system, the traffic police system includes a data server, and the streaming media task management device includes:
the receiving module is used for receiving a task execution request carrying the execution time of the streaming media task;
the adding module is used for adding each streaming media task into the waiting queue according to the task execution request of the streaming media task and the time sequence of the execution time of the streaming media task;
the first setting module is used for setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; the absolute time is a time difference value of the execution time of the streaming media task at the head position relative to the current time;
the second setting module is used for setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue; the relative time is a time difference value of the execution time of the streaming media task at the non-head position relative to the execution time of the previous streaming media task;
the updating module is used for dynamically updating the waiting time of the streaming media task at the head position according to the current time;
the first recording module is used for adding the streaming media task into an execution queue from a waiting queue when the execution time of the streaming media task reaches, and recording the initial time for starting execution of the streaming media task;
the second recording module is used for recording the end time of the completion of the execution of the streaming media task when the execution of the streaming media task is completed;
the judging module is used for judging whether the time interval between the initial time and the ending time is greater than the preset time or not according to the initial time and the ending time;
and the alarm module is used for giving an alarm when the time interval between the initial time and the ending time is greater than the preset time.
Meanwhile, the embodiment of the present application further provides a data server for a traffic police system, where the data server includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the steps in the streaming media task management method when executing the program.
Meanwhile, the embodiment of the present application further provides a computer-readable storage medium for a traffic police system, where multiple instructions are stored in the computer-readable storage medium, and the instructions are suitable for being loaded by a processor to perform the steps in the streaming media task management method.
Has the advantages that: the embodiment of the application provides a method and a device for managing streaming media tasks, wherein the method for managing the streaming media tasks is applied to a traffic police system, the traffic police system comprises a data server, and the method for managing the streaming media tasks firstly adopts the data server to receive a task execution request carrying the execution time of the streaming media tasks; then according to the task execution request of the streaming media task, adding each streaming media task into a waiting queue according to the time sequence of the execution time of the streaming media task; then setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue, then dynamically updating the waiting time of the streaming media task at the head position according to the current time, then adding the streaming media task into the execution queue from the waiting queue when the execution time of the streaming media task reaches, and recording the initial time for starting execution of the streaming media task; then when the execution of the streaming media task is finished, recording the finishing time of the execution of the streaming media task, judging whether the time interval between the initial time and the finishing time is greater than the preset time or not according to the initial time and the finishing time of the streaming media task, and alarming when the time interval between the initial time and the finishing time is greater than the preset time; the embodiment of the application sets the waiting time of the streaming media task at the head position of the waiting queue as absolute time and sets the waiting time of the streaming media task at the non-head position of the waiting queue as relative time when the streaming media task is added into the execution queue from the waiting queue, so that when the current time changes, only the waiting time of the streaming media task at the head position needs to be updated, the waiting time of other streaming media tasks does not need to be updated, the data updating amount is reduced, and the initial time of starting execution of the streaming media task and the finishing time of finishing execution of the streaming media task are recorded, so that whether the execution of the streaming media task is overtime can be judged according to the initial time of starting execution of the streaming media task and the time interval of finishing execution of the streaming media task and the preset time, and an alarm is given when the execution of the streaming media task is overtime, the method and the device have the advantages that when the overtime streaming media task is searched and executed, the searching can be carried out according to the alarm, the efficiency is high, and the program can be corrected according to the alarm, so that the subsequent streaming media task can be normally executed.
Drawings
The technical solution and other advantages of the present application will become apparent from the detailed description of the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic view of a scene of an intelligent transportation system according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a streaming media task management method according to an embodiment of the present application.
Fig. 3 is a first schematic diagram of a waiting queue in a streaming media task management method according to an embodiment of the present application.
Fig. 4 is a second schematic diagram of a waiting queue in a streaming media task management method according to an embodiment of the present application.
Fig. 5 is a schematic diagram of a change process of a wait queue changing with current time in a streaming media task management method according to an embodiment of the present application.
Fig. 6 is a third schematic diagram of a waiting queue in a streaming media task management method according to an embodiment of the present application.
Fig. 7 is a schematic diagram illustrating that a task is added from a waiting queue to an execution queue in a streaming media task management method according to an embodiment of the present application.
Fig. 8 is a schematic diagram of an alarm interface in a streaming media task management method according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of a streaming media task management device according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a data server according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic view of a scene of an intelligent traffic system according to an embodiment of the present application, where the system may include a device and a server that are connected to communicate through an SIP (Session Initiation Protocol) gateway, which is not described again, where the device includes a front-end device 11, the server includes a data server 12 and a communication server, and the communication server is not shown in fig. 1, where:
the front-end device 11 includes, but is not limited to, an embedded high-definition camera, an industrial personal computer, a high-definition camera, and the like, and is configured to perform data acquisition on a vehicle and a pedestrian passing through the front-end device, where the data acquisition includes, but is not limited to, a license plate number of the vehicle (the number may be a fake plate or a fake plate), a license plate type (a blue-bottom license plate of a private car, a yellow-bottom license plate of a truck, and the like), and illegal behaviors of the pedestrian.
The server includes a local server and/or a remote server, etc. The data server 12 and the communication server may be deployed on local servers, or may be partially or wholly deployed on remote servers.
The data server 12 may receive a task execution request carrying a streaming media task execution time; adding each streaming media task into a waiting queue according to a task execution request of the streaming media task and the time sequence of the streaming media task execution time; setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue; dynamically updating the waiting time of the streaming media task of the head position according to the current time; when the execution time of the streaming media task is reached, adding the streaming media task into an execution queue from a waiting queue, and recording the initial time for starting execution of the streaming media task; when the execution of the streaming media task is completed, recording the end time of the completion of the execution of the streaming media task; judging whether the time interval between the initial time and the end time is greater than a preset time or not according to the initial time and the end time; and when the time interval between the initial time and the ending time is greater than the preset time, alarming.
It should be noted that the system scenario diagram shown in fig. 1 is an example, and the server and the scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not form a limitation on the technical solution provided in the embodiment of the present application, and as a person having ordinary skill in the art knows, with the evolution of the system and the occurrence of a new service scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems. The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
Fig. 2 is a schematic flow chart of a streaming media task management method according to an embodiment of the present application, please refer to fig. 2, where the streaming media task management method includes the following steps:
201: and the data server receives a task execution request carrying the streaming media task execution time.
In an embodiment, the receiving, by the data server, the task execution request carrying the execution time of the streaming media task includes receiving, by the data server, a real-time monitoring video stream uploaded by at least one front-end device, that is, at this time, the streaming media task includes receiving, but is not limited to the real-time monitoring video stream, the streaming media task includes establishing a connection between the front-end device and the data server, receiving, by the data server, the real-time monitoring video stream sent by the front-end device, processing, by the data server, the real-time monitoring video stream, sending, by the data server, a heartbeat packet at a fixed time, detecting, by the data server, the number of received packets at a fixed time, and the like, where the heartbeat packet refers to a sent.
In one embodiment, the real-time monitoring video stream includes videos shot by front-end devices, such as high-definition cameras, and the real-time monitoring video stream includes real-time monitoring of vehicles passing through the front-end devices and real-time monitoring of pedestrians passing through the front-end devices, meanwhile, in the real-time monitoring video stream, corresponding events and information corresponding to addresses of the front-end devices can be recorded, so that when illegal behaviors occur in the real-time monitoring video stream, corresponding recording can be performed on the time and the addresses of the illegal behaviors, and the illegal behaviors can be handled subsequently according to the corresponding records.
In one embodiment, the streaming media task execution time refers to a certain time point of the streaming media task execution, for example, the streaming media task needs to be executed at beijing time 13:00: 00, the execution time of the streaming media task is Beijing time 13:00: 00.
it should be noted that the time used in the embodiment of the present application is used to describe the implementation process of the scheme of the present application, and the setting manner is not limited to the specific implementation manner of the present application, and in the processing process of the actual streaming media task, the setting is performed according to the actual execution time and the actual time interval of each streaming media task.
202: and adding each streaming media task into the waiting queue according to the time sequence of the streaming media task execution time according to the task execution request of the streaming media task.
In one embodiment, as shown in fig. 3, when receiving an execution request of a streaming media task, the streaming media task is added to the waiting queue 30 according to a time sequence of an execution time of the streaming media task, where the streaming media task includes an execution time of 13:00: task one 301, execution time of 00 is 13:00: task two 302 of 03, execution time is 13:00: task three 303, … of 05, execution time ab: cd: ef (the time is later than 13:00: 05) and task N with the reference number 304, arranging the streaming media tasks according to the time sequence, wherein N is a positive integer larger than 3.
In an embodiment, when the streaming media task is added to the waiting queue, the streaming media task may be sorted according to an absolute time of the streaming media task, for example, after an absolute time of a task one is 3 seconds, an absolute time of a task two is 6 seconds, and an absolute time of a task three is 9 seconds, the task one, the task two, and the task three may be sorted according to the absolute times of the task one, the task two, and the task three, so that the streaming media task is sorted in the waiting queue according to a time order, and when the streaming media task is added from the waiting queue to the execution queue, the streaming media task may be added to the execution queue according to the time order of the streaming media task.
In an embodiment, when adding a streaming media task into a waiting queue according to a time sequence of execution times of the streaming media tasks, considering that there is a need to insert other streaming media tasks into the waiting queue, the streaming media task to be inserted may be inserted into the waiting queue according to the execution times of the streaming media task to be inserted and the streaming media task in the waiting queue, where the streaming media task management method includes: acquiring the execution time of a stream media task to be inserted; and inserting the streaming media task to be inserted into the waiting queue according to the execution time of the streaming media task to be inserted and the execution time of the streaming media task in the waiting queue.
In an embodiment, when the to-be-inserted streaming media task is inserted into the waiting queue according to the execution time of the to-be-inserted streaming media task and the execution time of the streaming media task in the waiting queue, specifically, the execution time of the to-be-inserted streaming media task in the waiting queue may be set to be an interval according to the execution time, for example, the same interval may be set in the same minute, the same interval may be set in the same hour, and the same interval may be set in the same day, so when the execution time of the to-be-inserted streaming media task is compared with the execution time of the streaming media task in the waiting queue, an interval where the execution time of the to-be-inserted streaming media task is located may be determined first, so that the comparison may be facilitated, for example, the execution time of the to-be-inserted streaming media task is 13:00: firstly, determining an interval of the same hour corresponding to the execution time, and then searching an interval of the same minute in the interval corresponding to the same hour, so that the approximate insertion position of the stream media task to be inserted in the waiting queue can be predetermined, the comparison quantity is reduced, and after the interval corresponding to the same minute is determined, comparison can be further performed according to the second moment of the execution time, so that the insertion position of the stream media task to be inserted is determined; meanwhile, for the case that a certain interval does not exist in the waiting queue, for example, the waiting queue only has an interval corresponding to 12 points and 14 points, and does not have an interval corresponding to 13 points, the stream media task to be inserted may be directly inserted between the intervals corresponding to 12 points and 14 points, or may be inserted correspondingly when there is no time corresponding to a certain time, and meanwhile, may be further divided, and the stream media task to be inserted may be inserted into the waiting queue by dividing 60 seconds into a plurality of intervals.
203: setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; the absolute time is a time difference value of the execution time of the streaming media task at the head position relative to the current time.
In an embodiment, as shown in fig. 4, when the execution time of the streaming media task is obtained, a current time 41 is obtained, for example, the current time 41 in fig. 4 is 12:59: 59, then according to the current time and the execution time of the streaming media task at the head position of the waiting queue, in fig. 4, the task one 421 is taken as the streaming media task at the head position of the waiting queue, and meanwhile, the execution time 422 of the task one 421 is obtained, that is, 13:00: 00, after obtaining the current time 41 and the execution time 422 of the task one 421, the absolute time 423 of the streaming media task at the head position is obtained as 1 second, that is, after 1 second, the task one is added to the execution queue.
In fig. 4 and 6, the waiting time sequence indicates the waiting time of the sequence corresponding to each streaming task, the waiting time of the streaming task at the head position is absolute time, the waiting time of the streaming task at the non-head position is relative time, the updated waiting time sequence indicates the updated waiting time of the sequence corresponding to each streaming task, the streaming task at the head position is absolute time, and the waiting time of the streaming task at the non-head position is relative time.
It should be noted that the time axis T in fig. 4 and 6 includes each time point along the range from 00:00:00 to 24:00:00, and the time axis T in fig. 4 and 6 shows two time points "12: 59: 00" and "13: 00: 05", and the corresponding tasks are sorted according to the time corresponding to the time axis T.
It should be noted that the current time is the local time of the server, for example, if the server is set in a place where the beijing time is adopted, the current time is the beijing time, and the server can periodically update the local time through the beijing system to ensure the time accuracy.
204: setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue; the relative time is a time difference value of the execution time of the streaming media task at the non-head position relative to the execution time of the previous streaming media task.
In one embodiment, when the waiting time of the streaming media task at the non-head position in the waiting queue is set as the relative time, the execution time of the streaming media task and the execution time of the streaming media task before the streaming media task need to be known, so that the relative time of the streaming media task can be determined, the steps include: searching the previous streaming media task corresponding to the streaming media task according to the position of each streaming media task in the non-head position in the waiting queue; determining the relative time of the streaming media task and the previous streaming media task according to the execution time of the streaming media task and the execution time corresponding to the previous streaming media task; specifically, as shown in fig. 4, when it is required to determine the relative time from task two 431 to task N, where the task N is denoted by reference numeral 451, the position of each streaming media task is obtained first, then the previous streaming media task of the streaming media task and the execution time of the previous streaming media task are obtained, for example, the execution time 432 of the previous streaming media task of task two 431 is task one 421, and the execution time of task two 431 is 13:00: 03, execution time 422 of task one 421 is 13:00: 00, the relative time 433 of task two 431 is 3 seconds after task one is executed, the previous streaming media task of task three 441 is task two 431, and the execution time of task three 441 is 13:00:05, the execution time of task two 431 is 13:00: 03, when the relative time of task three 441 is 2 seconds after task two is executed, …, the execution time 452 of task N, labeled 451, is ab: cd: ef (the time is later than the time of task three), assuming that the difference between the execution time of task N and the execution time of task N-1 is k seconds, the relative time of task N, which is labeled 451, is k seconds after task N-1 executes, and accordingly, the relative time of each streaming media task at the non-head position is obtained according to the execution time of each streaming media task and the previous streaming media task.
In an embodiment, when there is a streaming media task to be inserted, considering that the execution time of the streaming media task to be inserted also needs to be set as a relative time, the position of the streaming media task to be inserted needs to be determined first, so as to determine whether the relative time of the streaming media task in the waiting queue needs to be updated according to the position of the streaming media task, where the step includes: judging whether the streaming media task to be inserted is positioned at the tail part of the waiting queue according to the execution time of the streaming media task to be inserted and the execution time of the streaming media task in the waiting queue; when the streaming media task to be inserted is positioned at the tail of the waiting queue, setting the waiting time of the streaming media task to be inserted as relative time; when the streaming media task to be inserted is not positioned at the tail of the waiting queue, updating the relative time of each streaming media task in the waiting queue; when the position of the streaming media task to be inserted in the waiting queue is judged, whether the streaming media task is at the tail part of the waiting queue can be judged firstly, when the streaming media task to be inserted is at the tail part, the relative time of the streaming media task in the waiting queue does not need to be updated, and the execution time of the streaming media task to be inserted only needs to be set as the relative time; when the streaming media task to be inserted is not at the tail, the execution time of the streaming media task to be inserted needs to be set as the relative time, and the relative time of each streaming media task in the waiting queue needs to be updated, so that the relative time of each streaming media task in the waiting queue is updated.
In one embodiment, when the to-be-inserted streaming media task is not located at the tail of the waiting queue, it is further required to determine whether the to-be-inserted streaming media task is located at the head of the waiting queue, and when the to-be-inserted streaming media task is located at the head of the waiting queue, the waiting time of the to-be-inserted streaming media task is set to be absolute time according to the current time and the waiting time of the to-be-inserted streaming media task, and then the absolute time of the to-be-inserted streaming media task at the head is updated to be relative time according to the execution time of the to-be-inserted streaming media task and the execution time of the to-be-inserted streaming media task at the head, so that the to-be-inserted streaming media task at the head of the waiting queue is set to be absolute time, the streaming media task at the head of the waiting queue is set to be relative time, the method comprises the following steps: judging whether the streaming media task to be inserted is positioned at the head of the waiting queue according to the execution time of the streaming media task to be inserted and the execution time of the streaming media task in the waiting queue; when the streaming media task to be inserted is located at the head of the waiting queue, setting the waiting time of the streaming media task to be inserted as absolute time, and updating the waiting time of the streaming media task at the head position in the waiting queue to relative time.
In an embodiment, when the to-be-inserted streaming media task is located at the tail of the waiting queue, the execution time of the to-be-inserted streaming media task and the execution time of the previous streaming media task of the to-be-inserted streaming media task need to be known, so that the waiting time of the to-be-inserted streaming media task can be obtained according to the execution time of the to-be-inserted streaming media task and the execution time of the previous streaming media task of the to-be-inserted streaming media task, where the step includes: acquiring the execution time of a previous streaming media task of the streaming media task to be inserted; and setting the waiting time of the streaming media task to be inserted as relative time according to the execution time of the streaming media task to be inserted and the execution time of the previous streaming media task of the streaming media task to be inserted.
In an embodiment, when the to-be-inserted streaming media task is not located at the tail of the waiting queue, the execution times of the previous streaming media task and the next streaming media task of the to-be-inserted streaming media task need to be known, so that the relative times of the to-be-inserted streaming media task and the next streaming media task can be determined according to the to-be-inserted streaming media task, the execution times of the previous streaming media task and the next streaming media task, and the relative times of the waiting queue can be updated, where the step includes: acquiring the execution time of a previous streaming media task and the execution time of a next streaming media task of the streaming media task to be inserted; determining the relative time of the streaming media task to be inserted and the previous streaming media task and the relative time of the streaming media task to be inserted and the next streaming media task according to the execution time of the streaming media task to be inserted and the execution times of the previous streaming media task and the next streaming media task of the streaming media task to be inserted; setting the waiting time of the streaming media task to be inserted as the relative time according to the relative time of the streaming media task to be inserted and the previous streaming media task and the relative time of the streaming media task to be inserted and the next streaming media task, and updating the relative time of the streaming media task next to the streaming media task to be inserted; when the stream media task to be inserted is not at the tail of the waiting queue, the waiting time of the stream media task to be inserted needs to be set as relative time, the relative time of the next stream media task of the stream media task to be inserted is updated, and at the moment, the relative time of each stream media task can be updated according to the stream media task to be inserted, the previous stream media task and the execution time of the next stream media task; specifically, as shown in fig. 6, when task five 611 is inserted between task two 431 and task three 441, the execution time 612 of task five 611 is obtained, that is, 13:00: 04, the position of the task five 611 in the waiting queue can be determined by the execution time of the task five 611, and then the relative time between the task five 611 and the task two 431 and the relative time between the task five 611 and the task three 441 are determined according to the execution time 612 of the task five 611, the execution time 432 of the task two 431 and the execution time 442 of the task three 441, so that the waiting time of the task five 611 can be set as the relative time 613, that is, after the task two is executed for 1 second, the relative time 443 of the task three 441 is updated to after the task five is executed for 1 second, while the relative times of other streaming media tasks are not updated, and the absolute time of the streaming media task at the head position is not updated, thereby updating the relative time of each streaming media task.
It should be noted that, in fig. 4, 5, and 6, task N represents the nth task, but the order of the streaming media tasks is not ordered according to the size of N, but ordered according to the chronological order, so task five is before task three in fig. 6, and N is only for convenience of description, in practice, the streaming media tasks include that the data server sends heartbeat packets, the data server detects the number of received packets at regular time, the front-end device establishes a connection with the data server, the data server receives the real-time monitoring video stream sent by the front-end device, the data server processes the real-time monitoring video stream, and the like, and the k value in fig. 4, 5, and 6 is a difference value between the set execution time of task N and the execution time of task N-1.
205: and dynamically updating the waiting time of the streaming media task of the head position according to the current time.
In an embodiment, when the current time changes, the absolute time of the streaming media task at the head position is updated, so that it is ensured that when the execution time of the streaming media task at the head position reaches, the streaming media task at the head position can be added into the execution queue, and when the current time passes 1 second in the updating process, the absolute time is reduced by 1 second, for example, the current time is from 59 th second to 60 th second, and the absolute time is updated from 5 seconds to 4 seconds later, so that the absolute time of the streaming media task at the head position is continuously updated, and the streaming media task at the head position can be added into the execution queue according to the execution time and executed.
In an embodiment, after the step of dynamically updating the waiting time of the streaming media task at the head position according to the current time, the method further includes adding the streaming media task at the head position as a task to be executed to an execution queue when the absolute time of the streaming media task at the head position arrives.
In one embodiment, when the execution time of the streaming media task at the head position reaches, that is, when the absolute time is zero, the streaming media task at the head position is added to the execution queue as the task to be executed, so that the streaming media task is executed.
In an embodiment, after the step of adding the streaming media task at the head position as the task to be executed to the execution queue when the absolute time of the streaming media task at the head position arrives, the method further includes determining a next streaming media task of the task to be executed in the waiting queue as the streaming media task at the head position in the waiting queue, and setting the waiting time of the streaming media task at the head position as the absolute time.
In one embodiment, after adding the task to be executed to the execution queue, the next streaming media task of the task to be executed is updated to the streaming media task at the head position in the waiting queue, and the waiting time of the streaming media task at the head position is set to the absolute time, as shown in fig. 4, after the task one 421 at the head position in the waiting queue is added to the execution queue as the task to be executed, the absolute time of the task one 421 at the head position in the waiting queue does not need to be updated, at this time, the next streaming media task at the head position in the waiting queue, i.e., task two 431, is determined to be the streaming media task at the head position in the waiting queue, then the waiting time of task two 431 is updated to the absolute time 434, i.e., after 3 seconds, while the relative time of the streaming media task behind task two is reserved without being updated, for example, the relative time 443 of task three 441 is, i.e., 2 seconds after task two is performed, the relative time 453 of task N451 remains, i.e., k seconds after task N-1 is performed.
In an embodiment, after the streaming media tasks in the waiting queue are added to the execution queue, the to-be-executed tasks in the execution queue are arranged according to the entry time, and the to-be-executed tasks are sequentially executed.
The embodiment of the application provides a streaming media task management method, based on which the relative time sequencing can be performed on the waiting time of the streaming media tasks in the waiting queue, so that when the streaming media tasks in the waiting queue are added into the execution queue, only the waiting time of the streaming media task at the head position of the waiting queue needs to be updated, but the relative time of the streaming media task at the non-head position in the waiting queue does not need to be updated, thereby reducing the amount of changed data.
Fig. 5 is a schematic diagram of a change process of a wait queue changing with current time in a streaming media task management method according to an embodiment of the present application, please refer to fig. 5:
after setting waiting time for each streaming media task in a waiting queue according to current time and execution time of each streaming media task, obtaining a waiting queue one 51, wherein the waiting queue one 51 comprises each streaming media task and the waiting time of each streaming media task, the waiting queue one 51 comprises the waiting time of a task one 511 and a task one 511 which are positioned at head positions, namely after the absolute time is 1 second, the waiting time of a task two 512 and a task two 512 which are positioned at non-head positions, namely after the relative time is that the task one executes for 3 seconds, the waiting time of a task three 513 and a task three 513, namely after the relative time is that the task two executes for two seconds, …, the waiting time of a task N which is marked 514 and the waiting time of a task N which is marked 514 are marked after the task N-1 executes for k seconds;
taking the time axis T as an example, assuming that after the current time changes by 0.5 second, the waiting queue one 51 becomes the waiting queue two 52, and meanwhile, the waiting queue two 52 only needs to change the waiting time of the task one 521 at the head position, that is, the absolute time of the task one 521 is updated to 0.5 second from 1 second, and the waiting time of the task two 512 at the non-head position to the task N with the reference numeral 514 does not need to be updated;
with the change of the current time, when the execution time of the task one 521 at the head position of the waiting queue two 52 arrives, that is, the waiting time is 0, the waiting queue two 52 is updated to the waiting queue three 53, the task one 521 at the head position in the waiting queue two 52 is added to the execution queue, the waiting time of the streaming media task at the head position of the waiting queue three 53 is updated to the task two 531, the waiting time of the task two 531 is set to be absolute time, that is, after 3 seconds, and the waiting time of the task three 513 after the task two 531 to the task N with the reference number 514 does not need to be updated.
The embodiment of the present application provides a change process of a waiting queue changing with current time in a streaming media task management method, and as can be seen from the change process of the waiting queue, when updating the waiting time of a streaming media task, only the waiting time of the streaming media task located at the head position in the waiting queue needs to be updated, and the waiting time of the streaming media task located at the non-head position in the waiting queue does not need to be updated, so that the amount of data to be changed is reduced.
206: and when the execution time of the streaming media task is reached, adding the streaming media task into the execution queue from the waiting queue, and recording the initial time of starting the execution of the streaming media task.
In one embodiment, the detecting of the execution state of the streaming media task may be performed at an initial time of recording the streaming media task, and a time when the streaming media task starts to be executed is taken as the initial time of the streaming media task, so that the initial time of the streaming media task is the time when the streaming media task starts to be executed, and the step includes: after the streaming media task is added into an execution queue from a waiting queue, detecting the execution state of the streaming media task; when the streaming media task starts to execute, recording the moment when the streaming media task starts to execute as the initial time of the streaming media task; specifically, considering that the streaming media task is not executed immediately after the streaming media task is added to the execution queue from the waiting queue, the actual execution starting time of the streaming media task may be detected, and the actual execution starting time of the streaming media task is taken as the initial time of the streaming media task.
In an embodiment, when detecting the execution state of the streaming media task, the execution state of the streaming media task may be detected in real time, or the execution state of the streaming media task may be detected at a certain time interval, so that the initial time of the streaming media task may be detected.
In an embodiment, when recording the execution time of the streaming media task, the time for the streaming media task to join in the execution queue may also be recorded, and the initial time of the streaming media task is obtained according to the joining time of the streaming media task, this step includes: when the streaming media task is added into the execution queue from the waiting queue, recording the adding time of the streaming media task, and obtaining the initial time of the streaming media task according to the adding time of the streaming media task; specifically, considering that the streaming media task is executed after a certain time after being added to the execution queue, the initial time of the streaming media task may be obtained according to the time for the streaming media task to be added to the waiting queue, for example, the time for the streaming media task to be added from the waiting queue to the execution queue is 12: 00:00, after the streaming media task is added to the execution queue, the streaming media task is executed after 3 seconds, and then 12: 00: 03 is used as the initial time of the streaming media task, and the initial time of the streaming media task can be obtained according to the adding time of the streaming media task; when the initial time of the streaming media task is obtained according to the joining time of the streaming media task, the joining time of the streaming media task from the waiting queue to the execution queue can be used as the initial time, that is, considering that each executed streaming media task needs to be joined to the execution queue, the joining time of the streaming media task can be used as the initial time, so as to judge whether the execution of the streaming media task is overtime according to the initial time.
207: and when the execution of the streaming media task is completed, recording the end time of the completion of the execution of the streaming media task.
In an embodiment, the execution state of the streaming task may be detected when the end time of the completion of the execution of the streaming task is recorded, the execution state of the streaming task is detected after the streaming task starts to be executed, and the end time of the completion of the execution of the streaming task may be recorded when the completion of the execution of the streaming task is detected.
208: and judging whether the time interval between the initial time and the ending time is greater than the preset time or not according to the initial time and the ending time.
In an embodiment, the preset time refers to a time set for the streaming media task to complete an execution process of the streaming media task, and the time may be a time when the streaming media task occupies a thread, or a time when the streaming media task is added to an execution queue until the streaming media task is completed.
In an embodiment, when determining whether the streaming media task is executed overtime, the preset time of the streaming media task is further obtained, and whether the streaming media task is executed overtime is determined according to a comparison between an actual execution time of the streaming media task and the preset time, and when the preset time of the streaming media task is set, the preset time can be set for each streaming media task according to a data volume of each streaming media task, that is, considering that the data volume of each streaming media task is different, more time can be allocated to the streaming media task with a larger data volume, so that the time of the streaming media task occupying a thread during execution is longer, and the execution of the streaming media task is completed, the step includes: acquiring the data volume of each streaming media task; distributing corresponding occupied time for each streaming media task according to the data volume of each streaming media task; acquiring preset time of each streaming media task according to the occupied time of each streaming media task; specifically, for example, when the data server receives task execution requests of streaming media tasks sent by two front-end cameras, video data sent by the front-end cameras needs to be processed to obtain traffic violation data corresponding to the video data, assuming that the data volume of one video data is 10 megabytes and the data volume of the other video data is 20 megabytes, occupation time can be allocated to the two streaming media tasks according to the data volume of the two video data, that is, the time that a streaming media task with the data volume of 20 megabytes occupies a thread is greater than the streaming media task with the data volume of 10 megabytes, so that the preset time of the streaming media task can be set according to the data volume of the streaming media task, and then whether the streaming media task is executed overtime is determined according to comparison between the preset time of the streaming media and a difference between the initial time and the end time of the streaming media task.
In an embodiment, when obtaining the preset time of the streaming media task according to the occupation time of the streaming media task, considering that the initial time of the streaming media task takes the time when the streaming media task joins the execution queue as the initial time, and the streaming media task is executed within a certain time after joining the execution queue, therefore, the preset time of the streaming media task can be obtained according to the time when the streaming media task joins the execution queue and the occupation time of the streaming media task, that is, assuming that the streaming media task will be executed after 3 seconds after joining the execution queue, when taking the time when the streaming media task joins the execution queue as the initial time, the preset time of the streaming media task can be made to be the sum of the occupation time after 3 seconds, as shown in fig. 7, taking a time axis t as an example, assuming that a current time 71 is 12:59: 57, in this case, the wait queue 72 has an execution time of 13:00: task one 721, execution time of 00 is 13:00: task two 722 and execution time of 03 are 13:00:05, task three 723, assuming that the execution time of the streaming media task is the time for the streaming media task to join the execution queue, and the time for the streaming media task to join the execution queue is the initial time, that is, the initial time of task one 721 is 13:00: 00, as time goes by, after 3 seconds, task one 721 is added to the execution queue 73, and when task one 721 is added to the execution queue, the preset time of task one 721 is also obtained, and assuming that the occupied time set for task one 721 is 10 seconds, the preset time of task one 721 can be set to 13 seconds, and then according to the initial time of task one 721 and the end time of task one 721, it is determined whether the time interval between the initial time and the end time of task one 721 is greater than 13 seconds, so as to determine whether task one 721 is executed overtime.
It should be noted that, in fig. 7, when task one 721 is added from wait queue 72 to execution queue 73, the wait queue is updated, and the updated wait queue is not shown in fig. 7.
In an embodiment, when a time interval between adding the streaming media task to the execution queue and executing the streaming media task is obtained, the historical data may be counted to obtain the time interval, for example, the time between adding each streaming media task to the execution queue and the time for executing each streaming media task in the historical data are obtained, and the time interval between adding each streaming media task to the execution queue and executing each streaming media task is determined according to the time between adding each streaming media task to the execution queue and the time for executing each streaming media task.
In an embodiment, when the preset time of the streaming media task is obtained according to the occupied time of the streaming media task, the occupied time of the streaming media task can be directly used as the preset time of the streaming media task, that is, the time of the streaming media task executed in the thread is used as the preset time of the streaming media task, and when the time of the streaming media task occupying the thread exceeds the preset time, the execution timeout of the streaming media task is determined.
In an embodiment, the preset time may be obtained according to the execution time of the next streaming media task and the initial time of the streaming media task, that is, after the initial time of the streaming media task is determined, considering that the next streaming media task will be added to the execution queue for execution, and the next streaming media task will be executed within a certain time interval after being added to the execution queue, so that the initial time of the streaming media task may be set according to the execution time of the next streaming media task, where the step includes: acquiring the execution time of the next streaming media task of the streaming media task; obtaining the preset time according to the initial time of the streaming media task and the execution time of the next streaming media task; specifically, for example, in order to avoid the streaming media task from being accumulated in the execution queue, the streaming media task may be executed immediately after being added to the execution queue, or the streaming media task may be executed after a certain time interval after being added to the execution queue, for example, the streaming media task may be executed after 3 seconds after being added to the execution queue, after the initial time of the streaming media task is determined, the time when the next streaming media starts to be executed may be obtained according to the execution time of the next streaming media task and the time interval from when the next streaming media task is added to the execution queue to start to be executed, and then the preset time of the streaming media task may be determined by using the difference between the time when the next streaming media starts to be executed and the initial time of the streaming media task; when the preset time is determined by using the execution time of the next streaming media task and the initial time of the streaming media task, the data volume of each streaming media task may be considered, and when the data volume of the previous streaming media task is large, the next streaming media task may be executed after a relatively long time after being added to the execution queue, for example, the data volume of the task one is greater than that of the task two, and the data volume of the task two is greater than that of the task three, then after the task one is executed, after the task two is added to the execution queue, the task two may be executed after 3 seconds, and after the task two is executed, after the task three is added to the execution queue, the task three may be executed after 2 seconds, even if the execution time of the streaming media task with a large data volume is relatively large, the specific implementation may refer to the manner in which different occupation times are allocated to the streaming media tasks with different data volumes in the above embodiment, and will not be described in detail herein.
209: and when the time interval between the initial time and the ending time is greater than the preset time, alarming.
In one embodiment, when the time interval between the initial time and the end time of the streaming media task is greater than the preset time, it indicates that the streaming media task is executed overtime, and an alarm may be performed, and when an alarm is performed, an alarm may be performed by displaying different indicator lights on a display interface, or by a pop-up window, or by a warning sound, and at the same time, the streaming media task information and the time interval between the initial time and the end time may be recorded during the alarm, so as to obtain the log information, so that corresponding processing may be performed according to the log information during subsequent repairing of the program, which includes: when the time interval between the initial time and the end time is greater than the preset time, recording streaming media task information and the time interval between the initial time and the end time; alarming according to the streaming media task information and the time interval between the initial time and the ending time; specifically, when the time interval between the initial time and the ending time is greater than the preset time, the execution of the streaming media task is overtime, at this time, an alarm can be made to indicate that the execution of the streaming media task is overtime, and information of the streaming media task can be recorded, including task content of the streaming media task, execution time of the streaming media task, initial time of the streaming media task, ending time of the streaming media task, preset time of the streaming media task, a sending object of the streaming media task, namely, a front-end device initiating a request for executing the streaming media task, a position of the streaming media task, namely, a position where the streaming media task is in a waiting queue, a storage position of the streaming media task, and the like, a thread for executing the streaming media task, and a time interval between the initial time and the ending time, and the data can be recorded as an alarm log and the alarm log is stored, even if the program can not be modified, when the data server and the front-end equipment are repaired subsequently, the position of the overtime execution of the streaming media task, the overtime time of the execution of the streaming media task and the sending object of the streaming media task can be quickly determined according to the alarm log, so that the front-end equipment and the data server can be repaired according to the information, the efficiency is higher when the overtime execution of the streaming media task is accelerated, the corresponding information of the overtime execution of the streaming media task can be obtained according to the alarm log, the program or the data server and the front-end equipment can be repaired according to the information, the overtime execution of the streaming media task is avoided, for example, the streaming media task obtains traffic violation data for processing video data sent by the front-end equipment, after the alarm log is obtained, after the execution of the follow-flow media task is completed, the data server and the front-end device are detected, for example, during detection, the front-end device sending the video data can be determined according to the information of the streaming media task, so that the problem that the execution of the streaming media task is overtime due to slow thread processing can be solved, and the data server and the front-end device are repaired correspondingly. As shown in fig. 8, an alarm may be given by using an indicator 82 on a display interface 81, and at the same time, streaming media task information 83 and a time interval 84 between an initial time and an end time may be displayed on the interface, and when the alarm is given by using the indicator 82, different colors may be used to give different degrees of alarm, for example, the time for the streaming media task to execute timeout is only 0.01 second, a yellow indicator may be used to indicate that the timeout is small, and when the time for the timeout is 1 second, a red indicator may be used to indicate that the timeout is large.
In one embodiment, when the time interval between the initial time and the ending time of the streaming media task is greater than the preset time, acquiring the time difference value between the time interval of the initial time and the ending time of the streaming media task and the preset time, setting the preset time difference value, when the time difference is smaller than or equal to the preset time difference, a first alarm is given, when the time difference is larger than the preset time difference, a second alarm is given, namely, a certain time error occurs in the process of executing the streaming media task, so that when the time difference is less than or equal to the preset time difference, a first alarm is given, when the time difference value is larger than the preset time difference value, a second alarm is carried out to show that the execution overtime problem occurs, the first alarm and the second alarm can adopt the indicator lamps with different colors to carry out alarm, and the preset time difference value can be set according to the requirement.
In an embodiment, when the time interval between the initial time and the ending time of the streaming media task is greater than the preset time, in order to enable other streaming media tasks to be executed normally, the influence of the time part that the time interval between the initial time and the ending time of the streaming media task exceeds the preset time needs to be eliminated, the preset time of part of the streaming media task can be modified, and the execution speed of the streaming media task is accelerated, so that the influence of the overtime part is eliminated within a certain time, and the influence of the overtime part can be eliminated by eliminating the overdue task in the waiting queue and adopting the preset time of the overdue task, and this step includes: detecting streaming media tasks in a waiting queue, and determining whether an overdue task exists in the waiting queue; when an overdue task exists in the waiting queue, acquiring preset time of the overdue task; reallocating the preset time of the streaming media task according to the preset time of the overdue task; specifically, after the streaming media task is executed for 10 seconds, and after the alarm is obtained, the streaming media task in the waiting queue is detected, when the expired tasks exist in the waiting queue, the expired tasks can be deleted, the preset time of the expired tasks is distributed to other streaming media tasks, so that other streaming media tasks are free from the influence of the timeout portion, for example, the preset time of the expired task is 5 seconds, if 5 streaming media tasks exist between the streaming media task and the overdue task, the preset time of each streaming media task can be reduced by 1 second, and the ending time of each streaming media task is delayed by 1 second backwards, therefore, the streaming media task after the overdue task can be executed according to the execution time, and the delay of the execution time of all subsequent streaming media tasks caused by the execution of the overtime streaming media task and even the failure of the execution of the streaming media task are avoided.
In an embodiment, when the time interval between the initial time and the ending time is greater than the preset time, an alarm is issued, in order to avoid that the execution time of the stream media task overtime affects the execution times of other stream media tasks in the waiting queue, a part of the stream media task may be adopted to repair the overtime, so that the other stream media tasks are normally executed, and the preset time of the part of the stream media task may be updated, so as to eliminate the overtime of the stream media task, which includes: updating the preset updating time of the first streaming media task in the waiting queue according to the time interval between the initial time and the end time; executing the first streaming media task according to the updating preset time of the first streaming media task in the waiting queue; specifically, after the execution of the streaming media task is overtime, the preset time of a part of the streaming media tasks in the waiting queue can be updated, so that the preset time of a part of the streaming media tasks in the waiting queue is reduced, and the subsequent streaming media tasks can be executed according to the execution time, for example, after the execution of the streaming media task is overtime, the overtime time of the streaming media task is 5 seconds, so that the preset time of the subsequent streaming media tasks can be shortened, for example, the preset time of the subsequent 5 streaming media tasks is shortened, and the preset time of each streaming media task is shortened by 1 second, so that the streaming media task can be normally executed from the 6 th streaming media task; for example, the streaming media task is to process video data sent by 10 front-end devices to obtain corresponding illegal data, and if the execution of the streaming media task is overtime when the video data sent by the 1 st front-end device is processed, the preset time from the 2 nd to the 6 th streaming media task can be reduced, so that the 7 th to the 10 th streaming media tasks can be executed on time, thereby avoiding the problem that the execution of other streaming media tasks is delayed after the execution of the streaming media task is overtime.
The embodiment of the application provides a streaming media task management method, which can determine whether a streaming media task is executed overtime or not by judging the time interval between the initial time and the ending time of the streaming media task and the size of the preset time, alarm after the execution of the streaming media task is overtime, and record the information of the streaming media task and the overtime time of the streaming media task, so that the execution time of the streaming media task can be modified, all tasks cannot be executed according to the execution time, and the information of the streaming media task and the like can be recorded to obtain an alarm log, so that the position where the execution is overtime and the corresponding information can be quickly found when a program is subsequently repaired, and the efficiency of finding the streaming media task which is executed overtime is high.
Correspondingly, fig. 9 is a schematic structural diagram of a streaming media task management device according to an embodiment of the present application; referring to fig. 9, the streaming media task management device includes the following modules:
a receiving module 901, configured to receive a task execution request carrying a streaming media task execution time;
a joining module 902, configured to join, according to a task execution request of a streaming media task, each streaming media task into a waiting queue according to a time sequence of execution times of the streaming media tasks;
a first setting module 903, configured to set, according to the current time and the execution time of the streaming media task located at the head position of the waiting queue, the waiting time of the streaming media task located at the head position of the waiting queue as an absolute time; the absolute time is a time difference value of the execution time of the streaming media task at the head position relative to the current time;
a second setting module 904, configured to set, according to an execution time of a streaming media task at a non-head position of a waiting queue, a waiting time of the streaming media task at the non-head position of the waiting queue as a relative time; the relative time is a time difference value of the execution time of the streaming media task at the non-head position relative to the execution time of the previous streaming media task;
an updating module 905, configured to dynamically update the waiting time of the streaming media task at the head position according to the current time;
a first recording module 906, configured to add the streaming media task to an execution queue from a waiting queue when the execution time of the streaming media task reaches, and record an initial time for starting execution of the streaming media task;
a second recording module 907, configured to record, when the streaming media task is completed, an end time of the completion of the execution of the streaming media task;
a determining module 908, configured to determine whether a time interval between the initial time and the end time is greater than a preset time according to the initial time and the end time;
and an alarm module 909, configured to alarm when a time interval between the initial time and the end time is greater than a preset time.
In one embodiment, the first recording module 906 includes a first module and a second module, and the first module is configured to detect an execution status of the streaming media task after the streaming media task is added from the waiting queue to the execution queue; and the second module is used for recording the time when the streaming media task starts to be executed as the initial time of the streaming media task.
In one embodiment, the first recording module 906 is configured to record a join time of the streaming media task when the streaming media task is joined from the waiting queue to the execution queue; and obtaining the initial time of the streaming media task according to the adding time of the streaming media task.
In an embodiment, the streaming media task management device further includes a first obtaining module, where the first obtaining module is configured to obtain a data volume of each streaming media task; distributing corresponding occupied time for each streaming media task according to the data volume of each streaming media task; and obtaining the preset time of the streaming media task according to the occupied time of each streaming media task.
In an embodiment, the streaming media task management apparatus further includes a second obtaining module, where the second obtaining module is configured to obtain an execution time of a next streaming media task of the streaming media task; and obtaining the preset time according to the initial time of the streaming media task and the execution time of the next streaming media task.
In one embodiment, the alarm module 909 is configured to record the streaming media task information and the time interval between the initial time and the end time when the time interval between the initial time and the end time is greater than a preset time; and alarming according to the streaming media task information and the time interval between the initial time and the ending time.
In one embodiment, the streaming media task management device further comprises a detection module, wherein the detection module is used for detecting the streaming media tasks in the waiting queue and determining whether the expired tasks exist in the waiting queue; when an overdue task exists in the waiting queue, acquiring preset time of the overdue task; and reallocating the preset time of the streaming media task according to the preset time of the overdue task.
In an embodiment, the streaming media task management device further includes an updating module, where the updating module is configured to update the preset updating time of the first streaming media task in the waiting queue according to a time interval between the initial time and the end time; and executing the first streaming media task according to the updated preset time of the first streaming media task in the waiting queue.
Accordingly, embodiments of the present application also provide a data server, as shown in fig. 10, the data server may include Radio Frequency (RF) circuitry 1001, a memory 1002 including one or more computer-readable storage media, an input unit 1003, a display unit 1004, a sensor 1005, audio circuitry 1006, a Wireless Fidelity (WiFi) module 1007, a processor 1008 including one or more processing cores, and a power supply 1009. Those skilled in the art will appreciate that the data server architecture shown in FIG. 10 does not constitute a limitation of data servers and may include more or fewer components than shown, or some combination of components, or a different arrangement of components. Wherein:
the RF circuit 1001 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 1008 for processing; in addition, data relating to uplink is transmitted to the base station. The memory 1002 may be used to store software programs and modules, and the processor 1008 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1002. The input unit 1003 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The display unit 1004 may be used to display information input by or provided to the user and various graphical user interfaces of the server, which may be made up of graphics, text, icons, video, and any combination thereof.
The data server may also include at least one sensor 1005, such as light sensors, motion sensors, and other sensors. The audio circuitry 1006 includes speakers, which may provide an audio interface between the user and the data server.
WiFi belongs to a short-distance wireless transmission technology, and the data server can help the user send and receive e-mails, browse web pages, access streaming media and the like through the WiFi module 1007, and provides wireless broadband internet access for the user. Although fig. 10 shows the WiFi module 1007, it is understood that it does not belong to the essential constitution of the data server, and may be omitted entirely as needed within the scope of not changing the essence of the application.
The processor 1008 is the control center of the data server, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the data server and processes data by running or executing software programs and/or modules stored in the memory 1002 and calling data stored in the memory 1002, thereby performing overall monitoring of the handset.
The data server also includes a power source 1009 (e.g., a battery) for providing power to the various components, which may preferably be logically coupled to the processor 1008 via a power management system, such that the power management system may manage charging, discharging, and power consumption.
Although not shown, the data server may further include a camera, a bluetooth module, and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 1008 in the data server loads the executable file corresponding to the process of one or more application programs into the memory 1002 according to the following instructions, and the processor 1008 runs the application program stored in the memory 1002, so as to implement the following functions:
receiving a task execution request carrying streaming media task execution time; adding each streaming media task into a waiting queue according to a task execution request of the streaming media task and the time sequence of the streaming media task execution time; setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue; dynamically updating the waiting time of the streaming media task of the head position according to the current time; when the execution time of the streaming media task is reached, adding the streaming media task into an execution queue from a waiting queue, and recording the initial time for starting execution of the streaming media task; when the execution of the streaming media task is completed, recording the end time of the completion of the execution of the streaming media task; judging whether the time interval between the initial time and the end time is greater than a preset time or not according to the initial time and the end time; and when the time interval between the initial time and the ending time is greater than the preset time, alarming.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description, and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to implement the following functions:
receiving a task execution request carrying streaming media task execution time; adding each streaming media task into a waiting queue according to a task execution request of the streaming media task and the time sequence of the streaming media task execution time; setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue; dynamically updating the waiting time of the streaming media task of the head position according to the current time; when the execution time of the streaming media task is reached, adding the streaming media task into an execution queue from a waiting queue, and recording the initial time for starting execution of the streaming media task; when the execution of the streaming media task is completed, recording the end time of the completion of the execution of the streaming media task; judging whether the time interval between the initial time and the end time is greater than a preset time or not according to the initial time and the end time; and when the time interval between the initial time and the ending time is greater than the preset time, alarming.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by any method provided in the embodiments of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The streaming media task management method and apparatus, the data server, and the computer-readable storage medium provided in the embodiments of the present application are introduced in detail, and a specific example is applied in the description to explain the principles and embodiments of the present application, and the description of the embodiments is only used to help understand the technical solutions and core ideas of the present application; those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the present disclosure as defined by the appended claims.

Claims (10)

1. A stream media task management method is applied to a traffic police system, the traffic police system comprises a data server and a front-end device, and the stream media task management method comprises the following steps:
the data server receives a task execution request carrying streaming media task execution time; the streaming media task comprises that a data server receives a real-time monitoring video stream sent by front-end equipment, and the data server processes the real-time monitoring video stream;
adding each streaming media task into a waiting queue according to a task execution request of the streaming media task and the time sequence of the streaming media task execution time; the method comprises the following steps: setting a time interval according to the execution time of each streaming media task, acquiring the execution time of the streaming media task to be inserted, determining the time interval corresponding to the execution time of the streaming media task to be inserted according to the execution time of the streaming media task to be inserted, and inserting the streaming media task to be inserted into a waiting queue according to the execution time of the streaming media task to be inserted and the time interval corresponding to the execution time of the streaming media task to be inserted;
setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; the absolute time is a time difference value of the execution time of the streaming media task at the head position relative to the current time;
setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue; the relative time is a time difference value of the execution time of the streaming media task at the non-head position relative to the execution time of the previous streaming media task;
dynamically updating the waiting time of the streaming media task of the head position according to the current time;
when the execution time of the streaming media task is reached, adding the streaming media task as a to-be-executed streaming media task from a waiting queue to an execution queue, determining the next streaming media task of the to-be-executed task in the waiting queue as the streaming media task at the head position in the waiting queue, setting the waiting time of the streaming media task at the head position as absolute time, and recording the initial time for starting execution of the streaming media task;
when the execution of the streaming media task is completed, recording the end time of the completion of the execution of the streaming media task;
judging whether the time interval between the initial time and the end time is greater than a preset time or not according to the initial time and the end time;
when the time interval between the initial time and the end time is greater than the preset time, recording the streaming media task information and the time interval between the initial time and the end time; alarming according to the streaming media task information and the time interval between the initial time and the ending time; the streaming media task information comprises task content of the streaming media task, execution time of the streaming media task, preset time of the streaming media task and a sending object of the streaming media task;
detecting streaming media tasks in a waiting queue, and determining whether an overdue task exists in the waiting queue; when an overdue task exists in the waiting queue, acquiring preset time of the overdue task; and reallocating the preset time of the streaming media tasks in the waiting queue according to the preset time of the overdue tasks.
2. The streaming media task management method according to claim 1, wherein the step of adding the streaming media task from a waiting queue to an execution queue and recording an initial time when the streaming media task starts to be executed when the execution time of the streaming media task reaches comprises:
after the streaming media task is added into an execution queue from a waiting queue, detecting the execution state of the streaming media task;
and when the streaming media task starts to execute, recording the time when the streaming media task starts to execute as the initial time of the streaming media task.
3. The streaming media task management method according to claim 1, wherein the step of adding the streaming media task from a waiting queue to an execution queue and recording an initial time when the streaming media task starts to be executed when the execution time of the streaming media task reaches comprises:
when the streaming media task is added into the execution queue from the waiting queue, recording the adding time of the streaming media task;
and obtaining the initial time of the streaming media task according to the adding time of the streaming media task.
4. The streaming media task management method according to claim 1, wherein before the step of determining whether the time interval between the initial time and the end time is greater than a preset time according to the initial time and the end time, the method further comprises:
acquiring the data volume of each streaming media task;
distributing corresponding occupied time for each streaming media task according to the data volume of each streaming media task;
and obtaining the preset time of the streaming media task according to the occupied time of each streaming media task.
5. The streaming media task management method according to claim 1, wherein before the step of determining whether the time interval between the initial time and the end time is greater than a preset time according to the initial time and the end time, the method further comprises:
acquiring the execution time of the next streaming media task of the streaming media task;
and obtaining the preset time according to the initial time of the streaming media task and the execution time of the next streaming media task.
6. The streaming media task management method according to claim 1, wherein after the step of alarming when the time interval between the initial time and the end time is greater than a preset time, the method further comprises:
updating the preset updating time of the first streaming media task in the waiting queue according to the time interval between the initial time and the end time;
and executing the first streaming media task according to the updated preset time of the first streaming media task in the waiting queue.
7. The stream media task management device is applied to a traffic police system, wherein the traffic police system comprises a data server and a front-end device, and the stream media task management device comprises:
the receiving module is used for receiving a task execution request carrying the execution time of the streaming media task; the streaming media task comprises that a data server receives a real-time monitoring video stream sent by front-end equipment, and the data server processes the real-time monitoring video stream;
the adding module is used for adding each streaming media task into the waiting queue according to the task execution request of the streaming media task and the time sequence of the execution time of the streaming media task; the method comprises the following steps: setting a time interval according to the execution time of each streaming media task, acquiring the execution time of the streaming media task to be inserted, determining the time interval corresponding to the execution time of the streaming media task to be inserted according to the execution time of the streaming media task to be inserted, and inserting the streaming media task to be inserted into a waiting queue according to the execution time of the streaming media task to be inserted and the time interval corresponding to the execution time of the streaming media task to be inserted;
the first setting module is used for setting the waiting time of the streaming media task at the head position of the waiting queue as absolute time according to the current time and the execution time of the streaming media task at the head position of the waiting queue; the absolute time is a time difference value of the execution time of the streaming media task at the head position relative to the current time;
the second setting module is used for setting the waiting time of the streaming media task at the non-head position of the waiting queue as relative time according to the execution time of the streaming media task at the non-head position of the waiting queue; the relative time is a time difference value of the execution time of the streaming media task at the non-head position relative to the execution time of the previous streaming media task;
the updating module is used for dynamically updating the waiting time of the streaming media task at the head position according to the current time;
a first recording module, configured to add the streaming media task as a to-be-executed streaming media task from a waiting queue to an execution queue when the execution time of the streaming media task reaches, determine a next streaming media task of the to-be-executed task in the waiting queue as a streaming media task at a head position in the waiting queue, set the waiting time of the streaming media task at the head position as an absolute time, and record an initial time when the streaming media task starts to be executed;
the second recording module is used for recording the end time of the completion of the execution of the streaming media task when the execution of the streaming media task is completed;
the judging module is used for judging whether the time interval between the initial time and the ending time is greater than the preset time or not according to the initial time and the ending time;
the alarm module is used for recording the streaming media task information and the time interval between the initial time and the end time when the time interval between the initial time and the end time is greater than the preset time; alarming according to the streaming media task information and the time interval between the initial time and the ending time; the streaming media task information comprises task content of the streaming media task, execution time of the streaming media task, preset time of the streaming media task and a sending object of the streaming media task;
the distribution module is used for detecting streaming media tasks in a waiting queue and determining whether overdue tasks exist in the waiting queue; when an overdue task exists in the waiting queue, acquiring preset time of the overdue task; and reallocating the preset time of the streaming media tasks in the waiting queue according to the preset time of the overdue tasks.
8. The streaming media task management apparatus of claim 7, wherein the first recording module comprises:
a first module, configured to detect an execution state of the streaming media task after the streaming media task is added to an execution queue from a waiting queue;
and the second module is used for recording the time when the streaming media task starts to be executed as the initial time of the streaming media task.
9. A computer-readable storage medium, wherein a plurality of instructions are stored in the computer-readable storage medium, and the instructions are suitable for being loaded by a processor to execute the steps in the streaming media task management method according to any one of claims 1 to 6.
10. A data server, characterized in that the data server comprises a memory, a processor being a computer program stored on the memory and running on the processor, wherein the processor when executing the program implements the steps in the streaming media task management method according to any of claims 1 to 6.
CN202011025608.1A 2020-09-25 2020-09-25 Streaming media task management method and device Active CN111930490B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011025608.1A CN111930490B (en) 2020-09-25 2020-09-25 Streaming media task management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011025608.1A CN111930490B (en) 2020-09-25 2020-09-25 Streaming media task management method and device

Publications (2)

Publication Number Publication Date
CN111930490A CN111930490A (en) 2020-11-13
CN111930490B true CN111930490B (en) 2021-06-15

Family

ID=73333634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011025608.1A Active CN111930490B (en) 2020-09-25 2020-09-25 Streaming media task management method and device

Country Status (1)

Country Link
CN (1) CN111930490B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183316A (en) * 2007-11-28 2008-05-21 北京中星微电子有限公司 Tasks delayed time processing method and system in real-time operating system
CN109684108A (en) * 2018-12-26 2019-04-26 江苏满运软件科技有限公司 Implementation method, system, storage medium and the electronic equipment of message queue
CN110309024A (en) * 2019-04-23 2019-10-08 网宿科技股份有限公司 Data processing system and its method for executing data processing task

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040100982A1 (en) * 1999-09-30 2004-05-27 Sivaram Balasubramanian Distributed real-time operating system
CN101339521B (en) * 2008-07-28 2011-04-20 华中科技大学 Tasks priority dynamic dispatching algorithm
CN106874087A (en) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 A kind of block chain intelligence contract timed task dispatching method
CN108628671A (en) * 2018-04-28 2018-10-09 北京顶象技术有限公司 Method for scheduling task and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183316A (en) * 2007-11-28 2008-05-21 北京中星微电子有限公司 Tasks delayed time processing method and system in real-time operating system
CN109684108A (en) * 2018-12-26 2019-04-26 江苏满运软件科技有限公司 Implementation method, system, storage medium and the electronic equipment of message queue
CN110309024A (en) * 2019-04-23 2019-10-08 网宿科技股份有限公司 Data processing system and its method for executing data processing task

Also Published As

Publication number Publication date
CN111930490A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN111970215B (en) Data packet management method and device
CN112148493A (en) Streaming media task management method and device and data server
CN111694674B (en) Message distribution processing method, device, equipment and storage medium
CN110177300B (en) Program running state monitoring method and device, electronic equipment and storage medium
CN111161546A (en) Key vehicle checking method and system for traffic management system
CN111787256B (en) Management method, device, medium and electronic equipment for pre-alarm video
US20220369278A1 (en) Object monitoring methods and apparatuses, electronic devices and computer readable storage media
CN111935497B (en) Video stream management method and data server for traffic police system
CN107181825B (en) Online processing method of terminal equipment data
CN111930490B (en) Streaming media task management method and device
CN102523236B (en) Method and equipment for establishing dynamic connection
CN112182289B (en) Data deduplication method and device based on Flink frame
CN113791792A (en) Application calling information acquisition method and device and storage medium
US10861306B2 (en) Method and apparatus for video surveillance
WO2023231723A1 (en) Streaming media data processing method and system
CN106341433A (en) Service system, signal server and intercom server
CN104836878A (en) Method, device and system for outputting prompt in communication process
CN111935313B (en) Connection pool management method and device
CN109040672B (en) Video playing method and device
CN112188245B (en) Front-end camera real-time video-on-demand method and device and electronic equipment
CN105578135A (en) Video on-demand method and device
CN112201047B (en) Suspected vehicle foothold analysis method and device based on Flink framework
CN111935309B (en) Method and device for managing circular tasks
CN111767131A (en) Streaming media task management method and device
CN113191305A (en) Data management method and device based on Flink framework

Legal Events

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