Disclosure of Invention
Problems to be solved by the invention
The invention mainly aims to provide a recommendation method and a recommendation system with a subtraction mechanism based on a graph neural network, which solve the problem of change of a recommendation system caused by change of friend states or relations in a friend system of the recommendation system, realize dynamic evaluation of friend recommendation and provide early warning for accounts with possible problems.
Means for solving the problems
In order to achieve the above object, the present invention provides a graph-based neural network recommendation method for presence subtraction mechanism, comprising:
acquiring a user data set and user characteristics, and performing grading initialization on user nodes;
carrying out positive scoring and negative scoring on the user, waiting for adding the score vector and subtracting the score vector, and evaluating the safety of the user according to the subtracting score vector;
when a friend is recommended to a certain user, the components of the addendum vector are added through weights, and the addition of the weights of the components in the subtracter vector is subtracted;
and updating the addend vector and the subtracter vector of the user at intervals, and re-detecting the safety of the user.
Preferably, the acquiring the user data set and the user characteristics comprises: position information, gender information, friend information, forwarding approval information and negative information records.
Preferably, the initializing the score of the user node comprises: and preprocessing user data, and initializing the adding component vector and the subtracting component vector through the initial friend information and behavior record of the user.
Preferably, positive scoring is performed according to the user characteristics to obtain a score-added vector, and negative scoring is performed on the negative information records to obtain a score-subtracted vector.
Preferably, the user scores are trained using a graphical neural network.
Preferably, when friend recommendation is performed on a certain user, deep learning is performed according to existing friend information of the user, wherein the weight of each component in the score-reduced vector is obtained through neural network learning or is obtained through manual presetting.
Preferably, in re-detecting user security, when an unsafe condition of a user is detected, the addend vector and the subtracter vector of the adjacent nodes of the user are re-calculated.
In order to achieve the above object, the present invention further provides a graph neural network-based recommendation system having a subtraction mechanism, comprising:
the acquisition module acquires a user data set and user characteristics and carries out grading initialization on user nodes;
the evaluation module is used for carrying out positive grading and negative grading on the user, waiting for the point adding vector and the point subtracting vector, and evaluating the safety of the user according to the point subtracting vector;
the weight adding module is used for adding all components of the adding and dividing vector through weights when a friend is recommended to a certain user, and subtracting the sum of all components in the subtracting and dividing vector through weights;
and the updating module updates the addend vector and the subtracter vector of the user at intervals and redetects the safety of the user.
The invention also provides an electronic device, a memory of the electronic device and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the method when executing the computer program.
The invention also provides a computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.
ADVANTAGEOUS EFFECTS OF INVENTION
Compared with the prior art, the invention has the following beneficial effects:
when a certain user is stolen or the actual user of the user is changed, the corresponding recommendation system can modify the recommendation strategy for the user and perform early warning on the user with potential safety hazard;
when the user has behaviors of frequently sending advertisements and the like, the recommendation strategy can be dynamically adjusted according to the condition of the user, and the recommendation of some users is avoided.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention. It should be further emphasized here that the following embodiments provide preferred embodiments, and that the various aspects (embodiments) may be used in combination or cooperation with each other.
As shown in fig. 2 to 5, a flow chart of a recommendation method based on a graph neural network with a subtraction mechanism, a schematic diagram of the recommendation method, a schematic diagram of an abstract model and a schematic diagram of a training process are respectively shown;
the recommendation method for the existing subtraction mechanism based on the graph neural network comprises the following steps:
step S1: acquiring a user data set and user characteristics, and performing grading initialization on user nodes;
in this step S1, the acquired user data set and user characteristics include: the system comprises position information, gender information, friend information, forwarding approval information, negative information records and the like, wherein the negative information records comprise frequently issued advertisements, marked by more users, suspected stolen numbers, mass-deleted friends and the like.
The scoring initialization of the user nodes comprises the following steps: preprocessing user data, such as data denoising, data filtering and the like, and initializing an addendum vector and a subtracter vector through friend information and behavior record of user initiation; for example, initialization may be set to all 0 s.
Step S2: carrying out positive grading and negative grading on the user to obtain a score adding vector and a score subtracting vector, and evaluating the safety of the user according to the score subtracting vector;
in step S2, a positive score is performed according to the degree (degree of a user node of the generated social network diagram) and the user characteristics to obtain an added score vector, each component of the added score vector represents a recommendation level of the user under a certain characteristic (such as location information, forwarding approval information, and the like), the higher the value is, the higher the recommendation priority is, the negative information record is negatively scored to obtain a subtracted score vector, and the score of the user characteristics is obtained through neural network training using the existing friend relationship, that is, the user score can be trained using the graph neural network, the subtracted score is taken into consideration in the recommendation process, and the specific subtracted score can be preset in advance.
Referring to fig. 4 and 5, the training process of the neural network of the figure will be described in detail:
model abstracted from data: a user-item (or user-video) bipartite graph (figure 4 illustrates a user-item as an example),
user characteristics: including login location, shopping history, user gender, etc.,
component division amount: when the number of times of the abnormal behavior of the user is increased, the dimensionality comprises the number of times of changing a login place, the number of times of logging in the user in a different place, the number of times of repeatedly purchasing different commodities, repeated transfer accounts, the number of times of goods return, user real name change information and the like, a threshold value is set for each dimensionality, and when the threshold value is exceeded (for example, when the login IP is changed for multiple times, the user is considered to have the risk of being stolen), an alarm is sent to a system administrator; when the user continuously logs in the different places for multiple times, the user is considered to change the location, and the information related to friend recommendation which is not in the same area with the user is reduced; when the user changes the real-name information, the recommendation of the commodities or videos collected by the user to the friends of the user should be temporarily reduced,
adding the component vector: recording the times of normal actions of the user, such as the times of shopping when goods return does not occur and goods receiving is confirmed by clicking on time, normally browsing the finished video and agreeing on times,
the user who browses the finished video and gives more favorable behaviors can have higher recommendation weight in a certain range for the video which is praised,
in addition, since the score vector subtraction vector is suitable for recommendation evaluation among users, only the left part in the social network, namely the user part, needs to be trained,
social network graph composed by users:
the left side shows the relationship of the users with each other's attention, and the interaction between the users and the goods shows that the users buy a certain goods (or praise behavior in the video platform).
Step S3: when a friend is recommended to a certain user, the components of the addendum vector are added through weights, and the addition of the weights of the components in the subtracter vector is subtracted;
in this step, for the behavior that the user needs to evaluate, such as scoring characteristics of shopping records, login location, etc., the score increases when his friend is close to his login location, which can be calculated using the graphical neural network.
And when the user value is detected to be the approval of the user for a certain video, the user is recommended to friends with the weight, and if the video is approved by a plurality of friends of the same user, the scores are added, namely the video is ranked more ahead in a list recommended to the user.
In addition, in the component of the user to the user, when a value exceeding a threshold value exists in the negative information vector of a certain user, an alarm is sent to the relevant user, or the user is marked, and alarm information, a seal number suggestion and the like are sent to manual audit; the related users refer to friends and platform supervisors.
When friend recommendation is performed on a user, deep learning is performed according to existing friend information of the user, wherein the weight of each component in the subtractive vector can be obtained through neural network learning or can be obtained through manual presetting;
if the user performs a large amount of negative evaluations or abnormal information sharing in a short period of time on the social platform, the user uses his friends to send an abnormal alarm, which indicates that "your user is at risk of being stolen".
Step S4: and updating the addend vector and the subtracter vector of the user at intervals, and re-detecting the safety of the user.
In the process of re-detecting the user security, when the situation that the user is unsafe is detected, the addend vector and the subtracter vector of the adjacent nodes of the user are re-calculated; the "adjacent node" refers to a node having a friend relationship with the adjacent node.
The recommendation strategy can be modified at any time by the deduction amount, and when the actual user of the user changes, the use habit of the user changes, and the user is not recommended to the former recommendation user;
when the user has more inappropriate behavior, one of the score-subtracted vectors exceeds a threshold, and the system pays special attention to the user.
That is, the invention respectively maintains the adding and subtracting vector and the influencing recommendation strategy; when a certain value in the subtractive vector exceeds a preset threshold, the system should issue a warning.
The aggregation function of the graph neural network-based recommendation method of the present invention is represented as follows:
HVl+1=AGGREGATE{(α*HNsum of the components of the adducted vector-beta HNSum of components of the subtractive vector) × HN}
H denotes user characteristics, alpha, beta denote trainable parameters, HNRepresents HVIs the feature of the neighbor node of (1), l represents the number of training layers
FIG. 6 is a block diagram of a graph neural network based recommendation system with a subtraction mechanism of the present invention; the present invention provides arecommendation system 1 based on a neural network of a figure with a subtraction mechanism, comprising:
theacquisition module 11 is used for acquiring a user data set and user characteristics and carrying out rating initialization on user nodes;
theevaluation module 12 is used for carrying out positive scoring and negative scoring on the user, waiting for the score adding vector and the score subtracting vector, and evaluating the safety of the user according to the score subtracting vector;
aweight summing module 13, which sums the components of the bonus vector by weight and subtracts the sum of the components of the subtractive vector by weight when recommending friends to a certain user; and
and the updatingmodule 14 updates the addend vector and the subtracter vector of the user at intervals and redetects the safety of the user.
In summary, the invention recommends and scores friends in the recommendation system, or recommends the user according to the shopping habits of the friends, but when the user has the risk of stealing the number or swiping a bill, when the friends send a message to the user, the invention sends the early warning that the friends are likely to steal the number to the user, or when the friend account of a certain user swipes a bill, the invention does not push the commodity to the user, namely, the recommendation score of the commodity is reduced.
The method and the device can effectively overcome the problem that the number of nodes with labels in the graph data is small, so that the abnormal account in the recommendation system can be detected more quickly and accurately.
Referring to fig. 7, an embodiment of the present application further provides anelectronic device 200, where theelectronic device 200 includes at least onememory 210, at least oneprocessor 220, and abus 230 connecting different platform systems.
Thememory 210 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)211 and/orcache memory 212, and may further include Read Only Memory (ROM) 213.
Thememory 210 further stores a computer program, and the computer program can be executed by theprocessor 220, so that theprocessor 220 executes the steps of the recommendation method in the embodiment of the present application, and a specific implementation manner of the method is consistent with the implementation manner and the achieved technical effect described in the embodiment of the recommendation method, and some contents are not described again.
Memory 210 may also include autility 214 having at least oneprogram module 215,such program modules 215 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Accordingly, theprocessor 220 may execute the computer programs described above, and may execute theutility 214.
Bus 230 may be a local bus representing one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or any other type of bus structure.
Theelectronic device 200 may also communicate with one or moreexternal devices 240, such as a keyboard, pointing device, bluetooth device, etc., and may also communicate with one or more devices capable of interacting with theelectronic device 200, and/or with any devices (e.g., routers, modems, etc.) that enable theelectronic device 200 to communicate with one or more other computing devices. Such communication may be through input-output interface 250. Also, theelectronic device 200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via thenetwork adapter 260. Thenetwork adapter 260 may communicate with other modules of theelectronic device 200 via thebus 230. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with theelectronic device 200, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, to name a few.
The embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium is used for storing a computer program, and when the computer program is executed, the steps of the recommendation method in the embodiment of the present application are implemented, and a specific implementation manner of the steps is consistent with the implementation manner and the achieved technical effect described in the embodiment of the recommendation method, and some contents are not described again.
Fig. 8 shows aprogram product 300 for implementing the above recommendation method provided in this embodiment, which may employ a portable compact disc read only memory (CD-ROM) and include program codes, and may be run on a terminal device, such as a personal computer. However, theprogram product 300 of the present invention is not so limited, and in this application, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.Program product 300 may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that can communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing. Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the C language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
While the present application is described in terms of various aspects, including exemplary embodiments, the principles of the invention should not be limited to the disclosed embodiments, but are also intended to cover various modifications, equivalents, and alternatives falling within the spirit and scope of the invention as defined by the appended claims.