The invention discloses an automatic advertisement screenshot and container automatic expansion method and
system in a
virtual desktop environment. A virtual display capable of exporting a DMA-BUF is created by deploying a Virtual
Display Driver in a kernel of a
host machine, and after Chrome is driven by Puppeteer to complete
hardware acceleration rendering in a container, zero-copy desktop-level screenshot is carried out on a
shared memory frame buffer by utilizing desktop-script-native; and meanwhile, a Kubernetes CRD unified
database task and a declarative API are adopted, a Redis
Stream second-level index and a predictive HPA
algorithm are combined to realize advanced
delta t capacity expansion of Pod, and the P99
queuing delay is ensured to be less than 2s. According to the method, single-node
concurrency is improved by 3.2 times without extra hardware cost, CPU occupation is reduced by 45%, WebGL / Flash advertisement fidelity is 100%, and the method is suitable for cloud advertisement
verification, brand security and programmed creative monitoring scenes.