[go: up one dir, main page]

CN113495753A - Project label acquisition method and device, electronic equipment and storage medium - Google Patents

Project label acquisition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113495753A
CN113495753A CN202110765576.7A CN202110765576A CN113495753A CN 113495753 A CN113495753 A CN 113495753A CN 202110765576 A CN202110765576 A CN 202110765576A CN 113495753 A CN113495753 A CN 113495753A
Authority
CN
China
Prior art keywords
level
annotation information
project
label
tag
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
CN202110765576.7A
Other languages
Chinese (zh)
Other versions
CN113495753B (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110765576.7A priority Critical patent/CN113495753B/en
Publication of CN113495753A publication Critical patent/CN113495753A/en
Application granted granted Critical
Publication of CN113495753B publication Critical patent/CN113495753B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Library & Information Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本公开提供了一种项目的标签获取方法、装置、电子设备及存储介质,涉及数据管理领域,尤其涉及项目的标签管理领域。具体实现方案为:从项目文件中解析出注释信息,其中,项目文件包括至少一个项目,注释信息用于描述项目的标签内容、且被预先添加在项目文件中;从注释信息中确定出至少一个项目的标签;按照预设数据格式记录至少一个项目的标签。由于任何计算机语言类型的项目的项目文件都可以允许添加注释信息,因此上述标签获取方法可以为任一类型的项目打标签;而且,注释信息所描述的标签内容的类型可以不受限制,因此上述标签获取方法可以为项目打多种类型的标签。

Figure 202110765576

The present disclosure provides a method, device, electronic device and storage medium for obtaining a label of a project, which relate to the field of data management, and in particular, to the field of project label management. The specific implementation scheme is: parsing the annotation information from the project file, wherein the project file includes at least one item, the annotation information is used to describe the label content of the project, and is pre-added in the project file; and at least one item is determined from the annotation information. The label of the project; the label of at least one project is recorded according to the preset data format. Since the project file of any computer language type project can allow adding annotation information, the above label acquisition method can label any type of project; moreover, the type of label content described by the annotation information can be unlimited, so the above The label get method can label items with various types of labels.

Figure 202110765576

Description

项目的标签获取方法、装置、电子设备及存储介质Project label acquisition method, device, electronic device and storage medium

技术领域technical field

本公开涉及数据管理领域,尤其涉及标签管理领域。The present disclosure relates to the field of data management, and in particular, to the field of label management.

背景技术Background technique

对一些项目打标签有助于实现对项目这些项目的科学管理,在现有技术中,通常是利用项目与项目对应的打标签程序来自动地为项目打标签。然而,现有的打标签程序所打的标签的类型较少,标签类型的范围存在较大的约束;而且,部分计算机语言类型的项目并不具备对应的打标签程序,导致这部分计算机语言类型的项目无法被自动打标签。Labeling some items is helpful to realize the scientific management of these items. In the prior art, the items are usually automatically tagged by using a tagging program corresponding to the item. However, the existing labeling programs have fewer types of labels, and the scope of labeling types has greater constraints; moreover, some projects of computer language types do not have corresponding labeling programs, resulting in some computer language types. Items cannot be automatically tagged.

发明内容SUMMARY OF THE INVENTION

本公开提供了一种项目的标签获取方法、装置、电子设备及存储介质。The present disclosure provides a method, device, electronic device, and storage medium for obtaining a tag of an item.

根据本公开的一方面,提供了一种项目的标签获取方法,包括:According to an aspect of the present disclosure, there is provided a method for obtaining a tag of an item, including:

从项目文件中解析出注释信息,其中,所述项目文件包括至少一个项目,所述注释信息用于描述项目的标签内容、且被预先添加在所述项目文件中;Parse the annotation information from the project file, wherein the project file includes at least one item, and the annotation information is used to describe the label content of the project and is pre-added in the project file;

从所述注释信息中确定出所述至少一个项目的标签;determining the label of the at least one item from the annotation information;

按照预设数据格式记录所述至少一个项目的标签。The label of the at least one item is recorded according to a preset data format.

根据本公开的另一方面,提供了一种项目的标签获取装置,包括:According to another aspect of the present disclosure, there is provided a tag acquisition device for an item, comprising:

注释解析模块,用于从项目文件中解析出注释信息,其中,所述项目文件包括至少一个项目,所述注释信息用于描述项目的标签内容、且被预先添加在所述项目文件中;An annotation parsing module, configured to parse out annotation information from a project file, wherein the project file includes at least one item, and the annotation information is used to describe the label content of the project and is pre-added in the project file;

标签确定模块,用于从所述注释信息中确定出所述至少一个项目的标签;A label determination module, configured to determine the label of the at least one item from the annotation information;

标签记录模块,用于按照预设数据格式记录所述至少一个项目的标签。评价值提取模块,用于从资源生产方所生产的历史资源中,提取出多个预设的可评价事件中每个可评价事件的评价值,所述多个可评价事件至少包括基于历史资源的特征的可评价事件、基于历史资源的用户反馈的可评价事件;The label recording module is configured to record the label of the at least one item according to a preset data format. The evaluation value extraction module is used to extract the evaluation value of each evaluable event in a plurality of preset evaluable events from the historical resources produced by the resource producer, and the plurality of evaluable events at least include historical resources based on Evaluable events based on characteristics of , and evaluable events based on user feedback from historical resources;

目标评价值计算模块,用于基于所述多个预设的可评价事件中每个可评价事件的评价值,计算出所述历史资源的目标评价值;a target evaluation value calculation module, configured to calculate the target evaluation value of the historical resource based on the evaluation value of each evaluable event in the plurality of preset evaluable events;

资源质量确定模块,用于基于所述目标评价值确定所述历史资源的质量等级。A resource quality determination module, configured to determine the quality level of the historical resource based on the target evaluation value.

根据本公开的另一方面,提供了一种电子设备,包括:According to another aspect of the present disclosure, there is provided an electronic device, comprising:

至少一个处理器;以及at least one processor; and

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的项目的标签获取方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described method for obtaining a tag of an item.

根据本公开的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行上述的项目的标签获取方法。According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the above-described method for obtaining a tag of an item.

根据本公开的另一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现上述的项目的标签获取方法。According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program that, when executed by a processor, implements the above-described method for obtaining a tag of an item.

应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or critical features of embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.

本公开提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solutions provided by the present disclosure are:

本公开实施提供的方案,允许预先在项目文件中添加用于描述项目的标签内容的注释信息,在需要为项目打标签时,通过解析注释信息即可获取到每个项目的标签。由于任何计算机语言类型的项目的项目文件都可以允许添加注释信息,因此上述标签获取方法可以为任一类型的项目打标签,使得该标签获取方法具有较高的普适性;而且,注释信息所描述的标签内容的类型可以不受限制,因此上述标签获取方法可以为项目打多种类型的标签,增加了项目的标签丰富度。The solution provided by the implementation of the present disclosure allows adding annotation information for describing the label content of the project in advance in the project file. When the project needs to be labeled, the label of each project can be obtained by parsing the annotation information. Since the project file of any computer language type project can allow adding annotation information, the above-mentioned tag acquisition method can tag any type of project, so that the tag acquisition method has high universality; The type of the described tag content can be unlimited, so the above tag acquisition method can tag the item with various types of tags, which increases the tag richness of the item.

附图说明Description of drawings

附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used for better understanding of the present solution, and do not constitute a limitation to the present disclosure. in:

图1示出了本公开实施例提供的一种项目的标签获取方法的流程示意图;1 shows a schematic flowchart of a method for obtaining a label of an item provided by an embodiment of the present disclosure;

图2示出了本公开实施例提供的另一种项目的标签获取方法的流程示意图;FIG. 2 shows a schematic flowchart of another method for obtaining a label of an item provided by an embodiment of the present disclosure;

图3示出了本公开实施例提供的一种项目文件的部分内容示意图;FIG. 3 shows a schematic diagram of partial content of a project file provided by an embodiment of the present disclosure;

图4示出了本公开实施例提供的一种项目的标签获取装置的结构示意图之一;FIG. 4 shows one of the schematic structural diagrams of a device for obtaining a label of an item provided by an embodiment of the present disclosure;

图5示出了本公开实施例提供的一种项目的标签获取装置的结构示意图之二;FIG. 5 shows the second schematic structural diagram of a device for obtaining a label of an item provided by an embodiment of the present disclosure;

图6示出了可以用来实施本公开的实施例项目的标签获取方法的示例电子设备的示意性框图。6 shows a schematic block diagram of an example electronic device that may be used to implement the tag acquisition method of an embodiment item of the present disclosure.

具体实施方式Detailed ways

以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding and should be considered as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.

对一些项目打标签有助于实现对这些项目的科学管理,在现有技术中,通常是利用与项目对应的打标签程序来自动地为项目打标签。然而,现有的打标签程序所打的标签的类型较少,标签类型的范围存在较大的约束;而且,部分计算机语言类型的项目并不具备对应的打标签程序,导致这部分计算机语言类型的项目无法被自动打标签。Tagging some items is helpful to realize scientific management of these items. In the prior art, a tagging program corresponding to the item is usually used to automatically tag the item. However, the existing labeling programs have fewer types of labels, and the scope of labeling types has greater constraints; moreover, some projects of computer language types do not have corresponding labeling programs, resulting in some computer language types. Items cannot be automatically tagged.

以待打标签的项目是测试用例为例,现有技术通常是利用测试用例的测试框架来自动地为测试用例打标签。例如,python计算机语言的测试用例的pytest框架,可以使用@pytest.mark.*对测试用例打标签;golang计算机语言的测试用例的ginkgo框架,可以通过用例参数对测试用例打标签。然而,测试框架所打的标签的类型较少,标签类型的范围存在较大的约束,例如,部分测试框架仅能对测试用例打项目级的标签。而且,部分计算机语言类型的测试用例的测试框架并不具备打标签的能力,导致这部分计算机语言类型的测试用例无法被自动打标签。Taking the project to be labeled as a test case as an example, the prior art usually uses the test framework of the test case to automatically label the test case. For example, the pytest framework of the test case of the python computer language can use @pytest.mark.* to mark the test case; the ginkgo framework of the test case of the golang computer language can mark the test case through the use case parameters. However, there are few types of tags tagged by the test framework, and the range of tag types has greater constraints. For example, some test frameworks can only tag test cases at the project level. Moreover, the test framework of some computer language type test cases does not have the ability to tag, so that this part of the computer language type test cases cannot be automatically tagged.

本公开实施例提供的项目的标签获取方法、装置、电子设备及存储介质,旨在解决现有技术的如上技术问题中的至少一个。The method, device, electronic device, and storage medium for obtaining a tag of an item provided by the embodiments of the present disclosure are intended to solve at least one of the above technical problems in the prior art.

图1示出了本公开实施例提供的一种项目的标签获取方法的流程示意图,如图1所示,该方法主要可以包括以下步骤:FIG. 1 shows a schematic flowchart of a method for obtaining a label of an item provided by an embodiment of the present disclosure. As shown in FIG. 1 , the method may mainly include the following steps:

S110:从项目文件中解析出注释信息。S110: Parse out the comment information from the project file.

在本公开实施例中,项目文件可以包括至少一个项目,项目文件中的项目的具体数量可以根据实际需要而定,此处不做限制。本公开实施例所述的项目可以是任意一种可被计算机存储的对象,如数据段、字段、基于计算机语言编写的代码段(例如测试用例)。注释信息可以被预先添加在项目文件中,例如,在项目文件编写项目的过程中可以编写相关的注释信息,注释信息可以用于描述项目的标签内容。在添加注释信息时,可以按照预设的格式编写注释信息的内容,以便在解析过程中按照该预设的格式从项目文件中解析出注释信息。In this embodiment of the present disclosure, the project file may include at least one project, and the specific number of projects in the project file may be determined according to actual needs, which is not limited here. The items described in the embodiments of the present disclosure may be any objects that can be stored by a computer, such as data segments, fields, and code segments (eg, test cases) written in a computer language. The comment information may be pre-added in the project file. For example, in the process of writing the project in the project file, the related comment information may be written, and the comment information may be used to describe the label content of the project. When adding annotation information, the content of the annotation information can be written according to a preset format, so that the annotation information can be parsed from the project file according to the preset format during the parsing process.

可选地,项目文件中的注释信息可以分为多个级别,每个的级别的注释信息用于描述项目的对应级别的标签。例如,项目文件中的注释信息可以包括目录级注释信息、文件级注释信息、类别级注释信息、项目级注释信息中的至少一个。本公开实施例设置多种层级的注释信息,有助于记录多种层级的标签,提高项目的标签类型的丰富度。Optionally, the annotation information in the project file may be divided into multiple levels, and the annotation information of each level is used to describe the label of the corresponding level of the project. For example, the annotation information in the project file may include at least one of directory-level annotation information, file-level annotation information, category-level annotation information, and project-level annotation information. In the embodiment of the present disclosure, multiple levels of annotation information are set, which helps to record multiple levels of tags and improves the richness of item tag types.

在解析注释信息时,可以从项目文件中解析出至少一个级别的注释信息。在从项目文件中解析出至少一个级别的注释信息之后,还可以基于至少一个级别的注释信息中每个注释信息的级别信息,生成包含父子关系的节点树。When parsing annotation information, at least one level of annotation information can be parsed from the project file. After parsing out at least one level of annotation information from the project file, a node tree including parent-child relationships may also be generated based on the level information of each annotation information in the at least one level of annotation information.

S120:从注释信息中确定出至少一个项目的标签。S120: Determine the label of at least one item from the annotation information.

如前文所述,项目文件中的注释信息可以分为多个级别,每个的级别的注释信息用于描述项目的对应级别的标签,因此,标签可以分为多个层级,例如,标签可以包括目录级注释信息对应的目录级标签、文件级注释信息对应的文件级标签、类别级注释信息对应的类别级标签、项目级注释信息对应的项目级标签中的至少一个。本公开实施例设置多种层级的标签,可以提高项目的标签类型的丰富度。在确定注释信息中确定标签时,可以从至少一个级别的注释信息中,解析出至少一个项目的至少一个级别的标签。As mentioned above, the annotation information in the project file can be divided into multiple levels, and the annotation information of each level is used to describe the label of the corresponding level of the project. Therefore, the label can be divided into multiple levels. For example, the label can include At least one of a directory-level tag corresponding to the directory-level annotation information, a file-level tag corresponding to the file-level annotation information, a category-level tag corresponding to the category-level annotation information, and an item-level tag corresponding to the item-level annotation information. The embodiment of the present disclosure sets tags of various levels, which can improve the richness of tag types of an item. When the label is determined in the determination of the annotation information, the label of at least one level of at least one item may be parsed from the annotation information of at least one level.

S130:按照预设数据格式记录至少一个项目的标签。S130: Record the label of at least one item according to a preset data format.

在本公开实施例中,预设数据格式可以是任一种数据存储形式,例如可以采用节点树的形式来记录至少一个项目的标签,或者采用表格的形式记录至少一个项目的标签。本公开实施例中,可以优先采用节点树的形式来记录至少一个项目的标签,以便清晰地表现出项目的各个标签之间的层级关系。可以理解,在记录了项目的标签,可以将标签存储在预设库中。In the embodiment of the present disclosure, the preset data format may be any data storage form, for example, the label of at least one item may be recorded in the form of a node tree, or the label of at least one item may be recorded in the form of a table. In the embodiment of the present disclosure, the label of at least one item may be recorded in the form of a node tree, so as to clearly represent the hierarchical relationship between the labels of the project. It will be appreciated that after the tags of the items are recorded, the tags may be stored in the preset library.

可选地,在项目的标签时,可以根据至少一个级别的标签中每个标签所对应的注释信息,确定每个标签在节点树中对应的节点;将每个标签绑定到节点树中对应的节点上。Optionally, when labeling an item, the node corresponding to each label in the node tree can be determined according to the annotation information corresponding to each label in the labels of at least one level; each label is bound to the corresponding node in the node tree. on the node.

在本公开实施例中,在按照预设数据格式记录至少一个项目的标签之后,还可以响应于用户的标签选择操作,确定用户选择的目标标签;基于被预设数据格式记录至少一个项目的标签,确定出具有目标标签的至少一个目标项目。In the embodiment of the present disclosure, after the label of at least one item is recorded according to the preset data format, the target label selected by the user may also be determined in response to the user's label selection operation; the label of the at least one item is recorded based on the preset data format , to determine at least one target item with a target tag.

本公开实施提供的项目的标签获取方法,允许预先在项目文件中添加用于描述项目的标签内容的注释信息,在需要为项目打标签时,通过解析注释信息即可获取到每个项目的标签。由于任何计算机语言类型的项目的项目文件都可以允许添加注释信息,因此上述标签获取方法可以为任一类型的项目打标签,使得该标签获取方法具有较高的普适性;而且,注释信息所描述的标签内容的类型可以不受限制,因此上述标签获取方法可以为项目打多种类型的标签,增加了项目的标签丰富度。The present disclosure implements a method for obtaining a label of an item, which allows to add annotation information for describing the content of the label of the project in the project file in advance, and when the project needs to be tagged, the label of each item can be obtained by parsing the annotation information. . Since the project file of any computer language type project can allow adding annotation information, the above-mentioned tag acquisition method can tag any type of project, so that the tag acquisition method has high universality; The type of the described tag content can be unlimited, so the above tag acquisition method can tag the item with various types of tags, which increases the tag richness of the item.

图2示出了本公开实施例提供的一种项目的标签获取方法的流程示意图,如图2所示,该方法主要可以包括以下步骤:FIG. 2 shows a schematic flowchart of a method for obtaining a label of an item provided by an embodiment of the present disclosure. As shown in FIG. 2 , the method may mainly include the following steps:

S210:从项目文件中解析出至少一个级别的注释信息。S210: Parse out at least one level of annotation information from the project file.

如前文所述,项目文件中的注释信息可以分为多个级别,每个的级别的注释信息用于描述项目的对应级别的标签。例如,项目文件中的注释信息可以包括目录级注释信息、文件级注释信息、类别级注释信息、项目级注释信息中的至少一个。As mentioned above, the annotation information in the project file can be divided into multiple levels, and the annotation information of each level is used to describe the label of the corresponding level of the project. For example, the annotation information in the project file may include at least one of directory-level annotation information, file-level annotation information, category-level annotation information, and project-level annotation information.

可选地,目录级注释信息可以描述与项目文件所在的目录这一层级相关的标签内容,文件级注释信息可以描述项目文件这一层级相关的标签内容,类别级注释信息可以描述项目所属的类别这一层级相关的标签内容,项目级注释信息可以描述项目这一层级相关的标签内容。Optionally, the directory-level comment information can describe the label content related to the level of the directory where the project file is located, the file-level comment information can describe the label content related to the project file level, and the category-level comment information can describe the category to which the project belongs. The label content related to this level, and the item-level annotation information can describe the label content related to this level of the project.

图3示出了本公开实施例提供的一种项目文件的部分内容示意图,如图3所示,方框A的内容为文件级注释信息、方框B的内容为类别级注释信息、方框C的内容和方框D的内容分别为两个项目级注释信息,图3中的print对应的内容为项目。可以理解,一个项目文件中并不一定要包含所有级别的注释信息,例如,图3所示出的项目文件不隶属于任一目录,所以该项目文件中可不包含目录级注释信。FIG. 3 shows a schematic diagram of part of the content of a project file provided by an embodiment of the present disclosure. As shown in FIG. 3 , the content of box A is file-level annotation information, the content of box B is category-level annotation information, and the content of box B is category-level annotation information. The content of C and the content of box D are respectively two item-level annotation information, and the content corresponding to the print in Figure 3 is the item. It can be understood that a project file does not necessarily contain all levels of comment information. For example, the project file shown in FIG. 3 does not belong to any directory, so the project file may not contain directory-level comment letters.

S220:基于至少一个级别的注释信息中每个注释信息的级别信息,生成包含父子关系的节点树。S220: Based on the level information of each annotation information in the annotation information of at least one level, generate a node tree including a parent-child relationship.

在本公开实施例中,不同级别的注释信息对应于节点树中不同级别的节点,其中,级别最高的注释信息对应于节点树中的根节点,级别最低高的注释信息对应于节点树中的叶子节点。可选地,上述目录级注释信息、文件级注释信息、类别级注释信息和项目级注释信息的级别依次降低,一般来说,项目级注释信息对应于节点树中的叶子节点。In the embodiment of the present disclosure, annotation information of different levels corresponds to nodes of different levels in the node tree, wherein the annotation information with the highest level corresponds to the root node in the node tree, and the annotation information with the lowest level corresponds to the nodes in the node tree. leaf node. Optionally, the levels of the above directory-level annotation information, file-level annotation information, category-level annotation information, and item-level annotation information are sequentially decreased. Generally speaking, the item-level annotation information corresponds to a leaf node in the node tree.

假设从一个项目文件中解析出目录级注释信息、文件级注释信息、类别级注释信息和项目级注释信息,这里,目录级注释信息对应于节点树中的根节点,文件级注释信息对应于节点树中根节点下一级的第二级节点,类别级注释信息对应于节点树中第二级节点的下一级的第三级节点,项目级注释信息对应于节点树中的叶子节点,根据上述注释信息与节点之间的对应关系,生成包含父子关系的节点树。Assume that directory-level comment information, file-level comment information, category-level comment information, and project-level comment information are parsed from a project file. Here, the directory-level comment information corresponds to the root node in the node tree, and the file-level comment information corresponds to the node. The second-level node at the next level of the root node in the tree, the category-level annotation information corresponds to the third-level node at the next level of the second-level node in the node tree, and the item-level annotation information corresponds to the leaf node in the node tree. According to the above The corresponding relationship between annotation information and nodes generates a node tree containing parent-child relationships.

S230:从至少一个级别的注释信息中,解析出至少一个项目的至少一个级别的标签。S230: From the annotation information of at least one level, parse out at least one level label of at least one item.

如前文所述,项目文件中的注释信息可以分为多个级别,每个的级别的注释信息用于描述项目的对应级别的标签,因此,标签可以分为多个层级,例如,标签可以包括目录级注释信息对应的目录级标签、文件级注释信息对应的文件级标签、类别级注释信息对应的类别级标签、项目级注释信息对应的项目级标签中的至少一个。As mentioned above, the annotation information in the project file can be divided into multiple levels, and the annotation information of each level is used to describe the label of the corresponding level of the project. Therefore, the label can be divided into multiple levels. For example, the label can include At least one of a directory-level tag corresponding to the directory-level annotation information, a file-level tag corresponding to the file-level annotation information, a category-level tag corresponding to the category-level annotation information, and an item-level tag corresponding to the item-level annotation information.

可选的,本公开实施例可以根据一定的匹配规则(如完全匹配和升级匹配)注释信息匹配出对应的标签,标签的内容可以分为枚举内容和文本内容。可选地,枚举内容需要在预设定的数值列表内,文本内容的标签值可是任意数据。Optionally, in this embodiment of the present disclosure, a corresponding tag may be matched according to certain matching rules (such as complete matching and upgrade matching) annotation information, and the content of the tag may be divided into enumeration content and text content. Optionally, the enumeration content needs to be in a preset value list, and the tag value of the text content can be any data.

在此需要说明的是,从一个注释信息中,可以解析出同一级别的至少一个标签。以图3为例,图3中的待打标签的项目是测试用例,从文件级注释信息解析出的文件级标签可以包括:文件名称标签“某功能测试集合”、文件功能标签“是某个功能的测试,包括增、删、改、查的测试”;从类别级注释信息解析出的类别级标签可以包括:类别名称标签“用例集1”;从第一个项目级注释信息中解析出的项目级注释标签可以包括:用例名称标签“创建”、测试类型标签“单测”、优先级标签“p1”;从第二个项目级注释信息中解析出的项目级注释标签可以包括:用例名称标签“test_update”、测试类型标签“单测”、优先级标签“p0”;执行方式标签“auto”。It should be noted here that, from an annotation information, at least one label at the same level can be parsed. Taking Fig. 3 as an example, the item to be labeled in Fig. 3 is a test case, and the file-level label parsed from the file-level comment information may include: the file name label "a certain function test set", the file function label "is a certain Function test, including adding, deleting, modifying, and checking tests"; the category-level tags parsed from category-level annotation information can include: category name tag "use case set 1"; parsed from the first item-level annotation information The project-level annotation labels can include: use case name label "create", test type label "single test", priority label "p1"; project-level annotation labels parsed from the second project-level annotation information can include: use case Name label "test_update", test type label "single test", priority label "p0"; execution method label "auto".

S240:根据至少一个级别的标签中每个标签所对应的注释信息,确定每个标签在节点树中对应的节点。S240: Determine the node corresponding to each label in the node tree according to the annotation information corresponding to each label in the labels of at least one level.

可以理解,每个标签所对应的节点树中的节点,与该标签所属的注释信息的节点是一致的。假设从一个项目文件中解析出目录级注释信息、文件级注释信息、类别级注释信息和项目级注释信息,这里,目录级注释信息对应于节点树中的根节点,该目录级注释信息解析出的目录级标签也对应于该根节点;文件级注释信息对应于节点树中根节点下一级的第二级节点,该文件级注释信息解析出的文件级标签也对应于该第二级节点;类别级注释信息对应于节点树中第二级节点的下一级的第三级节点,该类别级注释信息解析出的类别级标签也对应于该第三级节点;项目级注释信息对应于节点树中的叶子节点,该项目级注释信息解析出的项目级标签也对应于该叶子节点。It can be understood that the node in the node tree corresponding to each label is consistent with the node of the annotation information to which the label belongs. Assume that directory-level comment information, file-level comment information, category-level comment information, and project-level comment information are parsed from a project file. Here, the directory-level comment information corresponds to the root node in the node tree, and the directory-level comment information is parsed out. The directory-level label also corresponds to the root node; the file-level annotation information corresponds to the second-level node below the root node in the node tree, and the file-level label parsed from the file-level annotation information also corresponds to the second-level node; The category-level annotation information corresponds to the third-level node next to the second-level node in the node tree, and the category-level label parsed from the category-level annotation information also corresponds to the third-level node; the item-level annotation information corresponds to the node A leaf node in the tree, and the item-level label parsed from the item-level annotation information also corresponds to the leaf node.

S250:将每个标签绑定到节点树中对应的节点上。S250: Bind each label to the corresponding node in the node tree.

例如,对于一个目录级标签对应节点树中的根节点,则可以将该目录级标签绑定到节点树中的根节点上,其他标签的绑定方式此处不做赘述。可以理解,在完成标签绑定之后,可以将节点树和各个标签存储到数据库中。可选地,可以将项目文件的唯一标识和节点树关联存储到数据库,并将节点树中每个节点的唯一标识与对应的标签关联存储到数据库。For example, for a directory-level label corresponding to the root node in the node tree, the directory-level label can be bound to the root node in the node tree, and the binding methods of other labels are not described here. It can be understood that after the label binding is completed, the node tree and each label can be stored in the database. Optionally, the unique identifier of the project file may be stored in the database in association with the node tree, and the unique identifier of each node in the node tree may be stored in the database in association with the corresponding label.

在公开实施例中,在将每个标签绑定到节点树中对应的节点之后,可以基于获取到的标签来查询项目标签,基于标签来查询项目标签们可以对项目进行合理的管理,如对项目进行归类、筛选和过滤等,例如通过某一个目标标签准确地筛选出部分项目,之后执行具有目标标签的全部项目。可选地,基于标签来查询具体流程可以参见步骤S260。In the disclosed embodiment, after each label is bound to the corresponding node in the node tree, the project label can be queried based on the obtained label, and the project label can be queried based on the label to reasonably manage the project, such as Items are classified, filtered and filtered, for example, some items are accurately filtered out by a certain target tag, and then all items with the target tag are executed. Optionally, to query the specific process based on the tag, refer to step S260.

S260:响应于用户的标签选择操作,确定用户选择的目标标签;基于被预设数据格式记录至少一个项目的标签,确定出具有目标标签的至少一个目标项目。S260: In response to the user's tag selection operation, determine the target tag selected by the user; and determine at least one target item with the target tag based on the tag of the at least one item recorded in the preset data format.

在本公开实施例中,用户可以根据需要选择出至少一个目标标签,之后基于数据库存储的节点树和各个标签,确定出具有该至少一个目标标签的所有目标项目,在项目文件中调用出这些目标项目并进行展示。In the embodiment of the present disclosure, the user can select at least one target tag as required, then determine all target items with the at least one target tag based on the node tree and each tag stored in the database, and call these targets in the project file. project and show it.

本公开实施例可以预先构建虚拟的执行器来执行上述项目的标签获取方法中的对应步骤。例如,可以预先生成文件分发器、注释解析器和标签解析器。In the embodiment of the present disclosure, a virtual executor may be pre-built to execute the corresponding steps in the method for obtaining the label of the above item. For example, the file dispatcher, annotation parser, and tag parser can be pre-generated.

可选地,利用文件分发器确定出项目文件的文件类型,并将项目文件发送至与文件类型对应的注释解析器,之后利用注释解析器从项目文件中解析出注释信息。Optionally, the file type of the project file is determined by a file distributor, and the project file is sent to an annotation parser corresponding to the file type, and then the annotation information is parsed from the project file by using the annotation parser.

这里,可以根据不用的文件类型设置不同的注释解析器。文件类型是项目文件中的项目的计算机语言类型,在构建注释解析器时,可以首先定义每种类型的计算机语言的分词信息,之后使用每种类型的计算机语言的分词信息编写出对应的注释解析器。利用与项目文件的文件类型相匹配的注释解析器对注释信息进行解析,可以提高解析出的注释信息的准确率。Here, different annotation parsers can be set according to different file types. The file type is the computer language type of the project in the project file. When building the annotation parser, you can first define the word segmentation information of each type of computer language, and then use the word segmentation information of each type of computer language to write the corresponding annotation parsing device. Using an annotation parser matching the file type of the project file to parse the annotation information can improve the accuracy of the parsed annotation information.

注释解析器可兼容对应类型的计算机语言的所有关键字和语法,可选地,可以利用Antlr4根据编写的代码解析器生成相应的访问器,访问器可以对项目文件进行遍历解析,解析出注释信息。这里,解析注释信息的具体描述可以参见上述步骤中对应的描述,此处不再赘述。The comment parser is compatible with all keywords and grammars of the corresponding type of computer language. Optionally, Antlr4 can be used to generate the corresponding accessor according to the written code parser. The accessor can traverse and parse the project file and parse out the comment information. . Here, for a specific description of parsing the annotation information, reference may be made to the corresponding description in the above steps, and details are not repeated here.

在利用注释解析器从项目文件中解析出注释信息之后,可以利用标签解析器从注释信息中确定出至少一个项目的标签,按照预设数据格式记录至少一个项目的标签。这里,从注释信息中确定项目的标签、以及记录标签的具体描述可以参见上述步骤中对应的描述,此处不再赘述。After the annotation information is parsed from the project file by using the annotation parser, the label of at least one project can be determined from the annotation information by using the label parser, and the label of the at least one project can be recorded according to a preset data format. Here, for the specific description of determining the label of the item from the annotation information and recording the label, reference may be made to the corresponding description in the above steps, which will not be repeated here.

本公开实施例提供的项目的标签获取方法所针对的项目是包含有至少一个项目的项目文件。在实际情况中,一些项目文件并不包含项目,项目文件中不存在项目级注释信息,只有目录级标签和/或文件级注释信息,针对这类项目文件,同样可以使用本公开实施例提供的项目的标签获取方法对项目文件进行解析,但是解析出的标签并不能作为某一项目的标签。A project targeted by the method for obtaining a project label provided by the embodiment of the present disclosure is a project file including at least one project. In actual situations, some project files do not contain projects, and there is no project-level annotation information in the project files, but only directory-level labels and/or file-level annotation information. The project's label acquisition method parses the project file, but the parsed label cannot be used as the label of a certain project.

基于与上述的项目的标签获取方法相同的原理,图4示出了本公开实施例提供的一种项目的标签获取装置的结构示意图之一,图5示出了本公开实施例提供的一种项目的标签获取装置的结构示意图之二。如图4所示,项目的标签获取装置400包括注释解析模块410、标签确定模块420和标签记录模块430。Based on the same principle as the above-mentioned method for obtaining a label of an item, FIG. 4 shows one of the schematic structural diagrams of a device for obtaining a label of an item provided by an embodiment of the present disclosure, and FIG. 5 shows a schematic diagram of a device provided by an embodiment of the present disclosure The second schematic diagram of the structure of the label acquisition device of the project. As shown in FIG. 4 , the device 400 for obtaining a tag of an item includes an annotation parsing module 410 , a tag determining module 420 and a tag recording module 430 .

注释解析模块410用于从项目文件中解析出注释信息,其中,项目文件包括至少一个项目,注释信息用于描述项目的标签内容、且被预先添加在项目文件中。The annotation parsing module 410 is configured to parse out annotation information from the project file, wherein the project file includes at least one item, and the annotation information is used to describe the label content of the project and is pre-added in the project file.

标签确定模块420用于从注释信息中确定出至少一个项目的标签。The tag determination module 420 is used to determine the tag of at least one item from the annotation information.

标签记录模块430用于按照预设数据格式记录至少一个项目的标签。The tag recording module 430 is configured to record the tag of at least one item according to a preset data format.

本公开实施提供的项目的标签获取装置,允许预先在项目文件中添加用于描述项目的标签内容的注释信息,在需要为项目打标签时,通过解析注释信息即可获取到每个项目的标签。由于任何计算机语言类型的项目的项目文件都可以允许添加注释信息,因此上述标签获取方法可以为任一类型的项目打标签,使得该标签获取方法具有较高的普适性;而且,注释信息所描述的标签内容的类型可以不受限制,因此上述标签获取方法可以为项目打多种类型的标签,增加了项目的标签丰富度。The device for obtaining a label of a project provided by the implementation of the present disclosure allows to add comment information for describing the label content of the project in the project file in advance, and when the project needs to be labeled, the label of each project can be obtained by parsing the comment information . Since the project file of any computer language type project can allow adding annotation information, the above-mentioned tag acquisition method can tag any type of project, so that the tag acquisition method has high universality; The type of the described tag content can be unlimited, so the above tag acquisition method can tag the item with various types of tags, which increases the tag richness of the item.

在本公开实施例中,注释解析模块410在用于从项目文件中解析出注释信息时,具体用于:从项目文件中解析出至少一个级别的注释信息,其中,至少一个级别的注释信息包括目录级注释信息、文件级注释信息、类别级注释信息、项目级注释信息中的至少一个,每个的级别的注释信息用于描述项目的对应级别的标签。In this embodiment of the present disclosure, when the annotation parsing module 410 is used to parse out the annotation information from the project file, it is specifically configured to: parse out at least one level of annotation information from the project file, wherein the at least one level of annotation information includes At least one of directory-level annotation information, file-level annotation information, category-level annotation information, and item-level annotation information, each level of annotation information is used to describe the label of the corresponding level of the project.

在本公开实施例中,注释解析模块410还用于:基于至少一个级别的注释信息中每个注释信息的级别信息,生成包含父子关系的节点树。In the embodiment of the present disclosure, the annotation parsing module 410 is further configured to: generate a node tree including a parent-child relationship based on the level information of each annotation information in the at least one level of annotation information.

在本公开实施例中,标签确定模块420在用于从注释信息中确定出至少一个项目的标签时,具体用于:从至少一个级别的注释信息中,解析出至少一个项目的至少一个级别的标签;其中,至少一个级别的标签包括目录级注释信息对应的目录级标签、文件级注释信息对应的文件级标签、类别级注释信息对应的类别级标签、项目级注释信息对应的项目级标签中的至少一个。In this embodiment of the present disclosure, when the label determination module 420 is used to determine the label of at least one item from the annotation information, it is specifically configured to: parse out at least one level of at least one item from the at least one level of annotation information. Labels; wherein, the labels of at least one level include directory-level labels corresponding to directory-level annotation information, file-level labels corresponding to file-level annotation information, category-level labels corresponding to category-level annotation information, and item-level labels corresponding to item-level annotation information. at least one of.

在本公开实施例中,标签记录模块430在用于按照预设数据格式记录至少一个项目的标签时,具体用于:In the embodiment of the present disclosure, when the tag recording module 430 is used to record the tag of at least one item according to the preset data format, it is specifically used for:

根据至少一个级别的标签中每个标签所对应的注释信息,确定每个标签在节点树中对应的节点;According to the annotation information corresponding to each label in the labels of at least one level, determine the node corresponding to each label in the node tree;

将每个标签绑定到节点树中对应的节点上。Bind each label to the corresponding node in the node tree.

在本公开实施例中,注释解析模块410在用于从项目文件中解析出注释信息时,具体用于:In the embodiment of the present disclosure, when the annotation parsing module 410 is used to parse out the annotation information from the project file, it is specifically used to:

利用文件分发器确定出项目文件的文件类型,并将项目文件发送至与文件类型对应的注释解析器;Use the file distributor to determine the file type of the project file, and send the project file to the annotation parser corresponding to the file type;

利用注释解析器从项目文件中解析出注释信息。Use the annotation parser to parse the annotation information from the project file.

在本公开实施例中,如图5所示,项目的标签获取装置400还包括项目查询模块440,项目查询模块440用于:In the embodiment of the present disclosure, as shown in FIG. 5 , the device 400 for obtaining a label of an item further includes an item query module 440, and the item query module 440 is used for:

响应于用户的标签选择操作,确定用户选择的目标标签;In response to the user's tag selection operation, determining the target tag selected by the user;

基于被预设数据格式记录至少一个项目的标签,确定出具有目标标签的至少一个目标项目。At least one target item having a target tag is determined based on the tag of the at least one item recorded in the preset data format.

可以理解的是,本公开实施例中的项目的标签获取装置的上述各模块具有实现上述的项目的标签获取方法相应步骤的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。上述模块可以是软件和/或硬件,上述各模块可以单独实现,也可以多个模块集成实现。对于上述项目的标签获取装置的各模块的功能描述具体可以参见上述的项目的标签获取方法的对应描述,在此不再赘述。It can be understood that the above-mentioned modules of the device for obtaining a label of an item in the embodiment of the present disclosure have the function of implementing the corresponding steps of the above-mentioned method for obtaining a label of an item. This function can be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions. The above-mentioned modules may be software and/or hardware, and the above-mentioned modules may be implemented independently, or multiple modules may be integrated and implemented. For the functional description of each module of the label obtaining apparatus of the above item, reference may be made to the corresponding description of the above-mentioned project label obtaining method, which will not be repeated here.

在此需要说明的是,本公开的技术方案中,所涉及的用户个人信息的获取,存储和应用等,均符合相关法律法规的规定,且不违背公序良俗。It should be noted here that, in the technical solution of the present disclosure, the acquisition, storage and application of the user's personal information involved all comply with the relevant laws and regulations, and do not violate public order and good customs.

根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

图6示出了可以用来实施本公开的实施例项目的标签获取方法的示例电子设备的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。6 shows a schematic block diagram of an example electronic device that may be used to implement the tag acquisition method of an embodiment item of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are by way of example only, and are not intended to limit implementations of the disclosure described and/or claimed herein.

如图6所示,设备500包括计算单元501,其可以根据存储在只读存储器(ROM)502中的计算机程序或者从存储单元508加载到随机访问存储器(RAM)503中的计算机程序,来执行各种适当的动作和处理。在RAM 503中,还可存储设备500操作所需的各种程序和数据。计算单元501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。As shown in FIG. 6 , the device 500 includes a computing unit 501 that can be executed according to a computer program stored in a read only memory (ROM) 502 or loaded into a random access memory (RAM) 503 from a storage unit 508 Various appropriate actions and handling. In the RAM 503, various programs and data necessary for the operation of the device 500 can also be stored. The computing unit 501 , the ROM 502 , and the RAM 503 are connected to each other through a bus 504 . An input/output (I/O) interface 505 is also connected to bus 504 .

设备500中的多个部件连接至I/O接口505,包括:输入单元506,例如键盘、鼠标等;输出单元507,例如各种类型的显示器、扬声器等;存储单元508,例如磁盘、光盘等;以及通信单元509,例如网卡、调制解调器、无线通信收发机等。通信单元509允许设备500通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Various components in the device 500 are connected to the I/O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc. ; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.

计算单元501可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元501的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元501执行上文所描述的各个方法和处理,例如项目的标签获取方法。例如,在一些实施例中,项目的标签获取方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元508。在一些实施例中,计算机程序的部分或者全部可以经由ROM 502和/或通信单元509而被载入和/或安装到设备500上。当计算机程序加载到RAM 503并由计算单元501执行时,可以执行上文描述的项目的标签获取方法的一个或多个步骤。备选地,在其他实施例中,计算单元501可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行项目的标签获取方法。Computing unit 501 may be various general-purpose and/or special-purpose processing components with processing and computing capabilities. Some examples of computing units 501 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 executes the various methods and processes described above, such as a tag acquisition method of an item. For example, in some embodiments, the tag acquisition method for an item may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 508 . In some embodiments, part or all of the computer program may be loaded and/or installed on device 500 via ROM 502 and/or communication unit 509 . When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the tag acquisition method of the item described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured by any other suitable means (eg, by means of firmware) to perform the item's tag acquisition method.

本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein above may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips system (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.

用于实施本公开的方法的程序代码可以采用一个或多个编程计算机语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming computer languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, performs the functions/functions specified in the flowcharts and/or block diagrams. Action is implemented. The program code may execute entirely on the machine, partly on the machine, partly on the machine and partly on a remote machine as a stand-alone software package or entirely on the remote machine or server.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.

为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including acoustic input, voice input, or tactile input) to receive input from the user.

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user's computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.

计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,也可以为分布式系统的服务器,或者是结合了区块链的服务器。A computer system can include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a distributed system server, or a server combined with blockchain.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, no limitation is imposed herein.

上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure should be included within the protection scope of the present disclosure.

Claims (17)

1. A method for acquiring a label of an item comprises the following steps:
parsing annotation information from a project file, wherein the project file comprises at least one project, and the annotation information is used for describing tag content of the project and is pre-added in the project file;
determining a tag of the at least one item from the annotation information;
and recording the label of the at least one item according to a preset data format.
2. The method of claim 1, wherein said parsing out annotation information from the project file comprises:
parsing out at least one level of annotation information from the project file, wherein the at least one level of annotation information comprises at least one of directory level annotation information, file level annotation information, category level annotation information, and project level annotation information, and the annotation information of each level is used for describing a tag of a corresponding level of the project.
3. The method of claim 2, further comprising, after said parsing out at least one level of annotation information from the project file:
and generating a node tree containing a parent-child relationship based on the level information of each piece of annotation information in the at least one level of annotation information.
4. The method of claim 3, wherein said determining a tag for said at least one item from said annotation information comprises:
parsing out tags of at least one level of the at least one item from the annotation information of the at least one level;
wherein the at least one level of tags includes at least one of a directory level tag corresponding to the directory level annotation information, a file level tag corresponding to the file level annotation information, a category level tag corresponding to the category level annotation information, and a project level tag corresponding to the project level annotation information.
5. The method of claim 4, wherein the recording the tag of the at least one item in a preset data format comprises:
determining a node corresponding to each label in the node tree according to the annotation information corresponding to each label in the at least one level of labels;
and binding each label to the corresponding node in the node tree.
6. The method of any of claims 1 to 5, wherein the parsing out annotation information from the project file comprises:
determining the file type of a project file by using a file distributor, and sending the project file to an annotation parser corresponding to the file type;
and analyzing annotation information from the project file by using the annotation analyzer.
7. The method of any of claims 1 to 5, further comprising, after said recording the tag of the at least one item in a preset data format:
in response to a tag selection operation by a user, determining that the user selected;
and determining at least one target item with the target label based on the label of the at least one item recorded by the preset data format.
8. A tag acquisition apparatus for an item, comprising:
the annotation analysis module is used for analyzing annotation information from a project file, wherein the project file comprises at least one project, and the annotation information is used for describing tag content of the project and is added in the project file in advance;
a tag determination module for determining a tag of the at least one item from the annotation information;
and the label recording module is used for recording the label of the at least one item according to a preset data format.
9. The apparatus of claim 8, wherein the annotation parsing module, when configured to parse annotation information from a project file, is specifically configured to:
parsing out at least one level of annotation information from the project file, wherein the at least one level of annotation information comprises at least one of directory level annotation information, file level annotation information, category level annotation information, and project level annotation information, and the annotation information of each level is used for describing a tag of a corresponding level of the project.
10. The apparatus of claim 8, the annotation parsing module to further:
and generating a node tree containing a parent-child relationship based on the level information of each piece of annotation information in the at least one level of annotation information.
11. The apparatus according to claim 10, wherein the tag determining module, when configured to determine the tag of the at least one item from the annotation information, is specifically configured to:
parsing out tags of at least one level of the at least one item from the annotation information of the at least one level;
wherein the at least one level of tags includes at least one of a directory level tag corresponding to the directory level annotation information, a file level tag corresponding to the file level annotation information, a category level tag corresponding to the category level annotation information, and a project level tag corresponding to the project level annotation information.
12. The apparatus according to claim 11, wherein the tag recording module, when configured to record the tag of the at least one item according to a preset data format, is specifically configured to:
determining a node corresponding to each label in the node tree according to the annotation information corresponding to each label in the at least one level of labels;
and binding each label to the corresponding node in the node tree.
13. The apparatus according to any one of claims 8 to 12, wherein the annotation parsing module, when configured to parse annotation information from a project file, is specifically configured to:
determining the file type of a project file by using a file distributor, and sending the project file to an annotation parser corresponding to the file type;
and analyzing annotation information from the project file by using the annotation analyzer.
14. The apparatus of any of claims 8 to 12, further comprising an item query module to:
responding to a label selection operation of a user, and determining a target label selected by the user;
and determining at least one target item with the target label based on the label of the at least one item recorded by the preset data format.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202110765576.7A 2021-07-06 2021-07-06 Method and device for acquiring label of item, electronic equipment and storage medium Active CN113495753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110765576.7A CN113495753B (en) 2021-07-06 2021-07-06 Method and device for acquiring label of item, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110765576.7A CN113495753B (en) 2021-07-06 2021-07-06 Method and device for acquiring label of item, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113495753A true CN113495753A (en) 2021-10-12
CN113495753B CN113495753B (en) 2024-08-06

Family

ID=77995840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110765576.7A Active CN113495753B (en) 2021-07-06 2021-07-06 Method and device for acquiring label of item, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113495753B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050010562A1 (en) * 2003-04-30 2005-01-13 Fumio Nagasaka File management method, file management device, annotation information generation method, and annotation information generation device
CN102129365A (en) * 2010-01-20 2011-07-20 阿里巴巴集团控股有限公司 Method and device for generating code documentations
US8028276B1 (en) * 2007-06-29 2011-09-27 Oracle America, Inc. Method and system for generating a test file
US8706685B1 (en) * 2008-10-29 2014-04-22 Amazon Technologies, Inc. Organizing collaborative annotations
US10002117B1 (en) * 2013-10-24 2018-06-19 Google Llc Translating annotation tags into suggested markup
CN109753286A (en) * 2018-12-28 2019-05-14 四川新网银行股份有限公司 A method of the code method based on functional label counts its call number
CN110110293A (en) * 2019-03-21 2019-08-09 平安普惠企业管理有限公司 H5 project file illustrates document generation method, device and computer equipment
CN110471694A (en) * 2019-07-11 2019-11-19 平安普惠企业管理有限公司 Annotation information processing method, device, computer equipment and storage medium
US10635855B1 (en) * 2018-12-10 2020-04-28 Sap Se Code comment markup
CN113050953A (en) * 2021-04-21 2021-06-29 平安普惠企业管理有限公司 Method, device and storage medium for generating code based on annotation

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050010562A1 (en) * 2003-04-30 2005-01-13 Fumio Nagasaka File management method, file management device, annotation information generation method, and annotation information generation device
US8028276B1 (en) * 2007-06-29 2011-09-27 Oracle America, Inc. Method and system for generating a test file
US8706685B1 (en) * 2008-10-29 2014-04-22 Amazon Technologies, Inc. Organizing collaborative annotations
CN102129365A (en) * 2010-01-20 2011-07-20 阿里巴巴集团控股有限公司 Method and device for generating code documentations
US10002117B1 (en) * 2013-10-24 2018-06-19 Google Llc Translating annotation tags into suggested markup
US10635855B1 (en) * 2018-12-10 2020-04-28 Sap Se Code comment markup
CN109753286A (en) * 2018-12-28 2019-05-14 四川新网银行股份有限公司 A method of the code method based on functional label counts its call number
CN110110293A (en) * 2019-03-21 2019-08-09 平安普惠企业管理有限公司 H5 project file illustrates document generation method, device and computer equipment
CN110471694A (en) * 2019-07-11 2019-11-19 平安普惠企业管理有限公司 Annotation information processing method, device, computer equipment and storage medium
CN113050953A (en) * 2021-04-21 2021-06-29 平安普惠企业管理有限公司 Method, device and storage medium for generating code based on annotation

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
WENJIE ZHANG等: "A Divide-and-Conquer Approach for Large-Scale Multi-label Learning", 《2017 IEEE THIRD INTERNATIONAL CONFERENCE ON MULTIMEDIA BIG DATA (BIGMM)》, 3 July 2017 (2017-07-03) *
李斌;孔祥艳;: "基于DOM的XML解析技术在构件描述中的应用", 无线电通信技术, no. 02, 18 April 2011 (2011-04-18) *
黄袁;贾楠;周强;陈湘萍;熊英飞;罗笑南;: "融合结构与语义特征的代码注释决策支持方法", 软件学报, no. 08, 13 March 2018 (2018-03-13) *

Also Published As

Publication number Publication date
CN113495753B (en) 2024-08-06

Similar Documents

Publication Publication Date Title
CN113760891B (en) Data table generation method, device, equipment and storage medium
US20240403344A1 (en) Code retrieval method and apparatus based on large language model
CN111553556A (en) Business data analysis method, device, computer equipment and storage medium
US10489024B2 (en) UI rendering based on adaptive label text infrastructure
CN114428677A (en) Task processing method, processing device, electronic equipment and storage medium
CN116955561A (en) Question answering method, question answering device, electronic equipment and storage medium
CN113220710A (en) Data query method and device, electronic equipment and storage medium
CN112989066B (en) Data processing method and device, electronic device, computer readable medium
CN116521866A (en) Training sample construction method and device, electronic equipment and medium
CN117573507A (en) Test case generation method, device, electronic equipment and storage medium
CN118981527A (en) Question answering method, device, electronic device, storage medium, intelligent agent and program product based on large model
CN114416976A (en) Text annotation method, device and electronic equipment
US12353390B2 (en) Method and apparatus for storing data
CN112989797B (en) Model training, text expansion methods, devices, equipment and storage media
CN118133794A (en) Table configuration method, apparatus, device and storage medium
CN118152423A (en) Intelligent query method, device, electronic device and readable storage medium
CN114168119B (en) Code file editing method, device, electronic equipment and storage medium
CN117370339A (en) Report blood edge relationship processing method and device, computer equipment and storage medium
CN113495753B (en) Method and device for acquiring label of item, electronic equipment and storage medium
CN117171165A (en) A data logging method, device, electronic equipment and storage medium
CN116955856A (en) Information display method, device, electronic equipment and storage medium
US20230122397A1 (en) Functional impact identification for software instrumentation
CN116302218A (en) Function information adding method, device, equipment and storage medium
CN116069755A (en) mapper file processing method and related equipment
CN116049370A (en) Information query method and training method and device of information generation model

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