CN111814041A - A recommended method, apparatus, storage medium and computer equipment for an NPM package - Google Patents
A recommended method, apparatus, storage medium and computer equipment for an NPM package Download PDFInfo
- Publication number
- CN111814041A CN111814041A CN202010579732.6A CN202010579732A CN111814041A CN 111814041 A CN111814041 A CN 111814041A CN 202010579732 A CN202010579732 A CN 202010579732A CN 111814041 A CN111814041 A CN 111814041A
- Authority
- CN
- China
- Prior art keywords
- npm
- packages
- package
- value
- recommended
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/951—Indexing; Web crawling techniques
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
【技术领域】【Technical field】
本发明涉及关键字匹配领域,尤其涉及一种NPM包的推荐方法、装置、存储介质和计算机设备。The present invention relates to the field of keyword matching, and in particular, to a method, apparatus, storage medium and computer equipment for recommending NPM packages.
【背景技术】【Background technique】
节点包管理器(Node Package Manager,简称NPM)是一个基于Node.js的包管理器。通过NPM,开发者可以容易分享和重用代码。由于NPM的开放性,使得NPM包的质量良莠不齐。目前大部分NPM包管理平台,提供了通过搜索关键词,检索对应NPM包的功能。但由于NPM包的基数庞大,同一关键词可能检索出的NPM包很多,从而导致检索出的NPM包质量差的问题。Node Package Manager (NPM for short) is a package manager based on Node.js. With NPM, developers can easily share and reuse code. Due to the openness of NPM, the quality of NPM packages varies. At present, most NPM package management platforms provide the function of retrieving corresponding NPM packages by searching keywords. However, due to the huge base of NPM packages, many NPM packages may be retrieved for the same keyword, resulting in poor quality of retrieved NPM packages.
【发明内容】[Content of the invention]
有鉴于此,本发明实施例提供了一种NPM包的推荐方法、装置、存储介质和计算机设备,通过设置NPM包对应的推荐值,从而提升NPM包检索推荐的质量。In view of this, embodiments of the present invention provide a method, apparatus, storage medium, and computer equipment for recommending NPM packages. By setting a recommendation value corresponding to an NPM package, the quality of NPM package retrieval recommendation can be improved.
一方面,本发明实施例提供了一种NPM包的推荐方法,所述方法包括:On the one hand, an embodiment of the present invention provides a method for recommending an NPM package, the method comprising:
获取客户端发送的检索请求,所述检索请求包括至少一个检索词;Obtain a retrieval request sent by the client, where the retrieval request includes at least one retrieval term;
获取与每个所述检索词匹配的关键词,并根据每个所述关键词查询出与每个所述关键词对应的NPM包;Obtain keywords matching each of the search terms, and query the NPM package corresponding to each of the keywords according to each of the keywords;
从预先建立的推荐库中,查询出多个所述NPM包对应的推荐值;From the pre-established recommendation database, query the recommendation values corresponding to a plurality of the NPM packages;
根据推荐值对多个所述NPM包进行排序,得到排序后的NPM包;Sorting a plurality of the NPM packages according to the recommended value to obtain the sorted NPM packages;
将所述排序后的NPM包发送至所述客户端。The sequenced NPM packets are sent to the client.
可选地,所述根据推荐值对多个所述NPM包进行排序,得到排序后的NPM包,包括:Optionally, sorting a plurality of the NPM packages according to the recommended value to obtain sorted NPM packages, including:
按照推荐值高到低的排序关系对多个所述NPM包进行排序,得到排序后的NPM包。Sort a plurality of the NPM packages according to the ordering relationship from high to low recommended values to obtain sorted NPM packages.
可选地,在所述获取与每个所述检索词匹配的关键词,并根据每个所述关键词查询出与每个所述关键词对应的NPM包之前,还包括:Optionally, before obtaining the keywords matching each of the search terms, and querying the NPM packages corresponding to each of the keywords according to each of the keywords, the method further includes:
通过定时批量任务采集多个NPM包;Collect multiple NPM packages through scheduled batch tasks;
解析多个所述NPM包,获取每个NPM包对应的关键词。Parse a plurality of the NPM packages to obtain keywords corresponding to each NPM package.
可选地,所述解析多个所述NPM包,获取每个NPM包对应的关键词,包括:Optionally, the parsing of multiple NPM packages to obtain keywords corresponding to each NPM package, including:
解析所述NPM包对应的配置文件,获取所述NPM对应的关键字段和描述字段;Parse the configuration file corresponding to the NPM package, and obtain the key fields and description fields corresponding to the NPM;
根据所述关键字段和所述描述字段,生成所述NPM包对应的关键词。Generate a keyword corresponding to the NPM package according to the key field and the description field.
可选地,在所述从预先建立的推荐库中,查询出多个所述NPM包对应的推荐值之前,还包括:Optionally, before querying the recommendation values corresponding to the plurality of NPM packages from the pre-established recommendation database, the method further includes:
获取每个所述NPM包的推荐值相关参数;Obtain the recommended value-related parameters of each of the NPM packages;
根据每个所述NPM包的推荐值相关参数,确定出每个所述NPM包对应的推荐值;According to the recommended value-related parameters of each of the NPM packages, the recommended value corresponding to each of the NPM packages is determined;
在预先建立的推荐库中存储或更新多个NPM包信息,所述NPM包信息包括获取的所述NPM包、所述NPM包对应的关键词以及所述NPM包对应的推荐值。A plurality of NPM package information is stored or updated in a pre-established recommendation library, where the NPM package information includes the acquired NPM package, keywords corresponding to the NPM package, and recommendation values corresponding to the NPM package.
可选地,所述推荐值相关参数包括依赖包数、被依赖包数、收藏数、下载量、发布时间、源码收藏数、源码开发分支数、关注源码数以及源码的代码推送合并数目;Optionally, the recommended value-related parameters include the number of dependent packages, the number of dependent packages, the number of favorites, the number of downloads, the release time, the number of source code collections, the number of source code development branches, the number of concerned source code, and the number of code push merges of source code;
所述获取每个所述NPM包的推荐值相关参数,包括:The obtaining the recommended value-related parameters of each of the NPM packages includes:
从定时批量任务中查询出每个所述NPM包对应的所依赖和被依赖的包列表;Query the list of dependent and dependent packages corresponding to each of the NPM packages from the scheduled batch tasks;
根据所述所依赖和被依赖的包列表,确定出依赖包数、被依赖包数;Determine the number of dependent packages and the number of dependent packages according to the list of dependent and dependent packages;
获取所述NPM包对应的配置文件的代码仓库地址,并通过爬取所述代码仓库地址,获取收藏数、源码开发分支数、关注源码数以及源码的代码推送合并数目;Obtain the code warehouse address of the configuration file corresponding to the NPM package, and obtain the number of favorites, the number of source code development branches, the number of concerned source code, and the number of code push merges of source code by crawling the code warehouse address;
通过爬取所述NPM包的后台数据,获取下载量、发布时间、源码收藏数。By crawling the background data of the NPM package, the download amount, the release time, and the number of source code collections are obtained.
可选地,所述根据每个所述NPM包的推荐值相关参数,确定出每个所述NPM包对应的推荐值,包括:Optionally, determining the recommended value corresponding to each of the NPM packages according to parameters related to the recommended values of each of the NPM packages, including:
根据公式:推荐值=第一预设关联值*依赖包数+第二预设关联值*被依赖包数+第三预设关联值*收藏数+第四预设关联值*下载量+第五预设关联值*发布时间+第六预设关联值*源码收藏数+第七预设关联值*源码开发分支数+第八预设关联值*关注源码数+第九预设关联值*源码的代码推送合并数目,计算出每个所述NPM包对应的推荐值。According to the formula: recommended value = first preset association value * number of dependent packages + second preset association value * number of dependent packages + third preset association value * favorites + fourth preset association value * downloads + the first The fifth preset association value*release time+the sixth preset association value*the number of source code collections+the seventh preset association value*the number of source code development branches+the eighth preset association value*the number of concerned source codes+the ninth preset association value* The number of code pushes of the source code is combined, and the recommended value corresponding to each NPM package is calculated.
另一方面,本发明实施例提供了一种NPM包的推荐装置,所述装置包括:On the other hand, an embodiment of the present invention provides an apparatus for recommending an NPM package, the apparatus comprising:
获取模块,用于获取客户端发送的检索请求,所述检索请求包括至少一个检索词;获取与每个所述检索词匹配的关键词;an obtaining module, configured to obtain a retrieval request sent by the client, where the retrieval request includes at least one retrieval term; obtain keywords matching each of the retrieval terms;
查询模块,用于根据每个所述关键词查询出与每个所述关键词对应的NPM包;从预先建立的推荐库中,查询出多个所述NPM包对应的推荐值;a query module, configured to query the NPM package corresponding to each of the keywords according to each of the keywords; from a pre-established recommendation library, query the recommendation values corresponding to a plurality of the NPM packages;
排序模块,用于根据推荐值对多个所述NPM包进行排序,得到排序后的NPM包;a sorting module, configured to sort a plurality of the NPM packages according to the recommended value to obtain the sorted NPM packages;
发送模块,用于将所述排序后的NPM包发送至所述客户端。A sending module, configured to send the sorted NPM packets to the client.
另一方面,本发明实施例提供了一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行上述NPM包的推荐方法。On the other hand, an embodiment of the present invention provides a storage medium, where the storage medium includes a stored program, wherein when the program runs, a device where the storage medium is located is controlled to execute the above-mentioned method for recommending an NPM package.
另一方面,本发明实施例提供了一种计算机设备,包括存储器和处理器,所述存储器用于存储包括程序指令的信息,所述处理器用于控制程序指令的执行,所述程序指令被处理器加载并执行时上述NPM包的推荐方法的步骤。On the other hand, an embodiment of the present invention provides a computer device including a memory and a processor, where the memory is used for storing information including program instructions, the processor is used for controlling the execution of the program instructions, and the program instructions are processed Steps of the recommended method for the above npm package when loaded and executed.
本发明实施例提供的技术方案中,通过获取客户端发送的检索请求,检索请求包括至少一个检索词,获取与每个检索词匹配的关键词,并根据每个关键词查询出与每个关键词对应的NPM包,从预先建立的推荐库中,查询出多个NPM包对应的推荐值,根据推荐值对多个NPM包进行排序,得到排序后的NPM包,将排序后的NPM包发送至客户端,以使得开发人员能够快速的检索到适合的NPM包,从而提高了检索效率,通过设置NPM包对应的推荐值,从而提升NPM包检索推荐的质量。In the technical solution provided by the embodiment of the present invention, a retrieval request sent by a client is obtained, the retrieval request includes at least one retrieval term, a keyword matching each retrieval term is acquired, and a keyword matching each retrieval term is queried according to each keyword. The NPM package corresponding to the word, from the pre-established recommendation database, query the recommended values corresponding to multiple NPM packages, sort the multiple NPM packages according to the recommended values, obtain the sorted NPM packages, and send the sorted NPM packages. to the client, so that developers can quickly retrieve suitable NPM packages, thereby improving retrieval efficiency. By setting the recommended values corresponding to NPM packages, the quality of NPM package retrieval recommendations can be improved.
【附图说明】【Description of drawings】
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1为本发明一实施例提供的一种NPM包的推荐方法的流程图;1 is a flowchart of a method for recommending an NPM package according to an embodiment of the present invention;
图2为本发明又一实施例提供的一种NPM包的推荐方法的流程图;2 is a flowchart of a method for recommending an NPM package provided by another embodiment of the present invention;
图3为本发明又一实施例提供的一种推荐值相关参数的示意图;FIG. 3 is a schematic diagram of a recommended value-related parameter according to another embodiment of the present invention;
图4为本发明一实施例提供的一种NPM包的推荐装置的结构示意图;4 is a schematic structural diagram of a device for recommending an NPM package according to an embodiment of the present invention;
图5为本发明实施例提供的一种计算机设备的示意图。FIG. 5 is a schematic diagram of a computer device according to an embodiment of the present invention.
【具体实施方式】【Detailed ways】
为了更好的理解本发明的技术方案,下面结合附图对本发明实施例进行详细描述。In order to better understand the technical solutions of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
应当明确,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。It should be understood that the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. As used in the embodiments of the present invention and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise.
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,甲和/或乙,可以表示:单独存在甲,同时存在甲和乙,单独存在乙这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" used in this article is only an association relationship to describe related objects, indicating that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, and A and B exist at the same time. B, there are three cases of B alone. In addition, the character "/" in this text generally indicates that the related objects are an "or" relationship.
图1为本发明一实施例提供的一种NPM包的推荐方法的流程图,如图1所示,该方法包括:FIG. 1 is a flowchart of a method for recommending an NPM package according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
步骤101、获取客户端发送的检索请求,检索请求包括至少一个检索词。Step 101: Obtain a retrieval request sent by the client, where the retrieval request includes at least one retrieval term.
步骤102、获取与每个检索词匹配的关键词,并根据每个关键词查询出与每个关键词对应的NPM包。Step 102: Acquire keywords matching each search term, and query the NPM package corresponding to each keyword according to each keyword.
步骤103、从预先建立的推荐库中,查询出多个NPM包对应的推荐值。Step 103: Query the recommendation values corresponding to multiple NPM packages from the pre-established recommendation database.
步骤104、根据推荐值对多个NPM包进行排序,得到排序后的NPM包。
步骤105、将排序后的NPM包发送至客户端。Step 105: Send the sorted NPM package to the client.
本发明实施例提供的技术方案中,通过获取客户端发送的检索请求,检索请求包括至少一个检索词,获取与每个检索词匹配的关键词,并根据每个关键词查询出与每个关键词对应的NPM包,从预先建立的推荐库中,查询出多个NPM包对应的推荐值,根据推荐值对多个NPM包进行排序,得到排序后的NPM包,将排序后的NPM包发送至客户端,以使得开发人员能够快速的检索到适合的NPM包,从而提高了检索效率,通过设置NPM包对应的推荐值,从而提升NPM包检索推荐的质量。In the technical solution provided by the embodiment of the present invention, a retrieval request sent by a client is obtained, the retrieval request includes at least one retrieval term, a keyword matching each retrieval term is acquired, and a keyword matching each retrieval term is queried according to each keyword. The NPM package corresponding to the word, from the pre-established recommendation database, query the recommended values corresponding to multiple NPM packages, sort the multiple NPM packages according to the recommended values, obtain the sorted NPM packages, and send the sorted NPM packages. to the client, so that developers can quickly retrieve suitable NPM packages, thereby improving retrieval efficiency. By setting the recommended values corresponding to NPM packages, the quality of NPM package retrieval recommendations can be improved.
通过上述NPM包的推荐方法能够适用于大部分NPM包管理平台的检索,为提高NPM包的推荐方法的实用性,下列为本发明提供的另一种NPM包的推荐方法。The above-mentioned NPM package recommendation method can be applied to the retrieval of most NPM package management platforms. In order to improve the practicability of the NPM package recommendation method, the following is another NPM package recommendation method provided by the present invention.
图2为本发明又一实施例提供的一种NPM包的推荐方法的流程图,如图2所示,该方法包括:FIG. 2 is a flowchart of a method for recommending an NPM package provided by another embodiment of the present invention. As shown in FIG. 2 , the method includes:
步骤201、通过定时批量任务采集多个NPM包。
本发明实施例中,各步骤由节点包管理器(NPM)执行。In this embodiment of the present invention, each step is performed by a Node Package Manager (NPM).
本发明实施例中,NPM包可包括新增的NPM包和历史的NPM包。通过定时批量任务采集多个NPM包可包括两种采集流程,第一种采集流程是采集新增的NPM包,通过执行后续步骤,计算出新增的NPM包的推荐值并存储至预先建立的推荐库,本发明通过设置NPM包对应的推荐值,从而提升NPM包检索推荐的质量。第二种采集流程是采集历史的NPM包,通过执行后续步骤,在推荐库更新历史的NPM包的推荐值,从而能够进一步提高检索的质量。In this embodiment of the present invention, the NPM package may include newly added NPM packages and historical NPM packages. Collecting multiple NPM packages through timed batch tasks can include two collection processes. The first collection process is to collect newly added NPM packages. By performing subsequent steps, the recommended values of the newly added NPM packages are calculated and stored in a pre-established NPM package. Recommendation library, the present invention improves the quality of NPM package retrieval recommendation by setting the recommendation value corresponding to the NPM package. The second collection process is to collect historical NPM packages. By performing subsequent steps, the recommended values of the historical NPM packages are updated in the recommendation database, so that the quality of retrieval can be further improved.
需要说明的是,若为第二种采集流程时,可直接执行步骤204,避免了解析历史的NPM包从而造成资源时间浪费导致检索效率低的问题。It should be noted that, in the case of the second collection process, step 204 can be directly executed, which avoids the problem of wasting resources and time resulting in low retrieval efficiency caused by parsing historical NPM packets.
步骤202、解析多个NPM包,获取每个NPM包对应的关键词。Step 202: Parse a plurality of NPM packages to obtain keywords corresponding to each NPM package.
本发明实施例中,通过定时批量任务采集NPM包,保证了后续步骤计算NPM包对应的推荐值的准确性,以及便于后续步骤计算的新增的NPM包对应的推荐值。In the embodiment of the present invention, collecting NPM packages through timed batch tasks ensures the accuracy of calculating the recommended value corresponding to the NPM package in the subsequent steps, and facilitates the calculation of the recommended value corresponding to the newly added NPM package in the subsequent steps.
本发明实施例中,步骤202可具体包括:In this embodiment of the present invention, step 202 may specifically include:
步骤2021、解析NPM包对应的配置文件,获取NPM对应的关键字段和描述字段。Step 2021: Parse the configuration file corresponding to the NPM package, and obtain the key fields and description fields corresponding to the NPM.
步骤2022、根据关键字段和描述字段,生成NPM包对应的关键词。本发明实施例中,例如NPM包中包括“序列化”的关键字段,则将该关键字段“序列化”作为该NPM包对应的关键词。需要说明的是,一个NPM包可具有多个关键词。本发明对于NPM包对应的关键词的数量不做限定,可根据需求自行设定。Step 2022: Generate a keyword corresponding to the NPM package according to the key field and the description field. In this embodiment of the present invention, for example, an NPM package includes a "serialization" key field, and the key field "serialization" is used as a keyword corresponding to the NPM package. It should be noted that an NPM package can have multiple keywords. The present invention does not limit the number of keywords corresponding to the NPM package, and can be set by itself according to requirements.
步骤203、获取与每个检索词匹配的关键词,并根据每个关键词查询出与每个关键词对应的NPM包。Step 203: Acquire keywords matching each search term, and query the NPM package corresponding to each keyword according to each keyword.
本发明实施例中,作为一种可选方案,关键词与检索词一致,从而能够提高检索的精确度,作为另一种可选方案,关键词为检索词的相近词或同义词,从而能够提高检索的效率,避免了输入的检索词过多,导致无法匹配对应的关键词,从而导致检索效率低的问题。In the embodiment of the present invention, as an optional solution, the keywords are consistent with the search terms, so that the accuracy of the search can be improved; as another optional solution, the keywords are similar words or synonyms of the search terms, thereby improving The efficiency of retrieval avoids the problem of low retrieval efficiency due to the inability to match the corresponding keywords due to the input of too many retrieval words.
步骤204、获取每个NPM包的推荐值相关参数。Step 204: Obtain the recommended value-related parameters of each NPM package.
本发明实施例中,推荐值相关参数包括依赖包数、被依赖包数、收藏数、下载量、发布时间、源码收藏数、源码开发分支数、关注源码数以及源码的代码推送合并数目。In the embodiment of the present invention, the parameters related to the recommended value include the number of dependent packages, the number of dependent packages, the number of favorites, the number of downloads, the release time, the number of source code collections, the number of source code development branches, the number of concerned source codes, and the number of code push merges of source code.
本发明实施例中,步骤204,具体包括:In this embodiment of the present invention, step 204 specifically includes:
步骤2041、从定时批量任务中查询出每个NPM包对应的所依赖和被依赖的包列表。Step 2041: Query the dependent and dependent package lists corresponding to each NPM package from the scheduled batch tasks.
本发明实施例中,具体地,在定时批量任务中通过查询每个NPM包对应的包文件获取每个NPM包对应的所依赖和被依赖的包列表。In the embodiment of the present invention, specifically, a list of dependent and dependent packages corresponding to each NPM package is obtained by querying the package file corresponding to each NPM package in a timed batch task.
需要说明的是,通过执行在每个NPM包对应的包文件查询出每个NPM包对应的所依赖和被依赖的包列表的定时批量任务之后,系统会更新每个NPM包对应的所依赖和被依赖的包列表,也就是说,通过定时批量任务即可获取到依赖包数、被依赖包数,避免了在获取依赖包数、被依赖包数时,需要重复从每个NPM包对应的包文件获取每个NPM包对应的所依赖和被依赖的包列表,造成检索耗时增加的问题,从而通过上述步骤,提高了检索的效率。It should be noted that after executing the scheduled batch task of querying the list of dependent and dependent packages corresponding to each NPM package in the package file corresponding to each NPM package, the system will update the dependent and dependent packages corresponding to each NPM package. The list of dependent packages, that is to say, the number of dependent packages and the number of dependent packages can be obtained through scheduled batch tasks, avoiding the need to repeat the corresponding data from each NPM package when obtaining the number of dependent packages and the number of dependent packages. The package file obtains the list of dependent and dependent packages corresponding to each NPM package, which causes the problem of increased retrieval time. Therefore, through the above steps, the retrieval efficiency is improved.
步骤2042、根据所依赖和被依赖的包列表,确定出依赖包数、被依赖包数。Step 2042: Determine the number of dependent packages and the number of dependent packages according to the list of dependent and dependent packages.
本发明实施例中,依赖包数(NPM dependencies)用于指示该NPM包所依赖的其他包的数量,被依赖包数(NPM dependes by others)用于指示该NPM包被其他包所依赖的数量。In this embodiment of the present invention, the number of dependent packages (NPM dependencies) is used to indicate the number of other packages that the NPM package depends on, and the number of dependent packages (NPM depends by others) is used to indicate the number of other packages that the NPM package depends on. .
步骤2043、获取NPM包对应的配置文件的代码仓库地址,并通过爬取代码仓库地址,获取收藏数、源码开发分支数、关注源码数以及源码的代码推送合并数目。Step 2043: Obtain the code warehouse address of the configuration file corresponding to the NPM package, and obtain the number of favorites, the number of source code development branches, the number of concerned source code, and the number of code push merges of source code by crawling the code warehouse address.
本发明实施例中,收藏数(NPM stars)用于指示该NPM包的收藏数,源码开发分支数(Github forks)用于指示该NPM包源代码的开发分支树的数量,关注源码数(Githubwatch)用于指示关注该NPM包源代码的数量,源码的代码推送合并数目(Github pullrequest)用于指示该NPM包源代码的代码推送合并数目。In this embodiment of the present invention, the number of favorites (NPM stars) is used to indicate the number of favorites of the NPM package, the number of source code development branches (Github forks) is used to indicate the number of development branch trees of the source code of the NPM package, and the number of concerned source code (Githubwatch ) is used to indicate the number of source codes of the NPM package concerned, and the number of code push merges of the source code (Github pullrequest) is used to indicate the number of code push merges of the source code of the NPM package.
步骤2044、通过爬取NPM包的后台数据,获取下载量、发布时间、源码收藏数。Step 2044: Obtain the download amount, release time, and the number of source code collections by crawling the background data of the NPM package.
本发明实施例中,下载量(NPM downloads)用于指示该NPM包的下载量,发布时间(NPM last publish)用于指示该NPM包最后一次发布到节点包管理平台的时间,源码收藏数(Github stars)用于指示该NPM包源代码的收藏数。In this embodiment of the present invention, the download amount (NPM downloads) is used to indicate the download amount of the NPM package, the release time (NPM last publish) is used to indicate the time when the NPM package was last published to the node package management platform, the number of source code collections ( Github stars) is used to indicate the number of favorites of the source code of the NPM package.
本发明实施例中,此外,后台数据还可以包括其他数据信息,对此不做限定。In this embodiment of the present invention, in addition, the background data may also include other data information, which is not limited.
在实际应用中,相关技术通常在检索时,只采用检索词匹配关键词的方式,即将匹配到的关键词对应的NPM包进行展示,而本发明实施例中,通过获取上述各维度的推荐值相关参数之后,从而能够执行后续步骤的计算每个NPM包对应的推荐值,并将符合条件的NPM包进行排序展示,通过设置NPM包对应的推荐值,相对于相关技术而言,提升了NPM包检索推荐的质量。In practical applications, related technologies usually only use the method of matching keywords with search terms during retrieval, that is, the NPM packages corresponding to the matched keywords are displayed. In the embodiment of the present invention, the recommended values of the above dimensions are obtained by obtaining After the relevant parameters, the following steps can be performed to calculate the recommended value corresponding to each NPM package, and the qualified NPM packages can be displayed in order. By setting the recommended value corresponding to the NPM package, compared with related technologies, NPM is improved. The quality of the package retrieval recommendation.
步骤205、根据每个NPM包的推荐值相关参数,确定出每个NPM包对应的推荐值。Step 205: Determine the recommended value corresponding to each NPM package according to the parameters related to the recommended value of each NPM package.
本发明实施例中,步骤205,具体包括:根据公式:推荐值=第一预设关联值*依赖包数+第二预设关联值*被依赖包数+第三预设关联值*收藏数+第四预设关联值*下载量+第五预设关联值*发布时间+第六预设关联值*源码收藏数+第七预设关联值*源码开发分支数+第八预设关联值*关注源码数+第九预设关联值*源码的代码推送合并数目,计算出每个NPM包对应的推荐值。In this embodiment of the present invention, step 205 specifically includes: according to the formula: recommended value = first preset association value * number of dependent packages + second preset association value * number of dependent packages + third preset association value * number of favorites +The fourth preset association value*downloads+the fifth preset association value*release time+the sixth preset association value*the number of source code collections+the seventh preset association value*the number of source code development branches+the eighth preset association value *Follow the number of source code + the ninth default association value * the number of code pushes of the source code, and calculate the recommended value corresponding to each NPM package.
在本发明实施例中,第一预设关联值、第二预设关联值、第三预设关联值、第四预设关联值、第五预设关联值、第六预设关联值、第七预设关联值、第八预设关联值以及第九预设关联值可根据采集一段时间的开发人员检索NPM包的行为分析得到的,可以根据需求进行动态调整。可通过人为训练的方式,或者机器训练的方式对设置的预设关联值进行动态调整。其中,第一预设关联值、第二预设关联值、第三预设关联值、第四预设关联值、第五预设关联值、第六预设关联值、第七预设关联值、第八预设关联值以及第九预设关联值的取值范围为[0,1],例如第一预设关联值为0.5。In this embodiment of the present invention, the first preset association value, the second preset association value, the third preset association value, the fourth preset association value, the fifth preset association value, the sixth preset association value, the The seventh preset association value, the eighth preset association value, and the ninth preset association value can be obtained by analyzing the behavior of the developer retrieving the NPM package collected for a period of time, and can be dynamically adjusted according to requirements. The preset associated value can be dynamically adjusted through human training or machine training. Among them, the first preset association value, the second preset association value, the third preset association value, the fourth preset association value, the fifth preset association value, the sixth preset association value, and the seventh preset association value The value range of , the eighth preset association value and the ninth preset association value is [0, 1], for example, the first preset association value is 0.5.
在一种具体的实现方式中,通过公式:hq=aO+bP+cQ+dR+eS+fX+gY+hZ+iM,计算出每个NPM包对应的推荐值,其中,hq表示为NPM包对应的推荐值,a表示为第一预设关联值,b表示为第二预设关联值,c表示为第三预设关联值,d表示为第四预设关联值,e表示为第五预设关联值,f表示为第六预设关联值,g表示为第七预设关联值,h表示为第八预设关联值,i表示为第九预设关联值,O表示为依赖包数,P表示为被依赖包数,Q表示为收藏数,R表示为下载量,S表示为发布时间,X表示为源码收藏数,Y表示为源码开发分支数,Z表示为关注源码数,M表示为源码的代码推送合并数目。In a specific implementation manner, the recommended value corresponding to each NPM package is calculated by the formula: hq=aO+bP+cQ+dR+eS+fX+gY+hZ+iM, where hq represents the NPM package The corresponding recommended value, a represents the first preset correlation value, b represents the second preset correlation value, c represents the third preset correlation value, d represents the fourth preset correlation value, and e represents the fifth preset correlation value. The preset association value, f is the sixth preset association value, g is the seventh preset association value, h is the eighth preset association value, i is the ninth preset association value, and O is the dependency package number, P represents the number of dependent packages, Q represents the number of favorites, R represents the number of downloads, S represents the release time, X represents the number of source code collections, Y represents the number of source code development branches, and Z represents the number of source code concerned, M represents the number of code push merges for the source code.
例如,如图3所示,通过采集一段时间的开发人员检索NPM包的行为分析得到:依赖包数O对应的第一预设关联值a的关联程度是最低,而被依赖包数P对应的第二预设关联值b的关联程度大于第一预设关联值a,下载量R对应的第四预设关联值最高,因此根据获取的各个推荐值相关参数对应的预设关联值的关联程度,能够计算出该NPM包对应的推荐值。For example, as shown in Fig. 3, it is obtained by collecting the behavior analysis of developers retrieving NPM packages for a period of time: the first preset correlation value a corresponding to the number of dependent packages O has the lowest degree of correlation, while the number of dependent packages P corresponds to The association degree of the second preset association value b is greater than the first preset association value a, and the fourth preset association value corresponding to the download amount R is the highest. Therefore, according to the obtained association degree of the preset association value corresponding to each recommended value-related parameter , the recommended value corresponding to the NPM package can be calculated.
本发明实施例中,通过获取上述各维度的推荐值相关参数之后,从而能够计算每个NPM包对应的推荐值,并将符合条件的NPM进行排序展示,通过设置NPM包对应的推荐值,相对于相关技术而言,提升了NPM包检索推荐的质量。In the embodiment of the present invention, after obtaining the recommended value-related parameters of the above-mentioned dimensions, the recommended value corresponding to each NPM package can be calculated, and the qualified NPMs can be displayed in order. By setting the recommended value corresponding to the NPM package, relative For the related art, the quality of NPM package retrieval recommendation is improved.
步骤206、在预先建立的推荐库中存储或更新多个NPM信息,NPM信息包括获取的NPM包、NPM包对应的关键词以及NPM包对应的推荐值。Step 206: Store or update a plurality of NPM information in a pre-established recommendation library, where the NPM information includes the acquired NPM package, keywords corresponding to the NPM package, and recommendation values corresponding to the NPM package.
需要说明的是,若该NPM包为新增的NPM包时,由于预先建立的推荐库未存储有新增的NPM包对应的NPM信息,因此需要在预先建立的推荐库中存储该新增的NPM包对应的NPM信息。若该NPM包为历史的NPM包时,由于预先建立的推荐库已存储有该历史的NPM包对应的NPM信息,由于考虑到下载量,收藏量等推荐值相关参数为实时更新的状态,因此需要定时计算历史的NPM对应的推荐值,因此需要在预先建立的推荐库中更新该新增的NPM包对应的NPM信息,具体地,更新该新增的NPM包对应的推荐值。It should be noted that, if the NPM package is a newly-added NPM package, since the pre-established recommendation library does not store the NPM information corresponding to the newly-added NPM package, it is necessary to store the newly-added recommendation library in the pre-established recommendation library. NPM information corresponding to the NPM package. If the NPM package is a historical NPM package, since the pre-established recommendation library has stored the NPM information corresponding to the historical NPM package, and considering the download amount, the collection amount and other related parameters of the recommended value are updated in real time, so The recommendation value corresponding to the historical NPM needs to be calculated regularly, so the NPM information corresponding to the newly added NPM package needs to be updated in the pre-established recommendation database, and specifically, the recommendation value corresponding to the newly added NPM package needs to be updated.
本发明实施例中,通过执行步骤206之后,使得接收到客户端的检索请求时,能够根据推荐库,快速查询出符合开发人员要求的且推荐值高的NPM包,避免了当客户端发送检索请求时,再进行计算NPM包对应的推荐值,增加时间成本,设备负担的问题,从而节省了计算时间,提高了检索效率。In this embodiment of the present invention, after
步骤207、获取客户端发送的检索请求,检索请求包括至少一个检索词。Step 207: Obtain a retrieval request sent by the client, where the retrieval request includes at least one retrieval term.
本发明实施例中,在一种实现方式中,开发人员可通过在节点包管理平台的搜索框中输入检索词,该检索词可为一个或多个。In the embodiment of the present invention, in an implementation manner, the developer can input a search term in the search box of the node package management platform, and the search term can be one or more.
步骤208、从预先建立的推荐库中,查询出多个NPM包对应的推荐值。Step 208: Query the recommendation values corresponding to multiple NPM packages from the pre-established recommendation database.
步骤209、根据推荐值对多个NPM包进行排序,得到排序后的NPM包。
本发明实施例中,在一种可选方案中,步骤209可具体包括:按照推荐值高到低的排序关系对多个NPM包进行排序,得到排序后的NPM包。In the embodiment of the present invention, in an optional solution,
步骤210、将排序后的NPM包发送至客户端。Step 210: Send the sorted NPM package to the client.
本发明实施例中,通过选排序后的NPM包发送至客户端,以便开发人员能够快速查看适合的NPM包,从而能够提升NPM包检索推荐的质量。In the embodiment of the present invention, the sorted NPM packages are sent to the client, so that developers can quickly view suitable NPM packages, thereby improving the quality of NPM package retrieval recommendations.
本发明实施例中,在另一种可选方案中,步骤209之后还可以包括:In this embodiment of the present invention, in another optional solution, after
步骤210’、排序后的NPM包列表中选取出推荐值最高的前N个NPM包。Step 210': Select the top N NPM packages with the highest recommended values from the sorted NPM package list.
步骤211’、将推荐值最高的前N个NPM包发送至客户端。Step 211': Send the top N NPM packets with the highest recommended values to the client.
本发明实施例中,N的取值可根据需求进行设定,可由系统默认设置或者是开发人员设置。本发明实施例中,通过选取出推荐值最高的前N个NPM包发送至客户端,能够给开发人员推荐最匹配的NPM包,同时确保该NPM包在同等符合检索条件的情况下,将质量最优、维护最稳定的NPM包,返回给开发人员,使开发人员能够以最低的成本检索到最合适应用到业务项目的NPM包,进一步提升NPM包检索推荐的质量。In this embodiment of the present invention, the value of N can be set according to requirements, and can be set by a system default or by a developer. In the embodiment of the present invention, by selecting the top N NPM packages with the highest recommended values and sending them to the client, it is possible to recommend the most matching NPM packages to developers, and at the same time, it is ensured that the quality of the NPM packages equally meets the retrieval conditions. The optimal and most stable NPM packages are returned to developers, enabling developers to retrieve the most suitable NPM packages for business projects at the lowest cost, further improving the quality of NPM package retrieval recommendations.
本发明实施例中,在步骤211’之后,还包括:In this embodiment of the present invention, after step 211', it further includes:
步骤212、向客户端发送评估消息,以使客户端对推荐值最高的前N个NPM包进行评估,生成评估结果。Step 212: Send an evaluation message to the client, so that the client evaluates the top N NPM packages with the highest recommendation value, and generates an evaluation result.
本发明实施例中,例如,N=3。在一种实现方式中,将推荐值最高的前3个NPM包发送至客户端后,开发人员进行了更换下一批NPM包的操作,从而根据该开发人员的操作,生成这3个NPM包的评估结果,例如,评估结果为不符合开发人员需求。In this embodiment of the present invention, for example, N=3. In one implementation, after the first 3 NPM packages with the highest recommended values are sent to the client, the developer performs the operation of replacing the next batch of NPM packages, so as to generate these 3 NPM packages according to the developer's operation The evaluation result, for example, the evaluation result is that it does not meet the developer's needs.
步骤213、根据评估结果,调整推荐值最高的前N个NPM包中每个NPM包对应的推荐值中的多个预设关联值,并继续执行步骤205。Step 213 , according to the evaluation result, adjust a plurality of preset association values in the recommendation value corresponding to each NPM package in the top N NPM packages with the highest recommendation value, and continue to perform
本发明实施例中,以上述实现方式为例,根据该评估结果,降低推荐值最高的前3个NPM包对应的预设关联值,使得这3个NPM包对应的推荐值降低,从而能够提高NPM包的检索质量。反之,若评估结果为符合开发人员需求,则提高推荐值最高的前3个NPM包对应的预设关联值,使得这3个NPM包对应的推荐值提高,进一步能够提高NPM包的检索质量。In the embodiment of the present invention, taking the above implementation manner as an example, according to the evaluation result, the preset association values corresponding to the first three NPM packages with the highest recommended values are reduced, so that the recommended values corresponding to these three NPM packages are reduced, thereby improving the Retrieval quality of NPM packages. Conversely, if the evaluation result is in line with the developer's needs, the preset association values corresponding to the first three NPM packages with the highest recommended values are increased, so that the recommended values corresponding to these three NPM packages are improved, which can further improve the retrieval quality of NPM packages.
本发明实施例中,作为一种可选方案,评估消息可包括评估列表。除此之外还可以评估消息的具体表现形式还可以包括其他形式,本发明对此不做限定,目的只在于对推荐值最高的前N个NPM包进行评估。In this embodiment of the present invention, as an optional solution, the evaluation message may include an evaluation list. In addition to this, the specific expression form of the evaluation message may also include other forms, which are not limited in the present invention, and the purpose is only to evaluate the top N NPM packages with the highest recommended values.
本发明实施例中,通过向客户端发送评估消息,并根据客户端反馈的评估结果,对第一预设关联值、第二预设关联值、第三预设关联值、第四预设关联值、第五预设关联值、第六预设关联值、第七预设关联值、第八预设关联值以及第九预设关联值进行动态调整,即通过后期不断微调预设关联值,从而能够提升关联程度参数的准确性,进一步提升NPM包检索推荐的质量,进一步提高了NPM包检索推荐的质量。In this embodiment of the present invention, by sending an evaluation message to the client, and according to the evaluation result fed back by the client, the first preset association value, the second preset association value, the third preset association value, and the fourth preset association value are evaluated. value, the fifth preset association value, the sixth preset association value, the seventh preset association value, the eighth preset association value and the ninth preset association value are dynamically adjusted, that is, by continuously fine-tuning the preset association value in the later stage, Therefore, the accuracy of the association degree parameter can be improved, the quality of the NPM package retrieval recommendation can be further improved, and the quality of the NPM package retrieval recommendation can be further improved.
本发明实施例中,通过获取客户端发送的检索请求,检索请求包括至少一个检索词,获取与每个检索词匹配的关键词,并根据每个关键词查询出与每个关键词对应的NPM包,从预先建立的推荐库中,查询出多个NPM包对应的推荐值,根据推荐值对多个NPM包进行排序,得到排序后的NPM包,将排序后的NPM包发送至客户端,以使得开发人员能够快速的检索到适合的NPM包,从而提高了检索效率,通过设置NPM包对应的推荐值,从而提升NPM包检索推荐的质量。In this embodiment of the present invention, a retrieval request sent by a client is obtained, the retrieval request includes at least one retrieval term, a keyword matching each retrieval term is obtained, and an NPM corresponding to each keyword is queried according to each keyword. package, from the pre-established recommendation library, query the recommendation values corresponding to multiple NPM packages, sort multiple NPM packages according to the recommended values, obtain the sorted NPM packages, and send the sorted NPM packages to the client, This enables developers to quickly retrieve suitable NPM packages, thereby improving retrieval efficiency. By setting the recommended values corresponding to NPM packages, the quality of NPM package retrieval recommendations can be improved.
图4为本发明一实施例提供的一种NPM包的推荐装置的结构示意图,如图4所示,装置应用于计算机设备。该装置包括:第一获取模块11、查询模块12、排序模块13和发送模块14。FIG. 4 is a schematic structural diagram of an apparatus for recommending an NPM package according to an embodiment of the present invention. As shown in FIG. 4 , the apparatus is applied to computer equipment. The apparatus includes: a first obtaining
第一获取模块11用于获取客户端发送的检索请求,所述检索请求包括至少一个检索词。The first obtaining
所述第一获取模块11还用于获取与每个所述检索词匹配的关键词。The first obtaining
查询模块12用于根据每个所述关键词查询出与每个所述关键词对应的NPM包。The
所述查询模块12还用于从预先建立的推荐库中,查询出多个所述NPM包对应的推荐值。The
排序模块13用于根据推荐值对多个所述NPM包进行排序,得到排序后的NPM包。The sorting
发送模块14用于将所述排序后的NPM包发送至所述客户端。The sending
本发明实施例中,该装置的排序模块13具体用于按照推荐值高到低的排序关系对所述多个NPM包进行排序,得到排序后的NPM包。In the embodiment of the present invention, the sorting
本发明实施例中,该装置还包括:采集模块15和解析模块16。In the embodiment of the present invention, the apparatus further includes: a
采集模块15用于通过定时批量任务采集多个NPM包。The
解析模块16用于解析多个所述NPM包,获取每个NPM包对应的关键词。The
本发明实施例中,该装置的解析模块16具体用于解析所述NPM包对应的配置文件,获取所述NPM对应的关键字段和描述字段;根据所述关键字段和所述描述字段,生成所述NPM包对应的关键词。In the embodiment of the present invention, the parsing
本发明实施例中,所述推荐值相关参数包括依赖包数、被依赖包数、收藏数、下载量、发布时间、源码收藏数、源码开发分支数、关注源码数以及源码的代码推送合并数目;该装置还包括:第二获取模块17、确定模块18和存储/更新模块19。In the embodiment of the present invention, the parameters related to the recommended value include the number of dependent packages, the number of dependent packages, the number of favorites, the number of downloads, the release time, the number of source code favorites, the number of source code development branches, the number of concerned source codes, and the number of code push merges of source code ; The device further includes: a
第二获取模块17用于获取每个所述NPM包的推荐值相关参数。The second obtaining
确定模块18用于根据每个所述NPM包的推荐值相关参数,确定出每个所述NPM包对应的推荐值。The determining
存储/更新模块19用于在预先建立的推荐库中存储或更新多个NPM包信息,所述NPM包信息包括获取的所述NPM包、所述NPM包对应的关键词以及所述NPM包对应的推荐值。The storage/
本发明实施例中,该装置的第一获取模块11具体包括:查询子模块111、确定子模块112、获取子模块113和爬取子模块114。In the embodiment of the present invention, the
查询子模块111用于从定时批量任务中查询出每个所述NPM包对应的所依赖和被依赖的包列表。The query sub-module 111 is configured to query the list of dependent and dependent packages corresponding to each NPM package from the scheduled batch tasks.
确定子模块112用于根据所述所依赖和被依赖的包列表,确定出依赖包数、被依赖包数。The determining
获取子模块113用于获取所述NPM包对应的配置文件的代码仓库地址。The obtaining sub-module 113 is configured to obtain the code repository address of the configuration file corresponding to the NPM package.
爬取子模块114用于并通过爬取所述代码仓库地址,获取收藏数、源码开发分支数、关注源码数以及源码的代码推送合并数目。The crawling sub-module 114 is used to obtain the number of favorites, the number of source code development branches, the number of concerned source code, and the number of code push merges of source code by crawling the code warehouse address.
爬取子模块114还用于通过爬取所述NPM包的后台数据,获取下载量、发布时间、源码收藏数。The crawling sub-module 114 is further configured to obtain the download amount, release time, and the number of source code collections by crawling the background data of the NPM package.
本发明实施例中,该装置的确定模块18具体用于根据公式:推荐值=第一预设关联值*依赖包数+第二预设关联值*被依赖包数+第三预设关联值*收藏数+第四预设关联值*下载量+第五预设关联值*发布时间+第六预设关联值*源码收藏数+第七预设关联值*源码开发分支数+第八预设关联值*关注源码数+第九预设关联值*源码的代码推送合并数目,计算出每个所述NPM包对应的推荐值。In this embodiment of the present invention, the determining
本实施例提供的NPM包的推荐装置可用于实现上述图1或图2中的NPM包的推荐方法,具体描述可参见上述NPM包的推荐方法的实施例,此处不再重复描述。The apparatus for recommending an NPM package provided in this embodiment can be used to implement the method for recommending an NPM package in the foregoing FIG. 1 or FIG. 2 . For a specific description, refer to the embodiment of the foregoing method for recommending an NPM package, which will not be repeated here.
本发明实施例提供的NPM包的推荐装置的技术方案中,通过获取客户端发送的检索请求,检索请求包括至少一个检索词,获取与每个检索词匹配的关键词,并根据每个关键词查询出与每个关键词对应的NPM包,从预先建立的推荐库中,查询出多个NPM包对应的推荐值,根据推荐值对多个NPM包进行排序,得到排序后的NPM包,将排序后的NPM包发送至客户端,以使得开发人员能够快速的检索到适合的NPM包,从而提高了检索效率,通过设置NPM包对应的推荐值,从而提升NPM包检索推荐的质量。In the technical solution of the device for recommending NPM packages provided by the embodiment of the present invention, the retrieval request sent by the client is obtained, and the retrieval request includes at least one retrieval term, the keywords matching each retrieval term are obtained, and each keyword Query the NPM package corresponding to each keyword, query the recommended values corresponding to multiple NPM packages from the pre-established recommendation database, sort the multiple NPM packages according to the recommended values, and obtain the sorted NPM package, The sorted NPM packages are sent to the client, so that developers can quickly retrieve suitable NPM packages, thereby improving the retrieval efficiency. By setting the recommended values corresponding to the NPM packages, the quality of NPM package retrieval recommendations can be improved.
本发明实施例提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行上述NPM包的推荐方法的实施例的各步骤,具体描述可按照上述NPM包的推荐方法的实施例。An embodiment of the present invention provides a storage medium, where the storage medium includes a stored program, wherein, when the program runs, the device where the storage medium is located is controlled to execute the steps of the embodiment of the above-mentioned NPM package recommendation method. The specific description can be based on the above-mentioned NPM package Examples of recommended methods.
本发明实施例提供了一种计算机设备,包括存储器和处理器,存储器用于存储包括程序指令的信息,处理器用于控制程序指令的执行,程序指令被处理器加载并执行时实现上述NPM包的推荐方法的实施例的各步骤,具体描述可按照上述NPM包的推荐方法的实施例。An embodiment of the present invention provides a computer device, including a memory and a processor, where the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the above-mentioned NPM package is implemented. Each step of the embodiment of the recommended method can be described in detail according to the embodiment of the recommended method of the NPM package above.
图5为本发明实施例提供的一种计算机设备的示意图。如图5所示,该实施例的计算机设备30包括:处理器31、存储器32以及存储在存储32中并可在处理器31上运行的计算机程序33,该计算机程序33被处理器31执行时实现实施例中的应用于NPM包的推荐方法,为避免重复,此处不一一赘述。或者,该计算机程序被处理器31执行时实现实施例中应用于NPM包的推荐装置中各模型/单元的功能,为避免重复,此处不一一赘述。FIG. 5 is a schematic diagram of a computer device according to an embodiment of the present invention. As shown in FIG. 5 , the
计算机设备30包括,但不仅限于,处理器31、存储器32。本领域技术人员可以理解,图5仅仅是计算机设备30的示例,并不构成对计算机设备30的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如计算机设备还可以包括输入输出设备、网络接入设备、总线等。The
所称处理器31可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called
存储器32可以是计算机设备30的内部存储单元,例如计算机设备30的硬盘或内存。存储器32也可以是计算机设备30的外部存储设备,例如计算机设备30上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器32还可以既包括计算机设备30的内部存储单元也包括外部存储设备。存储器32用于存储计算机程序以及计算机设备所需的其他程序和数据。存储器32还可以用于暂时地存储已经输出或者将要输出的数据。The
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above may refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在本发明所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)或处理器(Processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (Processor) to execute the methods described in the various embodiments of the present invention. some steps. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the present invention. within the scope of protection.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010579732.6A CN111814041A (en) | 2020-06-23 | 2020-06-23 | A recommended method, apparatus, storage medium and computer equipment for an NPM package |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010579732.6A CN111814041A (en) | 2020-06-23 | 2020-06-23 | A recommended method, apparatus, storage medium and computer equipment for an NPM package |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN111814041A true CN111814041A (en) | 2020-10-23 |
Family
ID=72845552
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010579732.6A Pending CN111814041A (en) | 2020-06-23 | 2020-06-23 | A recommended method, apparatus, storage medium and computer equipment for an NPM package |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111814041A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112416338A (en) * | 2020-11-26 | 2021-02-26 | 上海睿成软件有限公司 | Code warehouse system based on label |
| CN113050937A (en) * | 2021-04-21 | 2021-06-29 | 中国工商银行股份有限公司 | Front-end data processing method and device based on command line |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102955779A (en) * | 2011-08-18 | 2013-03-06 | 腾讯科技(深圳)有限公司 | Method and device for searching software |
| CN108108380A (en) * | 2016-11-25 | 2018-06-01 | 阿里巴巴集团控股有限公司 | Search ordering method, searching order device, searching method and searcher |
| CN110869910A (en) * | 2017-08-31 | 2020-03-06 | 深圳市欢太科技有限公司 | Search resource recommendation method and related product |
-
2020
- 2020-06-23 CN CN202010579732.6A patent/CN111814041A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102955779A (en) * | 2011-08-18 | 2013-03-06 | 腾讯科技(深圳)有限公司 | Method and device for searching software |
| CN108108380A (en) * | 2016-11-25 | 2018-06-01 | 阿里巴巴集团控股有限公司 | Search ordering method, searching order device, searching method and searcher |
| CN110869910A (en) * | 2017-08-31 | 2020-03-06 | 深圳市欢太科技有限公司 | Search resource recommendation method and related product |
Non-Patent Citations (1)
| Title |
|---|
| 腾讯云开发者社区成员: "npm-入门-查找和选择包", pages 1, Retrieved from the Internet <URL:https://cloud.tencent.cn/developer/section/1490232> * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112416338A (en) * | 2020-11-26 | 2021-02-26 | 上海睿成软件有限公司 | Code warehouse system based on label |
| CN113050937A (en) * | 2021-04-21 | 2021-06-29 | 中国工商银行股份有限公司 | Front-end data processing method and device based on command line |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112800095B (en) | Data processing method, device, equipment and storage medium | |
| US11775501B2 (en) | Trace and span sampling and analysis for instrumented software | |
| US10453165B1 (en) | Computer vision machine learning model execution service | |
| US7657515B1 (en) | High efficiency document search | |
| US8219581B2 (en) | Method and system for analyzing ordered data using pattern matching in a relational database | |
| CN103544220B (en) | Using recommendation method and apparatus | |
| CN110968582A (en) | Crowd generation method and device | |
| CN111078276B (en) | Application redundant resource processing method, device, equipment and storage medium | |
| CN104834660A (en) | Interval based fuzzy database search | |
| CN116578389A (en) | Automatic generation method and device for container mirror image configuration file based on template representation | |
| CN110781217B (en) | Method and device for processing ordered data, storage medium and server | |
| CN109885729B (en) | Method, device and system for displaying data | |
| CN111814041A (en) | A recommended method, apparatus, storage medium and computer equipment for an NPM package | |
| CN117971873A (en) | Method and device for generating Structured Query Language (SQL) and electronic equipment | |
| US11978067B2 (en) | Determining patterns within a string sequence of user actions | |
| CN108345600B (en) | Management of search application, data search method and device thereof | |
| US12067029B2 (en) | Apparatus and method for managing and collecting metadata | |
| CN114780262B (en) | A page service processing method, device, equipment and storage medium | |
| CN114257528B (en) | Method, device, electronic device and storage medium for selecting Internet of Things devices | |
| CN117726393A (en) | Order data query method and device, electronic equipment and storage medium | |
| CN111711605B (en) | Data protocol active analysis method for Internet of things platform | |
| CN115168509A (en) | Processing method and device of wind control data, storage medium and computer equipment | |
| CN110502690B (en) | Classified search method and device | |
| CN114218259A (en) | Multidimensional science and technology innovation information search method and system based on big data SaaS | |
| CN108182201B (en) | Application expansion method and device based on key keywords |
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 | ||
| WD01 | Invention patent application deemed withdrawn after publication | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20201023 |