+

CN115457369A - Real-time video analysis task execution delay modeling and deployment method based on cloud-edge collaboration - Google Patents

Real-time video analysis task execution delay modeling and deployment method based on cloud-edge collaboration Download PDF

Info

Publication number
CN115457369A
CN115457369A CN202211025069.0A CN202211025069A CN115457369A CN 115457369 A CN115457369 A CN 115457369A CN 202211025069 A CN202211025069 A CN 202211025069A CN 115457369 A CN115457369 A CN 115457369A
Authority
CN
China
Prior art keywords
cloud
task
time
edge
video analysis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211025069.0A
Other languages
Chinese (zh)
Inventor
徐磊
周昊程
杨定坤
赵南
董平
刘春艳
孙澄宇
封晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Electric Power Information Technology Co Ltd
Original Assignee
Jiangsu Electric Power Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Electric Power Information Technology Co Ltd filed Critical Jiangsu Electric Power Information Technology Co Ltd
Priority to CN202211025069.0A priority Critical patent/CN115457369A/en
Publication of CN115457369A publication Critical patent/CN115457369A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/96Management of image or video recognition tasks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • G06F9/5088Techniques for rebalancing the load in a distributed system involving task migration
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5094Allocation of resources, e.g. of the central processing unit [CPU] where the allocation takes into account power or heat criteria
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/94Hardware or software architectures specially adapted for image or video understanding
    • G06V10/95Hardware or software architectures specially adapted for image or video understanding structured as a network, e.g. client-server architectures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/502Proximity
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a cloud-edge collaborative real-time video analysis task execution delay modeling and deployment method, which comprises the following steps: a video analysis task execution delay model construction method under a cloud edge environment; the time delay model is extra time delay introduced in the process of a video analysis task, and comprises time delay brought by edge end processing, time delay brought by data transmitted between an edge and a cloud end and time delay brought by cloud end processing; according to a video analysis task execution time delay model in a cloud edge environment, selecting a more energy-saving task deployment scheme for the video analysis task through an approximation algorithm based on a Lyapunov algorithm and a Markov approximation algorithm, wherein the task deployment scheme comprises edge end machine specification selection, cloud end machine instance specification and a task division scheme. According to the invention, when the task load of the video analysis task and the cloud side network environment change, the task deployment scheme can be rapidly adjusted, so that the energy consumption of the system in long-term operation is effectively reduced.

Description

云边协同的实时视频分析任务执行时延建模及部署方法Real-time video analysis task execution delay modeling and deployment method based on cloud-edge collaboration

技术领域technical field

本发明涉及边缘计算领域,涉及一种云边协同的系统节能部署方法,具体是一种云边协同的实时视频分析任务执行时延建模及部署方法。The invention relates to the field of edge computing, and relates to a cloud-edge collaborative system energy-saving deployment method, in particular to a cloud-edge collaborative real-time video analysis task execution delay modeling and deployment method.

背景技术Background technique

随着移动互联网的发展,大量的较强交互性的应用开始出现,如日前大火的AR类应用以及各种人脸、车牌识别等应用,对于此类较强交互性的应用,用户往往具有较高的响应时延的需求。终端到数据中心的传输时延由于中间需要经过基站、骨干网等多层网络转发,网络时延往往较高,大量传输的高质量视频也会对广域网带来了较大带宽压力。为了降低访问时延,这些应用引入了边缘计算。因此边缘计算正逐渐成为移动互联网时代中新的网络基础架构。边缘计算通过将服务部署在离用户更近的位置,如城市骨干网,基站,或者边缘设备来减少任务响应时延,同时减少原始数据传输对于广域网带宽造成的巨大压力。除此之外,将服务从数据中心卸载到用户边缘能够避免原始数据发往云端,从而提高用户数据的隐私性。With the development of the mobile Internet, a large number of highly interactive applications have begun to appear, such as the recently popular AR applications and various face and license plate recognition applications. For such highly interactive applications, users often have more High response latency requirements. The transmission delay from the terminal to the data center needs to be forwarded through multi-layer networks such as base stations and backbone networks. The network delay is often high, and a large number of high-quality videos transmitted will also bring great bandwidth pressure to the WAN. In order to reduce access latency, these applications introduce edge computing. Therefore, edge computing is gradually becoming a new network infrastructure in the mobile Internet era. Edge computing can reduce task response delay by deploying services closer to users, such as urban backbone networks, base stations, or edge devices, and reduce the huge pressure on WAN bandwidth caused by raw data transmission. In addition, offloading services from the data center to the user's edge can avoid sending raw data to the cloud, thereby improving the privacy of user data.

实时视频直播、实时视频监控等是随着CDN、边缘计算等技术发展而兴起的新型视频类应用,被广泛应用于自动驾驶、灾害监测等智能化系统中。这类应用要求低时延长时间的实时视频流传输。Real-time video broadcasting and real-time video monitoring are new types of video applications emerging with the development of technologies such as CDN and edge computing, and are widely used in intelligent systems such as autonomous driving and disaster monitoring. Such applications require real-time video streaming for extended periods of time.

当实时视频流分析任务在视频处理流水线较长、视频分析用的神经网络模型本身较大,或者是边缘端的计算能力太差时,单独在边缘端部署实时视频流分析任务难以满足算力要求,而完全放在云端带来的流量开销以及传输时延又难以接受,云边协同部署实时视频流分析任务就成为了更合理的部署方案。When the real-time video stream analysis task has a long video processing pipeline, the neural network model used for video analysis itself is large, or the computing power of the edge is too poor, it is difficult to deploy the real-time video stream analysis task on the edge alone to meet the computing power requirements. However, the traffic overhead and transmission delay caused by completely placing in the cloud are unacceptable, and the cloud-side collaborative deployment of real-time video stream analysis tasks has become a more reasonable deployment solution.

选取一个较优部署方案在实际生产环境中十分重要,较差的解决方案不仅会带来较高的电量开销或者花费,也会使得任务处理的时间较长。Choosing an optimal deployment solution is very important in the actual production environment. A poor solution will not only bring higher power consumption or cost, but also make the task processing time longer.

当前主流的云服务提供商,如Amazon Web Service,Azure,阿里云等公司在提供云服务时,云端可选配置数量较多甚至达到数千可用配置,边端可用配置同样存在多种,且对于大型神经网络或较长的处理流水线而言,其能够划分的云边之间的策略数量同样存在数十甚至上百种,因此云边部署方法总数较多。为了获取某一特定部署方法在执行特定任务时会带来的额外时延,需要实际运行对应的部署方法,因此对于每个部署方法的服务质量进行测量会花费巨大代价。测量所有部署方法的方式无法满足任务快速部署执行的要求。因此,在数量众多且实际性能会发生变化的可选部署方法中选择对于当前任务状况最优的部署方法是较难的。When current mainstream cloud service providers, such as Amazon Web Service, Azure, Alibaba Cloud and other companies provide cloud services, the number of cloud optional configurations is large or even reaches thousands of available configurations. For large-scale neural networks or long processing pipelines, there are also dozens or even hundreds of strategies that can be divided between cloud and edge, so the total number of cloud-edge deployment methods is large. In order to obtain the additional delay caused by a specific deployment method when performing a specific task, it is necessary to actually run the corresponding deployment method, so it will cost a lot of money to measure the service quality of each deployment method. The method of measuring all deployment methods cannot meet the requirements of rapid deployment execution of tasks. Therefore, it is difficult to choose the optimal deployment method for the current task situation among the large number of optional deployment methods whose actual performance will change.

发明内容Contents of the invention

