A method and device for preventing program operation and interactive control from being intercepted

By running python code files in the whitelist module of the operating system and monitoring the interaction between the terminal and the operating system, the problem of python programs being intercepted by anti-virus software under Windows is solved, achieving efficient anti-interception and improved compatibility.

CN112000950BActive Publication Date: 2024-10-29SHENZHEN DIANMAO TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010622042.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2024-10-29
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

In the existing technology, the python program uses the win-pty.exe core program to be intercepted by anti-virus software under the Windows operating system, resulting in the function of the python integrated development environment being unusable. Existing solutions such as submitting for review and manually adding a whitelist cannot be used. Solve the problem at the source without the time cost and poor user experience.

Method used

Run the pre-written python code file in the whitelist module of the operating system, obtain the python sub-process, and monitor the interaction between the terminal and the operating system. By receiving input data and processing output data, the interactive operation of the program is realized, thereby avoiding was intercepted.

Benefits of technology

There is no need for users to manually add programs to the whitelist. Python code files can be run directly in the whitelist module to monitor the interaction between the terminal and the operating system. This effectively prevents the program from being intercepted when it interacts with the console and improves the compatibility of program operation and user convenience. Convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112000950B_ABST
    Figure CN112000950B_ABST
Patent Text Reader

Abstract

The present invention discloses an anti-interception program running and interactive control method and device, the method comprising: running a pre-written python code file in a whitelist module to obtain a python subprocess; judging whether the program needs input, if so, stopping the subprocess, receiving input data from an interface terminal and sending corresponding commands according to the input data, otherwise judging whether the program has output; when the program has output, calling a corresponding processing function according to the event type triggered by the current subprocess, processing the output data and feeding it back to the interface terminal. The embodiment of the present invention directly runs the python code file in the whitelist module to obtain the subprocess, and monitors the interaction between the terminal and the operating system to perform corresponding interactive operations, thereby preventing the program from being intercepted when it is running and interacting with the console, and does not require the user to manually add the program to the whitelist, thereby improving the compatibility of the program running and the convenience of user use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to an anti-interception program running and interactive control method and device. Background Art

[0002] Currently, the well-known library node-pty is used in Python editors. Its main function is to be a pseudo-terminal library based on Unix commands that is compatible with macOS, Windows, and Linux, which allows the program to use the Unix instruction set under any operating system. This function allows developers to avoid writing redundant compatible code, and there is no need to determine the platform to select the corresponding instructions, and it has most of the functions of the terminal. However, since the operating system of the main audience of the editor is Windows, and node-pty needs to use the core program win-pty.exe under Windows in its implementation in Windows, this program operates at the bottom of the system and will be detected in most antivirus software, but it cannot be determined whether it is a legitimate program, so the program will be blocked. The blocking of this core program means that the main functions of the Python integrated development environment will be unavailable.

[0003] There are two main solutions to this problem. One is to submit the program to the antivirus software for review. If it passes, it will not be blocked. However, since there are many antivirus software on the market, each antivirus software needs to be reviewed, and the editor needs to be reviewed every time it releases a version. The time cost is very huge and enterprises cannot afford it. The other is to let users manually add the win-pty.exe program to the whitelist, so that it can skip the detection. However, considering the age group and number of users, if there is no notification before each use or it is ignored by the user, it will cause a large number of bugs and cause the program to fail to run normally. Neither of these two methods solves the problem from the source.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide an anti-interception program running and interactive control method and device, aiming to solve the problem of Python program being intercepted during execution in the prior art.

[0006] The technical solution of the present invention is as follows:

[0007] A method for program operation and interactive control to prevent interception, comprising the following steps:

[0008] Run the pre-written Python code file in the whitelist module to obtain the Python subprocess;

[0009] Determine whether the program needs input, if so, stop running the subprocess, receive input data from the interface terminal and send corresponding commands according to the input data, otherwise determine whether the program has output;

[0010] When the program has output, the corresponding processing function is called according to the event type triggered by the current sub-process, and the output data is processed and fed back to the interface terminal.

[0011] In the anti-interception program running and interactive control method, the pre-written Python code file is run in the whitelist module to obtain the Python subprocess, including:

[0012] Declare the shell class and initialize the terminal attributes in the constructor to store the Python subprocess;

[0013] Accept the file path of the python code file, call the whitelist module to run the python code file to obtain a python subprocess.

