WO2013097481A1 - 一种文件类型识别方法及系统 - Google Patents

一种文件类型识别方法及系统 Download PDF

Info

Publication number
WO2013097481A1
WO2013097481A1 PCT/CN2012/080831 CN2012080831W WO2013097481A1 WO 2013097481 A1 WO2013097481 A1 WO 2013097481A1 CN 2012080831 W CN2012080831 W CN 2012080831W WO 2013097481 A1 WO2013097481 A1 WO 2013097481A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
state machine
type
file type
feature
Prior art date
Application number
PCT/CN2012/080831
Other languages
English (en)
French (fr)
Inventor
阮玲宏
蒋武
李世光
王振辉
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP12863533.1A priority Critical patent/EP2746963A4/en
Publication of WO2013097481A1 publication Critical patent/WO2013097481A1/zh
Priority to US14/314,711 priority patent/US9405758B2/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation

Definitions

  • the present invention relates to the field of file type identification technology, and in particular, to a file type identification method and system. Background technique
  • network devices In network information transmission, network devices generally integrate the transmitted information into a certain file format. After the computer or other network device receives the file sent by another network device via the network, the file is generally detected. If the type of the file can be recognized and is a secure file type, the receiving network device can perform the file. Subsequent receipt and use of files. When it is recognized that the category of the file is not a secure file type, it can be handled by the police.
  • an embodiment of the present invention provides a file type identification method and system, to identify a file type more effectively, and the technical solution is as follows:
  • a file type identification method including:
  • loading the updated file type configuration file into the state machine includes: controlling the state machine to perform initialization;
  • the target program is loaded into the state machine.
  • the alarm module is controlled to perform alarm processing.
  • the file feature parameters include: a file type, and feature word information.
  • the feature word information includes: a feature word type, a feature word content, a feature word length, and a feature word offset.
  • the file type configuration file is an extensible markup language XML configuration file.
  • the modification interface is a web page or a command line interface.
  • the invention also provides a file type identification system, comprising: a modification interface providing module, a file feature parameter adding module, a configuration file loading module and a state machine,
  • the modification interface providing module is configured to provide a modification interface for updating a file feature parameter in the file type configuration file
  • the file feature parameter adding module is configured to receive a file feature parameter input by the user through the modification interface, and add the file feature parameter to the corresponding file type configuration file to obtain an updated file type configuration file;
  • the configuration file loading module is configured to load the updated file type configuration file into a state machine, so that file feature parameters in the state machine are updated, so that the state machine performs files according to the updated file feature parameters.
  • Type identification is configured to load the updated file type configuration file into a state machine, so that file feature parameters in the state machine are updated, so that the state machine performs files according to the updated file feature parameters.
  • the configuration file loading module includes: a state machine initialization submodule, a compiled submodule, and a program loading submodule.
  • the state machine initialization submodule is configured to control the state machine to perform initialization
  • the compiling submodule is configured to: after the state machine is initialized, configure the file type Set the file to compile and generate the target program;
  • the program loading submodule is configured to load the target program into the state machine.
  • the method further includes: an alarm module, configured to perform alarm processing when the file type identification of the state machine fails.
  • the present invention provides a file type identification method and system, which can provide a modification interface for a user to input file feature parameters, and add a file feature parameter input by a user to a file type configuration file, and then load to The state machine is used for identification of file types. Therefore, the user can modify the file feature parameters in the original file type configuration file.
  • the file feature parameter of a certain type of file changes or a new type file appears
  • the user can update the file feature parameter in the state machine in time. To identify the changed file or a new type of file. In this way, the user does not have to look up the recognition tool on the Internet.
  • FIG. 1 is a schematic flowchart of a file type identification method according to an embodiment of the present invention
  • FIG. 2 is a state tree according to the present disclosure
  • FIG. 3 is a schematic flowchart of another file type identification method according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a file type identification system according to an embodiment of the present invention
  • FIG. Schematic diagram of a configuration file loading module in a file type identification system
  • FIG. 6 is a schematic structural diagram of another file type identification system according to an embodiment of the present invention. detailed description
  • a file type identification method includes: S101.
  • a modification interface is provided for updating a file feature parameter in a file type configuration file.
  • the file feature parameter may include: Word information, of course, can also include an extension.
  • extension and feature word information for file type identification can improve the accuracy of recognition.
  • the recognition file extension fails or some files do not have an extension
  • a message indicating that the file type does not match the extension may be generated to prompt the user for processing.
  • the feature word information may include: a feature word type, a feature word content, a feature word length, and a feature word offset.
  • the feature word type is an encoding method that uniquely identifies the file type feature, and can generally be divided into a string and a hexadecimal.
  • the feature word content is a devil number that uniquely identifies the file type.
  • the feature word content can be a string or a hexadecimal string.
  • the feature word length is the length of the feature word content.
  • the feature word offset is the position at which the feature word appears in the file content.
  • the file type identification process if any feature word information can be matched, the type of the file may be identified.
  • file feature parameters can be mapped to file types, when compared with the first file.
  • the file feature parameter corresponding to the piece type matches the feature parameter of the identified first file
  • the first file can be identified as the first file type.
  • the modification interface may be a web page.
  • modification interface can also be a command line interface.
  • the file type configuration file saves the configuration information necessary for the system, and uses the configuration file to save the file feature parameters, and the file type identification function can be adjusted by modifying the configuration file.
  • the type of configuration file can be config file, INI file, XML file, and so on.
  • the extensible markup language XML file has clear structure, strong expressive ability, good extensibility, and convenient transmission of information between different systems. Therefore, XML files are used as configuration files of the system.
  • the type of the configuration file can be a scripting language such as Xml or html.
  • This configuration file is common to various platforms and has good portability. In terms of implementation, almost all programs can process configuration files such as xml.
  • new file type features need to be added, information is provided according to the contents of the configuration file. Without changing the code, the configuration file can be re-read and users are added. New requirements, good maintenance.
  • ⁇ Type>CAD file ⁇ /Type> type is CAD file
  • the Type field represents the file type, such as pdf, doc, ppt, CAD, etc.
  • the Extension field represents the file extension (may not be), such as .doc, .pdf, etc.
  • the Description field represents the description information
  • the CharacterList field represents a list of file characteristics
  • the CharacterType field represents the feature word type, string (string) or hexadecimal (bin); the Character field represents the content of the feature word, the content of the string type or the content of the hexadecimal string, such as:
  • the character content of the pdf file is ten Hex 0x25504446;
  • the Length field represents the length of the feature word
  • the Offset field represents the feature word offset
  • the Action field represents the response type, alarm or block, etc.
  • the state machine is a compiled data structure used to match a predefined set of patterns, which can be applied in file recognition: After loading the file feature parameters into the state machine, the state machine can be used to identify the file type, and Process according to different states. Specifically, a plurality of states may be set in the state machine of the tree structure, such that when a certain state matches the object to be matched, the state transition may be performed according to the node distribution of the state tree. As shown in FIG.
  • the state tree includes a start state 000, three final states: a fourth state 004, a fifth state 005, and a sixth state 006, and the final state is used to indicate how to handle a particular type of file, three Intermediate state: first state 001, a second state 002, and a third state 003, the intermediate state is used to indicate a file type.
  • the file feature parameter in the first state 001 is a file feature parameter of the first type file
  • the file feature parameter in the second state 002 is a file feature parameter of the second type file
  • the parameter is in the file feature parameter of the third type file.
  • the fourth state 004 is set according to the file type that the first state 001 can recognize, for example, the fourth state 004 is for issuing an alarm signal or preventing the received signal from being sent.
  • step S103 may include:
  • the initialization may include the following: pre-allocating the memory of the state machine, and setting the compilation parameters of the state machine.
  • the pre-defined set of patterns can be compiled into a data structure used to achieve matching after compilation.
  • the contents of the updated file type configuration file can be loaded into the state machine for identification of the file type.
  • the alarm module is controlled to perform alarm processing.
  • Steps S101 and S102 in the file type identification method shown in FIG. 3 are the same as steps S101 and S102 in the file type identification method shown in FIG. 1, and are not described again.
  • the invention provides a file type identification method, which can provide a modification interface for a user to input a file feature parameter, and add a file feature parameter input by a user to a file type configuration file, and then load into a state machine for file type. Identification. Therefore, the user can modify the file feature parameters in the original file type configuration file, when the file feature parameters of a certain type of file are When a new type of file is changed or appears, the user can update the file feature parameters in the state machine in time to identify the changed file or the new type file. In this way, the user does not have to look up the recognition tool on the Internet.
  • the present invention also provides a file type identification system.
  • a file type identification system provided by an embodiment of the present invention includes: a modification interface providing module 100, a file feature parameter adding module 200, a configuration file loading module 300, and a state machine 400.
  • the modification interface providing module 100 is configured to provide a modification interface for updating file feature parameters in the file type configuration file
  • the file feature parameter may include: feature word information, and of course, may also include an extension name.
  • the feature word information may include: a feature word type, a feature word content, a feature word length, and a feature word offset.
  • the modification interface may be a web page.
  • the file feature parameter adding module 200 is configured to receive a file feature parameter input by the user through the modification interface, and add the file feature parameter to the corresponding file type configuration file to obtain an updated file type configuration file;
  • the file type configuration file may be an extensible markup language XML configuration file.
  • the configuration file loading module 300 is configured to load the updated file type configuration file into the state machine 400, so that the file feature parameters in the state machine 400 are updated, so that the state machine 400 is based on the updated file feature parameters. Identify the file type.
  • the state machine is a compiled data structure used to match a predefined set of patterns and can be applied in file recognition: Once the file feature parameters are loaded into the state machine, the state machine can be used to identify the file type. Specifically, a plurality of states may be set in the state machine of the tree structure, such that when a state matches the object to be matched, the state transition may be performed according to the node distribution of the state tree.
  • the configuration file loading module 300 may include: a state machine initialization sub-module 310, a compilation sub-module 320, and a program loading sub-module 330.
  • the state machine initialization sub-module 310 is configured to control the state machine to perform initialization;
  • the compiling sub-module 320 is configured to: after the initialization of the state machine is completed, the file type The configuration file is compiled to generate a target program;
  • the program loading submodule 330 is configured to load the target program into the state machine.
  • another file type identification system provided by the embodiment of the present invention may further include: an alarm module 500, configured to perform alarm processing when the file type identification of the state machine fails.
  • the invention provides a file type identification system, which can provide a modification interface for the user to input file feature parameters, and add the file feature parameters input by the user to the file type configuration file, and then load into the state machine for file type. Identification. Therefore, the user can modify the file feature parameters in the original file type configuration file. When the file feature parameter of a certain type of file changes or a new type file appears, the user can update the file feature parameter in the state machine in time. To identify the changed file or a new type of file. This way, the user does not have to look up the recognition tool on the Internet.
  • the relevant part of the description of the method embodiment can be referred to.
  • the system embodiments described above are merely illustrative, and the components displayed for the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without undue creative labor.
  • the disclosed systems and methods may be implemented in other ways without departing from the spirit and scope of the invention.
  • the present embodiment is merely an illustrative example and should not be taken as limiting, and the specific content given should not limit the object of the present invention.
  • the division of the unit or subunit is only a logical function division, and the actual implementation may have another division manner, for example, a plurality of units or a plurality of subunits are combined.
  • multiple units may or may be combined or integrated into another system, or some features may be omitted or not implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (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

本发明公开了一种文件类型识别方法及系统,可以提供修改界面以使用户输入文件特征参数,并将用户输入的文件特征参数添加到文件类型配置文件中,然后加载到状态机中以进行文件类型的识别。因此,用户可以对原有的文件类型配置文件中的文件特征参数进行修改,当某类型文件的文件特征参数出现更改或出现新类型文件时,用户就可以及时的更新状态机中的文件特征参数,以对更改后的文件或新类型文件进行识别。这样,用户就不用在互联网上进行识别工具的查找。

Description

一种文件类型识别方法及系统
本申请要求于 2011年 12月 31 日提交中国专利局, 申请号为
201110459487.6, 发明名称为 "一种文件类型识别方法及系统" 的中国专利申 请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及文件类型识别技术领域, 特别是涉及一种文件类型识别方法 及系统。 背景技术
随着网络的发展, 人们越来越多的使用网络进行信息的传输, 这也带来 了使用网络进行信息传输的安全问题。
在网络信息传输中, 网络设备一般将所传输的信息整合成某种文件格式。 在计算机或其他网络设备接收到另一网络设备经网络发送的文件后, 一般会 对该文件进行检测, 如果该文件的类型能够识别, 且是安全的文件类型, 那 么接收端网络设备就可以进行文件的后续接收和使用。 当识别出该文件的类 别不属于安全的文件类型时, 就可以进行 警等处理。
然而, 当网络所传输的文件类型无法被识别时, 用户需要从互联网上查 找能够识别该类文件类型的工具, 较为繁瑣且成功率低。 并且, 现有的安全 机制下, 为了尽可能的保护网络设备的安全, 一般将无法识别的文件类型也 作为不安全文件来进行处理, 导致部分安全信息, 由于无法识别文件类型, 而无法接收。 发明内容
为解决上述技术问题, 本发明实施例提供一种文件类型识别方法及系统, 以更有效的识别文件类型, 技术方案如下:
一种文件类型识别方法, 包括:
提供用于更新文件类型配置文件中文件特征参数的修改界面;
接收用户通过所述修改界面输入的文件特征参数并添加到相应的文件类 型配置文件中, 得到更新后的文件类型配置文件; 将所述更新后的文件类型配置文件加载到状态机中, 使状态机中的文件 特征参数得到更新, 以
Figure imgf000004_0001
型的识别。
优选的, 将所述更新后的文件类型配置文件加载到状态机中, 包括: 控制所述状态机进行初始化;
所述状态机初始化完成后, 对所述文件类型配置文件进行编译, 生成目 标程序;
将所述目标程序加载到所述状态机中。
优选的, 当所述状态机的文件类型识别失败时, 控制报警模块进行报警 处理。
优选的, 所述文件特征参数包括: 文件类型、 和特征字信息。
优选的, 所述特征字信息包括: 特征字类型、 特征字内容、 特征字长度 和特征字偏移量。
优选的, 所述文件类型配置文件为可扩展标记语言 XML配置文件。 优选的, 所述修改界面为 Web页面或者命令行界面。
本发明还提供了一种文件类型识别系统, 包括: 修改界面提供模块、 文 件特征参数添加模块、 配置文件加载模块和状态机,
所述修改界面提供模块, 用于提供用于更新文件类型配置文件中文件特 征参数的修改界面;
所述文件特征参数添加模块, 用于接收用户通过所述修改界面输入的文 件特征参数并添加到相应的文件类型配置文件中, 得到更新后的文件类型配 置文件;
所述配置文件加载模块, 用于将所述更新后的文件类型配置文件加载到 状态机中, 使状态机中的文件特征参数得到更新, 以便所述状态机根据更新 后的文件特征参数进行文件类型的识别。
优选的, 所述配置文件加载模块包括: 状态机初始化子模块、 编译子模 块和程序加载子模块,
所述状态机初始化子模块, 用于控制所述状态机进行初始化;
所述编译子模块, 用于在所述状态机初始化完成后, 对所述文件类型配 置文件进行编译, 生成目标程序;
所述程序加载子模块, 用于将所述目标程序加载到所述状态机中。
优选的, 还包括: 报警模块, 用于当所述状态机的文件类型识别失败时, 进行报警处理。
通过应用以上技术方案, 本发明提供的一种文件类型识别方法及系统, 可以提供修改界面以使用户输入文件特征参数, 并将用户输入的文件特征参 数添加到文件类型配置文件中, 然后加载到状态机中以进行文件类型的识别。 因此, 用户可以对原有的文件类型配置文件中的文件特征参数进行修改, 当 某类型文件的文件特征参数出现更改或出现新类型文件时, 用户就可以及时 的更新状态机中的文件特征参数, 以对更改后的文件或新类型文件进行识别。 这样, 用户就不用在互联网上进行识别工具的查找。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明中记载的一些实施例, 对于本领域普通技术人员 来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例提供的一种文件类型识别方法的流程示意图; 图 2为本发明公开的一种状态树;
图 3为本发明实施例提供的另一种文件类型识别方法的流程示意图; 图 4为本发明实施例提供的一种文件类型识别系统的结构示意图; 图 5 为本发明实施例提供的另一种文件类型识别系统中配置文件加载模 块的结构示意图;
图 6为本发明实施例提供的另一种文件类型识别系统的结构示意图。 具体实施方式
为了使本技术领域的人员更好地理解本发明中的技术方案, 下面将结合 本发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施 例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动前 提下所获得的所有其他实施例, 都应当属于本发明保护的范围。
如图 1所示, 本发明实施例提供的一种文件类型识别方法, 包括: S101、 提供用于更新文件类型配置文件中文件特征参数的修改界面; 其中, 所述文件特征参数可以包括: 特征字信息, 当然也可以包括扩展 名。
容易理解的是, 大部分的文件类型都可以根据文件的扩展名进行识别, 如 Word文件的扩展名为 ".doc"。 使用扩展名进行文件类型的识别较为简单, 但同时也存在准确性低的问题。 可以理解的是, 很多文件的扩展名都是可以 进行修改的。 当某文件的扩展名被刻意修改为与该文件实际类型不符的类型 后, 如果仅以扩展名进行文件类型的识别, 将识别该文件的类型为与该文件 实际类型不符的类型, 这样在后续的文件使用中将带来很多的问题。 举例来 说, 将 Word文件的扩展名 ".doc" 修改为图像文件格式 "jpg" , 这样电子设 备将识别该文件为图像文件并默认使用图像软件进行打开, 于是造成文件打 开的失败。 因此, 同时使用扩展名和特征字信息进行文件类型的识别可以提 高识别的准确性。 当然, 当识别文件扩展名失败或某些文件不具有扩展名时, 也可以仅使用特征字信息进行文件类型的识别。 当然, 在考虑到扩展名识别 准确性低的情况下, 也可以不使用扩展名进行文件类型的识别或将扩展名识 别作为对使用特征字信息进行文件类型识别的校验。 当使用特征字信息识别 出的文件类型与使用扩展名识别出的文件类型不符时, 可以产生一个告知文 件类型与扩展名不符的信息, 以提示用户进行处理。
其中, 所述特征字信息可以包括: 特征字类型、 特征字内容、 特征字长 度和特征字偏移量。
需要说明的是, 特征字类型是唯一标识文件类型特征的编码方式, 一般 可以分为字符串和十六进制。 特征字内容是唯一标识文件类型的魔鬼数字, 根据特征字类型, 特征字内容可以为字符串或 16进制串。 特征字长度是特征 字内容的长度。 特征字偏移量为特征字出现在文件内容中的位置。
其中, 特征字信息可以有多个, 在文件类型识别过程中, 如果可以匹配 到任意个特征字信息, 则可识别出该文件的类型。
在实际应用中, 可以将文件特征参数与文件类型进行对应, 当与第一文 件类型对应的文件特征参数与所识别的第一文件的特征参数相匹配时, 就可 以识别该第一文件为第一文件类型。 当然, 将文件类型作为文件特征参数的 一部分输入文件类型配置文件中也是可以的。
其中, 所述修改界面可以为 Web页面。
在实际应用中, 用户一般习惯通过 Web页面对系统进行配置, 将当前的 文件类型配置文件以一定的方式格式化, 通过 Web的方式呈现, 将使配置变 得直观、 易理解, 操作起来也很方便、 简单。
当然, 所述修改界面也可以为命令行界面。
通过命令输入界面进行修改时, 可针对性的直接选择需要修改的文件类 型, 或者某个文件类型的某种特征字信息进行修改, 操作直接快速、 针对性 强。
S102、 接收用户通过所述修改界面输入的文件特征参数并添加到相应的 文件类型配置文件中, 得到更新后的文件类型配置文件;
其中, 所述文件类型配置文件中保存系统必需的配置信息, 使用配置文 件保存文件特征参数, 通过修改配置文件就可以调整文件类型识别功能的准 确性。
配置文件的类型可以为 config文件、 INI文件、 XML文件等等。 其中, 可扩展标记语言 XML文件结构清晰、 表达能力强, 有良好的可扩展性, 方便 于不同系统之间信息的传输, 所以釆用 XML文件作为本系统的配置文件。
容易理解的是, 配置文件的类型可以为 Xml、 html等脚本语言, 这种配 置文件各种平台通用, 可移植性好。 在实现上, 几乎所有的程序都能处理 xml 这样的配置文件, 当需要增加新的文件类型特征时, 按照配置文件的内容提 供信息, 不需要更改代码, 就可以重新读取配置文件, 增加用户新的需求, 维护性好。
为方便理解, 下面公开一种 XML配置文件中的内容:
<File>
<Type>CAD文件 </Type> 类型为 CAD文件
<Extension> . dwg</Extension> 扩展名为 . dwg
<Description>CAD文件 </Description> 描述信息为 "CAD文件" <CharacterList> 文件特征列表为以下内容
<CharacterType> bin </CharacterType> 特征字类型为十六进制
<Character>0x4D534346</Character> 特征字内容为 0x4D534346
<Length>4</Length> 征字长度为 4字节
<Offset>0</Offset> 特征字偏移量为 0
</CharacterList> 文件列表结束
<Action>block</Action> 响应类型为阻断
</File>
其中:
Type字段代表文件类型, 如 pdf、 doc、 ppt、 CAD等;
Extension字段代表文件扩展名 (可以没有), 如. doc、 .pdf等;
Description字段代表描述信息;
CharacterList字段代表文件特征列表;
CharacterType字段代表特征字类型, 字符串 ( string )或十六进制( bin ); Character字段代表特征字内容, string类型的内容或 16进制串的内容, 如: pdf文件的特征字内容为十六进制 0x25504446;
Length字段代表特征字长度;
Offset字段代表特征字偏移量;
Action字段代表响应类型, 告警(alert )或阻断 (block )等;
S103、 将所述更新后的文件类型配置文件加载到状态机中, 使状态机中 的文件特征参数得到更新, 以便所述状态机根据更新后的文件特征参数进行 文件类型的识别。
状态机是一种编译后的用来匹配预定义的模式集合的数据结构, 可以在 文件识别中应用: 将文件特征参数加载到状态机中后, 就可以使用状态机进 行文件类型的识别, 并根据不同的状态进行处理。 具体的, 可以在树状结构 的状态机中设置多个状态, 具这样当某一状态与所要匹配的对象匹配时, 就 可以按照状态树的节点分布进行状态转移。 如图 2 所示, 该状态树包括一开 始状态 000, 三个最终状态: 第四状态 004、 第五状态 005和第六状态 006, 最终状态用于指示对于特定类型文件的处理方式, 三个中间状态: 第一状态 001、 第二状态 002和第三状态 003 , 中间状态用于指示文件类型。 举例来说, 第一状态 001 中的文件特征参数为第一类型文件的文件特征参数; 第二状态 002中的文件特征参数为第二类型文件的文件特征参数;第三状态 003中的文 件特征参数为第三类型文件的文件特征参数中。 当电子设备所要识别的文件 为第一类型文件时, 第一状态 001 中的文件特征参数会与第一类型文件的文 件特征参数相匹配, 于是识别出所要识别的文件为第一类型文件, 第一状态
001向最终状态第四状态 004转移。 其中, 第四状态 004根据第一状态 001所 可以识别的文件类型进行设置, 如: 第四状态 004 为报警信号的发出或阻止 接收的信号发出等。
如图 3所示,本发明实施例提供的另一种文件类型识别方法中,步骤 S103 可以包括:
S201、 控制所述状态机进行初始化;
具体的, 初始化可以包括如下内容: 预先分配状态机的内存、 设置状态 机的编译参数。
5202、 所述状态机初始化完成后, 对所述文件类型配置文件进行编译, 生成目标程序;
其中, 编译后可以将预先定义好的模式集合编译成用来实现匹配的数据 结构。
5203、 将所述目标程序加载到所述状态机中。
这样, 更新后的文件类型配置文件中的内容就可以加载到状态机中, 从 而用于文件类型的识别。
其中, 当所述状态机的文件类型识别失败时, 控制报警模块进行报警处 理。
图 3所示的一种文件类型识别方法中步骤 S101和 S102和图 1所示的一 种文件类型识别方法中步骤 S101和步骤 S102相同, 不再累述。
本发明提供的一种文件类型识别方法, 可以提供修改界面以使用户输入 文件特征参数, 并将用户输入的文件特征参数添加到文件类型配置文件中, 然后加载到状态机中以进行文件类型的识别。 因此, 用户可以对原有的文件 类型配置文件中的文件特征参数进行修改, 当某类型文件的文件特征参数出 现更改或出现新类型文件时, 用户就可以及时的更新状态机中的文件特征参 数, 以对更改后的文件或新类型文件进行识别。 这样, 用户就不用在互联网 上进行识别工具的查找。
相应于上面的方法实施例, 本发明还提供一种文件类型识别系统。
如图 4所示, 本发明实施例提供的的一种文件类型识别系统, 包括: 修 改界面提供模块 100、 文件特征参数添加模块 200、 配置文件加载模块 300和 状态机 400,
修改界面提供模块 100,用于提供用于更新文件类型配置文件中文件特征 参数的修改界面;
其中, 所述文件特征参数可以包括: 特征字信息, 当然, 也可以包括扩 展名。 其中, 所述特征字信息可以包括: 特征字类型、 特征字内容、 特征字 长度和特征字偏移量。 其中, 所述修改界面可以为 Web页面。
文件特征参数添加模块 200 ,用于接收用户通过所述修改界面输入的文件 特征参数并添加到相应的文件类型配置文件中, 得到更新后的文件类型配置 文件;
其中, 所述文件类型配置文件可以为可扩展标记语言 XML配置文件。 配置文件加载模块 300,用于将所述更新后的文件类型配置文件加载到状 态机 400中,使状态机 400中的文件特征参数得到更新, 以便所述状态机 400 根据更新后的文件特征参数进行文件类型的识别。
状态机是一种编译后的用来匹配预定义的模式集合的数据结构, 可以在 文件识别中应用: 将文件特征参数加载到状态机中后, 就可以使用状态机进 行文件类型的识别。 具体的, 可以在树状结构的状态机中设置多个状态, 具 这样当某一状态与所要匹配的对象匹配时, 就可以按照状态树的节点分布进 行状态转移。
如图 5 所示, 本发明实施例提供的另一种文件类型识别系统中, 所述配 置文件加载模块 300可以包括: 状态机初始化子模块 310、 编译子模块 320和 程序加载子模块 330 ,
所述状态机初始化子模块 310, 用于控制所述状态机进行初始化; 所述编译子模块 320 , 用于在所述状态机初始化完成后,对所述文件类型 配置文件进行编译, 生成目标程序;
所述程序加载子模块 330 , 用于将所述目标程序加载到所述状态机中。 如图 6所示, 本发明实施例提供的另一种文件类型识别系统还可以包括: 报警模块 500 , 用于当所述状态机的文件类型识别失败时, 进行报警处理。
本发明提供的一种文件类型识别系统, 可以提供修改界面以使用户输入 文件特征参数, 并将用户输入的文件特征参数添加到文件类型配置文件中, 然后加载到状态机中以进行文件类型的识别。 因此, 用户可以对原有的文件 类型配置文件中的文件特征参数进行修改, 当某类型文件的文件特征参数出 现更改或出现新类型文件时, 用户就可以及时的更新状态机中的文件特征参 数, 以对更改后的文件或新类型文件进行识别。 这样, 用户就不用在互联网 上进行识别工具的查找。
对于系统实施例而言, 由于其基本相应于方法实施例, 所以相关之处参 见方法实施例的部分说明即可。 以上所描述的系统实施例仅仅是示意性的, 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或 者全部模块来实现本实施例方案的目的。 本领域普通技术人员在不付出创造 性劳动的情况下, 即可以理解并实施。
在本发明所提供的几个实施例中, 应该理解到, 所揭露的系统和方法, 在没有超过本发明的精神和范围内, 可以通过其他的方式实现。 当前的实施 例只是一种示范性的例子, 不应该作为限制, 所给出的具体内容不应该限制 本发明的目的。 例如, 所述单元或子单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另外的划分方式, 例如多个单元或多个子单元结合一起。 另外, 多个单元可以或组件可以结合或者可以集成到另一个系统, 或一些特 征可以忽略, 或不执行。
另外, 所描述系统和方法以及不同实施例的示意图, 在不超出本发明的 范围内, 可以与其它系统, 模块, 技术或方法结合或集成。 另一点, 所显示 或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口, 装置 或单元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。 以上所述仅是本发明的优选实施方式, 应当指出, 对于本技术领域的普 通技术人员来说, 在不脱离本发明原理的前提下, 还可以做出若干改进和润 饰, 这些改进和润饰也应视为本发明的保护范围。

Claims

权 利 要 求
1、 一种文件类型识别方法, 其特征在于, 包括:
提供用于更新文件类型配置文件中文件特征参数的修改界面;
接收用户通过所述修改界面输入的文件特征参数并添加到相应的文件类 型配置文件中, 得到更新后的文件类型配置文件;
将所述更新后的文件类型配置文件加载到状态机中, 使状态机中的文件 型的识别。
2、 根据权利要求 1所述的方法, 其特征在于, 将所述更新后的文件类型 配置文件加载到状态机中, 包括:
控制所述状态机进行初始化;
所述状态机初始化完成后, 对所述文件类型配置文件进行编译, 生成目 标程序;
将所述目标程序加载到所述状态机中。
3、 根据权利要求 1所述的方法, 其特征在于, 当所述状态机的文件类型 识别失败时, 控制报警模块进行报警处理。
4、 根据权利要求 1所述的方法, 其特征在于, 所述文件特征参数包括: 文件类型、 和特征字信息。
5、 根据权利要求 4所述的方法, 其特征在于, 所述特征字信息包括: 特 征字类型、 特征字内容、 特征字长度和特征字偏移量。
6、 根据权利要求 1所述的方法, 其特征在于, 所述文件类型配置文件为 可扩展标记语言 XML配置文件。
7、根据权利要求 1所述的方法, 其特征在于, 所述修改界面为 Web页面 或者命令行界面。
8、 一种文件类型识别系统, 其特征在于, 包括: 修改界面提供模块、 文 件特征参数添加模块、 配置文件加载模块和状态机,
所述修改界面提供模块, 用于提供用于更新文件类型配置文件中文件特 征参数的修改界面; 所述文件特征参数添加模块, 用于接收用户通过所述修改界面输入的文 件特征参数并添加到相应的文件类型配置文件中, 得到更新后的文件类型配 置文件;
所述配置文件加载模块, 用于将所述更新后的文件类型配置文件加载到 状态机中, 使状态机中的文件特征参数得到更新, 以便所述状态机根据更新 后的文件特征参数进行文件类型的识别。
9、 根据权利要求 8所述的系统, 其特征在于, 所述配置文件加载模块包 括: 状态机初始化子模块、 编译子模块和程序加载子模块,
所述状态机初始化子模块, 用于控制所述状态机进行初始化;
所述编译子模块, 用于在所述状态机初始化完成后, 对所述文件类型配 置文件进行编译, 生成目标程序;
所述程序加载子模块, 用于将所述目标程序加载到所述状态机中。
10、 根据权利要求 8所述的系统, 其特征在于, 还包括: 报警模块, 用 于当所述状态机的文件类型识别失败时, 进行报警处理。
PCT/CN2012/080831 2011-12-31 2012-08-31 一种文件类型识别方法及系统 WO2013097481A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP12863533.1A EP2746963A4 (en) 2011-12-31 2012-08-31 METHOD AND SYSTEM FOR IDENTIFYING FILE TYPES
US14/314,711 US9405758B2 (en) 2011-12-31 2014-06-25 Method and system for identifying file type

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110459487.6 2011-12-31
CN201110459487.6A CN103383681B (zh) 2011-12-31 2011-12-31 一种文件类型识别方法及系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/314,711 Continuation US9405758B2 (en) 2011-12-31 2014-06-25 Method and system for identifying file type

Publications (1)

Publication Number Publication Date
WO2013097481A1 true WO2013097481A1 (zh) 2013-07-04

Family

ID=48696320

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/080831 WO2013097481A1 (zh) 2011-12-31 2012-08-31 一种文件类型识别方法及系统

Country Status (4)

Country Link
US (1) US9405758B2 (zh)
EP (1) EP2746963A4 (zh)
CN (1) CN103383681B (zh)
WO (1) WO2013097481A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544032A (zh) * 2013-09-11 2014-01-29 深圳市共进电子股份有限公司 一种嵌入式设备配置文件升级方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701821B (zh) * 2013-12-31 2017-07-28 北京网康科技有限公司 文件类型识别方法及装置
CN104252531B (zh) * 2014-09-11 2017-12-08 北京优特捷信息技术有限公司 一种文件类型识别方法及装置
CN111382621A (zh) * 2018-12-28 2020-07-07 北大方正集团有限公司 参数调整方法和装置
US11341575B1 (en) 2019-02-11 2022-05-24 Morgan Stanley Services Group Inc. Meta data driven state transition engine for order management system
US10951737B1 (en) 2019-04-09 2021-03-16 Morgan Stanley Services Group Inc. Mainframe service request orchestrator and multiplexer
US10867351B1 (en) 2019-06-24 2020-12-15 Morgan Stanley Services Group Inc. Metadata-driven rules processing engine for order management system
CN114281782A (zh) * 2021-12-08 2022-04-05 奇安信科技集团股份有限公司 文件类型的识别方法、装置及电子设备
CN115374075B (zh) * 2022-08-01 2023-09-01 北京明朝万达科技股份有限公司 一种文件类型识别方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070901A1 (en) * 2008-09-16 2010-03-18 James Skinner Systems and Methods for In-Line Viewing of Multiple File Types over a Network Using a Single Player
CN101770470A (zh) * 2008-12-31 2010-07-07 中国银联股份有限公司 一种文件类型识别分析方法及系统
JP2011138189A (ja) * 2009-12-25 2011-07-14 Lac Co Ltd 通信装置及びプログラム

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6751753B2 (en) * 2001-02-27 2004-06-15 Sun Microsystems, Inc. Method, system, and program for monitoring system components
US9378472B2 (en) * 2008-12-22 2016-06-28 Adobe Systems Incorporated Systems and methods for enabling and configuring tracking of user interactions on computer applications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070901A1 (en) * 2008-09-16 2010-03-18 James Skinner Systems and Methods for In-Line Viewing of Multiple File Types over a Network Using a Single Player
CN101770470A (zh) * 2008-12-31 2010-07-07 中国银联股份有限公司 一种文件类型识别分析方法及系统
JP2011138189A (ja) * 2009-12-25 2011-07-14 Lac Co Ltd 通信装置及びプログラム

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
See also references of EP2746963A4 *
ZHANG, RUNFENG.: "Recognizing and Matching of File Type based on Identifiers.", COMPUTER SECURITY, 2011, pages 40 - 42, XP008171235 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544032A (zh) * 2013-09-11 2014-01-29 深圳市共进电子股份有限公司 一种嵌入式设备配置文件升级方法

Also Published As

Publication number Publication date
US20140310322A1 (en) 2014-10-16
EP2746963A1 (en) 2014-06-25
CN103383681B (zh) 2016-12-07
CN103383681A (zh) 2013-11-06
EP2746963A4 (en) 2014-09-24
US9405758B2 (en) 2016-08-02

Similar Documents

Publication Publication Date Title
WO2013097481A1 (zh) 一种文件类型识别方法及系统
EP2682863B1 (en) Installing applications remotely
CN111414407A (zh) 数据库的数据查询方法、装置、计算机设备及存储介质
EP3764220B1 (en) Automatic application updates
US9003001B2 (en) Bios parameter virtualization via BIOS configuration profiles
US20170083495A1 (en) Method for Modifying Webpage and Apparatus for Modifying Webpage
CN109391673A (zh) 一种管理更新文件的方法、系统及终端设备
US20210006643A1 (en) Information display method, terminal, and server
CN110865834A (zh) 应用程序界面更新方法、装置、可读存储介质及终端设备
WO2012129684A1 (en) Transforming http requests into web services trust messages for security processing
JP2014203138A (ja) 電子装置、検証方法及び検証プログラム
CN110968367A (zh) 一种电商商品字段配置方法、装置、服务器及存储介质
KR101844512B1 (ko) 어플리케이션 이용 방법, 그를 이용한 게이트웨이, 그를 이용한 단말기, 및 그를 이용한 통신 시스템
KR102506155B1 (ko) 전자장치, 어플리케이션 실행 시스템 및 그 제어방법
US9471587B2 (en) Remote enumeration of a directory
JP6259919B2 (ja) サーバとセキュアエレメント間の通信方法
JP2016526746A (ja) データ処理システム、センタ装置、及びプログラム
CN111352357B (zh) 机器人的控制方法、装置及终端设备
US9552078B2 (en) Safety navigation device and an executing method thereof
JP2009145969A (ja) 設定情報設定システムおよび設定情報設定方法
US8527580B2 (en) Saving multiple data items using partial-order planning
CN113779468B (zh) 用于处理页面接口数据的方法和装置
JP6221869B2 (ja) 画面遷移制御方法、画面遷移制御プログラムおよび画面遷移制御装置
WO2023093544A1 (zh) 一种yang模型文件的管理方法、装置及系统
US20230004379A1 (en) Service method for head unit software, head unit software and related devices

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12863533

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2012863533

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE