Open Access

Research on Mobile Point Exchange System Based on Collaborative Filtering Recommendation Algorithm

 and    | Feb 21, 2022

Cite

INTRODUCTION

The personalized recommendation system has played a vital role in the development of ecommerce platforms. In order to better serve customers, the system adopts a collaborative filtering recommendation algorithm, which is a commonly used recommendation algorithm in many e-commerce systems. When the user is performing an operation, the system will record the user’s operation log, including the behavior track of which products the user has viewed, favorite products, and sharing or evaluating products. Based on these logs, the algorithm converts these operations into points on the coordinates, and calculates the distance between these points to determine the degree of similarity between users, thereby recommending suitable products for users, that is, the common “guess you like” and “People who bought this product also like it” and other functions. Mainly realized by the following ways:

Recommend to you based on people who share your preferences.

Recommend similar items to you based on the items you like.

Comprehensive recommendation based on the above conditions.

Commonly used collaborative filtering algorithms mainly include user-based collaborative filtering algorithms and item-based collaborative filtering algorithms. The characteristics can be summarized as “people gather together and things are divided into groups”, and predictions and recommendations are made accordingly.

The realization of the collaborative filtering algorithm mainly solves the problem of how to calculate the similarity of data. To calculate the similarity, different similarity calculation methods should be selected according to the different characteristics of the data.

The calculation method of Jaccard similarity coefficient:

J ( A , B ) = | A B | | A B |

Among them, A and B are two different sets, and J is the ratio of the number of sample sets intersection and the number of sample sets union.

Cosine calculation method:

cos θ = x 1 x 2 + y 1 y 2 x 1 2 + y 1 2 x 2 2 + y 2 2

Among them, x1 and y1 are the horizontal and vertical coordinates of the vector A (x1, y1), and x2 and y2 are the horizontal and vertical coordinates of the vector B (x2, y2), and are the angles between the two vectors A and B.

cos θ = k = 1 n x 1 k x 2 k k = 1 n x 1 k 2 k = 1 n x 2 k 2

Among them, a and b are sample points a(x11,x12,...,x1n) and b(x21,x22,...,x2n) in two n-dimensional spaces, which are the angles between the two vectors of A and B.

When the system is looking for people with the same hobbies, it may find many people. For example, hundreds of people like product A, but among these hundreds of people, there may be dozens of people who also like product B at the same time, so the similarity is even greater. high. Usually a number K is set, and the K individuals with the highest calculated similarity are called the nearest K users as the recommended source group. When the amount of user data is very large, it will take a long time to find K users among all users, and in reality, there is no relationship between most users, so a reverse lookup table is needed here. The so-called anti-look-up table means that if someone likes products A, B, C, then use ABC as the line name, and list the people who like these products. Other people must have no resemblance to this person. If the degree is reached, calculate the similarity from these data and find K users. The specific calculation process is shown in Figure 1.

Figure 1.

The flow diagram for calculation

Due to the popularity, high exposure and popularity of first-line products, there is no need to recommend to users. Exclude products that users have browsed and purchased to avoid duplication of recommendations. At the same time, the products are classified into one to avoid cross-category recommendation of products. Since this type of collaborative filtering model needs to be supported by training data, and during a cold start, users will not complete all items in the data model, so the data will be sparse. In this case, when recommending products to users, recommendations can be made according to the types of products. In an e-commerce system, a collaborative filtering algorithm is needed to make intelligent recommendations for tens of millions of users. This is a great challenge to the response speed of the system and also consumes a lot of storage space. Therefore, selective recommendation can reduce the database. Storage overhead improves the response time of the system. In the calculation, the scope is appropriately delineated, and the products with no record and the category correlation gap are large, and users without operation records are eliminated, thereby reducing the pressure of calculation. At the same time, in order to improve the user experience, the recommended data can be trained and calculated during the offline period, but this solution will affect the accuracy of the recommendation to a certain extent.

TECHNICAL ARCHITECTURE DESIGN

The mobile terminal point exchange system uses a multi-layer architecture model to construct and decompose the program of the subtask group, and each subtask is at a specific level of abstraction. The layered architecture mode needs to determine the dependencies of each layer, so that each layer of the system can be separated, reduce the dependence between the layers, and make the module coupling between the systems lower, which is very beneficial for later maintenance.

The hierarchical structure of the mobile point redemption system is divided into the presentation layer, the business logic layer, the persistence layer, and the application layer. The presentation layer is also called the UI layer, which mainly processes user requests and returned data, and provides clients with application access. The application layer is also called the service layer, and its role is to decouple the presentation layer from the business logic layer. No business code appears in the presentation layer, and there is no need to modify the presentation layer code when modifying the business layer code. The business logic layer mainly processes the data interaction between the user and the system, and processes the data submitted by the form. After the data is processed by the business logic layer, the data can be persisted to realize data storage. The system architecture diagram is shown in Figure 2.

