Business operation control method and device, electronic equipment and storage medium

By hooking into the target process's interface and monitoring resource data, the problem of excessive I/O reads and speed fluctuations in antivirus operations of security applications was solved, achieving precise control over resource usage and stability of system performance.

CN116126232BActive Publication Date: 2025-11-21SANGFOR TECH INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211674768.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-26
Publication Date
2025-11-21
Estimated Expiration
2042-12-26

AI Technical Summary

Technical Problem

In existing technologies, security applications cause excessive disk I/O reads and speed fluctuations when performing antivirus operations, affecting system performance. Existing control methods are not precise enough.

Method used

By hooking the interface in the target process used to call the target file, the remaining resource data is obtained. The interface is only called to perform the target business operation when the execution conditions are met, so as to achieve precise control of resources.

Benefits of technology

It enables precise control over resource usage for target business operations, avoids fluctuations in resource usage, and improves system performance stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126232B_ABST
    Figure CN116126232B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer processing, in particular to a business operation control method and device, electronic equipment and a storage medium. The business operation control method, device, electronic equipment and storage medium provided by the application are used for hooking a first interface for calling a target file corresponding to a target business operation in a target process when the target process is started; current residual resource data is acquired; when the current residual resource data meets a target business operation execution condition, the first interface is called to enable the target process to perform the target business operation; in the above manner, the first interface corresponding to the target process is hooked, the target process cannot directly perform the target business operation on the target file, and when the residual resource data meets the target business operation execution condition, the first interface is called, so that accurate control of resource data used for the target business operation can be realized, and resource use fluctuation caused by the target business operation can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer processing, and in particular to a business operation control method and device, electronic equipment and storage medium. BACKGROUND

[0002] When the security application installed in the electronic device performs operations such as virus killing, a large number of file reading operations are performed, which can easily cause excessive disk IO (Input / Output) reading and fluctuation of reading speed, indirectly affecting the performance of the system disk. In the prior art, the reading and writing of program IO is indirectly affected by controlling the enumeration file speed or CPU control of thread suspension, or by controlling the reading and writing size of a single file to control IO. However, the above methods have the problem of inaccurate reading and writing control, which can easily cause disk IO reading and writing fluctuations. SUMMARY

[0003] In view of the above problems, the embodiments of the present application provide a business operation control method and device, electronic equipment and storage medium to solve the above technical problems.

[0004] In a first aspect, the embodiments of the present application provide a business operation control method, comprising:

[0005] When the target process is started, a first interface in the target process for calling a target file corresponding to a target business operation is hooked;

[0006] Obtain the current remaining resource data;

[0007] When the current remaining resource data meets the target business operation execution condition, the first interface is called to make the target process perform the target business operation.

[0008] As an implementation manner, the first interface in the target process for calling the target file corresponding to the target business operation is hooked, comprising:

[0009] The address of the first interface in the target process for calling the target file corresponding to the target business operation is replaced with a preset hook address.

[0010] As an implementation manner, after the current remaining resource data is obtained, the method further comprises:

[0011] When the current remaining resource data does not meet the target business operation execution condition, the target process is controlled to enter a waiting state;

[0012] Obtain the current remaining resource data updated at a first time interval.

[0013] As an implementation, after the current residual resource data is acquired, the method further includes:

[0014] Target resource data of the target service operation is acquired, and whether the current residual resource data satisfies a target service operation execution condition of the target process is determined according to the target resource data and the current residual resource data.

[0015] As an implementation, after the first interface is called to make the target process perform the target service operation, the method further includes:

[0016] The residual resource data is updated according to target resource data of the target service operation.

[0017] As an implementation, after the current residual resource data is acquired, the method further includes:

[0018] Release resource data is received at a second time interval;

[0019] The residual resource data is updated according to the received release resource data.

[0020] As an implementation, after the first interface for calling a target file corresponding to the target service operation in the target process is hooked when the target process is started, the method further includes:

[0021] The application program that initiates the target service operation is suspended;

[0022] Correspondingly, after the first interface is called to make the target process perform the target service operation, the method further includes:

[0023] The application program that initiates the target service operation is resumed.

[0024] In a second aspect, an embodiment of the present application further provides a service operation control device, which includes:

[0025] A hooking module is configured to hook a first interface for calling a target file corresponding to a target service operation in a target process when the target process is started;

[0026] A resource acquisition module is configured to acquire current residual resource data;

[0027] An execution control module is configured to call the first interface to make the target process perform the target service operation when the current residual resource data satisfies a target service operation execution condition.

