Virus detection method and system, electronic equipment and computer readable storage medium

By calling the virus scanner in the software to detect and add identification information, the problem of identifying malware and normal software is solved, improving the security of the software and reducing the risk of information leakage.

CN119089441APending Publication Date: 2024-12-06CHINA UNICOM (GUANGDONG) IND INTERNET CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411112886.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively identify and distinguish malware from normal software, which leads to users being prone to missed malware when using software, causing information leakage and security risks.

Method used

The target application is detected by calling the virus scanner, and when the detection result is a trusted application, it adds identification information, such as borders, to the interface window, clearly distinguish malware from normal software.

Benefits of technology

Effectively distinguishing malware from normal software reduces the risk of users' missed malware, improves the security of the software, and enhances users' awareness of software security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089441A_ABST
    Figure CN119089441A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a virus detection method and system, electronic equipment and a computer readable storage medium, the method is applied to the electronic equipment, and the method comprises the following steps: calling a virus scanning program to carry out virus detection on a target application process; and when it is detected that the target application program is the trusted application program, adding identification information for representing the trusted application to an interface window after the target application program is operated. By calling the virus scanning program to scan and detect malicious software such as viruses and Trojan horse programs in the target application program and adding the credible application identifier to the application program whose scanning result is not the malicious software, the malicious software can be distinguished from normal software in appearance, a user can more visually distinguish the malicious software, and the user experience is improved. The security problems of information leakage and the like caused by mistakenly clicking malicious software are avoided, and the risk caused by the malicious software is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to a method, system, electronic device and computer-readable storage medium for detecting viruses. Background Art

[0002] Driven by the tide of innovation in information technology applications, domestic software has ushered in unprecedented development opportunities. Even if the current technology uses program signatures that can identify software, users rarely check whether the program signature is correct when using the software, making it difficult for users to distinguish with the naked eye.

[0003] Therefore, in the process of developing domestic software, it is urgent to improve the security of the software to ensure that the software used by users has not been tampered with. Summary of the invention

[0004] The embodiments of the present application disclose a virus detection method, system, electronic device and computer-readable storage medium, which can effectively distinguish normal software from virus software, help users identify malware such as viruses, and improve the security of software.

[0005] The present application embodiment discloses a virus detection method, which is applied to electronic equipment, and the method includes:

[0006] Call the virus scanner to detect viruses on the target application process;

[0007] When it is detected that the target application is a trusted application, identification information for indicating a trusted application is added to an interface window after the target application is run.

[0008] The present application embodiment discloses a system for detecting viruses, including:

[0009] Virus scanning module, used to detect viruses on target applications;

[0010] The identification adding module is used to add identification information for indicating a trusted application to the interface window after the target application is run.

[0011] An embodiment of the present application discloses an electronic device, including a memory, a processor, and a communication unit. The memory stores a computer program. When the computer program is executed by the processor, the electronic device implements the method described in any of the above embodiments.

[0012] An embodiment of the present application discloses a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the method described in any of the above embodiments.

[0013] The technical solution of this application has at least the following beneficial effects:

[0014] The virus detection method, system, electronic device and computer-readable storage medium disclosed in the embodiments of the present application call a virus detection module to scan and detect viruses, Trojan programs and other malware in the target application, and add a trusted application identifier to the application whose scan results are not malware. In this way, malware can be distinguished from normal software in appearance, which helps users to distinguish malware more intuitively, avoid security issues such as information leakage caused by accidentally clicking on malware, and reduce the risks brought by malware. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 A flowchart of a virus detection method provided by an embodiment;

[0017] Figure 2 An embodiment is provided Figure 1 Flow chart of the virus detection method in;

[0018] Figure 3 Another embodiment provides Figure 1 Flow chart of the virus detection method in;

[0019] Figure 4 A flow chart of a virus detection method provided by another embodiment;

[0020] Figure 5a A schematic diagram of adding a border to an application icon provided by an embodiment;

[0021] Figure 5b A schematic diagram of adding a border to an application icon provided by another embodiment;

[0022] Figure 6 A flowchart of a virus detection method provided in yet another embodiment;

[0023] Figure 7a A schematic diagram of adding a border to an application interface provided by an embodiment;

[0024] Figure 7b A schematic diagram of adding a border to an application interface provided by another embodiment;

[0025] Figure 8A flowchart of a virus detection method provided in yet another embodiment;

[0026] Fig. 9 A schematic diagram of an interface for detecting viruses through a trusted security window provided by an embodiment;

[0027] Fig.10 A flowchart of adding a border in a Linux system provided by an embodiment;

[0028] Fig.11 A block diagram of a system for detecting viruses provided by one embodiment;

[0029] Fig.12 A structural block diagram of an electronic device provided by an embodiment. DETAILED DESCRIPTION

