Data scanning method, apparatus, electronic device and storage medium
By setting up the scanning engine in an independent scanning agent process and using multiple subprocesses to call different scanning engines, the inefficiency and security risks caused by integrating security scanning and data forwarding functions are resolved, achieving more efficient and secure data transmission.
Patent Information
- Application Number
- CN202211739721.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In existing technologies, security scanning and data forwarding functions are integrated into the same process, which can lead to an unstable or untrusted security engine affecting the normal operation of the forwarding function, resulting in low data transmission efficiency and information security risks.
The scanning agent process is separated from the forwarding process. A scanning engine is set in the scanning agent process. Data scanning is performed through an independent scanning agent process, which limits the impact of unstable or untrusted scanning engines on the forwarding process. An engine object is constructed using a preset engine structure and the function type is converted to adapt to different scanning engines. Multiple subprocesses are used to call different scanning engines to perform scanning.
It improves the efficiency and security of data transmission, reduces the impact of unstable or untrusted scanning engines on the forwarding process, enhances the accuracy and applicability of scanning, and reduces the risk of data leakage.
Smart Images

Figure CN116192464B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information security technology, and more specifically, to a data transmission scanning method, apparatus, electronic device, and storage medium. Background Technology
[0002] To ensure server security, traffic data flowing through the server is usually scanned for security. For example, when traffic data is sent to the internal network, it needs to be scanned by a proxy server before being forwarded to the internal network to prevent virus files carried in the data traffic from endangering the information security of the internal network.
[0003] Currently, security scanning functions are usually set up in the same process as traffic data forwarding functions. This process performs security scanning and forwarding of traffic data simultaneously. Security scanning functions usually use security engines for scanning. Integrating security engines and forwarding functions in the same process can lead to information security problems such as data leakage if the security engine comes from an unstable or untrusted third party. Summary of the Invention
[0004] In view of this, this application aims to provide a data scanning method, apparatus, electronic device, and storage medium to improve the efficiency and security of data transmission.
[0005] In a first aspect, embodiments of this application provide a data scanning method, comprising: receiving a scanning request sent by the forwarding process based on a transmission connection between a scanning agent process and a forwarding process, wherein the scanning request includes information characterizing data to be scanned; scanning the data to be scanned based on a preset scanning engine and the scanning request to obtain a scanning result; and feeding back the scanning result to the forwarding process.
[0006] In this embodiment, the scanning agent process and the forwarding process are set separately, and the scanning engine is set through the scanning agent process. This can limit the insecurity or instability of the scanning engine to the scanning agent process, reduce the impact of an unstable or untrusted scanning engine on the forwarding process, and thus improve the efficiency and security of data transmission.
[0007] In one embodiment, before scanning the data to be scanned based on a preset scanning engine and the scanning request, the method further includes: constructing an engine object according to a preset engine structure and the scanning engine; placing the engine object into a scanning engine array, wherein the scanning engine array is used to enable the scanning agent process to call the scanning engine.
[0008] In this embodiment, an engine object corresponding to the scanning engine is constructed by pre-setting an engine structure, and the engine object is placed into the scanning engine array. This allows for the simple introduction of different scanning engines, thereby improving convenience and applicability, and making it easier for users to select and replace trusted and stable scanning engines.
[0009] In one embodiment, before constructing the engine object based on the preset engine structure and the scanning engine, the method further includes: when it is determined that the function type of the scanning engine is different from the function type of the preset engine structure, converting the function type of the scanning engine to the same function type as the preset engine structure based on the preset function conversion relationship between the function type of the scanning engine and the function type of the preset engine structure, so as to place the scan engine after function type conversion into the scan engine array.
[0010] In this embodiment, by using a preset function conversion relationship, scanning engines with different function types can be converted into function types with the same preset engine structure. This allows the scanning agent process to reference different scanning engines, expanding its applicability. Simultaneously, it reduces user concerns about scanning engine compatibility, enabling users to choose trusted and stable scanning engines, thus improving the efficiency and security of data transmission during scanning.
[0011] In one embodiment, placing the engine object into the scanning engine array includes: placing multiple engine objects built based on different scanning engines into the scanning engine arrays of different subprocesses of the scanning agent process, wherein the scanning agent process includes multiple subprocesses, and each subprocess includes a corresponding scanning engine array.
[0012] In this embodiment, by setting up multiple sub-processes, each sub-process references a scanning engine through scanning engine data. This limits potential security or stability issues of the scanning engine to the sub-processes, effectively reducing the impact of the scanning engine on the forwarding process's data forwarding and improving the security and efficiency of data forwarding.
[0013] In one embodiment, scanning the data to be scanned based on a preset scanning engine and the scanning request includes: determining a subprocess to scan the data to be scanned; invoking a scanning engine corresponding to the engine flag based on an engine flag in the subprocess, so as to use the corresponding scanning engine to scan the data to be scanned; wherein the engine flag is set within the preset engine structure, and different engine flags are used to characterize different scanning engines.
[0014] In this embodiment of the application, by setting different engine flags in different sub-processes, different sub-processes can call different scanning engines to scan the data to be scanned, thereby improving the accuracy of scanning the data to be scanned and thus improving the security of data transmission in the forwarding process.
[0015] In one embodiment, before receiving the scan request sent by the forwarding process based on the transmission connection between the scanning agent process and the forwarding process, the method further includes: receiving a registration request from the forwarding process based on the main process, wherein the scanning agent process includes the main process and a child process; establishing a transmission connection between the scanning agent process and the forwarding process according to the registration request; generating the child process based on the transmission connection and the forwarding process, so as to scan the data to be scanned by the forwarding process based on the child process.
[0016] In this embodiment, a transmission connection between the scanning agent process and the forwarding process is established and a child process is generated based on the registration request of the forwarding process. This allows the child process to process only the data to be scanned for the corresponding forwarding process, avoiding the scanning engine from scanning unregistered forwarding processes. This reduces the security issues caused by the scanning engine scanning the data to be scanned in unregistered forwarding processes and improves the security of data forwarding.
[0017] In one embodiment, after receiving the scan request sent by the forwarding process, the method further includes: the main process feeding back response information indicating successful reception to the forwarding process.
[0018] In this embodiment, after receiving a scan request, a response indicating successful reception is sent back to the forwarding process, so that the forwarding process can perform other tasks, thereby improving the data forwarding efficiency of the forwarding process and reducing the impact of scan engine malfunctions on the working efficiency of the forwarding process.
[0019] Secondly, embodiments of this application provide a data scanning device, comprising: a request module, configured to receive a scanning request sent by the forwarding process based on a transmission connection between a scanning agent process and a forwarding process, wherein the scanning request includes information characterizing data to be scanned; a scanning module, configured to scan the data to be scanned based on a preset scanning engine and the scanning request, thereby obtaining a scanning result; and the scanning module further configured to feed back the scanning result to the forwarding process.
[0020] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor causes the processor to perform the data transmission scanning method as described in the first aspect.
[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the data transmission scanning method as described in the first aspect. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A schematic diagram illustrating the relationship between the scanning proxy process and the forwarding process provided in this application embodiment;
[0024] Figure 2 A flowchart illustrating a data scanning method provided in this application embodiment;
[0025] Figure 3 This is an interactive schematic diagram of a data scanning method provided in an embodiment of this application;
[0026] Figure 4 A schematic diagram of a data scanning device provided in an embodiment of this application;
[0027] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0028] Icons: Data transmission scanning device 200; request module 210; scanning module 220; electronic device 300; processor 310; memory 320. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0030] This application provides a method for scanning transmission data, used to scan traffic data.
[0031] In the data transmission scanning method provided in this application, a scanning agent process is pre-constructed, and the data transmission scanning method of this application is executed using the scanning agent process. Please refer to [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram illustrating the relationship between the scanning agent process and the forwarding process provided in an embodiment of this application.
[0032] A forwarding process refers to the process of forwarding traffic data. Through a forwarding process, data received from the network or other electronic devices can be forwarded to a preset location. For example, when sending data from a personal computer to the company's internal network, the server can receive the data from the personal computer through a forwarding process and forward it to the company's internal network.
[0033] Scan the proxy process to perform a security scan on the data forwarded by the forwarding process.
[0034] In this embodiment, the scanning agent process can invoke the scanning engine to perform a security scan on the data in the forwarding process. The scanning engine is used for security scanning, and its specific implementation can refer to existing technologies, which will not be elaborated here. The scanning agent process can include a main process and a child process. The main process, i.e., the Master, can receive requests from the forwarding process to scan data. The child process, i.e., the Worker, can, after receiving a request, invoke a pre-set scanning engine to process the data requested by the forwarding process.
[0035] It is understandable that the forwarding process and the scanning agent process are independent processes. They run independently on the same electronic device, such as a proxy server. When the forwarding process needs to scan data, it sends a request to the scanning agent process to perform the scan.
[0036] Next, the data transmission scanning method provided in the embodiments of this application will be described in conjunction with the forwarding process, the scanning proxy process, and the scanning engine.
[0037] Please see Figure 2 , Figure 2 A flowchart illustrating a data transmission scanning method provided in this application embodiment. The data transmission scanning method includes:
[0038] S110 receives scan requests sent by the forwarding process based on the transmission connection between the scan agent process and the forwarding process.
[0039] S120 scans the data to be scanned based on a preset scanning engine and scanning request, and obtains the scanning results.
[0040] S130, the scan results are fed back to the forwarding process.
[0041] Please see Figure 3 , Figure 3 This is an interactive schematic diagram of the data transmission scanning method provided in an embodiment of this application.
[0042] Prior to S110, the forwarding process could receive data packets from the network, i.e. traffic data. The forwarding process could determine whether the traffic data needed to be security scanned according to its own policy. If no security scan was required, the forwarding process could directly forward the traffic data to a preset location, such as the internal network of a company or school.
[0043] If the forwarding process determines that a security scan of the traffic data is necessary, it can send a scan request to the scanning agent process.
[0044] The forwarding process needs to register with the scanning agent process so that the scanning agent process can establish a transmission connection with the forwarding process, thereby enabling the scanning agent process to receive scanning requests from the forwarding process.
[0045] In one embodiment, the registration process includes: receiving a registration request from a forwarding process based on the main process; establishing a transmission connection between the scanning agent process and the forwarding process based on the registration request; generating a child process based on the transmission connection and the forwarding process, and scanning the data to be scanned by the forwarding process based on the child process.
[0046] In this embodiment, the main process receives requests from the forwarding process, which may include registration requests and scan requests. After the main process receives a registration request, the scan agent process can establish a transport connection with the forwarding process. This transport connection is used to send scan requests. The transport connection can be a socket (a programming interface) for transmitting scan messages, and the socket between the main process and the forwarding process is a request socket.
[0047] After the main process receives a registration request from the forwarding process and establishes a transport connection between them, the scanning agent process can create a child process corresponding to the forwarding process. The child process can have the same structure as the main process; that is, it can be a copy of the main process. It can be understood that the main process and the child process have different roles: the main process receives requests (acting as the receiver), while the child process scans the data to be scanned by the forwarding process and returns the scan results to the forwarding process. It can be understood that the main process is not used to scan the data to be scanned.
[0048] For the same forwarding process, multiple child processes can be created. Different child processes can reference the same or different scanning engines, so that different child processes can handle different requests from the forwarding process respectively.
[0049] After creating the child process, a transmission connection can be established between the child process and the forwarding process. This means a socket can be established; the socket between the child process and the forwarding process is a response socket (response interface).
[0050] In this process, once a scanning agent process has established a transmission connection with a forwarding process, another forwarding process needs to establish a connection with the scanning agent process. For example, if the scanning agent process has already established a transmission connection with forwarding process 1, and now needs to establish a transmission connection with forwarding process 2, the main process can receive the registration request from forwarding process 2 and establish a Request socket. Since the current child process of the scanning agent process is used to scan the data to be scanned by forwarding process 1, when switching to forwarding process 2, the existing child process can be cleared, and a new child process and Response socket can be established with forwarding process 2.
[0051] The above method allows the forwarding process to register with the scanning agent process, thereby establishing a transmission connection between the forwarding process and the scanning agent process, so that the forwarding process can request the scanning agent process to scan the data to be scanned.
[0052] After creating a child process, you can preset the scanning engine that the child process will use when scanning the data to be scanned.
[0053] In one embodiment, the preset scanning engine includes: constructing an engine object based on a preset engine structure and a scanning engine; placing the engine object into a scanning engine array, the scanning engine array being used to enable the scanning agent process to call the scanning engine.
[0054] In this embodiment, the scanning engine array can store engine objects with a preset engine structure. For example, the preset engine structure may include:
[0055] 1-module_id: The corresponding Mark;
[0056] 2-(*master_init)(void): The callback function used when the Master process is initialized, for global initialization. It can be empty.
[0057] 3-(*worker_init)(void): The callback function for initializing the Worker process; it can be empty.
[0058] 4-(*do_scan)(char*filenames[],int file_num,void*arg,void**result,int*len): The callback function for the scanning function, which cannot be empty.
[0059] Here, `module_id` is used to set the flag of the scanning engine, i.e., Mark, to identify the scanning engine used by this engine object. `(*master_init)(void)` and `(*worker_init)(void)` can respectively set the calling function of the Master, used for initializing the scanning agent process. `(*do_scan)` can set the calling function of the scanning engine, used to invoke the scanning engine corresponding to Mark.
[0060] By setting the information corresponding to the scanning engine in `module_id` and `(*do_scan)` respectively, the engine object can be obtained. Then, the engine object is filled into the engine call of the scanning agent process's scanning function, allowing the scanning agent process to call the scanning engine to scan the data to be scanned. It should be understood that the above is merely an example and should not be construed as limiting this application. Furthermore, the pre-defined engine structure facilitates the integration of other functional functions. For example, preprocessing functions and post-processing functions can be set to preprocess the data to be scanned, or to perform post-processing such as data statistics and type conversion on the data after obtaining the scan results, to meet different needs.
[0061] In this embodiment, the scanning function's engine call is set within a subprocess and invoked through a scanning engine array; therefore, the aforementioned engine object is set within a subprocess. By placing the engine object within a subprocess, the impact of scanning engine insecurity on the main process and the forwarding process can be effectively reduced, thereby improving the security of traffic data scanning and forwarding.
[0062] In some scenarios, since different scanning engines may be built by different developers, the programming languages and function types used to build the scanning engines may be different. The function types of some scanning engines may be inconsistent with the functions used in the preset engine structure. Therefore, in the embodiments of this application, when it is determined that the function type of the scanning engine is different from the function type of the preset engine structure, the function type of the scanning engine can be converted to the same function type as the preset engine structure based on the preset function conversion relationship between the function type of the scanning engine and the function type of the preset engine structure, so as to put the scanning engine after the function type conversion into the scanning engine array.
[0063] In this embodiment, a pre-defined function conversion relationship is established between different function types. When it is determined that the function type of the scanning engine differs from the function type of the pre-defined engine structure, the function type of the scanning engine can be converted to the same function type as the pre-defined engine structure through the pre-defined function conversion relationship. This allows the converted engine object to be placed into the scanning engine array and called by the child process. Therefore, different scanning engines can be configured for invocation through the pre-defined function conversion relationship, improving the applicability of the data transmission scanning method and reducing user concerns about the compatibility of the selected scanning engine. This allows users to choose a more secure scanning engine, thereby improving the security of data scanning.
[0064] In some embodiments, the scanning agent process includes multiple subprocesses, each subprocess including a corresponding array of scanning engines. Different engines can be introduced for different arrays of scanning engines, so that different scanning engines can be used when scanning is performed using different subprocesses. The different scanning engines can be scanning engines developed by different developers, scanning engines with different performance, etc.
[0065] Therefore, by using the above method, a scanning agent process can be pre-built, and a transmission connection can be established between the scanning agent process and the forwarding process, so that the scanning agent process can scan the data to be scanned by the forwarding process.
[0066] For S110, the scanning agent process can receive scanning requests from the forwarding process through the Request socket between the main process and the forwarding process.
[0067] Please continue reading. Figure 3 The forwarding process can receive traffic data from the network or other electronic devices. If it determines that there is traffic data or files that need to be scanned (i.e., data to be scanned exists), it stores the data to be scanned in the scanned area, awaiting scanning. In this embodiment, the scan request may include the storage location of the data to be scanned, so that the scan agent process can scan the data at that storage location.
[0068] In one embodiment, after receiving a scan request sent by the forwarding process, the main process sends a response message to the forwarding process indicating successful reception.
[0069] In this embodiment, after receiving a scan request, the main process of the scanning agent process can send a response message to the forwarding process. The response message indicates that the main process has received the scan request. As a result, the forwarding process can perform other tasks after receiving the response message, reducing the occurrence of situations where the forwarding process cannot perform its work due to an abnormality in the scanning agent process.
[0070] In one embodiment, there are multiple child processes. After receiving a scan request, the main process can store the scan request in a preset message queue so that the child processes can retrieve the scan request from the message queue.
[0071] In this embodiment, there are multiple child processes, each capable of scanning different data. However, there is only one main process. Distributing scan requests would affect the efficiency of the main process in obtaining the next scan request. Therefore, the main process can send scan requests to a message queue, allowing each child process to obtain the request independently, thus improving the efficiency of the scanning agent process. The method by which child processes obtain scan requests from the message queue can refer to existing technologies and will not be elaborated here. Different scanning engines may differ in accuracy and efficiency. When different child processes use different scanning engines, differences in scanning accuracy or efficiency may occur. In some embodiments, different child processes corresponding to different scanning engines can be selected to process messages based on the required accuracy or efficiency.
[0072] For S120, after the child process receives the scan request, it can determine the area to be scanned, i.e. the location of the data to be scanned, based on the scan request. Then, the child process can use the scan engine array to call the corresponding scan engine in the engine object to scan the data to be scanned.
[0073] In one embodiment, the data to be scanned is scanned based on a preset scanning engine and a scanning request, and a subprocess is determined to scan the data to be scanned. The scanning engine corresponding to the engine flag in the subprocess is called to scan the data to be scanned using the corresponding scanning engine. The engine flag is set in a preset engine structure, and different engine flags are used to represent different scanning engines.
[0074] As mentioned earlier, different child processes can be configured with different scanning engines. The engine object constructed by the scanning engine will have a flag corresponding to the scanning engine. After the child process that receives the scanning request is determined, it can call its own preset scanning engine to perform the scan. This allows different scanning engines to be called to scan the data to be scanned, thereby improving the security when scanning different data.
[0075] For S130, after the child process finishes scanning the data to be scanned, the scan results can be fed back to the forwarding process via Responsesocket, so that the forwarding process can handle packet loss or forwarding of the data to be scanned according to its own strategy.
[0076] In this embodiment, the scanning agent process and the forwarding process are set separately, and the scanning engine is set through the scanning agent process. This can limit the insecurity or instability of the scanning engine to the scanning agent process, reduce the impact of an unstable or untrusted scanning engine on the forwarding process, and thus improve the efficiency and security of data transmission.
[0077] Based on the same inventive concept, this application also provides a data scanning device for transmission. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of a data transmission scanning device provided in an embodiment of this application. The data transmission scanning device 200 includes a request module 210 and a scanning module 220.
[0078] The request module 210 is used to receive a scan request sent by the forwarding process based on the transmission connection between the scan agent process and the forwarding process. The scan request includes information that characterizes the data to be scanned.
[0079] The scanning module 220 is used to scan the data to be scanned based on a preset scanning engine and scanning request, and obtain the scanning results.
[0080] The scanning module 220 is also used to feed the scanning results back to the forwarding process.
[0081] The scanning module 220 is also used to construct an engine object based on the preset engine structure and the scanning engine, and to place the engine object into the scanning engine array. The scanning engine array is used to enable the scanning agent process to call the scanning engine.
[0082] The scanning module 220 is also used to convert the function type of the scanning engine to the same function type as the preset engine structure when it is determined that the function type of the scanning engine is different from the function type of the preset engine structure, based on the preset function conversion relationship between the function type of the scanning engine and the function type of the preset engine structure, so as to put the scanning engine after the function type conversion into the scanning engine array.
[0083] The scanning module 220 is also used to place multiple engine objects built based on different scanning engines into the scanning engine arrays of different subprocesses of the scanning agent process, wherein the scanning agent process includes multiple subprocesses, and each subprocess includes a corresponding scanning engine array.
[0084] The scanning module 220 is also used to determine the subprocess that will scan the data to be scanned; and to call the scanning engine corresponding to the engine flag based on the engine flag in the subprocess, so as to use the corresponding scanning engine to scan the data to be scanned; wherein, the engine flag is set in the preset engine structure, and different engine flags are used to represent different scanning engines.
[0085] The request module 210 is also used to receive a registration request sent by the forwarding process, establish a transmission connection between the scanning agent process and the forwarding process according to the registration request, generate a sub-process based on the transmission connection and the forwarding process, and scan the data to be scanned by the forwarding process based on the sub-process.
[0086] Request module 210 is also used to send response information indicating successful reception to the forwarding process based on the main process.
[0087] It is understood that the data transmission scanning device corresponds to the aforementioned data transmission scanning method, and the specific implementation details can be found in the data transmission scanning method, which will not be elaborated upon here. The aforementioned data transmission scanning device and method can be implemented as a computer-readable instruction, which can be implemented in, for example... Figure 5 It runs on the electronic device shown.
[0088] Please refer to Figure 5 This application also provides an electronic device 300, which can serve as the execution subject of the aforementioned data transmission scanning method, including: a processor 310 and a memory 320 communicatively connected to the processor 310.
[0089] The memory 320 stores instructions that can be executed by the processor 310. The processor 310 executes the instructions to enable the processor 310 to perform the data transmission scanning method in the foregoing embodiments.
[0090] The processor 310 and memory 320 can be connected via a communication bus, or via communication modules such as wireless communication modules, Bluetooth communication modules, 4G / 5G communication modules, etc.
[0091] Processor 310 can be an integrated circuit chip with signal processing capabilities. Processor 310 can be a general-purpose processor, including a CPU (Central Processing Unit), NP...
[0092] (Network Processor), etc.; it can also be a digital signal processor, application-specific integrated circuit, etc.
[0093] The circuit, readily available programmable gate array (FPGA), or other programmable logic device or transistor logic device, or zero-discrete hardware component. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0094] The memory 320 may include, but is not limited to, RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.
[0095] It is understood that the electronic device 300 may also include more general modules required by itself, which will not be described one by one in the embodiments of this application.
[0096] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium.
[0097] It stores a computer program, which executes the methods provided in the above embodiments when run.
[0098] The storage medium can be any available medium that can be accessed by a computer, or it can contain one or more...
[0099] Data storage devices such as servers and data centers that integrate multiple usable media. The usable media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., SSDs (Solid State Disks)).
[0100] In the embodiments provided in this application, it should be understood that the disclosed methods and apparatus can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. The functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0101] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM (Read-Only Memory), RAM (Random Access Memory), magnetic disks, or optical disks.
[0102] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0103] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for scanning transmitted data, characterized in that, include: Based on the transmission connection between the scanning agent process and the forwarding process, a scanning request sent by the forwarding process is received, the scanning request including information characterizing the data to be scanned; The forwarding process is the process of forwarding traffic data; The data to be scanned is scanned based on a preset scanning engine and the scanning request to obtain the scanning result; The scan results are fed back to the forwarding process; Before receiving the scanning request sent by the forwarding process based on the transmission connection between the scanning agent process and the forwarding process, the method further includes: receiving the registration request of the forwarding process based on the main process, wherein the scanning agent process includes the main process and a child process; A transmission connection is established between the scanning agent process and the forwarding process based on the registration request; a subprocess is generated based on the transmission connection and the forwarding process to scan the data to be scanned by the forwarding process based on the subprocess.
2. The method according to claim 1, characterized in that, Before scanning the data to be scanned based on a preset scanning engine and the scanning request, the method further includes: An engine object is constructed based on the preset engine structure and the scanning engine; The engine object is placed into the scan engine array, which is used to enable the scan agent process to invoke the scan engine.
3. The method according to claim 2, characterized in that, Before constructing the engine object based on the preset engine structure and the scanning engine, the method further includes: when it is determined that the function type of the scanning engine is different from the function type of the preset engine structure, based on the preset function conversion relationship between the function type of the scanning engine and the function type of the preset engine structure, converting the function type of the scanning engine to the same function type as the preset engine structure, so as to place the scan engine after function type conversion into the scan engine array.
4. The method according to claim 2, characterized in that, The step of placing the engine object into the scanning engine array includes: placing multiple engine objects built based on different scanning engines into the scanning engine arrays of different subprocesses of the scanning agent process, wherein the scanning agent process includes multiple subprocesses, and each subprocess includes a corresponding scanning engine array.
5. The method according to claim 4, characterized in that, Based on a preset scanning engine and the scanning request, the data to be scanned is scanned, including: determining a subprocess to scan the data to be scanned; invoking a scanning engine corresponding to the engine flag based on the engine flag in the subprocess, so as to use the corresponding scanning engine to scan the data to be scanned; wherein, the engine flag is set in the preset engine structure, and different engine flags are used to represent different scanning engines.
6. The method according to claim 1, characterized in that, After receiving the scan request sent by the forwarding process, the method further includes: the main process feeding back response information indicating successful reception to the forwarding process.
7. A data transmission scanning device, characterized in that, include: The request module is used to receive a scan request sent by the forwarding process based on the transmission connection between the scan agent process and the forwarding process. The scan request includes information representing the data to be scanned. The forwarding process is the process of forwarding traffic data; The scanning module is used to scan the data to be scanned based on a preset scanning engine and the scanning request, and obtain the scanning results; The scanning module is also used to feed the scanning results back to the forwarding process; The request module is further configured to receive a registration request from the forwarding process based on the main process, wherein the scanning agent process includes the main process and a child process; establish a transmission connection between the scanning agent process and the forwarding process according to the registration request; generate the child process based on the transmission connection and the forwarding process, so as to scan the data to be scanned by the forwarding process based on the child process.
8. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores computer-readable instructions that, when executed by the processor, cause the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Method and distributed system for achieving safety scanning
CN103856467A
Scanner API for executing multiple scanning engines
US20030051154A1
Unified scan engine
US20130269029A1