Simulation method and device for virtual equipment of cloud mobile phone

By initializing the kernel virtual machine, loading customized driver modules and configuring cross-layer communication channels, the problems of insufficient accuracy and high latency in the cloud phone virtual device layer are solved, and higher-precision sensor data generation, smooth video stream processing and accurate network simulation are achieved.

CN120653364APending Publication Date: 2025-09-16启朔(深圳)科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510723241.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

The cloud phone virtual device layer has problems with insufficient accuracy, high latency and missing functions in the dynamic generation of sensor data, video stream processing and network simulation, making it difficult to meet the high-precision and low-latency user needs.

Method used

By obtaining the hardware virtualization layer configuration permissions, initializing the kernel virtual machine, realizing dynamic adjustment of the memory allocation environment, loading customized driver modules, configuring cross-layer communication channels, and utilizing graphics processing virtualization and device hot-swap management, the multi-functional simulation of cloud phone virtual devices is completed.

Benefits of technology

It improves the accuracy of dynamic generation of sensor data, optimizes the video stream processing process, reduces network simulation latency, achieves more realistic network simulation, and solves the problems of insufficient accuracy and high latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653364A_ABST
    Figure CN120653364A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a simulation method and device of cloud mobile phone virtual equipment. According to the method, by obtaining the hardware virtualization layer configuration permission and initializing the kernel virtual machine, the memory allocation environment can be adjusted, and the problems of insufficient sensor data processing precision, video stream jamming and the like caused by unreasonable memory allocation are solved. And the abstract interface of the equipment is obtained through loading adaptation of the customized driving module, so that various virtual equipment can be accurately butted, the accuracy of dynamic generation of sensor data is improved, and the video stream processing flow is optimized. An equipment abstract interface is called to configure a cross-layer communication channel, efficient data transmission is guaranteed, network simulation delay is reduced, and the response speed is increased. On the basis of a cross-layer communication channel, graphic processing virtualization, equipment hot plug management and resource isolation are utilized, function deficiency is made up, more real network simulation is achieved, the video stream rendering effect is optimized, and the performance of a cloud mobile phone virtual equipment layer in the aspects of sensor data, video streams and network simulation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for simulating a cloud phone virtual device. Background Art

[0002] In the current field of cloud phone technology, the simulation of virtual device layer functions has systematic shortcomings, making it difficult to meet users' urgent needs for high-precision, low-latency video interaction.

[0003] Specifically, firstly, the ability to dynamically generate sensor data is lacking. Existing solutions mostly rely on fixed templates or simple data collection, and are unable to dynamically adjust sensor parameters according to complex scenarios. In scenarios such as the Internet of Vehicles that require high-precision spatiotemporal synchronization, the time deviation between multiple devices generally exceeds 200μs, affecting the effectiveness of the sensor fusion algorithm.

[0004] Second, video stream processing technology is seriously lagging behind. Traditional cloud phone camera simulations have static processing defects and insufficient dynamic analysis capabilities for real-time video streams. When the input stream resolution exceeds 4K, the end-to-end delay surges to more than 500ms. In addition, hardware acceleration support is insufficient, and there is excessive reliance on CPU software decoding, resulting in low decoding frame rate of 8K@60fps video streams and low GPU resource utilization. At the same time, there is a lack of intelligent processing capabilities, resulting in a high screen tearing rate in AR / VR scenarios.

[0005] Third, the network simulation accuracy is insufficient. The existing network simulation is limited by the basic bandwidth and cannot accurately simulate the micro-burst traffic characteristics of delay-sensitive services in the 5G slicing network. In the V2X scenario test of the Internet of Vehicles, the packet loss rate simulation error exceeds ±30%, reducing the credibility of the algorithm verification. Summary of the Invention

[0006] In view of this, an embodiment of the present invention provides a simulation method and device for a cloud phone virtual device to solve the problems of insufficient accuracy, high latency and missing functions in the cloud phone virtual device layer in terms of dynamic generation of sensor data, video stream processing and network simulation.

[0007] In a first aspect, an embodiment of the present invention provides a method for simulating a cloud phone virtual device, the method comprising:

[0008] Obtaining configuration permissions for the hardware virtualization layer, and initializing the kernel virtual machine based on the configuration permissions to obtain an adjustable memory allocation environment;

[0009] Loading and adapting a customized driver module according to the memory allocation environment to obtain a device abstract interface;

[0010] Calling the device abstract interface to configure a bidirectional control channel to obtain a cross-layer communication channel;

[0011] Based on the cross-layer communication channel, graphics processing virtualization, device hot plug management and resource isolation are utilized to complete the multi-functional simulation of the cloud phone virtual device.

[0012] Furthermore, the initializing of the kernel virtual machine based on the configuration permissions to obtain an adjustable memory allocation environment includes:

[0013] According to the hardware virtualization layer configuration authority, kernel parameter adjustment is performed, the kernel virtual machine is enabled and memory dynamic allocation parameters supporting the ballooning mechanism are configured to obtain a virtualized kernel environment;

[0014] Based on the virtualized kernel environment, load the kernel modules related to the kernel virtual machine, execute module parameter configuration to activate the ballooning function, and obtain the basic environment that supports dynamic memory adjustment;

[0015] In the basic environment, a virtual machine instance is created and a balloon driver is mounted, and memory pre-allocation policy configuration is executed to obtain an initial memory allocation plan;

[0016] Using the initial memory allocation plan, a monitoring script is deployed to collect virtual machine memory usage data in real time, thus obtaining a dynamic memory monitoring system.

[0017] Configure an adjustable memory allocation environment based on a dynamic memory monitoring system.

