WO2017181631A1 - Procédé et dispositif permettant de traiter des informations de capacité d'un fichier de projet - Google Patents

Procédé et dispositif permettant de traiter des informations de capacité d'un fichier de projet Download PDF

Info

Publication number
WO2017181631A1
WO2017181631A1 PCT/CN2016/102415 CN2016102415W WO2017181631A1 WO 2017181631 A1 WO2017181631 A1 WO 2017181631A1 CN 2016102415 W CN2016102415 W CN 2016102415W WO 2017181631 A1 WO2017181631 A1 WO 2017181631A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
tested
preset
character
capacity information
Prior art date
Application number
PCT/CN2016/102415
Other languages
English (en)
Chinese (zh)
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 北京新能源汽车股份有限公司
Publication of WO2017181631A1 publication Critical patent/WO2017181631A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • 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/13File access structures, e.g. distributed indices

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing capacity information of a project file.
  • the prior art roughly estimates the number of lines of code and the like by the size of each file given by the engineering compilation environment.
  • the method is to use the averaging principle, divide the size of a typical file by the total number of lines of the file, and get the average size of each line of code, and then divide the size of the entire project by the size of each line, you can get a rough The number of lines of code.
  • this method is more convenient than manual statistics, the accuracy is too low.
  • the present application aims to solve at least one of the technical problems in the related art to some extent.
  • the first object of the present application is to provide a capacity information processing method for a project file, which implements an adaptive identification of a project path, avoids manually adding a path to be counted, and improves the statistical granularity of the project file capacity information. Accuracy.
  • a second object of the present application is to provide a capacity information processing apparatus for a project file.
  • a third object of the invention is to propose an apparatus.
  • a fourth object of the present invention is to provide a non-volatile computer storage medium.
  • the first aspect of the present application provides a method for processing capacity information of a project file, including: traversing all files of the project to be tested, and saving the file name and file path of each file to a preset global In the variable, the file to be tested corresponding to the preset file type is obtained from the global variable; the code information of each file to be tested is detected according to the preset character feature library, and the capacity information corresponding to each file to be tested is determined.
  • the capacity information includes: the number of lines of code, the number of blank lines, and the number of comment lines.
  • the correspondence between the file name and the capacity information of each file to be tested is established according to a preset report format.
  • the capacity information processing method of the engineering file in the embodiment of the present application saves the file name and the file path of each file into a preset global variable by traversing all the files of the project to be tested, and obtains and predicts from the global variable.
  • the file to be tested corresponding to the file type; the code information of each file to be tested is detected according to the preset character feature library, and the capacity information corresponding to each file to be tested is determined, and the capacity information includes: the number of lines of code, and the space The number of rows and lines and the number of comment lines; the correspondence between the file name and the capacity information of each file to be tested is established according to the preset report format.
  • the second aspect of the present application provides a capacity information processing apparatus for a project file, including: an obtaining module, configured to traverse all files of a project to be tested, and save a file name and a file path of each file. Go to the preset global variable, and obtain a file to be tested corresponding to the preset file type from the global variable; and the detecting module is configured to detect code information of each file to be tested according to the preset character feature library, and determine The capacity information corresponding to each file to be tested, the capacity information includes: a number of code lines, a number of blank lines, and a number of comment lines; and a processing module, configured to establish a file name of each file to be tested according to a preset report format Correspondence with capacity information.
  • the capacity information processing apparatus of the project file of the embodiment of the present application saves the file name and the file path of each file into a preset global variable by traversing all the files of the project to be tested, and obtains and predicts from the global variable.
  • the file to be tested corresponding to the file type; the code information of each file to be tested is detected according to the preset character feature library, and the capacity information corresponding to each file to be tested is determined, and the capacity information includes: the number of lines of code, and the space The number of rows and lines and the number of comment lines; the correspondence between the file name and the capacity information of each file to be tested is established according to the preset report format.
  • a third aspect of the present invention provides an apparatus comprising: one or more processors; a memory; one or more programs, the one or more programs being stored in the memory when When multiple processors are executed, the following steps are performed: traversing all the files of the project to be tested, saving the file name and file path of each file to a preset global variable, and obtaining the preset file from the global variable.
  • the file to be tested corresponding to the type; detecting code information of each file to be tested according to the preset character feature library, and determining capacity information corresponding to each file to be tested, the capacity information includes: number of lines of code, number of lines of blank lines And the number of comment lines; the correspondence between the file name and the capacity information of each file to be tested is established according to a preset report format.
  • a fourth aspect of the present invention provides a non-volatile computer storage medium storing one or more programs, when the one or more programs are executed by one device, causing the device
  • the following steps are performed: traversing all the files of the project to be tested, saving the file name and file path of each file to a preset global variable, and obtaining a file to be tested corresponding to the preset file type from the global variable; Detecting code information of each file to be tested according to a preset character feature library, and determining capacity information corresponding to each file to be tested, the capacity
  • the quantity information includes: the number of code lines, the number of blank lines, and the number of comment lines; and the correspondence between the file name and the capacity information of each file to be tested is established according to a preset report format.
  • FIG. 1 is a flowchart of a method for processing capacity information of a project file according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a capacity information processing apparatus of a project file according to an embodiment of the present application.
  • FIG. 1 is a flow chart of a method for processing capacity information of a project file according to an embodiment of the present application.
  • the capacity information processing method of the project file includes:
  • Step 101 Traverse all the files of the project to be tested, save the file name and file path of each file to a preset global variable, and obtain a file to be tested corresponding to the preset file type from the global variable.
  • the file to be tested corresponding to the preset file type is obtained from the global variable.
  • preset file types for example, (.c, .h..H file), which can be set according to actual application requirements, which is not limited in this embodiment.
  • Step 102 Detect code information of each file to be tested according to a preset character feature library, and determine capacity information corresponding to each file to be tested, where the capacity information includes: number of lines of code, number of lines of blank lines, and number of comment lines .
  • a character feature library is preset, wherein the character feature library includes identification characters for identifying code lines, blank lines, and comment lines in the project file.
  • the code information of each file to be tested is detected according to a preset character feature library, and the capacity information corresponding to each file to be tested is determined by the number of matches in the code information with the preset characters in the character feature library, wherein Capacity information Including: the number of lines of code, the number of blank lines, and the number of comment lines.
  • the character feature library includes: a first character type of a blank line start character and an end character;
  • the code information of each file to be tested is detected according to the blank start and end characters in the first character type, and if the character information matching the blank start character and the end character appears, it is determined to be a blank line, and then The code information of the entire file is detected, and the number of blank lines corresponding to each file to be tested is determined.
  • the character signature library includes: a second character type of a comment start character and a terminator;
  • the code information of each file to be tested is detected according to the comment start and end characters in the second character type, and if the character information matching the comment start and end characters appears, it is determined as a comment line, and the entire file is sequentially The code information is detected to determine the number of comment lines corresponding to each file to be tested.
  • the character signature library includes: a third character type of a code start character and a terminator;
  • the code information of each file to be tested is detected, and if the character information matching the code start character and the end character appears, it is determined as a code line, and the entire file is sequentially The code information is detected to determine the number of lines of code corresponding to each file to be tested.
  • Step 103 Establish a correspondence between file names and capacity information of each file to be tested according to a preset report format.
  • the corresponding relationship between the file name and the capacity information of each file to be tested is established according to the preset report format.
  • report formats There are many types of report formats, which are not limited in this embodiment.
  • the report including the correspondence between the file name and the capacity information is saved to the preset path.
  • the capacity information processing method of the engineering file in the embodiment of the present application saves the file name and the file path of each file into a preset global variable by traversing all the files of the project to be tested, and obtains and predicts from the global variable.
  • the file to be tested corresponding to the file type; the code information of each file to be tested is detected according to the preset character feature library, and the capacity information corresponding to each file to be tested is determined, and the capacity information includes: the number of lines of code, and the space The number of rows and lines and the number of comment lines; the correspondence between the file name and the capacity information of each file to be tested is established according to the preset report format.
  • the present application also proposes a capacity information processing apparatus for a project file.
  • FIG. 2 is a schematic structural diagram of a capacity information processing apparatus of a project file according to an embodiment of the present application.
  • the capacity information processing apparatus of the project file includes:
  • the obtaining module 11 is configured to traverse all the files of the project to be tested, and save the file name and file path of each file. Go to a preset global variable, and obtain a file to be tested corresponding to the preset file type from the global variable;
  • the detecting module 12 is configured to detect code information of each file to be tested according to a preset character feature library, and determine capacity information corresponding to each file to be tested, where the capacity information includes: a number of lines of code, a number of lines of blank lines, and Number of comment lines;
  • the processing module 13 is configured to establish, according to a preset report format, a correspondence between file names and capacity information of each file to be tested.
  • a character feature library is preset, wherein the character feature library includes identification characters for identifying code lines, blank lines, and comment lines in the project file.
  • the code information of each file to be tested is detected according to a preset character feature library, and the capacity information corresponding to each file to be tested is determined by the number of matches in the code information with the preset characters in the character feature library, wherein
  • the capacity information includes: the number of lines of code, the number of blank lines, and the number of comment lines.
  • the detecting module 12 is configured to:
  • the detecting module 12 is configured to:
  • the detecting module 12 is configured to:
  • processing module 13 is further configured to:
  • the capacity information processing apparatus of the project file of the embodiment of the present application saves the file name and the file path of each file into a preset global variable by traversing all the files of the project to be tested, and obtains and predicts from the global variable.
  • the file to be tested corresponding to the file type; the code information of each file to be tested is detected according to the preset character feature library, and the capacity information corresponding to each file to be tested is determined, and the capacity information includes: the number of lines of code, and the space The number of rows and lines and the number of comment lines; the correspondence between the file name and the capacity information of each file to be tested is established according to the preset report format.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include at least one of the features, either explicitly or implicitly.
  • the meaning of "a plurality” is at least two, such as two, three, etc., unless specifically defined otherwise.
  • a "computer-readable medium” can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device.
  • computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM).
  • the computer readable medium may even be a paper or other suitable medium on which the program can be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, other suitable The method is processed to obtain the program electronically and then stored in computer memory.
  • portions of the application can be implemented in hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be used in the art.

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)
  • Stored Programmes (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

L'invention concerne un procédé et un dispositif permettant de traiter des informations de capacité d'un fichier de projet. Le procédé consiste : à parcourir tous les fichiers d'un projet à détecter, à mémoriser le nom de fichier et le chemin de fichier de chaque fichier dans une variable globale prédéfinie, et à acquérir, à partir de la variable globale, un fichier à détecter qui correspond à un type de fichier prédéfini (101) ; à détecter, en fonction d'une bibliothèque de d'attributs de caractères prédéfinie, des informations de code de chaque fichier à détecter, et à déterminer des informations de capacité correspondant à chaque fichier à détecter, les informations de capacité comprenant le nombre de rangées de code, le nombre de rangées vierges et le nombre de rangées de commentaires (102) ; et à établir, selon un format de rapport prédéfini, une correspondance entre le nom de fichier de chaque fichier à détecter et des informations de capacité (103). De cette manière, la présente invention permet une reconnaissance auto-adaptative de chemins de projet, évite d'avoir à ajouter manuellement des chemins de fichier devant subir une analyse statistique, et améliore la granularité statistique des informations de capacité d'un fichier de projet.
PCT/CN2016/102415 2016-04-19 2016-10-18 Procédé et dispositif permettant de traiter des informations de capacité d'un fichier de projet WO2017181631A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610245424.3A CN106407243A (zh) 2016-04-19 2016-04-19 工程文件的容量信息处理方法及装置
CN201610245424.3 2016-04-19

Publications (1)

Publication Number Publication Date
WO2017181631A1 true WO2017181631A1 (fr) 2017-10-26

Family

ID=58005860

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/102415 WO2017181631A1 (fr) 2016-04-19 2016-10-18 Procédé et dispositif permettant de traiter des informations de capacité d'un fichier de projet

Country Status (2)

Country Link
CN (1) CN106407243A (fr)
WO (1) WO2017181631A1 (fr)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721824A (zh) * 2021-08-10 2021-11-30 深圳市一博科技股份有限公司 一种cr5000平台一键设置库路径的方法
CN116340186A (zh) * 2023-05-25 2023-06-27 中汽研软件测评(天津)有限公司 汽车电子软件检测系统、方法及介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558571A (zh) * 2018-10-18 2019-04-02 深圳壹账通智能科技有限公司 文件容量识别方法、装置、计算机设备和存储介质
CN110427212A (zh) * 2019-07-11 2019-11-08 上海易点时空网络有限公司 适用于git的代码统计方法及装置、存储介质
CN110688320B (zh) * 2019-09-30 2023-05-23 潍柴动力股份有限公司 全局变量的检测方法、装置及终端设备
CN113609003A (zh) * 2021-07-16 2021-11-05 深圳开源互联网安全技术有限公司 代码行数统计方法、系统、终端及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5898872A (en) * 1997-09-19 1999-04-27 Tominy, Inc. Software reconfiguration engine
CN1395171A (zh) * 2001-07-06 2003-02-05 华为技术有限公司 一种计算机软件程序的代码统计工具及其实现方法
CN101582072A (zh) * 2008-05-16 2009-11-18 鸿富锦精密工业(深圳)有限公司 代码统计系统及方法
CN101963970A (zh) * 2010-01-12 2011-02-02 浪潮(山东)电子信息有限公司 一种高效率低维护的数据统计方法
CN103699637A (zh) * 2013-12-23 2014-04-02 国云科技股份有限公司 一种代码生产率统计方法及其系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309747B (zh) * 2013-05-20 2016-09-28 青岛海信传媒网络技术有限公司 一种代码文件统计任务的分配方法及装置
CN104750469B (zh) * 2013-12-30 2018-01-02 中国银联股份有限公司 源代码统计分析方法和系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5898872A (en) * 1997-09-19 1999-04-27 Tominy, Inc. Software reconfiguration engine
CN1395171A (zh) * 2001-07-06 2003-02-05 华为技术有限公司 一种计算机软件程序的代码统计工具及其实现方法
CN101582072A (zh) * 2008-05-16 2009-11-18 鸿富锦精密工业(深圳)有限公司 代码统计系统及方法
CN101963970A (zh) * 2010-01-12 2011-02-02 浪潮(山东)电子信息有限公司 一种高效率低维护的数据统计方法
CN103699637A (zh) * 2013-12-23 2014-04-02 国云科技股份有限公司 一种代码生产率统计方法及其系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721824A (zh) * 2021-08-10 2021-11-30 深圳市一博科技股份有限公司 一种cr5000平台一键设置库路径的方法
CN113721824B (zh) * 2021-08-10 2024-05-03 深圳市一博科技股份有限公司 一种cr5000平台一键设置库路径的方法
CN116340186A (zh) * 2023-05-25 2023-06-27 中汽研软件测评(天津)有限公司 汽车电子软件检测系统、方法及介质
CN116340186B (zh) * 2023-05-25 2023-09-19 中汽研软件测评(天津)有限公司 汽车电子软件检测系统、方法及介质

Also Published As

Publication number Publication date
CN106407243A (zh) 2017-02-15

Similar Documents

Publication Publication Date Title
WO2017181631A1 (fr) Procédé et dispositif permettant de traiter des informations de capacité d'un fichier de projet
US9430359B1 (en) Identifying and resolving software issues
US9135146B1 (en) Identifying and resolving software issues
US10643736B2 (en) Method, apparatus and electronic device for read/write speed testing
WO2020237508A1 (fr) Procédé et appareil de liaison de code de validation d'assertion
US20150095305A1 (en) Detecting multistep operations when interacting with web applications
WO2008088121A1 (fr) Appareil et procédé pour détecter la copie d'un programme par analyse de journaux des accès mémoire
CN110262870B (zh) 利用dump文件定位异常的方法、装置、计算机设备及存储介质
US20160314061A1 (en) Software Defect Detection Identifying Location of Diverging Paths
WO2018188222A1 (fr) Procédé et dispositif de fusion de fichier a2l
US10089213B1 (en) Identifying and resolving software issues
WO2015196962A1 (fr) Procédé et appareil permettant de détecter des données changées
US20150154103A1 (en) Method and apparatus for measuring software performance
CN106776348B (zh) 测试用例管理方法和装置
CN110704686B (zh) 半结构化数据的质量检测方法、装置、存储介质及设备
CN108133116A (zh) Cad户型图墙厚自动识别方法及系统
US8756580B2 (en) Instance-based field affinity optimization
CN107749838B (zh) 一种检测网络劫持的方法及装置
CN109710305B (zh) 一种开发信息的获取方法、装置、存储介质及终端设备
JP2020530629A (ja) データレコード内のフォーマットを動的に定義する技術
US9372949B1 (en) Guided exploration of circuit design states
WO2019047392A1 (fr) Procédé et dispositif de détermination d'essai de ligne différentielle
CN109710651B (zh) 数据类型识别方法及装置
Chen et al. CGAP-align: a high performance DNA short read alignment tool
CN108509347B (zh) 等价变异体识别方法及装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16899215

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16899215

Country of ref document: EP

Kind code of ref document: A1