[0014] In the anti-interception program operation and interactive control method, the step of receiving input data from the interface terminal and sending corresponding commands according to the input data includes:

[0015] receiving input data entered by the user at the interface terminal;

[0016] Formatting the input data so that the formatted input data meets the data format requirements of the current control terminal;

[0017] Send the corresponding command according to the formatted input data.

[0018] In the anti-interception program operation and interactive control method, formatting the input data so that the formatted input data meets the data format requirements of the current control terminal specifically includes:

[0019] The input data is formatted after the escape character recognition is performed according to the preset escape character configuration interface, so that the formatted input data meets the data format requirements of the current control terminal.

[0020] In the program operation and interactive control method for preventing interception, when the program has output, the corresponding processing function is called according to the event type triggered by the current sub-process, and the output data is processed and then fed back to the interface terminal, including:

[0021] Determine the event type triggered by the current subprocess;

[0022] When a data event is triggered, a data output processing function is called to perform character adaptation on the output data and then output it to the display terminal;

[0023] When an error event is triggered, an error processing function is called, and error information is obtained according to the output data, output to the display terminal, and written into the error log.

[0024] In the program operation and interactive control method for preventing interception, after determining whether the program has output, the method further includes:

[0025] When the program has no output, it is determined whether the subprocess has ended. If so, the terminal attribute is set to zero to exit the current program. Otherwise, it is continued to determine whether the program needs input.

[0026] In the anti-interception program running and interactive control method, the whitelist module is a child_process module.

[0027] Another embodiment of the present invention further provides an anti-interception program running and interactive control device, the device comprising at least one processor; and

[0028] a memory communicatively connected to the at least one processor; wherein,

[0029] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned anti-interception program running and interactive control method.

[0030] Another embodiment of the present invention further provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned anti-interception program running and interactive control method.

[0031] Another embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the above-mentioned anti-interception program running and interactive control method.

[0032] Beneficial effect: The present invention discloses an anti-interception program running and interactive control method and device. Compared with the prior art, the embodiment of the present invention obtains a child process by directly running a python code file in a whitelist module, and monitors the interaction between the terminal and the operating system to perform corresponding interactive operations, thereby preventing the program from being intercepted when interacting with the console, and there is no need for the user to manually add the program to the whitelist, thereby improving the compatibility of the program running and the convenience of user use. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0034] Figure 1 A flowchart of a preferred embodiment of the anti-interception program running and interactive control method provided by the present invention;

[0035] Figure 2 A flowchart of a specific embodiment of the anti-interception program running and interactive control method provided by the present invention;

[0036] Figure 3 A schematic diagram of the hardware structure of a preferred embodiment of the anti-interception program running and interactive control device provided by the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.

[0038] See also Figure 1 , Figure 1 The flowchart of the preferred embodiment of the program operation and interactive control method for preventing interception provided by the present invention. Figure 1 As shown, it includes the following steps:

[0039] S100, running a pre-written python code file in the whitelist module to obtain a python subprocess;

[0040] S200, determining whether the program needs input, if so, stopping the subprocess, receiving input data from the interface terminal and sending corresponding commands according to the input data, otherwise determining whether the program has output;

[0041] S300: When the program has output, the corresponding processing function is called according to the event type triggered by the current child process, and the output data is processed and then fed back to the interface terminal.

[0042] In this embodiment, the whitelist module of the operating system is directly selected. The whitelist module can operate to the bottom layer of the system but will not be intercepted by the anti-virus software. A pre-written python code file is run in the whitelist module to obtain a python subprocess, and then it is determined whether the program needs input. If so, the subprocess is stopped and waits for the user's input, the user's input data in the interface terminal is received, and the corresponding command is sent to interact with the operating system according to the input data, otherwise it is determined whether the program has output; when the program has output, the corresponding processing function is called according to the event type triggered by the current subprocess, and the output is data processed and the response is fed back to the interface terminal. Therefore, in this embodiment, based on directly running the python code file in the whitelist module of the operating system, the program operation is not restricted by the interception of the anti-virus software, and the program operation and the control terminal input and output and other interactive actions can be realized, such as inputting characters, line breaks, rollback characters, sending commands to interact with the operating system, etc. There is no need for users to manually add core programs to the system whitelist and developers do not need to submit them to each anti-virus software for review. The problem of python program operation being intercepted is solved from the source, and an efficient anti-interception program operation solution is provided.