[0030] 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.

[0031] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.

[0032] Driven by the tide of innovation in information technology applications, domestic software has ushered in unprecedented development opportunities, and various application software has sprung up. However, with the prosperity of the market, some security issues have also been exposed. In order to steal user information, some lawless elements often disguise malware such as viruses and Trojan programs as software we use daily. If users are not careful, they may accidentally click on these Trojan programs, resulting in serious consequences such as information leakage or even system control. Therefore, in the development process of domestic software, we must attach great importance to the security of the software and ensure that the software used by users has not been tampered with.

[0033] According to the above technical background, when malware disguises itself as a mainstream program, its icon and interface may be exactly the same as these mainstream software. Current technology is not enough to enable the operating system to effectively identify these malware. Even if a program signature is used, users rarely check whether its program signature is correct when using it. Among them, program signature is the process of adding a digital signature to a program or application file. This signature is used to verify the integrity and source of the program, ensure that the program has not been tampered with during the distribution and installation process, and indicate the identity of the developer or publisher of the program. In order to solve this problem, the inventor of the present application has found through research that the technology of self-checking and adding appearance identification can be used to distinguish these disguised viruses, Trojan programs and other malware.

[0034] The embodiments of the present application disclose a method, system, electronic device and computer-readable storage medium for detecting viruses. After calling a virus scanning program to detect a target application, if the detected target application is a trusted application, identification information for indicating a trusted application is added to it. In this way, malware such as viruses and Trojan programs can be directly distinguished from normal software in appearance through the identification information, which helps users to distinguish malware more intuitively, avoid security issues such as information leakage caused by accidentally clicking on these malware, and reduce the risks brought by them.

[0035] The virus detection method provided in the embodiment of the present application can be used for a variety of operating systems. The embodiment of the present application is described by applying to the Linux system as an example. Among them, the Linux system is an open source and free operating system, and users can obtain its source code and freely modify and distribute it. The Linux system is famous for its stability, security and flexibility, and can be widely used in various fields such as servers, mobile devices, supercomputers, embedded systems, etc. Linux supports multi-user, multi-tasking, device independence and scalability of configuration. It provides a wealth of command line tools and graphical user interface options, allowing users to customize the operating experience as needed.

[0036] Malware such as viruses and Trojans can harm the user's application information and disrupt its normal use functions in many ways. For example, by injecting malicious code into the legitimate process of the application to bypass security checks to achieve harm; by exploiting security vulnerabilities in the operating system or application, such as buffer overflow, to execute unauthorized code; by modifying the system registry, adding or modifying startup items, to ensure that the malware automatically runs when the system starts; by monitoring network traffic, intercepting or tampering with data in transit, or placing itself between the communicating parties to steal data; and by intrusion detection systems, firewalls, security-hardened operating systems and applications. It can be seen that through the above methods, malware such as viruses can cause multiple harms to the user end, so the above malware should be strictly prevented and distinguished. Although the Linux system is famous for its security and stability, no system is completely immune to malware. Therefore, keeping the system and applications updated in a timely manner, using security best practices, monitoring system logs and abnormal behavior, and using antivirus software are essential to maintaining the security of Linux systems and applications.

[0037] Figure 1 The flowchart of the virus detection method provided for an embodiment should be noted that the present specification provides the method operation steps as described in the embodiment or flowchart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual system or product is executed, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).

[0038] like Figure 1 As shown, the flow chart at least includes the following steps S101-S102:

[0039] Step S101, calling a virus scanning program to perform virus detection on a target application process.

[0040] There can be many types of virus scanning programs, as long as the purpose of virus scanning is achieved. The virus scanning program of the embodiment of the present application uses the ClamaAV virus scanning module to detect and scan viruses and other malicious software. Among them, ClamaAV is an open source anti-virus engine, which is mainly used to scan and detect viruses, Trojans and other malicious software in emails and files. It is designed to scan files in the file system, provide real-time protection, and support multiple platforms.

[0041] Step S102: when it is detected that the target application is a trusted application, identification information for indicating a trusted application is added to an interface window after the target application is run.

[0042] After completing the virus scan of the above-mentioned target application, if it is detected that the above-mentioned target application is not a virus or other malicious software, the above-mentioned target application is considered to be a trusted application. In order to distinguish the trusted application from the virus or other malicious software, the identification information used to represent the trusted application is added to the interface window after the above-mentioned target application is run. In some embodiments, the above-mentioned identification information representing the trusted application is a border added outside the interface window after the target application is run. In some embodiments, if the target application does not open the running interface window, a border is added outside the application icon representing the target application. The color of the above-mentioned border can be yellow, green, red or blue, which is not limited in the embodiments of the present application.