为了解决现有技术的不足,本发明的目的是提供一种云边协同的实时视频分析任务执行时延建模及部署方法。In order to solve the deficiencies of the prior art, the object of the present invention is to provide a cloud-side collaborative real-time video analysis task execution delay modeling and deployment method.

本发明的目的通过以下技术方案实现:The object of the present invention is achieved through the following technical solutions:

一种云边协同的实时视频分析任务执行时延建模及节能部署方法,其包括如下步骤:A cloud-edge collaborative real-time video analysis task execution delay modeling and energy-saving deployment method, which includes the following steps:

A.云边环境下的视频分析任务执行时延模型构建方法;所述时延模型即视频分析任务过程中引入的额外时延,包括在边缘端处理带来的时延,边缘与云端传输中间数据带来的时延以及云端处理带来的时延;A. The construction method of the video analysis task execution delay model in the cloud-edge environment; the delay model is the additional delay introduced in the process of the video analysis task, including the delay caused by the processing at the edge, and the transmission between the edge and the cloud The delay caused by data and the delay caused by cloud processing;

B.根据云边环境下的视频分析任务执行时延模型,构建云边环境最优任务部署方案问题;并通过基于李雅普诺夫算法以及马尔科夫近似算法的近似算法为视频分析任务选择更加节能的任务部署方案,所述任务部署方案包括边缘端机器规格选择,云端机器实例规格以及任务划分方案。B. According to the video analysis task execution delay model in the cloud-edge environment, construct the optimal task deployment plan for the cloud-edge environment; and use the approximate algorithm based on Lyapunov algorithm and Markov approximation algorithm to select more energy-saving video analysis tasks The task deployment scheme includes the selection of edge machine specifications, cloud machine instance specifications, and task division scheme.

进一步,所述步骤A中的视频分析任务执行时延模型构建方法包括分析任务所需计算量估计以及机器规格计算能力估计,通过计算能力以及计算量对任务处理时延进行估计;所述步骤B中的任务部署方案通过求解云边环境最优任务部署方案问题,即一个长期优化问题得到,该长期优化问题以最小化系统长期能耗为目标,约束条件为系统在每个时刻内的处理时延低于任务要求。Further, the video analysis task execution delay model construction method in the step A includes the estimation of the calculation amount required for the analysis task and the calculation capacity estimation of the machine specification, and estimates the task processing delay through the calculation capacity and the calculation amount; the step B The task deployment scheme in is obtained by solving the optimal task deployment scheme problem in the cloud-edge environment, that is, a long-term optimization problem. The long-term optimization problem aims to minimize the long-term energy consumption of the system, and the constraint condition is the processing time Delay falls short of task requirements.

所述步骤A中,在进行分析任务计算量估计时,将分析任务所需计算量按照分析任务进度(如深度神经网络放置在该机器上的总量,或放置在该机器上的神经网络算子的总量)进行建模;在进行机器规格计算能力估计时,将机器规格计算能力建模成为CPU型号及数量、GPU型号及数量、内存大小以及硬盘大小的函数;在进行实时视频分析任务执行时延建模时,首先选定基准机器规格,测定基准机器规格在执行完整的实时视频分析任务作为基准时间,之后使用基准机器规格对于任务的每个可能分割点进行执行,测量每个分割点前的执行时间作为分割点基准时间,之后不同机器规格的不同任务分割方式的执行时间可以由分割点基准时间以及不同机器规格与基准规格的计算能力系数决定。In the step A, when estimating the calculation amount of the analysis task, the calculation amount required for the analysis task is calculated according to the progress of the analysis task (such as the total amount of the deep neural network placed on the machine, or the neural network calculation amount placed on the machine). The total number of sub-units) for modeling; when estimating the computing power of machine specifications, the computing power of machine specifications is modeled as a function of CPU model and quantity, GPU model and quantity, memory size, and hard disk size; when performing real-time video analysis tasks When performing delay modeling, first select the benchmark machine specification, measure the benchmark machine specification and execute the complete real-time video analysis task as the benchmark time, then use the benchmark machine specification to execute each possible split point of the task, and measure each split The execution time before the point is used as the reference time of the split point, and the execution time of different task split methods of different machine specifications can be determined by the reference time of the split point and the computing power coefficients of different machine specifications and benchmark specifications.

所述步骤B中,在构建云边环境最优任务部署方案时,令边缘端与云端的可用机器规格集合分别为C1,C2,使用c1t,c2t分别代表在t时刻边缘端和云端选择的机器规格,Ut,ut分别表示当前实时视频分析任务的总计算量和部署在边缘端的计算量。e1,e2,e3分别代表在边缘端,在云端处理数据以及发送数据消耗的资源,该值会受到机器规格以及任务处理时间的综合影响。w1,w2,w3分别代表在边缘端,在云端处理数据以及发送数据消耗的时间,该值会受到机器规格以及任务所需计算量的影响。Bt代表当前时刻的可用带宽,L代表任务执行能接受的最大时延,f代表系统使用的中间数据压缩算法的压缩率(例如如果按照视频格式传输,可以使用视频流编码算法的码率与帧的大小的比值作为压缩率)。表1列出了本文中提到的各符号及其含义。In the step B, when constructing the optimal task deployment scheme for the cloud-edge environment, let the available machine specification sets of the edge end and the cloud be C 1 and C 2 respectively, and use c 1t and c 2t to represent the edge end and the cloud at time t respectively. The machine specifications selected by the cloud, U t , u t respectively represent the total calculation amount of the current real-time video analysis task and the calculation amount deployed at the edge. e 1 , e 2 , and e 3 respectively represent the resources consumed by processing data and sending data at the edge, in the cloud, and the values will be affected by machine specifications and task processing time. w 1 , w 2 , and w 3 respectively represent the time consumed to process data and send data at the edge, on the cloud, and the values will be affected by machine specifications and the amount of computation required for the task. B t represents the available bandwidth at the current moment, L represents the maximum time delay that the task can accept, and f represents the compression rate of the intermediate data compression algorithm used by the system (for example, if it is transmitted in a video format, the code rate of the video stream coding algorithm can be used with The ratio of the size of the frame as the compression rate). Table 1 lists the symbols and their meanings mentioned in this article.

表1本文中提到的各符号及其含义Table 1 Symbols and their meanings mentioned in this article

Figure BDA0003815380170000031
Figure BDA0003815380170000031

Figure BDA0003815380170000041
Figure BDA0003815380170000041

所述步骤B中,在构建云边环境最优任务部署方案时,构建的云边环境最优任务部署方案的目标为:In the step B, when constructing the optimal task deployment scheme for the cloud-edge environment, the goal of constructing the optimal task deployment scheme for the cloud-edge environment is:

Figure BDA0003815380170000042
Figure BDA0003815380170000042

优化目标为最小化长期能源消耗,其中e1(c1t,w1(c1t,ut))代表边缘端处理过程在单一时隙中消耗的能源(实际使用中每个时隙可以以分钟或小时为单位),参数代表处理数据消耗的资源e1与机器规格c1t以及机器处理时间w1有关(这是由于机器规格影响机器的功率,处理时间以及机器功率决定处理消耗的资源),e2(c2t,w2(c2t,Ut-ut))代表云端处理过程在单一时隙中消耗的资源,参数代表e2与机器规格c2t以及机器处理时间w2有关;进一步的由于Ut代表总计算量,ut代表边缘端计算量,因此Ut-ut代表云端计算量;w1以及w2的参数同理,机器规格影响计算能力,计算量以及计算能力共同决定处理时间;

Figure BDA0003815380170000043
代表传输中间数据带来的时延,由于dt与Bt分别代表数据量以及带宽,f代表压缩率,因此
Figure BDA0003815380170000044
即可以用来表示发送数据需要的时间;The optimization goal is to minimize long-term energy consumption, where e 1 (c 1t , w 1 (c 1t , u t )) represents the energy consumed by the edge processing in a single time slot (in actual use, each time slot can be measured in minutes or hours), the parameter represents the resource e 1 consumed by processing data is related to the machine specification c 1t and the machine processing time w 1 (this is because the machine specification affects the power of the machine, and the processing time and machine power determine the resources consumed by processing), e 2 (c 2t , w 2 (c 2t , U t -u t )) represents the resources consumed by the cloud processing process in a single time slot, and the parameter represents that e 2 is related to the machine specification c 2t and the machine processing time w 2 ; further Since U t represents the total calculation amount, and u t represents the edge calculation amount, U t -u t represents the cloud computing amount; the parameters of w 1 and w 2 are the same, and the machine specifications affect the computing power, and the computing power and computing power are common determine processing time;
Figure BDA0003815380170000043
Represents the delay caused by the transmission of intermediate data, since d t and B t represent the amount of data and bandwidth respectively, and f represents the compression rate, so
Figure BDA0003815380170000044
That is, it can be used to indicate the time required to send data;

约束条件为:The constraints are:

Figure BDA0003815380170000045
Figure BDA0003815380170000045

Figure BDA0003815380170000046
Figure BDA0003815380170000046

其中

Figure BDA0003815380170000051
代表传输中间数据需要花费的时间。in
Figure BDA0003815380170000051
Represents the time it takes to transfer intermediate data.

所述步骤B中,在求解云边环境最优任务部署方案问题时,首先使用李雅普诺夫算法将云边环境最优任务部署方案问题解耦成为每个时隙中的子问题,之后使用马尔科夫近似算法在解空间中寻找最优解。In the step B, when solving the problem of the optimal task deployment plan for the cloud-side environment, first use the Lyapunov algorithm to decouple the problem of the optimal task deployment plan for the cloud-side environment into subproblems in each time slot, and then use the Mark The Kove approximation algorithm finds the optimal solution in the solution space.

首先使用一个虚拟动态队列qt描述分析任务处理的时延的变化,当当前时刻的实际时延超过了阈值时,队列长度缩短,反之队列长度增加,且队列长度始终不小于0。虚拟动态队列的定义如下:First, a virtual dynamic queue q t is used to describe the change of the delay of analysis task processing. When the actual delay at the current moment exceeds the threshold, the queue length is shortened, otherwise the queue length is increased, and the queue length is always not less than 0. A virtual dynamic queue is defined as follows:

Figure BDA0003815380170000052
Figure BDA0003815380170000052

解耦后的云边环境最优任务部署方案子问题为,其中V是调节参数,用于调节算法对于约束的违反容忍程度:The decoupled sub-problem of the optimal task deployment scheme in the cloud-edge environment is, where V is an adjustment parameter, which is used to adjust the algorithm's tolerance for constraint violations:

Figure BDA0003815380170000053
Figure BDA0003815380170000053

Figure BDA0003815380170000054
Figure BDA0003815380170000054

Figure BDA0003815380170000055
Figure BDA0003815380170000055

Figure BDA0003815380170000056
Figure BDA0003815380170000056

c1t,c2t,ut∈Z+ c 1t , c 2t , u t ∈ Z +

使用马尔科夫近似的方法对最优任务部署方案子问题进行求解;Use the Markov approximation method to solve the optimal task deployment scheme sub-problem;

1)首先将c1t,c2t,ut都进行随机赋值,对此时分析任务带来的目标函数进行估计,将此时延记为

Figure BDA0003815380170000058
1) First, randomly assign c 1t , c 2t , and u t to estimate the objective function brought by the analysis task at this time, and record this delay as
Figure BDA0003815380170000058

2)之后随机更改c1t,c2t,ut的值,再次计算分析任务带来的目标函数,将此时延记为o,计算概率

Figure BDA0003815380170000057
其中e为自然对数,以该概率接受此新选取的方案;2) Afterwards, randomly change the values of c 1t , c 2t , and u t , calculate the objective function brought by the analysis task again, record this delay as o, and calculate the probability
Figure BDA0003815380170000057
Where e is the natural logarithm, accept this newly selected solution with this probability;

3)重复步骤2)直到程序设定的最大次数,或在执行过程中连续10次均随机方案均未对方案进行更新;3) Repeat step 2) until the maximum number of times set by the program, or the program is not updated for 10 consecutive random programs during the execution process;

4)将最终方案部署执行,并在执行过程中获取实际的边缘端执行时间,云端执行时间以及数据发送时间,分别记为

Figure BDA0003815380170000061
4) Deploy and execute the final solution, and obtain the actual edge execution time, cloud execution time, and data sending time during the execution process, which are recorded as
Figure BDA0003815380170000061

5)计算下一个子问题中的虚拟队列长度

Figure BDA0003815380170000062
5) Calculate the virtual queue length in the next subproblem
Figure BDA0003815380170000062

本发明的有益效果如下:The beneficial effects of the present invention are as follows:

基于李雅普诺夫优化设计在线算法为云边协同环境下的实时视频流分析选择最优的云边规格组合以及深度神经网络切割方案。系统首先利用爬山算法,在线性时间开销的情况下构建服务质量模型。利用马尔科夫近似在十万级配置空间寻找任务最优配置,保证服务质量且最小化资源开销。接着通过李雅普诺夫优化将长期优化问题解耦成为各个时刻的子问题。在每个时刻通过马尔可夫近似的方法求解较优解。在网络时延以及任务负载发生变化时,快速准确的调整任务部署方法,是系统的能源消耗最小。An online algorithm based on Lyapunov optimization design selects the optimal cloud-side specification combination and deep neural network cutting scheme for real-time video stream analysis in a cloud-side collaborative environment. The system first uses the hill-climbing algorithm to build a service quality model in the case of linear time overhead. Use Markov approximation to find the optimal configuration of tasks in the 100,000-level configuration space to ensure the quality of service and minimize resource overhead. Then, the long-term optimization problem is decoupled into sub-problems at each time through Lyapunov optimization. At each moment, a better solution is obtained through the Markov approximation method. When the network delay and task load change, quickly and accurately adjust the task deployment method to minimize the energy consumption of the system.

本发明中的分析任务时延模型构建方法能够在测量次数不超过云端配置,边端配置以及任务分割方法种类数线性累加的情况下构建分析任务时延模型,具有较好的灵敏度。The analysis task delay model construction method in the present invention can construct the analysis task delay model under the condition that the number of measurements does not exceed the cloud configuration, edge configuration, and task segmentation methods and the number of types is linearly accumulated, and has good sensitivity.

通过时间复杂度分析和仿真对比分析可见,本发明可以在网络时延以及任务负载发生变化时对系统的能源消耗进行有效的降低。Through time complexity analysis and simulation comparison analysis, it can be seen that the present invention can effectively reduce the energy consumption of the system when the network time delay and the task load change.

附图说明Description of drawings

图1是本实施例提供的云边协同的实时视频分析任务执行时延建模及部署方法的示意框图;FIG. 1 is a schematic block diagram of a cloud-edge collaborative real-time video analysis task execution delay modeling and deployment method provided in this embodiment;

图2是本实施例提供的云边协同的实时视频分析任务执行时延建模及部署方法中实时视频分析任务执行时延建模过程的不失一般性的举例说明。FIG. 2 is an illustration without loss of generality of the real-time video analysis task execution delay modeling process in the cloud-edge collaboration real-time video analysis task execution delay modeling and deployment method provided in this embodiment.

具体实施方式detailed description

下面结合实施例对本发明做进一步的详细说明,本实施列对本发明不构成限定。The present invention will be further described in detail below in conjunction with the examples, which are not intended to limit the present invention.

为了在分析任务的负载以及网络环境发生变化时尽量减少系统的资源消耗,本发明提供了一种云边协同的实时视频分析任务执行时延建模及节能部署方法。首先构建云边环境下的视频分析任务执行时延模型;所述时延模型即视频分析任务过程中引入的额外时延,包括在边缘端处理带来的时延,边缘与云端传输中间数据带来的时延以及云端处理带来的时延;之后根据云边环境下的视频分析任务执行时延模型,构建云边环境最优任务部署方案问题;并通过基于李雅普诺夫算法以及马尔科夫近似算法的近似算法为视频分析任务选择更加节能的任务部署方案,所述任务部署方案包括边缘端机器规格选择,云端机器实例规格以及任务划分方案。从而在满足分析任务执行时延的情况下有效降低系统长期执行所需的资源。本实施例中如图1所示具体包括如下若干步骤:In order to reduce the resource consumption of the system as much as possible when the load of the analysis task and the network environment change, the present invention provides a cloud-edge collaborative real-time video analysis task execution delay modeling and energy-saving deployment method. Firstly, a video analysis task execution delay model in the cloud-edge environment is constructed; the delay model refers to the additional delay introduced during the video analysis task process, including the delay caused by edge processing, and the intermediate data transmission between the edge and the cloud. The delay caused by the cloud processing and the delay caused by the cloud processing; then according to the video analysis task execution delay model in the cloud-edge environment, the optimal task deployment plan for the cloud-edge environment is constructed; and based on the Lyapunov algorithm and the Markov The approximate algorithm of the approximate algorithm selects a more energy-saving task deployment scheme for the video analysis task, and the task deployment scheme includes the selection of the edge machine specification, the cloud machine instance specification, and the task division scheme. In this way, the resources required for long-term execution of the system can be effectively reduced while satisfying the analysis task execution delay. As shown in Figure 1, the present embodiment specifically includes the following steps:

1)构建云边环境下的视频分析任务执行时延模型;1) Build a video analysis task execution delay model in the cloud-edge environment;

所述时延模型即视频分析任务过程中引入的额外时延,包括在边缘端处理带来的时延,边缘与云端传输中间数据带来的时延以及云端处理带来的时延;The delay model is the additional delay introduced in the video analysis task process, including the delay caused by edge processing, the delay caused by the transmission of intermediate data between the edge and the cloud, and the delay caused by cloud processing;

2)构建云边环境最优任务部署方案问题;2) Constructing the optimal task deployment scheme for the cloud-edge environment;

首先对问题进行描述,然后定义目标函数和各个约束条件。First describe the problem, and then define the objective function and various constraints.

3)对云边环境最优任务部署方案问题进行求解;3) Solve the problem of optimal task deployment scheme in cloud-edge environment;

通过基于李雅普诺夫算法以及马尔科夫近似算法的近似算法为视频分析任务选择更加节能的任务部署方案,所述任务部署方案包括边缘端机器规格选择,云端机器实例规格以及任务划分方案。A more energy-efficient task deployment scheme is selected for the video analysis task through an approximation algorithm based on the Lyapunov algorithm and the Markov approximation algorithm. The task deployment scheme includes edge machine specification selection, cloud machine instance specification, and task division scheme.

本实施例中构建云边环境下的视频分析任务执行时延模型包括如下步骤:In this embodiment, constructing a video analysis task execution delay model in a cloud-edge environment includes the following steps:

4)测定不同的视频分析任务处理分割点前需要的计算量;4) Determining the amount of calculation required before processing the segmentation point for different video analysis tasks;

将视频分析帧率以及视频分析输入图片大小固定为最高帧率以及最大输入图片大小,使用基准机器规格对不同的任务处理分割点前的总处理时间进行测量。Fix the video analysis frame rate and video analysis input picture size to the highest frame rate and maximum input picture size, and use the benchmark machine specifications to measure the total processing time before the split point for different tasks.

5)测定不同的视频分析帧率需要的计算量;5) Determining the amount of calculation required for different video analysis frame rates;

将任务处理分割点以及视频分析输入图片大小固定为第一个任务处理分割点以及最大输入图片大小,使用基准机器规格对不同的视频分析帧率的总处理时间进行测量。The task processing split point and the video analysis input image size are fixed to the first task processing split point and the maximum input image size, and the total processing time of different video analysis frame rates is measured using the benchmark machine specification.

6)测定不同的视频分析输入图片大小需要的计算量;6) Determining the calculation amount required for different video analysis input image sizes;

将任务处理分割点以及视频分析帧率固定为第一个任务处理分割点以及最大视频分析帧率,使用基准机器规格对不同的视频分析输入图片大小的总处理时间进行测量。Fix the task processing split point and video analysis frame rate as the first task processing split point and maximum video analysis frame rate, and use the benchmark machine specifications to measure the total processing time of different video analysis input image sizes.

7)根据步骤4)-6)的测量结果构建基准机器的不同任务分割及输入方案计算量系数表;7) According to the measurement results of steps 4)-6), the different tasks of the benchmark machine are divided and the calculation amount coefficient table of the input scheme is constructed;

对于任意任务分割点,视频分析帧率以及视频分析输入图片大小,计算量系数为:For any task split point, video analysis frame rate and video analysis input image size, the calculation coefficient is:

Figure BDA0003815380170000081
Figure BDA0003815380170000081

基准机器在任意任务分割点,视频分析帧率以及视频分析输入图片大小的情况下分析任务的处理时延可以估计为:The processing delay of the analysis task of the benchmark machine at any task split point, video analysis frame rate, and video analysis input image size can be estimated as:

Figure BDA0003815380170000082
Figure BDA0003815380170000082

其中

Figure BDA0003815380170000083
为步骤4)测定的不同分割点的处理时间;
Figure BDA0003815380170000084
为步骤5)测定的不同视频分析帧率的处理时间;其中
Figure BDA0003815380170000085
为步骤6)测定的不同视频分析输入图片大小的处理时间;
Figure BDA0003815380170000086
分别为最高帧率,输入图片大小,完整处理流程的时间以及最高帧率,最高输入图片大小,第一个分割点的时间。in
Figure BDA0003815380170000083
For step 4) the processing time of the different segmentation points measured;
Figure BDA0003815380170000084
Be the processing time of the different video analysis frame rates of step 5) measurement; Wherein
Figure BDA0003815380170000085
Analyze the processing time of the input picture size for the different videos measured in step 6);
Figure BDA0003815380170000086
They are the highest frame rate, the input image size, the time of the complete processing process and the highest frame rate, the highest input image size, and the time of the first split point.

8)对云端以及边缘端的不同机器规格的计算能力进行建模;8) Model the computing power of different machine specifications in the cloud and at the edge;

在进行机器规格计算能力估计时,将机器规格计算能力建模成为CPU型号及数量、GPU型号及数量、内存大小以及硬盘大小的函数;在进行实时视频分析任务执行时延建模时,首先选定基准机器规格,测定基准机器规格在执行完整的实时视频分析任务作为基准时间,之后使用基准机器规格对于任务的每个可能分割点进行执行,测量每个分割点前的执行时间作为分割点基准时间,之后不同机器规格的不同任务分割方式的执行时间可以由分割点基准时间以及不同机器规格与基准规格的计算能力系数决定。When estimating the computing power of the machine specification, the computing power of the machine specification is modeled as a function of the CPU model and quantity, GPU model and quantity, memory size, and hard disk size; when performing real-time video analysis task execution delay modeling, first select Determine the benchmark machine specification, measure the benchmark machine specification to execute the complete real-time video analysis task as the benchmark time, then use the benchmark machine specification to execute each possible split point of the task, and measure the execution time before each split point as the split point benchmark After that, the execution time of different task division methods of different machine specifications can be determined by the division point reference time and the computing power coefficients of different machine specifications and reference specifications.