[0043] Furthermore, the running of the pre-written Python code file in the whitelist module to obtain the Python subprocess includes:

[0044] Declare the shell class and initialize the terminal attributes in the constructor to store the Python subprocess;

[0045] Accept the file path of the python code file, call the whitelist module to run the python code file to obtain a python subprocess.

[0046] In the specific implementation, the developer first declares the shell class and initializes the terminal terminal attribute to zero (null) in the constructor. This attribute is used to store the Python subprocess. Specifically, this attribute type is SubProcess, which has a write method and an input_data attribute, which are respectively used to write data and cache input data. Then, the file path of the Python code file is accepted in the written core method, and the system whitelist module is called to run the Python code file to obtain the Python subprocess. In the embodiment of the present invention, the whitelist module is the child_process module of Nodejs, specifically the spawn submodule under child_process to realize the anti-interception operation of the program. The module of Nodejs is compatible with multiple platforms. Under Windows, although it can be operated to the bottom layer, the antivirus software will not intercept the corresponding module of Nodejs, because there is a parent-child relationship between processes and the module of Nodejs is safe and legal, and then the code is run through the whitelist module of the operating system, which prevents the program from being intercepted from the source, thereby improving the compatibility and reliability of the program operation.

[0047] Further, the receiving input data of the interface terminal and sending a corresponding command according to the input data includes:

[0048] receiving input data entered by the user at the interface terminal;

[0049] Formatting the input data so that the formatted input data meets the data format requirements of the current control terminal;

[0050] Send the corresponding command according to the formatted input data.

[0051] In specific implementation, the interaction with the console includes two parts, namely the real control terminal and the interface terminal. The control terminal sends commands to interact with the operating system, and the interface terminal body provides a UI interface and provides input logic for the control terminal, such as input characters, line breaks, back characters and shortcut keys, etc. Therefore, when the program needs input, the user inputs data at the interface terminal, and the control terminal listens and receives the input data sent by the interface terminal, and then formats the input data so that the formatted input data meets the data format requirements of the current control terminal. This is because some of the data or operation characters entered by the user at the interface terminal do not conform to the python process format, so an internal data conversion is required to format the input data so that it meets the data format requirements of the current control terminal, ensuring that the data sent by the user through the interface terminal can be correctly received, and the corresponding commands are sent according to the formatted input data, thereby realizing the interactive function of standard input and ensuring that the user's input data can be correctly responded to.

[0052] Furthermore, formatting the input data so that the formatted input data meets the data format requirement of the current control terminal specifically includes:

[0053] The input data is formatted after the escape character recognition is performed according to the preset escape character configuration interface, so that the formatted input data meets the data format requirements of the current control terminal.

[0054] That is, in the specific implementation, when performing data formatting processing, it is necessary to identify and judge the transfer characters, identify the transfer characters in the input data according to the pre-set escape character configuration interface, and then further format it to realize internal data conversion, so that the formatted input data can successfully identify the escape characters and meet the data format requirements of the current control terminal.

[0055] Specifically, the configuration of escape characters mainly uses the "strategy pattern" in the design pattern, removes the "if else" logic that is inconvenient to expand and highly coupled, extracts the internal logic and writes it into a json object to form a configuration. By opening the configuration interface, when new characters are added in the future, the processing logic can be directly added to the character processor charProcessor, and it can be directly called when recognizing the escaped characters. The recognition and judgment of escaped characters are realized through the pre-set escape character configuration interface, which improves the maintainability of recognition. If new characters are added in the future, they can be added by themselves without modifying the original logic code, thereby improving the recognition accuracy.

[0056] Furthermore, when the program has output, the corresponding processing function is called according to the event type triggered by the current sub-process, and the output data is processed and then fed back to the interface terminal, including:

[0057] Determine the event type triggered by the current subprocess;

[0058] When a data event is triggered, a data output processing function is called to perform character adaptation on the output data and then output it to the display terminal;

[0059] When an error event is triggered, an error processing function is called, and error information is obtained according to the output data, output to the display terminal, and written into the error log.