[0043] In step S101, calling a virus scanning program to detect viruses on the target application process can be implemented in different ways. For example, in some embodiments, the ClamaAV virus scanning module can perform virus scanning in two ways. The first way is to enter a virus scanning instruction in the command line interface provided by ClamaAV, and the second way is to scan by calling the interface of ClamaAV's virus library libclamav.

[0044] like Figure 2 As shown, Figure 2 An embodiment is provided Figure 1 The flowchart of the virus detection method in is a refinement of the above-mentioned method 1, and the flowchart at least includes the following steps S201-S204.

[0045] Step S201, loading the virus scanning program:

[0046] The ClamaAV module is installed in the Linux system so that it can be called in the virus scanning main program to implement the virus scanning function of the main program. The ClamaAV module is installed in the Linux system, usually through the system's package manager.

[0047] Step S202: configure a virus database configuration file to update the virus database of the virus scanning program.

[0048] After installing the ClamaAV module in the Linux system, to realize its virus scanning function, you need to configure the ClamaAV virus database configuration file. Configuring the behavior of the freshclam command is one of the key steps to ensure that ClamaAV can effectively defend against emerging viruses and malware. By properly configuring freshclam.conf, system administrators can ensure that the virus database is always kept up to date, thereby improving the security of the system.

[0049] In one embodiment, after the freshclam.conf virus database configuration file is configured, the virus database can be updated online using the freshclam command, wherein freshclam.conf is a configuration file in ClamaAV, which is specifically used to configure the behavior of the freshclam command, and freshclam is a component of ClamaAV, responsible for automatically updating ClamaAV's virus database, and this command is usually automatically run when the system starts, or manually triggered by the system administrator to ensure that the virus database is always kept up to date. Among them, the virus database in ClamaAV is an important part of its detection of malware, and it contains a variety of information for identifying and matching malicious code, such as virus feature information such as hash values, feature codes, metadata features, etc. for matching known malicious files, and also contains a whitelist for excluding known safe files to enhance the accuracy of virus identification, and the above feature information is maintained and regularly updated by the ClamAV community to ensure that the latest viruses and malware can be detected.

[0050] Step S203: input a virus detection command.

[0051] Embodiments of the present invention provide a variety of methods for inputting virus detection commands, for example: inputting virus detection commands through a command line interface. In the command line interface of ClamAV, the main commands used for virus detection are clamscan and clamdscan, both of which rely on ClamAV's anti-virus engine to scan viruses in files or directories, but they are slightly different in usage and function. Exemplarily, clamscan-r can be used to recursively scan files in a specified directory and all its subdirectories, and list all files detected as containing malware and other related information encountered during the scanning process; clamscan-i can be used to scan files in the current directory and only display infected files without displaying other scanning information; other scanning information may include scanning progress, scanning statistics, errors and warnings, version information, and processing suggestions; when using clamdscan, by default, clamdscan will recursively scan subdirectories without the -r option.

[0052] Step S204: the virus scanning program performs a virus scan on the target application program in response to the virus detection command.

[0053] After the virus detection command is input, the virus scanning program responds to the specific input command and correspondingly executes the virus scanning action to complete the scanning of the target application program.

[0054] In some embodiments, in addition to using the above-mentioned method 1, ie, scanning the target application through the command line, the above-mentioned method 2, ie, scanning the target application for viruses by calling the interface of the virus library of the above-mentioned virus scanning program, can also be used.

[0055] See also Figure 3 , Figure 3 Another embodiment provides Figure 1 Flowchart of the virus detection method in Figure 3 As shown, the flow chart at least includes the following steps S301-S305:

[0056] Step S301, performing virus scan on the target application by calling the virus library interface.

[0057] The embodiment of the present invention still takes the ClamaAV module as an example of a virus scanning module. After completing a series of preparations such as the installation of the ClamaAV module and the update of the ClamaAV virus database, the virus is scanned by calling the virus database interface. Among them, calling the virus database interface involves using the API (Application Programming Interface) provided by ClamaAV to perform virus scanning, detection and analysis operations. These APIs are usually encapsulated in the core library of ClamaAV, namely the libclamav library, allowing developers to integrate ClamAV functions in their own applications.

[0058] Step S302, initializing the virus database.

[0059] To scan the virus of the application by calling ClamaAV's virus library interface, you first need to initialize the virus library to prepare for the subsequent steps. When initializing the above virus library, the main function involved is the cl_init() function. When calling the API of the above virus library, you should first call cl_init() to initialize the library. If the initialization is successful, then create a scanning engine, load the virus library, etc.

[0060] Step S303: Create a virus scanning engine.