[0018] Furthermore, an adjustable memory allocation environment is configured based on the dynamic memory monitoring system, including:

[0019] Perform load forecasting based on historical memory usage data collected by the dynamic memory monitoring system to obtain memory usage trend data;

[0020] Execute pre-allocation strategy calculation based on the memory usage trend data and the memory threshold to obtain the target value of dynamic control in each virtual machine;

[0021] Using the target to write an automated script to configure an automated memory management strategy;

[0022] Execute the automated management strategy, and when the memory usage reaches a preset threshold, execute a balloon driver call to obtain a dynamic memory adjustment result;

[0023] The pre-allocation strategy is optimized according to the memory dynamic adjustment result to obtain an adjustable memory allocation environment.

[0024] Furthermore, the loading and adaptation operations of the customized driver module are performed according to the memory allocation environment to obtain the device abstract interface, including:

[0025] Compiling the customized driver module source code according to the memory allocation environment, and performing kernel module signing and loading on the customized driver module source code to obtain an adapted basic driver component;

[0026] Utilizing the basic driver components, driver parameters are configured to match dynamic memory characteristics, and a linkage test between the driver and the balloon mechanism is performed to obtain a memory-aware driver instance.

[0027] Obtaining the device abstraction layer middleware corresponding to the driver instance, calling the device abstraction layer middleware to convert the driver private interface into a standardized device operation API, and performing API consistency verification to obtain a device abstraction interface framework;

[0028] Based on the device abstract interface framework, an automated adaptation script is deployed to generate driver adapters for different types of virtual devices, and cross-device operation verification is performed to obtain the device abstract interface.

[0029] Furthermore, the calling of the device abstract interface to configure a bidirectional control channel to obtain a cross-layer communication channel includes:

[0030] Use the pre-built protocol framework to map the methods of the device abstract interface to cross-layer communication service instances;

[0031] Based on the communication service instance, configure the adaptive retransmission algorithm and TLS encryption and authentication mechanism to obtain the communication channel;

[0032] Deploy service registration and discovery components based on the communication channel to achieve automatic connection between the device abstract interface and the upper-layer application, perform cross-layer call stress testing, and obtain a stable cross-layer communication channel.

[0033] Furthermore, configuring an adaptive retransmission algorithm and a TLS encryption and authentication mechanism based on the communication service instance to obtain a communication channel includes:

[0034] Configuring adaptive retransmission algorithm parameters according to network characteristics of the communication service instance, and using the adaptive retransmission algorithm parameters to collect historical RTT sample data to obtain a calculation model;

[0035] Integrating a packet loss detection algorithm according to the calculation model to obtain a reliable transmission control module;

[0036] Obtain and generate TLS certificate and key pair, configure certificate chain verification strategy, and obtain basic components for encrypted communication;

[0037] The communication channel is constructed based on the encrypted communication component and the calculation model.

[0038] Furthermore, the method further comprises:

[0039] Use cross-layer communication channels to collect virtual device operation data in real time;

[0040] The operation data is organized into a time series format and input into a pre-trained prediction model to predict resource usage trends and abnormal behaviors;

[0041] According to the resource usage trend and the abnormal behavior, a corresponding resource scheduling strategy is triggered.

[0042] In a second aspect, an embodiment of the present invention provides a device for simulating a cloud phone virtual device, the device comprising:

[0043] An acquisition module is used to obtain the configuration authority of the hardware virtualization layer and initialize the kernel virtual machine based on the configuration authority to obtain an adjustable memory allocation environment;

[0044] An execution module, configured to load and adapt a customized driver module according to the memory allocation environment to obtain a device abstract interface;

[0045] A calling module, configured to call the device abstract interface to configure a bidirectional control channel and obtain a cross-layer communication channel;

[0046] The processing module is used to complete the multi-functional simulation of the cloud phone virtual device based on the cross-layer communication channel using graphics processing virtualization, device hot plug management and resource isolation.

[0047] In a third aspect, an embodiment of the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0048] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0049] The embodiment of the present application can adjust the memory allocation environment by obtaining the hardware virtualization layer configuration permission and initializing the kernel virtual machine, providing a flexible and stable resource foundation for the operation of virtual devices, and improving problems such as insufficient sensor data processing accuracy and video stream jamming caused by unreasonable memory allocation. The loading and adaptation of the customized driver module obtains the device abstract interface, which can accurately connect to various virtual devices, improve the accuracy of dynamic generation of sensor data, and optimize the video stream processing process. Call the device abstract interface to configure the cross-layer communication channel to ensure efficient data transmission, reduce network simulation delay, and improve response speed. Based on the cross-layer communication channel, graphics processing virtualization, device hot plug management and resource isolation are used to improve the virtual device function, make up for the lack of function, achieve more realistic network simulation, optimize the video stream rendering effect, and improve the performance of the cloud phone virtual device layer in sensor data, video stream and network simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 is a flowchart of a method for simulating a cloud phone virtual device according to some embodiments of the present invention;

[0052] Figure 2 is a schematic diagram of a simulation system of a cloud phone virtual device according to some embodiments of the present invention;

[0053] Figure 3 is a schematic diagram of resource isolation according to some embodiments of the present invention;

[0054] Figure 4 is a flowchart of another method for simulating a cloud phone virtual device according to some embodiments of the present invention;

[0055] Figure 5 is a structural block diagram of a simulation device for a cloud phone virtual device according to an embodiment of the present invention;

[0056] Figure 6 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.

