Console Access Method, Device, Equipment and Medium for Virtual Machine

By splicing encrypted session identifiers and unified resource locators in virtual machine console access, combined with multiple verification of user passwords, the security and reliability problems of virtual machine console access are solved, and a high-security access process is achieved.

CN115344889BActive Publication Date: 2025-08-01JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211000093.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2025-08-01
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

How to achieve secure and reliable access to the virtual machine console, especially in the face of widespread use of virtual machines, to ensure the security and reliability of the access process.

Method used

By judging console access instructions, splicing the unified resource locator of the target console and the currently encrypted session identifier, obtaining and decrypting the session identifier, using the request header to generate the target session identifier, and verifying the user password multiple times to ensure the security and reliability of the access.

Benefits of technology

It significantly improves the security and reliability of virtual machine console access, prevents illegal channel access, and ensures the access rights of legitimate users through multiple verifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115344889B_ABST
    Figure CN115344889B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for accessing a virtual machine console, which relates to the field of computer technology and includes: determining whether a console access instruction is currently received, if so, determining a target console, splicing the uniform resource locator of the target console and the currently encrypted session identifier to obtain a target console address, and opening the target console page; decrypting the obtained currently encrypted session identifier to obtain a current session identifier so as to obtain a target session identifier, and sending the target session identifier to the corresponding background server; obtaining a first verification result returned by the background server based on the target session identifier, determining whether the verification result meets a first preset condition, if it meets, obtaining a second verification result of the user password to be verified; determining whether the second verification result meets a second preset condition, and if it meets, displaying the current console page information corresponding to the target console. It can realize safe and reliable access to the virtual machine console.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technologies, and particularly to a method, device, equipment and medium for accessing a virtual machine console. Background Art

[0002] Today, with the rapid development of virtualization, virtualization management platforms have entered the stage of informatization construction in various industries. Moreover, with the development of virtualization, the platforms constructed by virtualization technologies have gradually become the mainstream tools for data management in many industries. Virtualization refers to virtualizing a physical server into multiple logical computers, i.e., virtual machines. Multiple virtual machines can run simultaneously on one server. Each virtual machine can run a different operating system, and application programs can run in independent spaces without affecting each other, thus significantly improving the working efficiency of virtual machines and reducing the usage costs of users. Facing the situation of the wide application of virtual machines, secure access to the virtual machine console is imperative.

[0003] In summary, how to achieve secure and reliable access to the virtual machine console is a problem to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for accessing a virtual machine console, which can achieve secure and reliable access to the virtual machine console. The specific solutions are as follows:

[0005] In a first aspect, the present application discloses a method for accessing a virtual machine console, including:

[0006] Judging whether a console access instruction is currently received. If so, determining a target console based on the console access instruction, and splicing the uniform resource locator of the target console and the currently encrypted session identifier to obtain a target console address, so as to open a target console page based on the target console address;

[0007] Obtaining the currently encrypted session identifier from the target console page, decrypting the currently encrypted session identifier to obtain a current session identifier, and then obtaining a target session identifier by using the current session identifier and the corresponding request header, so as to send the target session identifier to a background server corresponding to the target console;

[0008] Obtaining a first verification result returned by the background server based on the target session identifier, and judging whether the verification result meets a first preset condition. If it meets, obtaining a second verification result of the user password to be verified;

[0009] Judging whether the second verification result meets a second preset condition. If it meets, displaying the current console page information corresponding to the target console.

[0010] Optionally, before splicing the uniform resource locator of the target console and the currently encrypted session identifier to obtain the target console address, it further includes:

[0011] Obtain the uniform resource locator of the target console, and obtain the current session identifier corresponding to the currently encrypted session identifier through the corresponding identification interface.

[0012] Optionally, the obtaining the uniform resource locator of the target console includes:

[0013] Obtain the uniform resource locator including the communication protocol, host domain name, and port information of the target console.

[0014] Optionally, the obtaining the current session identifier corresponding to the currently encrypted session identifier through the corresponding identification interface includes:

[0015] Obtain the current session identifier through the corresponding identification interface, encrypt the current session identifier to obtain the currently encrypted session identifier, and then set a preset expiration flag to the current session identifier.

[0016] Optionally, the obtaining the currently encrypted session identifier from the target console page, decrypting the currently encrypted session identifier to obtain the current session identifier, and then obtaining the target session identifier by using the current session identifier and the corresponding request header includes:

[0017] Intercept the currently encrypted session identifier in the address bar of the target console page, and decrypt the currently encrypted session identifier to obtain the current session identifier;

[0018] Add the current session identifier to the preset identifier position of the corresponding first request header to obtain a second request header, and determine the second request header as the target session identifier.

[0019] Optionally, the obtaining the second verification result of the user password to be verified includes:

[0020] Obtain the user password to be verified through a preset password box, and send the user password to be verified to the background server;

[0021] Obtain the second verification result returned by the background server based on the user password to be verified.

[0022] Optionally, the displaying the current console page information corresponding to the target console includes:

[0023] Obtain the corresponding current console page information and communication status information from the background server at preset time intervals, and display the current console page information and the communication status information on the target console;

[0024] Determine whether the current user information meets the third preset condition, and if not, stop accessing the target console.

[0025] In a second aspect, the present application discloses a console access device for a virtual machine, including:

[0026] An address acquisition module, configured to determine whether a console access instruction is currently received. If so, determine a target console based on the console access instruction, and splice the uniform resource locator of the target console and the current encrypted session identifier to obtain a target console address, so as to open a target console page based on the target console address;

[0027] A sending module, configured to obtain the current encrypted session identifier from the target console page, decrypt the current encrypted session identifier to obtain a current session identifier, and then use the current session identifier and the corresponding request header to obtain a target session identifier, so as to send the target session identifier to a background server corresponding to the target console;

[0028] A result acquisition module, configured to obtain a first verification result returned by the background server based on the target session identifier, and determine whether the verification result meets a first preset condition. If it meets, obtain a second verification result of the user password to be verified;

[0029] A judgment module, configured to judge whether the second verification result meets a second preset condition;

[0030] An information display module, configured to display the current console page information corresponding to the target console if it meets the condition.

[0031] In a third aspect, the present application discloses an electronic device, including:

[0032] A memory, configured to store a computer program;

[0033] A processor, configured to execute the computer program to implement the steps of the virtual machine console access method disclosed above.

[0034] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein, when the computer program is executed by a processor, the steps of the virtual machine console access method disclosed above are implemented.

[0035] It can be seen that this application determines whether a console access instruction is currently received. If so, it determines the target console based on the console access instruction, and splices the uniform resource locator of the target console and the currently encrypted session identifier to obtain the target console address, so as to open the target console page based on the target console address; obtains the currently encrypted session identifier from the target console page, decrypts the currently encrypted session identifier to obtain the current session identifier, and then uses the current session identifier and the corresponding request header to obtain the target session identifier, so as to send the target session identifier to the background server corresponding to the target console; obtains the first verification result returned by the background server based on the target session identifier, and determines whether the verification result meets the first preset condition. If it meets, it obtains the second verification result of the user password to be verified; determines whether the second verification result meets the second preset condition. If it meets, it displays the current console page information corresponding to the target console. Thus, it can be seen that after this application receives the console access instruction, it determines the target console, that is, the target console to be accessed, and splices the currently encrypted session identifier with the uniform resource locator to obtain the target console address. Since the currently obtained encrypted session identifier is only current, it is only temporarily valid, that is, the next encrypted session identifier can be different from the current encrypted session identifier. Then, because the encrypted session identifier can change, even if the previous encrypted session identifier is obtained through illegal channels, it is impossible to access the target console. Therefore, compared with the traditional situation where the encrypted session identifier does not change, the security can be significantly improved; when the verification of the target session identifier passes, it will determine whether the second verification result of the user password to be verified meets the second preset condition. Only when the second preset condition is met, the current console page information corresponding to the target console is displayed. Multiple verifications also improve the reliability of console access. Description of the Drawings

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0037] Figure 1 Flowchart of a method for accessing the console of a virtual machine disclosed in the present application;

[0038] Figure 2 Flowchart of a specific method for accessing the console of a virtual machine disclosed in the present application;

[0039] Figure 3Schematic diagram of the structure of a console access device for a virtual machine disclosed in this application;

[0040] Figure 4 Structural diagram of an electronic device disclosed in this application. Specific embodiments

[0041] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0042] Today, with the rapid development of virtualization, virtualization management platforms have stepped onto the stage of informatization construction in all walks of life. Moreover, with the development of virtualization, the platforms constructed by virtualization technology have gradually become the mainstream tools for data management in many industries. Virtualization refers to virtualizing a physical server into multiple logical computers, i.e., virtual machines. Multiple virtual machines can run simultaneously on one server, each virtual machine can run a different operating system, and application programs can run in independent spaces without affecting each other, thus significantly improving the working efficiency of virtual machines and reducing the usage cost of users. Facing the situation of the widespread application of virtual machines, secure access to the virtual machine console is imperative.

[0043] Therefore, this application correspondingly provides a console access solution for virtual machines to achieve secure and reliable access to the virtual machine console.

[0044] See Figure 1 As shown, the embodiments of this application disclose a console access method for virtual machines, including:

[0045] Step S11: Determine whether a console access instruction is currently received. If so, determine the target console based on the console access instruction, and splice the uniform resource locator of the target console and the currently encrypted session identifier to obtain the target console address, so as to open the target console page based on the target console address.

[0046] In this embodiment, the corresponding console access instruction can be obtained by the user clicking on a preset access button. For example, the preset access button is "Open Console". After receiving the console access instruction, the uniform resource locator of the target console and the current session identifier corresponding to the currently encrypted session identifier need to be obtained through window.location, that is, the uniform resource locator containing the communication protocol, host name, and port information of the target console is obtained. Among them, it can be understood that the current session identifier is a temporary session identifier, that is, the current session identifier is different from the previous session identifier, and the same session identifier is not always used, which improves the security and reliability of subsequent use of the current session identifier. After obtaining the current session identifier, the current session identifier needs to be encrypted. For example, the current session identifier is encrypted using the AES (Advanced Encryption Standard) encryption method framework crypto-js to obtain the currently encrypted session identifier.

[0047] In this embodiment, the uniform resource locator of the target console and the currently encrypted session identifier are concatenated to obtain the target console address. For example, the concatenation method is as follows:

[0048] protocol / / host name:port / novnc / index.html?token=encrypted session Id.

[0049] Step S12: Obtain the currently encrypted session identifier from the target console page, decrypt the currently encrypted session identifier to obtain the current session identifier, and then obtain the target session identifier using the current session identifier and the corresponding request header, so as to send the target session identifier to the background server corresponding to the target console.

[0050] In this embodiment, obtaining the currently encrypted session identifier from the target console page, decrypting the currently encrypted session identifier to obtain the current session identifier, and then obtaining the target session identifier by using the current session identifier and the corresponding request header specifically includes: intercepting the currently encrypted session identifier in the address bar of the target console page and decrypting the currently encrypted session identifier to obtain the current session identifier; adding the current session identifier to a preset identifier position of the corresponding first request header to obtain a second request header, and determining the second request header as the target session identifier. It can be understood that the target session identifier is the permanent session identifier during the current use process, that is, the session identifier involved in this use process is the target session identifier. When decrypting the currently encrypted session identifier, the AES decryption method framework crypto-js can be used for decryption.

[0051] Step S13: Obtain the first verification result returned by the background server based on the target session identifier, and determine whether the verification result meets a first preset condition. If it meets the condition, obtain the second verification result of the user password to be verified.

[0052] In this embodiment, a preset password box can be set before receiving the console access instruction, so that the user can input the user password to be verified in the preset password box. After the user inputs the user password to be verified, the user clicks the corresponding OK button to trigger the operation of sending the user password to be verified to the corresponding background server. It should be noted that when sending the user password to be verified, the user password to be verified needs to be encrypted. For example, the AES encryption method framework crypto-js is used to encrypt the user password to be verified, thereby improving security.

[0053] Step S14: Determine whether the second verification result meets a second preset condition. If it meets the condition, display the current console page information corresponding to the target console.