[0061] In the case that the above virus database initialization operation is successful, a virus scanning engine is created. In ClamAV, the scanning engine is the core component for performing virus scanning tasks, and it relies on the virus database to identify malware. Exemplarily, the virus scanning engine is created using the cl_engine_new() function, which is responsible for initializing a new scanning engine instance. The above instance is the core of the subsequent virus scanning operation, and it contains various resources and configurations required for scanning. Among them, the above scanning engine encapsulates the scanning logic and algorithm of ClamAV, so that developers can implement complex virus scanning functions through simple API calls without having to deeply understand the internal implementation details of the scan.

[0062] Therefore, using the cl_engine_new() function to create a new scanning engine is one of the important steps in calling the ClamAV API for virus scanning. This function initializes the scanning environment, encapsulates the scanning logic, and provides necessary support for subsequent virus database loading, scanning preparation, and scanning operations. Without a scanning engine instance, subsequent virus scanning operations will not be possible.

[0063] In some embodiments, after the virus scanning engine is created using the cl_engine_new() function, the cl_load() function is used to load signatures from the virus library file into the scanning engine. When the virus library is loaded through the cl_load() function, the pointer of the scanning engine needs to be passed in as a parameter so that data such as virus signatures can be loaded into the scanning engine.

[0064] In some embodiments, after the virus database is loaded using the cl_load() function, the cl_engine_compile() function is used to prepare the scanning engine for virus scanning. The cl_engine_compile() function is mainly used to compile the scanning engine. By calling this function, the scanning engine will pre-process the signatures and rules in the virus database to optimize the scanning speed and accuracy. This function ensures that the scanning engine is ready before performing the scanning operation. If the scanning engine is not compiled correctly, the scanning operation may fail or return inaccurate results.

[0065] Step S304, scanning the target application.

[0066] After creating a virus scanning engine, the target application can be scanned for viruses. The functions used for virus scanning in ClamAV include cl_scanfile() and cl_scandesc(). Among them, the cl_scanfile() function reads the contents of the specified file and compares and detects it using ClamAV's virus library to determine whether the file contains known viruses or malware. Using the cl_scanfile() function to scan before file transfer, storage or execution can effectively prevent the spread and infection of viruses or malware; the cl_scandesc() function is more flexible. It allows developers to scan files referenced by file descriptors (filedescriptors). This method makes the scanning operation no longer limited to files in the file system, but can be extended to any data stream that can be accessed through file descriptors, such as network data streams, file mappings in memory, etc. In some scenarios that require highly customized scanning processes or processing non-standard file formats, the cl_scandesc() function provides more flexibility and control.

[0067] Step S305, releasing the engine structure.

[0068] After completing the virus scan of the target application, the virus scanning engine created above needs to be released to clean up some temporary data generated by the virus scanning engine during execution and prepare for subsequent scanning tasks, thereby avoiding interference between different scanning tasks and ensuring the accuracy of each scan. In ClamAV, the main function involved in releasing the engine structure is cl_engine_free(), which is used to release all resources allocated by the scanning engine created by the above cl_engine_new() function. When the scanning engine is no longer needed for virus scanning, the cl_engine_free() function should be called to release the resources it occupies. Before the application exits or closes, make sure to release all created scanning engine instances to avoid memory leaks.

[0069] In the embodiment of the present application, the above process for implementing the virus detection function is applicable to virus scanning in different scenarios, for example: when the target application is detected to be installed, when the target application is detected to be running, and when a virus scanning request for the target application is received.

[0070] For installed applications, these applications are already running on the user's device and have higher potential risks. If they are infected by malware or are malware themselves, they can directly access the device's system resources, personal data, and other applications, posing a serious security threat. For uninstalled applications, their installation packages are scanned and detected. Although uninstalled applications themselves do not directly pose a threat to the device, scanning before installation can prevent potential malware from entering the device, which is equivalent to intercepting the malware before it enters the device, thereby improving overall security. In other cases where virus scanning of applications is required, this can be achieved by triggering a virus scan request.

[0071] Figure 4 A flowchart of a virus detection method provided in another embodiment is a process of virus scanning when a target application is detected to be installed, such as Figure 4 As shown, the flow chart at least includes the following steps S401-S403:

[0072] Step S401: Detecting the target application installation.

[0073] Detecting whether the target application is installed and performing virus scanning separately for installed applications and uninstalled applications is mainly for the consideration of security, efficiency and management. In order to detect the installation of the target application and perform virus scanning after detecting this action, in some embodiments, the virus scanning program is configured to perform real-time scanning, so that the virus scanning program can check whether the file is safe when it is accessed or executed. In other embodiments, the virus scanning program can be integrated into third-party software and automatically scan downloaded files or newly installed software packages through configuration.

[0074] Step S402: calling a virus scanning program to perform virus detection on the target application.