[0058] According to an embodiment of the present invention, a method and apparatus for simulating a cloud phone virtual device are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0059] In this embodiment, a method for simulating a cloud phone virtual device is provided. Figure 1 This is a simulation method of a cloud phone virtual device according to an embodiment of the present invention and a flowchart of releasing A Fei, such as Figure 1 As shown, the process includes the following steps:

[0060] Step S101 , obtaining the configuration authority of the hardware virtualization layer, and initializing the kernel virtual machine based on the configuration authority to obtain an adjustable memory allocation environment.

[0061] In an embodiment of the present application, the kernel virtual machine is initialized based on configuration permissions to obtain an adjustable memory allocation environment, including: according to the hardware virtualization layer configuration permissions, performing kernel parameter adjustment, enabling the kernel virtual machine and configuring memory dynamic allocation parameters that support the ballooning mechanism to obtain a virtualized kernel environment; based on the virtualized kernel environment, loading the relevant kernel modules of the kernel virtual machine, performing module parameter configuration to activate the ballooning function, and obtaining a basic environment that supports dynamic memory adjustment; within the basic environment, creating a virtual machine instance and mounting the balloon driver, executing the memory pre-allocation policy configuration, and obtaining an initial memory allocation plan; using the initial memory allocation plan to deploy a monitoring script to collect virtual machine memory usage data in real time, and obtain a dynamic memory monitoring system; configuring an adjustable memory allocation environment based on the dynamic memory monitoring system.

[0062] First, based on the hardware virtualization layer's configuration permissions, access the system kernel configuration file (such as / etc / sysctl.conf) and add or modify parameters related to KVM (Kernel-based Virtual Machine). For example, enable dynamic memory ballooning and configure the kvm.balloon_control parameter to allow the virtual machine to dynamically adjust memory. Execute sysctl -p to validate the parameters and load the KVM kernel module (for example, modprobe kvm) to initialize kernel-level virtualization support. This ultimately creates a virtualized kernel environment with dynamic memory allocation capabilities.

[0063] Next, in the virtualized kernel environment, install the KVM-related kernel modules (such as kvm-intel or kvm-amd) using a package manager (such as apt-get or yum). Modify the module loading configuration file (such as / etc / modules-load.d / kvm.conf) to ensure that the module is automatically loaded when the system boots. Configure module parameters, such as setting the maximum memory limit for the balloon driver using / sys / module / kvm / parameters / balloon_force_max and activating the ballooning function using echo 1> / sys / kernel / mm / balloon / enable. Verify the module loading status (for example, using lsmod | grep kvm) to obtain a basic environment that supports dynamic memory adjustment.

[0064] Then, in a basic environment that supports dynamic memory adjustment, use the QEMU-KVM tool to create a virtual machine instance, specify the initial memory size through command-line parameters (such as -m 2048), and mount the balloon driver (such as -device virtio-balloon-pci) to enable dynamic memory interaction between the virtual machine and the host. Enter the virtual machine operating system, install the balloon driver client (such as qemu-guest-agent), and configure the memory pre-allocation policy, such as setting the reserved memory ratio through the libvirt parameter memoryBacking. This ensures stable basic memory resources when the virtual machine starts, and generates an initial memory allocation plan.

[0065] Next, based on the initial memory allocation plan, deploy a custom monitoring script (such as the Python psutil library or a Shell script) within the host or virtual machine to regularly collect memory usage data (such as usage rate, swap space utilization, and page fault rate) and store the data in a time-series database such as Prometheus. Set memory usage thresholds (such as a high watermark of 80% and a low watermark of 20%), develop alert rules (such as triggering notifications through Grafana), and build a dynamic memory monitoring system that includes data collection, storage, analysis, and alerting to reflect the virtual machine's memory status in real time.

[0066] Finally, an adjustable memory allocation environment is configured based on the dynamic memory monitoring system, including: performing load prediction based on the historical memory usage data collected by the dynamic memory monitoring system to obtain memory usage trend data; executing pre-allocation strategy calculation based on the memory usage trend data and memory threshold to obtain the target value of dynamic regulation in each virtual machine; using the target to write an automated script to configure the automated management strategy of memory; executing the automated management strategy, when the memory usage reaches the preset threshold, executing the balloon driver call to obtain the memory dynamic adjustment result; optimizing the pre-allocation strategy according to the memory dynamic adjustment result to obtain an adjustable memory allocation environment.

[0067] We extract historical memory usage data (such as minute-by-minute memory usage over the past 24 hours) from the dynamic memory monitoring system's time series database and build a prediction model using time series analysis algorithms (such as ARIMA or LSTM neural networks). By training and fitting the model to historical data, we predict memory usage trends over a period of time (such as the next 30 minutes) and generate trend data containing timestamps and corresponding memory usage forecasts, providing a basis for subsequent resource allocation.

[0068] Compare and analyze memory usage trend data against preset memory thresholds (e.g., 80% high watermark, 20% low watermark). For each virtual machine, if the predicted value exceeds the high watermark, calculate the incremental memory to be pre-allocated (e.g., current memory + predicted excess × 1.2); if it falls below the low watermark, calculate the decrement in memory to be reclaimed (e.g., current memory - predicted shortfall × 0.8). Combined with virtual machine priority (e.g., prioritizing business-critical virtual machines) and the remaining resource pool capacity of the host machine, generate target values ​​for dynamic memory control for each virtual machine (e.g., target memory size, adjustment time window).

