[go: up one dir, main page]

CN108446300A - The scan method and device of data information - Google Patents

The scan method and device of data information Download PDF

Info

Publication number
CN108446300A
CN108446300A CN201810076830.0A CN201810076830A CN108446300A CN 108446300 A CN108446300 A CN 108446300A CN 201810076830 A CN201810076830 A CN 201810076830A CN 108446300 A CN108446300 A CN 108446300A
Authority
CN
China
Prior art keywords
data information
scanned
memory
information
compressed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810076830.0A
Other languages
Chinese (zh)
Other versions
CN108446300B (en
Inventor
陈雄
徐鹏捷
赵建锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201810076830.0A priority Critical patent/CN108446300B/en
Publication of CN108446300A publication Critical patent/CN108446300A/en
Application granted granted Critical
Publication of CN108446300B publication Critical patent/CN108446300B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/122File system administration, e.g. details of archiving or snapshots using management policies
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种数据信息的扫描方法及装置。其中,该方法包括:根据待扫描的数据信息的信息容量判断待扫描的数据信息是否符合预设压缩条件;若是,对待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;针对内存中加载的压缩后的数据信息进行解压缩;针对解压缩后的数据信息进行解析,以确定待扫描的数据信息的扫描结果。由此可见,利用本发明提供的方案,通过对数据信息进行压缩,仅在内存中加载压缩后的数据信息,从而避免了因数据信息过大而无法扫描的问题,使扫描方法能够适用于各类大文件中,拓宽了业务应用场景。

The invention discloses a data information scanning method and device. Wherein, the method includes: judging whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned; if so, compressing the data information to be scanned, and loading the compressed data information into the memory; The compressed data information loaded in the memory is decompressed; the decompressed data information is analyzed to determine the scanning result of the data information to be scanned. It can be seen that, using the solution provided by the present invention, by compressing the data information, only the compressed data information is loaded in the memory, thereby avoiding the problem that the data information is too large to be scanned, and the scanning method can be applied to various In class large files, business application scenarios are broadened.

Description

数据信息的扫描方法及装置Scanning method and device for data information

技术领域technical field

本发明涉及计算机技术领域,具体涉及一种数据信息的扫描方法及装置。The invention relates to the technical field of computers, in particular to a method and device for scanning data information.

背景技术Background technique

目前,在很多应用场景中,都需要对数据信息进行扫描,以便根据扫描结果进行后续处理。例如,在杀毒、更新等多种场景中都需要对病毒库或更新库等数据库进行扫描。具体地,在扫描时需要先将文件加载到内存中,以便由系统进行扫描处理。Currently, in many application scenarios, data information needs to be scanned for subsequent processing based on the scanning results. For example, databases such as virus databases or update databases need to be scanned in various scenarios such as antivirus and update. Specifically, when scanning, the file needs to be loaded into the memory first, so that the system can scan and process it.

但是,发明人在实现本发明的过程中发现,现有技术中的上述扫描方式至少存在下述缺陷:由于待扫描的文件必须加载到内存中才能进行扫描,因此,待扫描的文件的大小受到内存剩余空间的制约。若文件大小大于内存剩余空间,则会导致文件无法加载至内存中,进而导致扫描操作失败。However, the inventor found in the process of implementing the present invention that the above-mentioned scanning method in the prior art has at least the following defects: since the file to be scanned must be loaded into the memory to scan, the size of the file to be scanned is limited. Restriction of remaining memory space. If the file size is larger than the remaining space in the memory, the file cannot be loaded into the memory, and the scanning operation will fail.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的数据信息的扫描方法及装置。In view of the above problems, the present invention is proposed to provide a method and device for scanning data information that overcomes the above problems or at least partially solves the above problems.

根据本发明的一个方面,提供了数据信息的扫描方法,包括:According to one aspect of the present invention, a scanning method for data information is provided, including:

根据待扫描的数据信息的信息容量判断待扫描的数据信息是否符合预设压缩条件;Judging whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned;

若是,对待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;If so, compress the data information to be scanned, and load the compressed data information into the memory;

针对内存中加载的压缩后的数据信息进行解压缩;Decompress the compressed data information loaded in the memory;

针对解压缩后的数据信息进行解析,以确定待扫描的数据信息的扫描结果。Analyzing the decompressed data information to determine the scanning result of the data information to be scanned.

根据本发明的另一个方面,提供了数据信息的扫描装置,包括:According to another aspect of the present invention, a scanning device for data information is provided, including:

判断模块,适于根据待扫描的数据信息的信息容量判断待扫描的数据信息是否符合预设压缩条件;The judging module is adapted to judge whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned;

加载模块,适于若是,对待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;The loading module, if applicable, compresses the data information to be scanned, and loads the compressed data information into the memory;

解压缩模块,适于针对内存中加载的压缩后的数据信息进行解压缩;The decompression module is suitable for decompressing the compressed data information loaded in the memory;

确定模块,适于针对解压缩后的数据信息进行解析,以确定待扫描的数据信息的扫描结果。The determination module is adapted to analyze the decompressed data information to determine the scanning result of the data information to be scanned.

根据本发明的又一方面,提供了一种电子设备,包括:处理器、存储器、通信接口和通信总线,处理器、存储器和通信接口通过通信总线完成相互间的通信;According to yet another aspect of the present invention, an electronic device is provided, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete mutual communication through the communication bus;

存储器用于存放至少一可执行指令,可执行指令使处理器执行上述数据信息的扫描方法对应的操作。The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the scanning method of the above-mentioned data information.

根据本发明的再一方面,提供了一种计算机存储介质,存储介质中存储有至少一可执行指令,可执行指令使处理器执行如上述数据信息的扫描方法对应的操作。According to yet another aspect of the present invention, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to perform operations corresponding to the above data information scanning method.

根据本发明公开的数据信息的扫描方法及装置,当根据待扫描的数据信息的信息容量判断出待扫描的数据信息符合预设压缩条件时,对待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;针对内存中加载的压缩后的数据信息进行解压缩后进行解析,以确定待扫描的数据信息的扫描结果。由此可见,该方式通过对数据信息进行压缩,仅在内存中加载压缩后的数据信息,从而避免了因数据信息过大而无法扫描的问题,使扫描方法能够适用于各类大文件中,拓宽了业务应用场景。According to the scanning method and device for data information disclosed in the present invention, when it is judged according to the information capacity of the data information to be scanned that the data information to be scanned meets the preset compression conditions, the data information to be scanned is compressed, and the compressed data The information is loaded into the memory; the compressed data information loaded in the memory is decompressed and analyzed to determine the scanning result of the data information to be scanned. It can be seen that this method compresses the data information and only loads the compressed data information in the memory, thereby avoiding the problem that the data information cannot be scanned due to too large data information, so that the scanning method can be applied to various large files. Broaden the business application scenarios.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same parts. In the attached picture:

图1示出了本发明一个实施例的数据信息的扫描方法的流程示意图;FIG. 1 shows a schematic flow chart of a scanning method for data information according to an embodiment of the present invention;

图2示出了本发明另一个实施例的数据信息的扫描方法的流程示意图;Fig. 2 shows a schematic flow chart of a scanning method for data information according to another embodiment of the present invention;

图3示出了本发明又一实施例提供的一种数据信息的扫描装置的装置结构图;Fig. 3 shows a device structure diagram of a scanning device for data information provided by another embodiment of the present invention;

图4示出了根据本发明实施例的一种电子设备的结构示意图。Fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

图1示出了本发明一个实施例的数据信息的扫描方法的流程示意图。如图1所示,该方法包括:FIG. 1 shows a schematic flowchart of a data information scanning method according to an embodiment of the present invention. As shown in Figure 1, the method includes:

步骤S110:根据待扫描的数据信息的信息容量判断待扫描的数据信息是否符合预设压缩条件。Step S110: Determine whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned.

其中,预设压缩条件可以灵活设置,本发明不限定具体的设置方式。例如,可以预先根据内存总容量设置容量阈值,将信息容量与容量阈值进行比较,根据比较结果确定待扫描的数据信息是否符合预设压缩条件又如,可以动态获取内存可用容量,将信息容量与内存可用容量进行比较,根据比较结果确定待扫描的数据信息是否符合预设压缩条件。Wherein, the preset compression condition can be flexibly set, and the present invention does not limit the specific setting manner. For example, the capacity threshold can be set in advance according to the total memory capacity, the information capacity can be compared with the capacity threshold, and whether the data information to be scanned meets the preset compression conditions can be determined according to the comparison result. Compare the available memory capacity, and determine whether the data information to be scanned meets the preset compression conditions according to the comparison result.

步骤S120:若是,对待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中。Step S120: If yes, compress the data information to be scanned, and load the compressed data information into the memory.

当确定出待扫描的数据信息符合预设压缩条件时,对待扫描的数据信息进行压缩,并将压缩后的数据信息加载到内存中。其中,压缩时可灵活采用各种压缩算法实现,只要能够达到缩小文件大小的目的即可。在本实施例中,既可以先将文件在硬盘中压缩完毕后在加载在内存中,也可以直接在内存中一边加载一边压缩。When it is determined that the data information to be scanned meets the preset compression condition, the data information to be scanned is compressed, and the compressed data information is loaded into the memory. Among them, various compression algorithms can be flexibly used for compression, as long as the purpose of reducing the file size can be achieved. In this embodiment, the file can be compressed in the hard disk first and then loaded into the memory, or it can be directly compressed while being loaded in the memory.

步骤S130:针对内存中加载的压缩后的数据信息进行解压缩。Step S130: Decompress the compressed data information loaded in the memory.

本步骤既可以在步骤S120执行完毕后立即执行,也可以在步骤S120执行完毕后根据需要按需执行。例如,也可以在需要使用对应的数据信息时才针对该部分数据信息执行解压缩处理。This step can be executed immediately after step S120 is executed, or can be executed as required after step S120 is executed. For example, the decompression process may also be performed on the part of the data information when the corresponding data information needs to be used.

步骤S140:针对解压缩后的数据信息进行解析,以确定待扫描的数据信息的扫描结果。Step S140: Analyzing the decompressed data information to determine the scanning result of the data information to be scanned.

通过本步骤,能够在解压缩完毕后进行解析式扫描,以确定扫描结果。该方式通过对数据信息进行压缩,仅在内存中加载压缩后的数据信息,从而避免了因数据信息过大而无法扫描的问题,使扫描方法能够适用于各类大文件中,拓宽了业务应用场景。Through this step, analytical scanning can be performed after the decompression is completed, so as to determine the scanning result. This method compresses the data information and only loads the compressed data information in the memory, thereby avoiding the problem that the data information cannot be scanned due to too large data information, making the scanning method applicable to various large files and broadening the business application Scenes.

根据本实施例提供的数据信息的扫描方法,当根据待扫描的数据信息的信息容量判断出待扫描的数据信息符合预设压缩条件时,对待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;针对内存中加载的压缩后的数据信息进行解压缩后进行解析,以确定待扫描的数据信息的扫描结果。由此可见,该方式通过对数据信息进行压缩,仅在内存中加载压缩后的数据信息,从而避免了因数据信息过大而无法扫描的问题,使扫描方法能够适用于各类大文件中,拓宽了业务应用场景。According to the scanning method of data information provided in this embodiment, when it is judged according to the information capacity of the data information to be scanned that the data information to be scanned meets the preset compression conditions, the data information to be scanned is compressed, and the compressed data information is Loading into the memory; analyzing the compressed data information loaded in the memory after decompression, so as to determine the scanning result of the data information to be scanned. It can be seen that this method compresses the data information and only loads the compressed data information in the memory, thereby avoiding the problem that the data information cannot be scanned due to too large data information, so that the scanning method can be applied to various large files. Broaden the business application scenarios.

图2示出了本发明另一个实施例的数据信息的扫描方法的流程示意图。在本实施例中,以数据信息为更新数据信息为例进行说明。该更新数据信息可以是待下载的更新包等形式的信息,用于实现软件或系统的更新功能。当然,在本发明其他的实施例中,数据信息也可以是漏洞修复数据信息,例如,可以是补丁包等形式的数据信息,用于实现自动修复功能。如图2所示,该方法包括:Fig. 2 shows a schematic flowchart of a data information scanning method according to another embodiment of the present invention. In this embodiment, the data information is updated data information as an example for description. The update data information may be information in the form of an update package to be downloaded, and is used to implement a software or system update function. Of course, in other embodiments of the present invention, the data information may also be vulnerability repair data information, for example, data information in the form of a patch package, etc., for realizing the automatic repair function. As shown in Figure 2, the method includes:

步骤S210:根据待扫描的数据信息的信息容量判断待扫描的数据信息是否符合预设压缩条件。Step S210: Determine whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned.

由于本实施例的主要用于减少内存的占用,以利于大文件的扫描,因此,预设压缩条件可以根据待扫描的数据信息的信息容量以及内存信息设置。下面介绍预设压缩条件的两种可能的实现方式:Since this embodiment is mainly used to reduce the memory occupation to facilitate the scanning of large files, the preset compression conditions can be set according to the information capacity of the data information to be scanned and the memory information. Two possible implementations of preset compression conditions are described below:

在第一种实现方式中,预先根据内存总容量设置容量阈值,将信息容量与容量阈值进行比较,根据比较结果确定待扫描的数据信息是否符合预设压缩条件。具体地,若内存总容量较大,则可以将容量阈值设置得较大;反之,则可以将容量阈值设置得较小。相应地,当信息容量大于容量阈值时,确定待扫描的数据信息符合预设压缩条件。另外,还可以结合扫描频率等外界条件来设置该容量阈值。该实现方式相当于预先设置了容量阈值,凡是大于该容量阈值的数据信息均需要执行压缩处理。In the first implementation manner, the capacity threshold is set in advance according to the total memory capacity, the information capacity is compared with the capacity threshold, and whether the data information to be scanned meets the preset compression condition is determined according to the comparison result. Specifically, if the total memory capacity is large, the capacity threshold may be set larger; otherwise, the capacity threshold may be set smaller. Correspondingly, when the information capacity is greater than the capacity threshold, it is determined that the data information to be scanned meets the preset compression condition. In addition, the capacity threshold may also be set in combination with external conditions such as scanning frequency. This implementation is equivalent to setting a capacity threshold in advance, and all data information larger than the capacity threshold needs to be compressed.

在第二种实现方式中,可以动态获取内存可用容量,将信息容量与内存可用容量进行比较,根据比较结果确定待扫描的数据信息是否符合预设压缩条件。具体地,每当获取到待扫描的数据信息之后,实时获取当前的内存可用容量,然后根据该待扫描的数据信息与当前的内存可用容量之间的比较结果动态确定是否符合预设压缩条件。例如,若该待扫描的数据信息与当前的内存可用容量之间的比值或差值符合一定的条件则确定符合预设压缩条件。实际上,可以根据待扫描的数据信息与当前的内存可用容量之间的比值或差值设置一个动态可调的阈值,并根据该阈值确定是否符合预设压缩条件。该方式能够动态调整压缩条件,以使当前压缩条件更加符合目前的系统状态。In the second implementation manner, the available memory capacity can be dynamically obtained, the information capacity is compared with the available memory capacity, and whether the data information to be scanned meets the preset compression condition is determined according to the comparison result. Specifically, whenever the data information to be scanned is obtained, the current available memory capacity is obtained in real time, and then it is dynamically determined whether the preset compression condition is met according to the comparison result between the data information to be scanned and the current available memory capacity. For example, if the ratio or difference between the data information to be scanned and the current available memory capacity meets a certain condition, it is determined that the preset compression condition is met. In fact, a dynamically adjustable threshold can be set according to the ratio or difference between the data information to be scanned and the current available memory capacity, and determine whether the preset compression condition is met according to the threshold. This method can dynamically adjust the compression conditions so that the current compression conditions are more in line with the current system state.

实际应用中,上述的两种实现方式既可以单独使用,也可以结合使用,本发明对此不做限定。In practical applications, the above two implementation manners may be used alone or in combination, which is not limited in the present invention.

步骤S220:若是,将待扫描的数据信息划分为多个数据块;分别针对每个数据块进行压缩,得到压缩后的数据块,为该压缩后的数据块建立数据块索引;将该压缩后的数据块加载到内存中,并根据数据块索引生成索引文件。Step S220: If yes, divide the data information to be scanned into multiple data blocks; compress each data block respectively to obtain a compressed data block, and establish a data block index for the compressed data block; The data blocks are loaded into the memory, and an index file is generated based on the data block index.

当确定出待扫描的数据信息符合预设压缩条件时,对待扫描的数据信息进行压缩,并将压缩后的数据信息加载到内存中。When it is determined that the data information to be scanned meets the preset compression condition, the data information to be scanned is compressed, and the compressed data information is loaded into the memory.

具体地,在本实施例中,为了便于对大文件进行分割处理,以实现节约内存空间的效果,在对数据信息执行压缩之前,预先将待扫描的数据信息划分为多个数据块,并分别针对每个数据块进行压缩,得到压缩后的各个数据块,并将压缩后的各个数据块加载到内存中。其中,在划分数据块时,可以根据数据信息中包含的各个部分的信息大小、内容种类、使用频率等多种因素进行划分。划分之后,分别针对每个数据块执行压缩处理,以便于后续过程中实现有针对性地解压缩操作。Specifically, in this embodiment, in order to facilitate the split processing of large files to achieve the effect of saving memory space, before performing compression on the data information, the data information to be scanned is divided into multiple data blocks in advance, and respectively Each data block is compressed to obtain each compressed data block, and each compressed data block is loaded into the memory. Wherein, when dividing the data block, the division may be performed according to various factors such as information size, content type, and usage frequency of each part included in the data information. After division, compression processing is performed on each data block, so as to realize targeted decompression operation in the subsequent process.

另外,为了便于在后续过程中实现有针对性地解压缩操作,提升信息查询效率,在本实施例中,进一步为该压缩后的数据块建立数据块索引,并根据数据块索引生成索引文件。例如,当一个数据信息被划分为五个数据块时,分别针对每个压缩后的数据块设置一个数据块索引,并在索引文件中存储五个数据块索引,以便于快速定位至对应的数据块。In addition, in order to facilitate targeted decompression operations in the subsequent process and improve information query efficiency, in this embodiment, a data block index is further established for the compressed data block, and an index file is generated according to the data block index. For example, when a piece of data information is divided into five data blocks, a data block index is set for each compressed data block, and the five data block indexes are stored in the index file, so as to quickly locate the corresponding data piece.

步骤S230:根据索引文件中包含的各个数据块索引,分别获取压缩后的各个数据块,并分别针对获取到的各个数据块进行解压缩。Step S230: Obtain each compressed data block according to each data block index included in the index file, and decompress each acquired data block respectively.

本步骤既可以在步骤S220执行完毕后立即执行,也可以在步骤S220执行完毕后根据需要按需执行。This step can be executed immediately after step S220 is executed, or can be executed as required after step S220 is executed.

例如,在一种具体的业务场景中,扫描引擎会按照如下过程处理:For example, in a specific business scenario, the scanning engine will process as follows:

首先,将待扫描的各个数据信息全部加载至内存中。此过程对应于步骤S210以及步骤S220。在此过程中,需要扫描各个数据信息的基本属性,例如,文件大小、文件类型、文件更新时间等;按照基本属性将各个数据信息全部加载至内存中。例如,在此过程中可以判断是否需要对文件执行压缩处理,并优先加载不需要压缩的文件;和/或,将不需要压缩的文件和需要压缩的文件分开存储。在本步骤中,若判断出一个文件符合预设压缩规则,则对其进行压缩后存入内存,以节省内存空间。First, load all the data information to be scanned into the memory. This process corresponds to step S210 and step S220. During this process, it is necessary to scan the basic attributes of each data information, such as file size, file type, file update time, etc.; all data information is loaded into the memory according to the basic attributes. For example, during this process, it may be determined whether the files need to be compressed, and the files that do not need to be compressed are loaded preferentially; and/or, the files that do not need to be compressed are stored separately from the files that need to be compressed. In this step, if it is judged that a file conforms to the preset compression rule, it is compressed and then stored in memory to save memory space.

然后,按照预设处理顺序从内存中获取需要的处理的数据信息并执行扫描处理。此过程对应于步骤S230。其中,预设处理顺序可以是优先处理不需压缩的数据,之后处理需要压缩的数据等各类顺序规则。由此可见,此过程实质上是按需实现的,根据当前的处理进度从内存中获取下一个要扫描的数据信息。具体获取时,考虑到有些大文件若全部解压后得到的文件大小有可能大于内存剩余可用空间,即使不大于内存剩余可用空间,也有可能因内存占用过大而影响系统运行效率。为了解决这一问题,在此过程中,根据索引文件中包含的各个数据块索引,分别获取压缩后的各个数据块,并分别针对获取到的各个数据块进行解压缩。例如,假设一个完整的压缩后的数据信息共包含10个数据块,若同时将10个数据块解压到内存中处理将会导致内存消耗过大,因此,按照实际处理的需要每次仅解压一个或两三个数据块,从而降低了同一时间内的内存消耗,能够有效防止因数据信息过大而导致扫描失败的现象发生。Then, according to the preset processing sequence, the required processing data information is obtained from the memory and the scanning processing is performed. This process corresponds to step S230. Wherein, the preset processing order may be various order rules such as prioritizing data that does not need to be compressed, and then processing data that needs to be compressed. It can be seen that this process is realized on demand in essence, and the next data information to be scanned is obtained from the memory according to the current processing progress. When obtaining it, consider that if some large files are fully decompressed, the size of the file may be larger than the remaining available space in the memory. Even if it is not larger than the remaining available space in the memory, the system operation efficiency may be affected due to excessive memory usage. In order to solve this problem, in this process, each compressed data block is obtained respectively according to each data block index contained in the index file, and each obtained data block is respectively decompressed. For example, assuming that a complete compressed data message contains 10 data blocks in total, if 10 data blocks are decompressed into the memory for processing at the same time, the memory consumption will be too large. Therefore, according to the actual processing needs, only one data block is decompressed at a time Or two or three data blocks, thereby reducing the memory consumption at the same time, and can effectively prevent the phenomenon of scanning failure caused by too large data information.

步骤S240:针对解压缩后的各个数据块进行解析,以确定待扫描的数据信息的扫描结果。Step S240: Analyzing each decompressed data block to determine the scanning result of the data information to be scanned.

其中,每当步骤S230执行完毕并获取到一个数据块之后,则通过本步骤对解压出来的数据块进行解析,得到该数据块的解析结果。最后,根据一个数据信息中包含的各个数据块的解析结果即可确定该待扫描的数据信息的整体扫描结果。Wherein, whenever step S230 is executed and a data block is obtained, the decompressed data block is analyzed through this step to obtain an analysis result of the data block. Finally, the overall scanning result of the data information to be scanned can be determined according to the analysis results of each data block included in the data information.

由此可见,本实施例通过在内存中执行压缩处理(常规的压缩处理都是在硬盘中实现的)并直接将压缩后的文件存储在内存中,能够有效减少大文件对内存的占用,从而提升系统运行效率。并且,由于压缩后的文件可以按照数据块进行解压,无需一次针对全部数据信息进行解压,因此显著降低了大文件在扫描过程中占用的内存数量,即使文件大小大于内存剩余空间也可通过该方式完成扫描功能,从而拓宽了扫描功能的应用范围,使一些原本受限于内存空间而无法应用扫描功能的应用也可以实现扫描功能,从而为用户提供更加全面的服务。该方式尤其适用于扫描更新场景中,由于更新库非常庞大,因此,导致传统的扫描方案无法应用更新库的扫描,采用本发明中的方案之后,能够有效解决这一问题。It can be seen that this embodiment can effectively reduce the memory occupation of large files by performing compression processing in memory (conventional compression processing is all implemented in the hard disk) and directly storing compressed files in memory. Improve system operating efficiency. Moreover, since compressed files can be decompressed according to data blocks, there is no need to decompress all data information at once, so the amount of memory occupied by large files during scanning is significantly reduced, even if the file size is larger than the remaining space of the memory, it can also be used in this way The scanning function is completed, thereby broadening the application range of the scanning function, so that some applications that are originally limited by the memory space and cannot use the scanning function can also implement the scanning function, thereby providing users with more comprehensive services. This method is especially suitable for scanning and updating scenarios. Since the update library is very large, the traditional scanning solution cannot be used for scanning the update library. After adopting the solution in the present invention, this problem can be effectively solved.

另外,本领域技术人员还可以对上述实施例进行各种可能的改动或扩展。例如,在执行根据待扫描的数据信息的信息容量判断待扫描的数据信息是否符合预设压缩条件的步骤之前,还可以进一步包括如下步骤:In addition, those skilled in the art may make various possible modifications or extensions to the above embodiments. For example, before performing the step of judging whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned, the following steps may be further included:

监测是否接收到关机指令;若是,针对所述关机指令执行拦截操作,并执行上述根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件的步骤。Monitoring whether a shutdown command is received; if so, intercepting the shutdown command, and performing the above step of judging whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned.

由于待扫描的文件必须加载到内存中才能进行扫描,因此在扫描的过程中会占用很大的内存,消耗很多的资源,影响计算机的使用甚至导致其无法使用,从而影响了用户正常使用计算机,为了解决上述问题,可以在用户结束使用计算机,触发关机指令之后开始扫描进程。监测是否接收到关机指令时,可以通过预先确定用于发送关机指令的关机函数,然后通过挂钩函数或者可以关联关机函数的其它类型的函数来对上述关机函数进行监控,通过监控关机函数从而可以及时地监测是否接收到关机指令。若是,可以通过暂停关机指令的传输的方式来执行拦截操作。Since the files to be scanned must be loaded into the memory to be scanned, it will take up a lot of memory and consume a lot of resources during the scanning process, affecting the use of the computer or even making it unusable, thus affecting the normal use of the computer by the user. In order to solve the above problem, the scanning process can be started after the user finishes using the computer and triggers a shutdown command. When monitoring whether a shutdown command is received, the shutdown function used to send the shutdown command can be determined in advance, and then the above shutdown function can be monitored through the hook function or other types of functions that can be associated with the shutdown function. By monitoring the shutdown function, it can be timely to monitor whether a shutdown command is received. If so, the interception operation may be performed by suspending the transmission of the shutdown command.

可选地,针对关机指令执行拦截操作的步骤之后,为了节省资源,提升处理速度,进一步将与扫描操作无关的进程标记为目标进程,结束目标进程。比如在计算机上打开的例如文档,浏览器等各种漏洞修复操作无关的进程都可以标记为目标进程,并且结束上述目标进程。通过关掉与漏洞修复操作无关的进程,可以提高执行漏洞修复操作的效率,减少修复所占用的时间。在结束目标进程之后,执行上述根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件的步骤以及后续步骤,最后当监测到待扫描的数据信息扫描完毕时,针对上述关机指令执行放行操作。具体地,可以通过恢复关机指令的传输的方式来执行放行操作。当系统接收到传输的关机指令后,此时可以执行关机操作进行关机。Optionally, after the step of intercepting the shutdown command, in order to save resources and improve processing speed, further mark a process unrelated to the scanning operation as a target process, and end the target process. For example, processes irrelevant to various vulnerability repair operations such as documents and browsers opened on the computer can be marked as target processes, and the above-mentioned target processes can be terminated. By shutting down processes that are not related to the vulnerability repair operation, the efficiency of performing the vulnerability repair operation can be improved, and the time taken for the repair can be reduced. After the target process is finished, execute the step of judging whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned and subsequent steps, and finally when it is detected that the data information to be scanned has been scanned, Execute the release operation for the above shutdown command. Specifically, the release operation may be performed by resuming the transmission of the shutdown command. After the system receives the transmitted shutdown command, it can perform a shutdown operation to shut down.

通过上述执行步骤,可以在用户不使用计算机,触发关机指令的时候开始数据信息扫描进程,避免了在用户使用计算机的时候,由于扫描数据信息占用了大量的计算机内存和资源而影响用户正常使用计算机的情况,从而大大地提升了用户体验。Through the above execution steps, the data information scanning process can be started when the user does not use the computer and triggers a shutdown command, which avoids affecting the normal use of the computer by the user due to the scanning data information occupying a large amount of computer memory and resources when the user is using the computer. , thus greatly improving the user experience.

图3示出了示出了本发明又一实施例提供的一种数据信息的扫描装置的装置结构图,如图3所示,所述装置包括:Fig. 3 shows a device structure diagram showing a scanning device for data information provided by another embodiment of the present invention. As shown in Fig. 3, the device includes:

判断模块33,适于根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件;The judging module 33 is adapted to judge whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned;

加载模块34,适于若是,对所述待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;The loading module 34 is adapted to compress the data information to be scanned, and load the compressed data information into the memory if so;

解压缩模块35,适于针对内存中加载的所述压缩后的数据信息进行解压缩;The decompression module 35 is suitable for decompressing the compressed data information loaded in the memory;

确定模块36,适于针对解压缩后的数据信息进行解析,以确定所述待扫描的数据信息的扫描结果。The determination module 36 is adapted to analyze the decompressed data information to determine the scanning result of the data information to be scanned.

在本发明另一个实施例中,其中,所述判断模块33具体适于:In another embodiment of the present invention, wherein, the judging module 33 is specifically adapted to:

预先根据内存总容量设置容量阈值,将所述信息容量与所述容量阈值进行比较,根据比较结果确定所述待扫描的数据信息是否符合预设压缩条件;和/或,Setting a capacity threshold in advance according to the total memory capacity, comparing the information capacity with the capacity threshold, and determining whether the data information to be scanned meets a preset compression condition according to the comparison result; and/or,

动态获取内存可用容量,将所述信息容量与所述内存可用容量进行比较,根据比较结果确定所述待扫描的数据信息是否符合预设压缩条件。Dynamically acquire the available memory capacity, compare the information capacity with the available memory capacity, and determine whether the data information to be scanned meets a preset compression condition according to the comparison result.

可选地,其中,所述加载模块34具体适于:Optionally, wherein the loading module 34 is specifically adapted to:

将所述待扫描的数据信息划分为多个数据块;Divide the data information to be scanned into multiple data blocks;

分别针对每个数据块进行压缩,得到压缩后的数据块,为该压缩后的数据块建立数据块索引;Compress each data block separately to obtain a compressed data block, and establish a data block index for the compressed data block;

将该压缩后的数据块加载到内存中,并根据所述数据块索引生成索引文件。The compressed data block is loaded into memory, and an index file is generated according to the data block index.

可选地,其中,所述解压缩模块35具体适于:Optionally, wherein, the decompression module 35 is specifically adapted to:

根据所述索引文件中包含的各个数据块索引,分别获取压缩后的各个数据块,并分别针对获取到的各个数据块进行解压缩。According to each data block index included in the index file, each compressed data block is respectively obtained, and each obtained data block is respectively decompressed.

可选地,其中,所述数据信息包括:更新数据信息、漏洞修复数据信息。Optionally, the data information includes: update data information and bug fix data information.

可选地,其中,所述装置进一步包括:Optionally, wherein the device further includes:

监测模块31,适于监测是否接收到关机指令;A monitoring module 31, adapted to monitor whether a shutdown command is received;

执行模块32,适于若是,针对所述关机指令执行拦截操作,并执行所述判断模块中的内容。The execution module 32 is adapted to, if yes, execute an interception operation on the shutdown command, and execute the content in the judging module.

可选地,其中,所述装置进一步包括放行模块37,Optionally, wherein the device further includes a release module 37,

适于:当监测到待扫描的数据信息扫描完毕时,针对所述关机指令执行放行操作。Suitable for: when it is detected that the scanning of the data information to be scanned is completed, performing a release operation for the shutdown instruction.

可选地,其中,所述执行模块32进一步适于:Optionally, wherein, the execution module 32 is further adapted to:

将与扫描操作无关的进程标记为目标进程,结束所述目标进程。A process irrelevant to the scanning operation is marked as a target process, and the target process is terminated.

上述各个模块的具体结构和工作原理可参照方法实施例中相应步骤的描述,此处不再赘述。For the specific structure and working principle of each of the above modules, reference may be made to the description of corresponding steps in the method embodiments, which will not be repeated here.

本申请实施例提供了一种非易失性计算机存储介质,计算机存储介质存储有至少一可执行指令,该计算机可执行指令可执行上述任意方法实施例中的数据信息的扫描方法。An embodiment of the present application provides a non-volatile computer storage medium. The computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the data information scanning method in any of the above method embodiments.

图4示出了根据本发明实施例的一种电子设备的结构示意图,本发明具体实施例并不对电子设备的具体实现做限定。Fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.

如图4所示,该电子设备可以包括:处理器(processor)402、通信接口(Communications Interface)404、存储器(memory)406、以及通信总线408。As shown in FIG. 4 , the electronic device may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

其中:in:

处理器402、通信接口404、以及存储器406通过通信总线408完成相互间的通信。The processor 402 , the communication interface 404 , and the memory 406 communicate with each other through the communication bus 408 .

通信接口404,用于与其它设备比如客户端或其它服务器等的网元通信。The communication interface 404 is used to communicate with network elements of other devices such as clients or other servers.

处理器402,用于执行程序410,具体可以执行上述数据信息的扫描方法实施例中的相关步骤。The processor 402 is configured to execute the program 410, and specifically, may execute relevant steps in the embodiment of the scanning method for data information above.

具体地,程序410可以包括程序代码,该程序代码包括计算机操作指令。Specifically, the program 410 may include program codes including computer operation instructions.

处理器402可能是中央处理器CPU,或者是特定集成电路ASIC(ApplicationSpecific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。电子设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。The processor 402 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be of the same type, such as one or more CPUs, or may be different types of processors, such as one or more CPUs and one or more ASICs.

存储器406,用于存放程序410。存储器406可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 406 is used to store the program 410 . The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

程序410具体可以用于使得处理器402执行以下操作:The program 410 can specifically be used to make the processor 402 perform the following operations:

根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件;judging whether the data information to be scanned meets a preset compression condition according to the information capacity of the data information to be scanned;

若是,对所述待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;If so, compress the data information to be scanned, and load the compressed data information into the memory;

针对内存中加载的所述压缩后的数据信息进行解压缩;Decompressing the compressed data information loaded in memory;

针对解压缩后的数据信息进行解析,以确定所述待扫描的数据信息的扫描结果。Analyzing the decompressed data information to determine the scanning result of the data information to be scanned.

在一种可选的方式中,程序410具体可以进一步用于使得处理器402执行以下操作:In an optional manner, the program 410 may be further specifically configured to enable the processor 402 to perform the following operations:

预先根据内存总容量设置容量阈值,将所述信息容量与所述容量阈值进行比较,根据比较结果确定所述待扫描的数据信息是否符合预设压缩条件;和/或,Setting a capacity threshold in advance according to the total memory capacity, comparing the information capacity with the capacity threshold, and determining whether the data information to be scanned meets a preset compression condition according to the comparison result; and/or,

动态获取内存可用容量,将所述信息容量与所述内存可用容量进行比较,根据比较结果确定所述待扫描的数据信息是否符合预设压缩条件。Dynamically acquire the available memory capacity, compare the information capacity with the available memory capacity, and determine whether the data information to be scanned meets a preset compression condition according to the comparison result.

在一种可选的方式中,程序410具体可以进一步用于使得处理器402执行以下操作:将所述待扫描的数据信息划分为多个数据块;In an optional manner, the program 410 may be further specifically configured to enable the processor 402 to perform the following operations: divide the data information to be scanned into multiple data blocks;

分别针对每个数据块进行压缩,得到压缩后的数据块,为该压缩后的数据块建立数据块索引;Compress each data block separately to obtain a compressed data block, and establish a data block index for the compressed data block;

将该压缩后的数据块加载到内存中,并根据所述数据块索引生成索引文件。The compressed data block is loaded into memory, and an index file is generated according to the data block index.

在一种可选的方式中,程序410具体可以进一步用于使得处理器402执行以下操作:根据所述索引文件中包含的各个数据块索引,分别获取压缩后的各个数据块,并分别针对获取到的各个数据块进行解压缩。In an optional manner, the program 410 may be further specifically configured to cause the processor 402 to perform the following operations: obtain each compressed data block respectively according to each data block index contained in the index file, and respectively obtain Decompress each data block received.

在一种可选的方式中,程序410具体可以进一步用于使得处理器402执行以下操作:所述数据信息包括:更新数据信息、漏洞修复数据信息。In an optional manner, the program 410 may be further specifically configured to enable the processor 402 to perform the following operations: the data information includes: update data information and bug fix data information.

在一种可选的方式中,程序410具体可以进一步用于使得处理器402执行以下操作:监测是否接收到关机指令;In an optional manner, the program 410 may be further specifically configured to enable the processor 402 to perform the following operations: monitor whether a shutdown instruction is received;

若是,针对所述关机指令执行拦截操作,并执行所述根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件的步骤。If so, perform an interception operation on the shutdown command, and perform the step of judging whether the data information to be scanned meets a preset compression condition according to the information capacity of the data information to be scanned.

在一种可选的方式中,程序410具体可以进一步用于使得处理器402执行以下操作:当监测到待扫描的数据信息扫描完毕时,针对所述关机指令执行放行操作。In an optional manner, the program 410 may be further specifically configured to enable the processor 402 to perform the following operation: when it is detected that the scanning of the data information to be scanned is completed, perform a release operation for the shutdown command.

在一种可选的方式中,程序410具体可以进一步用于使得处理器402执行以下操作:将与扫描操作无关的进程标记为目标进程,结束所述目标进程。In an optional manner, the program 410 may be further specifically configured to cause the processor 402 to perform the following operations: mark a process unrelated to the scanning operation as a target process, and end the target process.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的数据信息的扫描装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the data information scanning device according to the embodiment of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

另外,本发明还公开了:A1.一种数据信息的扫描方法,包括:In addition, the present invention also discloses: A1. A scanning method for data information, comprising:

根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件;judging whether the data information to be scanned meets a preset compression condition according to the information capacity of the data information to be scanned;

若是,对所述待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;If so, compress the data information to be scanned, and load the compressed data information into the memory;

针对内存中加载的所述压缩后的数据信息进行解压缩;Decompressing the compressed data information loaded in memory;

针对解压缩后的数据信息进行解析,以确定所述待扫描的数据信息的扫描结果。Analyzing the decompressed data information to determine the scanning result of the data information to be scanned.

A2.根据权利要求A1所述的方法,其中,所述根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件的步骤具体包括:A2. The method according to claim A1, wherein the step of judging whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned specifically comprises:

预先根据内存总容量设置容量阈值,将所述信息容量与所述容量阈值进行比较,根据比较结果确定所述待扫描的数据信息是否符合预设压缩条件;和/或,Setting a capacity threshold in advance according to the total memory capacity, comparing the information capacity with the capacity threshold, and determining whether the data information to be scanned meets a preset compression condition according to the comparison result; and/or,

动态获取内存可用容量,将所述信息容量与所述内存可用容量进行比较,根据比较结果确定所述待扫描的数据信息是否符合预设压缩条件。Dynamically acquire the available memory capacity, compare the information capacity with the available memory capacity, and determine whether the data information to be scanned meets a preset compression condition according to the comparison result.

A3.根据权利要求A1或A2所述的方法,其中,所述对所述待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中的步骤具体包括:A3. The method according to claim A1 or A2, wherein the step of compressing the data information to be scanned and loading the compressed data information into the memory specifically includes:

将所述待扫描的数据信息划分为多个数据块;Divide the data information to be scanned into multiple data blocks;

分别针对每个数据块进行压缩,得到压缩后的数据块,为该压缩后的数据块建立数据块索引;Compress each data block separately to obtain a compressed data block, and establish a data block index for the compressed data block;

将该压缩后的数据块加载到内存中,并根据所述数据块索引生成索引文件。The compressed data block is loaded into memory, and an index file is generated according to the data block index.

A4.根据权利要求A3所述的方法,其中,所述针对内存中加载的所述压缩后的数据信息进行解压缩的步骤具体包括:A4. The method according to claim A3, wherein the step of decompressing the compressed data information loaded in the memory specifically comprises:

根据所述索引文件中包含的各个数据块索引,分别获取压缩后的各个数据块,并分别针对获取到的各个数据块进行解压缩。According to each data block index included in the index file, each compressed data block is respectively obtained, and each obtained data block is respectively decompressed.

A5.根据权利要求A1-A4任一所述的方法,其中,所述数据信息包括:更新数据信息、漏洞修复数据信息。A5. The method according to any one of claims A1-A4, wherein the data information includes: update data information, bug repair data information.

A6.根据权利要求A1-A5任一所述的方法,其中,所述根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件的步骤之前,进一步包括:A6. The method according to any one of claims A1-A5, wherein, before the step of judging whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned, further comprising:

监测是否接收到关机指令;Monitor whether a shutdown command is received;

若是,针对所述关机指令执行拦截操作,并执行所述根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件的步骤。If so, perform an interception operation on the shutdown command, and perform the step of judging whether the data information to be scanned meets a preset compression condition according to the information capacity of the data information to be scanned.

A7.根据权利要求A6所述的方法,其中,所述方法进一步包括:A7. The method according to claim A6, wherein the method further comprises:

当监测到待扫描的数据信息扫描完毕时,针对所述关机指令执行放行操作。When it is detected that the data information to be scanned has been scanned, a release operation is performed for the shutdown command.

A8.根据权利要求A6或A7所述的方法,其中,所述针对所述关机指令执行拦截操作的步骤之后,进一步包括:A8. The method according to claim A6 or A7, wherein, after the step of intercepting the shutdown command, further comprising:

将与扫描操作无关的进程标记为目标进程,结束所述目标进程。A process irrelevant to the scanning operation is marked as a target process, and the target process is terminated.

B9.一种数据信息的扫描装置,包括:B9. A scanning device for data information, comprising:

判断模块,适于根据待扫描的数据信息的信息容量判断所述待扫描的数据信息是否符合预设压缩条件;The judging module is adapted to judge whether the data information to be scanned meets the preset compression condition according to the information capacity of the data information to be scanned;

加载模块,适于若是,对所述待扫描的数据信息进行压缩,将压缩后的数据信息加载到内存中;The loading module is suitable for compressing the data information to be scanned, and loading the compressed data information into the memory;

解压缩模块,适于针对内存中加载的所述压缩后的数据信息进行解压缩;A decompression module, adapted to decompress the compressed data information loaded in the memory;

确定模块,适于针对解压缩后的数据信息进行解析,以确定所述待扫描的数据信息的扫描结果。The determining module is adapted to analyze the decompressed data information to determine the scanning result of the data information to be scanned.

B10.根据权利要求B9所述的装置,其中,所述判断模块具体适于:B10. The device according to claim B9, wherein the judging module is specifically adapted to:

预先根据内存总容量设置容量阈值,将所述信息容量与所述容量阈值进行比较,根据比较结果确定所述待扫描的数据信息是否符合预设压缩条件;和/或,Setting a capacity threshold in advance according to the total memory capacity, comparing the information capacity with the capacity threshold, and determining whether the data information to be scanned meets a preset compression condition according to the comparison result; and/or,

动态获取内存可用容量,将所述信息容量与所述内存可用容量进行比较,根据比较结果确定所述待扫描的数据信息是否符合预设压缩条件。Dynamically acquire the available memory capacity, compare the information capacity with the available memory capacity, and determine whether the data information to be scanned meets a preset compression condition according to the comparison result.

B11.根据权利要求B9或B10所述的装置,其中,所述加载模块具体适于:B11. The device according to claim B9 or B10, wherein the loading module is specifically adapted to:

将所述待扫描的数据信息划分为多个数据块;Divide the data information to be scanned into multiple data blocks;

分别针对每个数据块进行压缩,得到压缩后的数据块,为该压缩后的数据块建立数据块索引;Compress each data block separately to obtain a compressed data block, and establish a data block index for the compressed data block;

将该压缩后的数据块加载到内存中,并根据所述数据块索引生成索引文件。The compressed data block is loaded into memory, and an index file is generated according to the data block index.

B12.根据权利要求B11所述的装置,其中,所述解压缩模块具体适于:B12. The device according to claim B11, wherein the decompression module is specifically adapted to:

根据所述索引文件中包含的各个数据块索引,分别获取压缩后的各个数据块,并分别针对获取到的各个数据块进行解压缩。According to each data block index included in the index file, each compressed data block is respectively obtained, and each obtained data block is respectively decompressed.

B13.根据权利要求B9-B12任一所述的装置,其中,所述数据信息包括:更新数据信息、漏洞修复数据信息。B13. The device according to any one of claims B9-B12, wherein the data information includes: update data information, bug repair data information.

B14.根据权利要求B9-B13任一所述的装置,其中,所述装置进一步包括:B14. The device according to any one of claims B9-B13, wherein the device further comprises:

监测模块,适于监测是否接收到关机指令;A monitoring module, adapted to monitor whether a shutdown command is received;

执行模块,适于若是,针对所述关机指令执行拦截操作,并执行所述判断模块中的内容。The execution module is adapted to, if yes, execute an interception operation for the shutdown command, and execute the content in the judging module.

B15.根据权利要求B14所述的装置,其中,所述装置进一步包括放行模块,B15. The device according to claim B14, wherein the device further comprises a release module,

适于:当监测到待扫描的数据信息扫描完毕时,针对所述关机指令执行放行操作。Suitable for: when it is detected that the scanning of the data information to be scanned is completed, performing a release operation for the shutdown instruction.

B16.根据权利要求B14或B15所述的装置,其中,所述执行模块进一步适于:B16. The device according to claim B14 or B15, wherein the execution module is further adapted to:

将与扫描操作无关的进程标记为目标进程,结束所述目标进程。A process irrelevant to the scanning operation is marked as a target process, and the target process is terminated.

C17.一种电子设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;C17. An electronic device, comprising: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete mutual communication through the communication bus;

所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行如权利要求A1-A8中任一项所述的数据信息的扫描方法对应的操作。The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the data information scanning method described in any one of claims A1-A8.

D18.一种计算机存储介质,所述存储介质中存储有至少一可执行指令,所述可执行指令使处理器执行如权利要求A1-A8中任一项所述的数据信息的扫描方法对应的操作。D18. A computer storage medium, at least one executable instruction is stored in the storage medium, and the executable instruction causes the processor to execute the corresponding method of scanning data information according to any one of claims A1-A8 operate.

Claims (10)

1. a kind of scan method of data information, including:
Judge whether the data information to be scanned meets default compressor bar according to the information capacity of data information to be scanned Part;
If so, being compressed to the data information to be scanned, compressed data information is loaded into memory;
It is unziped it for the compressed data information loaded in memory;
It is parsed for the data information after decompression, with the scanning result of the determination data information to be scanned.
2. according to the method described in claim 1, wherein, it is described judged according to the information capacity of data information to be scanned described in The step of whether data information to be scanned meets default contractive condition specifically includes:
Capacity threshold is set previously according to total amount of memory, described information capacity is compared with the capacity threshold, according to Comparison result determines whether the data information to be scanned meets default contractive condition;And/or
Described information capacity is compared by dynamic access memory active volume with the memory active volume, is tied according to comparing Fruit determines whether the data information to be scanned meets default contractive condition.
3. method according to claim 1 or 2, wherein it is described that the data information to be scanned is compressed, it will press Data information after contracting is loaded into the step in memory and specifically includes:
The data information to be scanned is divided into multiple data blocks;
It is compressed respectively for each data block, obtains compressed data block, data are established for the compressed data block Block indexes;
The compressed data block is loaded into memory, and is indexed according to the data block and generates index file.
4. according to the method described in claim 3, wherein, it is described for the compressed data information loaded in memory into The step of row decompression, specifically includes:
According to each data block index for including in the index file, compressed each data block is obtained respectively, and respectively It is unziped it for each data block got.
5. according to any methods of claim 1-4, wherein the data information includes:Update the data information, loophole is repaiied Complex data information.
6. according to any methods of claim 1-5, wherein the information capacity according to data information to be scanned is sentenced Before the step of whether data information to be scanned that breaks meets default contractive condition, further comprise:
It monitors whether to receive shutdown command;
Operation is intercepted if so, being executed for the shutdown command, and is executed described according to the information of data information to be scanned appearance Amount judges the step of whether data information to be scanned meets default contractive condition.
7. according to the method described in claim 6, wherein, the method further includes:
When monitoring that data information to be scanned is scanned, exit-entry operation is executed for the shutdown command.
8. a kind of scanning means of data information, including:
Judgment module, suitable for judging whether the data information to be scanned accords with according to the information capacity of data information to be scanned It closes and presets contractive condition;
Load-on module, suitable for if so, compressed to the data information to be scanned, compressed data information is loaded into In memory;
Decompression module, suitable for being unziped it for the compressed data information loaded in memory;
Determining module, suitable for being parsed for the data information after decompression, with the determination data information to be scanned Scanning result.
9. a kind of electronic equipment, including:Processor, memory, communication interface and communication bus, the processor, the storage Device and the communication interface complete mutual communication by the communication bus;
The memory makes the processor execute as right is wanted for storing an at least executable instruction, the executable instruction Ask the corresponding operation of the scan method of the data information described in any one of 1-7.
10. a kind of computer storage media, an at least executable instruction, the executable instruction are stored in the storage medium Make the corresponding operation of scan method of data information of the processor execution as described in any one of claim 1-7.
CN201810076830.0A 2018-01-26 2018-01-26 Data information scanning method and device Expired - Fee Related CN108446300B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810076830.0A CN108446300B (en) 2018-01-26 2018-01-26 Data information scanning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810076830.0A CN108446300B (en) 2018-01-26 2018-01-26 Data information scanning method and device

Publications (2)

Publication Number Publication Date
CN108446300A true CN108446300A (en) 2018-08-24
CN108446300B CN108446300B (en) 2021-04-09

Family

ID=63191028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810076830.0A Expired - Fee Related CN108446300B (en) 2018-01-26 2018-01-26 Data information scanning method and device

Country Status (1)

Country Link
CN (1) CN108446300B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941478A (en) * 2018-09-21 2020-03-31 北京奇虎科技有限公司 File scanning task execution method and device and computing equipment
CN111510155A (en) * 2020-04-17 2020-08-07 深圳市科思科技股份有限公司 Data compression method, data decompression method, electronic device and storage medium
CN113452378A (en) * 2021-06-28 2021-09-28 国网北京市电力公司 Twin data compression method and device and computer readable storage medium
CN114116234A (en) * 2022-01-24 2022-03-01 山东捷瑞数字科技股份有限公司 Three-dimensional scene model decompression loading method based on browser

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930515A (en) * 2010-08-27 2010-12-29 奇智软件(北京)有限公司 A system and method for safely decompressing compressed files
CN102025983A (en) * 2010-09-19 2011-04-20 北京邮电大学 Data transmission processing method and system and corresponding light-emitting diode (LED) display system
CN102289484A (en) * 2011-08-03 2011-12-21 Tcl集团股份有限公司 Method for scanning multimedia files of storage equipment based on android system
CN102411628A (en) * 2011-12-19 2012-04-11 Tcl集团股份有限公司 File scanning method and device based on android system
CN102436421A (en) * 2010-09-29 2012-05-02 腾讯科技(深圳)有限公司 Method for caching data
CN103218224A (en) * 2013-03-29 2013-07-24 东莞宇龙通信科技有限公司 Method and terminal for improving utilization ratio of memory space
CN103384884A (en) * 2012-12-11 2013-11-06 华为技术有限公司 A file compression method, file decompression method, device and server
CN103793649A (en) * 2013-11-22 2014-05-14 北京奇虎科技有限公司 Method and device for cloud-based safety scanning of files
CN104636165A (en) * 2015-02-02 2015-05-20 广东小天才科技有限公司 Mobile equipment starting method and device
CN105451042A (en) * 2015-12-14 2016-03-30 福建新大陆通信科技股份有限公司 Set top box based file upgrading system and method
CN105677259A (en) * 2016-02-29 2016-06-15 珠海市魅族科技有限公司 Method for storing file in mobile terminal and mobile terminal
CN105955722A (en) * 2016-04-20 2016-09-21 合肥师范学院 UBI device partition rapid loading method in embedded system
CN106503165A (en) * 2016-10-31 2017-03-15 杭州华为数字技术有限公司 Compression, decompressing method, device and equipment

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930515A (en) * 2010-08-27 2010-12-29 奇智软件(北京)有限公司 A system and method for safely decompressing compressed files
CN102025983A (en) * 2010-09-19 2011-04-20 北京邮电大学 Data transmission processing method and system and corresponding light-emitting diode (LED) display system
CN102436421A (en) * 2010-09-29 2012-05-02 腾讯科技(深圳)有限公司 Method for caching data
CN102289484A (en) * 2011-08-03 2011-12-21 Tcl集团股份有限公司 Method for scanning multimedia files of storage equipment based on android system
CN102411628A (en) * 2011-12-19 2012-04-11 Tcl集团股份有限公司 File scanning method and device based on android system
CN103384884A (en) * 2012-12-11 2013-11-06 华为技术有限公司 A file compression method, file decompression method, device and server
CN103218224A (en) * 2013-03-29 2013-07-24 东莞宇龙通信科技有限公司 Method and terminal for improving utilization ratio of memory space
CN103793649A (en) * 2013-11-22 2014-05-14 北京奇虎科技有限公司 Method and device for cloud-based safety scanning of files
CN104636165A (en) * 2015-02-02 2015-05-20 广东小天才科技有限公司 Mobile equipment starting method and device
CN105451042A (en) * 2015-12-14 2016-03-30 福建新大陆通信科技股份有限公司 Set top box based file upgrading system and method
CN105677259A (en) * 2016-02-29 2016-06-15 珠海市魅族科技有限公司 Method for storing file in mobile terminal and mobile terminal
CN105955722A (en) * 2016-04-20 2016-09-21 合肥师范学院 UBI device partition rapid loading method in embedded system
CN106503165A (en) * 2016-10-31 2017-03-15 杭州华为数字技术有限公司 Compression, decompressing method, device and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
熊渊琳 等: ""应用于嵌入式平台分块数据压缩的实现"", 《信息安全与技术》 *
蔡颖铭: ""适用于影像检测压缩系统的内存存取方式"", 《世界电子元器件》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941478A (en) * 2018-09-21 2020-03-31 北京奇虎科技有限公司 File scanning task execution method and device and computing equipment
CN110941478B (en) * 2018-09-21 2024-03-01 北京奇虎科技有限公司 Execution method and device of file scanning task and computing equipment
CN111510155A (en) * 2020-04-17 2020-08-07 深圳市科思科技股份有限公司 Data compression method, data decompression method, electronic device and storage medium
CN111510155B (en) * 2020-04-17 2023-09-26 深圳市科思科技股份有限公司 Data compression method, data decompression method, electronic device and storage medium
CN113452378A (en) * 2021-06-28 2021-09-28 国网北京市电力公司 Twin data compression method and device and computer readable storage medium
CN114116234A (en) * 2022-01-24 2022-03-01 山东捷瑞数字科技股份有限公司 Three-dimensional scene model decompression loading method based on browser

Also Published As

Publication number Publication date
CN108446300B (en) 2021-04-09

Similar Documents

Publication Publication Date Title
CN107832100B (en) APK plug-in loading method and terminal thereof
CN108446300A (en) The scan method and device of data information
US20090216967A1 (en) Computer, recording medium recording dump program, and dump method
CN102905045A (en) Method and server for providing picture data to computing terminal
JP2013517578A (en) Application operating method, apparatus and system
CN105095367A (en) Method and device for acquiring client data
WO2021189257A1 (en) Malicious process detection method and apparatus, electronic device, and storage medium
CN118567733B (en) Method, device and system for optimizing performance of server network card
WO2018161791A1 (en) Method and device for compressing executable file
US9152423B2 (en) Method and apparatus for efficient loop instruction execution using bit vector scanning
WO2020077765A1 (en) Webpage loading method, intermediate server, and webpage loading system
CN111124470A (en) Automatic optimization method and device for program package based on cloud platform
CN110263110A (en) Geographical spatial data loading method, equipment and storage medium based on evacuating algorithm
CN116226047A (en) A method and device for quickly reading MIR information of gzip-compressed stdf files
US12223346B2 (en) Selectively offloading the compression and decompression of files to a hardware controller
CN112732399B (en) Switching method of desktop display protocol, computing device and readable storage medium
CN108965295A (en) A kind of compressing file merging method and relevant apparatus
CN102999626B (en) A kind of data compression/decompression compression apparatus and method, system
CN112579282B (en) Data processing method, device, system, and computer-readable storage medium
CN118626171A (en) A method, device and system for loading resource files
US9325736B2 (en) Method and device for anti-virus scanning
CN102902564B (en) Method and the device of patch are installed
WO2020210955A1 (en) Application program starting method and apparatus, and electronic device and storage medium
CN114816562A (en) An iOS loading H5 page optimization method
CN115185962A (en) Data verification method, device, server and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210409

CF01 Termination of patent right due to non-payment of annual fee