[0028] In a third aspect, an electronic device is provided, including a processor, and a memory coupled to the processor, the memory storing program instructions executable by the processor; the processor executes the program instructions stored in the memory to implement the service operation control method.

[0029] In a fourth aspect, a storage medium is provided, the storage medium storing program instructions, the program instructions being executable by a processor to implement the service operation control method.

[0030] The service operation control method, device, electronic device, and storage medium provided by the embodiments of the present application can hook the first interface for calling the target file corresponding to the target service operation in the target process when the target process is started, obtain the current residual resource data, and call the first interface to make the target process perform the target service operation when the current residual resource data meets the target service operation execution condition of the target process. In this way, the first interface corresponding to the target process is hooked, and the target process cannot directly perform the target service operation on the target file. When the residual resource data meets the target service operation execution condition, the first interface is called, the accurate control of the resource data used for the target service operation can be achieved, and the resource use fluctuation caused by the target service operation can be avoided.

[0031] These aspects and other aspects of the present application will be more apparent in the following description of the embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0033] Figure 1 A flowchart of a service operation control method provided by an embodiment of the present application is shown.

[0034] Figure 2 A block diagram of the framework of service operation control in an embodiment of the present application is shown.

[0035] Figure 3 A flowchart of the framework of service operation control in an embodiment of the present application is shown.

[0036] Figure 4 A structural diagram of a service operation control device provided by an embodiment of the present application is shown.

[0037] Figure 5A structural diagram of an electronic device provided by an embodiment of the present application is shown.

[0038] Figure 6 A structural diagram of a storage medium provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0039] Embodiments of the present application are described below in detail, examples of which are shown in the drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below are exemplary only, and are used to explain the present application, and cannot be understood as limiting the present application.

[0040] In order to make the technical personnel in the art better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0041] In the embodiments of the present application, at least one means one or more; and multiple means two or more than two. In the description of the present application, the terms "first", "second", "third" and the like are only used to distinguish the described purposes, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order.

[0042] In the description of the present application, the reference "an embodiment" or "some embodiments" and the like means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, in the description of the present application, the terms "include", "contain", "have" and their variants all mean "include but not limited to", unless otherwise specifically emphasized.

[0043] It should be noted that in the embodiments of the present application, the "and / or" description of the association relationship between the associated objects means that there can be three relationships, for example, A and / or B can represent the existence of A alone, the existence of A and B together, and the existence of B alone.

[0044] It should be noted that in the embodiments of the present application, "connection" can be understood as electrical connection, and the connection between two electrical elements can be direct or indirect connection between two electrical elements. For example, A and B are connected, which can be direct connection between A and B, or indirect connection between A and B through one or more other electrical elements.

[0045] An embodiment of the present application provides a service operation control method. An execution subject of the service operation control method includes but is not limited to at least one of electronic devices such as a server and a terminal, which can be configured to execute the service operation control method provided by the embodiment of the present application. In other words, the service operation control method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to a single server, a server cluster, a cloud server or a cloud server cluster.

[0046] It should be noted that an application program is active in the form of a process during running, and the process is an instance of a program being run.

[0047] Referring to FIG. 1, Figure 1 It should be noted that the method of the present application is not limited to the order of the flow shown in FIG. 1 as long as the same result is achieved. Figure 1 In the embodiment, the service operation control method includes the following steps:

[0048] S10, when a target process is started, a first interface in the target process for calling a target file corresponding to a target service operation is hooked;

[0049] In the embodiment, the target application program initiates a request to an operating system when a target service operation needs to be executed, and the operating system creates a target process to execute the target service operation in response to the request. In the process of executing the target service operation, a target file stored in a storage medium needs to be called, the first interface is an interface for the target process to call the target file, and the target process calls the target file through the first interface.

[0050] In the embodiment, the hook is a method of hijacking and controlling the first interface in the target process, and the control of the target service operation is achieved by hijacking and controlling the first interface. For example, the original address of the first interface is address A, address A is replaced by address B, and address B is read at runtime instead of address A of the first interface. The above process is a hook of the first interface.

[0051] It should be noted that the target process is a monitored process that may cause fluctuations in system resources, and the target application program needs to perform many operations, without the need to hook each operation to reduce the cost of executing the hook.