[0069] Based on the generated memory control target values, write an automated script in Shell or Python to dynamically adjust VM memory by calling libvirt APIs (such as virshsetmemory) or directly manipulating the / dev / virtio_balloon device node. The script logic includes parsing the target value file, verifying the validity of the adjustment parameters, executing the memory adjustment operation, and logging it. Bind the script to a scheduled task (such as Cron) or an event-triggered mechanism (such as a monitoring system alarm) to establish an automated memory management policy, for example, checking every 5 minutes to see if the adjustment threshold has been reached.

[0070] When the dynamic memory monitoring system detects that a virtual machine's memory usage has reached a preset threshold (e.g., three consecutive samplings exceeding the high watermark), it automatically triggers the execution of an automated script. The script invokes the balloon driver interface to send memory adjustment instructions to the virtual machine. In pre-allocation scenarios, the balloon driver requests the target memory from the host's memory pool and injects it into the virtual machine; in reclaim scenarios, it releases the virtual machine's free memory to the host. Upon completion, the adjustment results (e.g., memory size before and after adjustment, duration, and status code) are recorded, and the virtual machine's memory status is updated via the monitoring system.

[0071] Collect data on dynamic memory adjustment results (such as adjustment success rate and post-adjustment memory usage fluctuations) and compare and analyze them with the trend data output by the load forecasting model. If memory usage still frequently hits the threshold after adjustment, or if adjustment latency is too high, causing service lag, adjust the forecasting model parameters (such as increasing the historical data window length) or optimize the pre-allocation strategy (such as introducing an elastic adjustment factor). By continuously iterating strategies and models, the accuracy and responsiveness of memory allocation can be improved, ultimately creating a more adaptable and adjustable memory allocation environment.

[0072] Step S102 : performing loading and adaptation operations on a customized driver module according to the memory allocation environment to obtain a device abstract interface.

[0073] In an embodiment of the present application, a customized driver module is loaded and adapted according to a memory allocation environment to obtain a device abstract interface, including: compiling the customized driver module source code according to the memory allocation environment, and executing kernel module signing and loading on the customized driver module source code to obtain an adapted basic driver component; configuring driver parameters using the basic driver component to match dynamic memory characteristics, and performing a linkage test between the driver and the balloon mechanism to obtain a memory-aware driver instance; obtaining the device abstraction layer middleware corresponding to the driver instance, calling the device abstraction layer middleware to convert the driver private interface into a standardized device operation API, and performing an API consistency check to obtain a device abstract interface framework; based on the device abstract interface framework, deploying an automated adaptation script, generating driver adapters for different types of virtual devices, performing cross-device operation verification, and obtaining a device abstract interface.

[0074] Specifically, in the memory allocation environment, first obtain the source code of the customized driver module (such as a device driver developed based on the QEMUVirtIO specification), and configure the compilation environment variables (such as ARCH=x86_64, CROSS_COMPILE=) to adapt to the target kernel version. Execute makemodules to compile the driver source code and generate a kernel module file (such as a .ko file). Then sign the kernel module and use the sign-file tool in combination with the system key pair (such as / var / lib / shim-signed / mok / MOK.der) to sign the module to ensure that it meets the UEFI secure boot requirements. Load the signed module through the insmod or modprobe command and verify the loading status (such as lsmod|grepvirtio) to finally obtain the basic driver component that adapts to the current memory allocation environment.

[0075] Using the loaded basic driver components, configure the driver parameters by modifying the corresponding parameter files in the / sys / module / directory (such as / sys / module / virtio_balloon / parameters / force_max) to adapt to dynamic memory characteristics (for example, setting balloon_compaction_threshold_mb = 512 to optimize page compression during memory reclaim). Write a linkage test script to simulate memory adjustment scenarios triggered by the balloon mechanism: First, use the virshsetmem command to reduce the virtual machine's memory and observe whether the driver releases the corresponding memory pages through the callback function. When increasing memory, verify that the driver can correctly allocate new pages. Use the dmesg log to check the driver's response and collect metrics such as memory adjustment time and page swap count to ensure that the driver operates stably under dynamic memory changes, ultimately obtaining a memory-aware driver instance.

[0076] Based on the memory-aware driver example, develop device abstraction layer middleware (such as a gRPC service written in Go) to establish a communication channel with the driver's private interface (such as / dev / virtio-ports / com.vendor.device) through system calls (such as ioctl). Define standardized device operation APIs (such as GetDeviceStatus and SetDeviceConfig) in the middleware and implement protocol conversion logic (such as converting the driver's binary communication protocol into a JSON-formatted API request). Write an API consistency verification tool to compare the behavioral differences between the standardized API and the driver's native functions, ensure that all device operations (such as reading and writing registers and interrupt handling) are correctly mapped at the API level, and ultimately generate a device abstraction interface framework that conforms to unified specifications.

[0077] Based on the device abstract interface framework, use Python or Shell to write automated adaptation scripts, and automatically generate corresponding driver adapter codes by parsing the driver documents of different types of virtual devices (such as GPUs, sound cards, and network cards). For example, generate an adapter that supports OpenGLES3.0 command forwarding for the GPU driver, and generate an API wrapper that complies with the virtio-net specification for the network card driver. Deploy these adapters to the cloud phone system, write cross-device operation test cases (such as calling the camera and audio drivers at the same time to simulate a video conference), and verify the compatibility of API calls and the correctness of data flow between different devices. Register the adapter service through the systemd service configuration file to ensure that it is automatically loaded when the system starts, and finally form a unified device abstract interface covering multiple types of virtual devices.

[0078] Step S103: calling the device abstract interface to configure a bidirectional control channel to obtain a cross-layer communication channel.