[0075] When the target application is detected to be installed in the above manner, the main program calls the virus scanner to detect the target application. Wherein, the main program has a built-in virus scanning function, which is implemented by calling a virus scanner such as ClamAV. For applications that are not installed, the virus scanner can perform virus scanning on the installation package of the target application. When processing the installation package files, the virus scanner can detect whether these files contain known malicious code or virus features, which is achieved by comparing them with the virus feature information contained in the virus database, and does not directly parse these files to obtain their internal details. If the installation package file of the target application that is not installed contains a code that matches an entry in the virus database, the virus scanner will mark it as a potential security threat. Wherein, the installation package file can be APK (Android application package), EXE (Windows executable file), and compressed package files such as ZIP, RAR, TAR, GZIP, BZIP2, etc., and this application does not limit this.

[0076] Step S403: When it is detected that the target application is a trusted application, a trusted mark is added to the corresponding icon of the target application.

[0077] If the above virus scanner finds an item matching the features in the virus database in the target application's file, it will mark the file as malware. If the above virus scanner does not find information matching the features in the virus database when detecting the target application, the target application scan result is a trusted application. In the case where the target application is detected to be installed, the target application does not open the corresponding application window, so a trusted mark is added to the application icon of the target application, so as to achieve the purpose of intuitively distinguishing trusted applications from malware such as viruses.

[0078] In some embodiments, the above-mentioned trusted identifier is a border added outside the above-mentioned application icon, such as Figure 5a As shown, Figure 5a A schematic diagram of adding a border to the above application icon is provided as a schematic diagram of an embodiment. Figure 5aIncluding application icons of APP1, APP2, APP3, and APP4 and a border 501 outside the application icons of APP1 and APP4. For example, APP1, APP2, APP3, and APP4 are used as target applications. The above-mentioned virus scanning program sequentially detects viruses on the above-mentioned target applications. If APP1 and APP4 are detected as trusted applications and APP2 and APP3 are malware, a border 501 representing a trusted application is added to the application icons of APP1 and APP4. For malware APP2 and APP3, no border is added. The color of the border 501 can be blue or green, or yellow or red, but is not limited thereto. In some embodiments, the user can pre-set the color of the border 501 according to needs.

[0079] In other embodiments, Figure 5b As shown, Figure 5b A schematic diagram of adding a border to an application icon provided in another embodiment. A user can also indicate malware by adding a border 502 outside the icon that is different from the border 501 indicating trusted software, wherein the border 502 is pre-set to a different color than the border 501. For example, the border 501 is green and the border 502 is red. Such different color settings can help users more intuitively distinguish trusted applications from malware, thereby reducing the risk of malware.

[0080] If the target application is already installed, the detection process for the running application is as follows Figure 6 As shown, the detection method at least includes steps S601-S603:

[0081] Step S601: Detect that the target application is running.

[0082] In some embodiments, the virus scanning program can be set to run in the background or automatically when the computer is turned on, so as to scan the running applications in real time. Optionally, the virus scanning program can be set to scan the target applications in a timed cycle. There is no fixed standard for the time interval setting of the timed cycle. It is determined based on various factors such as the specific needs of the individual or organization, system performance, security policies, etc.

[0083] Step S602: calling a virus scanning program to perform virus detection on the target application process.

[0084] For the target application being run, a virus scanner such as ClamAV is called to perform virus detection on the target application. However, ClamAV does not directly monitor or scan the processes of the running application itself, but scans the files and possible memory swap areas of these applications. In some embodiments, ClamAV can scan the executable files, library files, and configuration files of the application, etc. These files usually do not change when the application is running, so scanning them can detect static malicious code. ClamAV can also be configured to monitor the file system in real time and automatically scan when files are created, modified, or accessed, which helps to immediately discover and isolate malicious code when it enters the system. In other embodiments, ClamAV can be integrated with other security tools (such as firewalls, intrusion detection systems, endpoint security solutions, etc.) to provide more comprehensive security protection. These integrated solutions may provide monitoring and scanning functions for running application processes.

[0085] Step S603: When it is detected that the target application is a trusted application, a trusted mark is added to the interface window after the target application is run.

[0086] In order to distinguish the detected trusted applications from malware such as viruses, the embodiment of the present application adds trusted identification information to the application window corresponding to the above trusted software when it is running. In some embodiments, the trusted identification can be a frame added outside the application window of the above target application.