本实施例中,构建云边环境中最有任务部署方案问题,包括如下步骤:In this embodiment, the problem of constructing the most task deployment solution in the cloud-edge environment includes the following steps:

9)对问题进行描述;9) Describe the problem;

所述步骤B中,在构建云边环境最优任务部署方案问题时,令边缘端与云端的可用机器规格集合分别为C1,C2,使用c1t,c2t分别代表在t时刻边缘端和云端选择的机器规格,Ut,ut分别表示当前实时视频分析任务的总计算量和部署在边缘端的计算量。e1,e2,e3分别代表在边缘端,在云端处理数据以及发送数据消耗的资源,该值会受到机器规格以及任务处理时间的综合影响。w1,w2,w3分别代表在边缘端,在云端处理数据以及发送数据消耗的时间,该值会受到机器规格以及任务所需计算量的影响。Bt代表当前时刻的可用带宽,L代表任务执行能接受的最大时延,f代表系统使用的中间数据压缩算法的压缩率(例如如果按照视频格式传输,可以使用视频流编码算法的码率与帧的大小的比值作为压缩率)。In the above step B, when constructing the optimal task deployment solution for the cloud-edge environment, let the available machine specification sets of the edge end and the cloud be C 1 and C 2 respectively, and use c 1t and c 2t to represent the edge end at time t respectively. and the machine specification selected by the cloud, U t , u t respectively represent the total calculation amount of the current real-time video analysis task and the calculation amount deployed at the edge. e 1 , e 2 , and e 3 respectively represent the resources consumed by processing data and sending data at the edge, in the cloud, and the values will be affected by machine specifications and task processing time. w 1 , w 2 , and w 3 respectively represent the time consumed to process data and send data at the edge, on the cloud, and the values will be affected by machine specifications and the amount of computation required for the task. B t represents the available bandwidth at the current moment, L represents the maximum time delay that the task can accept, and f represents the compression rate of the intermediate data compression algorithm used by the system (for example, if it is transmitted in a video format, the code rate of the video stream coding algorithm can be used with The ratio of the size of the frame as the compression rate).

10)定义目标函数;10) Define the objective function;

构建的云边环境最优任务部署方案问题的目标为:The goal of the optimal task deployment scheme for the constructed cloud-edge environment is:

Figure BDA0003815380170000091
Figure BDA0003815380170000091

其中e1(c1t,w1(c1t,ut))代表边缘端处理过程在单一时隙中消耗的能源(实际使用中每个时隙可以以分钟或小时为单位),参数代表处理数据消耗的资源e1与机器规格c1t以及机器处理时间w1有关(这是由于机器规格影响机器的功率,处理时间以及机器功率决定处理消耗的资源),e2(c2t,w2(c2t,Ut-ut))代表云端处理过程在单一时隙中消耗的资源,参数代表e2与机器规格c2t以及机器处理时间w2有关;w1以及w2的参数同理,机器规格影响计算能力,计算量以及计算能力共同决定处理时间;进一步的由于Ut代表总计算量,ut代表边缘端计算量,因此Ut-ut代表云端计算量;

Figure BDA0003815380170000092
代表传输中间数据带来的时延,由于dt与Bt分别代表数据量以及带宽,f代表压缩率,因此
Figure BDA0003815380170000093
即可以用来表示发送数据需要的时间;where e 1 (c 1t , w 1 (c 1t , u t )) represents the energy consumed by the edge-end processing in a single time slot (in actual use, each time slot can be in minutes or hours), and the parameter represents the processing The resource e1 consumed by the data is related to the machine specification c 1t and the machine processing time w 1 (this is because the machine specification affects the power of the machine, and the processing time and machine power determine the resources consumed by processing), e 2 (c 2t , w 2 (c 2t , U t -u t )) represents the resources consumed by the cloud processing process in a single time slot, and the parameter e 2 is related to the machine specification c 2t and the machine processing time w 2 ; the parameters of w 1 and w 2 are the same, and the machine The specification affects the computing power, and the computing power and computing power together determine the processing time; further, since U t represents the total computing power, and u t represents the edge computing power, U t -u t represents the cloud computing power;
Figure BDA0003815380170000092
Represents the delay caused by the transmission of intermediate data, since d t and B t represent the amount of data and bandwidth respectively, and f represents the compression rate, so
Figure BDA0003815380170000093
That is, it can be used to indicate the time required to send data;

11)定义各个约束条件;11) Define each constraint condition;

约束条件为:The constraints are:

Figure BDA0003815380170000094
Figure BDA0003815380170000094

Figure BDA0003815380170000095
Figure BDA0003815380170000095

其中

Figure BDA0003815380170000096
代表传输中间数据需要花费的时间。in
Figure BDA0003815380170000096
Represents the time it takes to transfer intermediate data.

本实施例中,求解云边环境最优任务部署方案问题时,包含以下步骤:In this embodiment, when solving the problem of the optimal task deployment scheme in the cloud-edge environment, the following steps are included:

12)使用李雅普诺夫算法将云边环境最优任务部署方案问题解耦成为每个时隙中的子问题;12) Use Lyapunov algorithm to decouple the problem of optimal task deployment scheme in cloud-edge environment into sub-problems in each time slot;

使用一个虚拟动态队列qt描述分析任务处理的时延的变化,当当前时刻的实际时延超过了阈值L时,队列长度缩短,反之队列长度增加,且队列长度始终不小于0。虚拟动态队列的定义如下:A virtual dynamic queue q t is used to describe the change of the delay of analysis task processing. When the actual delay at the current moment exceeds the threshold L, the queue length is shortened, otherwise the queue length is increased, and the queue length is always not less than 0. A virtual dynamic queue is defined as follows:

Figure BDA0003815380170000101
Figure BDA0003815380170000101

解耦后的云边环境最优任务部署方案子问题为,其中V是调节参数,用于调节算法对于约束的违反容忍程度:The decoupled sub-problem of the optimal task deployment scheme in the cloud-edge environment is, where V is an adjustment parameter, which is used to adjust the algorithm's tolerance for constraint violations:

Figure BDA0003815380170000102
Figure BDA0003815380170000102

Figure BDA0003815380170000103
Figure BDA0003815380170000103

Figure BDA0003815380170000104
Figure BDA0003815380170000104

Figure BDA0003815380170000105
Figure BDA0003815380170000105

c1t,c2t,ut∈Z+ c 1t , c 2t , u t ∈ Z +

使用马尔科夫近似算法在解空间中寻找最优解;Use the Markov approximation algorithm to find the optimal solution in the solution space;

1)首先将c1t,c2t,ut都进行随机赋值,对此时分析任务带来的目标函数进行估计,将此时延记为

Figure BDA0003815380170000106
1) First, randomly assign c 1t , c 2t , and u t to estimate the objective function brought by the analysis task at this time, and record this delay as
Figure BDA0003815380170000106

2)之后随机更改c1t,c2t,ut的值,再次计算分析任务带来的目标函数,将此时延记为o,计算概率

Figure BDA0003815380170000107
其中e为自然对数,以该概率接受此新选取的方案;2) Afterwards, randomly change the values of c 1t , c 2t , and u t , calculate the objective function brought by the analysis task again, record this delay as o, and calculate the probability
Figure BDA0003815380170000107
Where e is the natural logarithm, accept this newly selected solution with this probability;