[0052] The following will be described in detail with a specific application scenario as an example. The target application program can be an antivirus application program, and the first interface can be a system API (Application Programming Interface) of an operating system. The target business operation can be a file reading operation, or the target business operation can also be an antivirus operation, which needs to open a target file to read and write the content of the file. More specifically, the operating system can be windows, and the system API can be ReadFile and ReadFileEx of the kernel32 library. The operating system can also be Linux, and the system API can be read and write of the standard C library.

[0053] S20, obtaining current remaining resource data;

[0054] The target process needs to consume resources when performing the target business operation. The current remaining resource data can be the amount of allocatable and unoccupied resources, for example, the resources can be IO traffic, the IO traffic is the data size written / read per unit time, and the unit of the IO traffic can be M / s.

[0055] S30, when the current remaining resource data meets the target business operation execution condition, calling the first interface to enable the target process to perform the target business operation;

[0056] The amount of resources required for performing the target business operation is the target resource data, and the target business operation execution condition can include i) the target resource data is less than the current remaining resource data; or ii) the difference between the current remaining resource data and the target resource data is greater than or equal to a preset resource data threshold. If the current remaining resource data meets the target business operation execution condition of the target process, the first interface is called to enable the target process to perform the target business operation, and performing the target business operation will consume the remaining resource data.

[0057] The business operation control method of the embodiment realizes the unified management of the entry of the target process for operating the target file by hooking the first interface in the target process, so as to control the target business operation. The first interface is called only when the current remaining resource data meets the target business operation execution condition of the target process, thereby realizing the precise control of the resource consumption of the target business operation, and avoiding the resource use fluctuation caused by the target business operation.

[0058] As an implementation manner, the target business operation is a file reading and writing operation, and the first interface is an interface for reading and writing a file. The business operation control method of the embodiment includes the following steps:

[0059] S10', when the target process is started, hooking a first interface in the target process for calling a read-write file;

[0060] S20', obtaining current residual resource data;

[0061] S30', when the current residual resource data meets a file read-write condition of the target process, calling the first interface to make the target process perform a file read-write operation.

[0062] As an implementation, after step S20 and before step S30, the method further includes the following step:

[0063] S21, obtaining target resource data of the target service operation, and determining whether the current residual resource data meets a target service operation execution condition of the target process according to the target resource data and the current residual resource data.

[0064] If a difference between the current residual resource data and the target resource data is greater than or equal to a preset resource data threshold, it is determined that the current residual resource data meets the target service operation execution condition of the target process; if the difference between the current residual resource data and the target resource data is less than the preset resource data threshold, it is determined that the current residual resource data does not meet the target service operation execution condition of the target process.

[0065] As an implementation, the way of hooking the first interface in the target process for calling a target file corresponding to the target service operation can be that: replacing an address of the first interface in the target process for calling the target file corresponding to the target service operation with a preset hooking address. In this implementation, when the target process serving as a control target is started, the first interface in the target process for calling the operation target file is redirected to a hooking interface, and an address of the hooking interface is the preset hooking address.

[0066] As an implementation, the service operation control method of the embodiment further includes the following step after step S20:

[0067] S41, when the current residual resource data does not meet the target service operation execution condition, controlling the target process to enter a waiting state;

[0068] S42, obtaining current residual resource data updated at a first time interval.

[0069] In the embodiment, if the current remaining resource data does not satisfy the target service operation execution condition of the target process, the target process is suspended to enter a waiting state, and the occupied resources are released after other processes are executed. The current remaining resource data is reacquired every first time interval, and it is determined whether the target service operation execution condition of the target process is satisfied according to the reacquired current remaining resource data. The step S30 or the steps S41 and S42 are continuously executed.

[0070] As an implementation mode, after the step S30, the following steps are further included:

[0071] S51, the remaining resource data is updated according to the target resource data of the target service operation.

[0072] In the embodiment, when it is determined that the current remaining resource data satisfies the target service operation execution condition of the target process, the resource data difference value between the current remaining resource data and the target resource data is acquired, and the acquired resource data difference value is taken as the updated remaining resource data.

[0073] As an implementation mode, after the step S20, the following steps are further included:

[0074] S61, the release resource data is received at a second time interval;

[0075] S62, the remaining resource data is updated according to the received release resource data.

[0076] In the embodiment, in order to improve the accuracy of the target service operation control, a preset resource data release amount is received every second time interval, the preset resource data release amount is the release resource data, the remaining resource data is increased by a preset resource data release amount every second time interval, and the remaining resource data can satisfy the target service operation execution condition of the target process after a plurality of second time intervals.

[0077] As an implementation mode, after the step S10, the following steps are further included:

[0078] S71, the application program initiating the target service operation is suspended;

[0079] After the first interface hook in the target process, the target service operation is suspended. Since the subsequent operation of the application program initiating the target service operation depends on the result of the target service operation, the application program is suspended before the target service operation is executed to save memory resources.

[0080] Correspondingly, after the step S30, the following steps are further included:

[0081] S72, the application program initiating the target service operation is resumed to run.

[0082] Specifically, when the target business operation meets the execution conditions, the application will resume running so that it can continue its original workflow and initiate other business operations.

[0083] As one implementation method, the service operation control method of this embodiment can be achieved through... Figure 2 The control system shown is implemented; please refer to [the relevant documentation / reference]. Figure 2 The diagram shows the framework principle of business operation control. Figure 3 The flowchart shown illustrates the business operation control process. The control system includes a Hook module, a resource control module, and a resource production module. These three modules can be software modules and can be implemented through software programs.

[0084] Please refer to Figure 2 As shown, the functions of each module are as follows:

[0085] The Hook module is used to hook the first interface of the target file in the target process that is used to call the target business operation, and to generate a target business operation request based on the target business operation of the target process, and send the generated target business operation request to the resource control module.

[0086] The resource production module receives resource release data at second time intervals and updates the remaining resource data based on the received resource release data. The resource production module also periodically produces resource values, which are then controlled by the resource control module.

[0087] The resource control module receives the target business operation request sent by the Hook module, obtains the current remaining resource data from the resource production module, determines whether the target business operation execution conditions of the target process are met based on the current remaining resource data, and when met, calls the first interface to make the target process perform the target business operation, generates the corresponding target business operation execution notification, and sends the target business operation execution notification to the hook module.

[0088] Please see Figure 3 As shown, the flow of the business operation control method in this embodiment is as follows:

[0089] Step (1): When the target process starts, load the Hook module;

[0090] Step (2): The Hook module loads the resource control module and initializes the resource control module;

[0091] Step (3): The Hook module replaces the address of the first interface in the target process with the hook address of the Hook module;

[0092] Step (4): Control the application corresponding to the target process to enter a waiting state;

[0093] Step (5): The Hook module generates a target business operation request based on the target business operation of the target process, and sends the generated target business operation request to the resource control module;

[0094] Step (6): The resource production module is used to receive released resource data at a second time interval and update the remaining resource data according to the received released resource data;

[0095] Step (7): Sub-step (7-1): After receiving the target business operation request sent by the Hook module, the resource control module obtains the current remaining resource data from the resource production module; Sub-step (7-2): Based on the current remaining resource data, determine whether the target business operation execution conditions of the target process are met. If met, call the first interface to make the target process perform the target business operation; if not met, proceed to sub-step (7-3); Sub-step (7-3): Wait for the resource production module to receive the release resource data at the second time interval, update the remaining resource data according to the received release resource data, until the conditions are met, call the first interface to make the target process perform the target business operation;

[0096] Step (8): After the resource control module calls the first interface, it generates the corresponding target business operation execution notification and sends the target business operation execution notification to the hook module;

[0097] Step (9): The Hook module allows the application to enter the waiting state, so that the application can continue to execute the next business operation according to the original process.

[0098] One embodiment of this application provides a business operation control device, such as... Figure 4 As shown, the business operation control device includes: a hooking module 41, a resource acquisition module 42, and an execution control module 43. The hooking module 41 is used to hook the first interface of the target process that is used to call the target file corresponding to the target business operation when the target process starts. The resource acquisition module 42 is used to acquire the current remaining resource data. The execution control module 43 is used to call the first interface to make the target process perform the target business operation when the current remaining resource data meets the execution conditions of the target business operation.

[0099] In some implementations, the hook module 41 is further configured to: replace the address of the first interface in the target process used to call the target business operation corresponding to the target file with a preset hook address.

[0100] In some embodiments, the execution control module 43 is further configured to control the target process to enter a waiting state when the current remaining resource data does not satisfy the target service operation execution condition; and acquire current remaining resource data updated at a first time interval.

[0101] In some embodiments, the execution control module 43 is further configured to acquire target resource data of the target service operation, and determine whether the current remaining resource data satisfies a target service operation execution condition of the target process according to the target resource data and the current remaining resource data.

[0102] In some embodiments, the resource acquisition module 42 is further configured to update the remaining resource data according to target resource data of the target service operation.

[0103] In some embodiments, the resource acquisition module 42 is further configured to receive release resource data at a second time interval; and update the remaining resource data according to the received release resource data.