[0087] In this embodiment of the present application, the Linux system is taken as an example. To create the application window of the target application, the X11 (X Window System) desktop technology is required. X11 is a window system designed for UNIX and UNIX-like operating systems (such as Linux). It allows users to access graphical applications from multiple terminals through the network and provides a rich graphical user interface (GUI) framework. Its core is a server-client model, in which the X server manages hardware resources such as the screen, keyboard and mouse, and the client is an application running on the user's computer. The above model allows applications to run on different computers, but their graphic outputs are sent to the X server through the network and displayed on the user's screen by the X server. In this embodiment, Xlib in X11 is the core part of the X11 library, which provides a set of C language function interfaces for communicating with the X server. It is the basis for building applications based on X11. In X11, you can use the function XOpenDisplay to open a connection with the X server. It returns a pointer to a Display structure that contains all the information related to a specific display screen. You can use the function XCreateWindow to create a new window on the screen. It returns a window identifier that is used to reference this window in subsequent function calls. You can use the function XMapWindow to map a previously created window to the screen to make it visible. You can use the function XClearWindow to clear the contents of a window. It accepts a window identifier as a parameter and sets the contents of the window to the background color. You can use the function XFreeDisplay to call this function to close the connection with the X server and release related resources when you no longer need to communicate with the X server.

[0088] In some embodiments, Figure 7a As shown, Figure 7a A schematic diagram of adding a border to an application interface provided for an embodiment includes an application interface 1 representing APP1, a border 701 added outside the application interface 1, and an application interface 2 representing APP2. Exemplarily, virus detection is performed on the target applications APP1 and APP2 whose application interfaces have been opened, and APP1 is detected as a trusted application and APP2 is malware. Based on this detection result, an outer frame 701 is added to the application interface 1, but not to the application interface 2. Therefore, the user can intuitively identify the trusted application and the malware according to whether the opened application interface has an outer frame, thereby reducing the risk brought by the malware. The color of the border can be green or yellow, or blue, but is not limited thereto.

[0089] In other embodiments, a border different from that added to the application interface of the trusted software is added to the application window of the malware. Figure 7b As shown, Figure 7b A schematic diagram of adding a border to an application interface provided for another embodiment includes an application interface 1 representing APP1, a border 701 added outside the application interface 1, an application interface 2 representing APP2, and a border 702 added outside the application interface 2. The border 701 has a different color from the border 702. For example, if the color of the border 701 is green, the color of the border 702 can be set to red to distinguish a trusted application from malware such as a virus in appearance.

[0090] In some embodiments, the virus scan request is issued by the user by moving the target application to a trusted security window through a touch operation. Figure 8 As shown, Figure 8 A flowchart of a virus detection method provided in yet another embodiment, the flowchart at least includes the following steps S801-S805:

[0091] Step S801: Using the window creation module in the Linux system to create a trusted security window of the virus scanning program.

[0092] In the embodiment of the present application, taking the Linux system as an example, the underlying Linux kernel usually does not directly provide the creation of graphical windows, but relies on various graphical user interface (GUI) libraries and frameworks, which allow developers to create and manage GUI elements such as windows, dialog boxes, buttons, etc. The window creation module can be established based on the QT framework, GTK toolkit, wxWidgets framework, and FLTK toolkit, etc. Through the window creation module, the graphic window of the virus scanning program can be directly created for easy interaction.

[0093] like Fig. 9 As shown, Fig. 9 A schematic diagram of an interface for detecting viruses through a trusted security window provided by an embodiment. The interface 900 includes a trusted security window 901, and the trusted security window 901 includes at least a button 902 representing "Start Detection" for sending a scan request to a virus scanning program. The interface 900 may include application icons of APP1, APP2, APP3, APP4, APP5, APP6, APPa, APPb, APPc, APPd, and APPe. The trusted security window 901 is created by the above-mentioned window creation module to facilitate the interaction of the user's virus scanning operation.

[0094] Step S802: A first touch operation is detected, where the first touch operation is used to move the target application to the trusted security window.

[0095] The user can move the target application that needs to be scanned for viruses into the above-mentioned trusted security window 901 through a first touch operation. The first touch operation can be dragging or long pressing to display a quick window containing the option of "scanning for viruses". The embodiment of the present application does not limit the type of the touch operation. The window can contain a button 902 for indicating "start detection". After the user clicks the button, the virus scanning program can detect viruses and other malicious software on the target application in the trusted security window 901.

[0096] Exemplarily, the user moves APP1 and APP2 to the trusted security window 901 by dragging and dropping, that is, APP1 and APP2 are target applications. After clicking the "Start Detection" button 902, the above-mentioned virus scanning program scans and detects viruses and other malicious software on the target applications APP1 and APP2 in the trusted security window 901.

[0097] Step S803: Upload the target application in the trusted security window to the virus scanning program.

[0098] After the target application to be detected is moved to the trusted security window 901, in response to the virus scan trigger request, the trusted security window 901 obtains the information required by the virus scanner, such as the file path and / or process information of the target application, and sends it to the virus scanner for scanning. In some embodiments, the above-mentioned virus scan request is issued by the user clicking the "Start Detection" button 902.

[0099] Step S804: the virus scanning program performs virus detection on the process of the target application.

