A device and program control method
By establishing a communication mechanism between the device monitoring module and the kernel driver module, monitoring the plug-in and unplugging events of USB devices and controlling their program operation, the problem that the existing technology cannot effectively prohibit the execution of malicious programs of USB devices is solved, and the security of the user terminal is improved.
Patent Information
- Application Number
- CN202210599688.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-05-30
AI Technical Summary
The prior art cannot effectively prohibit the execution of malicious programs or script files on USB devices without affecting the data reading and writing functions of USB devices, resulting in hidden dangers in user terminal security.
By establishing a communication mechanism between the device monitoring module and the kernel driver module, monitoring the plug-in and unplugging events of the USB device, determining the identification information of the target device, and sending instructions to the kernel driver module, controlling the operation of programs on the USB device to prevent the execution of malicious programs.
Real-time control of USB devices when plugging and unplugging, preventing malicious programs from running, improving the security of user terminals, and not affecting the normal data reading and writing functions of USB devices.
Smart Images

Figure CN115114616B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer program control, and in particular to a method and apparatus for controlling a device program. Background Art
[0002] At present, there are many malicious programs that can invade user terminals through Universal Serial Bus (USB) devices, that is, when a user inserts a USB device into a USB interface to connect to a user terminal, the malicious program on the USB device will automatically run. The current solution for controlling programs on USB devices can only prevent the USB device from automatically running when the USB device is inserted into a USB interface to connect to a user terminal. However, once the USB device is inserted into the USB interface to connect to the user terminal, if there is a malicious program on the USB device, it may be accidentally run manually by the user or indirectly run by other malicious programs, causing hidden dangers to the security of the user terminal. Summary of the invention
[0003] The present application provides a device program control method and apparatus, which can solve the current problem of how to prohibit the execution of executable programs or script files on a USB device without affecting the data reading and writing functions of the USB device itself.
[0004] In order to achieve the above purpose, this application adopts the following technical solutions:
[0005] In a first aspect, the present application provides a device program control method, which is applied to a device monitoring module, including: determining an event type of a target device; wherein the event type includes a first event and a second event, the first event being that the target device is connected to a terminal, and the second event being that the target device is unplugged from the terminal; determining first indication information based on the event type of the target device; wherein the first indication information includes identification information of the target device, and the first indication information is used to indicate control of a program on the target device, the program including an executable program and a script file program; and sending the first indication information to a kernel driver module.
[0006] Based on the above technical solution, the present application monitors the event type of the target device, determines the identification information of the target device when the target device is connected to or unplugged from the user terminal, and determines the indication information including the identification information, so that the kernel driver module can control the program on the target device running in the terminal according to the indication information, thereby preventing malicious programs on the target device from posing a hidden danger to the security of the terminal.
[0007] In one possible implementation, before determining the event type of the target device, the method also includes: sending first registration information to the operating system; wherein the first registration information is used to apply for registration of a first function, and the first function is used to determine the event type of the target device; receiving first configuration information from the operating system; and configuring the first function according to the first configuration information.
[0008] In a possible implementation, the above-mentioned determining the first indication information according to the event type of the target device specifically includes: if the event type of the target device is a first event, determining the identification information and the program prohibition instruction of the target device; determining the identification information and the program prohibition instruction of the target device as the first indication information; wherein the program prohibition instruction is used to indicate that the program on the target device is prohibited from running; if the event type of the target device is a second event, determining the identification information and the program prohibition cancellation instruction of the target device; determining the identification information and the program prohibition cancellation instruction of the target device as the first indication information; wherein the program prohibition cancellation instruction is used to indicate to stop prohibiting the program on the target device from running.
[0009] In a possible implementation manner, the device type of the target device is a USB device.
[0010] In the second aspect, the present application provides a device program control method, applied to a kernel driver module, including: receiving first indication information from a device monitoring module; the first indication information includes identification information of a target device; according to the first indication information, controlling the program on the target device; wherein the program includes an executable program and a script file program.
[0011] In one possible implementation, before receiving the first indication information from the device monitoring module, the method also includes: sending second registration information to the operating system; wherein the second registration information is used to apply for registration of a second function, and the second function is used to determine the running path of the program, and the running path includes a process path and a file path; receiving second configuration information from the operating system; and configuring the second function according to the second configuration information.
[0012] In a possible implementation, the above-mentioned controlling the program on the target device according to the first indication information specifically includes: when the first indication information includes a program prohibition instruction, determining whether the program's running path includes the target device's identification information; if the program's running path includes the target device's identification information, prohibiting the program from running; when the first indication information includes a program prohibition cancel instruction, stopping prohibiting the program from running.
[0013] In a possible implementation manner, the device type of the target device is a USB device.
[0014] In addition, the technical effects of the device program control method of the second aspect can refer to the technical effects of the device program control method of the first aspect mentioned above, and will not be repeated here.
[0015] In a third aspect, the present application provides a device program control apparatus, which comprises: a processing unit and a sending unit; the processing unit is used to determine an event type of a target device; wherein the event type comprises a first event and a second event, the first event being that the target device is connected to a terminal, and the second event being that the target device is unplugged from the terminal; the processing unit is further used to determine first indication information according to the event type of the target device; wherein the first indication information comprises identification information of the target device, and the first indication information is used to indicate control of a program on the target device, and the program comprises an executable program and a script file program; the sending unit is used to send the first indication information to a kernel driver module.
[0016] In a possible implementation, the device program apparatus further includes: a receiving unit; a sending unit, further configured to send first registration information to the operating system; wherein the first registration information is used to apply for registration of a first function, and the first function is used to determine an event type of the target device;
[0017] The receiving unit is used to receive first configuration information from the operating system; the processing unit is also used to configure the first function according to the first configuration information.
[0018] In one possible implementation, the processing unit is further used to determine the identification information and program prohibition instruction of the target device when the event type of the target device is a first event; determine the identification information and program prohibition instruction of the target device as first indication information; wherein the program prohibition instruction is used to indicate prohibition of program running on the target device; the processing unit is further used to determine the identification information and program prohibition cancellation instruction of the target device when the event type of the target device is a second event; determine the identification information and program prohibition cancellation instruction of the target device as first indication information; wherein the program prohibition cancellation instruction is used to indicate stopping prohibition of program running on the target device.
[0019] In a possible implementation, the device type of the target device is a USB device.
[0020] In addition, the technical effects of the equipment program control device of the third aspect can refer to the technical effects of the equipment program control method of the first aspect mentioned above, and will not be repeated here.
[0021] In a fourth aspect, the present application provides a device program control device, which includes: a receiving unit and a processing unit; the receiving unit is used to receive a first indication information from a device monitoring module; the first indication information includes identification information of the target device; the processing unit is used to control the program on the target device according to the first indication information; wherein the program includes an executable program and a script file program.
[0022] In one possible implementation, the device program device also includes: a sending unit; a sending unit, used to send second registration information to the operating system; wherein the second registration information is used to apply for registration of a second function, and the second function is used to determine the running path of the program, and the running path includes a process path and a file path; a receiving unit, also used to receive second configuration information from the operating system; and a processing unit, also used to configure the second function according to the second configuration information.
[0023] In one possible implementation, the processing unit is further used to determine whether the program's running path includes identification information of the target device when the first indication information includes a program prohibition instruction; if the program's running path includes identification information of the target device, prohibiting the program from running; the processing unit is further used to stop prohibiting the program from running when the first indication information includes a program prohibition cancel instruction.
[0024] In a possible implementation manner, the device type of the target device is a USB device.
[0025] In addition, the technical effects of the equipment program control device of the fourth aspect can refer to the technical effects of the equipment program control method of the first aspect mentioned above, and will not be repeated here.
[0026] In a fifth aspect, the present application provides a computer-readable storage medium storing one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device of the present application, enable the electronic device to execute a device program control method as described in the first aspect and any possible implementation of the first aspect.
[0027] In a sixth aspect, the present application provides an electronic device, comprising: a processor and a memory; wherein the memory is used to store one or more programs, and the one or more programs include computer execution instructions. When the electronic device is running, the processor executes the computer execution instructions stored in the memory to enable the electronic device to perform the device program control method described in the first aspect and any possible implementation of the first aspect.
[0028] In a seventh aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the electronic device of the present application to execute the device program control method as described in the first aspect and any possible implementation of the first aspect.
[0029] In an eighth aspect, the present application provides a chip system, which is applied to a device program control device; the chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected through a line; the interface circuit is used to receive a signal from the memory of the device program control device and send the signal to the processor, wherein the signal includes a computer instruction stored in the memory. When the processor executes the computer instruction, the device program control device executes the device program control method as described in the first aspect and any possible design thereof.
[0030] In this application, the name of the above-mentioned device program control device does not limit the device or functional unit itself. In actual implementation, these devices or functional units may appear with other names. As long as the functions of each device or functional unit are similar to those of this application, they are within the scope of the claims of this application and their equivalent technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the architecture of a device program control system provided in an embodiment of the present application;
[0032] Figure 2 A schematic diagram of a flow chart of a device program control method provided in an embodiment of the present application;
[0033] Figure 3 A flowchart of another device program control method provided in an embodiment of the present application;
[0034] Figure 4 A flowchart of another device program control method provided in an embodiment of the present application;
[0035] Figure 5 A schematic diagram of the structure of a device program control device provided in an embodiment of the present application;
[0036] Figure 6 A schematic diagram of the structure of another device program control device provided in an embodiment of the present application;
[0037] Figure 7 A schematic diagram of the structure of another device program control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] In this article, the character " / " generally indicates that the objects before and after are in an "or" relationship. For example, A / B can be understood as A or B.
[0040] The terms "first" and "second" in the specification and claims of this application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first edge service node and a second edge service node are used to distinguish different edge service nodes rather than to describe a characteristic order of edge service nodes.
[0041] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application 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 limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0042] In addition, in the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplarily" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present concepts in a specific way.
[0043] At present, USB devices can read, write and transfer data with user terminals through USB interfaces, and are commonly used mobile storage devices. However, in actual application environments, many malicious programs can invade user terminals through USB devices. Therefore, when a USB device is inserted into a user terminal, it is necessary to control the program on the USB device to prevent the operation of malicious programs on the USB device.
[0044] Exemplarily, the prior art provides the following two methods for prohibiting a program on a USB device from automatically running:
[0045] Method 1: Modify the registry configuration items to prevent the USB device from running automatically after being connected, but the registry items can be modified by anyone and any program, of course, malicious programs can also modify them.
[0046] Method 2: Use USB device filter driver to monitor inserted USB devices in the kernel and prohibit automatic operation. This method is more reliable than modifying registry configuration items, but it is more difficult to implement.
[0047] However, the above scheme for controlling the programs on the USB device can only prevent the USB device from automatically running when it is inserted into the USB interface and connected to the user terminal. However, once the USB device is inserted into the USB interface and connected to the user terminal, if there is a malicious program on the USB device, it may be accidentally run manually by the user or indirectly run by other malicious programs, posing a hidden danger to the security of the user terminal.
[0048] In order to solve the above-mentioned problem of how to prohibit the execution of executable programs or scripts on a USB device without affecting the data reading and writing functions of the USB device itself, the present application provides a device program control method to realize monitoring of the USB device when it is connected, and at the same time prohibit the execution of executable programs or scripts on the USB device, but without affecting the data reading, writing and transmission functions of the USB device itself.
[0049] For example, Figure 1 FIG. 1 is a system architecture diagram of a device program control system provided by the present application. The device program control system 10 comprises: a device monitoring module 11 , a kernel driver module 12 and an operating system 13 .
[0050] The device monitoring module 11 is used to monitor the insertion and removal of the USB device from the USB interface of the user terminal. When the device monitoring module 11 monitors the insertion and removal of the USB device from the USB interface, it will send corresponding indication information to the kernel driver module 12, so that the kernel driver module controls the program on the USB device according to the indication information.
[0051] The kernel driver module 12 is used to control the program on the USB according to the instruction information received from the device monitoring module 11. In addition, the kernel driver module 12 can also send registration information to the operating system 13 to configure the program process monitoring function.
[0052] The operating system 13 is used to receive the registration information from the kernel driver module 12 and configure the program process monitoring function for the kernel driver module. Exemplarily, the type of the operating system 13 may be Windows system.
[0053] In different application scenarios, the device monitoring module 11, the kernel driver module 12 and the operating system 13 can be deployed in different devices, or integrated into the same device included in the device program control system 10, and this application does not make specific limitations on this.
[0054] When the device monitoring module 11, the kernel driver module 12 and the operating system 13 are integrated into the same device, the communication mode between the device monitoring module 11, the kernel driver module 12 and the operating system 13 is the communication between the internal modules of the device. In this case, the communication process between the three is the same as "the communication process between the three when the device monitoring module 11, the kernel driver module 12 and the operating system 13 are independent of each other".
[0055] The technical solution provided by this application is described in detail below in conjunction with the accompanying drawings of the specification.
[0056] For example, Figure 2 As shown, the present application provides a device program control method, which specifically includes the following S201-S204:
[0057] S201. The device monitoring module determines the event type of the target device.
[0058] The event type includes a first event and a second event. For example, the first event is that the target device is connected to the user terminal, and the second event is that the target device is unplugged from the user terminal.
[0059] Optionally, the device type of the target device is a USB device.
[0060] In a possible implementation, the device monitoring module configures a function for determining the event type of the target device by sending registration information to the operating system. Exemplarily, the type of the operating system may be a Windows system. The specific method for configuring the function by the device monitoring module is described in S301-S303 below, which will not be repeated here.
[0061] S202: The device monitoring module determines first indication information according to an event type of the target device.
[0062] The first indication information includes identification information of the target device. Exemplarily, when the target device is a USB device, the identification information of the target device may be a drive letter of the USB device.
[0063] It should be noted that the first indication information is used to instruct the kernel driver module that receives the indication information to control the program on the target device.
[0064] Optionally, the program on the target device includes an executable program, such as a program file in exe format, and may also include a script file program. Further, controlling the program on the target device may specifically include: controlling the execution of the executable program on the target device, and controlling the execution of the script file program on the target device.
[0065] In a possible implementation, when the device monitoring module determines that the event type of the target device is the first event, the device monitoring module determines the identification information of the target device and generates a program prohibition instruction. The program prohibition instruction is used to indicate that the program on the target device is prohibited from running. After that, the device monitoring module determines the identification information of the target device and the program prohibition instruction as the first indication information, so that the kernel driver module performs control on the program on the target device after receiving the information.
[0066] In a possible implementation, when the device monitoring module determines that the event type of the target device is the second event, the device monitoring module determines the identification information of the target device and generates a program prohibition cancellation instruction. The program prohibition cancellation instruction is used to instruct to stop prohibiting the program on the target device from running. After that, the device monitoring module determines the identification information of the target device and the program prohibition cancellation instruction as the first indication information, so that the kernel driver module performs control on the program on the target device after receiving the information.
[0067] S203: The device monitoring module sends first indication information to the kernel driver module. Correspondingly, the kernel driver module receives the first indication information.
[0068] It can be understood that, when the device monitoring module determines that the event type of the target device is the first event, the first indication information includes identification information of the target device and a program prohibition instruction.
[0069] Correspondingly, when the device monitoring module determines that the event type of the target device is the second event, the first indication information includes identification information of the target device and a program prohibition cancellation instruction.
[0070] S204: The kernel driver module controls the program on the target device according to the first instruction information.
[0071] Optionally, after receiving the first indication information, the kernel driver module parses the first indication message to obtain the identification information of the target device included in the first indication information. And, depending on whether the first indication information includes a program prohibition instruction or a program prohibition cancellation instruction, the kernel driver module is divided into the following two processing situations:
[0072] Case 1: The first instruction information includes a program prohibition instruction.
[0073] After receiving the first indication information, the kernel driver module determines the running path of the program in the user terminal. It is understandable that the running path of the program is different according to the type of program. Specifically, the running path includes a process path and a file path, which correspond to an executable program and a script file program respectively.
[0074] After that, the kernel driver module determines whether the program's running path includes the identification information of the target device. If the kernel driver module determines that the program's running path includes the identification information of the target device, the kernel driver module prohibits the program from running.
[0075] It is understandable that if the running path of the program does not include the identification information of the target device, the kernel driver module allows the program to run normally.
[0076] Exemplarily, when the target device is a USB device, the above situation 1 is specifically as follows: after the USB device is inserted into the user terminal, the device monitoring module determines that an event (i.e., a first event) has occurred in which the USB device is connected to the user terminal, determines the drive letter of the USB device and the program prohibition instruction, and generates a first indication message based on the event and sends it to the kernel driver module. After receiving the first indication message, the kernel driver module parses it to obtain the drive letter and the program prohibition instruction of the USB device. Thereafter, the kernel driver module determines the running path of the program in the user terminal. If the running path of a program includes the drive letter of the USB device, the kernel driver module prohibits the program from running.
[0077] Case 2: The first instruction information includes a program prohibition cancellation instruction.
[0078] After receiving the first indication information, the kernel driver module determines the running path of the program in the user terminal. It is understandable that the running path of the program is different according to the type of program. Specifically, the running path includes a process path and a file path, which correspond to an executable program and a script file program respectively.
[0079] After that, the kernel driver module cancels the prohibition operation on the program including the identification information of the target device in the execution path.
[0080] Exemplarily, when the target device is a USB device, the above situation 2 is specifically as follows: after the USB device is unplugged from the user terminal, the device monitoring module determines that an event (i.e., a second event) has occurred in which the USB device is unplugged from the user terminal, determines the drive letter of the USB device and the program prohibition cancellation instruction, and generates a first indication message based on the information and sends it to the kernel driver module. After receiving the first indication message, the kernel driver module parses the information to obtain the drive letter of the USB device and the program prohibition cancellation instruction. Thereafter, the kernel driver module cancels the prohibition operation on the program whose running path includes the drive letter of the USB device.
[0081] In a possible implementation, the kernel driver module configures the function for determining the running path of the program by sending registration information to the operating system. The specific method for the kernel driver module to configure this function is shown in S401-S403 below, which will not be repeated here.
[0082] Based on the above technical solution, in the embodiment of the present application, by monitoring the event type of the target device, the identification information of the target device is determined when the target device is connected to or unplugged from the user terminal, and the indication information including the identification information is determined, so that the kernel driver module can control the program on the target device according to the identification information and instructions included in the indication information, thereby preventing malicious programs on the target device from posing a hidden danger to the security of the terminal.
[0083] For example, in combination Figure 2 ,like Figure 3 As shown, in the device program control method provided by the present application, before S201, the following S301-S303 are also included:
[0084] S301. The device monitoring module sends first registration information to the operating system.
[0085] The first registration information is used by the device monitoring module to apply for registration of the first function, and the device monitoring module can determine the event type of the target device according to the first function.
[0086] S302: The device monitoring module receives first configuration information.
[0087] The first configuration information is used to instruct the device monitoring module to configure a first function.
[0088] Optionally, the first configuration information is determined by the operating system according to the first registration information after receiving the first registration information. It should be noted that the method by which the operating system determines the first configuration information according to the first registration information and sends it to the device monitoring module is a mature technology in the art and will not be described in detail in this embodiment.
[0089] S303: The device monitoring module configures the first function according to the first configuration information.
[0090] It is understandable that after the device monitoring module configures the first function for itself according to the first configuration information, the device monitoring module only determines the device plugging and unplugging events of the target device type based on the first function. Exemplarily, when the target device is a USB device, the device monitoring module determines the event type of the USB device based on the first function only when a device of the USB device type is connected to or unplugged from the user terminal, so as to generate the first indication information later.
[0091] Based on the above technical solution, the device monitoring module in the embodiment of the present application can be configured with a function for determining the event type of the target device to facilitate the subsequent generation of the first indication information.
[0092] For example, in combination Figure 2 ,like Figure 4As shown, the device program control method provided by the present application further includes the following S401-S403 before S204:
[0093] S401. The kernel driver module sends second registration information to the operating system.
[0094] The second registration information is used by the kernel driver module to apply for registration of the second function, and the kernel driver module can determine the running path of the program in the user terminal according to the second function.
[0095] Optionally, the kernel driver module determines, according to the second function, that the running path of the program in the user terminal includes a process path and a file path. Accordingly, the program type corresponds to the running path type of the program. Specifically, the running path includes a process path and a file path, which correspond to an executable program and a script file program, respectively.
[0096] S402: The kernel driver module receives second configuration information.
[0097] The second configuration information is used to instruct the kernel driver module to configure the second function.
[0098] Optionally, the second configuration information is determined by the operating system according to the second registration information after receiving the second registration information. It should be noted that the method by which the operating system determines the second configuration information according to the second registration information and sends it to the kernel driver module is a mature technology in the art and will not be described in detail in this embodiment.
[0099] S403: The kernel driver module configures the second function according to the second configuration information.
[0100] It is understandable that after the kernel driver module configures the second function for itself according to the second configuration information, it can determine the running path of the program in the user terminal based on the second function.
[0101] In a possible implementation, the second function configured by the kernel driver module may be a callback function for process creation. Thus, when a new process is created in the terminal, the kernel driver module can obtain a notification of the process creation according to the callback function, and the notification includes a process creation command. After that, the kernel driver module parses the process creation command according to the callback function to obtain the complete path of the program corresponding to the process and other parameters of the command.
[0102] It should be noted that, for the two cases where the program is an executable program or a script file program, the method in which the kernel driver module determines the running path of the program is also different.
[0103] If the program is an executable program, the kernel driver module parses the process creation command of the process corresponding to the executable program, determines the process path of the executable program based on the obtained complete path of the executable program, and determines whether it includes the identification information of the target device, and finally determines whether to prohibit the program from running.
[0104] If the program is a script file program, the kernel driver module parses the process creation command of the process corresponding to the script file program, determines the file path of the script file program based on other parameters of the script file program creation command obtained, and determines whether it includes the identification information of the target device, and finally determines whether to prohibit the program from running.
[0105] Based on the above technical solution, the kernel driver module in the embodiment of the present application can be configured with a function for determining the running path of the program in the user terminal, so as to facilitate the control of the program on the target device in the subsequent process.
[0106] The embodiment of the present application can divide the device program control device into functional modules or functional units according to the above method example. For example, each functional module or functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules or functional units. Among them, the division of modules or units in the embodiment of the present application is schematic, which is only a logical function division. There may be other division methods in actual implementation.
[0107] For example, Figure 5 , which is a possible structural diagram of a device program control apparatus involved in an embodiment of the present application. The device program control apparatus 500 includes: a processing unit 501 , a sending unit 502 and a receiving unit 503 .
[0108] The processing unit 501 is used to determine the event type of the target device.
[0109] The processing unit 501 is further configured to determine first indication information according to the event type of the target device.
[0110] The sending unit 502 is used to send first indication information to the kernel driver module.
[0111] Optionally, the sending unit 502 is further configured to send the first registration information to the operating system.
[0112] Optionally, the receiving unit 503 is configured to receive first configuration information from an operating system;
[0113] Optionally, the processing unit 502 is further configured to configure the first function according to the first configuration information.
[0114] Optionally, the processing unit 502 is further configured to, when the event type of the target device is the first event, determine identification information and a program prohibition instruction of the target device; and determine the identification information and the program prohibition instruction of the target device as the first indication information.
[0115] Optionally, the processing unit 502 is further configured to, when the event type of the target device is the second event, determine identification information of the target device and a program prohibition cancellation instruction; and determine the identification information of the target device and the program prohibition cancellation instruction as the first indication information.
[0116] Optionally, the device program control device 500 may further include a storage unit ( Figure 5 The storage unit stores a program or instruction. When the processing unit 501, the sending unit 502 and the receiving unit 503 execute the program or instruction, the device program control apparatus can execute the device program control method described in the above method embodiment.
[0117] also, Figure 5 The technical effects of the equipment program control device can refer to the technical effects of the equipment program control method described in the above embodiment, and will not be repeated here.
[0118] For example, Figure 6 , which is a possible structural diagram of a device program control apparatus involved in an embodiment of the present application. The device program control apparatus 600 includes: a receiving unit 601 , a processing unit 602 and a sending unit 603 .
[0119] The receiving unit 601 is used to receive first indication information from the device monitoring module.
[0120] The processing unit 602 is used to control the program on the target device according to the first indication information.
[0121] Optionally, the sending unit 603 is configured to send second registration information to the operating system.
[0122] Optionally, the receiving unit 601 is further configured to receive second configuration information from an operating system;
[0123] Optionally, the processing unit 602 is further configured to configure the second function according to the second configuration information.
[0124] Optionally, the processing unit 602 is further used to determine whether the program's running path includes the identification information of the target device when the first indication information includes a program prohibition instruction; if the program's running path includes the identification information of the target device, prohibiting the program from running.
[0125] Optionally, the processing unit 602 is further configured to stop prohibiting the program from running when the first indication information includes a program prohibition cancel instruction.
[0126] Optionally, the device program control device 600 may further include a storage unit ( Figure 6 The storage unit stores a program or instruction. When the receiving unit 601, the processing unit 602 and the sending unit 603 execute the program or instruction, the device program control apparatus can execute the device program control method described in the above method embodiment.
[0127] also, Figure 6 The technical effects of the equipment program control device can refer to the technical effects of the equipment program control method described in the above embodiment, and will not be repeated here.
[0128] For example, Figure 7 FIG. 2 is another possible structural diagram of the device program control device involved in the above embodiment. Figure 7 As shown, the device program control apparatus 700 includes: a processor 702 .
[0129] Among them, the processor 702 is used to control and manage the actions of the device program control device 700, for example, executing the steps performed by the above-mentioned processing unit 501, sending unit 502, receiving unit 503, receiving unit 601, processing unit 602 and sending unit 603, and / or other processes for executing the technical solution described in this article.
[0130] The processor 702 may be a device that implements or executes various exemplary logic blocks, modules, and circuits described in conjunction with the contents of this application. The processor may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the contents disclosed in this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0131] Optionally, the device program control apparatus 700 may further include a communication interface 703, a memory 701 and a bus 704. The communication interface 703 is used to support the communication between the device program control apparatus 700 and other network entities. The memory 701 is used to store program codes and data of the device program control apparatus.
[0132] Among them, the memory 701 can be a memory in the device program control device, which can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory can also include a combination of the above types of memory.
[0133] The bus 704 may be an Extended Industry Standard Architecture (EISA) bus, etc. The bus 704 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and module described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0135] An embodiment of the present application provides a computer program product including instructions. When the computer program product is run on an electronic device of the present application, the computer is enabled to execute the device program control method described in the above method embodiment.
[0136] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When a computer executes the instructions, the electronic device of the present application executes each step executed by the device program control device in the method flow shown in the above method embodiment.
[0137] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, and a hard disk. Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM), registers, hard disks, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any other form of computer-readable storage medium in a suitable combination of the above, or numerical values in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an Application Specific Integrated Circuit (ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0138] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A device program control method, characterized in that: Applied to the equipment monitoring module, the method comprises: Determine an event type of the target device; wherein the event type includes a first event and a second event, the first event is that the target device is connected to a terminal, and the second event is that the target device is unplugged from the terminal; If the event type of the target device is a first event, determining the identification information and the program prohibition instruction of the target device; determining the identification information of the target device and the program prohibition instruction as first indication information; the program prohibition instruction is used to indicate prohibiting the running of the program on the target device; wherein the first indication information includes the identification information of the target device, the first indication information is used to indicate controlling the program on the target device, and the program includes an executable program and a script file program; If the event type of the target device is the second event, determining the identification information of the target device and the program prohibition cancellation instruction; determining the identification information of the target device and the program prohibition cancellation instruction as the first indication information; the program prohibition cancellation instruction is used to instruct to stop prohibiting the running of the program on the target device; The first indication information is sent to a kernel driver module; the kernel driver module is used to prohibit the program from running when the first indication information includes a program prohibition instruction and the running path of the program in the user terminal includes the identification information of the target device; the kernel driver module is configured with a callback function created by the process; the callback function is used to determine the running path of the program in the user terminal.
2. The method according to claim 1, characterized in that Before determining the event type of the target device, the method further includes: Sending first registration information to the operating system; wherein the first registration information is used to apply for registration of a first function, and the first function is used to determine the event type of the target device; receiving first configuration information from the operating system; Configure the first function according to the first configuration information.
3. The method according to any one of claims 1 to 2, characterized in that: The device type of the target device is a USB device.
4. A device program control method, characterized in that: Applied to the kernel driver module, the method includes: Receive first indication information from a device monitoring module; the first indication information includes identification information of a target device; if the event type of the target device is a first event, the identification information of the target device and a program prohibition instruction are the first indication information; the program prohibition instruction is used to indicate prohibiting the running of a program on the target device; if the event type of the target device is a second event, the identification information of the target device and a program prohibition cancellation instruction are the first indication information; the program prohibition cancellation instruction is used to indicate stopping prohibiting the running of a program on the target device; When the first indication information includes a program prohibition instruction and the running path of the program in the user terminal includes the identification information of the target device, the program is prohibited from running; wherein the program includes an executable program and a script file program; the kernel driver module is configured with a callback function created by the process; the callback function is used to determine the running path of the program in the user terminal.
5. The method according to claim 4, characterized in that Before receiving the first indication information from the device monitoring module, the method further includes: Sending second registration information to the operating system; wherein the second registration information is used to apply for registration of a second function, and the second function is used to determine the running path of the program, and the running path includes a process path and a file path; receiving second configuration information from the operating system; Configure the second function according to the second configuration information.
6. The method according to claim 5, characterized in that The method further comprises: In a case where the first instruction information includes a program prohibition cancel instruction, prohibiting the program from running is stopped.
7. The method according to any one of claims 4 to 6, characterized in that: The device type of the target device is a USB device.
8. A device program control device, characterized in that: The equipment program control device comprises: a processing unit and a sending unit; The processing unit is used to determine the event type of the target device; wherein the event type includes a first event and a second event, the first event is that the target device is connected to a terminal, and the second event is that the target device is unplugged from the terminal; The processing unit is further used to determine the identification information and the program prohibition instruction of the target device when the event type of the target device is the first event; determine the identification information of the target device and the program prohibition instruction as the first indication information; the program prohibition instruction is used to indicate prohibiting the program on the target device from running; determine the first indication information according to the event type of the target device; wherein the first indication information includes the identification information of the target device, the first indication information is used to indicate controlling the program on the target device, and the program includes an executable program and a script file program; The processing unit is further configured to, when the event type of the target device is a second event, determine the identification information of the target device and the program prohibition cancellation instruction; determine the identification information of the target device and the program prohibition cancellation instruction as the first indication information; the program prohibition cancellation instruction is used to instruct to stop prohibiting the running of the program on the target device; The sending unit is used to send the first indication information to the kernel driver module; the kernel driver module is used to prohibit the program from running when the first indication information includes a program prohibition instruction and the running path of the program in the user terminal includes the identification information of the target device; the kernel driver module is configured with a callback function created by the process; the callback function is used to determine the running path of the program in the user terminal.
9. The device program control device according to claim 8, characterized in that: The device program control device further comprises: a receiving unit; The sending unit is further used to send first registration information to the operating system; wherein the first registration information is used to apply for registration of a first function, and the first function is used to determine the event type of the target device; The receiving unit is used to receive first configuration information from the operating system; The processing unit is further used to configure the first function according to the first configuration information.
10. The device program control device according to any one of claims 8 to 9, characterized in that: The device type of the target device is a USB device.
11. A device program control device, characterized in that: The equipment program control device comprises: a receiving unit and a processing unit; The receiving unit is used to receive first indication information from the device monitoring module; the first indication information includes identification information of the target device; if the event type of the target device is the first event, the identification information of the target device and the program prohibition instruction are the first indication information; the program prohibition instruction is used to indicate prohibiting the running of the program on the target device; if the event type of the target device is the second event, the identification information of the target device and the program prohibition cancellation instruction are the first indication information; the program prohibition cancellation instruction is used to indicate stopping prohibiting the running of the program on the target device; The processing unit is used to prohibit the program from running when the first indication information includes a program prohibition instruction and the running path of the program in the user terminal includes the identification information of the target device; wherein the program includes an executable program and a script file program; the kernel driver module is configured with a callback function created by the process; and the callback function is used to determine the running path of the program in the user terminal.
12. The device program control device according to claim 11, characterized in that: The device program control device further comprises: a sending unit; The sending unit is used to send second registration information to the operating system; wherein the second registration information is used to apply for registration of a second function, and the second function is used to determine the running path of the program, and the running path includes a process path and a file path; The receiving unit is further configured to receive second configuration information from the operating system; The processing unit is further used to configure the second function according to the second configuration information.
13. The device program control device according to claim 12, characterized in that: The processing unit is further configured to, when the first indication information includes a program prohibition instruction, determine whether the running path of the program includes the identification information of the target device; if the running path of the program includes the identification information of the target device, prohibit the running of the program; The processing unit is further configured to stop prohibiting the program from running when the first indication information includes a program prohibition cancel instruction.
14. The device program control device according to any one of claims 11 to 13, characterized in that: The device type of the target device is a USB device.
15. An electronic device, characterized in that: include: A processor and a memory; wherein the memory is used to store computer-executable instructions, and when the electronic device is running, the processor executes the computer-executable instructions stored in the memory so that the electronic device executes the device program control method as described in any one of claims 1-3 or claims 4-7.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes instructions. When the instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to execute the device program control method according to any one of claims 1 to 3 or claims 4 to 7.
Citation Information
Patent Citations
Security label-based USB anti-ferry method
CN106951789A
Computer for virus prevention with software solidification
CN107145785A