发明名称 Method and system for identifying file type
摘要 A method and a system for identifying a file type. A modification interface may be provided so that a user inputs a file feature parameter, and the file feature parameter input by the user is added to a file type configuration file, then the file type configuration file is loaded to a state machine to perform file type identification. Therefore, the user can modify a file feature parameter in the original file type configuration file, and when a file feature parameter of a file of a certain type is changed or a file of a new type appears, the user can update a file feature parameter in the state machine in time to identify the changed file or the file of the new type. In this way, the user does not need to search for an identification tool on the Internet.
申请公布号 US9405758(B2) 申请公布日期 2016.08.02
申请号 US201414314711 申请日期 2014.06.25
申请人 Huawei Technologies Co., Ltd. 发明人 Ruan Linghong;Jiang Wu;Li Shiguang;Wang Zhenhui
分类号 G06F17/30 主分类号 G06F17/30
代理机构 Conley Rose, P.C. 代理人 Conley Rose, P.C. ;Rodolph Grant
主权项 1. A method for identifying a file type, comprising: providing a modification interface, wherein the modification interface is used to receive a file feature parameter input by a user, wherein the file feature parameter corresponds to a first file type and comprises the first file type and feature field information, wherein the feature field information comprises a feature field type, feature field content, a feature field length, and a feature field offset, wherein the feature field type is a coding mode which is classified into a character string and a hexadecimal system, wherein the feature field content is a manic number that uniquely identifies the first file type, and wherein the feature field offset is a position at which a feature field appears in file content; adding the file feature parameter to a file type configuration file for identifying a file of the first file type to obtain an updated file type configuration file, wherein the file feature parameter is input by a user by using the modification interface; loading the updated file type configuration file to a state machine to cause a file feature parameter in the state machine to be updated; receiving a first file; performing file type identification for the first file using the state machine; and identifying a file type of the first file as the first file type when the file feature parameter in a state of the state machine matches a feature parameter of the first file, wherein the state of the state machine indicates the first file type.
地址 Shenzhen CN