[0100] After receiving the target application information obtained by the above-mentioned trusted security window, in some embodiments, this information is compared with the virus feature information pre-stored in the virus database in the virus scanning program (such as ClamAV's virus library libclamav). If this information matches the above-mentioned virus feature information, the detection result is malware, otherwise, the detection result is trusted software.

[0101] Step S805: When it is detected that the target application is a trusted application, identification information for indicating a trusted application is added to the interface window after the target application is run.

[0102] When the virus scanner detects that the target application is a trusted application based on the information sent by the above-mentioned trusted security window, identification information for indicating a trusted application is added to the interface window after the application is run. In some embodiments, the above-mentioned identification information is a first preset color border added outside the interface window opened by the target application. In other embodiments, if the target application is detected as malware, the identification information can be set to a second preset color border outside the application interface opened by the target application. The second preset color is different from the first preset color, so that if multiple applications are detected, the trusted software and the malware can be intuitively distinguished from the appearance.

[0103] In the embodiment of the present application, taking the Linux system as an example, to add a border to the application interface opened by the application, it is necessary to create a border module for adding a border with the help of X11 framework technology. Fig. 9 As shown, Fig. 9 A flowchart of adding a border in a Linux system provided in an embodiment, the flowchart at least includes steps S1001 to S1003:

[0104] Step S1001, obtaining the process ID of the target application.

[0105] In an embodiment of the present application, when the target application is running, the border module obtains the process identifier (PID) of the application using the ps command according to the application name, wherein the ps command in the Linux system is used to display the status of the processes running in the current system.

[0106] Step S1002: Send the process identifier to the framework module.

[0107] In Linux system, use xdotool tool command to obtain the window ID of the main interface of the application through the PID of the application. Among them, xdotool allows simulation of keyboard input, mouse movement, click, window management and other operations. It does not directly obtain the window ID (Window ID, or WID) of its main interface through the PID (process identifier) ​​of the application, but indirectly implements this function by combining other command line tools (such as wmctrl, xprop or a combination of ps and grep). In the embodiment of the present application, after using the ps command to obtain the process identifier (PID) of the application, after sending the PID to the border module, use the xdotool tool command to obtain the window ID of the main interface of the application through the above-mentioned obtained PID.

[0108] Step S1003: Setting the main interface window corresponding to the process identifier to the first preset color frame through the framework module.

[0109] Set the member variables of the XColor structure to the first preset color, which can be yellow, green or red, but is not limited to this. In X11 programming, the XColor structure is used to represent colors. This structure is usually used in XWindow System graphics operations, including color selection, definition and query. The XColor structure contains at least unsigned short type red, green and blue member variables, which represent the red, green and blue components of the color. By setting the red, green and blue components to different proportions, various colors can be flexibly defined and set.

[0110] In the border module, functions such as XOpenDisplay, XAllocColor, and XSetLineAttributes can be used to add a first preset color border to the application interface window. XAllocColor is a function used to allocate colors in the X Window System (X11). It is mainly used to select or allocate a color closest to the requested color from the color mapping table of the viewport and return the pixel value of the color. The color mapping table is an internal table used by the X server to convert color indexes to actual screen colors. The XSetLineAttributes function is a function used to set line attributes when drawing in the X Window System. This function can be used to control line attributes such as line width, style, line cap style, and connection style.

[0111] In some embodiments, the border module can be used to add a border of a first preset color to a trusted application and a border of a second preset color to a malware, wherein the first preset color is different from the second preset color. The first preset color and the second preset color can be obtained by setting member variables in Xcolor to different proportions.

[0112] like Fig.11 As shown, Fig.11 The block diagram of a virus detection system provided by an embodiment is as follows: The virus detection system 1100 includes a virus scanning module 1110 and an identification adding module 1120 connected to the virus scanning module 1110 .

[0113] The virus scanning module 1110 is used to perform virus detection on the target application. In the embodiment of the present application, the virus scanning module 1110 sends the result of virus detection on the target application to the identification adding module 1120 so that the identification adding module 1120 adds identification information to the application according to the virus detection result.

[0114] The identification adding module 1120 is used to add identification information for representing a trusted application to the interface window after the target application is run. In some embodiments, the identification adding module 1120 is also used to add a frame to the application icon of the target application.

[0115] like Fig.12 As shown, Fig.12 A structural block diagram of an electronic device provided by an embodiment.

[0116] The electronic device may include: a radio frequency module 1210, a memory 1220, an input unit 1230, a display unit 1240, a WiFi (Wireless Fidelity) module 1250, a processor 1260, and a power supply 1270. Those skilled in the art will appreciate that Fig.12 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0117] The RF module 1210 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 1260 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF module 1210 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF module 1210 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution, email, short messaging service (SMS), etc.

