Command block rendering method and device, storage medium and electronic equipment
By processing and inserting the control symbol in the character stream to form a command block information, the generality and mixtable problem of the command block rendering scheme in the existing technology are solved, and the command block rendering and extensions of the cross -platform command block are realized.
Patent Information
- Application Number
- CN202310888177.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-19
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art lacks a technical solution that can independently and independently perform command block rendering on the terminal, and most mature command block rendering solutions are based on specific operating systems and operating environments, with poor versatility and portability, and high portability.
By capturing the target command on the server side and inserting the control symbol in the character stream where the target command is located, the command block information is formed.
It implements cross-platform and highly versatile command block rendering, which facilitates users to observe command content and command execution results, and provides extended functions based on command block information.
Smart Images

Figure CN119336423A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a command block rendering method, device, storage medium, and electronic device. Background Art
[0002] The related art lacks a technical solution that can independently render command blocks on the terminal. The so-called technical solution for command block rendering is a technical solution that organizes and displays commands and corresponding command execution results in the form of command blocks, and can further edit and display the command blocks after display. Most of the more mature command block rendering solutions in the related art are based on specific operating systems and operating environments, with poor versatility and portability, and are also difficult to transplant. Summary of the invention
[0003] In order to solve at least one of the above technical problems, the embodiments of the present application provide a command block rendering method, device, storage medium and electronic device to solve the technical problems that the related technology lacks a technical solution that can independently perform command block rendering on a terminal, and that more mature command block rendering solutions are mostly based on specific operating systems and operating environments, have poor versatility and portability, and are also difficult to port.
[0004] On the one hand, an embodiment of the present application provides a command block rendering method, which is applied to a page program, and the method includes:
[0005] When an acquisition action of a target command is detected, inserting a first control character and a command prompt corresponding to the target command into a character stream, wherein the first control character is used to indicate a start position of a command block corresponding to the target command;
[0006] After the target command is executed, a second control character is inserted into the character stream, the second control character is used to indicate the end position of the command block corresponding to the target command, the first control character, the target command and the second control character form command block information in the character stream, and the command block information is used to indicate that the target command is displayed in the form of a command block;
[0007] The target command is displayed on the target interface in the form of a command block by rendering the character stream.
[0008] On the other hand, an embodiment of the present application provides a command block rendering device, which is applied to a page program, and the device includes:
[0009] A character stream control module, configured to, when an acquisition action of a target command is detected, insert a first control character and a command prompt corresponding to the target command into a character stream, wherein the first control character is used to indicate a start position of a command block corresponding to the target command; and, after the target command is executed, insert a second control character into the character stream, wherein the second control character is used to indicate an end position of a command block corresponding to the target command, wherein the first control character, the target command and the second control character form command block information in the character stream, wherein the command block information is used to indicate that the target command is displayed in the form of a command block;
[0010] The rendering module is used to display the target command in the form of a command block on the target interface by rendering the character stream.
[0011] On the other hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned command block rendering method.
[0012] On the other hand, an embodiment of the present application provides an electronic device, comprising at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the above-mentioned command block rendering method by executing the instructions stored in the memory.
[0013] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which implement the above-mentioned command block rendering method when executed by a processor.
[0014] Embodiments of the present application provide a command block rendering method, device, storage medium and electronic device. The present application provides a command block rendering method, which relies on page development technology to render command blocks, and therefore has the significant advantages of high versatility and cross-platform. The method captures the target command on the server side and inserts a number of control characters in the character stream where the target command is located. These control characters are used to form command block information. The so-called command block information includes all the information required to display the target command in the form of a command block. Since the command block information is formed in the character stream, the terminal directly renders the character stream to present the command block effect on the target interface of the terminal. In other words, the target command and related content can be displayed in the form of a command block, which is convenient for users to observe the command content, command execution results and perform command analysis, and even based on the command block information, the terminal can provide users with extended functions based on the command block corresponding to the command block information. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 It is a schematic diagram of an implementation environment of a command block rendering method provided in an embodiment of the present application;
[0017] Figure 2 It is a flowchart of a command block rendering method provided in an embodiment of the present application;
[0018] Figure 3 It is a flowchart of rendering a character stream provided by an embodiment of the present application;
[0019] Figure 4 This is a schematic diagram of the command block display effect provided in the embodiment of the present application Figure 1 ;
[0020] Figure 5 This is a schematic diagram of the command block display effect provided in the embodiment of the present application Figure 2 ;
[0021] Figure 6 is a block diagram of a command block rendering device provided in an embodiment of the present application;
[0022] Figure 7 It is a schematic diagram of the hardware structure of a device provided in an embodiment of the present application for implementing the method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0025] In order to make the purpose, technical solution and advantages disclosed in the embodiments of the present application more clearly understood, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present application and are not used to limit the embodiments of the present application.
[0026] In the following, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "multiple" means two or more. In order to facilitate the understanding of the above-mentioned technical solutions and the technical effects produced by the embodiments of the present application, the embodiments of the present application first explain the relevant professional terms:
[0027] Cloud technology: refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. It is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool and be used on demand, flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, each resource may have its own identification mark in the future, and all resources need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0028] iOS: is an operating system developed by Apple.
[0029] Application Programming Interface: Application Programming Interface, referred to as API. The main purpose of API is to provide applications and developers with the ability to access a set of routines without having to access the source code or understand the details of the internal working mechanism. The software that provides the functions defined by the API is called the implementation of this API. API is an interface, so it is an abstraction. It is an agreement for the connection between different components of the software system. Due to the increasing scale of software in recent years, it is often necessary to divide complex systems into small components, and the design of programming interfaces is very important. In the practice of programming, the design of programming interfaces must first make the responsibilities of the software system reasonably divided. Good interface design can reduce the interdependence of various parts of the system, improve the cohesion of the components, and reduce the degree of coupling between the components, thereby improving the maintainability and scalability of the system.
[0030] Graphics Processing Unit, referred to as GPU, also known as display core, visual processor, display chip, is a microprocessor that specializes in image and graphics related computing on personal computers, workstations, game consoles and some mobile devices (such as tablets, smart phones, etc.). GPU reduces the graphics card's dependence on the central processor and performs some of the original work of the central processor, especially in 3D graphics processing. The core technologies used by GPU include hardware T&L (geometry transformation and lighting processing), cubic environment material mapping and vertex blending, texture compression and bump mapping, dual texture four-pixel 256-bit rendering engine, etc., and hardware T&L technology can be said to be the hallmark of GPU.
[0031] Rust: is a system programming language that focuses on safety, especially concurrency safety, and supports functional, imperative, and generic programming paradigms. Rust is similar to C++ in syntax, but the designers want to provide better memory safety while ensuring performance. Rust's designers optimized the Rust language and Rust compiler based on the experience they accumulated in developing the layout engine for website browsers.
[0032] Metal: It is a low-level graphics programming interface that can directly operate the GPU by using related APIs. The Metal framework supports GPU hardware acceleration, advanced stereo graphics rendering, and large data parallel computing. It provides advanced and streamlined APIs to ensure the fine-grainedness of the framework, and supports low-level control in organizational structure, program processing, graphics rendering, operation instructions, and management of instruction-related data resources. Its core purpose is to reduce the CPU overhead as much as possible, and hand over most of the runtime load to the GPU.
[0033] Metal is a graphics programming interface unique to iOS. It describes buffer and texture objects that represent memory allocations for the GPU. Texture objects have specific pixel formats and can be used for texture images or attachment objects, using the same data structures and resources (such as buffers, textures, and command queues) for graphics and computing operations. In addition, the Metal shading language supports graphics and computing functions. Metal shaders can be loaded and compiled at runtime like code, which has the benefit of better code generation and compilation debugging.
[0034] Warp: is a new high-performance terminal built entirely on Rust that makes software development more efficient. The command input editor is a full-text editor that supports selection, cursor positioning, and shortcuts, just like in other applications. Commands and their outputs are visually grouped into blocks, namely command blocks. And configure corresponding visual menus to make them easier to use. Warp uses Rust and Metal to complete high-performance visual rendering of commands and command execution results. That is, Warp uses a combination of Rust and Metal to implement the command block rendering solution.
[0035] In fact, Warp is a relatively mature or high-performance command block rendering solution in the relevant technology. In this rendering solution, commands and command execution results are rendered in the form of Block command blocks. Warp is specifically developed in Rust, and is a technical solution that uses Metal for GPU rendering in desktop terminals based on iOS operating systems. The rendering logic of the Block command block can be simply explained as distinguishing the command prompt, command input, and command output, and then independently controlling the rendering of the command and command execution results based on the distinction results.
[0036] However, Warp is just a desktop application and can only be used on the iOS operating system. If you design and implement a solution similar to Warp yourself, that is, design a technical solution that can independently control commands and render command execution results while maintaining relatively good performance, it will be difficult to implement. Of course, this is also the reason why Warp currently only supports the iOS desktop environment and is difficult to migrate to other operating systems or other hardware and software platforms.
[0037] TypeScript: It is an open source programming language developed by Microsoft. After being compiled by the TypeScript compiler, TypeScript can run on any browser and any operating system.
[0038] Xterm.js: Xterm.js refers to Xterm. Xterm is a front-end terminal component written in TypeScript that can implement a command-line terminal application directly in the browser. Xterm.js is suitable for most terminal applications, including support for application and mouse events. Xterm.js is very fast and even includes a GPU-accelerated renderer. The API provided in Xterm.js can be used to control the rendering of the command line and command execution results.
[0039] Shell: In computer science, Shell can refer to software that "provides an operating interface for users" (Command Interpreter, command parser). It receives user commands and then calls the corresponding application.
[0040] From the above, it can be seen that the related art lacks a technical solution that can independently render command blocks on the terminal. The so-called technical solution for command block rendering is a technical solution that organizes and displays commands and corresponding command execution results in the form of command blocks, and after display, the command blocks can be further edited and displayed. The more mature command block rendering solution in the related art is Warp, but Warp can only be applied to the desktop environment of the iOS system, with poor versatility and portability, and the difficulty of porting is also relatively high. In view of this, the present application proposes a command block rendering method, which relies on page development technology to render command blocks, so it has the significant advantages of high versatility and cross-platform. The method captures the target command on the server side and inserts several control characters in the character stream where the target command is located. These control characters are used to form command block information. The so-called command block information includes all the information required to display the target command in the form of a command block. Since the command block information is formed in the character stream, the terminal directly renders the character stream to present the command block effect on the target interface of the terminal. That is to say, the target command and related content can be displayed in the form of a command block, which makes it convenient for users to observe the command content, command execution results and perform command analysis. Based on the command block information, the terminal can even provide users with extended functions based on the command block corresponding to the command block information.
[0041] In some application scenarios, the command block rendering method provided in the embodiment of the present application can be applied to the field of smart transportation. For example, when the vehicle-mounted terminal communicates with the corresponding background server, the command block rendering method provided in the embodiment of the present application can be used to render the interactive data between the vehicle-mounted terminal and the corresponding background server.
[0042] Please refer to Figure 1, which shows a schematic diagram of an application program running environment provided by an embodiment of the present application. The application program running environment may include: a terminal 10 and a server 20.
[0043] The terminal 10 includes, but is not limited to, electronic devices such as mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, game consoles, e-book readers, multimedia playback devices, wearable devices, etc. The terminal 10 may be installed with a client of an application program.
[0044] In an embodiment of the present application, the above-mentioned application can be any application that can provide page access services. Typically, the application is a web browsing application. Of course, in addition to web browsing applications, other types of applications can also provide information flow content services. For example, news applications, social applications, interactive entertainment applications, browser applications, shopping applications, content sharing applications, virtual reality (VirtualReality, VR) applications, augmented reality (AugmentedReality, AR) applications, etc., which are not limited in the embodiment of the present application. In addition, for different applications, their corresponding functions will also be different, which can be pre-configured according to actual needs, which is not limited in the embodiment of the present application. Optionally, a client of the above-mentioned application is running in the terminal 10.
[0045] The server 20 is used to provide background services for the client of the application in the terminal 10. For example, the server 20 can be the background server of the above-mentioned application, or it can be a management server set up to access the background server. In other words, the above-mentioned server is used to manage the page server, and the above-mentioned terminal is used to indirectly access the target service by accessing the above-mentioned server, that is, the target service is the background server of the application, and the above-mentioned target service is the management object of the page server management. The server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the server 20 provides background services for applications in multiple terminals 10 at the same time.
[0046] Optionally, the terminal 10 and the server 20 may communicate with each other via a network 30. The terminal 10 and the server 20 may be directly or indirectly connected via wired or wireless communication, which is not limited in the present application.
[0047] The following describes a command block rendering method according to an embodiment of the present application. Figure 2 A flow chart of a command block rendering method provided by an embodiment of the present application is shown. The command block rendering method can be executed in a page program, and the instructions or codes corresponding to the command block rendering method can be recorded in a page script. The embodiment of the present application provides method operation steps as described above in the embodiment or flowchart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only order of execution. When the actual system, terminal device or server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. The above method may include:
[0048] S201. When an acquisition action of a target command is detected, a first control character and a command prompt corresponding to the target command are inserted into a character stream, wherein the first control character is used to indicate a start position of a command block corresponding to the target command.
[0049] If the terminal 20 receives a command input by the user, the command can be transmitted to the server 10, and the server 10 thus receives a character stream. The embodiment of the present application does not limit the way in which the user inputs a command in the terminal 20. For example, the terminal 20 can display a command line input interface, and by typing a command into the command line input interface, a byte stream can be formed, and the byte stream is transmitted to the server 10.
[0050] In the embodiment of the present application, the server 10 and the terminal 20 communicate bidirectionally, so the server 10 can receive a character stream, which includes a target command input by a user. When the page program on the server side detects that there is a target command in the character stream, a first control symbol and a command prompt corresponding to the target command can be inserted, and the first control symbol is used to indicate the start position of the command block corresponding to the target command.
[0051] The embodiment of the present application does not limit the target command, which can be understood as any command entered by the user in the command line input interface. Alternatively, the user can also enter a command based on the Shell connected between the terminal 20 and the remote server, and the input command can also be used as the target command.
[0052] In a specific embodiment, the page program includes a first hook function, and the above-mentioned page program inserts the first control character and the command prompt corresponding to the target command in the character stream when the acquisition action of the target command is detected, including: inserting the first control character and the command prompt in the character stream by executing the first hook function when the acquisition action of the target command is detected. In a specific embodiment, the first hook function is a preexec function, which is set based on the open source project bash-preexec. The first hook function can be used to insert the first control character and the command prompt corresponding to the target command in the character stream. That is, when the acquisition action of the target command is detected, that is, after the user enters the command and runs it in the terminal 20, the server 10 can detect the existence of the target command in the character stream, and the server 10 will call the first hook function to insert the first control character and the command prompt corresponding to the target command in the character stream.
[0053] The embodiment of the present application does not limit the specific content of the first hook function, as long as it can achieve the purpose of inserting the first control character and the command prompt corresponding to the target command into the character stream when the acquisition action of the target command is detected. Exemplarily, the first hook function can be:
[0054] preexec(){printf"\x1B]1337; PreExecMarker\x7";}
[0055] Specifically, PreExecMarker is a special character used to split character streams, which can be regarded as the first control character, and \x1B and \x7 are display control characters used to control the display of command blocks. Display control characters are invisible. The \x1B output by the first hook function book is an identification symbol for a control character, and the characters wrapped by it and \x7 will not be displayed on the terminal.
[0056] S202. After the execution of the above-mentioned target command is completed, a second control character is inserted into the above-mentioned character stream, and the above-mentioned second control character is used to indicate the end position of the command block corresponding to the above-mentioned target command. The above-mentioned first control character, the above-mentioned target command and the above-mentioned second control character form command block information in the above-mentioned character stream, and the above-mentioned command block information is used to indicate that the above-mentioned target command is displayed in the form of a command block.
[0057] The embodiment of the present application does not elaborate on the execution process of the target command, because the command block rendering method in the embodiment of the present application has no effect on the original execution process of the target command. The target command can be executed according to the original execution logic, but step S202 will be executed after the target command is executed.
[0058] In the specific execution process, some relevant information can also be added to the command block information. For example, in a feasible implementation, the execution result of the above-mentioned target command can be inserted into the above-mentioned command block information. For example, whether the target command is executed successfully or failed, and different display control information can even be set for different execution results, so that the terminal can display different command execution results with different display effects. By inserting the execution result into the command block information, after the front end obtains the command block information, it can display different background colors for command blocks with different execution results.
[0059] For example, if the target command is successfully executed, a green execution result or command block can be displayed, and if the target command is not successfully executed, a red execution result or command block can be displayed. This makes it easier for users to observe the target command and the execution result of the target command, and improves the expressiveness of the command block rendering effect.
[0060] In some feasible implementations, additional information corresponding to the target command may also be inserted into the command block information, and the additional information includes at least one of the following: path information associated with the target command, and file information associated with the target command. For example, by inserting the path information associated with the target command into the command block information, the terminal may display the path information, which may support some extended functions of the terminal, such as upload and download functions based on the path information. For example, in conjunction with the file upload function, the file may be dragged and dropped to the user's current directory with one click, thereby improving the user's experience. For another example, by inserting the file information associated with the target command into the command block information, the terminal may display the file information, which may support some extended functions of the terminal, such as, in conjunction with the file download function, the file may be dragged and dropped to download the file corresponding to the file information to the local computer with one click, thereby improving the user's experience.
[0061] In some embodiments, display control information corresponding to the target command may also be inserted into the command block information, and the display control information includes at least one of the following: first display control information for the target command, second display control information for the execution result of the target command, and third display control information for the additional information corresponding to the target command. The display control information is used to control at least one of the following display parameters: color, font, brightness, fill color, font size, information display effect. This application does not limit the information display effect. For example, it can be set whether to display in black, bold, underline, shadow, artistic text, etc.
[0062] The first display control information, the second display control information and the third display control information may all include at least one display parameter. The present application does not limit the specific content of the first display control information, the second display control information and the third display control information, which may present personalized adaptation capabilities according to specific scenarios.
[0063] For example, for a target command of querying system parameters, the corresponding first display control information includes display parameters such as black, non-highlighted, and yellow fill color. For a target command of file operation, the corresponding first display control information includes display parameters such as red, non-highlighted, and no fill color.
[0064] For another example, for a target command that is successfully executed, the corresponding second display control information includes a green background color, and for a target command that is not successfully executed, the corresponding second display control information includes a red background color.
[0065] The embodiments of the present application are not limited to the specific function of inserting the above-mentioned display control information, related information or target command execution results in the command block. Such information can also be inserted into the character stream in the second hook function below. Of course, the character stream can also be inserted by executing other functions, which is not limited by the embodiments of the present application.
[0066] When the page program on the server side detects that the target command has been executed, the second control character can be inserted into the character stream. In a specific embodiment, the page program includes a second hook function, and both the first hook function and the second hook function can be configured based on the hook function provided by the open source page programming project; after the target command is executed, the second control character is inserted into the character stream, including: after the target command is executed, the second control character is inserted into the character stream by executing the second hook function.
[0067] In a specific embodiment, the second hook function is a precmd function, which is set based on the open source project bash-preexec. Bash-preexec can automatically call these two methods at the right time when the two hook functions preexec and precmd exist in the current environment. Among them, preexec: This hook function is executed after the user's target command is read and before the target command is executed. precmd: This hook function is executed before each command prompt is output. In a specific embodiment, the second hook function can be used to insert the above-mentioned second control character into the above-mentioned character stream. That is to say, before detecting that the target command has been executed and has not been output, the server 10 can call the second hook function to insert the above-mentioned second control character into the above-mentioned character stream.
[0068] The embodiment of the present application does not limit the specific content of the second hook function, as long as it can achieve the purpose of inserting the second control symbol into the character stream after the target command is executed. Exemplarily, the second hook function can be:
[0069] precmd(){printf"\x1B]1337;PostExecMarker;Exit=$?;CurrentDir=$(pwd);\x7";}
[0071] Specifically, PostExecMarker is also a special character used to separate character streams, which can be regarded as the second control character. Exit indicates the execution result of the target command, and CurrentDir indicates the file path related to the target command.
[0072] It can be seen that there is a target command in the character stream, and there is also a first control symbol and a command prompt inserted by the first hook function, and a second control symbol inserted by the second hook function, so that the first control symbol, the target command and the second control symbol form a complete command block information in the character stream, and the command block information is a discrete structured data formed according to the logical order of command prompt->command->execution result->command prompt. The command block information is used to indicate that the target command is displayed in the form of a command block. The purpose of this operation is to use these two hook functions to insert the first control symbol and the second control symbol, so as to separate the information related to the target command and form the command block information. After such a character stream is output to the front end, the relevant information of the target command can be displayed in the form of a command block. Obviously, in the command block information, it is easy to determine which are command prompts, which are commands, and which are the execution results of commands.
[0073] S203. Display the target command in the form of a command block on the target interface by rendering the character stream.
[0074] Since the character stream includes the command block information, the terminal 20 does not need to process the character stream again, but only needs to display it directly to directly present the command block. Figure 3 , which shows a flow chart of rendering character stream:
[0075] S301. When the command prompt is detected, a target instance is created based on the front-end terminal component, and the target instance corresponds to the command line rendering mode.
[0076] After the front end receives the character stream, it can match special characters such as PreExecMarker and PostExecMarker output by the hook function above through regular expressions, so that the continuous character stream can be split and the command block information can be obtained.
[0077] The purpose of using the front-end terminal component to render the character stream is to achieve a cross-platform effect. The present application does not limit the front-end terminal component used. For example, in one embodiment, the front-end terminal component may be xterm.js. Specifically, the current output is a command prompt, and an xterm instance is created. xterm is the target instance, and the target instance can render the command block in the command line rendering mode.
[0078] S302. Based on the target instance, create a canvas associated with the target interface.
[0079] After the target instance is created, a canvas for performing rendering operations can be created. The embodiment of the present application does not limit the canvas, and the xterm target instance can create a Canvas canvas by itself. Canvas is a kind of canvas, which is a "container" for all user interface components in the game. In a scene, multiple Canvas canvases can be allowed to exist, and Canvas canvases can be nested. Any user interface object in the scene can be a child of a Canvas canvas. Canvas can accommodate all user interface elements. Canvas is a collection of mounted Canvas components, and all user interface elements are its child nodes. The Canvas area is displayed as a rectangle in the view to help view the location of all user interface elements.
[0080] S303. Render the canvas based on the command block information.
[0081] Since the command block information may include various information for controlling the display, directly rendering the command block information can achieve the technical effect of presenting the target command and related information in the form of a command block.
[0082] In one embodiment, after displaying the target command in the form of a command block on the target interface by rendering the character stream, the method further comprises: acquiring target command block information of the target command block when a selection operation on the target command block is detected, where the target command block is any command block displayed on the target interface;
[0083] When the target command block information is obtained, at least one of the following operations may be performed:
[0084] (1) When an upload operation for a file is detected, the file is uploaded to the location indicated by the path information in the target command block information.
[0085] For example, a control for uploading files can be displayed on the target interface. In response to the control being triggered, the location indicated by the path information can be displayed, and then the user is supported to drag the file to the location indicated by the path information, thereby uploading the above file to the location indicated by the path information in the above target command block information.
[0086] (2) When a download operation for a file is detected, the file is downloaded at a location indicated by the path information in the target command block information.
[0087] For example, a control for file downloading can be displayed on the target interface. In response to the control being triggered, all files at the location indicated by the path information can be displayed, and the user can be supported to drag at least one of the files to the local computer, thereby downloading the above files to the local computer.
[0088] (3) In response to the detected editing instruction, the target command block information is edited, wherein the editing includes at least one of the following: copying, pasting, cutting, and marking.
[0089] For example, an edit bar may be displayed directly on the target interface or in response to certain user operations, and the edit bar may be used to edit the information of the target command block, such as copying, pasting, cutting, marking, and the like.
[0090] In one embodiment, the target interface can also display a display control control for the target command block, and the display control control is used to perform at least one of the following operations: setting the display parameters of the target command block, the display parameters include: folding display indication parameters, unfolding display indication parameters, height adjustment parameters, font size adjustment parameters, display background parameters, and display foreground parameters; displaying the associated information of the target command block, the associated information includes at least one of the following: context information of the target command block, and static attribute information of the target command block. The folding display indication parameter and the unfolding display indication parameter are used to indicate whether the target command block is folded or unfolded, respectively, and the height adjustment parameter, the font size adjustment parameter, the display background parameter, and the display foreground parameter can be used to adjust the height, font size, background effect, and foreground effect of the target command block, respectively. The context information of the target command block may include part of the upstream and downstream information of the target command block, and the static attribute information may include inherent information such as the generation time of the target command block. Of course, the embodiment of the present application does not limit the specific content of the display parameters and associated information, and can be set according to actual conditions.
[0091] In the embodiment of the present application, the commands input by the user, the command execution results, etc. are output and displayed in the canvas. If the current command execution error occurs, a conspicuous background color can be set for the current canvas. When the next command prompt is encountered, another xterm target instance is created, and then the same steps as above are performed. In this way, the Canvas canvases are rendered one by one command blocks respectively to form a list of command blocks. After displaying in this way, the command blocks output are not only split at the data level, but also split at the display layer, so that the command blocks required by the user can be accurately obtained through the interactive mode of the keyboard and mouse, and the functions such as the copying of commands and command results are provided through the form of the right-click menu. Further, by such a display mode, the expansion and folding of the command blocks can be realized, which is actually the setting of the height of the display layer command blocks.
[0092] In one embodiment, the command block rendering method of the embodiment of the present application can be implemented under a server-client architecture, that is, the above-mentioned page program includes a first page program applied to the server and a second page program applied to the terminal.
[0093] The above-mentioned inserting the first control character and the command prompt corresponding to the target command in the character stream when the acquisition action of the target command is detected includes: inserting the first control character and the command prompt corresponding to the target command in the character stream when the first page program detects the acquisition action of the target command. The above-mentioned inserting the second control character in the character stream after the execution of the target command is completed includes: the first page program inserts the second control character in the character stream after the execution of the target command is completed. That is to say, the formation of the command block information is completed on the server side, and the first hook function and the second hook function can also be set in the first page program.
[0094] The above-mentioned method of rendering the above-mentioned character stream to display the above-mentioned target command in the form of a command block on the target interface includes: the above-mentioned first page program transmits the above-mentioned character stream to the above-mentioned second page program, and the above-mentioned second page program renders the above-mentioned character stream on the target interface of the above-mentioned terminal. The rendering of the character stream is completed in the terminal, that is, the terminal realizes the display of the command block.
[0095] The embodiment of the present application does not limit the specific functions implemented based on the server-client architecture. In one embodiment, the above-mentioned server is used to manage the page server, and the above-mentioned terminal is used to indirectly access the target service by accessing the above-mentioned server, and the above-mentioned target service is the management object managed by the page server. In one embodiment, the server can be a user's web page version of the server management tool, which remotely operates the server corresponding to its management object by means of commands, thereby providing users with support for the target service. If the command received and input in the page server management tool is too long, it may cause the user to be unable to quickly lock the valid information of the command in the session, thereby efficiently analyzing the information of the machine. Therefore, the first page program provided by the embodiment of the present application can be injected into the server management tool, so as to obtain the command block information based on the command. Then, the rendering is completed based on the command block at the terminal, and the correct verification coloring ability of the command can also be provided at the same time to facilitate the user to perceive the legitimacy of the command, quickly find the crux of the problem, so as to solve the problem efficiently.
[0096] Please refer to Figure 4 and Figure 5 , which shows a schematic diagram of the command block display effect. Obviously, the command block rendering solution in the embodiment of the present application can not only render commands and related information of commands in the form of command blocks, but also provide many extended functions, such as sharing, copying, pasting, adjusting font size, clearing the screen, saving in a specific format (TAT only represents a specific file format), etc.
[0097] The command block rendering method of the embodiment of the present application is actually a scheme that discretizes and structures the command-related data to form a command block, and displays it in a structured manner, and displays the command and the command execution result as a block. The page program and xterm.js used in the embodiment of the present application are both page development technologies, so it is possible to rely on the browser to achieve cross-platform operation. Therefore, the command block rendering method of the embodiment of the present application does not require the user to download the terminal to be convenient to use, and the continuous commands are discretized into command blocks one by one, so that each command block can be provided with functions such as copying commands, copying results, folding and unfolding, which cannot be done before the command block information is constructed, and the independent construction of command block information is also the core content of the specific scheme proposed in the embodiment of the present application, and it is also the key to realize independent and autonomous command block rendering. At the terminal that displays the command block, the embodiment of the present application can realize the functions of folding and unfolding the command block, or scrolling to the specified command block, which can also significantly improve the user experience.
[0098] The present application provides a command block rendering method, which relies on page development technology to render command blocks, so it has the significant advantages of high versatility and cross-platform. The method captures the target command on the server side and inserts a number of control characters in the character stream where the target command is located. These control characters are used to form command block information. The so-called command block information includes all the information required to display the target command in the form of a command block. Since the command block information is formed in the character stream, the terminal directly renders the character stream to present the command block effect on the target interface of the terminal. In other words, the target command and related content can be displayed in the form of a command block, which is convenient for users to observe the command content, command execution results, and perform command analysis. Even based on the command block information, the terminal can provide users with extended functions based on the command block corresponding to the command block information.
[0099] Please refer to Figure 6 , which shows a block diagram of a command block rendering device in this embodiment, the device includes:
[0100] The character stream control module 601 is used to insert a first control symbol and a command prompt symbol corresponding to the target command into the character stream when an acquisition action of a target command is detected, wherein the first control symbol is used to indicate the start position of a command block corresponding to the target command; and after the target command is executed, insert a second control symbol into the character stream, wherein the second control symbol is used to indicate the end position of the command block corresponding to the target command, wherein the first control symbol, the target command and the second control symbol form command block information in the character stream, wherein the command block information is used to indicate that the target command is displayed in the form of a command block;
[0101] The rendering module 602 is used to display the target command in the form of a command block on the target interface by rendering the character stream.
[0102] In one embodiment, the character flow control module 601 is used to perform the following operations:
[0103] The execution result of the above target command is inserted into the above command block information.
[0104] In one embodiment, the character flow control module 601 is used to perform the following operations:
[0105] The additional information corresponding to the target command is inserted into the command block information, wherein the additional information includes at least one of the following: path information associated with the target command and file information associated with the target command.
[0106] In one embodiment, the character flow control module 601 is used to perform the following operations:
[0107] Inserting display control information corresponding to the target command into the command block information, wherein the display control information includes at least one of the following: first display control information for the target command, second display control information for the execution result of the target command, and third display control information for additional information corresponding to the target command;
[0108] The display control information is used to control at least one of the following display parameters: color, font, brightness, fill color, font size, and information display effect.
[0109] In one embodiment, the page program includes a first hook function and a second hook function, wherein the first hook function and the second hook function are configured based on hook functions provided by an open source page programming project; the character flow control module 601 is used to perform the following operations:
[0110] In the case of detecting the acquisition action of the target command, inserting the first control symbol and the command prompt into the character stream by executing the first hook function;
[0111] After the execution of the target command is completed, the second control symbol is inserted into the character stream by executing the second hook function.
[0112] In one embodiment, the rendering module 602 is used to perform the following operations:
[0113] When the command prompt is detected, a target instance is created based on the front-end terminal component, and the target instance corresponds to the command line rendering mode;
[0114] Based on the target instance, create a canvas associated with the target interface.
[0115] Render the canvas based on the command block information.
[0116] In one embodiment, the rendering module 602 is used to perform the following operations:
[0117] In the case where a selection operation for a target command block is detected, target command block information of the target command block is acquired, where the target command block is any command block displayed on the target interface;
[0118] When the target command block information is obtained, at least one of the following operations is performed:
[0119] When an upload operation for a file is detected, uploading the file to a location indicated by the path information in the target command block information;
[0120] In the case where a download operation for a file is detected, downloading the file at a location indicated by the path information in the target command block information;
[0121] In response to the detected editing instruction, the target command block information is edited, and the editing includes at least one of the following: copying, pasting, cutting, and marking.
[0122] In one embodiment, the rendering module 602 is used to perform the following operations:
[0123] Display a display control for the target command block, wherein the display control is used to perform at least one of the following operations:
[0124] Setting display parameters of the target command block, the display parameters including: folding display indication parameter, expanding display indication parameter, height adjustment parameter, font size adjustment parameter, display background parameter, and display foreground parameter;
[0125] The associated information of the target command block is displayed, where the associated information includes at least one of the following: context information of the target command block and static attribute information of the target command block.
[0126] In one embodiment, the page program includes a first page program applied to the server and a second page program applied to the terminal.
[0127] The character flow control module 601 is used to perform the following operations:
[0128] When the first page program detects an acquisition action of a target command, inserting a first control character and a command prompt corresponding to the target command into a character stream;
[0129] The first page program inserts a second control character into the character stream after the target command is executed;
[0130] The rendering module 602 is used to perform the following operations: the first page program transmits the character stream to the second page program, and the second page program renders the character stream on the target interface of the terminal.
[0131] In one embodiment, the server is used to manage the page server, and the terminal is used to indirectly access the target service by accessing the server, and the target service is a management object managed by the page server.
[0132] The device part and the method embodiment in the embodiment of the present application are based on the same inventive concept and will not be described in detail here.
[0133] Further, Figure 7A schematic diagram of the hardware structure of a device for implementing the method provided in the embodiment of the present application is shown. The above device may participate in constituting or include the apparatus or system provided in the embodiment of the present application. Figure 7 As shown, the device 11 may include one or more (112a, 112b, ..., 112n are used to illustrate) processors 112 (the processor 112 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 114 for storing data, and a transmission device 116 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only and does not limit the structure of the electronic device. Figure 7 More or fewer components as shown, or with Figure 7 Different configurations are shown.
[0134] It should be noted that the one or more processors 112 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be fully or partially integrated into any of the other components in the device 11 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0135] The memory 114 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the above-mentioned method in the embodiment of the present application. The processor 112 executes various functional applications and data processing by running the software programs and modules stored in the memory 114, that is, to implement the above-mentioned command block rendering method. The memory 114 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 114 may further include a memory remotely arranged relative to the processor 112, and these remote memories may be connected to the device 11 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0136] The transmission device 116 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by the communication provider of the device 11. In one example, the transmission device 116 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 116 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0137] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the device 11 (or mobile device).
[0138] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of the embodiments of the present application are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0139] Each embodiment in the embodiments of the present application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and server embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0140] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program. The above program may be stored in a computer-readable storage medium, and the above storage medium may be a read-only memory, a disk or an optical disk, etc.
[0141] The instructions in the storage medium can execute a command block rendering method, which is applied to a page program. The method includes:
[0142] When an acquisition action of a target command is detected, inserting a first control symbol and a command prompt symbol corresponding to the target command into the character stream, wherein the first control symbol is used to indicate a start position of a command block corresponding to the target command;
[0143] After the target command is executed, a second control character is inserted into the character stream, the second control character is used to indicate the end position of the command block corresponding to the target command, the first control character, the target command and the second control character form command block information in the character stream, and the command block information is used to indicate that the target command is displayed in the form of a command block;
[0144] By rendering the above character stream, the above target command is displayed on the target interface in the form of a command block.
[0145] In one embodiment, the method further includes:
[0146] The execution result of the above target command is inserted into the above command block information.
[0147] In one embodiment, the method further includes:
[0148] The additional information corresponding to the target command is inserted into the command block information, wherein the additional information includes at least one of the following: path information associated with the target command and file information associated with the target command.
[0149] In one embodiment, the method further includes:
[0150] Inserting display control information corresponding to the target command into the command block information, wherein the display control information includes at least one of the following: first display control information for the target command, second display control information for the execution result of the target command, and third display control information for additional information corresponding to the target command;
[0151] The display control information is used to control at least one of the following display parameters: color, font, brightness, fill color, font size, and information display effect.
[0152] In one embodiment, the page program includes a first hook function and a second hook function, and the first hook function and the second hook function are configured based on hook functions provided by an open source page programming project;
[0153] The inserting of the first control symbol and the command prompt corresponding to the target command into the character stream when the acquisition action of the target command is detected comprises: inserting the first control symbol and the command prompt into the character stream by executing the first hook function when the acquisition action of the target command is detected;
[0154] The inserting of the second control character into the character stream after the target command is executed comprises: inserting the second control character into the character stream by executing the second hook function after the target command is executed.
[0155] In one embodiment, the above-mentioned method of rendering the above-mentioned character stream to display the above-mentioned target command in the form of a command block on the target interface includes:
[0156] When the command prompt is detected, a target instance is created based on the front-end terminal component, and the target instance corresponds to the command line rendering mode;
[0157] Based on the target instance, create a canvas associated with the target interface.
[0158] Render the canvas based on the command block information.
[0159] In one embodiment, after displaying the target command in the form of a command block on the target interface by rendering the character stream, the method further includes:
[0160] In the case where a selection operation for a target command block is detected, target command block information of the target command block is acquired, where the target command block is any command block displayed on the target interface;
[0161] When the target command block information is obtained, at least one of the following operations is performed:
[0162] When an upload operation for a file is detected, uploading the file to a location indicated by the path information in the target command block information;
[0163] In the case where a download operation for a file is detected, downloading the file at a location indicated by the path information in the target command block information;
[0164] In response to the detected editing instruction, the target command block information is edited, and the editing includes at least one of the following: copying, pasting, cutting, and marking.
[0165] In one embodiment, the method further includes:
[0166] Display a display control for the target command block, wherein the display control is used to perform at least one of the following operations:
[0167] Setting display parameters of the target command block, the display parameters including: folding display indication parameter, expanding display indication parameter, height adjustment parameter, font size adjustment parameter, display background parameter, and display foreground parameter;
[0168] The associated information of the target command block is displayed, where the associated information includes at least one of the following: context information of the target command block and static attribute information of the target command block.
[0169] In one embodiment, the page program includes a first page program applied to the server and a second page program applied to the terminal.
[0170] The inserting of the first control character and the command prompt corresponding to the target command into the character stream when the acquisition action of the target command is detected includes: inserting the first control character and the command prompt corresponding to the target command into the character stream when the first page program detects the acquisition action of the target command;
[0171] The inserting of the second control character into the character stream after the target command is executed comprises: the first page program inserting the second control character into the character stream after the target command is executed;
[0172] The method of rendering the character stream to display the target command in the form of a command block on the target interface includes: the first page program transmits the character stream to the second page program, and the second page program renders the character stream on the target interface of the terminal.
[0173] In one embodiment, the server is used to manage the page server, and the terminal is used to indirectly access the target service by accessing the server, and the target service is a management object managed by the page server.
[0174] The above are only preferred embodiments of the embodiments of the present application and are not intended to limit the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A command block rendering method, characterized in that: Applied to a page program, the method comprises: When an acquisition action of a target command is detected, inserting a first control character and a command prompt corresponding to the target command into a character stream, wherein the first control character is used to indicate a start position of a command block corresponding to the target command; After the target command is executed, a second control character is inserted into the character stream, the second control character is used to indicate the end position of the command block corresponding to the target command, the first control character, the target command and the second control character form command block information in the character stream, and the command block information is used to indicate that the target command is displayed in the form of a command block; The target command is displayed on the target interface in the form of a command block by rendering the character stream.
2. The method according to claim 1, characterized in that The method further comprises: The execution result of the target command is inserted into the command block information.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Additional information corresponding to the target command is inserted into the command block information, wherein the additional information includes at least one of the following: path information associated with the target command and file information associated with the target command.
4. The method according to claim 1, characterized in that: The method further comprises: Inserting display control information corresponding to the target command into the command block information, the display control information including at least one of the following: first display control information for the target command, second display control information for the execution result of the target command, and third display control information for additional information corresponding to the target command; The display control information is used to control at least one of the following display parameters: color, font, brightness, fill color, font size, and information display effect.
5. The method according to claim 1, characterized in that The page program includes a first hook function and a second hook function, wherein the first hook function and the second hook function are configured based on hook functions provided by an open source page programming project; The inserting a first control character and a command prompt corresponding to the target command into the character stream when the acquisition action of the target command is detected comprises: inserting the first control character and the command prompt into the character stream by executing the first hook function when the acquisition action of the target command is detected; The inserting the second control character into the character stream after the target command is executed comprises: inserting the second control character into the character stream by executing the second hook function after the target command is executed.
6. The method according to claim 5, characterized in that The method of displaying the target command in the form of a command block on the target interface by rendering the character stream includes: When the command prompt is detected, a target instance is created based on the front-end terminal component, and the target instance corresponds to the command line rendering mode; Based on the target instance, creating a canvas associated with the target interface; The canvas is rendered based on the command block information.
7. The method according to claim 1, characterized in that After displaying the target command in the form of a command block on the target interface by rendering the character stream, the method further includes: In the case where a selection operation for a target command block is detected, target command block information of the target command block is acquired, where the target command block is any command block displayed on the target interface; When the target command block information is obtained, at least one of the following operations is performed: When an upload operation for a file is detected, uploading the file to a location indicated by the path information in the target command block information; In the case where a download operation for a file is detected, downloading the file at a location indicated by the path information in the target command block information; In response to the detected editing instruction, the target command block information is edited, and the editing includes at least one of the following: copying, pasting, cutting, and marking.
8. The method according to claim 7, characterized in that The method further comprises: Display a display control control for the target command block, wherein the display control control is used to perform at least one of the following operations: Setting display parameters of the target command block, the display parameters including: folding display indication parameter, unfolding display indication parameter, height adjustment parameter, font size adjustment parameter, display background parameter, and display foreground parameter; The associated information of the target command block is displayed, where the associated information includes at least one of the following: context information of the target command block and static attribute information of the target command block.
9. The method according to claim 1, characterized in that: The page program includes a first page program applied to the server and a second page program applied to the terminal. The inserting of the first control character and the command prompt corresponding to the target command into the character stream when the acquisition action of the target command is detected comprises: inserting the first control character and the command prompt corresponding to the target command into the character stream when the first page program detects the acquisition action of the target command; The inserting of the second control character into the character stream after the target command is executed comprises: the first page program inserting the second control character into the character stream after the target command is executed; The method of displaying the target command in the form of a command block on the target interface by rendering the character stream includes: the first page program transmits the character stream to the second page program, and the second page program renders the character stream on the target interface of the terminal.
10. The method according to claim 9, characterized in that The server is used to manage the page server, and the terminal is used to indirectly access the target service by accessing the server. The target service is a management object managed by the page server.
11. A command block rendering device, characterized in that: Applied to a page program, the device comprises: A character stream control module, configured to, when an acquisition action of a target command is detected, insert a first control character and a command prompt corresponding to the target command into a character stream, wherein the first control character is used to indicate a start position of a command block corresponding to the target command; and, after the target command is executed, insert a second control character into the character stream, wherein the second control character is used to indicate an end position of a command block corresponding to the target command, wherein the first control character, the target command and the second control character form command block information in the character stream, wherein the command block information is used to indicate that the target command is displayed in the form of a command block; The rendering module is used to display the target command in the form of a command block on the target interface by rendering the character stream.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement a command block rendering method as described in any one of claims 1 to 10.
13. An electronic device, characterized in that: It includes at least one processor and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor implements a command block rendering method as described in any one of claims 1 to 10 by executing the instructions stored in the memory.
14. A computer program product, characterized in that The method comprises a computer program or an instruction, which, when executed by a processor, implements a command block rendering method as claimed in any one of claims 1 to 10.