Remote control method of experiment sandbox, terminal equipment and storage medium
Through the load balancing mechanism and RDP protocol of Guacd cluster, the optimal instance is dynamically selected to establish an RDP session channel, solving the problem of inefficient graphics rendering in traditional NoVNC technology, and achieving efficient graphical interface rendering and high frame rate graphics instruction transmission.
Patent Information
- Application Number
- CN202510813561.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-06-18
AI Technical Summary
Traditional HTML5-based NoVNC technology requires additional deployment of VNC servers in Windows system environment, resulting in inefficient graphics rendering and unable to meet the efficient graphics rendering requirements of industrial software teaching and training.
Through the load balancing mechanism of the Guacd cluster, dynamically select the optimal instance, establish an RDP session channel, directly call the Windows system native remote desktop service, avoid redundancy of the VNC server, and use the Guacd cluster's protocol conversion capabilities to build an RDP session channel.
It improves the rendering efficiency of industrial software graphics interfaces, realizes the transmission of high frame rate graphics instructions, and solves the problem of inefficient graphics rendering in traditional NoVNC technology.
Smart Images

Figure CN120390031A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing, and particularly relates to a remote control method, a terminal device, and a storage medium for an experimental sandbox. Background Art
[0002] With the increasing demand for industrial software teaching and training, students need to complete complex operation tasks by remotely accessing the experimental sandbox environment.
[0003] The traditional method is implemented based on the HTML5-based NoVNC technology. Although it does not require a local client, it needs to deploy an additional VNC server in the Windows system environment, resulting in low graphics rendering efficiency. A new technical means is needed to solve the above technical problems. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a remote control method, a terminal device, and a storage medium for an experimental sandbox, which can solve the problem of low graphics rendering efficiency in related technologies.
[0005] The first aspect of the present invention provides a remote control method for an experimental sandbox, including: If an experimental request initiated by a user end is received, configure the experimental sandbox according to the identity information carried in the experimental request, and query the experimental sandbox connection information corresponding to the identity information; Select an active target Guacd instance in the Guacd cluster, and establish an RDP session channel with the experimental sandbox according to the target Guacd instance and the experimental sandbox connection information; Respond to a trigger instruction of the user end according to the RDP session channel.
[0006] Optionally, in the first implementation manner of the first aspect of the present invention, the step of dynamically configuring a virtual machine according to the identity information carried in the experimental request includes: Retrieve virtual machine image configuration parameters from a preset template library according to the experimental identifier associated with the identity information; Generate a virtual machine instance according to the configuration parameters, and inject an experiment-specific dynamic credential to obtain the experimental sandbox, and the validity period of the dynamic credential is bound to the timeliness of the experimental request.
[0007] Optionally, in the second implementation manner of the first aspect of the present invention, the step of establishing an RDP session channel with the experimental sandbox according to the target Guacd instance and the experimental sandbox connection information includes: Establish an initial RDP session channel with the experimental sandbox through the Guacd instance and the experimental sandbox connection information; Perform end-to-end encryption on the initial RDP session channel to obtain the RDP session channel.
[0008] Optionally, in the third implementation manner of the first aspect of the present invention, the step of responding to the trigger instruction of the user terminal according to the RDP session channel includes: When a trigger instruction is obtained from the captured user input event, convert the trigger instruction into a Guacamole instruction set; Transmit the Guacamole instruction set to the experimental sandbox through the RDP session channel.
[0009] Optionally, in the fourth implementation manner of the first aspect of the present invention, after the step of responding to the trigger instruction of the user terminal according to the RDP session channel, the method further includes: When a connection interruption is detected due to a network anomaly, perform a reconnection operation and dynamically calculate a reconnection waiting interval based on the historical failure count; During the execution of the reconnection operation, maintain the running state of the experimental environment and maintain a session with the Guacd cluster through a heartbeat packet algorithm.
[0010] Optionally, in the fifth implementation manner of the first aspect of the present invention, after the step of responding to the trigger instruction of the user terminal according to the RDP session channel, the method further includes: Real-time monitor the screen size and pixel density parameters of the user terminal; Dynamically generate adaptation parameters according to the screen size and the pixel density parameters; Send a resolution configuration instruction to the experimental sandbox according to the adaptation parameters.
[0011] Optionally, in the sixth implementation manner of the first aspect of the present invention, the step of querying the experimental sandbox connection information corresponding to the identity information includes: Query the experimental information cache database according to the identity information to obtain the experimental sandbox connection information.
[0012] Optionally, in the seventh implementation manner of the first aspect of the present invention, the step of selecting an active target Guacd instance in the Guacd cluster includes: Real-time obtain the CPU occupancy rate, memory usage rate, and active connection count of the Guacd cluster; Dynamically calculate the weight value of each Guacd instance in the Guacd cluster according to the CPU occupancy rate, the memory usage rate, and the active connection count; Determine the target Guacd instance among the various Guacd instances according to the weight values of the various Guacd instances.
[0013] In a second aspect, an embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned remote control method of the experimental sandbox are implemented.
[0014] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned remote control method of the experimental sandbox are implemented.
[0015] In a fourth aspect, an embodiment of the present invention provides a computer program product. When the computer program product runs on a terminal device, the terminal device is enabled to execute the above-mentioned remote control method of the experimental sandbox.
[0016] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: By dynamically selecting the optimal instance based on the load balancing mechanism of the Guacd cluster to establish an RDP session channel, the core problem of low graphic rendering efficiency in the traditional NoVNC technology can be effectively solved. Specifically, by directly invoking the native remote desktop service of the Windows system through the RDP protocol, the technical redundancy of additionally deploying a VNC server in the traditional solution can be avoided, and the rendering efficiency of the industrial software graphic interface can be improved. By constructing an RDP session channel through the protocol conversion ability of the Guacd cluster, the hardware acceleration characteristics of the Windows system remote desktop can be fully utilized to achieve high-frame-rate graphic instruction transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following-described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 It is a schematic diagram of an embodiment of the remote control method of the experimental sandbox in the embodiments of the present invention; Figure 2 It is a schematic diagram of a specific embodiment of step S101 of the remote control method of the experimental sandbox in the embodiments of the present invention; Figure 3 It is a schematic diagram of a specific embodiment of step S102 of the remote control method of the experimental sandbox in the embodiments of the present invention; Figure 4 It is a schematic diagram of a specific embodiment of step S103 of the remote control method of the experimental sandbox in the embodiments of the present invention; Figure 5Schematic diagram of an embodiment of the terminal device in an embodiment of the present invention. Detailed implementation manners
[0019] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention 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 invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
[0020] It should be noted that the terms "include", "comprise" and "have" and any variations thereof in the description and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusion. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products or devices. In the claims, description and drawings of the present invention, relational terms such as "first" and "second" are only used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such actual relationship or order between these entities / operations / objects.
[0021] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.
[0022] With the increasing demand for industrial software teaching and training, students need to complete complex operation tasks by remotely accessing the experimental sandbox environment.
[0023] The traditional method is implemented based on the NoVNC technology of HTML5. Although it does not require a local client, it needs to deploy an additional VNC server in the Windows system environment, resulting in low graphics rendering efficiency. A new technical means is needed to solve the above technical problems.
[0024] In view of this, embodiments of the present invention provide a method for remotely controlling an experimental sandbox, a terminal device, and a storage medium. By dynamically selecting an optimal instance based on the load balancing mechanism of the Guacd cluster to establish an RDP session channel, the core problem of low graphics rendering efficiency in traditional NoVNC technology can be effectively solved. Specifically, by directly invoking the native remote desktop service of the Windows system through the RDP protocol, the technical redundancy of additionally deploying a VNC server in the traditional solution can be avoided, and the rendering efficiency of the industrial software graphical interface can be improved. By constructing an RDP session channel through the protocol conversion ability of the Guacd cluster, the hardware acceleration characteristics of the Windows system remote desktop can be fully utilized to achieve high-frame-rate graphic instruction transmission.
[0025] To illustrate the technical solution of the present invention, the following will be described through specific embodiments.
[0026] Figure 1 The figure shows a schematic diagram of the implementation process of a method for remotely controlling an experimental sandbox provided by an embodiment of the present invention. This method can be applied to a terminal device. The terminal device can be a mobile phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, etc.
[0027] Specifically, the above method for remotely controlling an experimental sandbox may include the following steps S101 to S103.
[0028] Step S101, if an experimental request initiated by the user end is received, configure the experimental sandbox according to the identity information carried in the experimental request, and query the experimental sandbox connection information corresponding to the identity information.
[0029] In an embodiment of the present invention, when the user end initiates an experimental request, the identity information (such as user ID, session token, etc.) carried in the request is parsed, and its validity is verified by an authentication module.
[0030] Specifically, the session ID parameter is extracted from the request header and compared with the session records stored in the cache database to verify the user identity and the timeliness of the token. If the authentication fails, the connection process is immediately terminated; if the authentication passes, the connection information is obtained from the created experimental sandbox records according to the combination key of the user ID and the experimental ID.
[0031] According to the authenticated identity information, the pre-generated experimental sandbox connection information is queried from the experimental information cache database. Specifically, according to the identity information, the experimental information cache database is queried to obtain the experimental sandbox connection information.
[0032] Specifically, the cache database is retrieved using the combination key as the index. If it does not exist, the experimental environment is created in real time through the cloud platform API and the connection parameters are stored. The returned structured data includes the protocol type (fixed as RDP), access credentials, and terminal address.
[0033] Step S102: Select an active target Guacd instance in the Guacd cluster, and establish an RDP session channel with the experimental sandbox based on the target Guacd instance and the experimental sandbox connection information.
[0034] In an embodiment of the present invention, after the experimental sandbox configuration is completed, an active target Guacd instance is screened from the Guacd cluster through the load balancing module.
[0035] Specifically, the running state indicators of each node in the cluster are collected in real time (including CPU occupancy rate, memory usage rate, and current active connection count), the weight values of each instance are 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, a communication link is established between the Web system and the Guacd instance, and an initial RDP session channel is established with the experimental sandbox virtual machine through the Guacd protocol conversion middleware.
[0036] Specifically, based on the experimental sandbox connection information, the target Guacd instance is driven to establish a native RDP connection with the experimental sandbox, forming an RDP session channel.
[0037] To further ensure the security of data transmission, end-to-end encryption processing (such as the TLS protocol) is performed on the initial channel to form an encrypted RDP session channel, ensuring the secure transmission of user operation instructions and remote desktop images.
[0038] Step S103: Respond to the trigger instruction of the client according to the RDP session channel.
[0039] In an embodiment of the present invention, through the established RDP session channel, the input events of the client are captured in real time (such as keyboard strokes, mouse movements, and clipboard operations). The event module of the front-end system serializes the original event data into a Guacamole protocol instruction set (such as a keyboard event is mapped to a key instruction, and a mouse click is mapped to a mouse instruction), and pushes the instruction set to the target Guacd instance through a WebSocket long connection.
[0040] After receiving the instruction, the Guacd instance converts it into a native RDP protocol instruction and forwards it to the experimental sandbox virtual machine for execution. At the same time, the graphic output data of the experimental sandbox is transmitted back to the client through the reverse path and is rendered in real time by the connection module of the front-end system, forming a two-way interaction closed loop.
[0041] During the entire interaction process, continuously monitor the channel status. When a network anomaly is detected, trigger the exponential backoff reconnection mechanism, and dynamically adjust the reconnection strategy to maintain the continuity of the experimental process.
[0042] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: By dynamically selecting the optimal instance based on the load balancing mechanism of the Guacd cluster to establish an RDP session channel, the core problem of low graphics rendering efficiency in traditional NoVNC technology can be effectively solved. Specifically, by directly invoking the native remote desktop service of the Windows system through the RDP protocol, the technical redundancy of deploying an additional VNC server in the traditional solution can be avoided, and the rendering efficiency of the industrial software graphical interface can be improved. By constructing an RDP session channel through the protocol conversion ability of the Guacd cluster, the hardware acceleration characteristics of the Windows system remote desktop can be fully utilized to achieve high-frame-rate graphic instruction transmission.
[0043] Traditional experimental sandbox configuration methods rely on manual setting of virtual machine parameters by humans, suffering from problems such as low configuration efficiency and insufficient standardization. In a multi-user concurrent scenario, repetitive operations are prone to configuration errors or resource allocation conflicts. Based on this, an alternative embodiment of the present invention is proposed.
[0044] Refer to Figure 2 , Figure 2 It is a schematic diagram of a specific embodiment of step S101 of the remote control method of the experimental sandbox in the embodiments of the present invention. Step S101 further includes the following specific implementations.
[0045] Step S1011, according to the experimental identifier associated with the identity information, retrieve the virtual machine image configuration parameters from the preset template library.
[0046] In the embodiments of the present invention, when an experimental request initiated by the user terminal is received, extract the experimental identifier (such as an experiment ID or a course code) carried in the request, and associate it with the user identity information.
[0047] Subsequently, retrieve the corresponding virtual machine image configuration parameters from the preset template library based on the experimental identifier. Specifically, the template library stores standardized virtual machine configuration templates for different experimental scenarios (which may include parameters such as operating system version, pre-installed software packages, and resource quotas), and quickly locates the target template through key-value matching to ensure the standardization of the experimental environment configuration.
[0048] Step S1012, generate a virtual machine instance according to the configuration parameters, and inject an experiment-specific dynamic credential to obtain an experimental sandbox. The validity period of the dynamic credential is bound to the timeliness of the experimental request.
[0049] In an embodiment of the present invention, according to the retrieved configuration parameters, a virtual machine instance is created through a cloud platform interface, and initialization operations (such as disk mounting and network configuration) are automatically performed. During the startup process of the virtual machine, 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, allowing access only within the experiment validity period and automatically expiring after expiration. To achieve the on-demand creation of the experimental environment and the automated management of temporary credentials, effectively avoiding the security risks brought by static passwords.
[0050] In the embodiment of the present invention, through the template-based configuration and dynamic credential injection mechanism driven by the experiment identifier, the deployment efficiency and security of the experimental sandbox are significantly improved.
[0051] Traditional NoVNC technology relies on the VNC protocol for remote connection, and the VNC protocol itself lacks native strong encryption support. Usually, additional SSH tunnels or third-party encryption tools need to be configured, resulting in high deployment complexity and the risk of configuration oversights. Based on this, an alternative embodiment of the present invention is proposed.
[0052] Step S101 further includes the following specific embodiments.
[0053] Step S1013, establish an initial RDP session channel with the experimental sandbox through the Guacd instance and the experimental sandbox connection information.
[0054] In an embodiment of the present invention, through the selected Guacd instance and the experimental sandbox connection information, an RDP protocol connection request is initiated with the experimental sandbox, and handshake negotiation is performed based on the native remote desktop service of the Windows system.
[0055] 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 the protocol version negotiation and function set confirmation, and establish an unencrypted initial RDP session channel.
[0056] At this stage, the Guacd instance synchronously creates a protocol conversion buffer for the two-way forwarding of subsequent instruction sets.
[0057] Step S1014, perform end-to-end encryption on the initial RDP session channel to obtain an RDP session channel.
[0058] In an embodiment of the present invention, the initial RDP session channel is encrypted and strengthened. The TLS (Transport Layer Security) protocol is adopted to implement end-to-end encryption through a two-way certificate verification mechanism.
[0059] Specifically, the Guacd instance sends an encrypted handshake request to the experimental sandbox, and both parties exchange digital certificates and verify their legitimacy; based on the TLS protocol version, the encryption suite is negotiated to generate a session key; the plaintext data stream of the initial RDP session is converted into an encrypted data packet and transmitted through the encrypted tunnel. The encrypted RDP session channel supports data integrity and confidentiality protection, and can prevent man-in-the-middle attacks or data eavesdropping.
[0060] In an embodiment of the present invention, 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.
[0061] In the traditional NoVNC technology, user input events need to be transmitted to the remote desktop through the VNC protocol, but the VNC protocol has limited support for complex operation instructions, which is prone to instruction loss or response delay. Based on this, an alternative embodiment of the present invention is proposed.
[0062] Refer to Figure 3 , Figure 3 FIG. is a schematic diagram of a specific embodiment of step S102 of the remote control method for the experimental sandbox in an embodiment of the present invention, and step S102 further includes the following specific embodiments.
[0063] Step S1021, when the captured user input event obtains a trigger instruction, the trigger instruction is converted into a Guacamole instruction set.
[0064] In an embodiment of the present invention, the input events of the user side are captured in real time through the 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 performs standardization processing on the original event data (such as coordinate normalization, key value encoding conversion), and serializes it into the corresponding instruction format according to the Guacamole protocol specification. For example: Keyboard events are mapped to key instructions (including press / release status, virtual key code); Mouse events are mapped to mouse instructions (including coordinate position, click type, and scroll wheel offset); Clipboard events are mapped to clipboard instructions (supporting two-way synchronization of text / image data).
[0065] Step S1022, through the RDP session channel, the Guacamole instruction set is transmitted to the experimental sandbox.
[0066] In an embodiment of the present invention, the serialized Guacamole instruction set is encapsulated into a data frame conforming to the WebSocket protocol and transmitted to the target Guacd instance through an established RDP session channel (end-to-end encrypted). After receiving the instruction, the Guacd instance parses the instruction content, converts it into a format supported by the native RDP protocol (such as the keyboard scan code and mouse absolute coordinates recognized by the Windows Remote Desktop Service), and forwards it to the experimental sandbox virtual machine for execution. This process can ensure the low-latency transmission and protocol compatibility of user operation instructions.
[0067] The graphic output data generated by the experimental sandbox virtual machine after executing the instruction is transmitted back to the Guacd instance through the RDP protocol in reverse. The Guacd instance repackages the graphic data into a display instruction of the Guacamole protocol and transmits it back to the user side through the encrypted channel. The connection module of the front-end system renders the remote desktop screen in real time according to the received instruction, forming a complete operation interaction loop.
[0068] In the embodiment of the present invention, through the standardized conversion and encrypted transmission mechanism of the Guacamole instruction set, the execution efficiency and security of user operation instructions can be significantly improved. Unifying heterogeneous input events into the Guacamole instruction set can avoid the instruction compatibility problems of different protocols (such as VNC / RDP) in traditional solutions.
[0069] Traditional remote desktop solutions (such as NoVNC) usually adopt a fixed-interval retry strategy when the network is abnormal, resulting in a mismatch between the reconnection frequency and the actual network recovery status, which is likely to cause resource waste or reconnection failure. Based on this, an alternative embodiment of the present invention is proposed.
[0070] Refer to Figure 4 , Figure 4 FIG. is a schematic diagram of a specific embodiment of step S103 of the remote control method of the experimental sandbox in the embodiment of the present invention, and step S103 further includes the following specific embodiments.
[0071] Step S1031, when it is detected that the connection is interrupted due to network abnormality, perform a reconnection operation and dynamically calculate the reconnection waiting interval according to the historical failure times.
[0072] In an embodiment of the present invention, the network status of the RDP session channel (such as the round-trip delay of data packets, packet loss rate, and connection heartbeat response) is continuously monitored. When a continuous timeout or communication interruption event is detected, it is determined that the network is abnormal and the reconnection process is triggered.
[0073] Specifically, the abnormal state is confirmed through a preset threshold condition (such as the loss of 3 consecutive heartbeats), and the context information of this interruption (such as the interruption timestamp, session ID, and failure reason code) is recorded at the same time.
[0074] Step S1032, maintain the running state of the experimental environment during the execution of the reconnection operation, and maintain the session with the Guacd cluster through the heartbeat packet algorithm.
[0075] In an embodiment of the present invention, based on the historical reconnection failure times, the waiting interval for this reconnection is dynamically calculated through the exponential backoff algorithm. For example, the waiting time for the first reconnection is the reference value (such as 1 second); for each additional failure time, the waiting interval is adjusted according to the exponential function, and at the same time, the maximum waiting threshold is set to avoid infinite delay; a random perturbation value is added to the calculated interval to avoid resource competition caused by multiple users reconnecting simultaneously. After the calculation is completed, a reconnection request is automatically initiated after the waiting interval expires, and an attempt is made to reconstruct the WebSocket connection and the RDP session channel with the target Guacd instance.
[0076] 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 operations caused by connection interruption; a heartbeat packet is regularly sent to the Guacd cluster through an auxiliary link independent of the main channel to maintain session activity and synchronize the reconnection progress status; the instruction sequence and the screen state of the last successful interaction are cached, and are preferentially synchronized to the user side after the channel is restored to ensure operation coherence.
[0077] In the embodiment of the present invention, the robustness in the network fluctuation scenario can be significantly improved through dynamic reconnection and maintaining the experimental environment state.
[0078] Traditional NoVNC technology relies on fixed resolution or manual adjustment strategies, resulting in problems such as screen stretching, element blurring, or operation area truncation when students access the experimental environment on different terminals. Based on this, an alternative embodiment of the present invention is proposed.
[0079] After step S103, the following specific embodiments are further included.
[0080] Step S201, monitor the screen size and pixel density parameters of the user side in real time.
[0081] In an embodiment of the present invention, 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) is pushed to the resolution adaptation engine.
[0082] Step S202, dynamically generate adaptation parameters according to the screen size, pixel density parameters, and preset resolution mapping rules.
[0083] In an embodiment of the present invention, adaptation parameters are generated based on the collected screen parameters in combination with a preset resolution mapping rule library.
[0084] Step S203: Send a resolution configuration instruction to the experimental sandbox according to the adaptation parameters.
[0085] In an embodiment of the present invention, the generated adaptation parameters are encapsulated into a resolution configuration instruction (such as the size instruction of Guacamole, and the parameters are the width and height of the resolution), and are sent to the experimental sandbox virtual machine through the RDP session channel. After receiving the instruction, 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 screen is re-rendered, and the adaptive layout update of the user-side browser viewport is triggered.
[0086] In an embodiment of the present invention, through the dynamic resolution adaptation mechanism sensed by the terminal, the core pain points of traditional remote desktop technology in multi-device compatibility are solved. Automatically optimizing the resolution according to the screen parameters can effectively avoid interface misalignment or scroll bar interference caused by students' manual adjustment.
[0087] Traditional Guacd cluster deployment often adopts static polling or random allocation strategies, which cannot sense the real-time load status of nodes, resulting in unbalanced resource allocation. Based on this, an alternative embodiment of the present invention is proposed.
[0088] Step S102 further includes the following specific embodiments.
[0089] Step S1024: Obtain the CPU occupancy rate, memory usage rate, and active connection number of the Guacd cluster in real time.
[0090] In an embodiment of the present invention, the Guacd cluster management module periodically polls the operation status data of each node.
[0091] Specifically, obtain the current CPU usage percentage through the operating system interface; calculate the ratio of the used memory to the total memory to monitor the memory pressure of the node; and count the total number of RDP session connections currently maintained by each Guacd instance.
[0092] The acquisition module stores the above indicators in the cache database according to the time stamp and marks the node identifier to provide real-time data support for subsequent weight calculation.
[0093] Step S1025: Dynamically calculate the weight values of each Guacd instance in the Guacd cluster according to the CPU occupancy rate, memory usage rate, and active connection number.
[0094] In an embodiment of the present invention, based on the collected index data, the weight values of each Guacd instance are dynamically calculated through a weighted comprehensive evaluation algorithm.
[0095] Specifically, the CPU occupancy rate, memory usage rate, and active connection count are respectively converted into standardized values in the range of 0-1 to eliminate the dimension difference; according to the characteristics of the cluster performance bottleneck, the weight coefficients of each index are set (for example, CPU accounts for 40%, memory accounts for 30%, and connection count accounts for 30%), and the priority reflects the sensitivity of system resources.
[0096] Generate an instance score according to the weight value = CPU standardized value * 0.4 + memory standardized value * 0.3 + connection count standardized value * 0.3. The lower the value, the lighter the load. The calculation results are sorted in ascending order to generate an instance priority queue.
[0097] Step S1026, determine the target Guacd instance among each Guacd instance according to the weight value of each Guacd instance.
[0098] In the embodiment of the present invention, the Guacd instance with the smallest weight value is selected from the priority queue as the target node.
[0099] Optionally, check the index collection timestamp. If it exceeds the threshold, trigger re-collection; if the heartbeat detection of the target instance fails or the weight is abnormal (such as CPU > 95%), automatically degrade to the sub-optimal node; when the weights of multiple instances are the same, use a polling strategy to allocate connections to avoid local overload. After selecting the instance, update the cluster status database and establish a session channel.
[0100] In the embodiment of the present invention, through the multi-dimensional index dynamic weight calculation and real-time load balancing strategy, the resource utilization rate and stability of the Guacd cluster can be significantly improved.
[0101] As Figure 5 shown, it is a schematic diagram of a terminal device provided by an embodiment of the present invention. The terminal device 500 may 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 for an experimental sandbox. When the processor 501 executes the computer program 503, the steps in the above-mentioned remote control embodiments of each experimental sandbox are implemented.
[0102] The computer program may 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 invention. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0103] The terminal device may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art can understand that Figure 5The following are merely examples of terminal devices and do not constitute limitations thereto. They may include more or fewer components than shown in the figures, or combine certain components, or have different components. For example, a terminal device may also include input / output devices, network access devices, buses, etc.
[0104] The so-called processor 501 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc.
[0105] The memory 502 may be an internal storage unit of the terminal device, such as the hard disk or memory of the terminal device. The memory 502 may also be an external storage device of the terminal device, such as 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 may also include both an internal storage unit and an 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 may also be used to temporarily store data that has been output or is to be output.
[0106] It should be noted that for the sake of convenience and brevity of description, the structure of the above terminal device may also refer to the specific description of the structure in the method embodiments, which will not be elaborated here.
[0107] An embodiment of the present invention also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in the above remote control method of the experimental sandbox can be implemented.
[0108] An embodiment of the present invention provides a computer program product, and when the computer program product runs on a mobile terminal, the mobile terminal can execute the steps in the above remote control method of the experimental sandbox.
[0109] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0110] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner 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 to exceed the scope of the present invention.
[0111] In the embodiments provided by the present invention, it should be understood that the disclosed terminal devices and methods can be implemented in other ways. For example, the terminal device embodiments described above are merely illustrative. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0114] When the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, 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 content 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.
[0115] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features. And 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 various embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A remote control method for an experimental sandbox, characterized in that, Including: If an experiment request initiated by the client is received, configure an experimental sandbox according to the identity information carried in the experiment request, and query the experimental sandbox connection information corresponding to the identity information; Select an active target Guacd instance in the Guacd cluster, and establish an RDP session channel with the experimental sandbox according to the target Guacd instance and the experimental sandbox connection information; Respond to the trigger instruction of the client according to the RDP session channel.
2. The remote control method of the experimental sandbox according to claim 1, characterized in that, The step of configuring the experimental sandbox according to the identity information carried in the experiment request includes: Retrieve virtual machine image configuration parameters from a preset template library according to the experiment identifier associated with the identity information; Generate a virtual machine instance according to the configuration parameters and inject an experiment-specific dynamic credential to obtain the experimental sandbox, and the validity period of the dynamic credential is bound to the timeliness of the experiment request.
3. The remote control method of the experimental sandbox according to claim 1, characterized in that, The step of establishing an RDP session channel with the experimental sandbox according to the target Guacd instance and the experimental sandbox connection information includes: Establish an initial RDP session channel with the experimental sandbox through the Guacd instance and the experimental sandbox connection information; Perform end-to-end encryption on the initial RDP session channel to obtain the RDP session channel.
4. The remote control method of the experimental sandbox according to claim 1, characterized in that, The step of responding to the trigger instruction of the client according to the RDP session channel includes: When a trigger instruction is obtained from the captured user input event, convert the trigger instruction into a Guacamole instruction set; Transmit the Guacamole instruction set to the experimental sandbox through the RDP session channel.
5. The remote control method of the experimental sandbox according to claim 1, wherein After the step of responding to the trigger instruction of the client according to the RDP session channel, the method further includes: When it is detected that the connection is interrupted due to a network anomaly, perform a reconnection operation and dynamically calculate the reconnection waiting interval according to the historical failure times; Maintain the running state of the experimental environment during the execution of the reconnection operation and maintain the session with the Guacd cluster through a heartbeat packet algorithm.
6. The remote control method of the experimental sandbox according to claim 1, characterized in that, After the step of responding to the trigger instruction of the client according to the RDP session channel, the method further includes: Real-time monitor the screen size and pixel density parameters of the client; Dynamically generate adaptation parameters according to the screen size and the pixel density parameters; Send a resolution configuration instruction to the experimental sandbox according to the adaptation parameters.
7. The remote control method of the experimental sandbox according to claim 1, characterized in that The step of querying the experimental sandbox connection information corresponding to the identity information includes: Query the experimental information cache database according to the identity information to obtain the experimental sandbox connection information.
8. The remote control method of the experimental sandbox according to claim 1, characterized in that, The step of selecting an active target Guacd instance in the Guacd cluster includes: Real-time obtain the CPU occupancy rate, memory usage rate and active connection number of the Guacd cluster; Dynamically calculate the weight values of each Guacd instance in the Guacd cluster according to the CPU occupancy rate, the memory usage rate and the active connection number; Determine the target Guacd instance among each Guacd instance according to the weight values of each Guacd instance.
9. A terminal device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the remote control method of the experimental sandbox according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the remote control method of the 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
Remote control cloud radiotherapy collaboration method and system based on guacale
CN116661937A
Server firmware remote upgrading method and system
CN120151195A
Methods and systems for providing access to a computing environment
EP2369479A2
Cited By
Concurrent debugging method and system based on sandbox-LLM session bidirectional binding
CN120723618A
Cloud integration method and device for oil and gas industrial software
CN121681006A
Cloud integration method and device for oil and gas industry software
CN121681006B