[0060] In specific implementation, if the current program has no input, it is determined whether it has output. When there is output, the event type triggered by the current child process is first determined. If a data event is triggered, the data output processing function is called, and the output data is character-adapted and then output to the display terminal for display. The reason why character adaptation is required is that there is a default character encoding for standard output in Python. If the encoding format is not specified, the default encoding is related to the operating system type and the operating system version. At this time, it will be found that the output Chinese is garbled, so it is necessary to specify the encoding format according to the default encoding of the current operating system to implement character adaptation. For example, the default encoding in Windows 7 is gbk. The default encoding in macOS is UTF-8. Taking macOS as an example, you need to specify the encoding format as UTF-8. You can set the environment variables "PYTHONIOENCODING" and "PYTHONLEGACYWINDOWSIOENCODING" to "UTF-8" in the options of generating the child process to achieve character adaptation and ensure that the output data can be displayed normally on the interface terminal; if an error event is triggered, the error handling function is called to obtain error information based on the output data, and the error information is output to the display terminal for display. At the same time, the error is also written to the error log so that developers can better debug and optimize the program.

[0061] Furthermore, after determining whether the program has output, the method further includes:

[0062] When the program has no output, it is determined whether the subprocess has ended. If so, the terminal attribute is set to zero to exit the current program. Otherwise, it is continued to determine whether the program needs input.

[0063] In an embodiment of the present invention, if the current program has no input, it is determined whether it has output. If the program has no output, it is determined whether the subprocess has ended. If so, the terminal attribute is set to zero (null) to release memory and then exit the current program. Otherwise, it continues to determine whether the program needs input, thereby realizing a complete anti-interception program running and console interaction process.

[0064] Preferably, the embodiment of the present invention also makes special processing on program interruption. When the interruption is triggered, since the running Python code may execute the statement of generating a child process, and a new child process may be generated in the child process, the entire process tree cannot be interrupted by an ordinary interrupt command, that is, the derived child process cannot be interrupted, and only the Python main process can be interrupted. If a series of related processes are to be interrupted, it can only be done by interrupting the process group. At this time, a problem will arise. Since the IDE (integrated development environment) and the Python process are in the same process group, interrupting the process group will interrupt the entire application. In order to avoid this situation, this embodiment maintains an array to record the id of the generated child process, and then when the process is interrupted, it is interrupted by looping through the child process id and calling the interrupt method. Furthermore, in another embodiment, the "detached" attribute in the spwan method option can be set, which refers to "whether it is independent of the parent process". By setting it to true, the process ids of the parent process and the child process are in different process groups, avoiding the phenomenon that the program interruption causes the interruption of the entire application.

[0065] To better understand the program running and console interaction process in the embodiment of the present invention, the following Figure 2 The process of the program operation and interactive control method for preventing interception provided by the present invention is introduced as follows: Figure 2 As shown, the method comprises the following steps:

[0066] S1. Run the pre-written Python code file in child_process.spawn to obtain the Python child process;

[0067] S2, determine whether the program needs input, if so, execute step S3, otherwise execute step S4;

[0068] S3, stop running the subprocess, receive input data and send corresponding commands according to the input data;

[0069] S4, determine whether the program has output, if so, execute step S5, otherwise execute step S6;

[0070] S5. Call the data output processing function or the error processing function according to the event type triggered by the subprocess, and feed back the corresponding result to the interface terminal;

[0071] S6. Determine whether the program is finished. If so, the program exits, otherwise returns to step S2.

[0072] Another embodiment of the present invention provides an anti-interception program operation and interactive control device, such as Figure 3 As shown, the device 10 includes:

[0073] One or more processors 110 and memory 120, Figure 3 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0074] The processor 110 is used to complete various control logics of the device 10, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.

[0075] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the anti-interception program operation and interactive control method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, the anti-interception program operation and interactive control method in the above method embodiment is implemented.

[0076] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store applications required for operating the device and at least one function; the data storage area may store data created according to the use of the device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the device 10 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.

[0077] One or more units are stored in the memory 120, and when executed by one or more processors 110, the program operation and interactive control method for preventing interception in any of the above method embodiments is executed, for example, the program operation and interactive control method described above are executed. Figure 1 The method comprises steps S100 to S300.

[0078] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S300.

[0079] As an example, the non-volatile storage medium can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable ROM (EEPROM), or a flash memory. Volatile memory can include a random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0080] Another embodiment of the present invention provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a processor, the processor executes the program operation and interactive control method of the anti-interception method embodiment. For example, the execution of the above described Figure 1 The method comprises steps S100 to S300.