[0079] In an embodiment of the present application, a device abstract interface is called to configure a bidirectional control channel to obtain a cross-layer communication channel, including: using a pre-built protocol framework to map the methods of the device abstract interface to a cross-layer communication service instance; based on the communication service instance, an adaptive retransmission algorithm and a TLS encryption and authentication mechanism are configured to obtain a communication channel; based on the communication channel, a service registration and discovery component is deployed to realize automatic connection between the device abstract interface and the upper-layer application, perform cross-layer call stress testing, and obtain a stable cross-layer communication channel.

[0080] Specifically, use the pre-defined gRPC protocol framework (such as .proto files) to map the methods of the device abstract interface (such as GetDeviceStatus and SetDeviceConfig) to the RPC methods of the gRPC service. Use the protoc compiler to generate server and client code, and encapsulate the calling logic of the device abstract interface in the server implementation (such as forwarding requests through system calls or middleware APIs). Configure service instance parameters (such as listening port 50051, thread pool size 10), and register interceptors to process metadata of cross-layer calls (such as request source, permission identifier). Package the service instance through containerization technology (such as Docker) to ensure environmental consistency, and ultimately obtain a cross-layer communication service based on standard protocols.

[0081] Based on the communication service instance, configure the adaptive retransmission algorithm parameters (such as initial RTO = 1 second, α = 0.8, β = 0.2), and dynamically adjust the timeout threshold by collecting historical RTT samples. Integrate TLS encryption and authentication mechanism: generate self-signed certificates (such as using OpenSSL to create CA certificates and service certificates), configure the server to enable two-way TLS verification (client_auth = REQUIRE), and embed the trust chain in the client code. Use interceptors to achieve transparent encryption / decryption of request / response data to ensure the integrity and confidentiality of the communication content. Write stress test scripts (such as using ghz tools) to simulate high-concurrency scenarios to verify that under conditions of 10% packet loss rate and ±50ms network jitter, the service can still maintain a 99.9% request success rate, ultimately obtaining a secure and reliable communication channel.

[0082] Deploy service registration and discovery components (such as Consul or Etcd) based on the communication channel, and configure the service instance to automatically register its own metadata (such as service name, endpoint address, and load metrics) when it starts. Integrate the service discovery client in the upper-layer application, call the device abstract interface through the service name instead of the hard-coded address, and achieve dynamic load balancing and failover. Perform cross-layer call stress testing: Use custom testing tools to simulate tens of thousands of concurrent requests (such as 10,000 device status queries per second) and monitor key indicators (such as average response time <5ms and error rate <0.1%). Optimize the configuration (such as enabling session reuse and adjusting the certificate chain length) to address performance bottlenecks (such as TLS handshakes that take too long), and prevent cascading failures through circuit breaking mechanisms (such as Sentinel). Ultimately, through continuous stress testing and parameter tuning, a stable and reliable cross-layer communication channel that can support large-scale concurrency is obtained.

[0083] Step S104, based on the cross-layer communication channel, graphics processing virtualization, device hot plug management and resource isolation are used to complete the multi-functional simulation of the cloud phone virtual device.

[0084] In an embodiment of the present application, an adaptive retransmission algorithm and a TLS encryption and authentication mechanism are configured based on a communication service instance to obtain a communication channel, including: configuring adaptive retransmission algorithm parameters according to the network characteristics of the communication service instance, and using the adaptive retransmission algorithm parameters to collect historical RTT sample data to obtain a calculation model; integrating a packet loss detection algorithm according to the calculation model to obtain a reliable transmission control module; obtaining and generating a TLS certificate and key pair, configuring a certificate chain verification strategy, and obtaining an encrypted communication basic component; and constructing a communication channel based on the encrypted communication component and the calculation model.

[0085] Based on the network characteristics of the communication service instance (such as bandwidth fluctuation range and average delay), the adaptive retransmission algorithm parameters (initial RTO = 1 second, smoothing factor α = 0.8, and deviation factor β = 0.2) are configured. During the communication process, the round-trip time (RTT) sample data of each request is collected through the interceptor and stored in a sliding time window (such as the last 1000 samples). The exponentially weighted moving average (EWMA) algorithm is used to process historical RTT data, dynamically calculate the RTO value (RTO = α × RTT + β × RTT_var), and automatically adjust the parameters according to the network congestion situation. The distribution characteristics of the sample data are analyzed through linear regression, and the algorithm parameters are optimized to adapt to different network environments. Finally, an RTO calculation model that can dynamically adapt to network changes is constructed.

[0086] Based on the RTO calculation model, the selective acknowledgment (SACK) and fast retransmit algorithms are integrated to implement packet loss detection. The sending window and acknowledgment status table are maintained at the sending end. When three duplicate ACKs are received or the RTO times out, the fast retransmit mechanism is triggered. The out-of-order data packet cache and SACK information feedback are implemented at the receiving end, and packet loss is detected by comparing sequence numbers. The congestion control logic is written. When packet loss is detected, the congestion avoidance algorithm (such as multiplication reduction) is executed to adjust the sending rate. The module function is verified through unit testing, and different packet loss rate scenarios (such as 5%, 10%) are simulated to ensure that the module can maintain a stable throughput under various network conditions, and finally a reliable transmission control module is obtained.