[0054] In this embodiment, the display of the current console page information corresponding to the target console specifically includes: obtaining the corresponding current console page information and communication status information from the background server at preset time intervals, and displaying the current console page information and the communication status information on the target console; determining whether the current user information meets the third preset condition, and if not, stopping the access to the target console. Because during the process of accessing the console, a network connection is required for information interaction, but the network may be unstable. Therefore, the communication status information can be obtained at each preset time interval. For example, the communication status information can be obtained every 5 seconds. If the current console page information cannot be displayed normally, the specific reason for the abnormal display can be determined based on the current console page information. When displaying the current console page information, it can be determined whether the current user information meets the third preset condition. For example, whether the current user information has been cancelled. If it has been cancelled, the display of the current console page information is stopped, and the target console is closed.

[0055] It can be seen that this application determines whether a console access instruction is currently received. If so, it determines the target console based on the console access instruction, and splices the uniform resource locator of the target console and the currently encrypted session identifier to obtain the target console address, so as to open the target console page based on the target console address; obtains the currently encrypted session identifier from the target console page, decrypts the currently encrypted session identifier to obtain the current session identifier, and then uses the current session identifier and the corresponding request header to obtain the target session identifier, so as to send the target session identifier to the background server corresponding to the target console; obtains the first verification result returned by the background server based on the target session identifier, and determines whether the verification result meets the first preset condition. If it meets, it obtains the second verification result of the user password to be verified; determines whether the second verification result meets the second preset condition. If it meets, it displays the current console page information corresponding to the target console. Thus, it can be seen that after this application receives the console access instruction, it determines the target console, that is, the target console to be accessed, and splices the currently encrypted session identifier with the uniform resource locator to obtain the target console address. Because the currently obtained encrypted session identifier is only current, it is only temporarily valid, that is, the next encrypted session identifier can be different from the current encrypted session identifier. Then, because the encrypted session identifier can change, even if the previous encrypted session identifier is obtained through illegal channels, it is impossible to access the target console. Therefore, compared with the traditional situation where the encrypted session identifier does not change, the security can be significantly improved; when the verification of the target session identifier passes, it will determine whether the second verification result of the user password to be verified meets the second preset condition. Only when the second preset condition is met, the current console page information corresponding to the target console is displayed. Multiple verifications also improve the reliability of console access.

[0056] See Figure 2 As shown, an embodiment of this application discloses a specific method for accessing the console of a virtual machine, including:

[0057] Step S21: Obtain the uniform resource locator of the target console, and obtain the current session identifier corresponding to the currently encrypted session identifier through the corresponding identification interface.

[0058] In this embodiment, the obtaining of the current session identifier corresponding to the currently encrypted session identifier through the corresponding identification interface specifically includes: obtaining the current session identifier through the corresponding identification interface, encrypting the current session identifier to obtain the currently encrypted session identifier, and then setting a preset expiration flag to the current session identifier. It can be understood that after obtaining the current session identifier, it is necessary to set the current session identifier to a preset expiration flag. After setting the preset expiration flag, the current session identifier will never be used again, that is, the obtained current session identifier is a temporary session identifier and can only be used currently. For example, if the current session identifier is A, the next session identifier cannot be A. It can also make the current session identifier not be used within a preset time period. For example, currently it is April 3, 2022, the current session identifier is A, and the preset time period is 3 days. Then after using A as the current session identifier currently, it can be used again after April 7, 2022. It should be noted that the session identifier A can be used after April 7, 2022, but there may be no regular pattern of use. For example, a session identifier library can be created to save the list of currently available session identifiers, and any session identifier can be randomly selected from this list as the current session identifier. And when randomly selecting, a session identifier different from the previous session identifier can be selected as the current session identifier. Therefore, even if the previous session identifier is obtained through illegal channels, because it is different from the current session identifier, it cannot pass the subsequent verification, thus ensuring the reliability of accessing the target console.

[0059] Step S22: Determine whether a console access instruction is currently received. If so, determine the target console based on the console access instruction, and splice the uniform resource locator of the target console and the currently encrypted session identifier to obtain the target console address, so as to open the target console page based on the target console address.