3)重复步骤2)直到程序设定的最大次数,或在执行过程中连续10次均随机方案均未对方案进行更新;3) Repeat step 2) until the maximum number of times set by the program, or the program is not updated for 10 consecutive random programs during the execution process;

4)将最终方案部署执行,并在执行过程中获取实际的边缘端执行时间,云端执行时间以及数据发送时间,分别记为

Figure BDA0003815380170000108
4) Deploy and execute the final solution, and obtain the actual edge execution time, cloud execution time, and data sending time during the execution process, which are recorded as
Figure BDA0003815380170000108

5)计算下一个子问题中的虚拟队列长度

Figure BDA0003815380170000111
5) Calculate the virtual queue length in the next subproblem
Figure BDA0003815380170000111

图1描述了一个典型的运用云边协同视频分析任务部署方法进行系统优化的过程。Figure 1 describes a typical system optimization process using the cloud-edge collaborative video analysis task deployment method.

下面结合图2对本实施例涉及的云边协同视频分析任务时延模型构建方法进行不失一般性的举例说明:The following is an example without loss of generality of the construction method of the cloud-side collaborative video analysis task delay model involved in this embodiment in combination with FIG. 2 :

根据本实施例中提供的任务部署方法,假设在某时刻有一视频分析任务需要进行云边协同部署,该任务具有5个可分割的分割点,任务在执行时可以有多种运行模式,这些运行模式的帧率和输入图片大小是不同的。帧率可变化集合为{1,2,3,5,10}(指每秒处理1帧,2帧等),执行时图片输入大小的可变化集合为{416*416,512*512,608*608}(416,512,606是目标识别神经网络yolov3的三种标准输入图片尺寸)。According to the task deployment method provided in this embodiment, it is assumed that at a certain moment there is a video analysis task that needs to be deployed cloud-side collaboratively. The frame rate of the mode and the input image size are different. The variable set of frame rate is {1,2,3,5,10} (referring to processing 1 frame, 2 frames, etc. per second), and the variable set of image input size during execution is {416*416,512*512,608*608}( 416, 512, 606 are the three standard input image sizes of the target recognition neural network yolov3).

首先构建云边环境下的视频分析任务执行时延模型,具体而言分为一下几个步骤,1.测定不同的视频分析任务处理分割点前需要的计算量;First, build a video analysis task execution delay model in the cloud-edge environment. Specifically, it is divided into the following steps. 1. Measure the amount of calculation required before processing the segmentation point for different video analysis tasks;

将视频分析帧率以及视频分析输入图片大小固定为帧率10以及输入图片大小为608,使用基准机器规格对不同的任务处理分割点(即从1到5)前的总处理时间进行测量。The video analysis frame rate and video analysis input picture size are fixed at a frame rate of 10 and an input picture size of 608, and the total processing time before different task processing split points (ie, from 1 to 5) is measured using the benchmark machine specification.

2.测定不同的视频分析帧率需要的计算量;2. Determine the amount of calculation required for different video analysis frame rates;

将任务处理分割点以及视频分析输入图片大小固定为第1个任务处理分割点以及608,使用基准机器规格对不同的视频分析帧率(即{1,2,3,5,10})的总处理时间进行测量。Fix the task processing split point and video analysis input image size to the first task processing split point and 608, and use the benchmark machine specifications to analyze the total Processing time is measured.

3.测定不同的视频分析输入图片大小需要的计算量;3. Determine the amount of calculation required for different video analysis input image sizes;

将任务处理分割点以及视频分析帧率固定为第1个任务处理分割点以及帧率10,使用基准机器规格对不同的视频分析输入图片大小(即416*416,512*512,608*608)的总处理时间进行测量。Fix the task processing split point and video analysis frame rate as the first task processing split point and frame rate 10, and use the benchmark machine specifications to analyze the total processing time of different video input image sizes (ie 416*416, 512*512, 608*608) Take measurements.

根据步骤1-3的测量结果构建基准机器的不同任务分割及输入方案计算量系数表;According to the measurement results of steps 1-3, construct the different task division of the benchmark machine and the calculation amount coefficient table of the input scheme;

对于任意任务分割点,视频分析帧率以及视频分析输入图片大小,计算量系数为:For any task split point, video analysis frame rate and video analysis input image size, the calculation coefficient is:

Figure BDA0003815380170000112
Figure BDA0003815380170000112

基准机器在任意任务分割点,视频分析帧率以及视频分析输入图片大小的情况下分析任务的处理时延可以估计为:The processing delay of the analysis task of the benchmark machine at any task split point, video analysis frame rate, and video analysis input image size can be estimated as:

Figure BDA0003815380170000121
Figure BDA0003815380170000121

各符号的含义如上文所述。The meaning of each symbol is as described above.

本发明具体应用途径很多,以上所述方法尤其是冗余率调整方式仅是本发明的优选实施方式,应当指出以上实施列对本发明不构成限定,相关工作人员在不偏离本发明技术思想的范围内,所进行的多样变化和修改,均落在本发明的保护范围内。There are many specific application ways of the present invention, and the above-mentioned method, especially the adjustment mode of the redundancy rate, is only a preferred embodiment of the present invention. It should be pointed out that the above-mentioned examples do not limit the present invention, and relevant workers do not deviate from the scope of the technical idea of the present invention Various changes and modifications made within the scope of the present invention all fall within the protection scope of the present invention.

Claims (8)

