Command execution method and device, electronic equipment and storage medium
By encapsulating the operation process into scripts and generating visual plug-ins, the problem of manually inputting complex commands in software development and testing is solved, and the effect of automating tasks and lowering the threshold for use is achieved.
Patent Information
- Application Number
- CN202411492618.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-14
AI Technical Summary
During software development and testing, developers need to manually enter complex commands to perform tasks, such as debugging WebView, installing App packages, exporting application logs and hardening files, resulting in high labor costs and low efficiency.
By encapsulating the operation process into a script and visualizing the script, a visual plug-in is generated and displayed in the foreground application of the electronic device. When the user selects the visual plug-in, the corresponding scripting operation is performed on another device connected to the communication.
Automate the execution of repetitive tasks, improve work efficiency, simplify complex commands and manual operations through visual plug-ins, and lower the threshold for use.
Smart Images

Figure CN119440344A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a command execution method, device, electronic device and storage medium. Background Art
[0002] Currently, in the existing application development process, developers often face the need to debug WebView components, install App packages, export application logs, and harden applications. However, when performing these tasks, they often need to manually enter complex commands and frequently consult official documents to obtain relevant information. This repetitive manual operation is time-consuming and labor-intensive, and has high labor costs. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to provide a command execution method, device, electronic device and storage medium, which are used to reduce the labor cost of using commands in software development and testing.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a command execution method, which is applied to a first electronic device, and the method includes:
[0005] In some embodiments, a plurality of operation processes are obtained, and each of the operation processes is encapsulated into a script to obtain a plurality of scripts, each operation process corresponds to at least one script, and each operation process includes at least one operation command;
[0006] Performing visualization operations on the multiple scripts respectively to obtain a visualization plug-in corresponding to each script;
[0007] Displaying a plurality of the visual plug-ins in a first application, where the first application is a foreground application of the first electronic device;
[0008] In response to a user's selection operation on a first visualization plug-in among the multiple visualization plug-ins, an operation process in a script corresponding to the first visualization plug-in is executed on a second application, the second application is an application installed on a second electronic device, and the first electronic device and the second electronic device are communicatively connected.
[0009] In some embodiments, the operation flow includes a first flow for debugging a web page view;
[0010] The step of executing the operation flow in the script corresponding to the first visualization plug-in on the second application includes:
[0011] When the script corresponding to the first visualization plug-in includes a first process, executing the first process on the second application;
[0012] The first process includes:
[0013] Calling the Explorer command to obtain the process number and port of the web page view debugging tool in the second application;
[0014] linking the compiler of the first electronic device and the web page view debugging tool of the second electronic device according to the process number port;
[0015] The page of the web view debugging tool is displayed on the browser of the first electronic device.
[0016] In some embodiments, the operational process includes a second process for obtaining duplicate files;
[0017] The step of executing the operation flow in the script corresponding to the first visualization plug-in on the second application includes:
[0018] When the script corresponding to the first visualization plug-in includes a second process, executing the second process on the second application;
[0019] The second process includes:
[0020] Calling a Finder command to scan the global files of the second electronic device using a content duplication checking algorithm to obtain files containing duplicate content;
[0021] The file names and file paths corresponding to the files containing duplicate content are output and displayed on the first electronic device in the form of list groups.
[0022] In some embodiments, the operation process includes a third process for obtaining an installation package;
[0023] The step of executing the operation flow in the script corresponding to the first visualization plug-in on the second application includes:
[0024] When the script corresponding to the first visualization plug-in includes a third process, executing the third process on the second application;
[0025] The third process includes:
[0026] Acquire multiple types of installation packages, send the installation packages to the second electronic device through a Miner command, and control the installation packages to be installed on the second electronic device.
[0027] In some embodiments, the operational process includes a fourth process for exporting a log file;
[0028] The step of executing the operation flow in the script corresponding to the first visualization plug-in on the second application includes:
[0029] In a case where the script corresponding to the first visualization plug-in includes a fourth process, executing the fourth process on the second application;
[0030] The fourth process includes:
[0031] A directory named with the current date and time is created in the first electronic device, and a Traverser command is called to export the log file of the second electronic device to the directory of the first electronic device.
[0032] In some embodiments, the operation process includes a fifth process for document hardening;
[0033] The step of executing the operation process in the script corresponding to the first visualization plug-in on the second application includes:
[0034] In a case where the script corresponding to the first visualization plug-in includes a fifth process, executing the fifth process on the second application;
[0035] The fifth process includes:
[0036] Identify the directory where the script corresponding to the first visualization plug-in is located, and read a reinforcement parameter configuration file, where the reinforcement parameter configuration file is used to configure the file to be reinforced;
[0037] Call the Icesolid command to perform a hardening operation on the files to be hardened configured in the hardening parameter configuration file.
[0038] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a command execution device, the device comprising:
[0039] A packaging module, used to obtain multiple operation processes, package each of the operation processes into a script, and obtain multiple scripts, each operation process corresponds to at least one script, and each operation process includes at least one operation command;
[0040] A visualization module, used to perform visualization operations on the plurality of scripts respectively to obtain a visualization plug-in corresponding to each script;
[0041] A display module, configured to display the plurality of visualization plug-ins in a first application, wherein the first application is a foreground application of the first electronic device;
[0042] A response module is used to respond to a user's selection operation on a first visualization plug-in among multiple visualization plug-ins, and execute an operation process in a script corresponding to the first visualization plug-in on a second application, wherein the second application is an application installed on a second electronic device, and the first electronic device and the second electronic device are communicatively connected.
[0043] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0044] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0045] The present application proposes a command execution method, device, electronic device and storage medium, which encapsulates the operation process into a script, performs visual operations on the script, and generates a corresponding visual plug-in according to the script content; the visual plug-in is displayed in the foreground application of the first electronic device, and when the user selects one or more visual plug-ins, the script operation corresponding to the visual plug-in is run on the second electronic device that is connected to the first electronic device. By encapsulating the operation process into a script, repetitive tasks can be automatically executed to improve work efficiency; through the visual plug-in, complex commands and manual operations are simplified into visual buttons, which reduces the threshold for use. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a flowchart of a command execution method provided by an embodiment of the present application;
[0047] Figure 2 yes Figure 1 Flow chart of step S200 in FIG.
[0048] Figure 3 yes Figure 1 Flow chart of step S400 in FIG.
[0049] Figure 4 is a schematic diagram of the structure of a command execution device provided in an embodiment of the present application;
[0050] Figure 5 yes Figure 4 A schematic diagram of the structure of the device 20;
[0051] Figure 6 yes Figure 4 A schematic diagram of the structure of the device 40;
[0052] Figure 7 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is 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 present application and are not used to limit the present application.
[0054] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0056] First, some nouns involved in this application are analyzed:
[0057] Debugging WebView: is the process of debugging the WebView component embedded in the application, including checking and resolving possible problems with the web pages loaded and rendered in the WebView component. WebView is a client-side browser control used to load and render web pages, but it is not equivalent to a complete browser, so when developing web pages, additional debugging work is required in the WebView environment. WebView allows applications to display web page content in their own interface, and debugging WebView is to ensure that these web page contents can be displayed correctly and function as expected.
[0058] File security hardening: refers to a series of security processing on files to improve their security and prevent malicious attacks. This process includes but is not limited to operations such as hiding, obfuscation, and encryption, and is intended to protect the interests of the software from being damaged. Specifically, the purpose of file hardening is to increase the difficulty for attackers to analyze and modify files by adopting various technical means, such as code obfuscation and shelling, thereby improving the security of files.
[0059] During the APP development process, it is usually necessary to debug WebView, install App packages, export logs, and consolidate files. However, these operations often require developers to manually enter a large number of script commands to complete these tasks. Manual execution of these repetitive operations is not only inefficient but also prone to errors. Developers may have to interrupt the development process because they cannot remember complex commands and consult official documents to find the correct commands and steps, which not only increases the workload but also reduces efficiency.
[0060] In addition, after the App is submitted to the testing team, testers are also faced with the need to frequently install and uninstall packages. Before each test, the installation command needs to be re-entered, which not only consumes a lot of valuable time, but also easily causes problems due to human errors, affecting overall work efficiency.
[0061] Based on this, the embodiments of the present application provide a command execution method, device, electronic device and storage medium, aiming to reduce the labor cost of using commands.
[0062] A command execution method, device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the recommended method in the embodiments of the present application is described.
[0063] A command execution method provided in an embodiment of the present application relates to the field of software development technology. A command execution method provided in an embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as 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, and big data and artificial intelligence platforms; the software can be an application that implements a command execution method, etc., but is not limited to the above forms.
[0064] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0065] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0066] Figure 1 is an optional flow chart of a command execution method provided in an embodiment of the present application. The command execution method provided in an embodiment of the present application is applied to a first electronic device. Figure 1 The method may include but is not limited to steps S100 to S400.
[0067] Step S100, obtaining multiple operation processes, encapsulating each of the operation processes into a script, obtaining multiple scripts, each operation process corresponds to at least one script, and each of the operation processes includes at least one operation command.
[0068] Specifically, the operation flow is composed of a number of operation commands, which can be used to complete specific tasks. The operation commands can be understood as instructions for controlling or triggering the execution of specific actions, which can be single commands in a command line or one or more lines of code in a script. In this embodiment, each of the operation flows includes at least one operation command, which can be independently developed, or implemented using existing open source tools or libraries, or secondary developed based on open source projects.
[0069] A script is a program written in a specific computer language, which is usually used for automated task processing. The scripting language can be Shell script, Python, Ruby, Perl, etc. Encapsulation refers to combining a group of related functions or operations together and processing them as an independent module or unit. In this embodiment, by encapsulating common operating processes into scripts, a series of complex commands can be automatically executed without manual input, thereby improving efficiency; scripts can be reused in different projects to avoid repeated code writing; in addition, all commands can be centrally managed for easy modification and maintenance.
[0070] Step S200, performing visualization operations on the plurality of scripts respectively to obtain a visualization plug-in corresponding to each script.
[0071] The functions of the script are encapsulated into a graphical user interface (GUI), and the user can execute the script by clicking buttons, selecting options, etc. Specifically, the graphical interface library can be selected according to the language and environment of the script, such as: Tkinter based on Python, PyQt or PySide based on Qt, Electron based on JavaScript, etc.
[0072] Furthermore, a user-friendly interface layout can be designed according to the function of the script, and the execution of the script can be triggered and monitored through this interface. First, create the basic structure of the plug-in, including interface elements for inputting parameters, such as buttons, text boxes, drop-down menus, switches, etc. Secondly, plan the position and size of the plug-in in the window. For example, the position of the plug-in can be sorted according to the order of software development; or the position of the plug-in can be sorted according to the frequency of use according to the user's usage habits. In addition, different sizes can be assigned according to the importance of the plug-in. For important plug-ins, larger space and more conspicuous positions can be allocated; for minor plug-ins, they can be placed in smaller or less conspicuous positions. At the same time, users can customize the plug-in settings as needed, and add other controls and functions, such as progress bars, status bars, log output, configuration options, etc. Finally, define the calling interface of the script execution logic, and map the user's operations on the interface to the corresponding script commands, so as to realize the interaction between the interface and the script.
[0073] Furthermore, the plug-in is tested and debugged to ensure that all functions work as expected. The developed visualization plug-in is deployed to the target environment to implement visual operations on the script. Through the visualization plug-in, the use threshold can be lowered, so that users who are not familiar with script commands can easily perform development and testing operations; the intuitive interface and interactive elements can help users easily monitor the execution status of the script, complete tasks faster, and improve efficiency; the visualization plug-in also has cross-platform compatibility and can run on different operating systems, expanding the scope of use of the script.
[0074] Step S300: displaying a plurality of the visual plug-ins in a first application, where the first application is a foreground application of the first electronic device.
[0075] Specifically, the first application refers to an application installed on the first electronic device, which directly interacts with the user as a foreground application, and its interface is currently visible and operable to the user. In this embodiment, multiple visualization plug-ins are displayed in the interface of the first application on the first electronic device, and the user can implement the visualization call operation of the script through the multiple visualization plug-ins integrated and displayed in the first application.
[0076] Step S400, in response to a user's selection operation on a first visualization plug-in among the multiple visualization plug-ins, an operation process in a script corresponding to the first visualization plug-in is executed on a second application, the second application is an application installed on a second electronic device, and the first electronic device and the second electronic device are communicatively connected.
[0077] It will be understood by those skilled in the art that the first electronic device and the second electronic device provided in the embodiments of the present application include, but are not limited to, computers (such as desktop computers, laptop computers), mobile terminals (such as smart phones, tablet computers), and other electronic devices with computing and networking capabilities. The first electronic device and the second electronic device may be electronic devices of the same type or different types. In this embodiment, the first electronic device is a computer, and the second electronic device is a mobile terminal.
[0078] The communication connection between the first electronic device and the second electronic device can be achieved through a wireless network (such as Wi-Fi, Bluetooth, mobile data) or a wired connection (such as USB, Ethernet). Specifically, when the two devices are in the same local area network, they can directly use the TCP / IP protocol to communicate; when the two devices are not in the same local area network, messages can be forwarded through an intermediate server; in addition, services provided by the cloud computing platform can also be used to achieve cross-device message delivery.
[0079] In this embodiment, when the user selects a first visualization plug-in among multiple visualization plug-ins in a first application on a first electronic device, the system will respond to this selection operation. First, the user selects a first visualization plug-in in the first application by clicking, touching or other interactive methods. The first visualization plug-in includes at least one visualization plug-in, that is, the first visualization plug-in can be one of the visualization plug-ins or a combination of multiple visualization plug-ins. Then, the first application recognizes the user's selection and executes a script corresponding to the first visualization plug-in, the script containing a predefined operation process, which is performed in the second application on the second electronic device. The first application sends the operation command for executing the script to the second application on the second electronic device through the established communication connection. After receiving the command, the second application performs the corresponding task according to the operation process in the script. After the execution is completed, the second application can feedback the operation result to the first application so that the user can see the effect or status of the operation.
[0080] In the steps S100 to S400 shown in the embodiment of the present application, the operation process is encapsulated into a script, the script is visualized, and a corresponding visualization plug-in is generated according to the script content; the visualization plug-in is displayed in the foreground application of the first electronic device, and when the user selects one or more visualization plug-ins, the script operation corresponding to the visualization plug-in is run on the second electronic device that is connected to the first electronic device. By encapsulating the operation process into a script, repetitive tasks can be automatically performed to improve work efficiency; through the visualization plug-in, complex commands and manual operations are simplified into visualization buttons, which reduces the threshold for use.
[0081] See also Figure 2 In some embodiments, step S200 may include but is not limited to step S210:
[0082] Step S210: Integrate the plurality of scripts into the graphical user interface of the first electronic device through a preset cross-platform framework, and generate the visualization plug-in corresponding to each script according to the plurality of scripts.
[0083] Cross-platform frameworks allow developers to use one programming language and toolset to build applications that can run on multiple operating systems. Developers do not need to develop applications separately for each platform, and developers can use the programming language and technology stack they are familiar with to develop cross-platform applications. At the same time, because the code is unified, it makes code updating and maintenance easier. Cross-platform frameworks usually provide a unified set of design specifications and component libraries to help applications maintain consistency in appearance and behavior on different platforms.
[0084] In this embodiment, the preset cross-platform framework is a cross-platform Tkinter framework based on Python3. Tkinter is Python's standard GUI library, which can be used to develop cross-platform desktop applications, ensuring that different platforms such as Windows, Linux, macOS and other different systems can run and display the interface.
[0085] See also Figure 3 In some embodiments, step S400 may include but is not limited to steps S410 to S450:
[0086] Step S410, the operation process includes a first process for debugging a web page view; when the script corresponding to the first visualization plug-in includes the first process, the first process is executed on the second application; the first process includes: calling the Explorer command to obtain the process number port of the web page view debugging tool in the second application; linking the compiler of the first electronic device and the web page view debugging tool of the second electronic device according to the process number port; displaying the page of the web page view debugging tool on the browser of the first electronic device.
[0087] The first process is used to debug the web view (WebView). By debugging WebView, developers can see the real-time performance of WebView in the application directly on the device or simulator, modify the code and view the results immediately without recompiling and installing the application, which greatly improves development efficiency. WebView is compatible with different operating systems, and the performance of Web content can be tested on different browsers and platforms through debugging tools.
[0088] Developers usually use the browser on the local computer (first electronic device) for development, while the WebView debugging port runs on the mobile phone (second electronic device). By calling the Explorer command, you can find the process information that monitors the port, including the process number and port. According to the process number and port, you can establish a connection between the local computer and the mobile phone, forward the mobile phone's WebView debugging port to the port of the local computer, and then use the browser on the local computer to debug WebView.
[0089] In this embodiment, first, on the second electronic device (such as a mobile phone or tablet), start the application containing WebView, and ensure that the WebView debugging tool is enabled. The process number port of the WebView debugging tool is obtained through the Explorer command, and the compiler of the first electronic device and the WebView debugging tool of the second electronic device are linked according to the process number port, so that the WebView on the second electronic device is displayed in the compiler, and then the Web page in the App is directly debugged in the browser, which simplifies the debugging process and improves development efficiency.
[0090] Step S420, the operation process includes a second process for obtaining duplicate files; when the script corresponding to the first visualization plug-in includes the second process, the second process is executed on the second application; the second process includes: calling the Finder command, scanning the global files of the second electronic device through a content duplication detection algorithm, and obtaining files containing duplicate content; outputting the file name and file path corresponding to the file containing duplicate content, and displaying them on the first electronic device in the form of a list group.
[0091] The second process is used to obtain duplicate files. During the development iteration process, different developers may import duplicate resource files, but due to different file names, duplicate files may not be directly identified by the file name. If duplicate files are not cleaned up in time, the size of the installation package will become larger and larger, wasting user mobile phone space, which will in turn affect the user experience. By scanning and checking the global files of the mobile phone. Identify problems such as duplicate files, invalid resources, and irregular resource naming, so as to help developers optimize the size of the application package and improve application performance. After the scan is completed, the duplicate files can be handed over to the developer to determine whether they need to be deleted.
[0092] In this embodiment, the Finder command is called to scan global files using a content duplicate checking algorithm, which identifies duplicate files by comparing file contents, thereby obtaining files containing duplicate content. For each duplicate file identified, the system outputs the name of the file and its storage path on the second electronic device, and displays the file name and storage path in a list grouping form, so that developers can see at a glance which files are duplicates and their specific locations stored on the second electronic device, which is convenient for developers to clean up and manage files.
[0093] Step S430, the operation process includes a third process for obtaining an installation package; when the script corresponding to the first visualization plug-in includes the third process, the third process is executed on the second application; the third process includes: obtaining multiple types of installation packages, and sending the installation packages to the second electronic device through the Miner command, and controlling the installation package to be installed on the second electronic device.
[0094] The third process is used to obtain the installation package. Developers usually download the latest installation package in the continuous integration / continuous deployment (CI / CD) pipeline. The source of the installation package includes but is not limited to Internet downloads, local network sharing, external storage devices, etc.
[0095] In addition, the traditional method can only be done by modifying the code configuration and manually serial packaging, that is, only one installation package can be generated at a time. This embodiment can also encapsulate multiple types of installation packages through the Trailblazer command, configure different compilation parameters according to different compilation environments, allow multiple tasks to be run in parallel, and generate installation packages corresponding to different environments at the same time, thereby saving development time and improving development efficiency.
[0096] Exemplarily, different compilation environments are first determined, such as a test environment, a formal environment, and a debuggable formal environment. Different compilation parameters are then set according to different compilation environments, and scripts of different compilation environments are encapsulated through the Trailblazer command to obtain different types of installation packages, such as a test installation package, a formal environment installation package, and a formal environment debuggable installation package. This improves compilation efficiency and makes multi-environment compilation simpler and more reliable.
[0097] In this embodiment, multiple types of installation packages are obtained, and the multiple types of installation packages include at least two of: a test installation package, a formal environment installation package, and a formal environment debuggable installation package. The test installation package is used to perform functional testing, performance testing, compatibility testing, etc. in a test environment; the formal environment installation package is a product version for end users, which is deployed in a formal production environment; the formal environment debuggable installation package is used in a production environment, but contains additional debugging information to facilitate problem diagnosis when a problem occurs.
[0098] The obtained installation package is transferred from the first electronic device to the designated location of the second electronic device through the Miner command, and the installation operation is automatically performed. After success, the cache file is automatically removed to reduce the mobile phone storage. On the contrary, if the installation package needs to be uninstalled, the uninstall function can also be performed through the third process.
[0099] Step S440, the operation process includes a fourth process for exporting log files; when the script corresponding to the first visualization plug-in includes the fourth process, the fourth process is executed on the second application; the fourth process includes: creating a directory named with the current date and time in the first electronic device, and calling the Traverser command to export the log file of the second electronic device to the directory of the first electronic device.
[0100] The fourth process is used to export log files. When problems are encountered during the test process, it is often necessary to manually enter the file browser to find and analyze the log files. By exporting log files, when an exception or error occurs in the system, developers do not need to manually enter the file browser to find and analyze the log files. They only need to track the specific time point and context information of the problem based on the exported log files, thereby helping developers quickly locate the problem and improve development efficiency.
[0101] In this embodiment, in order to organize and manage the log files exported from the second electronic device on the first electronic device, it is necessary to create a directory named with the current date and time in the first electronic device for easy identification and archiving, and the directory name starts with Log_xxxx. By calling the Traverser command to export the log files of the second electronic device to the directory of the first electronic device, the rapid export and classification management of the logs of the second electronic device is achieved. This helps developers or system administrators collect log files for problem diagnosis, performance analysis or other operations that require log data.
[0102] Step S450, the operation process includes a fifth process for file reinforcement; when the script corresponding to the first visualization plug-in includes the fifth process, the fifth process is executed on the second application; the fifth process includes: identifying the directory where the script corresponding to the first visualization plug-in is located, reading a reinforcement parameter configuration file, and the reinforcement parameter configuration file is used to configure the file to be reinforced; calling the Icesolid command to perform reinforcement operations on the file to be reinforced configured in the reinforcement parameter configuration file.
[0103] The fifth process is used for file hardening. File hardening can enhance the security of the App and prevent malicious code attacks and reverse engineering. Through integrity protection and signature verification, it is possible to effectively prevent files from being repackaged or modified, and prevent the generation of pirated applications; by hiding and encrypting files, attackers cannot decompile binary codes, and thus cannot obtain source code or code running logic; through anti-debugging technology, attackers are prevented from debugging native code and obtaining sensitive data.
[0104] In this embodiment, it is first necessary to identify the directory where the script corresponding to the first visualization plug-in is located, and then read the reinforcement parameter configuration file, which is usually a text file containing the path of the file to be reinforced and other reinforcement parameters. Finally, according to the information in the reinforcement parameter configuration file, call the Icesolid command to perform the reinforcement operation. Reinforcement operations include but are not limited to encryption, signing, compression, permission settings, code obfuscation, file name obfuscation, code virtualization, anti-debugging and anti-injection technology, etc. Through the file reinforcement operation, the reinforcement operation of the specified file can be implemented, the security and anti-tampering ability of the file can be improved, which helps to protect the application from malicious attacks and ensure the security of user data.
[0105] The embodiment of the present application encapsulates the operation process into a script, performs visual operations on the script, and generates a corresponding visual plug-in according to the script content; the visual plug-in is displayed in the foreground application of the first electronic device, and when the user selects one or more visual plug-ins, the script operation corresponding to the visual plug-in is run on the second electronic device that is connected to the first electronic device. By encapsulating the visual plug-in, complex and cumbersome commands and manual operations are simplified into visual buttons, and functions such as simplified debugging web page views, one-click debugging, and one-click installation are realized; the efficiency of troubleshooting can also be improved, and key log files can be quickly exported; the publishing process can also be simplified, and multiple installation packages, debugging packages, reinforcement packages, etc. can be generated with one click.
[0106] See also Figure 4 The embodiment of the present application further provides a command execution device, which can implement the above-mentioned command execution method, and the device includes:
[0107] The encapsulation module 10 is used to obtain multiple operation processes, encapsulate each of the operation processes into a script, and obtain multiple scripts, each operation process corresponds to at least one script, and each operation process includes at least one operation command;
[0108] A visualization module 20, used to perform visualization operations on the plurality of scripts respectively to obtain a visualization plug-in corresponding to each script;
[0109] A display module 30, configured to display the plurality of visualization plug-ins in a first application, where the first application is a foreground application of the first electronic device;
[0110] The response module 40 is used to execute the operation process in the script corresponding to the first visualization plug-in on the second application in response to the user's selection operation on the first visualization plug-in among the multiple visualization plug-ins, wherein the second application is an application installed on the second electronic device, and the first electronic device and the second electronic device are communicatively connected.
[0111] See also Figure 5In some embodiments, the visualization module 20 may include:
[0112] The integration unit 21 is used to integrate the multiple scripts into the graphical user interface of the first electronic device through a preset cross-platform framework, and generate the visualization plug-in corresponding to each script according to the multiple scripts.
[0113] See also Figure 6 In some embodiments, the response module 40 may include:
[0114] A debugging web view unit 41 is used to execute the first process on the second application when the script corresponding to the first visualization plug-in includes the first process; the operation process includes the first process for debugging the web view; the first process includes: calling the Explorer command to obtain the process number port of the web view debugging tool in the second application; linking the compiler of the first electronic device and the web view debugging tool of the second electronic device according to the process number port; and displaying the page of the web view debugging tool on the browser of the first electronic device.
[0115] A duplicate file acquisition unit 42 is used to execute the second process on the second application when the script corresponding to the first visualization plug-in includes the second process; the operation process includes a second process for acquiring duplicate files; the second process includes: calling a Finder command to scan the global files of the second electronic device through a content duplication detection algorithm to obtain files containing duplicate content; outputting the file name and file path corresponding to the file containing duplicate content, and displaying them on the first electronic device in the form of a list group.
[0116] An installation package acquisition unit 43 is used to execute the third process on the second application when the script corresponding to the first visualization plug-in includes the third process; the operation process includes a third process for acquiring the installation package; the third process includes: acquiring multiple types of installation packages, and sending the installation packages to the second electronic device through the Miner command, and controlling the installation package to be installed on the second electronic device.
[0117] An export log file unit 44 is used to execute the fourth process on the second application when the script corresponding to the first visualization plug-in includes the fourth process; the operation process includes the fourth process for exporting the log file; the fourth process includes: creating a directory named with the current date and time in the first electronic device, and calling the Traverser command to export the log file of the second electronic device to the directory of the first electronic device.
[0118] The file hardening unit 45 is used to execute the fifth process on the second application when the script corresponding to the first visualization plug-in includes the fifth process; the operation process includes the fifth process for file hardening; the fifth process includes: identifying the directory where the script corresponding to the first visualization plug-in is located, reading the hardening parameter configuration file, and the hardening parameter configuration file is used to configure the file to be hardened; calling the Icesolid command to perform a hardening operation on the file to be hardened configured in the hardening parameter configuration file.
[0119] The specific implementation of the command execution device is substantially the same as the specific implementation of the command execution method described above, and will not be described in detail herein.
[0120] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above command execution method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0121] See also Figure 7 , Figure 7 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0122] The processor 71 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0123] The memory 72 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 72 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 72, and the processor 71 calls and executes the command execution method of the embodiment of this application;
[0124] Input / output interface 73, used to implement information input and output;
[0125] Communication interface 74, used to realize communication interaction between the device and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);
[0126] A bus 75 that transmits information between the various components of the device (e.g., the processor 71, the memory 72, the input / output interface 73, and the communication interface 74);
[0127] The processor 71 , the memory 72 , the input / output interface 73 and the communication interface 74 are connected to each other in communication within the device via a bus 75 .
[0128] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned command execution method is implemented.
[0129] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor 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.
[0130] The embodiments of the present application provide a command execution method, a command execution device, an electronic device, and a storage medium, which encapsulates the operation process into a script, performs visual operations on the script, and generates a corresponding visual plug-in according to the script content; the visual plug-in is displayed in the foreground application of the first electronic device, and when the user selects one or more visual plug-ins, the script operation corresponding to the visual plug-in is run on the second electronic device that is connected to the first electronic device. By encapsulating the operation process into a script, repetitive tasks can be automatically executed to improve work efficiency; through the visual plug-in, complex commands and manual operations are simplified into visual buttons, which reduces the threshold for use.
[0131] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0132] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0133] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0134] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0135] The terms "first", "second", "third", "fourth", etc. (if any) in the specification 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 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 device 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.
[0136] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0137] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0138] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0140] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0141] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A command execution method, characterized in that: Applied to a first electronic device, the method includes: Acquire multiple operation processes, encapsulate each of the operation processes into a script, and obtain multiple scripts, each operation process corresponds to at least one script, and each operation process includes at least one operation command; Performing visualization operations on the multiple scripts respectively to obtain a visualization plug-in corresponding to each script; Displaying a plurality of the visual plug-ins in a first application, where the first application is a foreground application of the first electronic device; In response to a user's selection operation on a first visualization plug-in among the multiple visualization plug-ins, an operation process in a script corresponding to the first visualization plug-in is executed on a second application, the second application is an application installed on a second electronic device, and the first electronic device and the second electronic device are communicatively connected.
2. The method according to claim 1, characterized in that The operation process includes a first process for debugging a web page view; The step of executing the operation process in the script corresponding to the first visualization plug-in on the second application includes: When the script corresponding to the first visualization plug-in includes a first process, executing the first process on the second application; The first process includes: Calling the Explorer command to obtain the process number and port of the web page view debugging tool in the second application; linking the compiler of the first electronic device and the web page view debugging tool of the second electronic device according to the process number port; The page of the web view debugging tool is displayed on the browser of the first electronic device.
3. The method according to claim 1, characterized in that The operation process includes a second process for obtaining duplicate files; The step of executing the operation process in the script corresponding to the first visualization plug-in on the second application includes: When the script corresponding to the first visualization plug-in includes a second process, executing the second process on the second application; The second process includes: Calling a Finder command to scan the global files of the second electronic device using a content duplication checking algorithm to obtain files containing duplicate content; The file names and file paths corresponding to the files containing duplicate content are output and displayed on the first electronic device in the form of list groups.
4. The method according to claim 1, characterized in that: The operation process includes a third process for obtaining an installation package; The step of executing the operation process in the script corresponding to the first visualization plug-in on the second application includes: When the script corresponding to the first visualization plug-in includes a third process, executing the third process on the second application; The third process includes: Acquire multiple types of installation packages, send the installation packages to the second electronic device through a Miner command, and control the installation packages to be installed on the second electronic device.
5. The method according to claim 1, characterized in that The operation process includes a fourth process for exporting a log file; The step of executing the operation process in the script corresponding to the first visualization plug-in on the second application includes: In a case where the script corresponding to the first visualization plug-in includes a fourth process, executing the fourth process on the second application; The fourth process includes: A directory named with the current date and time is created in the first electronic device, and a Traverser command is called to export the log file of the second electronic device to the directory of the first electronic device.
6. The method according to claim 1, characterized in that The operation process includes a fifth process for document reinforcement; The step of executing the operation process in the script corresponding to the first visualization plug-in on the second application includes: In a case where the script corresponding to the first visualization plug-in includes a fifth process, executing the fifth process on the second application; The fifth process includes: Identify the directory where the script corresponding to the first visualization plug-in is located, and read a reinforcement parameter configuration file, where the reinforcement parameter configuration file is used to configure the file to be reinforced; Call the Icesolid command to perform a hardening operation on the files to be hardened configured in the hardening parameter configuration file.
7. The method according to claim 1, characterized in that The performing visualization operations on the plurality of scripts respectively to obtain a visualization plug-in corresponding to each script includes: The plurality of scripts are integrated into the graphical user interface of the first electronic device through a preset cross-platform framework, and the visualization plug-in corresponding to each script is generated according to the plurality of scripts.
8. A command execution device, characterized in that: The device comprises: A packaging module, used to obtain multiple operation processes, package each of the operation processes into a script, and obtain multiple scripts, each operation process corresponds to at least one script, and each operation process includes at least one operation command; A visualization module, used to perform visualization operations on the plurality of scripts respectively to obtain a visualization plug-in corresponding to each script; A display module, configured to display the plurality of visualization plug-ins in a first application, wherein the first application is a foreground application of the first electronic device; A response module is used to respond to a user's selection operation on a first visualization plug-in among multiple visualization plug-ins, and execute an operation process in a script corresponding to the first visualization plug-in on a second application, wherein the second application is an application installed on a second electronic device, and the first electronic device and the second electronic device are communicatively connected.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the command execution method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the command execution method according to any one of claims 1 to 7 is implemented.