[0087] Use OpenSSL to generate a self-signed certificate and key pair: Create a root CA certificate (, then generate a server certificate for the communication service and have it signed by the CA. Configure the certificate chain verification policy to require the client to verify the signature and validity period of the server certificate, and enable client certificate verification on the server.

[0088] Configure the TLS version and encryption suite in the communication library, implement the certificate hot update mechanism through code injection, ensure the forward security of the communication process, and finally obtain the basic components of encrypted communication.

[0089] Deeply integrate the basic components of encrypted communication with the reliable transmission control module to achieve reliable transmission of encrypted data packets. At the sending end, the application data is first encrypted by the TLS layer, and then handed over to the transmission control module to add sequence numbers, perform segmentation and retransmission logic; at the receiving end, the data packet is first reassembled by the transmission control module, and then the data is decrypted by the TLS layer. Optimize the TLS handshake process and apply the adaptive retransmission algorithm to the handshake stage to reduce handshake failures caused by network fluctuations. Deploy end-to-end encrypted communication stress testing, and in a simulated 5G network environment (bandwidth 100Mbps, latency 20ms, packet loss rate 1%), verify that the system throughput reaches more than 95Mbps and the end-to-end latency is kept within 50ms, ultimately building a secure, reliable and high-performance communication channel.

[0090] As an example, Figure 2 The figure shows a multi-layered architecture from the hardware layer to the application layer. The hardware layer, as the foundation, connects to the device abstraction layer through data flow. It also allocates memory bandwidth and, leveraging NUMA resource isolation, implements L3 cache partitioning and NUMA affinity binding for PCIe devices. It also utilizes KVM and cgroupsv2 for resource management. The device abstraction layer follows udev rules through device registration and deregistration, inherits the data flow from the hardware layer, and passes the data to the service layer. The service layer builds a cross-platform device control channel based on gRPC streams and then directs data to the application layer. The application layer implements graphics rendering redirection based on OpenGL ES 3.0. All layers work closely together to achieve data processing and device control.

[0091] As an example, Figure 3 As shown, the system first obtains hardware virtualization layer configuration permissions, then initializes the kernel virtual machine (KVM). Using this, it leverages cgroups v2 to implement memory bandwidth allocation and resource isolation. The former achieves L3 cache partitioning and rationally divides cache resources, while the latter implements NUMA affinity binding for PCIe devices, tightly associating devices with corresponding NUMA nodes, reducing memory access latency and ultimately creating a tunable memory allocation environment. Within this environment, a customized driver module is loaded and adapted to obtain a device abstraction interface. This interface is then used to configure a bidirectional control channel, forming a cross-layer communication channel. Finally, based on this channel, the system utilizes graphics processing virtualization, device hot-swap management, and the aforementioned resource isolation to achieve multifunctional cloud phone virtual device simulation. Specifically, cgroups v2 uses resource isolation to bind PCIe devices to specific NUMA nodes, prioritizing local node memory when accessing memory, reducing cross-node data transfer and improving performance. Memory bandwidth allocation also enables L3 cache partitioning and optimizes cache resource utilization.

[0092] This embodiment of the application obtains hardware virtualization layer configuration permissions and initializes the kernel virtual machine, using the ballooning mechanism to achieve dynamic memory allocation and monitoring, rationally allocate resources, and avoid sensor data processing lag, accuracy deviation, and high video stream processing latency caused by insufficient or uneven memory allocation, laying a resource foundation for subsequent operations. Customized driver module loading and adaptation, from source code compilation to the final formation of the device abstract interface, enables the driver to accurately adapt to dynamic memory characteristics, enhances the control precision of virtual devices, improves the accuracy of dynamic sensor data generation, optimizes the video stream processing process, and reduces data transmission and processing delays.

[0093] During the configuration of the bidirectional control channel, by mapping service instances and configuring reliable transmission and encryption mechanisms, we ensure secure and efficient data transmission across layers, reducing network simulation latency, improving network response speed, and addressing issues such as missing functionality and latency in network simulation. Finally, by leveraging technologies such as graphics processing virtualization across cross-layer communication channels, we comprehensively enhance virtual device functionality, enabling more realistic dynamic sensor data generation, smooth video streaming, and more accurate network simulation, effectively addressing issues such as insufficient precision, high latency, and missing functionality.

[0094] Figure 4 This is a simulation method of a cloud phone virtual device according to an embodiment of the present invention and a flowchart of releasing A Fei, such as Figure 4 As shown, the process includes the following steps:

[0095] Step S201: Using a cross-layer communication channel to collect operating data of virtual devices in real time.

[0096] In an embodiment of the present application, through the bidirectional data flow capability of the cross-layer communication channel, a lightweight data collection agent (such as a probe based on eBPF technology) is deployed at the virtual device layer to monitor key system calls and device status change events in real time.

[0097] Customized data collection strategies are implemented for different types of virtual devices (such as GPUs, storage, and networks). For GPUs, data is collected on rendering frame rate, video memory utilization, and shader execution time. For storage devices, I / O throughput, average response time, and queue depth are monitored. For network devices, data packet send and receive rates, packet loss rates, and number of connections are captured. The collected raw data is serialized using the Protobuf protocol and transmitted to the data aggregation service via a TLS-encrypted channel, ensuring secure and efficient data transmission. Leveraging the low latency of the communication channel (end-to-end latency <10ms), data collection is achieved at a frequency of seconds, creating a dynamic, real-time profile of device status.

[0098] Step S202 : The operation data is sorted in a time series format and input into a pre-trained prediction model to predict resource usage trends and abnormal behaviors.

[0099] In an embodiment of the present application, the collected raw operating data is sorted by timestamp, a time series data set of a sliding time window (such as 60 minutes) is constructed, and statistical features (such as mean, standard deviation, kurtosis) and time features (such as weekdays / weekends, hourly granularity) are extracted.

[0100] The preprocessed data is fed into a pre-trained hybrid model: An LSTM neural network is used to predict resource usage trends (e.g., memory usage over the next 30 minutes), while an isolation forest algorithm is used to detect anomalous behavior patterns (e.g., sudden I / O spikes, persistent GPU overheating). The model output includes resource usage predictions, anomaly confidence scores, and potential risk levels. For example, a prediction that memory usage will reach 90% in 15 minutes (high risk) or a detection of an abnormally high network packet loss rate (95% confidence) is used. Model integration techniques, such as bagging, are used to improve prediction accuracy and ensure generalization across diverse load scenarios.

[0101] Step S203: triggering corresponding resource scheduling strategies based on resource usage trends and abnormal behaviors.

[0102] In an embodiment of the present application, based on the resource trends and abnormal behaviors output by the prediction model, a rule engine is developed to parse the risk level and trigger corresponding scheduling strategies.

[0103] For resource usage trend prediction, preventive scheduling is implemented: if the predicted memory usage rate will exceed a threshold (such as 80%), the memory pre-allocation process is automatically triggered, and the balloon driver is called through the cross-layer communication channel to increase the virtual machine memory quota; if the predicted GPU utilization rate is continuously below 20%, some computing tasks are migrated to other nodes. For abnormal behavior detection, responsive scheduling is performed: when an I / O anomaly is detected, the IOPS limit of the storage device is automatically adjusted or data copies are migrated; when an abnormal network packet loss rate is found, the network traffic path is dynamically switched or redundant connection establishment is triggered. All scheduling decisions are sent down to the device abstract interface through the communication channel for execution, and operation logs are recorded for auditing and policy optimization.

[0104] In this embodiment, a simulation device for a cloud phone virtual device is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements 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.

[0105] This embodiment provides a simulation device for a cloud phone virtual device, such as Figure 5 As shown, including:

[0106] An acquisition module 501 is used to obtain the configuration authority of the hardware virtualization layer and initialize the kernel virtual machine based on the configuration authority to obtain an adjustable memory allocation environment;

[0107] The execution module 502 is used to load and adapt the customized driver module according to the memory allocation environment to obtain the device abstract interface;

[0108] The calling module 503 is used to call the device abstract interface to configure a bidirectional control channel and obtain a cross-layer communication channel;

[0109] The processing module 504 is used to complete the multi-functional simulation of the cloud phone virtual device based on the cross-layer communication channel using graphics processing virtualization, device hot plug management and resource isolation.

[0110] In an embodiment of the present application, an acquisition module 501 is used to configure permissions of the hardware virtualization layer, perform kernel parameter adjustment, enable the kernel virtual machine and configure memory dynamic allocation parameters that support the ballooning mechanism to obtain a virtualized kernel environment; based on the virtualized kernel environment, load the relevant kernel modules of the kernel virtual machine, execute module parameter configuration to activate the ballooning function, and obtain a basic environment that supports dynamic memory adjustment; within the basic environment, create a virtual machine instance and mount the balloon driver, execute memory pre-allocation policy configuration, and obtain an initial memory allocation plan; use the initial memory allocation plan to deploy a monitoring script to collect virtual machine memory usage data in real time, and obtain a dynamic memory monitoring system; configure an adjustable memory allocation environment based on the dynamic memory monitoring system.

[0111] In an embodiment of the present application, an acquisition module 501 is used to perform load prediction based on historical memory usage data collected by a dynamic memory monitoring system to obtain memory usage trend data; perform pre-allocation strategy calculation based on the memory usage trend data and the memory threshold to obtain the target value of dynamic regulation in each virtual machine; use the target to write an automated script to configure the automated management strategy of memory; execute the automated management strategy, and when the memory usage reaches a preset threshold, execute a balloon driver call to obtain the memory dynamic adjustment result; optimize the pre-allocation strategy according to the memory dynamic adjustment result to obtain an adjustable memory allocation environment.

[0112] In an embodiment of the present application, the execution module 502 is used to compile the customized driver module source code according to the memory allocation environment, and execute the kernel module signature and loading of the customized driver module source code to obtain the adapted basic driver component; use the basic driver component to configure the driver parameters to match the dynamic memory characteristics, and perform the linkage test of the driver and balloon mechanism to obtain a memory-aware driver instance; obtain the device abstraction layer middleware corresponding to the driver instance, call the device abstraction layer middleware to convert the driver private interface into a standardized device operation API, and perform API consistency verification to obtain a device abstract interface framework; based on the device abstract interface framework, deploy an automated adaptation script, generate driver adapters for different types of virtual devices, perform cross-device operation verification, and obtain a device abstract interface.

[0113] In an embodiment of the present application, the calling module 503 is used to use a pre-built protocol framework to map the methods of the device abstract interface to a cross-layer communication service instance; based on the communication service instance, an adaptive retransmission algorithm and a TLS encryption and authentication mechanism are configured to obtain a communication channel; based on the communication channel, a service registration and discovery component is deployed to realize automatic connection between the device abstract interface and the upper-layer application, perform cross-layer call stress testing, and obtain a stable cross-layer communication channel.

[0114] In an embodiment of the present application, module 503 is called to configure the adaptive retransmission algorithm parameters according to the network characteristics of the communication service instance, and use the adaptive retransmission algorithm parameters to collect historical RTT sample data to obtain a calculation model; integrate the packet loss detection algorithm according to the calculation model to obtain a reliable transmission control module; obtain and generate a TLS certificate and key pair, configure the certificate chain verification strategy, and obtain the encrypted communication basic component; and build a communication channel based on the encrypted communication component and the calculation model.

[0115] In an embodiment of the present application, the device also includes: a prediction module for collecting the operating data of the virtual device in real time using a cross-layer communication channel; organizing the operating data in a time series format and inputting it into a pre-trained prediction model to predict resource usage trends and abnormal behaviors; and triggering corresponding resource scheduling strategies based on the resource usage trends and the abnormal behaviors.

[0116] See also Figure 6 , Figure 6 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of a GUI on an external input / output device (such as, a display device coupled to an interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0117] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0118] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0119] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created based on the use of a computer device for displaying a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device 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 a combination thereof.