[0104] In some embodiments, the hook module 41 is further configured to suspend an application that initiates the target service operation; and accordingly, the hook module 41 is further configured to resume running the application that initiates the target service operation.

[0105] Figure 5 FIG. 1 is a structural schematic diagram of an electronic device according to an embodiment of the present application. As shown in FIG. 1, the electronic device 50 includes a processor 51 and a memory 52 coupled to the processor 51. Figure 5

[0106] The memory 52 stores program instructions for implementing the service operation control method of any of the above embodiments.

[0107] The processor 51 is configured to execute the program instructions stored in the memory 52 to perform service operation control.

[0108] The processor 51 can also be referred to as a CPU (Central Processing Unit). The processor 51 can be an integrated circuit chip with processing capability. The processor 51 can also be a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The general purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0109] Referring to FIG. 1, Figure 6 , Figure 6 ​A structural schematic diagram of a storage medium of an embodiment of the present application. The storage medium 60 of the embodiment of the present application stores program instructions 61 capable of implementing all the methods described above, wherein the program instructions 61 can be stored in the storage medium in the form of a software product, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes, or a terminal device such as a computer, a server, a mobile phone, a tablet, etc.

[0110] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0111] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit. The above is only an embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the contents of the specification and drawings of the present application, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.

[0112] The above is only a preferred embodiment of the present application, and does not limit the present application in any form, although the present application has been disclosed as above with a preferred embodiment, however, it is not intended to limit the present application, any person skilled in the art, without departing from the scope of the technical solution of the present application, can make some changes or modifications as equivalent embodiments, but as long as it does not deviate from the technical solution of the present application, according to the technical essence of the present application, any brief introduction, modification, equivalent change and modification of the above embodiments are still within the scope of the technical solution of the present application.

Claims

1. A service operation control method characterized by comprising: The method comprises the following steps: hooking a first interface in a target process for calling a target file corresponding to a target service operation when the target process is started, to control the target service operation; obtaining current residual resource data; when the current residual resource data meets a target service operation execution condition, calling the first interface to make the target process perform the target service operation; when the current residual resource data does not meet the target service operation execution condition, controlling the target process to enter a waiting state.

2. The service operation control method according to claim 1, characterized by, The hooking the first interface in the target process for calling the target file corresponding to the target service operation comprises: replacing an address of the first interface in the target process for calling the target file corresponding to the target service operation with a preset hooking address.

3. The service operation control method according to claim 1, characterized by, After the controlling the target process to enter the waiting state when the current residual resource data does not meet the target service operation execution condition, the method further comprises the following steps: obtaining the current residual resource data updated at a first time interval.

4. The service operation control method according to claim 1, characterized by, After the obtaining the current residual resource data, the method further comprises the following steps: obtaining target resource data of the target service operation, and determining whether the current residual resource data meets a target service operation execution condition of the target process according to the target resource data and the current residual resource data.

5. The service operation control method according to claim 1, characterized by, After the calling the first interface to make the target process perform the target service operation, the method further comprises the following steps: updating the residual resource data according to target resource data of the target service operation.

6. The service operation control method according to claim 5, characterized by, After the obtaining the current residual resource data, the method further comprises the following steps: receiving release resource data at a second time interval; updating the residual resource data according to the received release resource data.

7. The service operation control method according to claim 1, characterized by, After the hooking the first interface in the target process for calling the target file corresponding to the target service operation when the target process is started, the method further comprises the following steps: suspending an application program initiating the target service operation; correspondingly, after the calling the first interface to make the target process perform the target service operation, the method further comprises the following steps: resuming running of the application program initiating the target service operation.

8. A service operation control device characterized by comprising: The method comprises the following steps: a hooking module is configured to hook a first interface in a target process for calling a target file corresponding to a target service operation when the target process is started, to control the target service operation; a resource obtaining module is configured to obtain current residual resource data; an execution control module is configured to, when the current residual resource data meets a target service operation execution condition, call the first interface to make the target process perform the target service operation; and when the current residual resource data does not meet the target service operation execution condition, control the target process to enter a waiting state.

9. An electronic device, comprising: The method comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions executable by the processor; and the processor executes the program instructions stored in the memory to implement the service operation control method in any one of claims 1 to 7.

10. A storage medium, characterized by The storage medium stores program instructions, and the program instructions are executed by the processor to implement the business operation control method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Resource broker system for deploying and managing software service in a virtual environment

    US20100125844A1