Figure 2.

The architecture diagram for system

When a user initiates a request through the page, it will first be processed in Spring MVC, forwarded through Dispatcher-Servlet, found the corresponding processing unit in the service interaction layer, enter the business logic layer for business processing, and finally perform data in the persistence layer after the operation is successful, it will return to the HTML page. The technical architecture diagram is shown in Figure 3.

Figure 3.

The architecture diagram for technology

FRONT FUNCTION MODULE DESIGN
Gift search function design

This system uses Solr search engine to first obtain the query string entered by the user, use the query parser QueryParser to parse the query string and generate the query object Query, use the searcher IndexSearcher to execute the query object Query to obtain TopDocs, and traverse TopDocs to obtain documents. Select the request handler RequestHandler according to the user’s request type, and select a RequestHander query parser to parse the user’s query string according to the parameter defType input by the user. After the query parser is parsed, it searches for the specified field according to the parameters entered by the user, performs some special processing after the query results, and uses the response processor ResponseWriter to return it to the user.

To realize the associative search, you need to configure the Solr word segmenter and filter, and the two must be used in combination to achieve the effect of the associative search. In the search process, the word segmenter of the Solr search engine will first split the searched content into the form of subject, predicate, and object, and then match the content in the database one by one. During this period, the Solr search engine will also pass the filter selects its results. Solr also provides users with flexible configuration, which can be configured in the schema.xml configuration file according to the business requirements of the system. To use Solr search engine’s own word segmentation and filter in the gift search, you first need to establish the table required for Solr query, copy the gift information and other related query content in the data to the newly created table, when the user searches for gifts At the time, Solr will query in the newly created table and sort and filter according to the configured word segmentation and filter. When a new gift is added to the system, the system’s monitor can be triggered, and the new gift can be copied to Solr’s query table, so that users can search for the new gift. During the development process, a Spring timer is also set to automatically query whether there is any new gift information, and regularly backup Solr’s search table to ensure the accuracy of user searches. The search function class diagram is shown in Figure 4, and the search module sequence diagram is shown in Figure 5.

Figure 4.

The class diagram for the searching interface

Figure 5.

The sequence diagram for the searching interface

Gift redemption function design

Users can use their points to redeem electronic gift certificates, such as buffet redemption coupons, car wash service redemption coupons, etc. If the redemption is successful, the coupon code information will be received, and the user can use this coupon code information as a voucher to enjoy the service.

After the user selects the electronic gift certificate, he can choose the redemption quantity to redeem. The system determines whether the current points are greater than the redemption points. If the customer’s points are greater than or equal to the redemption points, it will enter the order confirmation page, and the total points paid for the order can be settled. A prompt “You cannot redeem this product if you have insufficient points”. After the customer confirms that the order information is correct, the order information can be submitted, and the system will send the SMS verification code to the customer’s reserved mobile phone number. After the customer fills in the verification code, the points can be paid. After the system receives the payment information, the order will be generated and the customer points will be deducted by calling the point core interface. After the deduction is successful, the order creation is completed. The system will retrieve the inventory from the merchant through the real-time interface, and then the merchant will return the card password and expiration date. After the system retrieves the card secret information from the merchant system, the customer can receive the redemption success text message and the card secret text message sent by the system through the SMS platform; at the same time, they can also view or check in the “Personal Center-My Order or My Coupon Code”. Use the coupon code, and customers can use the coupon code offline or on other platforms of the merchant. The electronic gift certificate gift category diagram is shown in Figure 6, and the electronic gift certificate gift sequence diagram is shown in Figure 7.

Figure 6.

The class diagram for electronic coupon

Figure 7.

The sequence diagram for electronic coupon

Due to the particularity of the electronic gift certificate, the system will determine whether the order supports the return of the product based on the unique parameters of the gift.

If the gift expires and can be refunded, that is, if the coupon code is valid, the customer can click to apply for a refund at any time, the system will notify the supplier in real time, and the supplier will determine the status and refund the customer points after the card password is invalidated by the supplier; If the coupon code expires, the system will initiate an automatic batch task to query the card secret status to the supplier on the second working day after the coupon code expires. After the supplier returns the status as unused, the system cancels the order and refunds the points.

If the gift has expired and is not refundable, that is, if the coupon code expires and the card password status is not used, the system will cancel the order but not refund the points.