[0120] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0121] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0122] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

[0123] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for simulating a cloud phone virtual device, characterized in that: The method comprises: Obtaining configuration permissions for the hardware virtualization layer, and initializing the kernel virtual machine based on the configuration permissions to obtain an adjustable memory allocation environment; Loading and adapting a customized driver module according to the memory allocation environment to obtain a device abstract interface; Calling the device abstract interface to configure a bidirectional control channel to obtain a cross-layer communication channel; Based on the cross-layer communication channel, graphics processing virtualization, device hot plug management and resource isolation are utilized to complete the multi-functional simulation of the cloud phone virtual device.

2. The method according to claim 1, characterized in that Initializing the kernel virtual machine based on the configuration permissions to obtain an adjustable memory allocation environment includes: According to the hardware virtualization layer configuration authority, kernel parameter adjustment is performed, the kernel virtual machine is enabled and memory dynamic allocation parameters supporting the ballooning mechanism are configured to obtain a virtualized kernel environment; Based on the virtualized kernel environment, load the kernel modules related to the kernel virtual machine, execute module parameter configuration to activate the ballooning function, and obtain the basic environment that supports dynamic memory adjustment; In the basic environment, a virtual machine instance is created and a balloon driver is mounted, and memory pre-allocation policy configuration is executed to obtain an initial memory allocation plan; Using the initial memory allocation plan, a monitoring script is deployed to collect virtual machine memory usage data in real time, thus obtaining a dynamic memory monitoring system. Configure an adjustable memory allocation environment based on a dynamic memory monitoring system.