1.一种云边协同的实时视频分析任务执行时延建模及部署方法,其特征在于,包括如下步骤:1. A cloud-side collaborative real-time video analysis task execution delay modeling and deployment method, is characterized in that, comprises the following steps: A.云边环境下的视频分析任务执行时延模型构建方法;所述时延模型即视频分析任务过程中引入的额外时延,包括在边缘端处理带来的时延,边缘与云端传输中间数据带来的时延以及云端处理带来的时延;A. The construction method of the video analysis task execution delay model in the cloud-edge environment; the delay model is the additional delay introduced in the process of the video analysis task, including the delay caused by the processing at the edge, and the transmission between the edge and the cloud The delay caused by data and the delay caused by cloud processing; B.根据云边环境下的视频分析任务执行时延模型,构建云边环境最优任务部署方案问题;并通过基于李雅普诺夫算法以及马尔科夫近似算法为视频分析任务选择更加节能的任务部署方案,所述任务部署方案包括边缘端机器规格选择,云端机器实例规格以及任务划分方案。B. According to the video analysis task execution delay model in the cloud-edge environment, construct the optimal task deployment plan for the cloud-edge environment; and select a more energy-efficient task deployment for video analysis tasks based on the Lyapunov algorithm and the Markov approximation algorithm The task deployment scheme includes the selection of edge machine specifications, cloud machine instance specifications, and task division schemes. 2.根据权利要求1所述的实时视频分析任务执行时延建模及部署方法,其特征在于:所述步骤A中,视频分析任务执行时延模型构建方法包括分析任务所需计算量估计以及机器规格计算能力估计,通过计算能力以及计算量对任务处理时延进行估计;所述步骤B中,任务部署方案通过求解云边环境最优任务部署方案问题,即一个长期优化问题得到,该长期优化问题以最小化系统长期能耗为目标,约束条件为系统在每个时刻内的处理时延低于任务要求。2. The real-time video analysis task execution delay modeling and deployment method according to claim 1, characterized in that: in the step A, the video analysis task execution delay model construction method includes the calculation amount estimation required for the analysis task and Estimate the computing power of the machine specification, and estimate the task processing delay through the computing power and the amount of calculation; in the step B, the task deployment plan is obtained by solving the problem of the optimal task deployment plan in the cloud-edge environment, that is, a long-term optimization problem, the long-term The goal of the optimization problem is to minimize the long-term energy consumption of the system, and the constraint condition is that the processing delay of the system at each moment is lower than the task requirement. 3.根据权利要求1所述的实时视频分析任务执行时延建模及部署方法,其特征在于:所述步骤A中,在进行分析任务计算量估计时,将分析任务所需计算量按照分析任务进度进行建模;在进行机器规格计算能力估计时,将机器规格计算能力建模成为CPU型号及数量、GPU型号及数量、内存大小以及硬盘大小的函数;在进行实时视频分析任务执行时延建模时,首先选定基准机器规格,测定基准机器规格在执行完整的实时视频分析任务作为基准时间,之后使用基准机器规格对于任务的每个可能分割点进行执行,测量每个分割点前的执行时间作为分割点基准时间,之后不同机器规格的不同任务分割方式的执行时间可以由分割点基准时间以及不同机器规格与基准规格的计算能力系数决定。3. The real-time video analysis task execution delay modeling and deployment method according to claim 1, characterized in that: in the step A, when the analysis task calculation amount is estimated, the calculation amount required for the analysis task is calculated according to the analysis Model the task progress; when estimating the computing power of the machine specification, model the computing power of the machine specification as a function of the CPU model and quantity, GPU model and quantity, memory size, and hard disk size; when performing real-time video analysis task execution delay When modeling, first select the benchmark machine specification, measure the benchmark machine specification and execute the complete real-time video analysis task as the benchmark time, then use the benchmark machine specification to execute each possible split point of the task, and measure the time before each split point The execution time is used as the reference time of the segmentation point, and the execution time of different task segmentation methods of different machine specifications can be determined by the reference time of the segmentation point and the computing power coefficients of different machine specifications and reference specifications. 4.根据权利要求1所述的实时视频分析任务执行时延建模及部署方法,其特征在于:所述步骤B中,在构建云边环境最优任务部署方案问题时,令边缘端与云端的可用机器规格集合分别为C1,C2,使用c1t,c2t分别代表在t时刻边缘端和云端选择的机器规格,Ut,ut分别表示当前实时视频分析任务的总计算量和部署在边缘端的计算量;e1,e2,e3分别代表在边缘端,在云端处理数据以及发送数据消耗的资源,该值会受到机器规格以及任务处理时间的综合影响;w1,w2,w3分别代表在边缘端,在云端处理数据以及发送数据消耗的时间,该值会受到机器规格以及任务所需计算量的影响;Bt代表当前时刻的可用带宽,L代表任务执行能接受的最大时延,f代表系统使用的中间数据压缩算法的压缩率;dt代表当前时刻需要传输的数据量。4. The real-time video analysis task execution delay modeling and deployment method according to claim 1, characterized in that: in the step B, when constructing the optimal task deployment solution for the cloud-side environment, the edge terminal and the cloud The set of available machine specifications are C 1 , C 2 , respectively, c 1t , c 2t represent the machine specifications selected at the edge and cloud at time t, respectively, U t , u t represent the total calculation amount and The amount of computing deployed at the edge; e 1 , e 2 , and e 3 respectively represent the resources consumed by processing data and sending data on the edge at the cloud, and this value will be affected by the comprehensive impact of machine specifications and task processing time; w 1 , w 2 and w 3 respectively represent the time spent on processing data and sending data at the edge, in the cloud, and this value will be affected by machine specifications and the amount of calculation required by the task; B t represents the available bandwidth at the current moment, and L represents the task execution performance The maximum time delay accepted, f represents the compression rate of the intermediate data compression algorithm used by the system; d t represents the amount of data that needs to be transmitted at the current moment. 5.根据权利要求4所述的实时视频分析任务执行时延建模及部署方法,其特征在于:所述步骤B中,在构建云边环境最优任务部署方案问题时,构建的云边环境最优任务部署方案问题的目标为:5. The real-time video analysis task execution delay modeling and deployment method according to claim 4, characterized in that: in the step B, when constructing the cloud edge environment optimal task deployment plan problem, the constructed cloud edge environment The objective of the optimal task deployment problem is:
Figure FDA0003815380160000021
Figure FDA0003815380160000021
优化目标为最小化长期能源消耗,其中e1(c1t,w1(c1t,ut))代表边缘端处理过程在单一时隙中消耗的能源,参数代表处理数据消耗的资源e1与机器规格c1t以及机器处理时间w1有关,e2(c2t,w2(c2t,Ut-ut))代表云端处理过程在单一时隙中消耗的资源,参数代表e2与机器规格c2t以及机器处理时间w2有关;进一步的由于Ut代表总计算量,ut代表边缘端计算量,因此Ut-ut代表云端计算量;w1以及w2的参数同理,机器规格影响计算能力,计算量以及计算能力共同决定处理时间;
Figure FDA0003815380160000022
代表传输中间数据带来的时延,由于dt与Bt分别代表数据量以及带宽,f代表压缩率,因此
Figure FDA0003815380160000023
即可以用来表示发送数据需要的时间;
The optimization goal is to minimize long-term energy consumption, where e 1 (c 1t , w 1 (c 1t , u t )) represents the energy consumed by the edge processing in a single time slot, and the parameter represents the resources e 1 and The machine specification c 1t is related to the machine processing time w 1 , e 2 (c 2t , w 2 (c 2t , U t -u t )) represents the resources consumed by the cloud processing process in a single time slot, and the parameter represents e 2 and the machine The specification c 2t is related to the machine processing time w 2 ; further, because U t represents the total calculation amount, and u t represents the edge calculation amount, so U t -u t represents the cloud computing amount; the parameters of w 1 and w 2 are the same, Machine specifications affect the computing power, and the amount of computing and computing power together determine the processing time;
Figure FDA0003815380160000022
Represents the delay caused by the transmission of intermediate data, since d t and B t represent the amount of data and bandwidth respectively, and f represents the compression rate, so
Figure FDA0003815380160000023
That is, it can be used to indicate the time required to send data;
约束条件为:The constraints are:
Figure FDA0003815380160000024
Figure FDA0003815380160000024
Figure FDA0003815380160000025
Figure FDA0003815380160000025
其中
Figure FDA0003815380160000026
代表传输中间数据需要花费的时间。
in
Figure FDA0003815380160000026
Represents the time it takes to transfer intermediate data.
6.根据权利要求5所述的实时视频分析任务执行时延建模及部署方法,其特征在于:所述步骤B中,在求解云边环境最优任务部署方案问题时,首先使用李雅普诺夫算法将云边环境最优任务部署方案问题解耦成为每个时隙中的子问题,之后使用马尔科夫近似算法在解空间中寻找最优解。6. The real-time video analysis task execution delay modeling and deployment method according to claim 5, characterized in that: in the step B, when solving the problem of the optimal task deployment plan for the cloud-side environment, first use Lyapunov The algorithm decouples the problem of the optimal task deployment scheme in the cloud-edge environment into sub-problems in each time slot, and then uses the Markov approximation algorithm to find the optimal solution in the solution space. 7.根据权利要求6所述的实时视频分析任务执行时延建模及部署方法,其特征在于:云边环境最优任务部署方案问题的求解算法如下:7. The real-time video analysis task execution delay modeling and deployment method according to claim 6, characterized in that: the solution algorithm for the problem of optimal task deployment scheme in cloud-side environment is as follows: 首先使用一个虚拟动态队列qt描述分析任务处理的时延的变化,当当前时刻的实际时延超过了阈值时,队列长度缩短,反之队列长度增加,且队列长度始终不小于0;虚拟动态队列的定义如下:First, a virtual dynamic queue q t is used to describe the change of the delay of analysis task processing. When the actual delay at the current moment exceeds the threshold, the queue length is shortened, otherwise the queue length increases, and the queue length is always not less than 0; the virtual dynamic queue is defined as follows:
Figure FDA0003815380160000031
Figure FDA0003815380160000031
解耦后的云边环境最优任务部署方案子问题为,其中V是调节参数,用于调节算法对于约束的违反容忍程度:The decoupled sub-problem of the optimal task deployment scheme in the cloud-edge environment is, where V is an adjustment parameter, which is used to adjust the algorithm's tolerance for constraint violations:
Figure FDA0003815380160000032
Figure FDA0003815380160000032
Figure FDA0003815380160000033
Figure FDA0003815380160000033
Figure FDA0003815380160000034
Figure FDA0003815380160000034
Figure FDA0003815380160000035
Figure FDA0003815380160000035
c1t,c2t,ut∈Z+c 1t , c 2t , u t ∈ Z + .
8.根据权利要求6所述的实时视频分析任务执行时延建模及部署方法,其特征在于:使用马尔科夫近似的方法对最优任务部署方案子问题进行求解,具体如下:8. The real-time video analysis task execution delay modeling and deployment method according to claim 6, characterized in that: using the Markov approximation method to solve the optimal task deployment scheme sub-problem, specifically as follows: 1)首先将c1t,c2t,ut都进行随机赋值,对此时分析任务带来的目标函数进行估计,将此时延记为
Figure FDA0003815380160000036
1) First, randomly assign c 1t , c 2t , and u t to estimate the objective function brought by the analysis task at this time, and record this delay as
Figure FDA0003815380160000036
2)之后随机更改c1t,c2t,ut的值,再次计算分析任务带来的目标函数,将此时延记为o,计算概率
Figure FDA0003815380160000041
其中e为自然对数,以该概率接受此新选取的方案;
2) Afterwards, randomly change the values of c 1t , c 2t , and u t , calculate the objective function brought by the analysis task again, record this delay as o, and calculate the probability
Figure FDA0003815380160000041
Where e is the natural logarithm, accept this newly selected solution with this probability;
3)重复步骤2)直到程序设定的最大次数,或在执行过程中连续10次均随机方案均未对方案进行更新;3) Repeat step 2) until the maximum number of times set by the program, or the program is not updated for 10 consecutive random programs during the execution process; 4)将最终方案部署执行,并在执行过程中获取实际的边缘端执行时间,云端执行时间以及数据发送时间,分别记为
Figure FDA0003815380160000042
4) Deploy and execute the final solution, and obtain the actual edge execution time, cloud execution time, and data sending time during the execution process, which are recorded as
Figure FDA0003815380160000042
5)计算下一个子问题中的虚拟队列长度
Figure FDA0003815380160000043
5) Calculate the virtual queue length in the next subproblem
Figure FDA0003815380160000043
CN202211025069.0A 2022-08-25 2022-08-25 Real-time video analysis task execution delay modeling and deployment method based on cloud-edge collaboration Pending CN115457369A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211025069.0A CN115457369A (en) 2022-08-25 2022-08-25 Real-time video analysis task execution delay modeling and deployment method based on cloud-edge collaboration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211025069.0A CN115457369A (en) 2022-08-25 2022-08-25 Real-time video analysis task execution delay modeling and deployment method based on cloud-edge collaboration

Publications (1)

Publication Number Publication Date
CN115457369A true CN115457369A (en) 2022-12-09

Family

ID=84299003

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211025069.0A Pending CN115457369A (en) 2022-08-25 2022-08-25 Real-time video analysis task execution delay modeling and deployment method based on cloud-edge collaboration

Country Status (1)

Country Link
CN (1) CN115457369A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111405569A (en) * 2020-03-19 2020-07-10 三峡大学 Method and device for computing offloading and resource allocation based on deep reinforcement learning
CN112364507A (en) * 2020-11-10 2021-02-12 大连理工大学 Distributed dynamic service deployment method based on mobile edge computing
CN112996056A (en) * 2021-03-02 2021-06-18 国网江苏省电力有限公司信息通信分公司 Method and device for unloading time delay optimized computing task under cloud edge cooperation
CN113301151A (en) * 2021-05-24 2021-08-24 南京大学 Low-delay containerized task deployment method and device based on cloud edge cooperation
CN113905347A (en) * 2021-09-29 2022-01-07 华北电力大学 A cloud-side-end collaboration method for air-ground integrated power Internet of things

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111405569A (en) * 2020-03-19 2020-07-10 三峡大学 Method and device for computing offloading and resource allocation based on deep reinforcement learning
CN112364507A (en) * 2020-11-10 2021-02-12 大连理工大学 Distributed dynamic service deployment method based on mobile edge computing
CN112996056A (en) * 2021-03-02 2021-06-18 国网江苏省电力有限公司信息通信分公司 Method and device for unloading time delay optimized computing task under cloud edge cooperation
CN113301151A (en) * 2021-05-24 2021-08-24 南京大学 Low-delay containerized task deployment method and device based on cloud edge cooperation
CN113905347A (en) * 2021-09-29 2022-01-07 华北电力大学 A cloud-side-end collaboration method for air-ground integrated power Internet of things

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
于升升 等: ""基于最大加权队列的终端到终端通信时延感知跨层设计算法"", 《计算机应用》, vol. 35, no. 05, 10 May 2015 (2015-05-10), pages 1205 - 1208 *

Similar Documents

Publication Publication Date Title
Fu et al. Soft actor–critic DRL for live transcoding and streaming in vehicular fog-computing-enabled IoV
CN103425535B (en) Quick elastic telescopic method under cloud environment
CN114553661B (en) Mobile user equipment clustering training method for wireless federal learning
CN108270805B (en) Resource allocation method and device for data processing
CN114666224A (en) Dynamic allocation method, device, equipment and storage medium for business resource capacity
CN110351571A (en) Live video cloud transcoding resource allocation and dispatching method based on deeply study
CN107483292B (en) Dynamic monitoring method for cloud platform
CN119232741B (en) Distributed network resource optimal scheduling method and system under load balancing strategy
CN113286269B (en) A Resource Management Method for Power Communication Network Based on Edge Computing
CN110083518A (en) A kind of software virtual machine ageing predetermination method based on AdaBoost-Elman
CN117135131A (en) Task resource demand perception method for cloud edge cooperative scene
CN110046048A (en) A kind of load-balancing method adaptively quickly reassigned based on workload
CN108052387A (en) Resource allocation Forecasting Methodology and system in a kind of mobile cloud computing
CN115033340A (en) Host selection method and related device
CN117573339A (en) Dynamic capacity expansion and contraction method, device and storage medium for satellite edge computing services
CN116579441A (en) A cloud-edge-device collaborative federated learning intelligent optimization method and device
CN101986608B (en) Method for evaluating heterogeneous overlay network load balance degree
CN106209990A (en) The appreciable request scheduling method of cost under a kind of distribution strange land cloud data center
CN117056420B (en) Metering data high-availability circulation method and system based on incremental block synchronization
CN115457369A (en) Real-time video analysis task execution delay modeling and deployment method based on cloud-edge collaboration
CN118573733A (en) Big data acquisition and processing method and system based on Internet of things
CN117573347A (en) Resource allocation method and system of cloud computing platform
CN117042051A (en) Task unloading strategy generation method, system, equipment and medium in Internet of vehicles
CN114401195B (en) Method and device for adjusting capacity of server, storage medium and electronic equipment
CN113297152B (en) Method and device for updating cache of edge server of power internet of things

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载