CN111814041A - NPM package recommendation method and device, storage medium and computer equipment - Google Patents

NPM package recommendation method and device, storage medium and computer equipment Download PDF

Info

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
packet
packets
recommendation
keyword
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
Application number
CN202010579732.6A
Other languages
Chinese (zh)
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202010579732.6A priority Critical patent/CN111814041A/en
Publication of CN111814041A publication Critical patent/CN111814041A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; 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

The embodiment of the invention provides a method, a device, a storage medium and a computer device for recommending an NPM packet, wherein a retrieval request sent by a client is obtained, the retrieval request comprises at least one retrieval word, the keyword matched with each retrieval word is obtained, the NPM packet corresponding to each keyword is inquired according to each keyword, the recommendation values corresponding to a plurality of NPM packets are inquired from a pre-established recommendation library, the NPM packets are sequenced according to the recommendation values to obtain sequenced NPM packets, and the sequenced NPM packets are sent to the client, so that developers can quickly retrieve the appropriate NPM packets, the retrieval efficiency is improved, and the quality of NPM packet retrieval recommendation is improved by setting the recommendation values corresponding to the NPM packets.

Description

NPM package recommendation method and device, storage medium and computer equipment
[ technical field ] A method for producing a semiconductor device
The invention relates to the field of keyword matching, in particular to a method and a device for recommending an NPM (network provider model) package, a storage medium and computer equipment.
[ background of the invention ]
A Node Package Manager (NPM) is a node.js-based Package Manager. With NPM, developers can easily share and reuse code. The quality of the NPM pack is variable due to the openness of the NPM. Currently, most NPM package management platforms provide a function of retrieving a corresponding NPM package by searching for a keyword. However, because the base number of the NPM packets is huge, many NPM packets may be retrieved from the same keyword, thereby causing a problem of poor quality of the retrieved NPM packets.
[ summary of the invention ]
In view of this, embodiments of the present invention provide a method, an apparatus, a storage medium, and a computer device for recommending an NPM packet, so as to improve the quality of the retrieval recommendation of the NPM packet by setting a recommendation value corresponding to the NPM packet.
In one aspect, an embodiment of the present invention provides a method for recommending an NPM packet, where the method includes:
acquiring a retrieval request sent by a client, wherein the retrieval request comprises at least one retrieval word;
acquiring keywords matched with each search term, and inquiring an NPM packet corresponding to each keyword according to each keyword;
inquiring a plurality of recommendation values corresponding to the NPM packets from a pre-established recommendation library;
sequencing the NPM packets according to the recommended values to obtain sequenced NPM packets;
and sending the sequenced NPM packets to the client.
Optionally, the sorting the plurality of NPM packets according to the recommended value to obtain sorted NPM packets includes:
and sequencing the NPM packets according to the sequencing relation of the recommended values from high to low to obtain the sequenced NPM packets.
Optionally, before the obtaining of the keyword matched with each search term and querying an NPM packet corresponding to each keyword according to each keyword, the method further includes:
collecting a plurality of NPM packets through timed batch tasks;
and analyzing the plurality of NPM packets to obtain the corresponding keywords of each NPM packet.
Optionally, the analyzing the plurality of NPM packets to obtain the keyword corresponding to each NPM packet includes:
analyzing a configuration file corresponding to the NPM packet, and acquiring a key field and a description field corresponding to the NPM;
and generating a keyword corresponding to the NPM packet according to the key field and the description field.
Optionally, before querying a plurality of recommendation values corresponding to the NPM packet from the pre-established recommendation library, the method further includes:
acquiring a recommended value related parameter of each NPM packet;
determining a recommended value corresponding to each NPM packet according to the recommended value related parameter of each NPM packet;
storing or updating a plurality of NPM packet information in a pre-established recommendation library, wherein the NPM packet information comprises the obtained NPM packet, a keyword corresponding to the NPM packet and a recommendation value corresponding to the NPM packet.
Optionally, the recommended value related parameters include a dependent package number, a collection number, a download amount, release time, a source code collection number, a source code development branch number, an attention source code number, and a code pushing and merging number of source codes;
the obtaining of the recommended value related parameter of each NPM packet includes:
inquiring a dependent and depended packet list corresponding to each NPM packet from a timing batch task;
determining the number of the dependent packets and the number of the depended packets according to the depended and depended packet lists;
acquiring a code warehouse address of a configuration file corresponding to the NPM packet, and acquiring a collection number, a source code development branch number, an attention source code number and a code pushing and combining number of source codes by crawling the code warehouse address;
and crawling background data of the NPM packet to obtain the downloading amount, the release time and the source code collection number.
Optionally, the determining, according to the parameter related to the recommended value of each NPM packet, the recommended value corresponding to each NPM packet includes:
according to the formula: and calculating the code pushing and merging number of the recommended value, namely a first preset correlation value, a dependent packet number, a second preset correlation value, a dependent packet number, a third preset correlation value, a collection number, a fourth preset correlation value, a downloading amount, a fifth preset correlation value, a release time, a sixth preset correlation value, a source code collection number, a seventh preset correlation value, a source code development branch number, an eighth preset correlation value, an attention source code number and a ninth preset correlation value, and calculating the recommended value corresponding to each NPM packet.
On the other hand, an embodiment of the present invention provides an apparatus for recommending an NPM packet, where the apparatus includes:
the system comprises an acquisition module, a search module and a search module, wherein the acquisition module is used for acquiring a search request sent by a client, and the search request comprises at least one search term; acquiring a keyword matched with each search term;
the query module is used for querying the NPM packet corresponding to each keyword according to each keyword; inquiring a plurality of recommendation values corresponding to the NPM packets from a pre-established recommendation library;
the sequencing module is used for sequencing the NPM packets according to the recommended values to obtain the sequenced NPM packets;
and the sending module is used for sending the sequenced NPM packets to the client.
On the other hand, an embodiment of the present invention provides a storage medium, where the storage medium includes a stored program, and when the program runs, a device in which the storage medium is located is controlled to execute the method for recommending an NPM package.
In another aspect, 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, and the processor is used for controlling execution of the program instructions, and the program instructions are loaded by the processor and executed to perform the steps of the above-mentioned method for recommending an NPM packet.
According to the technical scheme provided by the embodiment of the invention, the retrieval request sent by the client is obtained, the retrieval request comprises at least one retrieval word, the keyword matched with each retrieval word is obtained, the NPM packet corresponding to each keyword is inquired according to each keyword, the recommendation values corresponding to the NPM packets are inquired from a pre-established recommendation library, the NPM packets are sequenced according to the recommendation values to obtain sequenced NPM packets, and the sequenced NPM packets are sent to the client, so that developers can quickly retrieve the appropriate NPM packets, the retrieval efficiency is improved, and the quality of NPM packet retrieval recommendation is improved by setting the recommendation values corresponding to the NPM packets.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a flowchart of a method for recommending an NPM packet according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for recommending an NPM packet according to another embodiment of the present invention;
FIG. 3 is a diagram illustrating a recommended value-related parameter according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for recommending an NPM packet according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a computer device according to an embodiment of the present invention.
[ detailed description ] embodiments
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of associative relationship that describes an associated object, meaning that three types of relationships may exist, e.g., A and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Fig. 1 is a flowchart of a method for recommending an NPM packet according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step 101, a retrieval request sent by a client is obtained, wherein the retrieval request comprises at least one retrieval word.
And 102, acquiring keywords matched with each search term, and inquiring an NPM (network provider Module) packet corresponding to each keyword according to each keyword.
And 103, inquiring recommendation values corresponding to the NPM packets from a pre-established recommendation library.
And 104, sequencing the NPM packets according to the recommended values to obtain the sequenced NPM packets.
And 105, sending the sequenced NPM packet to the client.
According to the technical scheme provided by the embodiment of the invention, the retrieval request sent by the client is obtained, the retrieval request comprises at least one retrieval word, the keyword matched with each retrieval word is obtained, the NPM packet corresponding to each keyword is inquired according to each keyword, the recommendation values corresponding to the NPM packets are inquired from a pre-established recommendation library, the NPM packets are sequenced according to the recommendation values to obtain sequenced NPM packets, and the sequenced NPM packets are sent to the client, so that developers can quickly retrieve the appropriate NPM packets, the retrieval efficiency is improved, and the quality of NPM packet retrieval recommendation is improved by setting the recommendation values corresponding to the NPM packets.
The method for recommending the NPM packet can be suitable for searching most NPM packet management platforms, and in order to improve the practicability of the method for recommending the NPM packet, another method for recommending the NPM packet provided by the invention is provided as follows.
Fig. 2 is a flowchart of a method for recommending an NPM packet according to another embodiment of the present invention, as shown in fig. 2, the method includes:
step 201, a plurality of NPM packets are collected through a timed batch task.
In the embodiment of the invention, each step is executed by a Node Packet Manager (NPM).
In the embodiment of the present invention, the NPM packets may include a newly added NPM packet and a historical NPM packet. The method comprises the steps of acquiring a plurality of NPM packets through a timed batch task, wherein the first acquisition process is to acquire a newly added NPM packet, calculate the recommendation value of the newly added NPM packet by executing subsequent steps and store the recommendation value into a pre-established recommendation library. The second acquisition process is to acquire the historical NPM packet, and update the recommendation value of the historical NPM packet in the recommendation library by executing the subsequent steps, so that the retrieval quality can be further improved.
It should be noted that, if the second acquisition process is performed, step 204 may be directly performed, so as to avoid the problem of low retrieval efficiency due to resource and time waste caused by analyzing historical NPM packets.
Step 202, analyzing the plurality of NPM packets, and obtaining a keyword corresponding to each NPM packet.
In the embodiment of the invention, the NPM packets are collected through the timed batch tasks, so that the accuracy of calculating the recommended value corresponding to the NPM packet in the subsequent step is ensured, and the recommended value corresponding to the newly added NPM packet which is calculated in the subsequent step is convenient.
In the embodiment of the present invention, step 202 may specifically include:
step 2021, parsing the configuration file corresponding to the NPM packet, and obtaining the key field and the description field corresponding to the NPM.
Step 2022, generating a keyword corresponding to the NPM packet according to the key field and the description field. In the embodiment of the present invention, for example, if the NPM packet includes a key field of "serialization", the key field of "serialization" is used as a keyword corresponding to the NPM packet. It should be noted that one NPM packet may have a plurality of keywords. The number of the keywords corresponding to the NPM packet is not limited, and the keywords can be set according to requirements.
Step 203, obtaining the keywords matched with each search term, and querying an NPM packet corresponding to each keyword according to each keyword.
In the embodiment of the invention, as one alternative, the keywords are consistent with the search terms, so that the retrieval accuracy can be improved, and as another alternative, the keywords are similar words or synonyms of the search terms, so that the retrieval efficiency can be improved, and the problem that the retrieval efficiency is low because the input search terms are too many and the corresponding keywords cannot be matched is solved.
And step 204, acquiring a recommended value related parameter of each NPM packet.
In the embodiment of the invention, the recommended value related parameters comprise the number of dependent packages, the number of depended packages, the collection number, the downloading amount, the release time, the source code collection number, the source code development branch number, the concerned source code number and the code pushing and merging number of the source codes.
In the embodiment of the present invention, step 204 specifically includes:
step 2041, querying a dependent and a dependent packet list corresponding to each NPM packet from the timed batch task.
In the embodiment of the present invention, specifically, in the timed batch task, the dependent and depended packet lists corresponding to each NPM packet are obtained by querying the packet file corresponding to each NPM packet.
It should be noted that, after the timed batch task of querying the dependent and depended packet lists corresponding to each NPM packet is executed on the packet file corresponding to each NPM packet, the system updates the dependent and depended packet lists corresponding to each NPM packet, that is, the dependent packet number and the depended packet number can be obtained through the timed batch task, so that the problem that the retrieval time consumption is increased because the dependent and depended packet lists corresponding to each NPM packet need to be repeatedly obtained from the packet file corresponding to each NPM packet when the dependent packet number and the depended packet number are obtained is solved, and the retrieval efficiency is improved through the above steps.
And step 2042, determining the number of the dependent packets and the number of the depended packets according to the dependent and depended packet lists.
In the embodiment of the present invention, the number of dependent packets (NPM dependencies) is used to indicate the number of other packets that the NPM packet depends on, and the number of dependent packets (NPM dependencies by others) is used to indicate the number of the NPM packet that the NPM packet depends on by other packets.
Step 2043, a code warehouse address of the configuration file corresponding to the NPM packet is obtained, and a collection number, a source code development branch number, an attention source code number and a code pushing and merging number of the source code are obtained by crawling the code warehouse address.
In the embodiment of the present invention, the collection number (NPM stars) is used to indicate the collection number of the NPM packet, the source code development branch number (gitublocks) is used to indicate the number of development branch trees of the source code of the NPM packet, the focus source code number (gitubwatch) is used to indicate the number of focus source codes of the NPM packet, and the code push merge number (gitubpullrequest) of the source code is used to indicate the code push merge number of the source code of the NPM packet.
And 2044, crawling the background data of the NPM packet to obtain the download amount, the release time and the source code collection number.
In the embodiment of the present invention, the download amount (NPM downloads) is used to indicate the download amount of the NPM packet, the publishing time (NPM last publish) is used to indicate the time when the NPM packet is published to the node packet management platform for the last time, and the source code collection number (gitubs stars) is used to indicate the collection number of the source code of the NPM packet.
In the embodiment of the present invention, the background data may further include other data information, which is not limited to this.
In practical application, in related technologies, generally, only a mode that a search word matches a keyword is adopted during searching, that is, an NPM packet corresponding to the matched keyword is displayed, in the embodiment of the present invention, after the recommendation value related parameters of each dimension are obtained, the recommendation value corresponding to each NPM packet can be calculated in subsequent steps, and the NPM packets meeting the conditions are displayed in a sorted manner, and by setting the recommendation values corresponding to the NPM packets, the quality of NPM packet searching recommendation is improved compared with the related technologies.
And step 205, determining a recommended value corresponding to each NPM packet according to the recommended value related parameter of each NPM packet.
In the embodiment of the present invention, step 205 specifically includes: according to the formula: and calculating the code pushing and merging number of the recommended value, namely a first preset correlation value, a dependent packet number, a second preset correlation value, a dependent packet number, a third preset correlation value, a collection number, a fourth preset correlation value, a downloading amount, a fifth preset correlation value, a release time, a sixth preset correlation value, a source code collection number, a seventh preset correlation value, a source code development branch number, an eighth preset correlation value, an attention source code number and a ninth preset correlation value, and calculating the corresponding recommended value of each NPM packet.
In the embodiment of the present invention, the first preset correlation value, the second preset correlation value, the third preset correlation value, the fourth preset correlation value, the fifth preset correlation value, the sixth preset correlation value, the seventh preset correlation value, the eighth preset correlation value, and the ninth preset correlation value may be obtained by analyzing a behavior of a developer who collects a period of time to retrieve an NPM packet, and may be dynamically adjusted according to a requirement. The preset correlation value can be dynamically adjusted in a manual training mode or a machine training mode. The value ranges of the first preset correlation value, the second preset correlation value, the third preset correlation value, the fourth preset correlation value, the fifth preset correlation value, the sixth preset correlation value, the seventh preset correlation value, the eighth preset correlation value and the ninth preset correlation value are [0,1], for example, the first preset correlation value is 0.5.
In one particular implementation, the following is expressed by the formula: and (2) hq is aO + bP + cQ + dR + eS + fX + gY + hZ + iM, and a recommended value corresponding to each NPM packet is calculated, wherein hq is expressed as a recommended value corresponding to the NPM packet, a is expressed as a first preset correlation value, b is expressed as a second preset correlation value, c is expressed as a third preset correlation value, d is expressed as a fourth preset correlation value, e is expressed as a fifth preset correlation value, f is expressed as a sixth preset correlation value, g is expressed as a seventh preset correlation value, h is expressed as an eighth preset correlation value, i is expressed as a ninth preset correlation value, O is expressed as a dependent packet number, P is expressed as a dependent packet number, Q is expressed as a collection number, R is expressed as a download amount, S is expressed as release time, X is expressed as a source code collection number, Y is expressed as a source code development branch number, Z is expressed as a source code number of interest, and M is expressed as a pushed code merging number of source codes.
For example, as shown in fig. 3, the behavior analysis by collecting a developer for a period of time to retrieve an NPM package results in: the correlation degree of the first preset correlation value a corresponding to the dependent packet number O is the lowest, the correlation degree of the second preset correlation value b corresponding to the dependent packet number P is greater than the first preset correlation value a, and the fourth preset correlation value corresponding to the download amount R is the highest, so that the recommended value corresponding to the NPM packet can be calculated according to the correlation degree of the preset correlation values corresponding to the acquired parameters related to each recommended value.
In the embodiment of the invention, after the recommendation value related parameters of each dimension are obtained, the recommendation value corresponding to each NPM packet can be calculated, the NPMs meeting the conditions are displayed in a sequencing mode, and the quality of NPM packet retrieval recommendation is improved by setting the recommendation values corresponding to the NPM packets, compared with the related technology.
And step 206, storing or updating a plurality of NPM information in a pre-established recommendation library, wherein the NPM information comprises the obtained NPM packet, the keywords corresponding to the NPM packet and the recommendation value corresponding to the NPM packet.
It should be noted that, if the NPM packet is a newly added NPM packet, since the pre-established recommendation library does not store the NPM information corresponding to the newly added NPM packet, the NPM information corresponding to the newly added NPM packet needs to be stored in the pre-established recommendation library. If the NPM packet is a historical NPM packet, since the pre-established recommendation library stores the NPM information corresponding to the historical NPM packet, and since the recommendation-value-related parameters such as the download amount and the collection amount are in a real-time update state, the recommendation value corresponding to the historical NPM needs to be calculated at regular time, the NPM information corresponding to the newly added NPM packet needs to be updated in the pre-established recommendation library, and specifically, the recommendation value corresponding to the newly added NPM packet needs to be updated.
In the embodiment of the invention, after the step 206 is executed, when the retrieval request of the client is received, the NPM packet which meets the requirement of the developer and has a high recommendation value can be quickly inquired according to the recommendation library, so that the problems of time cost increase and equipment burden caused by calculating the recommendation value corresponding to the NPM packet when the client sends the retrieval request are solved, the calculation time is saved, and the retrieval efficiency is improved.
Step 207, obtaining a retrieval request sent by the client, wherein the retrieval request comprises at least one retrieval word.
In an implementation manner, in the embodiment of the present invention, a developer may input a search term in a search box of the node packet management platform, where the search term may be one or more search terms.
And 208, inquiring recommendation values corresponding to the NPM packets from a pre-established recommendation library.
And 209, sequencing the plurality of NPM packets according to the recommended values to obtain the sequenced NPM packets.
In an alternative embodiment of the present invention, step 209 may specifically include: and sequencing the NPM packets according to the sequencing relation of the recommended values from high to low to obtain the sequenced NPM packets.
And step 210, sending the sequenced NPM packets to the client.
In the embodiment of the invention, the NPM packets after sorting are selected and sent to the client, so that developers can quickly check the appropriate NPM packets, and the quality of NPM packet retrieval recommendation can be improved.
In another alternative embodiment of the present invention, step 209 may further include:
and step 210', selecting the top N NPM packets with the highest recommended values from the sorted NPM packet list.
And step 211', sending the first N NPM packets with the highest recommendation value to the client.
In the embodiment of the invention, the value of N can be set according to requirements, and can be set by default of a system or by developers. In the embodiment of the invention, the top N NPM packets with the highest recommendation value are selected and sent to the client, so that the best-matched NPM packet can be recommended to developers, and the NPM packet with the optimal quality and the most stable maintenance is returned to the developers under the condition that the NPM packet equally meets the retrieval conditions, so that the developers can retrieve the NPM packet which is most suitable for being applied to the service item at the lowest cost, and the quality of the retrieval recommendation of the NPM packet is further improved.
In the embodiment of the present invention, after step 211', the method further includes:
step 212, sending an evaluation message to the client, so that the client evaluates the first N NPM packets with the highest recommended value, and generates an evaluation result.
In the embodiment of the present invention, N is 3, for example. In one implementation, after the first 3 NPM packets with the highest recommended value are sent to the client, the developer performs an operation of replacing the next NPM packet, so as to generate an evaluation result of the 3 NPM packets according to the operation of the developer, for example, the evaluation result is not in accordance with the requirement of the developer.
Step 213, according to the evaluation result, adjusting a plurality of preset associated values in the recommended values corresponding to each of the first N NPM packets with the highest recommended value, and continuing to execute step 205.
In the embodiment of the present invention, taking the above implementation manner as an example, according to the evaluation result, the preset associated value corresponding to the first 3 NPM packets with the highest recommended value is reduced, so that the recommended value corresponding to the 3 NPM packets is reduced, and thus the retrieval quality of the NPM packets can be improved. On the contrary, if the evaluation result is that the evaluation result meets the requirements of developers, the preset associated values corresponding to the first 3 NPM packets with the highest recommended values are increased, so that the recommended values corresponding to the 3 NPM packets are increased, and the retrieval quality of the NPM packets can be further improved.
In the embodiment of the present invention, the evaluation message may include an evaluation list as an alternative. Besides, the specific expression form of the evaluation message may also include other forms, which is not limited by the present invention, and the purpose is only to evaluate the top N NPM packets with the highest recommended value.
In the embodiment of the invention, the evaluation message is sent to the client, and the first preset correlation value, the second preset correlation value, the third preset correlation value, the fourth preset correlation value, the fifth preset correlation value, the sixth preset correlation value, the seventh preset correlation value, the eighth preset correlation value and the ninth preset correlation value are dynamically adjusted according to the evaluation result fed back by the client, namely, the preset correlation values are continuously fine-tuned in the later period, so that the accuracy of the correlation degree parameter can be improved, the quality of the NPM packet retrieval recommendation is further improved, and the quality of the NPM packet retrieval recommendation is further improved.
In the embodiment of the invention, by acquiring a retrieval request sent by a client, the retrieval request comprises at least one retrieval word, keywords matched with each retrieval word are acquired, an NPM packet corresponding to each keyword is inquired according to each keyword, recommended values corresponding to a plurality of NPM packets are inquired from a pre-established recommendation library, the NPM packets are sequenced according to the recommended values to obtain sequenced NPM packets, and the sequenced NPM packets are sent to the client, so that developers can quickly retrieve the appropriate NPM packets, the retrieval efficiency is improved, and the quality of NPM packet retrieval recommendation is improved by setting the recommended values corresponding to the NPM packets.
Fig. 4 is a schematic structural diagram of an apparatus for recommending an NPM packet according to an embodiment of the present invention, and as shown in fig. 4, the apparatus is applied to a computer device. The device includes: a first obtaining module 11, a query module 12, a sorting module 13 and a sending module 14.
The first obtaining module 11 is configured to obtain a retrieval request sent by a client, where the retrieval request includes at least one retrieval word.
The first obtaining module 11 is further configured to obtain a keyword matched with each search term.
The query module 12 is configured to query an NPM packet corresponding to each keyword according to each keyword.
The query module 12 is further configured to query recommendation values corresponding to a plurality of NPM packets from a pre-established recommendation library.
The sorting module 13 is configured to sort the plurality of NPM packets according to the recommended value, so as to obtain the sorted NPM packets.
The sending module 14 is configured to send the sorted NPM packets to the client.
In this embodiment of the present invention, the sorting module 13 of the apparatus is specifically configured to sort the plurality of NPM packets according to a sorting relationship between high and low recommended values, so as to obtain sorted NPM packets.
In the embodiment of the present invention, the apparatus further includes: an acquisition module 15 and an analysis module 16.
The collecting module 15 is used for collecting a plurality of NPM packets through the timed batch task.
The parsing module 16 is configured to parse the plurality of NPM packets to obtain a keyword corresponding to each NPM packet.
In the embodiment of the present invention, the parsing module 16 of the apparatus is specifically configured to parse a configuration file corresponding to the NPM packet, and obtain a key field and a description field corresponding to the NPM; and generating a keyword corresponding to the NPM packet according to the key field and the description field.
In the embodiment of the invention, the recommended value related parameters comprise dependent package number, collection number, download amount, release time, source code collection number, source code development branch number, concerned source code number and code pushing and merging number of source codes; the device also includes: a second acquisition module 17, a determination module 18 and a storage/update module 19.
The second obtaining module 17 is configured to obtain a recommended value related parameter of each of the NPM packets.
The determining module 18 is configured to determine a recommended value corresponding to each NPM packet according to the recommended value related parameter of each NPM packet.
The storage/update module 19 is configured to store or update a plurality of NPM packet information in a pre-established recommendation library, where the NPM packet information includes the obtained NPM packet, a keyword corresponding to the NPM packet, and a recommendation value corresponding to the NPM packet.
In this embodiment of the present invention, the first obtaining module 11 of the apparatus specifically includes: a query submodule 111, a determination submodule 112, an acquisition submodule 113 and a crawl submodule 114.
The query submodule 111 is configured to query a dependent and a dependent packet list corresponding to each NPM packet from the timed batch task.
The determining submodule 112 is configured to determine the number of dependent packets and the number of depended packets according to the dependent and depended packet lists.
The obtaining sub-module 113 is configured to obtain a code warehouse address of a configuration file corresponding to the NPM packet.
The crawling submodule 114 is configured to obtain, by crawling the code repository address, a collection number, a source code development branch number, an attention source code number, and a code pushing and merging number of the source code.
The crawling submodule 114 is further configured to obtain a download amount, a publishing time, and a source code collection number by crawling the background data of the NPM packet.
In this embodiment of the present invention, the determining module 18 of the apparatus is specifically configured to: and calculating the code pushing and merging number of the recommended value, namely a first preset correlation value, a dependent packet number, a second preset correlation value, a dependent packet number, a third preset correlation value, a collection number, a fourth preset correlation value, a downloading amount, a fifth preset correlation value, a release time, a sixth preset correlation value, a source code collection number, a seventh preset correlation value, a source code development branch number, an eighth preset correlation value, an attention source code number and a ninth preset correlation value, and calculating the recommended value corresponding to each NPM packet.
The NPM packet recommendation apparatus provided in this embodiment may be used to implement the NPM packet recommendation method in fig. 1 or fig. 2, and for specific description, reference may be made to an embodiment of the NPM packet recommendation method in the foregoing, and a description is not repeated here.
According to the technical scheme of the NPM packet recommendation device provided by the embodiment of the invention, the retrieval request sent by the client is obtained, the retrieval request comprises at least one retrieval word, the keyword matched with each retrieval word is obtained, the NPM packet corresponding to each keyword is inquired according to each keyword, the recommendation values corresponding to a plurality of NPM packets are inquired from a pre-established recommendation library, the NPM packets are sequenced according to the recommendation values to obtain sequenced NPM packets, and the sequenced NPM packets are sent to the client, so that developers can quickly retrieve the appropriate NPM packets, the retrieval efficiency is improved, and the quality of NPM packet retrieval recommendation is improved by setting the recommendation values corresponding to the NPM packets.
An embodiment of the present invention provides a storage medium, where the storage medium includes a stored program, where each step of the embodiment of the method for recommending an NPM packet is executed by controlling a device where the storage medium is located when the program runs, and an embodiment of the method for recommending an NPM packet is specifically described.
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, and the processor is used to control execution of the program instructions, and the program instructions are loaded and executed by the processor to implement the steps of the above-mentioned embodiment of the method for recommending an NPM packet, and an embodiment of the method for recommending an NPM packet is specifically described.
Fig. 5 is a schematic diagram of a computer device according to an embodiment of the present invention. As shown in fig. 5, the computer device 30 of this embodiment includes: the processor 31, the memory 32, and the computer program 33 stored in the memory 32 and capable of running on the processor 31, where the computer program 33 is executed by the processor 31 to implement the recommendation method applied to the NPM packet in the embodiment, and in order to avoid repetition, details are not repeated herein. Alternatively, the computer program is executed by the processor 31 to implement the functions of each model/unit in the recommendation device applied to the NPM packet in the embodiment, and for avoiding redundancy, the description is omitted here.
The computer device 30 includes, but is not limited to, a processor 31, a memory 32. Those skilled in the art will appreciate that fig. 5 is merely an example of a computer device 30 and is not intended to limit the computer device 30 and that it may include more or fewer components than shown, or some components may be combined, or different components, e.g., the computer device may also include input output devices, network access devices, buses, etc.
The Processor 31 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 32 may be an internal storage unit of the computer device 30, such as a hard disk or a memory of the computer device 30. The memory 32 may also be an external storage device of the computer device 30, such as a plug-in hard disk provided on the computer device 30, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 32 may also include both internal and external storage units of the computer device 30. The memory 32 is used for storing computer programs and other programs and data required by the computer device. The memory 32 may also be used to temporarily store data that has been output or is to be output.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a Processor (Processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for recommending an NPM packet, the method comprising:
acquiring a retrieval request sent by a client, wherein the retrieval request comprises at least one retrieval word;
acquiring keywords matched with each search term, and inquiring an NPM packet corresponding to each keyword according to each keyword;
inquiring a plurality of recommendation values corresponding to the NPM packets from a pre-established recommendation library;
sequencing the NPM packets according to the recommended values to obtain sequenced NPM packets;
and sending the sequenced NPM packets to the client.
2. The method of claim 1, wherein the sorting the plurality of NPM packets according to the recommended value to obtain sorted NPM packets comprises:
and sequencing the NPM packets according to the sequencing relation of the recommended values from high to low to obtain the sequenced NPM packets.
3. The method of claim 1, before the obtaining the keywords matching each of the search terms and querying the NPM packet corresponding to each of the keywords according to each of the search terms, further comprising:
collecting a plurality of NPM packets through timed batch tasks;
and analyzing the plurality of NPM packets to obtain the corresponding keywords of each NPM packet.
4. The method of claim 3, wherein the parsing the plurality of NPM packets to obtain the corresponding keyword of each NPM packet comprises:
analyzing a configuration file corresponding to the NPM packet, and acquiring a key field and a description field corresponding to the NPM;
and generating a keyword corresponding to the NPM packet according to the key field and the description field.
5. The method of claim 4, wherein before querying the recommendation value corresponding to the plurality of NPM packets from the pre-established recommendation library, the method further comprises:
acquiring a recommended value related parameter of each NPM packet;
determining a recommended value corresponding to each NPM packet according to the recommended value related parameter of each NPM packet;
storing or updating a plurality of NPM packet information in a pre-established recommendation library, wherein the NPM packet information comprises the obtained NPM packet, a keyword corresponding to the NPM packet and a recommendation value corresponding to the NPM packet.
6. The method of claim 5, wherein the recommended value related parameters include a dependent package number, a collection number, a download amount, a release time, a source code collection number, a source code development branch number, an attention source code number, and a code push merge number of source codes;
the obtaining of the recommended value related parameter of each NPM packet includes:
inquiring a dependent and depended packet list corresponding to each NPM packet from a timing batch task;
determining the number of the dependent packets and the number of the depended packets according to the depended and depended packet lists;
acquiring a code warehouse address of a configuration file corresponding to the NPM packet, and acquiring a collection number, a source code development branch number, an attention source code number and a code pushing and combining number of source codes by crawling the code warehouse address;
and crawling background data of the NPM packet to obtain the downloading amount, the release time and the source code collection number.
7. The method of claim 6,
the determining the recommended value corresponding to each NPM packet according to the recommended value-related parameter of each NPM packet includes:
according to the formula: and calculating the code pushing and merging number of the recommended value, namely a first preset correlation value, a dependent packet number, a second preset correlation value, a dependent packet number, a third preset correlation value, a collection number, a fourth preset correlation value, a downloading amount, a fifth preset correlation value, a release time, a sixth preset correlation value, a source code collection number, a seventh preset correlation value, a source code development branch number, an eighth preset correlation value, an attention source code number and a ninth preset correlation value, and calculating the recommended value corresponding to each NPM packet.
8. An apparatus for recommending an NPM packet, the apparatus comprising:
the system comprises an acquisition module, a search module and a search module, wherein the acquisition module is used for acquiring a search request sent by a client, and the search request comprises at least one search term; acquiring a keyword matched with each search term;
the query module is used for querying the NPM packet corresponding to each keyword according to each keyword; inquiring a plurality of recommendation values corresponding to the NPM packets from a pre-established recommendation library;
the sequencing module is used for sequencing the NPM packets according to the recommended values to obtain the sequenced NPM packets;
and the sending module is used for sending the sequenced NPM packets to the client.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device where the storage medium is located is controlled to execute the recommendation method of the NPM packet according to any one of claims 1 to 7.
10. A computer device comprising a memory for storing information including program instructions and a processor for controlling the execution of the program instructions, characterized in that the program instructions are loaded and executed by the processor to implement the steps of the method of recommending an NPM packet according to any of claims 1 to 7.
CN202010579732.6A 2020-06-23 2020-06-23 NPM package recommendation method and device, storage medium and computer equipment Pending CN111814041A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010579732.6A CN111814041A (en) 2020-06-23 2020-06-23 NPM package recommendation method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010579732.6A CN111814041A (en) 2020-06-23 2020-06-23 NPM package recommendation method and device, storage medium and computer equipment

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 NPM package recommendation method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN111814041A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
腾讯云开发者社区成员: "npm-入门-查找和选择包", pages 1, Retrieved from the Internet <URL:https://cloud.tencent.cn/developer/section/1490232> *

Cited By (2)

* Cited by examiner, † Cited by third party
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
CN110968582B (en) Crowd generation method and device
CN104298679B (en) Applied business recommended method and device
CN112800095B (en) Data processing method, device, equipment and storage medium
US7657515B1 (en) High efficiency document search
CN110795455A (en) Dependency relationship analysis method, electronic device, computer device and readable storage medium
CN102411591A (en) Method and equipment for processing information
CN114911830B (en) Index caching method, device, equipment and storage medium based on time sequence database
CN111814041A (en) NPM package recommendation method and device, storage medium and computer equipment
CN110855477A (en) Link log monitoring method and device, computer equipment and storage medium
WO2013175495A2 (en) A system and a method for reasoning and running continuous queries over data streams
CN113190426B (en) Stability monitoring method for big data scoring system
CN111159135A (en) Data processing method and device, electronic equipment and storage medium
CN111274091B (en) Log processing method, device, computer equipment and storage medium
CN112732663A (en) Log information processing method and device
CN117971873A (en) Method and device for generating Structured Query Language (SQL) and electronic equipment
CN106940710B (en) Information pushing method and device
CN117611272A (en) Commodity recommendation method and device and electronic equipment
CN116700929A (en) Task batch processing method and system based on artificial intelligence
CN112887113A (en) Method, device and system for processing data
CN106844415A (en) A kind of data processing method and device in SparkSQL systems
CN113495723B (en) Method, device and storage medium for calling functional component
CN109446263A (en) A kind of data relationship correlating method and device
CN115168509A (en) Processing method and device of wind control data, storage medium and computer equipment
CN110929207B (en) Data processing method, device and computer readable storage medium
CN108345600A (en) A kind of management, data search method and its device of search application

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