[0060] Step S23: Obtain the currently encrypted session identifier from the target console page, decrypt the currently encrypted session identifier to obtain the current session identifier, and then obtain the target session identifier by using the current session identifier and the corresponding request header, so as to send the target session identifier to the background server corresponding to the target console.

[0061] Step S24: Obtain the first verification result returned by the background server based on the target session identifier, and determine whether the verification result meets the first preset condition. If it meets, obtain the second verification result of the user password to be verified.

[0062] In this embodiment, obtaining the second verification result of the user password to be verified specifically includes: obtaining the user password to be verified through a preset password box, and sending the user password to be verified to the background server; obtaining the second verification result returned by the background server based on the user password to be verified. It can be understood that when sending the user password to be verified to the background server, the user password to be verified can be encrypted to obtain the encrypted user password to be verified, and correspondingly, obtaining the second verification result returned by the background server based on the encrypted user password to be verified.

[0063] Step S25: Determine whether the second verification result meets the second preset condition. If it meets, display the current console page information corresponding to the target console.

[0064] It can be seen that this application makes use of the difference between the current session identifier and the previous session identifier, that is, it does not always use the same session identifier. When the previous session identifier is obtained through illegal channels, it cannot be used for the current use. And because the change of the session identifier is also irregular, only the legally obtained current session identifier can pass the subsequent verification, thus effectively improving security and reliability.

[0065] See Figure 3 As shown, an embodiment of this application discloses a console access device for a virtual machine, including:

[0066] An address acquisition module 11, configured to determine whether a console access instruction is currently received. If so, determine a target console based on the console access instruction, and splice the uniform resource locator of the target console and the current encrypted session identifier to obtain a target console address, so as to open a target console page based on the target console address;

[0067] A sending module 12, configured to obtain the current encrypted session identifier from the target console page, decrypt the current encrypted session identifier to obtain a current session identifier, and then obtain a target session identifier by using the current session identifier and the corresponding request header, so as to send the target session identifier to a background server corresponding to the target console;

[0068] A result acquisition module 13, configured to obtain a first verification result returned by the background server based on the target session identifier, and determine whether the verification result meets a first preset condition. If it meets, obtain a second verification result of the user password to be verified;

[0069] A judgment module 14, configured to determine whether the second verification result meets the second preset condition;

[0070] An information display module 15, configured to, if it meets, display the current console page information corresponding to the target console.

[0071] It can be seen that this application determines whether a console access instruction is currently received. If so, it determines the target console based on the console access instruction, and splices the uniform resource locator of the target console and the currently encrypted session identifier to obtain the target console address, so as to open the target console page based on the target console address; obtains the currently encrypted session identifier from the target console page, and decrypts the currently encrypted session identifier to obtain the current session identifier, and then uses the current session identifier and the corresponding request header to obtain the target session identifier, so as to send the target session identifier to the background server corresponding to the target console; obtains the first verification result returned by the background server based on the target session identifier, and determines whether the verification result meets the first preset condition. If it meets, it obtains the second verification result of the user password to be verified; determines whether the second verification result meets the second preset condition. If it meets, it displays the current console page information corresponding to the target console. Thus, it can be seen that after this application receives the console access instruction, it determines the target console, that is, the target console to be accessed, and splices the currently encrypted session identifier with the uniform resource locator to obtain the target console address. Since the currently encrypted session identifier obtained is only current, it is only temporarily valid, that is, the next encrypted session identifier can be different from the current encrypted session identifier. Then, because the encrypted session identifier can change, even if the previous encrypted session identifier is obtained through illegal channels, it is impossible to access the target console. Therefore, compared with the traditional situation where the encrypted session identifier does not change, the security can be significantly improved; when the verification of the target session identifier passes, it will determine whether the second verification result of the user password to be verified meets the second preset condition. Only when the second preset condition is met, the current console page information corresponding to the target console is displayed. Multiple verifications also improve the reliability of console access.

[0072] In some specific embodiments, the console access device of the virtual machine includes:

[0073] A first acquisition unit, configured to acquire the uniform resource locator of the target console, and acquire the current session identifier corresponding to the currently encrypted session identifier through the corresponding identification interface.

[0074] In some specific embodiments, the first acquisition unit includes:

[0075] A second acquisition unit, configured to acquire the uniform resource locator including the communication protocol, host domain name, and port information of the target console.

[0076] In some specific embodiments, the first acquisition unit includes:

[0077] A marking setting unit, configured to obtain a current session identifier through a corresponding identification interface, encrypt the current session identifier to obtain a current encrypted session identifier, and then set a preset expiration marking to the current session identifier.

[0078] In some specific embodiments, the sending module 12 includes:

[0079] A decryption unit, configured to intercept the current encrypted session identifier in the address bar of the target console page, and decrypt the current encrypted session identifier to obtain a current session identifier;

[0080] A target session identifier obtaining unit, configured to add the current session identifier to a preset identifier position of a corresponding first request header to obtain a second request header, and determine the second request header as a target session identifier.

[0081] In some specific embodiments, the result obtaining module 13 includes:

[0082] A verification result obtaining unit, configured to obtain a user password to be verified through a preset password box, send the user password to be verified to the background server; and obtain a second verification result returned by the background server based on the user password to be verified.

[0083] In some specific embodiments, the information display module 15 includes:

[0084] A page information and status information display unit, configured to obtain corresponding current console page information and communication status information from the background server every preset time period, and display the current console page information and the communication status information in the target console;

[0085] An access stop unit, configured to determine whether the current user information meets a third preset condition, and if not, stop accessing the target console.

[0086] Figure 4 This is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the following steps:

[0087] Determine whether a console access instruction is currently received. If so, determine the target console based on the console access instruction, and splice the uniform resource locator of the target console and the current encrypted session identifier to obtain the target console address, so as to open the target console page based on the target console address;

[0088] Obtain the current encrypted session identifier from the target console page, decrypt the current encrypted session identifier to obtain the current session identifier, and then use the current session identifier and the corresponding request header to obtain the target session identifier, so as to send the target session identifier to the background server corresponding to the target console;

[0089] Obtain the first verification result returned by the background server based on the target session identifier, and determine whether the verification result meets the first preset condition. If it meets, obtain the second verification result of the user password to be verified;

[0090] Determine whether the second verification result meets the second preset condition. If it meets, display the current console page information corresponding to the target console.

[0091] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0092] Obtain the uniform resource locator of the target console, and obtain the current session identifier corresponding to the current encrypted session identifier through the corresponding identification interface.

[0093] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0094] Obtain the uniform resource locator including the communication protocol, host domain name, and port information of the target console.

[0095] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0096] Obtain the current session identifier through the corresponding identification interface, encrypt the current session identifier to obtain the current encrypted session identifier, and then set a preset expiration mark to the current session identifier.

[0097] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0098] Intercept the current encrypted session identifier in the address bar of the target console page, and decrypt the current encrypted session identifier to obtain the current session identifier;

[0099] Add the current session identifier to a preset identifier position in the corresponding first request header to obtain a second request header, and determine the second request header as the target session identifier.

[0100] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0101] Obtain the user password to be verified through a preset password box, and send the user password to be verified to the background server;

[0102] Obtain a second verification result returned by the background server based on the user password to be verified.

[0103] In some specific embodiments, the processor can further include the following steps by executing the computer program stored in the memory:

[0104] Obtain the corresponding current console page information and communication status information from the background server at preset time intervals, and display the current console page information and the communication status information in the target console;

[0105] Determine whether the current user information meets a third preset condition, and if not, stop accessing the target console.

[0106] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of this application, and no specific limitation is made here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0107] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for the rendering and drawing of the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0108] In addition, the memory 22, as a carrier for resource storage, may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage method may be temporary storage or permanent storage.

[0109] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It may be Windows, Unix, Linux, etc. In addition to the computer program that can be used to complete the console access method of the virtual machine executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by the external device received by the electronic device, but also the data collected by its own input / output interface 25, etc.

[0110] Furthermore, the embodiments of the present application also disclose a computer-readable storage medium. When the computer program stored in the storage medium is loaded and executed by a processor, the method steps executed during the console access process of the virtual machine disclosed in any of the foregoing embodiments are implemented.