[0118] The memory 1220 can be used to store software programs and modules. The processor 1260 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 1220. The memory 1220 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 1220 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0119] The input unit 1230 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the input unit 1230 may include a touch panel 1232 and other input devices 1234. The touch panel 1232, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1232 or near the touch panel 1232 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1232 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1260, and can receive and execute commands sent by the processor 1260. In addition, the touch panel 1232 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1232, the input unit 1230 may also include other input devices 1234. Specifically, other input devices 1234 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0120] The display unit 1240 can be used to display information input by the user or information provided to the user and various menus of the electronic device. The display unit 1240 may include a display panel 1242. Optionally, the display panel 1242 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 1232 may cover the display panel 1242. When the touch panel 1232 detects a touch operation on or near it, it is transmitted to the processor 1260 to determine the type of touch event. Subsequently, the processor 1260 provides a corresponding visual output on the display panel 1242 according to the type of touch event. Although in Fig.12 In the embodiment, the touch panel 1232 and the display panel 1242 are used as two independent components to implement the input and output functions of the electronic device, but in some embodiments, the touch panel 1232 and the display panel 1242 can be integrated to implement the input and output functions of the electronic device.

[0121] WiFi is a short-range wireless transmission technology. Electronic devices can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1250. It provides users with wireless broadband Internet access.

[0122] The processor 1260 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 1220, and calling data stored in the memory 1220, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 1260 may include one or more processing units; preferably, the processor 1260 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1260.

[0123] The electronic device also includes a power supply 1270 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 1260 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. Although not shown, the electronic device can also include a camera, a Bluetooth module, etc., which will not be repeated here.

[0124] In one embodiment, when the computer program stored in the memory 1220 is executed by the processor 1260, the processor 1260 implements the methods described in the above embodiments.

[0125] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program implements the methods described in the above embodiments when executed by a processor.

[0126] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a ROM, etc.

[0127] As used herein, any reference to memory, storage, database, or other medium may include nonvolatile and / or volatile memory. Suitable nonvolatile memory may include ROM, programmable ROM (Programmable ROM, PROM), erasable PROM (Erasable PROM, EPROM), electrically erasable PROM (Electrically Erasable PROM, EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. By way of illustration and not limitation, RAM may be in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus direct RAM (RDRAM) and direct memory bus dynamic RAM (DRDRAM).

[0128] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application. It should be noted that "multiple" in the present application includes "two or more".

[0129] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0130] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0131] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0132] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0133] The above is a detailed introduction to a method, system, electronic device and computer-readable storage medium for detecting viruses disclosed in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those of ordinary skill in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. A virus detection method, characterized in that: Applied to electronic equipment, the method comprises: Call the virus scanner to detect viruses on the target application process; When it is detected that the target application is a trusted application, identification information for indicating a trusted application is added to an interface window after the target application is run.

2. The method according to claim 1, characterized in that The calling of a virus scanning program to perform virus detection on the target application process comprises: When the target application is detected to be installed; or, When the target application is detected to be running; or, When a virus scanning request of the target application is received, a virus scanning program is called to perform virus detection on the target application process.

3. The method according to claim 1, characterized in that The adding identification information for indicating a trusted application to the interface window after the target application is run includes: The main interface window corresponding to the target application is set to have a first preset color frame representing a trusted application.

4. The method according to claim 3, characterized in that The electronic device is equipped with a Linux system, and the main interface window corresponding to the target application is set to have a first preset color frame indicating a trusted application, including: The framework module in the Linux system is used to set the main interface window corresponding to the target application to the first preset color frame.

5. The method according to claim 4, characterized in that The step of setting the main interface window corresponding to the target application to the first preset color frame by using the framework technology in the Linux system includes: Obtaining a process ID of the target application; Sending the process identifier to the framework module; The main interface window corresponding to the process identifier is set to the first preset color frame through the framework module.

6. According to claim 3 or 4, it is characterized in that: The method further comprises: When it is detected that the target application is a trusted application, the first preset color border identifying the target application as a trusted application is added to the corresponding icon of the target application.

7. According to any one of claims 3 or 4, it is characterized in that: The method further comprises: When it is detected that the target application is an untrusted application, a second preset color border for indicating an untrusted application is added to an interface window after the target application is run, and the first preset color is different from the second preset color.

8. The method according to claim 2, characterized in that: The receiving the target application virus scanning request includes: Using the window creation module in the Linux system to create a trusted and secure window of the virus scanning program; A first touch operation is detected, where the first touch operation is used to move the target application to the trusted security window; Uploading the target application in the trusted security window to the virus scanning program; The virus scanning program performs virus detection on the process of the target application program.

9. A system for detecting viruses, characterized in that: include: Virus scanning module, used to detect viruses on target applications; The identification adding module is used to add identification information for indicating a trusted application to the interface window after the target application is run.

10. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a communication unit, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device implements the method for detecting malware as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method for detecting malware as claimed in any one of claims 1 to 8.