If the gift is non-refundable, the points will not be refunded in any state.

BACKSTAGE FUNCTION MODULE DESIGN
System management function design

The system management module provides functions such as organization management, channel management, and authority management for the system. According to the user authority design, different users have different menu authority. Managers can view, add, delete, and modify user information, jump from the current page to the user creation/edit page, support the modification and saving of user information, and export all lists under the current filtering conditions in EXCEL form, and at the same time The operation mode is displayed in the table, and the user information can be viewed, edited, enabled, disabled, postponed, and logged out. The system management module can realize both precise query and fuzzy query at the same time. When the condition is empty, click the query button, and the system will flashback all data according to the creation time; when the query condition is not empty, click the query button, and the system can find out all matches The data of the query conditions are arranged in a flashback according to the creation time. The initial password of the administrator after the successful creation can be set in the system parameters. The newly created account has only the main authority, only the user attribute authority, and does not control the display of any data items; the department authority and role are associated with the system-related functions. The system management class diagram is shown in Figure 8.

Figure 8.

The class diagram for system management

Role management function design

Role management can realize the functions of role assignment in the background of gift orders, adding and deleting roles, and displaying the list of existing roles in the system. The system roles include four categories: system management, business management, business operations, and report query.

System management roles: including system administrators and senior system administrators. The system administrator is mainly responsible for user addition, deletion, password reset, institution addition, deletion, and merging, and system parameter setting; the senior system administrator is responsible for related review work.

Business management roles: Including business administrators and senior business administrators. The business administrators are mainly responsible for reviewing points merchants, viewing report statistics, merchant reconciliation and settlement, etc. Business administrators are divided into head office and branch business administrators. Head office business administrators are responsible for entering and reviewing merchants cooperating with the head office. Branch business administrators manage the branch’s own cooperative merchants; senior business administrators are responsible for relevant review work.

Business operation roles: including business operators and senior business operators, mainly responsible for the daily operation and management of point e-commerce advertising, announcements, product classification management, merchant product review, and product order review.

Report query role: You can query the relevant reports of the organization where the salesperson is located and below.

The role management class diagram is shown in Figure 9, and the role management sequence diagram is shown in Figure 10.

Figure 9.

The class diagram for management of role

Figure 10.

The class diagram for management of orders

Order management module

The order management module is a module for administrators to implement batch management of orders placed by users. Operations administrators can view orders generated after customers redeem gifts and perform related operations. The details of the order include order information, product information, merchant information, etc. This module supports searching for orders based on product name, transaction time, order number, customer number, etc., and can export orders in batches, or display tabs according to order status.

At the same time, the system realizes the function of canceling the order. When the order meets the following conditions, the customer can unsubscribe:

The order is within the validity period.

The status of non-physical orders is redeemed.

The value-added service order status can only be cancelled when there is no appointment.

The order management class diagram is shown in Figure 11, and the order management sequence diagram is shown in Figure 12.

Figure 11.

The sequence diagram for management of orders

COLLABORATIVE FILTERING RECOMMENDATION ALGORITHM TEST

When testing the collaborative filtering algorithm, first establish a connection to Hive, read the data in Hive (SQL method), divide the data set, training set and test set (0.8, 0.2). Use the ALS function, set the parameters, and train the model through the training set, and use the test set to test the trained model. Finally, use./spark-submit -master yarn /program/wsh/readTpch1 to submit to spark for processing. Obtain the Euclidean coefficient between 5 users, which is the distance between users. The smaller the coefficient, the closer the distance between the two users and the closer the preferences. In order to avoid that the value is too small, it may not be able to accurately represent the difference in the distance between different users, so the calculated coefficient is taken as the reciprocal, so that the closer the distance between users, the larger the value. The output results are shown in Table 1.

THE TABLE FOR THE OUTPUT RESULT

USER COEFFICIENT RECIPROCAL
USER A&B 4.63 0.18
USER A&C 0.36 0.73
USER A&D 0.71 0.59
USER A&E 3.89 0.20
USER B&C 4.30 0.19
USER B&D 4.00 0.20
USER B&E 0.78 0.56
USER C&D 0.54 0.65
USER C&E 3.58 0.22
USER D&E 3.24 0.24
CONCLUSION

This paper summarizes and organizes all the content of the paper. Through the analysis of the background and significance of the project, the programming technology used, the outline design and detailed design of the system, etc., it summarizes the mobile point exchange system based on the collaborative filtering recommendation algorithm. The advantages and later development space provide effective and reasonable suggestions for follow-up research.

eISSN:
2470-8038
Language:
English
Publication timeframe:
4 times per year
Journal Subjects:
Computer Sciences, other