[0111] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0112] The above has introduced in detail a method, apparatus, device and medium for console access to a virtual machine provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A console access method for a virtual machine, characterized in that, Including: Determine whether a console access instruction is currently received. If so, determine the target console based on the console access instruction, and splice the uniform resource locator of the target console and the currently encrypted session identifier to obtain the target console address, so as to open the target console page based on the target console address; Obtain the currently encrypted session identifier from the target console page, decrypt the currently encrypted session identifier to obtain the current session identifier, and then use the current session identifier and the corresponding request header to obtain the target session identifier, so as to send the target session identifier to the background server corresponding to the target console; Obtain the first verification result returned by the background server based on the target session identifier, and determine whether the verification result meets the first preset condition. If it meets, obtain the second verification result of the user password to be verified; Determine whether the second verification result meets the second preset condition. If it meets, display the current console page information corresponding to the target console.

2. The console access method for a virtual machine according to claim 1, wherein, Before splicing the uniform resource locator of the target console and the currently encrypted session identifier to obtain the target console address, it further includes: Obtain the uniform resource locator of the target console, and obtain the current session identifier corresponding to the currently encrypted session identifier through the corresponding identification interface.

3. The console access method for a virtual machine according to claim 2, wherein, The obtaining the uniform resource locator of the target console includes: Obtain the uniform resource locator including the communication protocol, host domain name, and port information of the target console.

4. The console access method for a virtual machine according to claim 2, characterized in that, The obtaining the current session identifier corresponding to the currently encrypted session identifier through the corresponding identification interface includes: Obtain the current session identifier through the corresponding identification interface, encrypt the current session identifier to obtain the currently encrypted session identifier, and then set a preset expiration mark to the current session identifier.

5. The console access method for a virtual machine according to claim 1, wherein The obtaining the currently encrypted session identifier from the target console page, decrypting the currently encrypted session identifier to obtain the current session identifier, and then using the current session identifier and the corresponding request header to obtain the target session identifier includes: Intercept the currently encrypted session identifier in the address bar of the target console page, and decrypt the currently encrypted session identifier to obtain the current session identifier; Add the current session identifier to the preset identification position of the corresponding first request header to obtain the second request header, and determine the second request header as the target session identifier.

6. The console access method for a virtual machine according to claim 1, characterized in that, The obtaining the second verification result of the user password to be verified includes: Obtain the user password to be verified through the preset password box, and send the user password to be verified to the background server; Obtain the second verification result returned by the background server based on the user password to be verified.

7. The console access method for a virtual machine according to any one of claims 1 to 6, characterized in that The displaying the current console page information corresponding to the target console includes: Obtain the corresponding current console page information and communication status information from the background server every preset time period, and display the current console page information and the communication status information in the target console; Determine whether the current user information meets the third preset condition. If not, stop accessing the target console.

8. A console access device for a virtual machine, characterized in that, Including: An address acquisition module, configured to determine whether a console access instruction is currently received. If so, determine a target console based on the console access instruction, and splice the uniform resource locator of the target console and the current encrypted session identifier to obtain a target console address, so as to open a target console page based on the target console address; A sending module, configured to obtain the current encrypted session identifier from the target console page, decrypt the current encrypted session identifier to obtain a current session identifier, and then obtain a target session identifier by using the current session identifier and the corresponding request header, so as to send the target session identifier to a background server corresponding to the target console; A result acquisition module, configured to obtain a first verification result returned by the background server based on the target session identifier, and determine whether the verification result meets a first preset condition. If so, obtain a second verification result of the user password to be verified; A judgment module, configured to judge whether the second verification result meets a second preset condition; 9. An electronic device, characterized in that, An information display module, configured to display the current console page information corresponding to the target console if it is satisfied. Including: A memory, configured to store a computer program; 10. A computer-readable storage medium, characterized in that, A processor, configured to execute the computer program to implement the steps of the console access method of the virtual machine according to any one of claims 1 to 7. For storing a computer program; wherein, when the computer program is executed by a processor, the steps of the console access method of the virtual machine according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method achieving XenServer virtual machine remote control on https

    CN103200215A

  • Method and device for accessing virtual machine console and cloud management platform

    CN112817703A