Remote control method of experimental sandbox, terminal device and storage medium
By leveraging the load balancing mechanism and RDP protocol of the Guacd cluster, the optimal instance is dynamically selected to establish an RDP session channel, solving the problem of low graphics rendering efficiency in traditional NoVNC technology and achieving efficient industrial software graphical interface rendering and high frame rate graphics command transmission.
Patent Information
- Application Number
- CN202510813561.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-06-18
AI Technical Summary
Traditional HTML5-based NoVNC technology requires the additional deployment of a VNC server in a Windows system environment, resulting in low graphics rendering efficiency and failing to meet the needs of industrial software teaching and training.
By dynamically selecting the optimal instance through the load balancing mechanism based on the Guacd cluster, an RDP session channel is established, directly calling the native remote desktop service of the Windows system. This avoids the redundancy of traditional solutions and utilizes the protocol conversion capability of the Guacd cluster to build the RDP session channel, giving full play to the hardware acceleration features of the Windows system remote desktop.
It improves the rendering efficiency of industrial software graphical interfaces, enables high frame rate graphics command transmission, and solves the problem of low graphics rendering efficiency in traditional NoVNC technology.
Smart Images

Figure CN120390031B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of data processing, and particularly relates to a remote control method of an experimental sandbox, a terminal device and a storage medium. BACKGROUND
[0002] With the increasing demand for industrial software teaching and training, students need to complete complex operation tasks through remote access to an experimental sandbox environment.
[0003] The traditional method is realized based on the NoVNC technology of HTML5, and does not require a local client, but needs to additionally deploy a VNC server in a Windows system environment, resulting in low graphic rendering efficiency. A new technical means is needed to solve the above technical problems. SUMMARY
[0004] In view of this, the embodiments of the present application provide a remote control method of an experimental sandbox, a terminal device and a storage medium, which can solve the problem of low graphic rendering efficiency in related technologies.
[0005] The first aspect of the present application provides a remote control method of an experimental sandbox, comprising:
[0006] If an experiment request initiated by a user end is received, an experimental sandbox is configured according to identity information carried by the experiment request, and experimental sandbox connection information corresponding to the identity information is queried;
[0007] An active target Guacd instance is selected from a Guacd cluster, and an RDP session channel with the experimental sandbox is established according to the target Guacd instance and the experimental sandbox connection information;
[0008] The RDP session channel responds to the trigger instruction of the user end.
[0009] Optionally, in the first implementation manner of the first aspect of the present application, the step of dynamically configuring a virtual machine according to the identity information carried by the experiment request comprises:
[0010] An experimental identifier associated with the identity information is used to call virtual machine image configuration parameters from a preset template library;
[0011] A virtual machine instance is generated according to the configuration parameters, and an experimental special dynamic credential is injected to obtain the experimental sandbox, and the validity period of the dynamic credential is bound with the timeliness of the experiment request.
[0012] Optionally, in the second implementation manner of the first aspect of the present application, the step of establishing an RDP session channel with the experimental sandbox according to the target Guacd instance and the experimental sandbox connection information comprises:
[0013] establishing an initial RDP session channel with the experimental sandbox through the Guacd instance and the experimental sandbox connection information;
[0014] end-to-end encrypting the initial RDP session channel to obtain the RDP session channel.
[0015] Optionally, in a third implementation manner of the first aspect, the step of responding to the trigger instruction of the user terminal according to the RDP session channel comprises:
[0016] when the captured user input event obtains the trigger instruction, converting the trigger instruction into a Guacamole instruction set;
[0017] transmitting the Guacamole instruction set to the experimental sandbox through the RDP session channel.
[0018] Optionally, in a fourth implementation manner of the first aspect, after the step of responding to the trigger instruction of the user terminal according to the RDP session channel, the method further comprises:
[0019] when detecting that the network exception causes the connection to be interrupted, performing a reconnection operation, and dynamically calculating a reconnection waiting interval according to a historical failure number;
[0020] maintaining an experimental environment running state during the execution of the reconnection operation, and maintaining a session with the Guacd cluster through a heartbeat packet algorithm.
[0021] Optionally, in a fifth implementation manner of the first aspect, after the step of responding to the trigger instruction of the user terminal according to the RDP session channel, the method further comprises:
[0022] real-time monitoring of a screen size and a pixel density parameter of the user terminal;
[0023] dynamically generating an adaptation parameter according to the screen size and the pixel density parameter;
[0024] issuing a resolution configuration instruction to the experimental sandbox according to the adaptation parameter.
[0025] Optionally, in a sixth implementation manner of the first aspect, the step of querying the experimental sandbox connection information corresponding to the identity information comprises:
[0026] querying an experimental information cache database according to the identity information to obtain the experimental sandbox connection information.
[0027] Optionally, in a seventh implementation manner of the first aspect, the step of selecting an active target Guacd instance from the Guacd cluster comprises:
[0028] acquire, in real time, CPU occupancy, memory usage and active connection number of the Guacd cluster;
[0029] dynamically calculate weight values of each Guacd instance in the Guacd cluster according to the CPU occupancy, the memory usage and the active connection number;
[0030] determine the target Guacd instance from the each Guacd instance according to the weight values of the each Guacd instance.
[0031] In a second aspect, an embodiment of the present application provides a terminal device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the remote control method of the experimental sandbox when executing the computer program.
[0032] In a third aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the remote control method of the experimental sandbox when executed by a processor.
[0033] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, causes the terminal device to perform the remote control method of the experimental sandbox.
[0034] Compared with the prior art, the embodiment of the present application has the beneficial effects that: the optimal instance is dynamically selected by the load balancing mechanism based on the Guacd cluster to establish an RDP session channel, which can effectively solve the core problem of low efficiency of graphic rendering in the traditional NoVNC technology. Specifically, the Windows system native remote desktop service is directly called through the RDP protocol, which can avoid the technical redundancy of additional deployment of the VNC server in the traditional scheme, and can improve the rendering efficiency of the industrial software graphic interface. The RDP session channel is constructed through the protocol conversion capability of the Guacd cluster, which can fully exert the hardware acceleration characteristics of the Windows system remote desktop and realize high frame rate graphic instruction transmission. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0036] Figure 1 It is a schematic diagram of one embodiment of the remote control method of the experimental sandbox in the embodiments of the present application.
[0037] Figure 2 A specific embodiment of step S101 of the remote control method for the experimental sandbox in the embodiment of the present application is shown in the figure;
[0038] Figure 3 A specific embodiment of step S102 of the remote control method for the experimental sandbox in the embodiment of the present application is shown in the figure;
[0039] Figure 4 A specific embodiment of step S103 of the remote control method for the experimental sandbox in the embodiment of the present application is shown in the figure;
[0040] Figure 5 An embodiment of the terminal device in the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0041] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work belong to the protection of the present application.
[0042] It should be noted that the terms "comprise", "contain" and "have" in the specification and claims of the present application and the above-mentioned figures are intended to cover non-exclusive inclusion. For example, a process, method, terminal, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device. In the claims, specification and drawings of the present application, the relationship terms such as "first" and "second" are used only to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or sequence between the entities / operations / objects.
[0043] In this document, the term "embodiment" means that the specific features, structures or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears in various places in the specification does not necessarily refer to the same embodiment, nor is it mutually exclusive or alternative to other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0044] With the increasing demand for industrial software teaching and training, students need to complete complex operation tasks through remote access to experimental sandbox environment.
[0045] The traditional method is based on the implementation of NoVNC technology of HTML5, which does not require a local client, but needs to deploy a VNC server additionally in the Windows system environment, resulting in low efficiency of graphic rendering. A new technical means is needed to solve the above technical problems.
[0046] Therefore, the embodiment of the present application provides a remote control method of an experimental sandbox, a terminal device and a storage medium, which dynamically selects the optimal instance to establish an RDP session channel based on the load balancing mechanism of Guacd cluster, and can effectively solve the core problem of low efficiency of graphic rendering in the traditional NoVNC technology. Specifically, the Windows system native remote desktop service can be directly called through the RDP protocol, which can avoid the technical redundancy of the additional deployment of the VNC server in the traditional scheme, and can improve the rendering efficiency of the industrial software graphic interface. The RDP session channel can be established through the protocol conversion capability of the Guacd cluster, which can fully exert the hardware acceleration characteristics of the Windows system remote desktop, and realize high frame rate graphic instruction transmission.
[0047] In order to illustrate the technical scheme of the present application, the following will be described through specific embodiments.
[0048] Figure 1 A remote control method of an experimental sandbox provided by the embodiment of the present application is shown in the implementation flowchart, which can be applied to a terminal device. The terminal device can be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, etc.
[0049] Specifically, the remote control method of the experimental sandbox can include the following steps S101 to S103.
[0050] Step S101, if the experimental request initiated by the user end is received, the experimental sandbox is configured according to the identity information carried by the experimental request, and the experimental sandbox connection information corresponding to the identity information is queried.
[0051] In the embodiment of the present application, when the user end initiates the experimental request, the identity information (such as user ID, session token, etc.) carried in the request is analyzed, and the validity thereof is verified through the authentication module.
[0052] Specifically, the session ID parameter is extracted from the request header, compared with the session record stored in the cache database, the user identity and token timeliness are verified. If the authentication fails, the connection process is terminated immediately; if the authentication is passed, the connection information is obtained in the created experiment sandbox record according to the combination key of the user ID and the experiment ID.
[0053] According to the identity information authenticated successfully, the pre-generated experiment sandbox connection information is queried from the experiment information cache database. Specifically, according to the identity information, the experiment information cache database is queried to obtain the experiment sandbox connection information.
[0054] Specifically, the cache database is retrieved with the combination key as the index, and if it does not exist, the experiment environment is created in real time through the cloud platform API and the connection parameter is stored. The returned structured data includes the protocol type (fixed as RDP), access credentials and terminal address.
[0055] Step S102, an active target Guacd instance is selected from the Guacd cluster, and an RDP session channel with the experiment sandbox is established according to the target Guacd instance and the experiment sandbox connection information.
[0056] In the embodiment of the application, after the experiment sandbox configuration is completed, the active target Guacd instance is selected from the Guacd cluster through the load balancing module.
[0057] Specifically, the running state indicators (including CPU occupancy, memory usage and current active connection number) of each node in the cluster are collected in real time, the weight value of each instance is dynamically calculated based on the minimum load algorithm, and the instance with the lowest load is selected as the connection node. After the target instance is selected, the communication link between the Web system and the Guacd instance is established, and the initial RDP session channel with the experiment sandbox virtual machine is established through the Guacd protocol conversion middleware.
[0058] Specifically, based on the experiment sandbox connection information, the target Guacd instance and the experiment sandbox establish a native RDP connection to form an RDP session channel.
[0059] In order to further guarantee the safety of data transmission, end-to-end encryption processing (such as TLS protocol) is implemented on the initial channel to form an encrypted RDP session channel, and the safety of user operation instructions and remote desktop pictures is ensured.
[0060] Step S103, the RDP session channel responds to the trigger instruction of the user end.
[0061] In an embodiment of the present application, input events (such as keyboard strokes, mouse movements, and clipboard operations) of the user terminal are captured in real time through an established RDP session channel. The event module of the front-end system serializes the raw event data into a Guacamole protocol instruction set (such as keyboard events mapped to key instructions and mouse clicks mapped to mouse instructions) and pushes the instruction set to the target Guacd instance through a WebSocket long connection.
[0062] Upon receiving the instructions, the Guacd instance converts them into native RDP protocol instructions and forwards them to the experimental sandbox virtual machine for execution. Meanwhile, the graphical output data of the experimental sandbox is transmitted back to the user terminal through the reverse path, and is rendered in real time by the connection module of the front-end system, forming a two-way interactive closed loop.
[0063] During the entire interaction process, the channel state is continuously monitored, and when network anomalies are detected, an exponential backoff reconnection mechanism is triggered to dynamically adjust the reconnection strategy to maintain the continuity of the experiment process.
[0064] The beneficial effects of the embodiments of the present application compared with the prior art are: through the load balancing mechanism based on the Guacd cluster, the optimal instance is dynamically selected to establish the RDP session channel, which can effectively solve the core problem of low efficiency of graphical rendering in the traditional NoVNC technology. Specifically, by directly calling the Windows system native remote desktop service through the RDP protocol, the technical redundancy of additional deployment of the VNC server in the traditional scheme can be avoided, and the rendering efficiency of the industrial software graphical interface can be improved. Through the protocol conversion capability of the Guacd cluster, the RDP session channel can be established, which can fully utilize the hardware acceleration characteristics of the Windows system remote desktop to realize high frame rate graphical instruction transmission.
[0065] The traditional experimental sandbox configuration method relies on manual setting of virtual machine parameters, and has problems of low configuration efficiency and insufficient standardization. In a multi-user concurrent scenario, repetitive operations can easily lead to configuration errors or resource allocation conflicts. Based on this, an optional embodiment of the present application is proposed.
[0066] Reference Figure 2 , Figure 2 is a schematic diagram of one specific embodiment of step S101 of the remote control method of the experimental sandbox in the embodiments of the present application, and step S101 further includes the following specific embodiments.
[0067] In step S1011, the virtual machine image configuration parameters are retrieved from the preset template library according to the experiment identifier associated with the identity information.
[0068] In an embodiment of the present application, when receiving an experiment request initiated by the user terminal, the experiment identifier (such as the experiment ID or course code) carried in the request is extracted and associated with the user identity information.
[0069] Subsequently, the corresponding virtual machine image configuration parameters are retrieved from the preset template library based on the experiment identifier. Specifically, the template library stores standardized virtual machine configuration templates (which can include operating system version, pre-installed software package, resource quota, etc.) under different experiment scenarios, and the target template is quickly located through key-value matching to ensure the standardization of the experiment environment configuration.
[0070] In step S1012, a virtual machine instance is generated according to the configuration parameters, and an experiment-specific dynamic credential is injected to obtain an experiment sandbox, and the validity period of the dynamic credential is bound to the timeliness of the experiment request.
[0071] In the embodiment of the application, according to the configuration parameters retrieved, a virtual machine instance is created through a cloud platform interface, and an initialization operation (such as disk mounting and network configuration) is automatically performed. In the virtual machine startup process, an experiment-specific dynamic credential (such as a randomly generated RDP connection password or token) is generated, and the validity period of the credential is bound to the timeliness of the experiment request (such as a course time window or a user reservation period). The dynamic credential is injected into the virtual machine metadata through a secure channel and stored in an encrypted cache database, and only access is allowed within the experiment validity period, and it is automatically invalidated after expiration. This enables on-demand creation of experiment environments and automated management of temporary credentials, effectively avoiding security risks associated with static passwords.
[0072] In the embodiment of the application, the template-based configuration driven by the experiment identifier and the dynamic credential injection mechanism significantly improve the deployment efficiency and security of the experiment sandbox.
[0073] The traditional NoVNC technology relies on the VNC protocol for remote connection, but the VNC protocol itself lacks native encryption support, and usually requires additional configuration of SSH tunnel or third-party encryption tools, resulting in high deployment complexity and risk of configuration omission. Based on this, an optional embodiment is proposed.
[0074] Step S101 also includes the following specific implementation.
[0075] In step S1013, an initial RDP session channel is established with the experiment sandbox through the Guacd instance and the experiment sandbox connection information.
[0076] In the embodiment of the application, an RDP protocol connection request is initiated with the experiment sandbox through the selected Guacd instance and the experiment sandbox connection information, and a handshake negotiation is performed based on the Windows system native remote desktop service.
[0077] Specifically, the Guacd instance sends a session initialization instruction to the target virtual machine through the experimental sandbox connection information (including IP address, RDP port and dynamic credential). After the virtual machine responds, the two parties complete protocol version negotiation and function set confirmation, and establish an unencrypted initial RDP session channel.
[0078] At this stage, the Guacd instance synchronously creates a protocol conversion buffer for subsequent bidirectional forwarding of instruction sets.
[0079] Step S1014, the initial RDP session channel is end-to-end encrypted to obtain an RDP session channel.
[0080] In the embodiment of the application, the initial RDP session channel is encrypted and reinforced. The TLS (Transport Layer Security) protocol is used to implement end-to-end encryption through a bidirectional certificate verification mechanism.
[0081] Specifically, the Guacd instance sends an encrypted handshake request to the experimental sandbox, and the two parties exchange digital certificates and verify the legality; based on the TLS protocol version negotiation encryption suite, a session key is generated; the plaintext data stream of the initial RDP session is converted into an encrypted data packet, which is transmitted through an encrypted tunnel. The encrypted RDP session channel supports data integrity and confidentiality protection, and can prevent man-in-the-middle attacks or data eavesdropping.
[0082] In the embodiment of the application, the security of the RDP session channel is strengthened through end-to-end encryption technology, which can solve the data leakage risk of the traditional remote desktop protocol in the unencrypted scenario.
[0083] In the traditional NoVNC technology, user input events need to be transmitted to the remote desktop through the VNC protocol, and the VNC protocol has limited support for complex operation instructions, which can easily lead to instruction loss or response delay. Based on this, an optional embodiment is proposed in the application.
[0084] Reference Figure 3 , Figure 3 This is a specific embodiment diagram of step S102 of the remote control method of the experimental sandbox in the embodiment of the application. Step S102 further includes the following specific embodiments.
[0085] Step S1021, when the captured user input event obtains a trigger instruction, the trigger instruction is converted into a Guacamole instruction set.
[0086] In an embodiment of the present application, the input events of the user end are captured in real time by a browser event listening layer, including keyboard key events, mouse movement / click events, and clipboard operations (such as copy and paste). After capture, the event module standardizes the original event data (such as coordinate normalization and key value encoding conversion), and serializes it into the corresponding instruction format according to the Guacamole protocol specification. For example:
[0087] Keyboard events are mapped to key instructions (including press / release status and virtual key code);
[0088] Mouse events are mapped to mouse instructions (including coordinate position, click type, and scroll wheel offset);
[0089] Clipboard events are mapped to clipboard instructions (supporting bidirectional synchronization of text / image data).
[0090] In step S1022, the Guacamole instruction set is transmitted to the experimental sandbox through the RDP session channel.
[0091] In an embodiment of the present application, the serialized Guacamole instruction set is encapsulated as a data frame conforming to the WebSocket protocol, and is transmitted to the target Guacd instance through the established RDP session channel (after end-to-end encryption). After receiving the instructions, the Guacd instance parses the instruction content, converts it to a format supported by the native RDP protocol (such as the keyboard scan code and mouse absolute coordinate recognized by the Windows Remote Desktop Service), and forwards it to the experimental sandbox virtual machine for execution. This process ensures low-latency transmission of user operation instructions and protocol compatibility.
[0092] The graphical output data generated by the experimental sandbox virtual machine after executing the instructions is transmitted back to the Guacd instance through the RDP protocol. The Guacd instance re-encapsulates the graphical data as display instructions of the Guacamole protocol, and transmits it back to the user end through the encrypted channel. The connection module of the front-end system renders the remote desktop screen in real time according to the received instructions, forming a complete operation interaction loop.
[0093] In an embodiment of the present application, the standardized conversion and encrypted transmission mechanism of the Guacamole instruction set can significantly improve the execution efficiency and security of user operation instructions. The unified conversion of heterogeneous input events into the Guacamole instruction set can avoid the instruction compatibility problem of different protocols (such as VNC / RDP) in traditional solutions.
[0094] The traditional remote desktop scheme (such as NoVNC) usually adopts a fixed interval retry strategy when the network is abnormal, which causes the reconnection frequency to be inconsistent with the actual recovery state of the network, and easily causes resource waste or reconnection failure. Based on this, an optional embodiment is provided.
[0095] Reference Figure 4 , Figure 4 For a specific embodiment of step S103 of the remote control method of the experimental sandbox in the embodiment of the application, step S103 further includes the following specific implementation.
[0096] Step S1031, when detecting that the network exception causes the connection to be interrupted, performing a reconnection operation, and dynamically calculating a reconnection waiting interval according to a historical failure number.
[0097] In the embodiment of the application, the network state of the RDP session channel is continuously monitored (such as packet round-trip delay, packet loss rate and connection heartbeat response), when a continuous timeout or communication interruption event is detected, it is determined that the network is abnormal and the reconnection process is triggered.
[0098] Specifically, the abnormal state is confirmed through a preset threshold condition (such as 3 consecutive heartbeat losses), and the context information of this interruption (such as interruption timestamp, session ID and failure reason code) is recorded.
[0099] Step S1032, maintaining the experimental environment running state during the execution of the reconnection operation, and maintaining the session with the Guacd cluster through the heartbeat packet algorithm.
[0100] In the embodiment of the application, based on the historical reconnection failure number, the waiting interval of this reconnection is dynamically calculated through an exponential backoff algorithm. For example, the first reconnection waiting time is a reference value (such as 1 second); each time the failure number is increased, the waiting interval is adjusted according to an exponential function, and a maximum waiting threshold is set to avoid infinite delay; a random disturbance value is added to the calculated interval to avoid resource competition caused by simultaneous reconnection of multiple users. After the calculation is completed, the reconnection request is automatically initiated after the waiting interval expires, and the WebSocket connection with the target Guacd instance and the RDP session channel are tried to be rebuilt.
[0101] During the reconnection process, a suspension instruction is sent to the front-end experimental sandbox page to pause the graphical interface refresh but keep the background process running, which can avoid the loss of experimental operation caused by connection interruption; a heartbeat packet is periodically sent to the Guacd cluster through an auxiliary link independent of the main channel to maintain the session activity and synchronize the reconnection progress state; the instruction sequence and picture state of the last successful interaction are cached, and are synchronized to the user end after the channel is restored, to ensure operation continuity.
[0102] In the embodiment of the present application, through dynamic reconnection and experimental environment state maintenance, the robustness in network fluctuation scenarios can be significantly improved.
[0103] The traditional NoVNC technology relies on fixed resolution or manual adjustment strategy, resulting in problems such as picture stretching, element blurring or operation area truncation when students access the experimental environment on different terminals. Based on this, an optional embodiment is proposed in the present application.
[0104] Step S103 further includes the following specific embodiments.
[0105] Step S201, real-time monitoring of the screen size and pixel density parameters of the user terminal.
[0106] In the embodiment of the present application, the screen size (physical resolution) and pixel density (DPI) of the user terminal are continuously collected through the browser API. The parameter values are updated at a fixed frequency (such as 10 times per second), and the normalized data (such as converted to standard pixel units) are pushed to the resolution adaptation engine.
[0107] Step S202, dynamically generating adaptation parameters according to the screen size, pixel density parameters and preset resolution mapping rules.
[0108] In the embodiment of the present application, based on the collected screen parameters, the resolution mapping rule library is combined to generate adaptation parameters.
[0109] Step S203, issuing resolution configuration instructions to the experimental sandbox according to the adaptation parameters.
[0110] In the embodiment of the present application, the generated adaptation parameters are packaged as resolution configuration instructions (such as Guacamole's size instruction, the parameters are the width and height of the resolution), which are issued to the experimental sandbox virtual machine through the RDP session channel. After receiving the instructions, the virtual machine calls the underlying graphics service interface to adjust the display resolution of the remote desktop in real time. After the adjustment is completed, the picture is re-rendered, and the adaptive layout update of the user terminal browser viewport is triggered.
[0111] In the embodiment of the present application, through the dynamic resolution adaptation mechanism of terminal perception, the core pain points of traditional remote desktop technology in multi-device compatibility are solved. According to the screen parameters, the resolution is automatically optimized, which can effectively avoid the interface misplacement or scroll bar interference caused by manual adjustment of students.
[0112] The traditional Guacd cluster deployment often uses static polling or random allocation strategy, which cannot perceive the real-time load state of the nodes, resulting in unbalanced resource allocation. Based on this, an optional embodiment is proposed in the present application.
[0113] Step S102 further includes the following specific embodiments.
[0114] Step S1024, real-time acquisition of CPU occupation rate, memory usage rate and active connection number of Guacd cluster.
[0115] In the embodiment of the application, the running state data of each node is periodically polled by the Guacd cluster management module.
[0116] Specifically, the current CPU usage percentage is acquired through an operating system interface; the ratio of used memory to total memory is calculated to monitor the memory pressure of the node; and the total number of RDP session connections currently maintained by each Guacd instance is counted.
[0117] The acquisition module stores the above-mentioned indexes in the cache database according to the time stamp and marks the node identifier, thereby providing real-time data support for subsequent weight calculation.
[0118] Step S1025, dynamic calculation of the weight value of each Guacd instance in the Guacd cluster according to the CPU occupation rate, memory usage rate and active connection number.
[0119] In the embodiment of the application, the weight value of each Guacd instance is dynamically calculated by a weighted comprehensive evaluation algorithm based on the collected index data.
[0120] Specifically, the CPU occupation rate, memory usage rate and active connection number are respectively converted into standardized values in the range of 0-1 to eliminate the dimensional difference; the weight coefficients of each index are set according to the performance bottleneck characteristics of the cluster (for example, CPU accounts for 40%, memory accounts for 30% and connection number accounts for 30%), and the priority reflects the system resource sensitivity.
[0121] The instance score is generated according to the weight value = CPU standardized value * 0.4 + memory standardized value * 0.3 + connection number standardized value * 0.3, and the lower the value, the lighter the load. The calculation result is arranged in ascending order to generate an instance priority queue.
[0122] Step S1026, determination of a target Guacd instance from each Guacd instance according to the weight value of each Guacd instance.
[0123] In the embodiment of the application, the Guacd instance with the minimum weight value is selected from the priority queue as the target node.
[0124] Optionally, the index acquisition time stamp is checked, and if it exceeds the threshold, reacquisition is triggered; if the target instance heartbeat detection fails or the weight is abnormal (for example, CPU > 95%), it is automatically degraded to a suboptimal node; when the weights of multiple instances are the same, a polling strategy is used to distribute connections to avoid local overload. After the selected instance is selected, the cluster state database is updated and a session channel is established.
[0125] In the embodiment of the present application, through the multi-dimensional index dynamic weight calculation and real-time load balancing strategy, the resource utilization and stability of the Guacd cluster can be significantly improved.
[0126] As shown in Figure 5 Fig. 5 is a schematic diagram of a terminal device according to an embodiment of the present application. The terminal device 500 can include a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501, such as a remote control program of the experimental sandbox. The processor 501 implements the steps in the above-mentioned remote control embodiments of the experimental sandbox when executing the computer program 503.
[0127] The computer program can be divided into one or more modules / units, one or more modules / units are stored in the memory 502 and executed by the processor 501 to complete the present application. One or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which is used to describe the execution process of the computer program in the terminal device.
[0128] The terminal device can include, but is not limited to, the processor 501 and the memory 502. Those skilled in the art can understand that Figure 5 The terminal device is only an example and does not constitute a limitation on the terminal device, and can include more or fewer components than the diagram, or combine certain components, or different components, for example, the terminal device can also include an input / output device, a network access device, a bus, etc.
[0129] The processor 501 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0130] The memory 502 can be an internal storage unit of the terminal device, for example, a hard disk or a memory of the terminal device. The memory 502 can also be an external storage device of the terminal device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Further, the memory 502 can include both the internal storage unit and the external storage device of the terminal device. The memory 502 is used to store computer programs and other programs and data required by the terminal device. The memory 502 can also be used to temporarily store data that has been output or will be output.
[0131] It should be noted that, for the convenience and brevity of description, the structure of the terminal device described above can also refer to the specific description of the structure in the method embodiments, which will not be described here.
[0132] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in the remote control method of the experimental sandbox.
[0133] The embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal can implement the steps in the remote control method of the experimental sandbox.
[0134] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0135] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0136] In the embodiments provided by the present application, it should be understood that the disclosed terminal device and method can be implemented by other ways. For example, the terminal device embodiments described above are only schematic. In addition, the mutual coupling or direct coupling or communication connection between the shown or discussed elements can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0137] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e. may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0138] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0139] The integrated module / unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the contents included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0140] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A remote control method for an experimental sandbox, characterized in that, The method comprises the steps of: If a user terminal initiates an experiment request, an experiment sandbox is configured according to identity information carried in the experiment request, and experiment sandbox connection information corresponding to the identity information is queried; An active target Guacd instance is selected from a Guacd cluster, and an RDP session channel with the experiment sandbox is established according to the target Guacd instance and the experiment sandbox connection information; The RDP session channel is used to respond to the triggering instruction of the user terminal.
2. The method of claim 1, wherein the remote control of the experimental sandbox is performed by a user through a web interface. The step of configuring the experiment sandbox according to the identity information carried in the experiment request comprises the steps of: According to the experiment identifier associated with the identity information, a virtual machine image configuration parameter is retrieved from a preset template library; According to the configuration parameter, a virtual machine instance is generated, and an experiment-specific dynamic credential is injected to obtain the experiment sandbox, and the validity period of the dynamic credential is bound to the timeliness of the experiment request.
3. The method of claim 1, wherein the remote control of the experimental sandbox is performed by a user through a web interface. The step of establishing the RDP session channel with the experiment sandbox according to the target Guacd instance and the experiment sandbox connection information comprises the steps of: An initial RDP session channel with the experiment sandbox is established through the Guacd instance and the experiment sandbox connection information; The initial RDP session channel is end-to-end encrypted to obtain the RDP session channel.
4. The method of claim 1, wherein the remote control of the experimental sandbox is performed by a user through a web interface. The step of responding to the triggering instruction of the user terminal according to the RDP session channel comprises the steps of: When the triggering instruction is obtained through the captured user input event, the triggering instruction is converted into a Guacamole instruction set; The Guacamole instruction set is transmitted to the experiment sandbox through the RDP session channel.
5. The method of claim 1, wherein the remote control of the experimental sandbox is performed by a user through a web interface. After the step of responding to the triggering instruction of the user terminal according to the RDP session channel, the method further comprises the steps of: When a network anomaly is detected to cause a connection interruption, a reconnection operation is performed, and a reconnection waiting interval is dynamically calculated according to a historical failure number; During the execution of the reconnection operation, the experiment environment is kept in a running state, and a heartbeat packet algorithm is used to maintain a session with the Guacd cluster.
6. The method of claim 1, wherein the remote control of the experimental sandbox is performed by a user through a web interface. After the step of responding to the triggering instruction of the user terminal according to the RDP session channel, the method further comprises the steps of: Screen size and pixel density parameters of the user terminal are monitored in real time; Adaptation parameters are dynamically generated according to the screen size and the pixel density parameters; Resolution configuration instructions are issued to the experiment sandbox according to the adaptation parameters.
7. The method of claim 1, wherein the remote control of the experimental sandbox is performed by a user through a web interface. The step of querying the experiment sandbox connection information corresponding to the identity information comprises the steps of: According to the identity information, an experiment information cache database is queried to obtain the experiment sandbox connection information.
8. The method of claim 1, wherein the remote control of the experimental sandbox is performed by a user through a web interface. The step of selecting an active target Guacd instance from a Guacd cluster comprises the steps of: CPU occupancy, memory usage and active connection numbers of the Guacd cluster are obtained in real time; According to the CPU occupancy, the memory usage and the active connection numbers, weight values of each Guacd instance in the Guacd cluster are dynamically calculated; According to the weight values of each Guacd instance, the target Guacd instance is determined from the Guacd instances.
9. A terminal device, comprising: A computer program product comprising a memory, a processor, and a computer program stored in the memory and loadable on the processor, the processor implementing the steps of the method for the remote control of an experimental sandbox according to any one of claims 1 to 8 when running the computer program.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program product, when run by the processor, implements the steps of the method for the remote control of an experimental sandbox according to any one of claims 1 to 8.
Citation Information
Patent Citations
Automated keyboard mapping for virtual desktops
CN113454577A
Desktop cloud system and related method, device, equipment and medium
CN114356465A