Data processing method, device, storage medium and electronic device
By using a pre-defined allocation algorithm and a real-time monitoring mechanism, the problem of uneven task scheduling in existing technologies has been solved, achieving efficient and accurate allocation of data processing, and improving task processing efficiency and resource utilization.
Patent Information
- Application Number
- CN202210338063.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-04-01
AI Technical Summary
In existing data processing methods, task scheduling cannot be based on task priority, resulting in low task processing accuracy and efficiency, and serious waste of computing resources.
Data processing task information is obtained through a preset allocation algorithm, tasks are allocated and instructions are sent to the target engine, the engine status is monitored in real time and tasks are updated to ensure engine load balance.
It improves the efficiency and accuracy of data processing, avoids engine overload or idleness, and optimizes the utilization of computing resources.
Smart Images

Figure CN114896033B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communications, and in particular, to a data processing method, device, storage medium and electronic device. Background Art
[0002] With the continuous development in the field of artificial intelligence (AI), the way of processing multimedia data has also made great progress.
[0003] For example, when performing video stream point analysis, the existing data scheduling method is to obtain tasks by pulling them through the algorithm engine. In order to improve scheduling efficiency, this process usually pulls tasks randomly. This scheduling method cannot be scheduled according to algorithms such as task priority, which reduces the task processing accuracy. At the same time, after the task is pulled, the process of assigning the task to the engine is also random, which will cause the algorithm engine to allocate tasks unevenly, thereby reducing task processing efficiency and wasting computing resources. Summary of the invention
[0004] Embodiments of the present invention provide a data processing method, device, storage medium and electronic device to at least solve the problem of low data processing efficiency in related technologies.
[0005] According to an embodiment of the present invention, there is provided a data processing method, comprising:
[0006] Get data processing task information;
[0007] Performing task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result;
[0008] According to the first allocation result, a data processing instruction is sent to the target engine to instruct the target engine to perform a data processing operation according to the data processing task information.
[0009] In an exemplary embodiment, after sending the data processing instruction to the target engine according to the first allocation result, the method further includes:
[0010] Determine the task processing status according to the received data processing result, wherein the data processing result is fed back by the target engine after executing the data processing operation;
[0011] When determining that the task processing state is the first state, sending the first data processing instruction to a first engine to instruct the first engine to perform a data processing operation, wherein the first engine is an engine other than the target engine;
[0012] When it is determined that the task processing state is the second state, information update processing is performed on the data processing task information.
[0013] In an exemplary embodiment, before performing task allocation processing on the data processing task information by using a preset first allocation algorithm, the method further includes:
[0014] Obtaining registration information of the target engine;
[0015] Sending a heartbeat monitoring instruction to the target based on the registration information to instruct the target engine to send heartbeat information, wherein the heartbeat information includes the real-time working status of the target engine;
[0016] Receive the heartbeat information sent by the target engine.
[0017] In an exemplary embodiment, the method further comprises:
[0018] Obtaining a streaming switch instruction, wherein the streaming switch instruction is used to instruct the target engine to perform a streaming switch operation;
[0019] Based on the push flow switch instruction, storing the push flow switch state;
[0020] When a push stream update request is received, push stream switch information is sent to the target engine according to the push stream switch state to instruct the target engine to perform a push stream switch operation, wherein the push stream update request is sent by the target engine when receiving push stream change information.
[0021] In an exemplary embodiment, performing task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result includes:
[0022] Determining factor weights in the first allocation algorithm based on the data processing task information;
[0023] The task allocation process is performed based on the factor weights and the data processing task information to obtain the first allocation result.
[0024] According to another embodiment of the present invention, there is provided a data processing device, comprising:
[0025] Information collection module, used to obtain data processing task information;
[0026] A task allocation module, used to perform task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result;
[0027] An instruction sending module is used to send a data processing instruction to a target engine according to the first allocation result, so as to instruct the target engine to perform a data processing operation according to the data processing task information.
[0028] In an exemplary embodiment, the apparatus further comprises:
[0029] A task status determination module, used to determine the task processing status according to the received data processing result, wherein the data processing result is fed back after the target engine executes the data processing operation;
[0030] a first instruction sending module, configured to, after sending the data processing instruction to the target engine according to the first allocation result, send the first data processing instruction to a first engine in the case where it is determined that the task processing state is a first state, so as to instruct the first engine to perform a data processing operation, wherein the first engine is an engine other than the target engine;
[0031] The information updating module is used to update the data processing task information when it is determined that the task processing state is the second state.
[0032] In an exemplary embodiment, the apparatus further comprises:
[0033] An information registration module, used for obtaining the registration information of the target engine before performing task allocation processing on the data processing task information by using a preset first allocation algorithm;
[0034] A monitoring instruction sending module, used for sending a heartbeat monitoring instruction to the target based on the registration information to instruct the target engine to send heartbeat information, wherein the heartbeat information includes the real-time working status of the target engine;
[0035] The heartbeat information receiving module is used to receive the heartbeat information sent by the target engine.
[0036] According to yet another embodiment of the present invention, a computer-readable 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 run.
[0037] 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.
[0038] Through the present invention, since the engine status is determined before sending the data processing instruction to the target engine, it is possible to avoid the situation where the target engine cannot process related tasks, or the target engine is fully loaded and causes low processing efficiency, so that the data processing task can be processed by the engine. Therefore, the problem of low data processing efficiency can be solved, and the effect of improving data processing efficiency can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a hardware structure block diagram of a mobile terminal of a data processing method according to an embodiment of the present invention;
[0040] Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention;
[0041] Figure 3 is a structural block diagram of a data processing device according to an embodiment of the present invention;
[0042] Figure 4 This is a process according to a specific embodiment of the present invention Figure 1 ;
[0043] Figure 5 is a structural diagram of a device according to a specific embodiment of the present invention;
[0044] Figure 6 This is a process according to a specific embodiment of the present invention Figure 2 . DETAILED DESCRIPTION
[0045] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0046] 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.
[0047] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a data processing method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal 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, wherein the mobile terminal 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 1The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0048] 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 a data processing method 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 examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal 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.
[0049] 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 a communication provider of the mobile terminal. 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 (RF) module, which is used to communicate with the Internet wirelessly.
[0050] In this embodiment, a data processing method is provided. Figure 2 is a flow chart according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:
[0051] Step S202, obtaining data processing task information;
[0052] In this embodiment, the data processing task information is obtained in order to determine the type of task to be processed, so that the task can be accurately assigned to the corresponding algorithm engine, thereby achieving efficient use of the algorithm engine.
[0053] Among them, the data processing task information includes the task type, task quantity, computing power requirement, task target time, task cycle, task address and other information of the data processing task; the acquisition of data processing task information can be achieved (but not limited to) through the periodic monitoring operation page, can also be achieved through fixed interface reception, and can also be achieved in other ways.
[0054] For example, the user starts a task through the touch screen operation interface, and then the task management service module flow adds the task to the list of pending tasks by calling the interface of the scheduler manager, and then assigns the task to the algorithm engine analyzer through the task call instruction. At the same time, the algorithm engine analyzer obtains the task information through monitoring and then starts the analysis and processing of the task.
[0055] Step S204, performing task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result;
[0056] In this embodiment, task allocation processing of data processing task information is to arrange the corresponding algorithm engine to process related data processing tasks, thereby improving the utilization efficiency of the algorithm engine, and at the same time enabling the data processing tasks to be processed by the appropriate engine, thereby improving data processing efficiency.
[0057] Among them, the first allocation algorithm can be (but not limited to) an algorithm model that calculates weights based on video stream attributes and engine attributes, or an algorithm model that calculates weights based on encoding formats, or an algorithm model that calculates weights based on bandwidth, memory consumption, etc.; the first allocation result includes (but not limited to) information such as the number of allocated engines, engine number codes, and engine addresses.
[0058] For example, for the calculation of task weights and engine analysis quotas, the video stream attributes and algorithm models can be taken into account and converted into a relatively consistent measurement method; among them, the video stream attributes include resolution, encoding method and bit rate. The resolution is generally 720P, 1080P, 2K and 4K, etc.; the encoding methods are divided into H264 and H265, and the bit rates are generally 2Mbps, 4Mbps, 8Mbps and 16Mbps, etc. These attributes will affect the GPU decoding, video memory and network bandwidth consumption used in algorithm analysis.
[0059] Taking network bandwidth as an example, a 100M network card can analyze 25 streams with a bit rate of 4Mbps. Considering this dimension alone, the engine analysis quota cannot exceed 25 channels, and the same applies to other consumption.
[0060] It should be noted that algorithm models generally include detection, analysis, and tracking, which will affect the consumption of GPU, CPU, and memory.
[0061] Step S206: Send a data processing instruction to the target engine according to the first allocation result to instruct the target engine to perform a data processing operation according to the data processing task information.
[0062] In this embodiment, the data processing instructions are sent to the target engine in order to accurately control the algorithm engine to process the data processing tasks, ensure the data processing efficiency, and avoid the situation where the algorithm engine is overloaded or idle, so that the algorithm engine can accurately process the corresponding tasks.
[0063] Among them, the data processing instructions can be (but not limited to) data streams, data packets, or electrical signals; the data processing instructions can be transmitted via Ethernet, 3G / 4G / 5G / quantum communication, or other methods; the number of target engines can be one or more; the correspondence between target engines and data processing instructions can be (but not limited to) multiple target engines corresponding to one data processing instruction, or one data processing instruction corresponding to one target engine.
[0064] Through the above steps, since the data processing task information is first allocated and calculated before assigning tasks to the target engine, and then the target engine is assigned according to the calculation results, it is possible to avoid the situation where the engine cannot accurately process the task or the engine processing efficiency is low, thereby solving the problem of low data processing efficiency and improving data processing efficiency and accuracy.
[0065] The execution subject of the above steps may be a base station, a terminal, etc., but is not limited thereto.
[0066] In an optional embodiment, after sending the data processing instruction to the target engine according to the first allocation result, the method further includes:
[0067] Step S208, determining the task processing status according to the received data processing result, wherein the data processing result is fed back after the target engine performs the data processing operation;
[0068] Step S2010, when it is determined that the task processing state is the first state, sending a first data processing instruction to a first engine to instruct the first engine to perform a data processing operation, wherein the first engine is an engine other than the target engine;
[0069] Step S2012: When it is determined that the task processing state is the second state, update the data processing task information.
[0070] In this embodiment, the first engine is instructed to perform data processing operations in order to ensure that the data processing operations can still be performed when the target engine cannot perform the data processing operations; and the data processing task information is updated in order to avoid energy waste caused by performing data processing when there are faults or errors in the data, thereby ensuring the normal progress of data processing.
[0071] Among them, the first state may be (but not limited to) a state in which the target engine cannot work normally, such as a target engine failure or a target engine cannot perform data processing operations; the second state may be (but not limited to) a state in which there are errors in the data to be processed or the assigned data processing tasks are unrecognizable; the number of first engines may be multiple or one; information update processing includes but is not limited to updating the data to be processed, stopping the processing of the data, etc.
[0072] For example, when the engine is analyzing a task, if it encounters an analysis error and needs to retry, or the analysis ultimately fails, it can call the task status update interface of the scheduler server to report the status, and the scheduler server will update the task status accordingly; or the algorithm engine analyzer monitors the task and learns that the task has been deleted, and will stop analyzing the task; or the target engine monitors that the task status changes from starting to waiting, and deletes the task information. After the engine monitors this, it will stop analyzing the task.
[0073] In an optional embodiment, before performing task allocation processing on the data processing task information by using a preset first allocation algorithm, the method further includes:
[0074] Step S20402, obtaining registration information of the target engine;
[0075] Step S20404, sending a heartbeat monitoring instruction to the target based on the registration information to instruct the target engine to send heartbeat information, wherein the heartbeat information includes the real-time working status of the target engine;
[0076] Step S20406, receiving the heartbeat information sent by the target engine.
[0077] In this embodiment, the heartbeat information is obtained to monitor the working status of the target engine in real time, so as to achieve accurate control of the target engine and ensure normal data processing.
[0078] The registration information includes (but is not limited to) the target engine's data processing type, data processing quantity, working status, workload, maximum load, target engine's address information, interface information, number of interfaces, and other information; the heartbeat information also includes the target engine's real-time switch status, load, and other information.
[0079] For example, when the algorithm engine analyzer is started, it registers the engine information and maintains the heartbeat by calling the scheduler's interface.
[0080] In an optional embodiment, the method further comprises:
[0081] Step S2014, obtaining a streaming switch instruction, wherein the streaming switch instruction is used to instruct the target engine to perform a streaming switch operation;
[0082] Step S2016, based on the streaming switch instruction, storing the streaming switch state;
[0083] Step S2018, when receiving a push stream update request, send push stream switch information to the target engine according to the push stream switch state to instruct the target engine to perform the push stream switch operation, wherein the push stream update request is sent by the target engine when receiving push stream change information.
[0084] In this embodiment, the state of the streaming switch is stored, and when a streaming update request is received, the streaming switch information is sent to the target engine in order to buffer the target engine and preload the task, thereby avoiding system failure caused by drastic operations performed by the target engine in a short period of time, thereby ensuring normal information processing.
[0085] The streaming change information may be (but not limited to) obtained by the target engine through real-time monitoring of the information flow, or may be obtained by user input through a page, or may be obtained through other means; the streaming switch instruction may be (but not limited to) in the form of an electrical signal, a data stream, or a data packet.
[0086] It should be noted that executing the streaming switch operation is to enable the target engine to turn streaming on or off, thereby avoiding restarting the task to pull the stream again.
[0087] In an optional embodiment, performing task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result includes:
[0088] Step S2042, determining the factor weights in the first allocation algorithm based on the data processing task information;
[0089] Step S2044: perform task allocation processing based on the factor weights and the data processing task information to obtain a first allocation result.
[0090] In this embodiment, the factor weights are determined in order to judge the allocation of data processing tasks from multiple perspectives, thereby more accurately processing related data and improving data processing efficiency.
[0091] Among them, the factor weights include (but are not limited to) data resolution, encoding method, bit rate, GPU decoding, video memory and network bandwidth consumption, CPU and memory consumption, engine rated workload, engine real-time workload, etc.
[0092] For example, taking traffic incidents as an example, different algorithm models consume different resources:
[0093] Motor vehicle running red lights includes: traffic light classification + vehicle detection + attributes + tracking + license plate
[0094] Motor vehicle reverse driving includes: vehicle detection + attributes + tracking + license plate
[0095] Traffic congestion includes: Vehicle detection
[0096] In this scenario, the resource consumption of the corresponding algorithm model is: motor vehicle running a red light > motor vehicle driving in the wrong direction > traffic congestion. At this time, the three scenarios are assigned to different algorithm engines for calculation to process the data in the three scenarios respectively.
[0097] In an optional embodiment, the method further comprises:
[0098] Step S2020, obtaining a task stop instruction;
[0099] Step S2022, according to the task stop instruction, performing a deletion operation on the target data processing task information;
[0100] Step S2024: upon receiving the task deletion request, sending a task deletion instruction to the target engine to instruct the target engine to stop executing the data processing operation.
[0101] In this embodiment, the operation stop is indicated by deleting the task, which can avoid erroneous processing caused by erroneous recognition of the target engine.
[0102] 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, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0103] In the present embodiment, a data processing device 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 conceived.
[0104] Figure 3is a structural block diagram of a data processing device according to an embodiment of the present invention. Figure 3 As shown, the device comprises:
[0105] An information collection module 32 is used to obtain data processing task information;
[0106] The task allocation module 34 is used to perform task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result;
[0107] The instruction sending module 36 is used to send a data processing instruction to the target engine according to the first allocation result, so as to instruct the target engine to perform a data processing operation according to the data processing task information.
[0108] In an optional embodiment, the device further comprises:
[0109] A task status determination module 38, configured to determine a task processing status according to a received data processing result, wherein the data processing result is fed back after the target engine executes the data processing operation;
[0110] A first instruction sending module 310 is used for sending the first data processing instruction to the first engine after sending the data processing instruction to the target engine according to the first allocation result, and in the case where it is determined that the task processing state is the first state, to instruct the first engine to perform the data processing operation, wherein the first engine is an engine other than the target engine;
[0111] The information updating module 312 is used to update the data processing task information when it is determined that the task processing state is the second state.
[0112] In an optional embodiment, the device further comprises:
[0113] The information registration module 314 is used to obtain the registration information of the target engine before performing task allocation processing on the data processing task information by using the preset first allocation algorithm;
[0114] A monitoring instruction sending module 316, configured to send a heartbeat monitoring instruction to the target based on the registration information to instruct the target engine to send heartbeat information, wherein the heartbeat information includes the real-time working status of the target engine;
[0115] The heartbeat information receiving module 318 is used to receive the heartbeat information sent by the target engine.
[0116] In an optional embodiment, the device further comprises:
[0117] The streaming instruction acquisition module 320 is used to obtain a streaming switch instruction, wherein the streaming switch instruction is used to instruct the target engine to perform a streaming switch operation;
[0118] An instruction storage module 322, used for storing the push flow switch state based on the push flow switch instruction;
[0119] The information sending module 324 is used to send streaming switch information to the target engine according to the streaming switch state when receiving a streaming update request, so as to instruct the target engine to perform a streaming switch operation, wherein the streaming update request is sent by the target engine when receiving streaming change information.
[0120] In an optional embodiment, the task allocation module 34 includes:
[0121] A weight determination unit 342, configured to determine the weights of factors in the first allocation algorithm based on the data processing task information;
[0122] The allocating unit 344 is used to perform the task allocation process based on the factor weights and the data processing task information to obtain the first allocation result.
[0123] In an optional embodiment, the device further comprises:
[0124] A stop instruction acquisition module 326 is used to obtain a task stop instruction;
[0125] A deletion operation module 328, configured to perform a deletion operation on the target data processing task information according to the task stop instruction;
[0126] The stop execution operation 330 is used to send a task deletion instruction to the target engine when a task deletion request is received, so as to instruct the target engine to stop executing the data processing operation.
[0127] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0128] The present invention is described below in conjunction with specific embodiments.
[0129] like Figure 4-Figure 6 As shown, the present invention includes the following process:
[0130] Step S41 (corresponding to the aforementioned steps S20402-20406), when the algorithm engine analyzer is started, it registers the engine information and keeps the heartbeat by calling the scheduler's interface. The scheduler monitors the changes of the engine. If it monitors that an engine is added, it adds the engine information to the list of engines that can be scheduled; if it monitors that the engine is offline, it deletes the task being analyzed by the engine and adds the task to the list of pending tasks, which can be rescheduled by other engines.
[0131] In step S42 (corresponding to the aforementioned steps S202-206), the user starts the task through the interface, and the task management service flow adds the task to the list of pending tasks by calling the scheduler's interface; through task scheduling, the task is assigned to the analyzer; the analyzer obtains the task information through monitoring and starts the analysis of the task.
[0132] Step S43: When the engine is analyzing the task, if it encounters an analysis error and needs to retry, or the analysis ultimately fails, it can call the scheduler's task status update interface to report the status, and the scheduler manager will update the task status accordingly.
[0133] Alternatively, the user turns on or off streaming through the interface, and the task management service flow updates the streaming status by calling the scheduler's interface; then the algorithm engine analyzer monitors the flow status, obtains streaming status changes, and turns streaming on or off (corresponding to the aforementioned steps S2014-2018).
[0134] In step S44, the user stops the task through the interface, and the task management service flow deletes the task information by calling the scheduler's interface; the analyzer monitors the task and learns that the task has been deleted, and will stop analyzing the task (corresponding to the aforementioned steps S2020-2024).
[0135] Among them, for the scheduled (periodic running) task data, the task status is changed through global polling. When the task status changes from waiting to starting, the task is added to the pending list and can be assigned to the corresponding engine through scheduling; when the task status changes from starting to waiting, the task information is deleted, and the engine will stop analyzing the task after listening.
[0136] Specifically, Figure 5 As shown in the figure, the scheduler scheduling service mainly includes the following modules:
[0137] TaskService task management server, used to interact with the task management service flow;
[0138] VmrService is a task scheduling server, used to interact with the algorithm engine analyzer;
[0139] Manager memory management, which implements different data management through interfaces, such as etcd-based, memory buffer, etc.
[0140] Core module, including various scheduling algorithms and task status processing.
[0141] The specific functions of each module are introduced as follows:
[0142] TaskService task management server includes:
[0143] The task management service flow implements corresponding operations by calling the grpc client TaskClient, such as:
[0144] StartTask, called when the flow starts a task, adds task information to the list of pending tasks;
[0145] StopTask, called when flow stops a task and deletes the task information;
[0146] UpdateStreamStatus: Update the streaming status.
[0147] The VmrService task scheduling server includes:
[0148] The algorithm engine analyzer implements corresponding operations by calling the grpc client VmrClient, such as:
[0149] AnalyzerLease, engine registration (granting lease) + heartbeat (continuous lease);
[0150] PutTaskStatus, updates the task status;
[0151] WatchTask, monitors tasks, including task information and streaming status.
[0152] Manager memory management includes:
[0153] Internal data management, through interface encapsulation, docking with different storage, such as etcd and memory buffer. Task scheduling storage on the server can use etcd, which is a distributed key-value pair storage designed to reliably and quickly save key data and provide access. It is used for shared configuration, service discovery, and scheduling coordination of distributed systems or computer clusters. In embedded scenarios such as smart boxes, since the number of tasks is small, memory can be simply used.
[0154] The main contents of memory management services are as follows:
[0155] AddTask, add a new task and add the task information to the storage;
[0156] DeleteTask, delete the task and delete the task information from the storage;
[0157] GetTasks, get the task list, get all the tasks in the storage;
[0158] PutTaskStream, updates the stream status and adds the stream status update message to the storage;
[0159] WatchTask, monitors tasks, including adding, deleting and updating task status;
[0160] GetAnalyzer, obtains a list of all online algorithm engines for task scheduling selection;
[0161] WatchAnalyzer, monitoring engine, including the addition and deletion of engines.
[0162] Core modules include:
[0163] The core capabilities of the dispatch service include:
[0164] Implement a variety of task scheduling algorithms, such as random method, first-come-first-go method, maximum weight method, minimum weight method, etc., and select the task scheduling algorithm suitable for different scenarios through configuration;
[0165] Implement multiple engine load balancing algorithms, such as random method, polling method, weighted random method, and maximum amount remaining method, and select the engine load balancing algorithm suitable for different scenarios through configuration;
[0166] Global polling tasks, depending on whether the task status changes during the runtime, add task information to the list to be assigned, or delete task information accordingly.
[0167] When calculating task weights and engine analysis quotas, video stream attributes and algorithm models can be taken into account and converted into a relatively consistent measurement method.
[0168] Video stream attributes include resolution, encoding method and bit rate. The resolution is generally 720P, 1080P, 2K and 4K.
[0169] The encoding methods are divided into H264 and H265, and the bit rates are generally 2Mbps, 4Mbps, 8Mbps, and 16Mbps, etc. These properties will affect the GPU decoding, video memory, and network bandwidth consumption used in the algorithm analysis.
[0170] Taking network bandwidth as an example, a 100M network card can analyze 25 streams with a bit rate of 4Mbps. Considering this dimension alone, the engine analysis quota cannot exceed 25, and the same applies to other consumption.
[0171] Algorithm models generally include detection, analysis, and tracking, which will affect the consumption of GPU, CPU, and memory. Taking traffic events as an example, different algorithm models consume different resources:
[0172] Motor vehicle running red lights includes: traffic light classification + vehicle detection + attributes + tracking + license plate
[0173] Motor vehicle reverse driving includes: vehicle detection + attributes + tracking + license plate
[0174] Traffic congestion includes: Vehicle detection
[0175] Resource consumption: Motor vehicles running red lights > Motor vehicles driving against traffic > Traffic congestion
[0176] Streaming consumes GPU encoding, CPU, memory, and network bandwidth. It is generally not recommended to enable multiple streams at the same time.
[0177] An embodiment of the present invention further provides a computer-readable 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.
[0178] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as 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.
[0179] 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.
[0180] In an exemplary embodiment, 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.
[0181] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0182] 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, 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.
[0183] 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 data processing method, characterized in that: include: Get data processing task information; Performing task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result; According to the first allocation result, sending a data processing instruction to the target engine to instruct the target engine to perform a data processing operation according to the data processing task information; The method further comprises: Acquire a streaming switch instruction, wherein the streaming switch instruction is used to instruct the target engine to perform a streaming switch operation, and the streaming switch instruction includes an electrical signal, a data stream, or a data packet; Based on the push flow switch instruction, storing the push flow switch state; When a streaming update request is received, streaming switch information is sent to the target engine according to the streaming switch state to instruct the target engine to perform a streaming switch operation, wherein the streaming update request is sent by the target engine when receiving streaming change information, and the streaming change information is obtained by the target engine through real-time monitoring of the information flow.
2. The method according to claim 1, characterized in that After sending the data processing instruction to the target engine according to the first allocation result, the method further includes: Determine the task processing status according to the received data processing result, wherein the data processing result is fed back by the target engine after executing the data processing operation; When determining that the task processing state is a first state, sending a first data processing instruction to a first engine to instruct the first engine to perform a data processing operation, wherein the first engine is an engine other than the target engine; When it is determined that the task processing state is the second state, information update processing is performed on the data processing task information.
3. The method according to claim 1, characterized in that Before performing task allocation processing on the data processing task information by using a preset first allocation algorithm, the method further includes: Obtaining registration information of the target engine; Sending a heartbeat monitoring instruction to the target engine based on the registration information to instruct the target engine to send heartbeat information, wherein the heartbeat information includes the real-time working status of the target engine; Receive the heartbeat information sent by the target engine.
4. The method according to claim 1, characterized in that: The step of performing task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result includes: Determining factor weights in the first allocation algorithm based on the data processing task information; The task allocation process is performed based on the factor weights and the data processing task information to obtain the first allocation result.
5. A data processing device, characterized in that: include: Information collection module, used to obtain data processing task information; A task allocation module, used to perform task allocation processing on the data processing task information by using a preset first allocation algorithm to obtain a first allocation result; An instruction sending module, used for sending a data processing instruction to a target engine according to the first allocation result, so as to instruct the target engine to perform a data processing operation according to the data processing task information; Wherein, the device further comprises: A streaming instruction acquisition module, used for acquiring a streaming switch instruction, wherein the streaming switch instruction is used for instructing the target engine to perform a streaming switch operation, and the streaming switch instruction includes an electrical signal, a data stream or a data packet; An instruction storage module, used for storing the push flow switch state based on the push flow switch instruction; The information sending module is used to send streaming switch information to the target engine according to the streaming switch state when receiving a streaming update request, so as to instruct the target engine to perform a streaming switch operation, wherein the streaming update request is sent by the target engine when receiving streaming change information, and the streaming change information is obtained by the target engine through real-time monitoring of the information flow.
6. The device according to claim 5, characterized in that The device also includes: A task status determination module, used to determine the task processing status according to the received data processing result, wherein the data processing result is fed back after the target engine executes the data processing operation; a first instruction sending module, configured to send a first data processing instruction to a first engine after sending the data processing instruction to the target engine according to the first allocation result, in the case where it is determined that the task processing state is the first state, to instruct the first engine to perform a data processing operation, wherein the first engine is an engine other than the target engine; The information updating module is used to update the data processing task information when it is determined that the task processing state is the second state.
7. The device according to claim 5, characterized in that The device also includes: The information registration module is used to register the data processing task information according to the preset first allocation algorithm. Before task allocation processing, obtaining registration information of the target engine; A monitoring instruction sending module, used for sending a heartbeat monitoring instruction to the target engine based on the registration information to instruct the target engine to send heartbeat information, wherein the heartbeat information includes the real-time working status of the target engine; The heartbeat information receiving module is used to receive the heartbeat information sent by the target engine.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 4 when executed.
9. 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 4.
Citation Information
Patent Citations
Video scheduling method, data processing method and corresponding devices and systems thereof
CN102905197A
Method and device for recovering interrupt tasks
CN103092712A
Job scheduling management system and method
CN103324539A
Server scheduling method and device, and server
CN112162865A
Task processing method, apparatus, and system
WO2019204572A1
