Software service recommendation method and device, equipment and medium
By combining a global session model and a heterogeneous representation model with a gated recurrent neural network, and dynamically fusing user and session interest features, the problem of inaccurate software service recommendations in existing technologies is solved, and more efficient repository recommendations are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2022-08-11
- Publication Date
- 2026-04-24
AI Technical Summary
In existing technologies, software service recommendation methods based on convolutional networks or deep learning cannot dynamically model services, resulting in inaccurate software service recommendations and imprecise repository representations, which affect recommendation quality.
By combining a global session model and a heterogeneous representation model with a gated recurrent neural network, and by acquiring and analyzing user session sequences, this method dynamically fuses user and session interest features using the embedding matrices of the heterogeneous graph and the global graph to recommend target repositories.
The accuracy of software service recommendations has been improved. By combining dynamic modeling and heterogeneous representation models, the accuracy of repository representation has been enhanced, thereby improving the precision of recommendations.
Smart Images

Figure CN115238147B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of big data, specifically to a software service recommendation method, apparatus, electronic device, medium, and program product. Background Technology
[0002] In service-based application software development, developers can obtain the required software services from open-source service registries and then use the functional code of these services to build services within their development projects. The functional code implementing a software service is stored in a repository that matches that service. However, due to the large number of software services deployed on open-source projects and the numerous user pull requests, it is difficult for developers to quickly and accurately obtain the software services that meet their needs from open-source projects.
[0003] In related technologies, convolutional networks or deep learning methods are generally used to recommend software services to users based on their historical behavior data. However, these recommendation methods are all based on fixed pull behaviors to build the recommendation model framework, and cannot dynamically model the software service recommendation task. In addition, the use of historical interaction information between the user to be recommended and the database to recommend software services in related technologies can lead to inaccurate representation of the software service repository, affecting the quality of software service recommendations. Summary of the Invention
[0004] In view of the above problems, this disclosure provides a software service recommendation method, apparatus, device, medium and program product.
[0005] According to a first aspect of this disclosure, a software service recommendation method is provided, comprising: obtaining a first session sequence, the first session sequence including identification information of N repositories, the identification information of the N repositories being sorted according to the click order of a target object, where N is greater than or equal to 2; inputting the first session sequence into a global session model and outputting a global embedding matrix; inputting a heterogeneous graph corresponding to the first session sequence into a heterogeneous representation model and outputting a heterogeneous embedding matrix; and determining, based on the global embedding matrix and the heterogeneous embedding matrix, a target repository among the N repositories to be recommended to the target object, the target repository being used to implement a software service with a preset function.
[0006] According to embodiments of this disclosure, determining the target repository to be recommended to the target object from among N repositories based on the global embedding matrix and the heterogeneous embedding matrix includes: processing the global embedding matrix and the heterogeneous embedding matrix using a gated recurrent neural network to obtain a heterogeneous representation and a global representation; determining a heterogeneous prediction value and a global prediction value based on the inner product similarity between the global representation and the global embedding matrix, and the inner product similarity between the heterogeneous representation and the heterogeneous embedding matrix, respectively; determining the final prediction value for each of the N repositories based on the heterogeneous prediction value and the global prediction value, and determining the repository with the highest final prediction value as the target repository.
[0007] According to embodiments of this disclosure, processing the global embedding matrix and the heterogeneous embedding matrix using a gated recurrent neural network to obtain heterogeneous representations and global representations includes: alternately inputting the global embedding matrix and the heterogeneous embedding matrix into the gated recurrent neural network and alternately outputting heterogeneous representations and global representations, wherein the global embedding matrix and the heterogeneous embedding matrix share the network parameters of the gated recurrent neural network.
[0008] According to embodiments of this disclosure, determining the final predicted value for each of the N repositories based on the heterogeneous predicted value and the global predicted value includes: adding the product of the heterogeneous predicted value and a first activation function, the product of the global predicted value and a second activation function to obtain the final predicted value, wherein the first activation function and the second activation function are used to determine the fusion relationship between the heterogeneous predicted value and the global predicted value.
[0009] According to an embodiment of this disclosure, the heterogeneous representation model includes an L-layer relational graph convolutional network; inputting the heterogeneous graph corresponding to the first session sequence into the heterogeneous representation model and outputting a heterogeneous embedding matrix includes: inputting N repositories in the heterogeneous graph into a first-layer relational graph convolutional network and outputting first-layer embedding data of the N repositories; inputting the first-layer embedding data into the first-layer relational graph convolutional network again, and inputting the output data of the first-layer relational graph convolutional network into a second-layer relational graph convolutional network to output second-layer embedding data of the N repositories; inputting the second-layer embedding data into the first-layer relational graph convolutional network until the L-th layer relational graph convolutional network outputs the L-th layer embedding data of the N repositories; and using the sum of the L-th layer embedding data of the i-th repository as the embedding representation of the i-th repository to obtain a heterogeneous embedding matrix, the heterogeneous embedding matrix including the embedding representations of the N repositories, where L is greater than or equal to 2, and i is greater than or equal to 1 and less than or equal to N.
[0010] According to an embodiment of this disclosure, the global session model includes a gated graph neural network; inputting a first session sequence into the global session model and outputting a global embedding matrix includes: inputting the first session sequence into the gated graph neural network so that the gated graph neural network outputs the state vectors of the N repositories at the next moment based on the state vectors of the N repositories at the current moment in the first session sequence; and using the state vectors of the N repositories at the next moment to determine the global embedding matrix of the first session sequence.
[0011] According to an embodiment of this disclosure, the method for determining the heterogeneous representation model includes: obtaining Q second session sequences corresponding to Q users, wherein the second session sequences include identification information of M repositories, the identification information of the M repositories is sorted according to the historical click order of the users, M is greater than or equal to 2, and Q is greater than or equal to 2; selecting P related users from the Q users based on the Q second session sequences, wherein P is greater than or equal to 1 and less than or equal to Q; obtaining a historical interaction heterogeneous graph based on P+1 second session sequences corresponding to the P related users and the q-th user; and training the heterogeneous representation model to be trained using the historical interaction heterogeneous graph, thereby obtaining the heterogeneous representation model under preset conditions.
[0012] According to an embodiment of this disclosure, selecting P relevant users from Q users based on Q second session sequences includes: calculating the core values of M repositories in the second session sequence corresponding to the q-th user, and constructing the interest feature vector of the q-th user by embedding the core values of K databases with core values higher than a preset threshold, wherein K is greater than or equal to 1 and less than or equal to M; obtaining Q interest feature vectors corresponding to the Q users; and calculating the similarity between the Q interest feature vectors, and selecting P relevant users from the Q users based on the similarity.
[0013] According to an embodiment of this disclosure, the second session sequence includes multiple sub-session sequences, each sub-session sequence including identification information of at least one repository, the identification information of the at least one repository being sorted according to the user's click order within a preset time period.
[0014] A second aspect of this disclosure provides a software service recommendation apparatus, comprising: an acquisition device for acquiring a first session sequence, the first session sequence including identification information of N repositories, the identification information of the N repositories being sorted according to the click order corresponding to the target, where N is greater than or equal to 2; a first determination device for inputting the first session sequence into a global session model and outputting a global embedding matrix; a second determination device for inputting a heterogeneous graph corresponding to the first session sequence into a heterogeneous representation model and outputting a heterogeneous embedding matrix; and a prediction device for determining, based on the global embedding matrix and the heterogeneous embedding matrix, a target repository among the N repositories to be recommended to the target object, the target repository being used to implement a software service with a preset function.
[0015] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the software service recommendation method described above.
[0016] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described software service recommendation method.
[0017] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described software service recommendation method.
[0018] This disclosure extends the representation types of repositories by utilizing both global and heterogeneous representation models. Then, it leverages these two types of repository representation data to achieve dynamic integration of shared user and session interests in software service recommendation. By integrating the interactions between the user to be recommended and the repository, as well as the interactions between the global user and the repository, through the heterogeneous representation model, the characteristics of the session sequence are enhanced, improving the accuracy of software service recommendation. Attached Figure Description
[0019] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0020] Figure 1 This illustration schematically depicts an application scenario of the software service recommendation method according to embodiments of the present disclosure;
[0021] Figure 2 A flowchart illustrating a software service recommendation method according to an embodiment of the present disclosure is shown schematically.
[0022] Figure 3 A flowchart illustrating a method for determining a target repository according to an embodiment of this disclosure is shown schematically;
[0023] Figure 4 A schematic diagram illustrating a process flow according to an embodiment of the present disclosure is shown.
[0024] Figure 5 A schematic diagram illustrating a software service recommendation apparatus according to an embodiment of the present disclosure is shown; and
[0025] Figure 6 A block diagram of an electronic device illustrating a software service recommendation method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0026] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0027] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0029] When using expressions such as "at least one of A, B, and C", the expression should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0030] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.
[0031] In the technical solution disclosed herein, the user's authorization or consent is obtained before acquiring or collecting the user's personal information.
[0032] Embodiments of this disclosure provide a software service recommendation method, comprising: obtaining a first session sequence, the first session sequence including identification information of N repositories, the identification information of the N repositories being sorted according to the click order of the target object, where N is greater than or equal to 2; inputting the first session sequence into a global session model and outputting a global embedding matrix; inputting a heterogeneous graph corresponding to the first session sequence into a heterogeneous representation model and outputting a heterogeneous embedding matrix; and determining, based on the global embedding matrix and the heterogeneous embedding matrix, a target repository to be recommended to the target object from among the N repositories, the target repository being used to implement a software service with a preset function.
[0033] Figure 1 The illustration depicts an application scenario of the software service recommendation method according to an embodiment of the present disclosure.
[0034] like Figure 1 As shown, application scenario 100 according to this embodiment may include terminal devices 101, 102, and 103, network 104, and server 105. Network 104 is used as a medium to provide a communication link between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0035] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. For example, users can log in to web clients or software service recommended applications on terminal devices 101, 102, and 103.
[0036] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0037] Server 105 can be a server providing various services, such as a backend management server (for example only) supporting websites browsed by users using terminal devices 101, 102, and 103; or a server that acquires session sequences generated from user clicks on terminal devices. The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated based on user requests) to the terminal devices. For example, it can recommend target repositories based on session sequences generated from user clicks.
[0038] It should be noted that the software service recommendation method provided in this embodiment can generally be executed by server 105. Correspondingly, the software service recommendation device provided in this embodiment can generally be located in server 105. The software service recommendation method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the software service recommendation device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.
[0039] It should be understood that Figure 1The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0040] The following will be based on Figure 1 The described scene, through Figures 2-4 The software service recommendation method of the disclosed embodiments is described in detail.
[0041] Figure 2 A flowchart illustrating a software service recommendation method according to an embodiment of this disclosure is shown schematically.
[0042] like Figure 2 As shown, the method includes operations S210 to S240.
[0043] In operation S210, the first session sequence is obtained. The first session sequence includes the identification information of N repositories. The identification information of the N repositories is sorted according to the click order of the target object, and N is greater than or equal to 2.
[0044] According to embodiments of this disclosure, the first session sequence is the interaction information between the target object and N repositories generated when the target object uses the terminal, so that the global session model and the heterogeneous representation model can predict the repository to be clicked in the next moment from the N repositories based on the interaction information. The target object includes the user.
[0045] According to embodiments of this disclosure, the first session sequence only includes repository identification information obtained by the user clicking on the terminal device, without needing to obtain specific repository information or user information.
[0046] For example, the first session sequence includes s: [A, B, C, B, D]. A, B, C, and D represent the identification information of four repositories, and the first session sequence s indicates that the click order of the target object is from A to B, from B to C, from C to B, and then from B to D.
[0047] In operation S220, the first session sequence is input into the global session model, and the global embedding matrix is output.
[0048] According to an embodiment of this disclosure, after inputting the first session sequence into the global session model, the global session model can determine the global embedding representation information of each of the N repositories based on the state information of the N repositories in the first session sequence; and then combine the global embedding representation information of the N repositories into a global embedding matrix.
[0049] According to embodiments of this disclosure, the global embedding representation information of each repository is related to the embedding representation information of N-1 other repositories. Furthermore, the global embedding representation information of each repository is also related to the order in which the N-1 repositories are arranged.
[0050] According to embodiments of this disclosure, the global session model may include convolutional neural networks, bidirectional long short-term memory networks, and classification models, etc.
[0051] In operation S230, the heterogeneous graph corresponding to the first session sequence is input into the heterogeneous representation model, and the heterogeneous embedding matrix is output.
[0052] According to embodiments of this disclosure, the first session sequence includes identification information for N repositories, which can reflect the interaction information between the user and the repositories. The N repositories are sorted according to the click order of the target user, which can also reflect the interaction information between repositories. The heterogeneous graph corresponding to the first session sequence includes two types of relationships: the interaction relationship between the target object and the repositories, and the interaction relationship between repositories.
[0053] According to embodiments of this disclosure, the heterogeneous graph corresponding to the first session sequence includes N repository nodes. After inputting the heterogeneous graph into a heterogeneous representation model, the heterogeneous representation model aggregates the repository nodes under multiple relations using different linear transformation matrices to obtain a heterogeneous embedding representation for each repository. Then, the heterogeneous embedding representations of the N repositories are combined into a heterogeneous embedding matrix.
[0054] According to embodiments of this disclosure, the heterogeneous representation model includes a graph convolutional neural network. The heterogeneous embedding representation of each repository includes features of multiple repositories.
[0055] In operation S240, based on the global embedding matrix and the heterogeneous embedding matrix, the target repository to be recommended to the target object is determined from among N repositories.
[0056] According to embodiments of this disclosure, after obtaining global embedding matrices and heterogeneous embedding matrices of N repositories based on the click session sequence of the target object, a gated recurrent neural network is used to analyze the features of the global embedding matrices and heterogeneous embedding matrices to obtain global and heterogeneous representations. Since the gated recurrent neural network analyzes the alternating input global and heterogeneous embedding matrices, it can adaptively fuse the global and heterogeneous representations according to a set of parameters while generating the global and heterogeneous representations.
[0057] In the related technologies disclosed in this disclosure, a sparse isomorphic graph of interaction information is typically constructed based solely on the interaction information in the current user session sequence, and software service recommendation (SSR) is performed based on this isomorphic graph. This results in limited sources of interaction information, inaccurate repository representations, and affects the quality of software service recommendations. This disclosure utilizes historical interaction information from multiple users to train a heterogeneous representation model, enabling the heterogeneous representation model to generate a heterogeneous embedding matrix based on the heterogeneous graph of the first session sequence. Because the heterogeneous representation model integrates the historical pull behaviors of multiple users, the repository representation of the heterogeneous embedding matrix output by the heterogeneous representation model is more accurate.
[0058] This disclosure utilizes a heterogeneous representation model to process the heterogeneous graph of the first session sequence, obtaining the user's heterogeneous embedding matrix; and utilizes a global session model to process the first session sequence, obtaining the user's global embedding matrix. This disclosure uses the heterogeneous representation model and the global session model to determine historical interest features and session click features respectively, expanding the types of repository representations and helping to improve repository representation and the quality of software service recommendations. By using a gated recurrent neural network to analyze the heterogeneous embedding matrix and the global embedding matrix, global representation and heterogeneous representation are obtained respectively. Then, the final predicted value of the repository is obtained by fusing the global representation and the heterogeneous representation, realizing software service recommendation that integrates user interests and sessions.
[0059] Furthermore, since software service recommendations in related technologies typically construct recommendation model frameworks under fixed pull behaviors, dynamic modeling of software service recommendation tasks is not possible. However, this disclosure analyzes the first session sequence of the target object and achieves dynamic modeling of the software service recommendation model by fusing heterogeneous representations and global representations through a dynamic fusion method during the prediction process.
[0060] Figure 3 A flowchart illustrating a method for determining a target repository according to an embodiment of this disclosure is shown schematically.
[0061] like Figure 3 As shown, the method of this embodiment includes operations S341 to S343, which can be used as a specific embodiment of operation S240.
[0062] In operation S341, a gated recurrent neural network is used to process the global embedding matrix and the heterogeneous embedding matrix to obtain the heterogeneous representation and the global representation.
[0063] According to embodiments of this disclosure, after determining the global embedding matrix and heterogeneous embedding matrix of N repositories in the first session sequence, the global embedding matrix and heterogeneous embedding matrix are jointly input into a gated recurrent neural network (GRU), and then the global representation corresponding to the global embedding matrix and the heterogeneous representation corresponding to the heterogeneous embedding matrix are output.
[0064] According to embodiments of this disclosure, a global embedding matrix and a heterogeneous embedding matrix are alternately input into a gated recurrent neural network, which alternately outputs heterogeneous representations and global representations. The global embedding matrix and the heterogeneous embedding matrix share the network parameters of the gated recurrent neural network.
[0065] According to embodiments of this disclosure, the process of determining the repository to recommend to the target object from N repositories based on the heterogeneous representation and global representation of the repository requires fusing the features of the heterogeneous representation and the global representation. Using two GRUs to process the global embedding matrix and the heterogeneous embedding matrix respectively to obtain the global and heterogeneous representations results in two sets of parameter information, increasing the difficulty of fusing the global and heterogeneous representations, and leading to lower accuracy in recommending the repository by fusing the global and heterogeneous representations.
[0066] By alternately inputting the global embedding matrix and the heterogeneous embedding matrix into the GRU, the global embedding matrix and the heterogeneous embedding matrix share the network parameters of the gated recurrent neural network. In the process of obtaining the global representation and the heterogeneous representation, the initial preparation for the fusion of the global representation and the heterogeneous representation is realized, which reduces the difficulty of fusion of the global representation and the heterogeneous representation and improves the fusion efficiency.
[0067] According to embodiments of this disclosure, the order of alternating data GRUs in the heterogeneous embedding matrix and the global embedding matrix can be changed, but alternating input and alternating output must be guaranteed.
[0068] In operation S342, the heterogeneous prediction value and the global prediction value are determined based on the inner product similarity between the global representation and the global embedding matrix, and the inner product similarity between the heterogeneous representation and the heterogeneous embedding matrix, respectively.
[0069] According to embodiments of this disclosure, after the GRU outputs the global representation and the heterogeneous representation respectively, the inner product similarity between the global representation and the global embedding representation in the global embedding matrix of each repository, and the inner product similarity between the heterogeneous representation and the heterogeneous embedding representation in the heterogeneous embedding matrix are calculated to obtain the global prediction value and the heterogeneous prediction value of each repository respectively.
[0070] In operation S343, based on the heterogeneous prediction value and the global prediction value, the final prediction value of each of the N repositories is determined, and the repository with the highest final prediction value is determined as the target repository.
[0071] According to embodiments of this disclosure, after obtaining global and heterogeneous prediction values for N repositories, an adaptive fusion mechanism is used to fuse the global and heterogeneous prediction values to obtain a final prediction value. After obtaining N final prediction values for N repositories, the repository with the largest final prediction value is determined as the target repository to be recommended.
[0072] According to embodiments of this disclosure, the adaptive fusion mechanism includes a first activation function corresponding to the heterogeneous predicted value and a second activation function corresponding to the global predicted value. After obtaining the heterogeneous predicted value and the global predicted value, the product of the heterogeneous predicted value and the first activation function, and the product of the global predicted value and the second activation function are added to obtain the final predicted value. The first activation function and the second activation function are used to determine the fusion relationship between the heterogeneous predicted value and the global predicted value.
[0073] According to embodiments of this disclosure, the first activation function and the second activation function include the Sigmoid function, etc.
[0074] According to embodiments of this disclosure, the heterogeneous representation model includes an L-layer Relational Graph Convolutional Network (R-GCN). The heterogeneous graph can be represented as... Here, edge E consists of two meta-paths: repository-repository and repository-user, and each edge is represented as (v i ,v j ,r),v i and v j This represents a repository. For multi-relationship data in a heterogeneous graph, different linear transformation matrices are used to aggregate repository node information across multiple relationships.
[0075] For operation S230, the N repositories in the heterogeneous graph are input into the first layer of the relational graph convolutional network, which outputs the first layer embedding data of the N repositories. The first layer embedding data is then input into the first layer of the relational graph convolutional network again, and the output of the first layer is input into the second layer of the relational graph convolutional network, which outputs the second layer embedding data of the N repositories. The second layer embedding data is input into the first layer of the relational graph convolutional network, and so on, until the Lth layer of the relational graph convolutional network outputs the Lth layer embedding data of the N repositories. The sum of the Lth layer embedding data of the i-th repository is used as the embedding representation of the i-th repository, resulting in the heterogeneous embedding matrix. The heterogeneous embedding matrix includes the embedding representations of the N repositories, where L is greater than or equal to 2, and i is greater than or equal to 1 and less than or equal to N.
[0076] For example, Represents repository v i The Lth layer heterogeneous embedding representation is obtained by inputting the vector representations of all repositories into the first layer of the relational graph convolutional network, which outputs the first layer embedding data. Then, the heterogeneous embedding representations of N repositories are used as input data to update the input heterogeneous embedding representations starting from the first layer. Each input updates one more layer of the relational graph convolutional network than the previous one, until the Lth layer relational graph convolutional network is updated, outputting the Lth layer embedding data.
[0077] For each repository, the final heterogeneous embedding representation includes L layers of heterogeneous embedding representations, satisfying the formula:
[0078]
[0079] in, This represents the input to the i-th repository. This represents the output of the l-th layer relational graph convolutional network.
[0080] Based on the heterogeneous embedding representation of each repository, a heterogeneous embedding matrix of N repositories was obtained.
[0081] According to embodiments of this disclosure, the global session model includes a gated graph neural network (GGNN). For operation S220, inputting a first session sequence into the global session model and outputting a global embedding matrix includes: inputting the first session sequence into the gated graph neural network so that the gated graph neural network outputs the state vectors of the N repositories at the next time step based on the current state vectors of the N repositories in the first session sequence. Using the state vectors of the N repositories at the next time step, the global embedding matrix of the first session sequence is determined.
[0082] Specifically, after inputting the first session sequence into the gated graph neural network, the trained gated graph neural network learns the features of N repositories. The process by which the gated graph neural network outputs the next-time state vectors of the N repositories based on their current state vectors in the first session sequence satisfies the following:
[0083]
[0084] in, This represents a list of vectors containing N repositories at time t-1. Let represent the state vector of the i-th repository at time t.
[0085] After determining N state vectors stored at the current time step, the state vectors of all repositories at the current time step are concatenated to obtain the global embedding matrix. The repository identification information included in the first session sequence is ordered according to the click order of the target object. The first session sequence can be decomposed into multiple sessions, among which... The global embedding representation of the i-th session satisfies:
[0086]
[0087] It should be noted that the quantity n here is convenient for concatenating the global representation and heterogeneous representation later, and can be padded with zeros.
[0088] Figure 4 A schematic diagram illustrating a process flow according to an embodiment of the present disclosure is shown.
[0089] According to embodiments of this disclosure, such as Figure 4 As shown, User 1's first session sequence includes 5 repositories, and User 2's first session sequence includes 3 repositories. User 1's first session sequence is input into a heterogeneous representation model composed of an L-layer R-GCN network, with the input heterogeneous embedding matrix V. h The five repositories that appear are used to form a global graph, which is then fed into the global session model GGNN, and the output is the global embedding matrix V. g The global embedding matrix V g and heterogeneous embedding matrix V h In an alternating input GRU network, the final timestamp is output. and These are heterogeneous representation and global representation, respectively. Then, the heterogeneous representation is computed. and heterogeneous embedding matrix V h The inner product similarity is used to obtain the heterogeneous prediction value. Similarly, compute the global representation and global embedding matrix V g The inner product similarity is used to obtain the global predicted value. The global and heterogeneous predictions are input into the adaptive fusion layer to obtain the final predictions from N repositories.
[0090] According to embodiments of this disclosure, the method for determining a heterogeneous representation model includes: obtaining Q second session sequences corresponding to Q users, each second session sequence including identification information of M repositories, the identification information of the M repositories being sorted according to the users' historical click order, where M is greater than or equal to 2 and Q is greater than or equal to 2. For ease of description, the first session sequence is used as the prediction input, and the second session sequence is used as the training input.
[0091] Based on Q second-session sequences, P relevant users are selected from the Q users, where P is greater than or equal to 1 and less than or equal to Q. Then, the P second-session sequences corresponding to the P relevant users are used to construct a historical interaction heterogeneous graph. The heterogeneous representation model to be trained is then trained using the historical interaction heterogeneous graph, and the heterogeneous representation model is obtained under preset conditions.
[0092] The preset conditions include a preset number of training iterations or a preset threshold for the loss function.
[0093] According to embodiments of this disclosure, the global session model, heterogeneous representation model, and GRU network are jointly trained using historical pull behavior information from multiple users to obtain optimal training parameters, and finally a fusion method for global session model, heterogeneous representation model, global representation, and heterogeneous representation used for prediction is obtained.
[0094] According to embodiments of this disclosure, during training using a second session sequence, the sum of the loss function of the global prediction value, the loss function of the heterogeneous prediction value, and the loss function of the final prediction value is used as the loss function of the entire model. By jointly training the heterogeneous prediction value, the global prediction value, and the final prediction value using cross-entropy, the final prediction result is optimized.
[0095] This disclosure trains a heterogeneous representation model based on the historical interaction session information of multiple users, enabling the heterogeneous representation model to learn the repository interaction features of multiple users and improving the accuracy of repository representation.
[0096] According to an embodiment of this disclosure, the process of selecting P relevant users includes: calculating the core values of M repositories in the second session sequence corresponding to the q-th user, and constructing the interest feature vector of the q-th user by embedding the core values of K databases with core values higher than a preset threshold, wherein K is greater than or equal to 1 and less than or equal to M.
[0097] Specifically, the PageRank algorithm is used to calculate the PageRank center values of the M repositories in the second session sequence corresponding to the q-th user. These center values are then used as the core value for each repository. Repository nodes with larger center values can be used to represent potential information about the repository's importance. Nodes with larger PageRank center values indicate that the repository appears more frequently alongside other repositories.
[0098] After calculating the core values of all repositories, the core values are sorted from highest to lowest, and K repositories are selected from highest to lowest as anchors. The embeddings of the K repositories are then concatenated to obtain the interest feature vector of the q-th user.
[0099]
[0100] Among them, v i Let u represent the i-th repository. q Let represent the high-dimensional vector of the q-th user, used to represent the long-term preferences of user q.
[0101] According to embodiments of this disclosure, interest feature vectors can be obtained by concatenating Mean Pooling and MaxPooling representations embedded in K repositories. Other pooling methods can also be used for concatenation as needed.
[0102] Similarly, using the method described above, Q interest feature vectors corresponding to Q users are obtained. Then, the similarity between the Q interest feature vectors is calculated to identify other users with strong relevance to the current user. Specifically, based on the cosine distance function, the cosine similarity between each pair of the Q interest feature vectors is calculated, and P relevant users whose cosine similarity meets a preset threshold are selected. Based on the second conversation sequence of the aforementioned P+1 users, a historical interaction heterogeneous graph is constructed to train the heterogeneous representation model.
[0103] This disclosure reduces training difficulty and improves training efficiency by calculating and filtering the core values of the repository in the historical session sequence, even when the historical filtering includes multiple users.
[0104] According to embodiments of this disclosure, the second session sequence is historical interaction information of multiple users, including multiple pull actions. Accordingly, the second session sequence can be divided into multiple sub-session sequences, and each user can have multiple sessions. The sub-session sequence includes identification information for at least one repository, and the identification information of the at least one repository is sorted according to the click order of users within a preset time period.
[0105] Specific preset time periods include one day, one hour, one week, etc. They can also be sorted according to the order of clicks made during a single user session.
[0106] This disclosure proposes a novel graph neural network model that combines a global session model, a heterogeneous representation model, and a gated recurrent neural network for exploring fusion methods, to achieve heterogeneous graph software service recommendation that integrates shared user and session interests. The novel graph neural network model proposed in this disclosure can fully utilize rich interaction information to dynamically integrate repository representations, recommending repositories that meet developers' needs. Furthermore, the novel graph neural network model proposed in this disclosure can creatively study the interactive pull behavior of software service recommendation, realizing software service recommendation.
[0107] Furthermore, an adaptive fusion mechanism is introduced during the prediction phase to obtain the user-pushed session representation. There is no need to artificially search for a suitable fusion mechanism; the global and heterogeneous representations can be adaptively fused using only the parameter information obtained during the training phase, significantly reducing the fusion difficulty.
[0108] During the training phase, this disclosure utilizes novel neighborhood user modeling and heterogeneous graph networks. After identifying users with similar pull behaviors, it uses these users as the target object to model neighborhood users, thus obtaining a historical interaction heterogeneous graph. Furthermore, the obtained historical interaction heterogeneity is used to train a heterogeneous representation model to learn the pull features of similar users, enhancing the accuracy of repository representation and improving the quality of software service recommendations.
[0109] Furthermore, by applying the disclosed service recommendation method to the public dataset GitHub, we achieved software service recommendation results that outperform other algorithms.
[0110] Figure 5 A schematic block diagram of a software service recommendation apparatus according to an embodiment of the present disclosure is shown.
[0111] like Figure 5 As shown, the software service recommendation device 500 of this embodiment includes an acquisition module 510, a first determination module 520, a second determination module 530, and a prediction module 540.
[0112] The acquisition module 510 is used to acquire a first session sequence, which includes identification information of N repositories. The identification information of the N repositories is sorted according to the click order corresponding to the target, and N is greater than or equal to 2. In one embodiment, the acquisition module 510 can be used to perform the operation S210 described above, which will not be repeated here.
[0113] The first determining module 520 is used to input the first session sequence into the global session model and output a global embedding matrix. In one embodiment, the first determining module 520 can be used to perform the operation S220 described above, which will not be repeated here.
[0114] The second determining module 530 is used to input the heterogeneous graph corresponding to the first session sequence into the heterogeneous representation model and output a heterogeneous embedding matrix. In one embodiment, the second determining module 530 can be used to perform the operation S230 described above, which will not be repeated here.
[0115] The prediction module 540 is used to determine, based on the global embedding matrix and the heterogeneous embedding matrix, a target repository to be recommended to the target object from among N repositories. The target repository is used to implement software services with preset functions. In one embodiment, the prediction module 540 can be used to perform the operation S240 described above, which will not be repeated here.
[0116] According to embodiments of this disclosure, the prediction module 540 includes a first determining unit, a second determining unit, and a third determining unit.
[0117] The first determining unit is used to process the global embedding matrix and the heterogeneous embedding matrix using a gated recurrent neural network to obtain heterogeneous representations and global representations. In one embodiment, the first determining unit can be used to perform the operation S341 described above, which will not be repeated here.
[0118] The second determining unit is used to determine the heterogeneous predicted value and the global predicted value based on the inner product similarity between the global representation and the global embedding matrix, and the inner product similarity between the heterogeneous representation and the heterogeneous embedding matrix, respectively. In one embodiment, the second determining unit can be used to perform the operation S342 described above, which will not be repeated here.
[0119] The third determining unit is used to determine the final predicted value of each of the N repositories based on the heterogeneous predicted value and the global predicted value, and to determine the repository with the highest final predicted value as the target repository. In one embodiment, the third determining unit can be used to perform the operation S343 described above, which will not be repeated here.
[0120] According to embodiments of this disclosure, the second determining module 530 includes a fourth determining unit, a fifth determining unit, a sixth determining module, and a seventh determining module.
[0121] The fourth determining unit is used to input the N repositories in the heterogeneous graph into the first layer relational graph convolutional network and output the first layer embedding data of the N repositories.
[0122] The fifth determining unit is used to input the first layer embedding data back into the first layer relational graph convolutional network, and input the output data of the first layer relational graph convolutional network into the second layer relational graph convolutional network, outputting the second layer embedding data of N repositories.
[0123] The sixth determining unit is used to input the second layer embedding data into the first layer relational graph convolutional network until the Lth layer relational graph convolutional network outputs the Lth layer embedding data of N repositories.
[0124] The seventh determining unit is used to take the sum of the L-layer embedding data of the i-th repository as the embedding representation of the i-th repository, and obtain the heterogeneous embedding matrix. The heterogeneous embedding matrix includes the embedding representations of N repositories, where L is greater than or equal to 2, and i is greater than or equal to 1 and less than or equal to N.
[0125] According to embodiments of this disclosure, the first determining module 510 includes an eighth determining unit and a ninth determining unit.
[0126] The eighth determining unit is used to input the first session sequence into the gated graph neural network, so that the gated graph neural network outputs the state vectors of the N repositories at the next moment based on the current state vectors of the N repositories in the first session sequence.
[0127] The ninth determining unit is used to determine the global embedding matrix of the first session sequence using the state vectors of the N repositories at the next time step.
[0128] Figure 6 A block diagram of an electronic device illustrating a software service recommendation method according to an embodiment of the present disclosure is shown schematically.
[0129] like Figure 6As shown, an electronic device 600 according to an embodiment of this disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.
[0130] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0131] According to embodiments of this disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0132] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0133] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.
[0134] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the software service recommendation method provided in the embodiments of this disclosure.
[0135] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0136] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0137] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0138] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0139] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0140] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0141] The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of this disclosure. It should be understood that the above descriptions are merely specific embodiments of this disclosure and are not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.
Claims
1. A software service recommendation method, comprising: Obtain a first session sequence, which includes identification information of N repositories. The identification information of the N repositories is sorted according to the click order of the target object, and N is greater than or equal to 2. The first session sequence is input into the global session model, and the global embedding matrix is output. The global session model includes a gated graph neural network. The heterogeneous graph corresponding to the first session sequence is input into the heterogeneous representation model, and the heterogeneous embedding matrix is output. The heterogeneous representation model includes an L-layer relational graph convolutional network. as well as Based on the global embedding matrix and the heterogeneous embedding matrix, a target repository to be recommended to the target object is determined from the N repositories. The target repository is used to implement software services with preset functions. The step of determining the target repository to be recommended to the target object from the N repositories based on the global embedding matrix and the heterogeneous embedding matrix includes: The global embedding matrix and the heterogeneous embedding matrix are processed using a gated recurrent neural network to obtain heterogeneous representation and global representation, wherein the global embedding matrix and the heterogeneous embedding matrix share the network parameters of the gated recurrent neural network; Based on the inner product similarity between the global representation and the global embedding matrix, and the inner product similarity between the heterogeneous representation and the heterogeneous embedding matrix, the heterogeneous prediction value and the global prediction value are determined respectively. Based on the heterogeneous prediction value and the global prediction value, the final prediction value of each of the N repositories is determined, and the repository with the highest final prediction value is determined as the target repository.
2. The method according to claim 1, wherein, The step of using a gated recurrent neural network to process the global embedding matrix and the heterogeneous embedding matrix to obtain heterogeneous representations and global representations includes: The global embedding matrix and the heterogeneous embedding matrix are alternately input into the gated recurrent neural network, which alternately outputs the heterogeneous representation and the global representation.
3. The method according to claim 1, wherein, The step of determining the final predicted value for each of the N repositories based on the heterogeneous predicted value and the global predicted value includes: The final predicted value is obtained by adding the product of the heterogeneous predicted value and the first activation function, and the product of the global predicted value and the second activation function, wherein the first activation function and the second activation function are used to determine the fusion relationship between the heterogeneous predicted value and the global predicted value.
4. The method according to claim 1, wherein, The step of inputting the heterogeneous graph corresponding to the first session sequence into the heterogeneous representation model and outputting a heterogeneous embedding matrix includes: The N repositories in the heterogeneous graph are input into the first layer of the relational graph convolutional network, and the first layer of embedding data of the N repositories is output. The first layer of embedded data is input again into the first layer of relational graph convolutional network, and the output data of the first layer of relational graph convolutional network is input into the second layer of relational graph convolutional network to output the second layer of embedded data of the N repositories; The second layer of embedded data is input into the first layer of the relational graph convolutional network until the Lth layer of the relational graph convolutional network outputs the Lth layer of embedded data for the N repositories; and The sum of the L layers of embedded data of the i-th repository is used as the embedding representation of the i-th repository to obtain the heterogeneous embedding matrix. The heterogeneous embedding matrix includes the embedding representations of the N repositories, where L is greater than or equal to 2, and i is greater than or equal to 1 and less than or equal to N.
5. The method according to claim 1, wherein, The step of inputting the first session sequence into the global session model and outputting a global embedding matrix includes: The first session sequence is input into the gated graph neural network, so that the gated graph neural network outputs the state vectors of the N repositories at the next moment based on the current state vectors of the N repositories in the first session sequence; and The global embedding matrix of the first session sequence is determined by using the state vectors of the N repositories at the next time step.
6. The method according to claim 1, wherein, The method for determining the heterogeneous representation model includes: Obtain Q second session sequences corresponding to Q users. The second session sequence includes the identification information of M repositories. The identification information of the M repositories is sorted according to the user's historical click order, where M is greater than or equal to 2 and Q is greater than or equal to 2. Based on the Q second session sequences, P relevant users are selected from the Q users, where P is greater than or equal to 1 and less than or equal to Q. Based on the P+1 second session sequences corresponding to the P related users and the q-th user, a historical interaction heterogeneous graph is obtained; and The heterogeneous representation model to be trained is trained using the historical interaction heterogeneous graph, and the heterogeneous representation model is obtained under the condition of satisfying the preset conditions.
7. The method according to claim 6, wherein, The step of selecting P relevant users from the Q users based on the Q second session sequences includes: Calculate the core values of the M repositories in the second session sequence corresponding to the q-th user, and construct the interest feature vector of the q-th user by embedding the K databases whose core values are higher than a preset threshold, where K is greater than or equal to 1 and less than or equal to M; Obtain Q interest feature vectors corresponding to the Q users; and Calculate the similarity between the Q interest feature vectors, and select P relevant users from the Q users based on the similarity.
8. The method according to claim 6, wherein, The second session sequence includes multiple sub-session sequences, each sub-session sequence including identification information of at least one repository, the identification information of the at least one repository being sorted according to the user's click order within a preset time period.
9. A software service recommendation device, comprising: The acquisition module is used to acquire a first session sequence, which includes identification information of N repositories. The identification information of the N repositories is sorted according to the click order corresponding to the target, and N is greater than or equal to 2. The first determining module is used to input the first session sequence into a global session model and output a global embedding matrix, wherein the global session model includes a gated graph neural network; The second determining module is used to input the heterogeneous graph corresponding to the first session sequence into the heterogeneous representation model and output the heterogeneous embedding matrix. The heterogeneous representation model includes an L-layer relational graph convolutional network. as well as The prediction module is used to determine, based on the global embedding matrix and the heterogeneous embedding matrix, a target repository to be recommended to the target object from among the N repositories, wherein the target repository is used to implement software services with preset functions; The prediction module includes: The first determining unit is used to process the global embedding matrix and the heterogeneous embedding matrix using a gated recurrent neural network to obtain a heterogeneous representation and a global representation, wherein the global embedding matrix and the heterogeneous embedding matrix share the network parameters of the gated recurrent neural network; The second determining unit is used to determine the heterogeneous prediction value and the global prediction value based on the inner product similarity between the global representation and the global embedding matrix, and the inner product similarity between the heterogeneous representation and the heterogeneous embedding matrix, respectively. The third determining unit is used to determine the final predicted value of each of the N repositories based on the heterogeneous predicted value and the global predicted value, and to determine the repository with the highest final predicted value as the target repository.
10. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 8.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Recommended object determination method and device, electronic equipment and storage medium
CN111881269A
Session recommendation method, recommendation model training method, device, equipment and medium
CN114117219A