3. The method according to claim 2, characterized in that Configure an adjustable memory allocation environment based on a dynamic memory monitoring system, including: Perform load forecasting based on historical memory usage data collected by the dynamic memory monitoring system to obtain memory usage trend data; Execute pre-allocation strategy calculation based on the memory usage trend data and the memory threshold to obtain the target value of dynamic control in each virtual machine; Using the target to write an automated script to configure an automated memory management strategy; Execute the automated management strategy, and when the memory usage reaches a preset threshold, execute a balloon driver call to obtain a dynamic memory adjustment result; The pre-allocation strategy is optimized according to the memory dynamic adjustment result to obtain an adjustable memory allocation environment.

4. The method according to claim 1, wherein The loading and adaptation operations of the customized driver module are performed according to the memory allocation environment to obtain the device abstract interface, including: Compiling the customized driver module source code according to the memory allocation environment, and performing kernel module signing and loading on the customized driver module source code to obtain an adapted basic driver component; Utilizing the basic driver components, driver parameters are configured to match dynamic memory characteristics, and a linkage test between the driver and the balloon mechanism is performed to obtain a memory-aware driver instance. Obtaining the device abstraction layer middleware corresponding to the driver instance, calling the device abstraction layer middleware to convert the driver private interface into a standardized device operation API, and performing API consistency verification to obtain a device abstraction interface framework; Based on the device abstract interface framework, an automated adaptation script is deployed to generate driver adapters for different types of virtual devices, and cross-device operation verification is performed to obtain the device abstract interface.

5. The method according to claim 1, wherein The calling of the device abstract interface to configure a bidirectional control channel to obtain a cross-layer communication channel includes: Use the pre-built protocol framework to map the methods of the device abstract interface to cross-layer communication service instances; Based on the communication service instance, configure the adaptive retransmission algorithm and TLS encryption and authentication mechanism to obtain the communication channel; Deploy service registration and discovery components based on the communication channel to achieve automatic connection between the device abstract interface and the upper-layer application, perform cross-layer call stress testing, and obtain a stable cross-layer communication channel.

6. The method according to claim 5, characterized in that The communication service instance is based on which an adaptive retransmission algorithm and a TLS encryption and authentication mechanism are configured to obtain a communication channel, including: Configuring adaptive retransmission algorithm parameters according to network characteristics of the communication service instance, and using the adaptive retransmission algorithm parameters to collect historical RTT sample data to obtain a calculation model; Integrating a packet loss detection algorithm according to the calculation model to obtain a reliable transmission control module; Obtain and generate TLS certificate and key pair, configure certificate chain verification strategy, and obtain basic components for encrypted communication; The communication channel is constructed based on the encrypted communication component and the calculation model.

7. The method according to claim 1, characterized in that The method further comprises: Use cross-layer communication channels to collect virtual device operation data in real time; The operation data is organized into a time series format and input into a pre-trained prediction model to predict resource usage trends and abnormal behaviors; According to the resource usage trend and the abnormal behavior, a corresponding resource scheduling strategy is triggered.

8. A simulation device for a cloud phone virtual device, characterized in that: The device comprises: An acquisition module is used to obtain the configuration authority of the hardware virtualization layer and initialize the kernel virtual machine based on the configuration authority to obtain an adjustable memory allocation environment; An execution module, configured to load and adapt a customized driver module according to the memory allocation environment to obtain a device abstract interface; A calling module, configured to call the device abstract interface to configure a bidirectional control channel and obtain a cross-layer communication channel; The processing module is used to complete the multi-functional simulation of the cloud phone virtual device based on the cross-layer communication channel using graphics processing virtualization, device hot plug management and resource isolation.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.