Operator operation method and device, storage medium, and electronic device
By running multiple operators in the target tracking algorithm in parallel in the task manager, the problem that algorithms in the prior art cannot be processed and deployed to the core of the chip in parallel is solved, the processing efficiency and throughput are improved, and the calculation of multi-core chips is used is used. ability.
Patent Information
- Application Number
- CN202010641902.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-06
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-07-06
AI Technical Summary
In the prior art, perimeter intrusion detection algorithm based on network video streams cannot implement parallel processing on multi-core chip devices, resulting in reduced processing throughput, and the algorithm cannot be effectively deployed to the chip core, and the computing power cannot be utilized to the maximum extent.
By obtaining multiple operators in the target tracking algorithm and setting them in a task in an idle state in the task manager, the chip core of the hardware manager is used to run in parallel, realizing resource sharing and reasonable deployment between operators .
It improves the real-time throughput of the overall framework, reduces unnecessary calculations, maximizes the calculation ability of hardware chips, reduces the calculation amount in subsequent links, and improves the algorithm processing efficiency.
Smart Images

Figure CN111897634B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to an operator operation method and device, a storage medium, and an electronic device. Background Art
[0002] With the rapid development of computer graphics, artificial intelligence, machine learning, Internet of Things and other technologies, perimeter intrusion detection based on network video streams has become a research hotspot in related fields. Perimeter intrusion detection based on network video streams refers to the detection of the movement trajectory and behavior of the target entering the alarm area within the monitoring range of the network camera (IP camera, referred to as IPC) according to the set monitoring conditions and alarm area. As long as the target entering the area meets the aforementioned alarm conditions, the IPC automatic alarm will be automatically triggered and reported.
[0003] In the related art, a method for realizing alarm using real-time video stream is provided: first, target detection (Object Detection) is used to capture the target in the video stream, and then the three-frame difference method is used to obtain the foreground image and extract the outline of each moving target, and then track each target (Object Tracktion). If the target trajectory and behavior meet the alarm rules set above, the alarm is triggered. This invention can effectively realize the monitoring and alarm of the target area of interest.
[0004] However, in related technologies, video stream data can only be connected in series through algorithms (such as detection and tracking algorithms), and cannot be effectively processed in parallel on multi-core chip devices, reducing the throughput of the entire processing framework. Since most current chips have multiple computing cores, the algorithm cannot deploy the required algorithms to the appropriate computing cores based on the computing load of all current cores, and cannot maximize the use of chip computing power.
[0005] In response to the problems in related technologies, such as the inability to process algorithms in parallel and the inability to effectively deploy algorithms to chip cores, no effective technical solutions have been proposed. Summary of the invention
[0006] The embodiments of the present invention provide an operator operation method and device, a storage medium, and an electronic device to at least solve the problems in the related art such as the inability to process algorithms in parallel and the inability to effectively deploy algorithms to chip cores.
[0007] An embodiment of the present invention provides an operator running method, comprising: obtaining M operators to be run in a target tracking algorithm, where M is an integer greater than 1; setting some or all of the M operators in L tasks in an idle state in a task manager, where L is an integer greater than 1; calling the L tasks in the idle state to run some or all of the operators in parallel through L chip cores of the hardware manager.
[0008] Optionally, obtaining M operators of the target tracking algorithm includes: obtaining M1 target detection operators to be run in the target tracking algorithm, wherein the target detection operator is used to detect the target from the video data; obtaining M2 target tracking operators to be run in the target tracking algorithm, wherein the target tracking operator is used to track the detected target to obtain a tracking result; obtaining an alarm operator to be run in the target tracking algorithm, wherein the alarm operator is used to determine whether the tracking result satisfies the alarm rule, wherein the M operators include: the M1 target detection operators, the M2 target tracking operators and the alarm operator.
[0009] Optionally, obtaining M operators of the target tracking algorithm includes: obtaining M3 motion detection operators to be run in the target tracking algorithm, wherein the motion detection operator is used to delete targets whose stationary time exceeds a preset threshold from the detected targets, and the M operators include: the M1 target detection operators, the M2 target tracking operators, the M3 motion detection operators and the alarm operator.
[0010] Optionally, some or all of the M operators are set in L tasks that are in an idle state in the task manager, including: polling the first target identifier corresponding to the task in the task manager, wherein when the first target identifier is a first value, the task corresponding to the first target identifier is in an idle state, and when the first target identifier is a second value, the task corresponding to the first target identifier is in a busy state; determining L tasks whose first target identifier is a first value; and setting some or all of the M operators in the L tasks that are in an idle state in the task manager.
[0011] Optionally, after setting some or all of the M operators in L tasks in an idle state in the task manager, the method further includes: receiving a control instruction; and responding to the control instruction to set whether the task in the task manager processes the operators in the task at the target time.
[0012] Optionally, in response to the control instruction, setting whether the task in the task manager processes the operator in the task at the target time includes: in response to the control instruction, setting the value of the second target identifier of the task, wherein, when the second target identifier is a third value, allowing the operator in the task corresponding to the second target identifier to be processed at the target time, and when the second target identifier is a fourth value, not processing the operator in the task corresponding to the second target identifier at the target time.
[0013] Optionally, the method further comprises: forming a cluster with the task manager and other P task managers, so that the hardware manager and the hardware managers corresponding to the other P task managers share resources.
[0014] According to another embodiment of the present invention, there is also provided an operator running device, including: an acquisition module, used to acquire M operators to be run in a target tracking algorithm, where M is an integer greater than 1; a setting module, used to set some or all of the M operators in L tasks in an idle state in a task manager, where L is an integer greater than 1; and a calling module, used to call the L tasks in the idle state to run some or all of the operators in parallel through the L chip cores of the hardware manager.
[0015] Optionally, the acquisition module is also used to acquire M1 target detection operators to be run in the target tracking algorithm, wherein the target detection operator is used to detect the target from the video data; acquire M2 target tracking operators to be run in the target tracking algorithm, wherein the target tracking operator is used to track the detected target to obtain a tracking result; acquire an alarm operator to be run in the target tracking algorithm, wherein the alarm operator is used to determine whether the tracking result satisfies the alarm rule, wherein the M operators include: the M1 target detection operators, the M2 target tracking operators and the alarm operator.
[0016] Optionally, the acquisition module is also used to acquire M3 motion detection operators to be run in the target tracking algorithm, wherein the motion detection operator is used to delete targets whose stationary time exceeds a preset threshold from the detected targets, and the M operators include: the M1 target detection operators, the M2 target tracking operators, the M3 motion detection operators and the alarm operator.
[0017] Optionally, the setting module is also used to poll the first target identifier corresponding to the task in the task manager, wherein when the first target identifier is a first value, the task corresponding to the first target identifier is in an idle state, and when the first target identifier is a second value, the task corresponding to the first target identifier is in a busy state; determine L tasks whose first target identifier is the first value; and set some or all of the M operators in the L tasks that are in an idle state in the task manager.
[0018] Optionally, the above device further includes: a receiving module for receiving a control instruction; and a responding module for responding to the control instruction to set whether the task in the task manager processes the operator in the task at the target time.
[0019] Optionally, the response module is also used to respond to the control instruction and set the value of the second target identifier of the task, wherein, when the second target identifier is a third value, the operator in the task corresponding to the second target identifier is allowed to be processed at the target time, and when the second target identifier is a fourth value, the operator in the task corresponding to the second target identifier is not processed at the target time.
[0020] Optionally, the above-mentioned device further includes: a sharing module, which is used to form a cluster with the task manager and other P task managers, so that the hardware manager and the hardware managers corresponding to the other P task managers share resources.
[0021] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0022] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0023] Through the present invention, M operators to be run in the target tracking algorithm are obtained, where M is an integer greater than 1; some or all of the M operators are set in L tasks in an idle state in the task manager, where L is an integer greater than 1; the L tasks in the idle state are called to run some or all of the operators in parallel through L chip cores of the hardware manager, that is, the operators to be run can be set in the tasks in the idle state in the task manager, and then the operators to be run in the tasks in the idle state can be run in parallel through the chip core of the hardware manager. The above technical solution is adopted to solve the problems in the related technology that the algorithm cannot be processed in parallel and the algorithm cannot be effectively deployed to the chip core, and then through the parallel operation of the operators in the algorithm, the real-time throughput of the overall framework is improved, unnecessary calculations are reduced, the computing power of the hardware chip is used to the maximum extent, the calculation amount of subsequent links is reduced, and the algorithm processing efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0025] Figure 1 A hardware structure block diagram of a chip for an operator operation method according to an embodiment of the present invention;
[0026] Figure 2 is a flowchart of an operation method of an operator according to an embodiment of the present invention;
[0027] Figure 3 It is a schematic diagram of a flow chart of an operation method of an operator according to an optional embodiment of the present invention;
[0028] Figure 4 A schematic diagram of the structure of a topology diagram for sharing computing resources according to an optional embodiment of the present invention;
[0029] Figure 5 4 is a structural block diagram of an operating device of an operator according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] The method embodiments provided in the embodiments of the present application can be executed in a chip, a computer terminal or a similar computing device. Taking running on a chip as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a chip of an operator operation method according to an embodiment of the present invention. Figure 1 As shown, the chip 10 may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above chip may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above chip. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the operation method of an operator in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the chip via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by the communication provider of the chip. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0035] In this embodiment, a method for operating an operator running on the above chip is provided. Figure 2 is a flow chart of an operation method of an operator according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:
[0036] Step S202, obtaining M operators to be run in the target tracking algorithm, where M is an integer greater than 1;
[0037] Step S204, setting some or all of the M operators in L tasks in an idle state in the task manager, where L is an integer greater than 1;
[0038] Step S206: calling the L tasks in the idle state to run part or all of the operators in parallel through the L chip cores of the hardware manager.
[0039] Through the present invention, M operators to be run in the target tracking algorithm are obtained; some or all of the M operators are set in L tasks in an idle state in the task manager; the L tasks in the idle state are called to run some or all of the operators in parallel through the L chip cores of the hardware manager, that is, according to the needs of the operators to be run in the target tracking algorithm, the operators to be run can be set in the tasks in the idle state in the task manager, and then the operators to be run in the tasks in the idle state can be run in parallel through the chip core of the hardware manager. The above technical solution is adopted to solve the problems in the related technology that the algorithm cannot be processed in parallel and the algorithm cannot be effectively deployed to the chip core, and then through the parallel operation of the operators in the algorithm, the real-time throughput rate of the overall framework is improved, unnecessary calculations are reduced, the computing power of the hardware chip is used to the maximum extent, the calculation amount of subsequent links is reduced, and the algorithm processing efficiency is improved.
[0040] There are multiple ways to obtain the M operators of the target tracking algorithm in the above step S202. In an optional embodiment, it can be implemented by the following scheme: obtain M1 target detection operators to be run in the target tracking algorithm, wherein the target detection operator is used to detect the target from the video data; obtain M2 target tracking operators to be run in the target tracking algorithm, wherein the target tracking operator is used to track the detected target to obtain a tracking result; obtain an alarm operator to be run in the target tracking algorithm, wherein the alarm operator is used to determine whether the tracking result meets the alarm rule, wherein the M operators include: M1 target detection operators, M2 target tracking operators and alarm operators.
[0041] That is to say, given the above-mentioned technical solution of determining M operators, in an embodiment of the present invention, the target detection operator to be run in the target tracking algorithm can detect the target from the video data, and at the same time, the target tracking operator to be run in the target tracking algorithm can be used to track the target to generate a tracking result corresponding to the target, and then the alarm operator in the target tracking algorithm determines whether the tracking result meets the alarm rule based on the tracking result. When the alarm rule is met, the alarm is triggered and reported to the system. When the alarm rule is not met, the detection and tracking of the target in the video data continue.
[0042] Optionally, obtaining M operators of the target tracking algorithm includes: obtaining M3 motion detection operators to be run in the target tracking algorithm, wherein the motion detection operator is used to delete targets whose stationary time exceeds a preset threshold from the detected targets, and the M operators include: M1 target detection operators, M2 target tracking operators, M3 motion detection operators and alarm operators.
[0043] In short, in order to improve the processing efficiency of the target tracking algorithm, the targets detected from the video data by the target detection operator and whose stillness time exceeds a preset threshold can be deleted from the detection results according to the motion detection operator to be run in the target tracking algorithm. It should be noted that the preset threshold of the stillness time is set according to the detection requirements of the video data, so that the target tracking algorithm can better track the target according to the target tracking operator, and the present invention does not impose too many restrictions on this.
[0044] Optionally, some or all of the M operators are set in L tasks that are in an idle state in the task manager, including: polling the first target identifier corresponding to the tasks in the task manager, wherein when the first target identifier is a first value, the task corresponding to the first target identifier is in an idle state, and when the first target identifier is a second value, the task corresponding to the first target identifier is in a busy state; determining L tasks whose first target identifier is a first value; and setting some or all of the M operators in the L tasks that are in an idle state in the task manager.
[0045] That is to say, based on the value corresponding to the first target identifier, the state corresponding to the task in the polling task manager can be determined. For example, when the first target identifier is the first value, the corresponding task is in an idle state; when the first target identifier is the second value, the corresponding task is in a busy state; thereby, based on determining multiple tasks with the first target identifier as the first value; some or all of the operators in the operator can be set in the task in the idle state in the task manager. Optionally, the first value is 1 and the second value is 0.
[0046] Optionally, after setting some or all of the M operators in L tasks in idle state in the task manager, the method further includes: receiving a control instruction; responding to the control instruction, setting whether the task in the task manager processes the operators in the task at the target time.
[0047] That is, after receiving the control instruction, the task manager responds to the control instruction and sets the task in the task manager to process the operator in the task at the target time. The target time is the time when the task is in the idle state. Then, according to the completed settings, the operator in the task is processed.
[0048] Optionally, in response to a control instruction, setting whether the task in the task manager processes the operator in the task at the target time includes: in response to a control instruction, setting the value of the second target identifier of the task, wherein when the second target identifier is a third value, allowing the operator in the task corresponding to the second target identifier to be processed at the target time, and when the second target identifier is a fourth value, not processing the operator in the task corresponding to the second target identifier at the target time.
[0049] That is to say, in response to the control instruction, after setting the task in the task manager to determine whether to process the operator in the task at the target time, further processing judgment can be made based on the value of the second target identifier of the task. When the second target identifier is the third value, it indicates that the operator in the task corresponding to the second target identifier is allowed to be processed at the target time; when the second target identifier is the fourth value, it indicates that the operator in the task corresponding to the second target identifier is not processed at the target time. Optionally, the third value is 1 and the fourth value is 0.
[0050] It should be noted that the above-mentioned determination of the corresponding processing method by the value of the target identifier (including the first target identifier or the second target identifier) is pre-configured in the target tracking algorithm, and can also be set to other values to determine the operator processing scheme in the task. The present invention does not impose too many restrictions on this.
[0051] Optionally, the method further includes: forming a cluster with the task manager and other P task managers, so that the hardware manager and the hardware managers corresponding to the other P task managers share resources.
[0052] For example, Figure 4 As shown in the figure, the three task managers of the device are connected to form a cluster (the number of devices is only schematic), and the task managers of each device share the current device operation status. When a device is idle, some computing tasks on other devices can be balanced to this device to achieve effective resource utilization. At the same time, if the computing power of the cluster needs to be increased, only computing node devices need to be dynamically added, which is easy to expand.
[0053] The following is an explanation of the operation method flow of the above operator in combination with several optional embodiments, but is not intended to limit the technical solution of the embodiment of the present invention.
[0054] Figure 3 Schematic diagram of a flowchart of an operation method of an operator in an optional embodiment of the present invention, such as Figure 3 As shown, the following steps are included:
[0055] Step S1: an external real-time video stream (equivalent to the video data in the embodiment of the present invention) is input as data to a target detection node. The target detection can be applied to the detection of visible light and infrared light input data. The node contains n target detection operators that can process n input video data. The node detects targets {od1, od2, od3, ...od α}.
[0056] Step S2: The node obtains the target detection results {od1, od2, od3, ...od α}, track the target detected in S1 according to the historical frame data. Similarly, in order to deal with n-way detection target results, this node contains n-way target tracking operators. After operation, the tracking results {ot1,ot2,ot3,...ot β}.
[0057] Step S3: The node obtains n detection targets {ot1, ot2, ot3, ...ot β}, through the motion detection operator, the target is detected again, and the targets that have not moved for a long time are filtered out to obtain the result {om1,om2,om3,...om χ}, this step improves the detection accuracy, reduces unnecessary calculations, and reduces the amount of calculations in subsequent links.
[0058] Step S4: filter the target {om1, om2, om3, ...om χ}According to the set alarm rules (equivalent to the alarm rules in the embodiment of the present invention), the judgment is performed to obtain the result {alert1, alert2, alert3, ... alert δ}, when the alarm rules are met, the alarm is triggered and reported to the system.
[0059] Optionally, S4 will also adaptively adjust some operating parameters (such as sensitivity, time interval, upper limit of detection number, etc.) according to the alarm effect. And as the device runs, the training model is continuously improved through deep learning, thereby improving the aforementioned target detection, target tracking, motion detection accuracy, and ultimately improving the overall detection accuracy of the system.
[0060] Step S5, M1 task manager. Since the calculations required by S1, S2, S3, and S4 are not directly deployed on hardware chip resources, they are first sent to an abstract M1 task manager, which manages k tasks. The idle state of the i-th task at time t is m i (t), m i When the value of (t) is 1, it indicates busy, and when it is 0, it indicates idle. When a new operator task enters M1 in the algorithm S1-S4, the task manager polls M1. i (t) state, if there are idle task units, the newly entered operator will be deployed on the idle task unit; otherwise, the operator to be processed will be placed in the waiting queue, and the waiting operator in the queue will be run when there are idle task resources. At the same time, the task manager controls whether to process each data flowing through the operator, S i (t) indicates whether the i-th task needs to be processed at time t. 1 indicates that the operator needs to be processed, and 0 indicates that the processing of the operator is skipped and the operator input data is returned as the output result. Therefore, S can be set externally in real time. i (t) to enable / disable some algorithms. Flexible enabling / disabling of algorithms allows the solution to be deployed on hardware devices with different computing power. On hardware devices with weaker computing power, the solution can still run by disabling some algorithms without doing additional code development.
[0061] Step S6: The M2 task manager is a hardware chip manager that directly manages the computing core of the hardware chip. The task manager deploys the M1 task to the computing core. The load state of the computing core i at time t is l i (t), whose value range is 0% to 100%. The task manager will calculate the current computing load of each core of the chip. i(t) Deploy new tasks to appropriate computing cores. If all cores are busy, new tasks enter the waiting queue. When the subsequent core computing resources are idle, the tasks in the waiting queue will be processed. When there are no new tasks entering and some tasks are currently running on M2, M2 will balance the load level of each computing core according to the current load of all computing cores, so that each computing core is in a relatively good operating state. When a hardware chip core fails to run a task, the M2 hardware chip manager will re-send the task to a new idle hardware computing core to perform the task, and report the faulty core computing event at the same time.
[0062] Since M1 manages all computing tasks, the computing status of each task (time consumption, resource utilization, real-time running status) can be recorded here, which is convenient for external debugging of problems and performance tuning of the entire system.
[0063] It should be noted that due to the introduction of 5G technology and the maturity of Internet of Things technology, the optional embodiment of the present invention also supports the sharing of computing resources of cluster devices within a certain range. Figure 4 4 is a schematic diagram of a topology diagram of computing resource sharing according to an optional embodiment of the present invention. As shown in FIG. 4 , only three devices are drawn in the diagram. It should be understood that Figure 4 The numbers are merely illustrative. According to implementation requirements, the optional embodiments of the present invention support any number of devices to share computing resources of cluster devices within the range. Figure 4 The three devices are connected to form a cluster, and the M1 task schedulers between the devices share the current device operation status. When a device is idle, some computing tasks on other devices can be balanced to the device to achieve effective resource utilization. At the same time, if the computing power of the cluster needs to be increased, only the computing node devices need to be dynamically increased, which is easy to expand.
[0064] Compared with the prior art, the optional embodiment of the present invention increases the framework data throughput rate by running the algorithm operators in parallel; in addition, by adding a motion detection link, the detection accuracy is improved, unnecessary calculations are reduced, and the amount of calculation in subsequent links is reduced; abstract hardware computing resources and provide an indirect layer - the task manager, which can deploy new tasks to the most suitable core for operation according to the computing load of each chip calculation verification, effectively improving the utilization rate of the chip computing power. At the same time, the task manager provides external support for the algorithm enable / disable function; the abstract task manager records the computing status of each deployed task, which is convenient for external error debugging and performance analysis of the entire system.
[0065] In summary, the optional embodiment of the present invention mentions that according to the needs of the operators to be run of the target tracking algorithm, the operators to be run are set in the tasks in the idle state in the task manager, and then the chip core of the hardware manager runs the operators to be run in the idle state in parallel. The technical solution solves the problems that the algorithm cannot be processed in parallel and the algorithm cannot be effectively deployed to the chip core. Furthermore, through the parallel running of the operators in the algorithm, the real-time throughput of the overall framework is improved, unnecessary calculations are reduced, the computing power of the hardware chip is utilized to the maximum extent, the calculation amount of subsequent links is reduced, and the algorithm processing efficiency is improved.
[0066] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0067] In this embodiment, a running device of an operator is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0068] Figure 5 is a structural block diagram of an operation device of an operator according to an embodiment of the present invention, such as Figure 4 As shown, the device comprises:
[0069] An acquisition module 50 is used to acquire M operators to be run in the target tracking algorithm, where M is an integer greater than 1;
[0070] A determination module 52, configured to set some or all of the M operators in L tasks in an idle state in a task manager, where L is an integer greater than 1;
[0071] The calling module 54 is used to call the L tasks in the idle state to run part or all of the operators in parallel through the L chip cores of the hardware manager.
[0072] Through the above-mentioned device, M operators to be run in the target tracking algorithm are obtained, where M is an integer greater than 1; some or all of the M operators are set in L tasks in an idle state in the task manager, where L is an integer greater than 1; the L tasks in the idle state are called to run some or all of the operators in parallel through the L chip cores of the hardware manager, that is, according to the needs of the operators to be run in the target tracking algorithm, the operators to be run can be set in the tasks in the idle state in the task manager, and then the operators to be run in the tasks in the idle state can be run in parallel through the chip core of the hardware manager. The above-mentioned technical solution is adopted to solve the problems in the related technology that the algorithm cannot be processed in parallel and the algorithm cannot be effectively deployed to the chip core, and then through the parallel operation of the operators in the algorithm, the real-time throughput of the overall framework is improved, unnecessary calculations are reduced, the computing power of the hardware chip is utilized to the maximum extent, the calculation amount of subsequent links is reduced, and the algorithm processing efficiency is improved.
[0073] Optionally, the acquisition module is also used to acquire M1 target detection operators to be run in the target tracking algorithm, wherein the target detection operator is used to detect the target from the video data; acquire M2 target tracking operators to be run in the target tracking algorithm, wherein the target tracking operator is used to track the detected target to obtain a tracking result; acquire an alarm operator to be run in the target tracking algorithm, wherein the alarm operator is used to determine whether the tracking result satisfies the alarm rule, wherein the M operators include: the M1 target detection operators, the M2 target tracking operators and the alarm operator.
[0074] That is to say, given the above-mentioned technical solution of determining M operators, in an embodiment of the present invention, the target detection operator to be run in the target tracking algorithm can detect the target from the video data, and at the same time, the target tracking operator to be run in the target tracking algorithm can be used to track the target to generate a tracking result corresponding to the target, and then the alarm operator in the target tracking algorithm determines whether the tracking result meets the alarm rule based on the tracking result. When the alarm rule is met, the alarm is triggered and reported to the system. When the alarm rule is not met, the detection and tracking of the target in the video data continue.
[0075] Optionally, the acquisition module is also used to acquire M3 motion detection operators to be run in the target tracking algorithm, wherein the motion detection operator is used to delete targets whose stationary time exceeds a preset threshold from the detected targets, and the M operators include: the M1 target detection operators, the M2 target tracking operators, the M3 motion detection operators and the alarm operator.
[0076] In short, in order to improve the processing efficiency of the target tracking algorithm, the targets detected from the video data by the target detection operator and whose stillness time exceeds a preset threshold can be deleted from the detection results according to the motion detection operator to be run in the target tracking algorithm. It should be noted that the preset threshold of the stillness time is set according to the detection requirements of the video data, so that the target tracking algorithm can better track the target according to the target tracking operator, and the present invention does not impose too many restrictions on this.
[0077] Optionally, the setting module is also used to poll the first target identifier corresponding to the task in the task manager, wherein when the first target identifier is a first value, the task corresponding to the first target identifier is in an idle state, and when the first target identifier is a second value, the task corresponding to the first target identifier is in a busy state; determine L tasks whose first target identifier is the first value; and set some or all of the M operators in the L tasks that are in an idle state in the task manager.
[0078] That is to say, based on the value corresponding to the first target identifier, the state corresponding to the task in the polling task manager can be determined. For example, when the first target identifier is the first value, the corresponding task is in an idle state; when the first target identifier is the second value, the corresponding task is in a busy state; thereby, based on determining multiple tasks with the first target identifier as the first value; some or all of the operators in the operator can be set in the task in the idle state in the task manager. Optionally, the first value is 1 and the second value is 0.
[0079] Optionally, the above device further includes: a receiving module for receiving a control instruction; and a responding module for responding to the control instruction to set whether the task in the task manager processes the operator in the task at the target time.
[0080] In order to improve the efficiency of setting some or all operators in a task that is in an idle state in the task manager, after receiving the control instruction, the task manager responds to the control instruction and sets the task in the task manager whether to process the operators in the task at the target time. The target time is the time when the task is in an idle state, and then the processing of the operators in the task is executed according to the completed settings.
[0081] Optionally, the response module is also used to respond to the control instruction and set the value of the second target identifier of the task, wherein, when the second target identifier is a third value, the operator in the task corresponding to the second target identifier is allowed to be processed at the target time, and when the second target identifier is a fourth value, the operator in the task corresponding to the second target identifier is not processed at the target time.
[0082] That is to say, in response to the control instruction, after setting the task in the task manager to determine whether to process the operator in the task at the target time, further processing judgment can be made based on the value of the second target identifier of the task. When the second target identifier is the third value, it indicates that the operator in the task corresponding to the second target identifier is allowed to be processed at the target time; when the second target identifier is the fourth value, it indicates that the operator in the task corresponding to the second target identifier is not processed at the target time. Optionally, the third value is 1 and the fourth value is 0.
[0083] It should be noted that the above-mentioned determination of the corresponding processing method by the value of the target identifier (including the first target identifier or the second target identifier) is pre-configured in the target tracking algorithm, and can also be set to other values to determine the operator processing scheme in the task. The present invention does not impose too many restrictions on this.
[0084] Optionally, the above-mentioned device further includes: a sharing module, which is used to form a cluster with the task manager and other P task managers, so that the hardware manager and the hardware managers corresponding to the other P task managers share resources.
[0085] For example, Figure 4 As shown in the figure, the three task managers of the device are connected to form a cluster (the number of devices is only schematic), and the task managers of each device share the current device operation status. When a device is idle, some computing tasks on other devices can be balanced to this device to achieve effective resource utilization. At the same time, if the computing power of the cluster needs to be increased, only computing node devices need to be dynamically added, which is easy to expand.
[0086] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0087] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0088] S1, obtain M operators to be run in the target tracking algorithm, where M is an integer greater than 1;
[0089] S2, setting some or all of the M operators in L tasks in an idle state in the task manager, where L is an integer greater than 1;
[0090] S3, calling the L tasks in the idle state to run part or all of the operators in parallel through the L chip cores of the hardware manager.
[0091] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0092] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0093] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0094] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0095] S1, obtain M operators to be run in the target tracking algorithm, where M is an integer greater than 1;
[0096] S2, setting some or all of the M operators in L tasks in an idle state in the task manager, where L is an integer greater than 1;
[0097] S3, calling the L tasks in the idle state to run part or all of the operators in parallel through the L chip cores of the hardware manager.
[0098] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0099] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0100] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for operating an operator, characterized in that: include: Get M operators to be run in the target tracking algorithm, where M is an integer greater than 1; Setting some or all of the M operators in L tasks in an idle state in the task manager, where L is an integer greater than 1; Calling the L tasks in the idle state to run part or all of the operators in parallel through the L chip cores of the hardware manager; The step of setting some or all of the M operators in L tasks in an idle state in the task manager includes: Polling a first target identifier corresponding to the task in the task manager, wherein when the first target identifier is a first value, the task corresponding to the first target identifier is in an idle state, and when the first target identifier is a second value, the task corresponding to the first target identifier is in a busy state; Determine L tasks with a first target identifier being a first value; Setting some or all of the M operators in L tasks in an idle state in a task manager; Wherein, the M operators of the target tracking algorithm are obtained, including: Obtaining M1 target detection operators to be run in a target tracking algorithm, wherein the target detection operators are used to detect targets from video data; Obtaining M2 target tracking operators to be run in the target tracking algorithm, wherein the target tracking operators are used to track the detected targets to obtain tracking results; Acquire an alarm operator to be run in a target tracking algorithm, wherein the alarm operator is used to determine whether the tracking result satisfies an alarm rule, wherein the M operators include: the M1 target detection operators, the M2 target tracking operators and the alarm operator.
2. The method according to claim 1, characterized in that: Get the M operators of the target tracking algorithm, including: Obtain M3 motion detection operators to be run in the target tracking algorithm, wherein the motion detection operator is used to delete targets whose stationary time exceeds a preset threshold from the detected targets, and the M operators include: the M1 target detection operators, the M2 target tracking operators, the M3 motion detection operators and the alarm operator.
3. The method according to claim 1, characterized in that After setting some or all of the M operators in the L tasks in the idle state in the task manager, the method further includes: Receive control instructions; In response to the control instruction, the task in the task manager is set to process the operator in the task at the target time.
4. The method according to claim 3, characterized in that In response to the control instruction, setting whether the task in the task manager processes the operator in the task at the target time includes: In response to the control instruction, the value of the second target identifier of the task is set, wherein, when the second target identifier is a third value, the operator in the task corresponding to the second target identifier is allowed to be processed at the target time, and when the second target identifier is a fourth value, the operator in the task corresponding to the second target identifier is not processed at the target time.
5. The method according to claim 1, characterized in that The method further comprises: The task manager is clustered with other P task managers so that the hardware manager and the hardware managers corresponding to the other P task managers can share resources.
6. An operator operation device, characterized in that: include: An acquisition module is used to acquire M operators to be run in the target tracking algorithm, where M is an integer greater than 1; A setting module, used for setting some or all of the M operators in L tasks in an idle state in the task manager, where L is an integer greater than 1; A calling module, used for calling the L tasks in the idle state, so as to run part or all of the operators in parallel through the L chip cores of the hardware manager; The setting module is further used to poll the first target identifier corresponding to the task in the task manager, wherein when the first target identifier is a first value, the task corresponding to the first target identifier is in an idle state, and when the first target identifier is a second value, the task corresponding to the first target identifier is in a busy state; determine L tasks whose first target identifier is the first value; and set some or all of the M operators in the L tasks in the idle state in the task manager; The acquisition module is further used to acquire M1 target detection operators to be run in the target tracking algorithm, wherein the target detection operator is used to detect the target from the video data; Obtaining M2 target tracking operators to be run in the target tracking algorithm, wherein the target tracking operators are used to track the detected targets to obtain tracking results; Acquire an alarm operator to be run in a target tracking algorithm, wherein the alarm operator is used to determine whether the tracking result satisfies an alarm rule, wherein the M operators include: the M1 target detection operators, the M2 target tracking operators and the alarm operator.
7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 5 when executed.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method for detecting peccant lane changing
CN107563310A
Method and system for task allocation of reconfigurable processing system
CN108363615A
Visual target rapid detection, tracking, parallel computing and fusion method based on multi-kernel DSP
CN108805901A