Display content acquisition method and device, electronic equipment and storage medium
By integrating remote desktop functions and optical character recognition technology in a pure command line operating system, the problem of not being able to view the content displayed on the server without a graphical interface system is solved, and the graphical interface is directly viewed in the command line environment is realized, which improves operation and maintenance efficiency and reduces costs.
Patent Information
- Application Number
- CN202510360969.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-11
AI Technical Summary
The prior art cannot view the server's displayed content in real time under a pure command line operating system without a graphical user interface, resulting in inconvenience in operation and maintenance personnel.
By integrating the remote desktop function in a pure command line operating system, switching the network serial port input source to the interactive interface, obtaining the display screen data of the target terminal, and converting the image into text content to display through optical character recognition technology, realizing direct viewing of the graphical interface.
In a pure command line operating system, direct viewing of the server graphical interface is realized, which improves the management and operation efficiency of operation and maintenance personnel and reduces operation and maintenance costs.
Smart Images

Figure CN120295592A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and in particular, to a method, apparatus, electronic device, and storage medium for obtaining display content. Background Art
[0002] As an important function provided by the server BMC (Baseboard Management Controller), KVM (Keyboard Video Mouse, a remote desktop function) enables customers to remotely view the desktop of the operating system through the network and perform mouse and keyboard operations on the system, which is a very frequently used function by customers. The KVM technology does not require the target server to modify the software and can access the target computer at any time in a remote environment, providing true motherboard-level access. It has developed into an enterprise IT infrastructure management system for the computer room, and servers and devices located at multiple remote locations can be directly accessed from the KVM client.
[0003] In related technologies, for server operation and maintenance personnel, if they want to view the display content of the server system in real time, the currently preferred option is the KVM function provided by the BMC. This function allows customers to use a browser or VNC client software to view the display content of the server operating system and perform mouse and keyboard operations on the system. However, since KVM can only be used through a browser or VNC client, and browser and VNC client software can only be installed on an operating system with a GUI (Graphical User Interface), in actual use, the pure command-line system without a graphical user interface, which is more commonly used by server operation and maintenance personnel, cannot use KVM, causing great inconvenience to the operation and maintenance personnel.
[0004] In addition, operation and maintenance personnel can also remotely enter the server system through the SOL (Serial Over Lan) solution provided by the BMC. SOL is a function that allows customers to access the serial port of the server system through the network. Operation and maintenance personnel can use command-line tools such as ipmitool to remotely access the system serial port of the server and perform operations. However, using ipmitool sol can only access the system serial port of the server and cannot view the display content of the server operating system, which cannot meet the needs of operation and maintenance personnel who need to view the display content of the operating system. Summary of the Invention
[0005] This application provides a method, apparatus, electronic device, and storage medium for obtaining display content, so as to at least solve the problem that related technologies cannot meet the viewing requirements of users for the screen content of the server operating system in different operating system environments.
[0006] The present application provides a method for obtaining display content. The method is applied to a target terminal and includes: obtaining a target acquisition instruction of an operation terminal of a pure command-line operating system; in response to the target acquisition instruction, obtaining display screen data of the target terminal; identifying text content displayed in the display screen data, and sending the text content to the operation terminal.
[0007] The present application provides another method for obtaining display content. The method is applied to an operation terminal of a pure command-line operating system and includes: generating a target acquisition instruction according to a user's command-line operation; sending the target acquisition instruction to a target terminal, where the target terminal, in response to the target acquisition instruction, obtains display screen data of the target terminal and identifies text content displayed in the display screen data; and displaying the text content displayed in the interactive interface of the target terminal.
[0008] The present application further provides an apparatus for obtaining display content. The apparatus is applied to a target terminal and includes: an acquisition module, configured to obtain a target acquisition instruction of an operation terminal of a pure command-line operating system; a response module, configured to, in response to the target acquisition instruction, obtain display screen data of the target terminal; and a first sending module, configured to identify text content displayed in the display screen data and send the text content to the operation terminal.
[0009] The present application further provides another apparatus for obtaining display content. The apparatus is applied to an operation terminal of a pure command-line operating system and includes: a generation module, configured to generate a target acquisition instruction according to a user's command-line operation; a second sending module, configured to send the target acquisition instruction to a target terminal, where the target terminal, in response to the target acquisition instruction, obtains display screen data of the target terminal and identifies text content displayed in the display screen data; and a display module, configured to display the text content displayed in the interactive interface of the target terminal.
[0010] The present application further provides an electronic device, including: a memory, configured to store a computer program; and a processor, configured to implement the steps of any of the above methods for obtaining display content when executing the computer program.
[0011] The present application further provides a computer-readable storage medium, in which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any of the above methods for obtaining display content.
[0012] This application realizes directly viewing the graphical interface content of a server in a pure command-line operating system by obtaining the display screen data of a target terminal and displaying the display screen data in text form on the operation terminal of the pure command-line operating system. It has high applicability and does not require switching to an operating system with a graphical interface, enabling users to manage and operate the server more efficiently. Thus, it solves the problem that the related technology cannot meet the user's need to view the operating system screen content of the server in different operating system environments. Brief Description of the Drawings
[0013] To more clearly illustrate the embodiments of this application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0014] Figure 1 It is a flowchart of a method for obtaining display content provided by an embodiment of this application;
[0015] Figure 2 It is an example diagram of a method for obtaining display content in an embodiment of this application;
[0016] Figure 3 It is an example diagram of a method for obtaining display content in another embodiment of this application;
[0017] Figure 4 It is a flowchart of another method for obtaining display content provided by an embodiment of this application.
[0018] Figure 5 It is a block diagram of a device for obtaining display content provided by an embodiment of this application.
[0019] Figure 6 It is a block diagram of another method for obtaining display content provided by an embodiment of this application. Detailed Embodiments
[0020] The following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the drawings in the embodiments of this application. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of this application.
[0021] It should be noted that in the description of this application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0022] In order to enable those skilled in the art of this technology to better understand the solution of this application, the following further detailed description of this application will be made in conjunction with the accompanying drawings and specific embodiments.
[0023] An embodiment of this application provides a method for obtaining display content, and this method is applied to a target terminal.
[0024] Specifically, Figure 1 It is a schematic flowchart of a method for obtaining display content provided by an embodiment of this application.
[0025] As Figure 1 shown, the method for obtaining display content includes the following steps:
[0026] In step S101, obtain a target acquisition instruction of an operation terminal of a pure command-line operating system.
[0027] It can be understood that server users use more pure command-line operating systems without GUI, and KVM cannot be used on such systems, which brings inconvenience to users. In the embodiment of this application, the target acquisition instruction is initiated by the server user on the operation terminal of the pure command-line operating system and is used to request to obtain the display screen content of the server's GUI system.
[0028] In step S102, in response to the target acquisition instruction, obtain the display screen data of the target terminal.
[0029] In some embodiments, obtaining the display screen data of the target terminal in response to the target acquisition instruction includes: in response to the target acquisition instruction, start the remote desktop function of the target terminal; switch the input source of the target network serial port of the remote desktop function to the interactive interface; obtain the display screen data of the interactive interface from the driver of the interactive interface.
[0030] It can be understood that after obtaining the target acquisition instruction of the operation terminal, the embodiments of the present application can, according to the parameters in the target acquisition instruction (such as the IP address), if it is desired to obtain the display screen data of the target terminal, a connection needs to be established with the target network serial port of the target terminal. The target network serial port is a virtual serial port implemented through the network, which allows users to connect to the serial port of the target terminal through the network for remote management and operation. The network serial port can be connected to different input sources, such as the target terminal serial port or the target terminal interaction interface. Among them, the target terminal serial port is usually used for command-line operations, while the target terminal interaction interface is used for graphical interface operations. During actual execution, the embodiments of the present application can, through commands such as Redfish, switch the input source of the target network serial port, and can switch between the target terminal serial port and the target terminal interaction interface. For example, switch from the serial port of the target terminal to the interaction interface, or switch from the interaction interface to the serial port. This switching function allows users to select different operation modes according to needs. For example, switch to the interaction interface when it is necessary to view the graphical interface, and switch back to the serial port when it is necessary to perform command-line operations.
[0031] For example, when the user needs to view the graphical interface of the server, the Redfish command can be used to switch the input source of the target network serial port to the interaction interface. In this way, the user can view the VGA screen of the server through the target network serial port, just as if directly connected to the monitor of the server.
[0032] Furthermore, once the input source of the target network serial port is switched to the interaction interface (VGA screen), the background process of the remote desktop function of the BMC will start to obtain the display screen data from the driver of the interaction interface. During actual execution, the driver of the interaction interface (such as the graphics card driver) is responsible for rendering the graphical interface of the target terminal into image data. The background process of the remote desktop function of the BMC obtains this image data through the interface with the driver (such as API calls). For example, the background process can regularly obtain the latest image frames from the graphics card driver. These image frames are stored in a compressed format (such as JPEG or PNG) for easy transmission. Among them, the BMC is a controller independent of the target terminal, used to monitor the target terminal and implement the remote desktop function.
[0033] In summary, the embodiments of the present application start the remote desktop function without a complex operation process. After the remote desktop function is started, the input source of the target network serial port is switched from the system serial port to the interaction interface (VGA screen). This operation enables the network serial port to receive the display data from the graphical interface of the target terminal instead of the traditional command-line data, enabling a pure command-line operating system to access the graphical interface of the target terminal.
[0034] In some embodiments, display screen data of an interactive interface is obtained from the driver of the interactive interface, including: obtaining the display screen data of the interactive interface from the driver of the interactive interface through a background process of the remote desktop function; and sending the display screen data to a background process of a target network serial port.
[0035] Among them, the background process of the remote desktop function of the BMC interacts with the driver of the interactive interface to obtain the current display screen data. To reduce the bandwidth requirement of network transmission and improve transmission efficiency, the background process of the remote desktop function compresses the obtained display screen data (such as image data). Compression formats used include JPEG, PNG, etc. These formats can significantly reduce the data volume while maintaining the image quality. For example, assume that the VGA screen resolution of the target terminal is 1920×1080 pixels, and the uncompressed original image data may be very large (for example, 3 bytes per pixel, with a total data volume of about 6MB). Through JPEG compression, the data volume can be reduced to dozens of KB or even a few KB, depending on the compression ratio and image content. Further, the compressed image frame data is sent to the background process of the target network serial port of the BMC. This process is responsible for managing the input and output of the network serial port to ensure that data can be correctly transmitted through the network to the operation terminal. In actual execution, data transmission can be implemented through various network protocols, such as WebSocket, Redfish, etc., to ensure the integrity and accuracy of the data. Thus, the background process of the remote desktop function focuses on obtaining the display screen data from the driver of the interactive interface, while the background process of the target network serial port is responsible for managing and maintaining the communication of the network serial port. This division of labor enables each process to efficiently complete its specific task and improves the overall operation efficiency.
[0036] In some embodiments, in response to a target acquisition instruction, display screen data of a target terminal is obtained, including: in response to the target acquisition instruction, starting a command-line tool for implementing the remote desktop function, and the command-line tool connects to a target network interface of the remote desktop function through a target protocol; after the command-line tool successfully connects to the target network interface, the command-line tool obtains the display screen data of the interactive interface from the background process of the remote desktop function and sends the display screen data to the background process of the target network serial port through the target network interface.
[0037] Among them, the command-line tool can be cmdKVM, and the target protocol allows a persistent and two-way communication channel to be established between the target terminal and the operator terminal, supports real-time data transmission, and is used for application scenarios that require interaction. It can be WebSocket Secure, hereinafter simply referred to as the wss protocol.
[0038] It can be understood that the embodiments of the present application can start the cmdKVM for implementing the remote desktop function. The cmdKVM command-line tool parses the target acquisition instruction to obtain the server IP address of the target terminal, constructs a WebSocket connection request, and connects to the target network interface of the remote desktop function using the wss protocol. The format of the connection address is usually: wss: / / bmc-ip / kvm / 0.
[0039] After the cmdKVM command-line tool successfully establishes a communication connection with the target network interface, it starts to receive and send data. The command-line tool in the embodiments of the present application sends a request to the KVM background process through the established connection, requesting to obtain the display screen data of the target terminal. After receiving the request, the background process of the remote desktop function captures the current display screen data from the graphics interface driver of the target terminal. The command-line tool decompresses the compressed image frame data and performs necessary processing (such as OCR (Optical Character Recognition) recognition to convert the text content in the image into plain text characters). The processed display screen data (such as plain text characters) is sent to the background process of the network serial port through the target network interface. The background process of the network serial port sends the received display screen data to the user's operation terminal, and the user can view the display screen content of the target terminal on the operation terminal.
[0040] Thus, the embodiments of the present application can integrate the command-line tool with the remote desktop function, enabling a pure command-line operating system to access the graphics interface of the target terminal through the command-line tool. The user inputs a target acquisition instruction through the command-line tool, and the tool connects to the network interface of the remote desktop function through the target protocol (such as WebSocket Secure). The background process of the remote desktop function obtains the display screen data from the driver of the interaction interface and sends this data to the background process of the target network serial port to obtain the display screen data, without a complex operation process. This design enables the user to quickly access the graphics interface of the target terminal in a familiar command-line environment.
[0041] In some embodiments, the command-line tool is also used to obtain the target operation instruction of the operation terminal from the target network interface, send the target operation instruction to the background process of the remote desktop function, and the background process of the remote desktop function responds to the target operation instruction.
[0042] It can be understood that the command-line tool of the embodiments of the present application can not only obtain the display screen data of the target middle end, but also receive the user's keyboard operations and send these operations to the background process of the remote desktop function through the wss protocol, thereby realizing real-time control of the target terminal system.
[0043] Specifically, in a command-line environment, the standard input interface (stdin) is one of the main ways for users to interact with programs, allowing users to input instructions and data via the keyboard. Command-line tools capture users' keyboard operations through the standard input interface, including key events (such as letters, numbers, special characters) and control instructions (such as Ctrl+C, Enter), etc. After the command-line tool is launched, it enters a listening state, waiting in real-time for users to input operations via the keyboard. When the user presses any key on the keyboard, the command-line tool captures this key event and converts it into a corresponding operation instruction. For example, when the user presses the Ctrl+C key combination, the command-line tool captures this key combination event and recognizes it as an interrupt operation.
[0044] During the actual execution process, the command-line tool uses the wss protocol to establish an encrypted two-way communication channel with the BMC of the target terminal for transmitting keyboard operations and receiving responses from the target terminal. The BMC of the target terminal runs a background process for the remote desktop function, which is responsible for listening to the data on the wss connection. When it receives the keyboard operation data sent by the command-line tool, it parses this data and converts it into operation instructions that the target terminal can understand. The BMC forwards the received keyboard operation instructions to the operating system or other target controllers of the target terminal to execute the corresponding operations. If the received instruction is Ctrl+C, the BMC sends an interrupt signal to the operating system of the target terminal. After the target terminal executes the operation, it returns the execution result to the BMC. The BMC then sends the result back to the command-line tool through the wss connection. The command-line tool displays the execution result in text form in the command-line terminal, allowing users to see the execution status of the operation, thus enhancing the user experience of managing the target terminal using a pure command-line system.
[0045] In step S103, identify the text content displayed in the display screen data and send the text content to the operation terminal.
[0046] In some embodiments, identifying the text content displayed in the display screen data includes: identifying the compressed image data in the display screen data; decompressing the compressed image data to obtain decompressed image data; performing at least one of character segmentation, feature extraction, character recognition, character error correction, and formatting on the image in the decompressed image data through optical character recognition technology; generating the text content displayed in the display screen data according to the processing result.
[0047] Based on the above embodiments, when the background process of the target network serial port obtains the display screen data (such as image data), the embodiments of the present application first need to decompress this data to restore it to the original image format. The decompressed image data can be common image formats such as JPEG, PNG, etc.
[0048] Furthermore, the embodiments of the present application can then identify the content in the picture as pure characters through steps such as OCR image text recognition, image preprocessing, character segmentation, feature extraction, and character recognition. Specifically as follows:
[0049] 1) Image preprocessing
[0050] Convert the color image into a grayscale image to reduce the complexity of color information while retaining the main features of the image. Then, use filtering algorithms (such as median filtering and Gaussian filtering) to remove the noise points in the image, smooth the image edges, and reduce interference. Also, perform smoothing processing on the image through a Gaussian kernel to reduce noise while retaining the main features of the image, thereby improving the image quality.
[0051] 2) Character segmentation
[0052] The character segmentation in the embodiments of the present application is a process of splitting the text content in the image into individual characters for subsequent feature extraction and character recognition. For example, first split the image into multiple lines, and within each line, further split the text into individual characters.
[0053] 3) Feature extraction
[0054] Feature extraction is a process of extracting recognizable features from the segmented character images. These features can be the shape, strokes, contours, etc. of the characters. In the actual execution process, the embodiments of the present application can calculate the contours and directions of the strokes to extract the feature vectors of the strokes, use contour detection algorithms (such as the Canny operator) to extract the contours of the characters, and calculate the geometric features of the contours. Use texture analysis algorithms (such as gray-level co-occurrence matrix) to extract the texture features of the characters, etc.
[0055] 4) Character recognition
[0056] The character recognition in the embodiments of the present application is a process of matching the extracted features with known character templates to determine the characters. For example, match the extracted character features with predefined character templates and determine the characters by calculating the similarity. Among them, methods such as Euclidean distance and cosine similarity can be used to calculate the similarity between feature vectors.
[0057] Furthermore, the embodiments of the present application can also perform error correction and formatting processing on the recognized characters to obtain the final text content, so as to improve the accuracy and readability of the recognition result. After processing the recognition result, the embodiments of the present application can output this text content to the user's operation terminal. Since the operation terminal of a pure command-line operating system usually displays content in text form and does not support graphical display, the embodiments of the present application display the display screen data of the target terminal by converting it into text content, which improves the user experience of using a pure command-line system to manage the server and can also reduce the operation and maintenance cost. Users do not have to purchase a computer with a GUI system specifically for using the KVM function.
[0058] In summary, through the above series of technical steps, the function of viewing the graphical interface (VGA screen) of the target terminal in a pure command-line operating system is realized. The following will describe in detail the method for obtaining the display content of the embodiments of the present application in combination with two specific examples. The target terminal can be described by a server system, as follows:
[0059] 1) Embodiment 1
[0060] As Figure 2 described, the embodiments of the present application can switch the input source of the server network serial port through commands such as redfish, and can switch between the system serial port and the system display interaction interface. In the actual execution process, the user of the embodiments of the present application inputs the above command in the command line, and the command-line tool (such as curl) sends the request to the BMC of the server system. After receiving the request, the BMC executes the switching operation, switching the input source of the network serial port from the system serial port to the system display interaction interface (VGA screen). After the switching is completed, the BMC returns a confirmation message indicating that the input source has been successfully switched to the VGA screen.
[0061] After switching to the system display, when the user enables the network serial port, the BMC KVM background process (the background process of the remote desktop function) obtains the compressed image frame from the driver and sends the frame image data to the background process of the BMC network serial port. After the background process of the BMC network serial port obtains the frame image data, it decompresses it to obtain the picture, and then through the method of OCR image text recognition, after steps such as image preprocessing, character segmentation, feature extraction, character recognition, error correction and formatting, the content in the picture is recognized as pure text characters. The BMC network serial port background process sends the recognized characters to the user's network serial port tool, and the user can see the content of the server system VGA screen.
[0062] 2) Embodiment 2
[0063] As Figure 3As shown in the figure, the command-line tool (such as cmdKVM) connects to the target network interface (such as the KVM interface) that provides the standard wss protocol of the BMC through websocket, for example, wss: / / bmc-ip / kvm / 0. After the connection is successful, the compressed image frame data is obtained. By decompressing, the picture is obtained, and then through the OCR image text recognition method, after image preprocessing, character segmentation, feature extraction, character recognition, error correction and formatting and other steps, the content in the picture is recognized as pure characters. After obtaining the recognized pure characters, they are output to the user's command-line terminal, and the user can view the content of the server operating system VGA screen. As another possible implementation method, cmdKVM obtains keyboard operations from the standard input interface and sends the keyboard operations to the BMC through wss to implement operations on the server system.
[0064] According to the method for obtaining display content provided by the embodiment of the present application, by obtaining the display screen data of the target terminal and displaying the display screen data in text form on the operation terminal of the pure command-line operating system, it is realized to directly view the graphical interface content of the server in the pure command-line operating system, with high applicability, without switching to the operating system with a graphical interface, so that users can manage and operate the server more efficiently.
[0065] Secondly, the embodiment of the present application also provides another method for obtaining display content, which is applied to the operation terminal of the pure command-line operating system, such as Figure 4 As shown in the figure, it includes the following steps
[0066] In step S201, a target acquisition instruction is generated according to the user's command-line operation.
[0067] It can be understood that the user inputs a specific command-line instruction in the pure command-line operating system to generate a target acquisition instruction, and the target acquisition instruction can be to obtain the graphical screen display content of the target terminal located at 192.168.1.100.
[0068] In step S202, the target acquisition instruction is sent to the target terminal, where the target terminal responds to the target acquisition instruction, obtains the display screen data of the target terminal, and recognizes the text content displayed in the display screen data.
[0069] In the embodiment of the present application, by sending the target acquisition instruction to the BMC of the target terminal, the BMC of the target terminal (server) performs corresponding operations after receiving the target acquisition instruction, and switches the input source of the network serial port to the interactive interface (i.e., VGA screen). The KVM background process of the BMC captures the current display screen data from the graphical interface driver of the target terminal, compresses it into a format suitable for network transmission, and sends the display screen data to the background process of the target network serial port. After receiving the compressed image frame data, the network serial port background process of the BMC decompresses it and recognizes the text content in the image through OCR image text recognition technology.
[0070] In another possible implementation, the command line tool cmdKVM uses a specific network protocol (such as the wss protocol) to connect to the target network interface (KVM interface) of the remote desktop function. In the actual execution process, the command line tool initiates a connection request to the target network interface through the wss protocol. During the connection process, identity authentication may be required to ensure that only authorized users can access the graphical interface of the target terminal. After the command line tool cmdKVM successfully connects to the KVM interface of the target terminal, it is ready to receive display screen data. The BMC of the target terminal runs the background process of the remote desktop function and the background process of the target network serial port. The background process of the remote desktop function is responsible for capturing the output signal of the graphical interface of the target terminal and compressing it into a format suitable for network transmission (such as JPEG or PNG). The background process of the target network serial port is responsible for managing and maintaining the communication of the network serial port.
[0071] The command line tool obtains compressed image frame data from the background process of the remote desktop function through the wss protocol, and sends the received display screen data to the background process of the target network serial port through the target network interface. After the background process of the target network serial port receives the display screen data, it decompresses and processes the text content in the recognized image, and the recognized text content is output to the user's operation end through the command line tool.
[0072] In step S203, the text content displayed in the target terminal interaction interface is displayed.
[0073] It should be noted that the method for obtaining display content in the embodiment of the present application is applied to an operating terminal of a pure command line operating system. For details, please refer to the above embodiment. To avoid redundancy, it will not be elaborated here.
[0074] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0075] An embodiment of the present application further provides an acquisition device 10 for display content. The device is applied to a target terminal and includes: an acquisition module 101 for acquiring a target acquisition instruction of an operation terminal of a pure command-line operating system; a response module 102 for responding to the target acquisition instruction and acquiring display screen data of the target terminal; a first sending module 103 for identifying the text content displayed in the display screen data and sending the text content to the operation terminal.
[0076] In some embodiments, the response module 102 is further configured to respond to the target acquisition instruction, start the remote desktop function of the target terminal; switch the input source of the target network serial port of the remote desktop function to the interactive interface; and acquire the display screen data of the interactive interface from the driver of the interactive interface.
[0077] In some embodiments, the response module 102 is further configured to acquire the display screen data of the interactive interface from the driver of the interactive interface through the background process of the remote desktop function; and send the display screen data to the background process of the target network serial port.
[0078] In some embodiments, the response module 102 is further configured to respond to the target acquisition instruction, start a command-line tool for implementing the remote desktop function. The command-line tool is connected to the target network interface of the remote desktop function through a target protocol; after the command-line tool is successfully connected to the target network interface, the command-line tool acquires the display screen data of the interactive interface from the background process of the remote desktop function and sends the display screen data to the background process of the target network serial port through the target network interface.
[0079] In some embodiments, the command-line tool is further configured to acquire a target operation instruction of the operation terminal from the target network interface, send the target operation instruction to the background process of the remote desktop function, and the background process of the remote desktop function responds to the target operation instruction.
[0080] An embodiment of the present application further provides an acquisition device 20 for display content. The device is applied to an operation terminal of a pure command-line operating system and includes: a generation module 201 for generating a target acquisition instruction according to a user's command-line operation; a second sending module 202 for sending the target acquisition instruction to the target terminal, where the target terminal responds to the target acquisition instruction, acquires the display screen data of the target terminal, and identifies the text content displayed in the display screen data; a display module 203 for displaying the text content displayed in the interactive interface of the target terminal.
[0081] It should be noted that for the description of the features in the corresponding embodiments of the acquisition device for display content in the embodiments of the present application, reference may be made to the relevant descriptions in the corresponding embodiments of the acquisition method for display content. To avoid redundancy, they will not be elaborated here one by one.
[0082] The display content acquisition device according to the embodiments of the present application obtains the display screen data of the target terminal and displays the display screen data in text form on the operation terminal of the pure command-line operating system, so as to directly view the graphical interface content of the server in the pure command-line operating system, with high applicability and without the need to switch to an operating system with a graphical interface, enabling users to manage and operate the server more efficiently. Thus, the problem that the related technology cannot meet the user's need to view the operating system screen content of the server in different operating system environments is solved.
[0083] Embodiments of the present application further provide an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above-described embodiments of the display content acquisition method.
[0084] Embodiments of the present application further provide a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above-described embodiments of the display content acquisition method when running.
[0085] Embodiments of the present application further provide a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the display content acquisition method.
[0086] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. 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 application.
[0087] The above has introduced in detail a display content acquisition method provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for obtaining display content, characterized in that, The method is applied to a target terminal. The method includes: Obtain a target acquisition instruction of an operation terminal of a pure command-line operating system; In response to the target acquisition instruction, obtain the display screen data of the target terminal; Identify the text content displayed in the display screen data, and send the text content to the operation terminal.
2. The method for obtaining the displayed content according to claim 1, wherein The step of "In response to the target acquisition instruction, obtain the display screen data of the target terminal" includes: In response to the target acquisition instruction, start the remote desktop function of the target terminal; Switch the input source of the target network serial port of the remote desktop function to the interactive interface; Obtain the display screen data of the interactive interface from the driver of the interactive interface.
3. The method for obtaining the display content according to claim 2, wherein The step of "Obtain the display screen data of the interactive interface from the driver of the interactive interface" includes: Obtain the display screen data of the interactive interface from the driver of the interactive interface through the background process of the remote desktop function; Send the display screen data to the background process of the target network serial port.
4. The method for obtaining the displayed content according to claim 1, wherein The step of "In response to the target acquisition instruction, obtain the display screen data of the target terminal" includes: In response to the target acquisition instruction, start a command-line tool for implementing the remote desktop function. The command-line tool is connected to the target network interface of the remote desktop function through a target protocol; After the command-line tool is successfully connected to the target network interface, the command-line tool obtains the display screen data of the interactive interface from the background process of the remote desktop function, and sends the display screen data to the background process of the target network serial port through the target network interface.
5. The method for obtaining the display content according to claim 4, wherein The command-line tool is further configured to obtain a target operation instruction of the operation terminal from the target network interface, send the target operation instruction to the background process of the remote desktop function, and the background process of the remote desktop function responds to the target operation instruction.
6. A method for obtaining display content, characterized in that The method is applied to an operation terminal of a pure command-line operating system. The method includes: Generate a target acquisition instruction according to the command-line operation of the user; Send the target acquisition instruction to the target terminal. The target terminal responds to the target acquisition instruction, obtains the display screen data of the target terminal, and identifies the text content displayed in the display screen data; Display the text content displayed in the interactive interface of the target terminal.
7. An apparatus for obtaining display content, characterized in that, The device is applied to a target terminal and includes: An acquisition module, configured to obtain a target acquisition instruction of an operation terminal of a pure command-line operating system; A response module, configured to obtain the display screen data of the target terminal in response to the target acquisition instruction; A first sending module, configured to identify the text content displayed in the display screen data and send the text content to the operation terminal.
8. An apparatus for obtaining display content, characterized in that, The device is applied to an operation terminal of a pure command-line operating system and includes: A generation module, configured to generate a target acquisition instruction according to the command-line operation of the user; A second sending module, configured to send the target acquisition instruction to the target terminal. The target terminal responds to the target acquisition instruction, obtains the display screen data of the target terminal, and identifies the text content displayed in the display screen data; A display module for displaying the text content shown in the target terminal interaction interface.
9. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for implementing the steps of the method for obtaining the display content according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, characterized in that A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the method for obtaining the display content according to any one of claims 1 to 6 when executed by a processor.