[0081] In summary, in the program operation and interactive control method and device for preventing interception disclosed by the present invention, the method includes: running a pre-written python code file in a whitelist module to obtain a python subprocess; judging whether the program needs input, if so, stopping the subprocess, receiving input data from the interface terminal and sending corresponding commands according to the input data, otherwise judging whether the program has output; when the program has output, calling the corresponding processing function according to the event type triggered by the current subprocess, processing the output data and feeding it back to the interface terminal. The embodiment of the present invention obtains the subprocess by directly running the python code file in the whitelist module, and monitors the interaction between the terminal and the operating system to perform corresponding interactive operations, thereby preventing the program from being intercepted when it is running and interacting with the console from the root, and there is no need for the user to manually add the program to the whitelist, thereby improving the compatibility of the program operation and the convenience of user use.

[0082] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they 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.

[0083] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer electronic device (which can be a personal computer, a server, or a network electronic device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0084] Conditional language such as "can," "can," "might," or "may," among other things, unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey that particular embodiments can include (while other embodiments do not) particular features, elements, and / or operations. Thus, such conditional language is generally not intended to imply that features, elements, and / or operations are in any way required for one or more embodiments or that one or more embodiments must include logic for determining whether such features, elements, and / or operations are included or will be performed in any particular embodiment, with or without student input or prompting.

[0085] What has been described herein in this specification and the accompanying drawings includes examples of program operation and interactive control methods and devices that can provide anti-interception. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it can be recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure. In addition, or in an alternative, other embodiments of the present disclosure may be obvious from consideration of this specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples proposed in this specification and the accompanying drawings are considered to be illustrative and not restrictive in all respects. Although specific terms are employed herein, they are used in a general and descriptive sense and are not used for limiting purposes.

Claims

1. A method for program operation and interactive control to prevent interception, characterized in that , including the following steps: Run the pre-written Python code file in the whitelist module to obtain the Python subprocess; Determine whether the program needs input, if so, stop running the subprocess, receive input data from the interface terminal and send corresponding commands according to the input data, otherwise determine whether the program has output; When the program has output, the corresponding processing function is called according to the event type triggered by the current sub-process, and the output data is processed and fed back to the interface terminal; The receiving input data of the interface terminal and sending a corresponding command according to the input data includes: receiving input data entered by the user at the interface terminal; Formatting the input data so that the formatted input data meets the data format requirements of the current control terminal; Send corresponding commands according to the formatted input data; The formatting of the input data so that the formatted input data meets the data format requirement of the current control terminal specifically includes: According to a preset escape character configuration interface, the input data is formatted after escape character recognition, so that the formatted input data meets the data format requirements of the current control terminal; The escape character configuration processing specifically extracts the internal logic and writes it into a json object to form a configuration. By opening the configuration interface, when new characters are added in the future, the processing logic can be directly added to the character processor charProcessor. When identifying escape characters, it can be directly called to realize the recognition and judgment of escape characters.

2. The method for anti-interception program operation and interactive control according to claim 1, characterized in that: The pre-written Python code file is run in the whitelist module to obtain the Python subprocess, including: Declare the shell class and initialize the terminal attributes in the constructor to store the Python subprocess; Accept the file path of the python code file, call the whitelist module to run the python code file to obtain a python subprocess.

3. The method for anti-interception program operation and interactive control according to claim 1, characterized in that: When the program has output, the corresponding processing function is called according to the event type triggered by the current sub-process, and the output data is processed and fed back to the interface terminal, including: Determine the event type triggered by the current subprocess; When a data event is triggered, a data output processing function is called to perform character adaptation on the output data and then output it to the display terminal; When an error event is triggered, an error processing function is called, and error information is obtained according to the output data, output to the display terminal, and written into the error log.

4. The method for anti-interception program operation and interactive control according to claim 2, characterized in that: After determining whether the program has output, the method further includes: When the program has no output, it is determined whether the subprocess has ended. If so, the terminal attribute is set to zero to exit the current program. Otherwise, it is continued to determine whether the program needs input.

5. The method for anti-interception program operation and interactive control according to any one of claims 1 to 4, characterized in that: The whitelist module is a child_process module.

6. An anti-interception program operation and interactive control device, characterized in that: The apparatus comprises 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 instructions are executed by the at least one processor so that the at least one processor can execute the anti-interception program running and interactive control method described in any one of claims 1-5.

7. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the anti-interception program running and interactive control method described in any one of claims 1-5.

8. A computer program product, characterized in that The computer program product includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the anti-interception program operation and interactive control method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method and apparatus for execution control of computer programs

    US20080295114A1