A smart self-service recharge system and its security optimization method

By introducing a microservice architecture and an event-driven mechanism, the flexibility and security issues of the recharge system were resolved, event handling was optimized, efficient personalized recommendations and high-concurrency processing were achieved, and the convenience and security of the system were improved.

CN119888935BActive Publication Date: 2025-10-31HUIZHI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510090277.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-10-31
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

Existing recharge systems lack flexibility and scalability, have weak security, are vulnerable to data attacks, lack personalized recommendations, have low event processing efficiency, and cannot meet high concurrency requirements.

Method used

It adopts a microservice architecture, including a main application server, an event bus cluster, NAS storage devices, API gateway, payment gateway server, anomaly detection server, LAN switch, self-service terminal, card reader, firewall gateway, and external payment system interface. It implements an event-driven architecture through Kafka's publish-subscribe mechanism, uses encrypted communication protocols and multi-factor authentication, and introduces intelligent recommendation algorithms.

Benefits of technology

It improves the system's flexibility and scalability, enhances data security, optimizes the event handling mechanism, supports high-concurrency processing, improves user experience and system convenience, and enables personalized recommendations and real-time data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888935B_ABST
    Figure CN119888935B_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent self-service recharge system and its security optimization method, belonging to the field of communication technology. It includes a main application server, an event bus cluster, a NAS storage device, an API gateway, a payment gateway server, an anomaly detection server, a LAN switch, a self-service terminal, a card reader, a firewall gateway, and an external payment system interface. It solves the technical problems of providing modular services, improving system flexibility and scalability, enhancing data security, and optimizing event handling mechanisms. It is easy to expand and maintain, improves data interaction efficiency, has efficient event handling, enhanced data security, an intelligent recommendation engine, and an innovative user experience. It seamlessly integrates identity verification, payment, photo upload, and feedback processes, significantly improving system usability. It also introduces a social recommendation mechanism to enhance employee interaction and consumption experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of communication technology, and in particular relates to an intelligent self-service recharge system and its security optimization method. Background Technology

[0002] With the widespread adoption of intelligent systems, enterprise recharge management systems are gradually evolving towards self-service and digitalization. Existing recharge systems typically include the following functions:

[0003] Identity verification: Identity confirmation is completed based on card swiping, fingerprint or facial recognition;

[0004] Top-up payment: Online payment can be made by linking a bank card or a third-party payment platform;

[0005] Record Inquiry: Provides query functions for recharge records and consumption details;

[0006] Device interconnection: Connecting multiple terminals via a local area network or the Internet to achieve information synchronization and sharing;

[0007] Most of these systems rely on traditional centralized designs, lacking modularity and flexibility. Furthermore, data security and anomaly handling capabilities typically depend on simple rules rather than intelligent algorithms, making them unsuitable for complex scenarios.

[0008] Disadvantages of existing technology:

[0009] Architectural design limitations: lack of flexible system architecture, difficulty in dynamically expanding functional modules; high coupling between multiple modules, resulting in high costs for modification or expansion;

[0010] Weak security: Data transmission mostly uses basic encryption mechanisms, which are vulnerable to network attacks. Anomaly detection relies on simple rules and cannot cope with complex abnormal transaction behavior.

[0011] Insufficient personalization: Most recommendation systems are based on static rules, making it difficult to achieve dynamic personalized recommendations. They fail to fully utilize user behavior data, environmental data, and social data, resulting in low recommendation accuracy.

[0012] Inefficient event handling: Traditional synchronous communication methods cannot meet high concurrency requirements; without event-driven architecture support, data flow efficiency is low and system response speed is slow. Summary of the Invention

[0013] The purpose of this invention is to provide an intelligent self-service recharge system and its security optimization method, which solves the technical problems of providing modular services, improving system flexibility and scalability, enhancing data security, and optimizing event handling mechanisms.

[0014] To achieve the above objectives, the present invention adopts the following technical solution:

[0015] An intelligent self-service recharge system includes a main application server, an event bus cluster, a NAS storage device, an API gateway, a payment gateway server, an anomaly detection server, a local area network switch, a self-service terminal, a card reader, a firewall gateway, and an external payment system interface;

[0016] The LAN switch communicates with the main application server, event bus cluster, NAS storage device, API gateway, payment gateway server, anomaly detection server, self-service terminal and card reader via the LAN;

[0017] The main application server communicates with the event bus cluster, API gateway, and NAS storage device via a LAN switch.

[0018] The event bus cluster communicates with the main application server, payment gateway server, anomaly detection server, and self-service terminal via a local area network switch.

[0019] The payment gateway server communicates with the API gateway and the event bus cluster via a local area network switch.

[0020] The anomaly detection server communicates with the event bus cluster and the main application server via a LAN switch;

[0021] The firewall gateway connects to the payment gateway server, and the external payment system interface communicates with the payment gateway server through the firewall gateway.

[0022] Preferably, the main application server is connected to the LAN switch via Gigabit Ethernet, and the main application server communicates with the API gateway via a REST interface;

[0023] The event bus cluster uses Kafka's publish-subscribe mechanism to communicate with the main application server, payment gateway server, anomaly detection server, and self-service terminal.

[0024] The API gateway acts as a proxy for external interfaces, and also communicates with the payment gateway server to forward payment requests and receive results.

[0025] The payment gateway server is used to process payment requests and send payment results;

[0026] The anomaly detection server is used to subscribe to payment and consumption behavior events, and publish abnormal behavior events after detecting anomalies;

[0027] Firewall gateways are used to manage communication between the public network and the internal network, protecting data security;

[0028] The external payment system interface communicates with the payment gateway server through a firewall gateway, using the HTTPS protocol to ensure data security.

[0029] Preferably, the event bus cluster consists of 3 Kafka servers to realize message passing in an event-driven architecture; the NAS storage device is a 12TB RAID 10 storage array.

[0030] Preferably, the self-service terminal is equipped with a card swiping module, a facial recognition camera, and a touch screen; the external payment system interface is connected to a third-party payment system.

[0031] A method for optimizing the security of intelligent self-service recharge includes the following steps:

[0032] Step 1: Establish an intelligent self-service recharge system and deploy a microservice architecture within it;

[0033] Employees select an identity verification method at the self-service terminal, and the self-service terminal collects the identity verification data;

[0034] The identity verification service interacts with the user management service's database to verify employee identities; if identity verification is successful, the employee ID is returned, and the process proceeds to the next step; if verification fails, a prompt message is returned.

[0035] The authentication service publishes a "user authentication successful event" to Kafka, and the user management service subscribes to the event and updates the session state.

[0036] Employees enter the recharge page, and the self-service terminal displays recommended payment methods;

[0037] The recommendation service analyzes employees' historical spending records, environmental data, and social data to return personalized payment method recommendations, which are then displayed on the page.

[0038] The recommendation service publishes "recommendation update events" to Kafka, and the self-service terminal subscribes to the events to dynamically update the recommendation content;

[0039] Employees select a payment method and confirm the recharge amount; the intelligent self-service recharge system then calls the payment gateway to complete the transaction.

[0040] The payment service calls the payment gateway to process the transaction, update the employee's account balance, and after the payment is completed, generates a payment voucher and returns it to the terminal.

[0041] The payment service publishes a "payment success event" to Kafka, the recommendation service subscribes to the event to update the recommendation strategy, the anomaly detection service subscribes to the event to check for abnormal payment behavior, and the user management service subscribes to the event to update the account balance and recharge records.

[0042] Step 2: Employees take photos at the self-service terminal, which then transmits the photos to the photo upload service, which stores the photos on the NAS storage device.

[0043] The photo upload service publishes a "photo upload successful" event to Kafka, and the user management service subscribes to the event to update employee photo information.

[0044] Step 3: The intelligent self-service recharge system regularly analyzes employee behavior, environmental factors, etc. to generate recommended content. The recommendation service generates recommended content based on the latest data.

[0045] The recommendation service publishes "recommendation update events" to Kafka, and the self-service terminal subscribes to the events and updates the page in real time;

[0046] Employees submit feedback information through self-service terminals. The feedback service receives and stores the feedback data for subsequent optimization and analysis.

[0047] The feedback service publishes a "feedback submission event" to Kafka, and the recommendation service subscribes to the event and adjusts the algorithm to optimize subsequent recommendation content.

[0048] Step 4: The intelligent self-service recharge system encrypts the transmission of all sensitive data;

[0049] The security service generates and manages encryption keys, enables mTLS for microservice communication, publishes "data encryption events," and the log service subscribes to record compliance information.

[0050] When employee identity verification fails, the intelligent self-service recharge system requires the user to enter an SMS verification code or complete App authentication.

[0051] The identity verification service works in conjunction with the SMS service or App authentication service to complete multi-factor authentication, and the identity verification service publishes an "identity verification failure event" or an "identity verification success event".

[0052] The system monitors transaction behavior in real time and detects abnormal payment patterns;

[0053] The anomaly detection service analyzes transaction logs, locks accounts when anomalies are detected, and notifies users to perform secondary verification. The anomaly detection service also issues an "abnormal transaction event" to notify relevant services to respond.

[0054] Preferably, the microservice architecture specifically includes authentication service, payment service, recommendation service, anomaly detection service, user management service, photo upload service, security service, logging and monitoring service, and event handling service.

[0055] Preferably, in a microservice architecture, communication between microservices includes synchronous and asynchronous communication. Synchronous communication uses RESTful APIs or GraphQL APIs for real-time data interaction, suitable for authentication and payment processing; asynchronous communication uses Apache Kafka as a message queue to implement event-driven asynchronous communication, suitable for recommendation updates and anomaly detection.

[0056] Ideally, a separate database should be established for each microservice:

[0057] Authentication service: Employee identity data is stored using the relational database PostgreSQL;

[0058] Payment services: Use a relational database to record payment transaction information;

[0059] Recommendation service: Uses NoSQL databases to store user behavior data and recommendation strategies;

[0060] Anomaly detection service: Uses the time-series database InfluxDB to monitor transaction behavior;

[0061] User management services: Establish a database to centrally manage employee account information and spending records;

[0062] Photo upload service: Establish a database to store employee photos;

[0063] Security services: Establish a database using stored encryption keys and security policies to store encrypted information;

[0064] Logs and monitoring services: Use the ELK Stack for log collection and analysis.

[0065] Preferably, for Kafka operations, an event-driven architecture is deployed, including user authentication success events, recommendation update events, payment success events, photo upload success events, recommendation update events, feedback submission events, data encryption events, authentication failure events, authentication success events, and abnormal transaction events.

[0066] This invention discloses an intelligent self-service recharge system and its security optimization method, which solves the technical problems of providing modular services, improving system flexibility and scalability, enhancing data security, and optimizing event handling mechanisms. The invention features a flexible microservice architecture, with each microservice running independently, facilitating expansion and maintenance, improving data interaction efficiency, and efficient event handling. It utilizes the Kafka event bus to implement an event-driven architecture, supporting asynchronous communication and high-concurrency processing. Event stream optimization reduces system latency and improves data real-time performance. Enhanced data security is achieved through the full implementation of encrypted communication protocols to ensure secure data transmission. An intelligent recommendation engine supports real-time feedback mechanisms, continuously optimizing recommendation strategies to improve user experience. The system offers an innovative user experience, seamlessly integrating identity verification, payment, photo upload, and feedback processes, significantly improving ease of use. Furthermore, the introduction of a social recommendation mechanism enhances employee interaction and the overall consumption experience. Attached Figure Description

[0067] Figure 1This is a schematic diagram of the system architecture of the present invention;

[0068] Figure 2 This is the main flowchart of the present invention;

[0069] Figure 3 This is a flowchart of step 1 of the present invention;

[0070] Figure 4 This is a flowchart of step 2 of the present invention;

[0071] Figure 5 This is a flowchart of step 3 of the present invention;

[0072] Figure 6 This is a flowchart of step 4 of the present invention. Detailed Implementation

[0073] Example 1:

[0074] Depend on Figure 1 The intelligent self-service recharge system shown includes a main application server, an event bus cluster, a NAS storage device, an API gateway, a payment gateway server, an anomaly detection server, a local area network switch, a self-service terminal, a card reader, a firewall gateway, and an external payment system interface.

[0075] The LAN switch communicates with the main application server, event bus cluster, NAS storage device, API gateway, payment gateway server, anomaly detection server, self-service terminal and card reader via the LAN;

[0076] The main application server communicates with the event bus cluster, API gateway, and NAS storage device via a LAN switch.

[0077] The main application server is connected to the LAN switch via Gigabit Ethernet, and communicates with the API gateway via a REST interface.

[0078] In this embodiment, the main application server is configured with an 8-core CPU, 32GB RAM, and 1TB SSD; its functions include background management, recommendation engine, and data processing.

[0079] Local area network switch configuration: 24-port gigabit switch, supports VLAN, function is to connect various terminals and servers.

[0080] The API gateway acts as a proxy for external interfaces, and also communicates with the payment gateway server to forward payment requests and receive results.

[0081] The API gateway is configured with a 4-core CPU, 16GB RAM, and 256GB SSD; its functions include interface management and load balancing.

[0082] The NAS storage device is a 12TB RAID 10 storage array, designed to store employee photos, transaction records, and recommendation logs.

[0083] The self-service terminal is equipped with a card swiping module, a facial recognition camera, and a touch screen; the external payment system interface connects to a third-party payment system.

[0084] The event bus cluster communicates with the main application server, payment gateway server, anomaly detection server, and self-service terminal via a local area network switch.

[0085] The event bus cluster uses Kafka's publish-subscribe mechanism to communicate with the main application server, payment gateway server, anomaly detection server, and self-service terminal.

[0086] The event bus cluster consists of three Kafka servers, enabling message passing in an event-driven architecture.

[0087] The event bus cluster is configured with 3 Kafka servers, each with a 4-core CPU, 16GB RAM, and 500GB SSD; its function is message passing in an event-driven architecture.

[0088] The payment gateway server communicates with the API gateway and the event bus cluster via a local area network switch.

[0089] The payment gateway server is used to process payment requests and send payment results; the payment gateway server is configured with a 4-core CPU, 16GB RAM, and 256GB SSD.

[0090] The anomaly detection server communicates with the event bus cluster and the main application server via a LAN switch;

[0091] The anomaly detection server is used to subscribe to payment and consumption behavior events, and publish abnormal behavior events after detecting anomalies;

[0092] The anomaly detection server is configured with a 6-core CPU, 32GB RAM, and 512GB SSD, and its function is to detect abnormal payment or account behavior.

[0093] The firewall gateway connects to the payment gateway server, and the external payment system interface communicates with the payment gateway server through the firewall gateway.

[0094] Firewall gateways are used to manage communication between the public network and the internal network, protecting data security;

[0095] The external payment system interface communicates with the payment gateway server through a firewall gateway, using the HTTPS protocol to ensure data security.

[0096] In this embodiment, the firewall gateway is configured as follows:

[0097] IP access control: Restrict access from external devices through a whitelist policy, allowing only pre-authorized IP addresses to access critical systems;

[0098] Port restrictions: Only open the necessary ports (such as ports 80 and 443 for HTTP / HTTPS traffic), and close the rest of the ports or set them to be accessible only to the internal network;

[0099] Inbound and outbound rules: Establish strict inbound and outbound traffic rules to ensure that external traffic can only access public network service interfaces, and access to all other services is strictly restricted;

[0100] Traffic monitoring and auditing: Configure logging, monitor traffic activity in real time, detect and block abnormal traffic, and audit network access logs regularly.

[0101] In this embodiment, multiple self-service terminals can be deployed. Each self-service terminal is configured with an embedded system (8-core ARM processor, 4GB RAM), a card swiping module, a face recognition camera, and a touch screen.

[0102] Multiple card readers can be deployed. A card reader is a dedicated card-reading payment terminal, such as a POS machine, with a printing module.

[0103] Example 2:

[0104] like Figures 2-6 As shown, the intelligent self-service recharge security optimization method described in Example 2 is implemented based on the intelligent self-service recharge system described in the example, and includes the following steps:

[0105] Step 1: Establish an intelligent self-service recharge system and deploy a microservice architecture within it;

[0106] The microservice architecture specifically includes authentication service, payment service, recommendation service, anomaly detection service, user management service, photo upload service, security service, logging and monitoring service, and event handling service.

[0107] The specific microservice architecture is shown in Table 1:

[0108]

[0109] Table 1

[0110] In a microservice architecture, communication between microservices includes synchronous and asynchronous communication. Synchronous communication uses RESTful APIs or GraphQL APIs for real-time data interaction, which is suitable for authentication and payment processing. Asynchronous communication uses Apache Kafka as a message queue to implement event-driven asynchronous communication, which is suitable for recommendation updates and anomaly detection.

[0111] In this embodiment, the service network of the microservices is as follows:

[0112] Traffic management: Istio manages traffic between microservices, enabling load balancing and fault recovery;

[0113] Secure communication: Enable mTLS (mutual TLS encryption) to protect communication between microservices and prevent man-in-the-middle attacks and data tampering;

[0114] Monitoring and Tracking: Use the monitoring tools provided by Istio to track service performance and health status in real time.

[0115] For each microservice, establish an independent database:

[0116] Authentication service: Employee identity data is stored using the relational database PostgreSQL;

[0117] Payment services: Use a relational database to record payment transaction information;

[0118] Recommendation service: Use a NoSQL database (MongoDB is an option) to store user behavior data and recommendation strategies;

[0119] Anomaly detection service: Uses the time-series database InfluxDB to monitor transaction behavior;

[0120] User management services: Establish a database to centrally manage employee account information and spending records;

[0121] Photo upload service: Establish a database to store employee photos;

[0122] Security services: Establish a database using stored encryption keys and security policies to store encrypted information;

[0123] Log and monitoring services: Log collection and analysis are performed using the ELK Stack (Elasticsearch, Logstash, Kibana).

[0124] Employees select an identity verification method at the self-service terminal, and the self-service terminal collects the identity verification data;

[0125] The identity verification service interacts with the user management service's database to verify employee identities; if identity verification is successful, the employee ID is returned, and the process proceeds to the next step; if verification fails, a prompt message is returned.

[0126] The authentication service publishes a "user authentication successful event" to Kafka, and the user management service subscribes to the event and updates the session state.

[0127] In this embodiment, the main body, microservices, and event flow involved in the specific execution are as follows:

[0128] Implementing entity:

[0129] Self-service terminal: Collects employee identity data;

[0130] Authentication service: Handles authentication logic;

[0131] User management service: Stores and updates employee information.

[0132] Data interaction:

[0133] The self-service terminal sends identity data to the main application server via the local area network. The main application server then calls the authentication service and interacts with the user management service database to perform authentication.

[0134] Microservice operation:

[0135] After successful authentication, publish a successful user authentication event to Kafka. The user management service subscribes to the event, updates the employee session state, and ensures that subsequent operations are effective.

[0136] Event stream optimization: Kafka delivers event messages quickly to subscribers, ensuring parallel processing of multiple sessions and improving response efficiency.

[0137] Employees enter the recharge page, and the self-service terminal displays recommended payment methods;

[0138] The recommendation service analyzes employees' historical spending records, environmental data, and social data to return personalized payment method recommendations, which are then displayed on the page.

[0139] The recommendation service publishes "recommendation update events" to Kafka, and the self-service terminal subscribes to the events to dynamically update the recommendation content;

[0140] Employees select a payment method and confirm the recharge amount; the intelligent self-service recharge system then calls the payment gateway to complete the transaction.

[0141] The payment service calls the payment gateway to process the transaction, update the employee's account balance, and after the payment is completed, generates a payment voucher and returns it to the terminal.

[0142] The payment service publishes a "payment success event" to Kafka, the recommendation service subscribes to the event to update the recommendation strategy, the anomaly detection service subscribes to the event to check for abnormal payment behavior, and the user management service subscribes to the event to update the account balance and recharge records.

[0143] In this embodiment, the main body, microservices, and event flow involved in the specific execution are as follows:

[0144] Implementing entity:

[0145] Recommendation service: Analyze employee spending records and generate recommended content;

[0146] Payment services: Process payment requests and update account information;

[0147] Anomaly detection service: Monitor payment behavior and detect anomalies.

[0148] Data interaction:

[0149] The self-service terminal communicates with the main application server through the API gateway. The main application server calls the recommendation service to generate payment method recommendations and returns them to the terminal. After the employee selects a payment method, the payment request is forwarded to the payment gateway server through the API gateway and finally completes the transaction with the external payment system.

[0150] Microservice operation:

[0151] After payment is completed, the payment service publishes a payment success event to Kafka, the recommendation service subscribes to the event and adjusts the payment method recommendation strategy; the anomaly detection service subscribes to the event and analyzes payment behavior; and the user management service subscribes to the event and updates account balances and recharge records.

[0152] Event flow optimization: Kafka's asynchronous mechanism ensures that multiple operations triggered by a payment success event are executed in parallel, avoiding bottlenecks during peak payment periods.

[0153] Step 2: Employees take photos at the self-service terminal, which then transmits the photos to the photo upload service, which stores the photos on the NAS storage device.

[0154] The photo upload service publishes a "photo upload successful" event to Kafka, and the user management service subscribes to the event to update employee photo information.

[0155] In this embodiment, the main body, microservices, and event flow involved in the specific execution are as follows:

[0156] Implementing entity:

[0157] Self-service terminal: Take and upload photos;

[0158] Photo upload service: Receive and store photos.

[0159] Data interaction:

[0160] The self-service terminal transmits photos to the photo upload service via the local area network, and the photo upload service stores the photos on the NAS storage device.

[0161] Microservice operation:

[0162] After a photo is successfully uploaded, the photo upload service publishes a photo upload success event to Kafka, and the user management service subscribes to the event to update the employee's photo information.

[0163] Event stream optimization: Kafka ensures that photo upload notifications are delivered quickly, avoiding data update delays caused by network jitter.

[0164] Step 3: The intelligent self-service recharge system regularly analyzes employee behavior, environmental factors, etc. to generate recommended content. The recommendation service generates recommended content based on the latest data.

[0165] The recommendation service publishes "recommendation update events" to Kafka, and the self-service terminal subscribes to the events and updates the page in real time;

[0166] Employees submit feedback information through self-service terminals. The feedback service receives and stores the feedback data for subsequent optimization and analysis.

[0167] The feedback service publishes a "feedback submission event" to Kafka, and the recommendation service subscribes to the event and adjusts the algorithm to optimize subsequent recommendation content.

[0168] In this embodiment, the main body, microservices, and event flow involved in the specific execution are as follows:

[0169] Implementing entity:

[0170] Recommendation service: Dynamically generate recommended content;

[0171] Feedback service: Processes feedback submitted by employees.

[0172] Data interaction:

[0173] The self-service terminal requests the latest recommended content from the recommendation service, and employees submit feedback through the terminal. The feedback data is stored in the feedback service's database.

[0174] Microservice operation:

[0175] The recommendation service publishes recommendation update events to Kafka based on employee behavior data. The self-service terminal subscribes to the events and updates the page in real time. The feedback service publishes feedback submission events to Kafka. The recommendation service subscribes to the events and optimizes the recommendation algorithm.

[0176] Event stream optimization: Kafka's high throughput capability supports fast push and feedback processing of real-time recommended content.

[0177] In this embodiment, when specifically employing a recommendation algorithm, a hybrid recommendation algorithm can be used, such as combining collaborative filtering and content-based recommendation algorithms, while also incorporating environmental data and real-time feedback.

[0178] Collaborative filtering recommends payment methods or packages related to group preferences based on employees' similar consumption behaviors, as detailed below:

[0179] Using a user-item matrix, calculate the similarity (e.g., cosine similarity) between employees. The specific formula is as follows:

[0180]

[0181] Where R(u,i) is the predicted rating of user u for item i; sim(u,v) is the similarity between user u and user v; r(v,i) is the rating of user v for item i, U (i) U is the set of users who rate item i. These users' ratings or behavioral data are used to predict other users' potential preferences for item i. For example, in a self-service recharge system scenario, U... (i) It can be the set of all employees who choose a certain payment method i, and their spending records will be used to predict whether other employees will tend to choose the same payment method.

[0182] Collaborative filtering first generates a user-item rating matrix based on user historical behavior (such as purchase history and browsing history), and then makes recommendations using similar users or items. Neighborhood-based collaborative filtering (such as user or item KNN) is used to predict items that a user might be interested in.

[0183] Content-based recommendation involves analyzing users' preferences for specific content (such as products, food, etc.), extracting features (such as keywords, tags, etc.), and recommending similar content to users based on these features, as detailed below:

[0184] Using a feature weight model, the similarity of payment methods is calculated based on employee spending records:

[0185]

[0186] Where S(i,j) represents the similarity between payment method i and payment method j, w k It is the feature weight, f i,k It is feature k of payment method i.

[0187] The following is the recommended content calculation process used in this embodiment:

[0188] S1: Data collection and preprocessing, as detailed below:

[0189] Data source:

[0190] Consumer behavior data (such as payment method, amount, and time);

[0191] Environmental data (such as real-time weather and holidays);

[0192] Social data (such as consumer group similarity);

[0193] Data processing: standardization, deduplication, dimensionality reduction (principal component analysis, PCA).

[0194] S2: Feature extraction and weight allocation, as detailed below:

[0195] Use a weighted mechanism to assign weights to features from different data sources:

[0196] W final =α×W 消费 +β×W 环境 +γ×W 社交 ;

[0197] Where α, β, and γ are all weighting parameters that can be optimized using historical data; W 消费 Historical consumption weights are weight matrices generated based on users' historical consumption behavior, reflecting users' consumption habits and preferences; W 环境 Environmental factor weights are weight matrices generated based on environmental data (such as weather, time, holidays, etc.), reflecting users' potential preferences in different environments; W 社交 Social data weights are weight matrices generated using social interaction data (such as friend recommendations and preferences of similar groups), reflecting the possible choices users may make under the influence of social networks.

[0198] In this embodiment, W final This represents the final rating matrix of users for items, where each element is represented as W. final (u,i) specifically represents the recommendation rating of user u for item i.

[0199] S3: Recommended content generation, as detailed below:

[0200] The collaborative filtering and content-based recommendation results are weighted and fused together. Based on preset weights (e.g., 80% collaborative filtering, 20% content-based), a final recommendation result is obtained, generating a preliminary recommendation list.

[0201] The recommendation list is reordered using a weighted approach, incorporating environmental and feedback factors as adjustments.

[0202] R final (i)=Rbase (i)+λF(i);

[0203] Among them, R final (i) is the final recommendation score for payment method i.

[0204] R base (i) is the basic recommendation score, which is usually calculated from the user's historical behavior (such as consumption records, ratings, etc.) and is the core foundation of the recommendation system.

[0205] F(i) is the adjusted score of environment and feedback, which can include environmental data (such as weather, holidays), social factors, dynamic context (such as real-time events), etc., reflecting the dynamic impact of external factors on recommended content.

[0206] λ is the weight ratio, which controls the importance of F(i).

[0207] In this embodiment, when λ = 0, the recommendation system is entirely based on historical behavior and does not consider external factors; when λ > 0, external factors F(i) begin to affect the recommended content, and the larger λ is, the more significant the effect of the influencing factor.

[0208] The following is a specific example scenario of this embodiment:

[0209] Assuming the recommender system is recommending payment methods, external influencing factors F(i) might include:

[0210] Weather conditions (e.g., online payment is recommended on rainy days);

[0211] Holiday promotions (such as holiday discounts and recommendations for specific payment methods);

[0212] Social influence (such as payment methods recommended by colleagues).

[0213] By adjusting λ, the system's response to these factors can be dynamically adjusted, for example:

[0214] Increasing λ during rainy weather makes the effects of the weather more significant.

[0215] Reduce λ during normal working days to allow historical data to play a dominant role.

[0216] Step 4: The intelligent self-service recharge system encrypts the transmission of all sensitive data;

[0217] The security service generates and manages encryption keys, enables mTLS for microservice communication, publishes "data encryption events," and the log service subscribes to record compliance information.

[0218] When employee identity verification fails, the intelligent self-service recharge system requires the user to enter an SMS verification code or complete App authentication.

[0219] The identity verification service works in conjunction with the SMS service or App authentication service to complete multi-factor authentication, and the identity verification service publishes an "identity verification failure event" or an "identity verification success event".

[0220] The system monitors transaction behavior in real time and detects abnormal payment patterns;

[0221] The anomaly detection service analyzes transaction logs, locks accounts when anomalies are detected, and notifies users to perform secondary verification. The anomaly detection service also issues an "abnormal transaction event" to notify relevant services to respond.

[0222] In this embodiment, the main body, microservices, and event flow involved in the specific execution are as follows:

[0223] Implementing entity:

[0224] Security services: Encrypting data and managing keys;

[0225] Anomaly detection service: Analyzes transaction logs to detect abnormal transaction behavior.

[0226] Data interaction:

[0227] Data transmission uses the HTTPS protocol, sensitive information is encrypted using AES-256, and abnormal transaction behavior is analyzed by the anomaly detection service to analyze payment service logs and publish events.

[0228] Microservice operation:

[0229] When identity verification fails, the system calls the SMS service or App authentication service to complete multi-factor authentication and publishes relevant events. After the anomaly detection service detects suspicious behavior, it publishes an abnormal transaction event and triggers the account lock-up and notification mechanism.

[0230] Event stream optimization: Kafka achieves efficient distribution and fast response in multi-subscription scenarios of abnormal transaction events.

[0231] In this embodiment, the Kafka operation is specifically implemented using an event-driven architecture, including user authentication success events, recommendation update events, payment success events, photo upload success events, recommendation update events, feedback submission events, data encryption events, authentication failure events, authentication success events, and abnormal transaction events. The specific event design is shown in Table 2.

[0232]

[0233]

[0234] Table 2

[0235] In this embodiment, the partitioning and storage strategy for Kafka is as follows:

[0236] Based on the system's data throughput and business requirements, the Kafka cluster will be partitioned by topic to avoid data skew and improve system scalability. Each topic will have at least three partitions to support parallel processing and improve message passing efficiency.

[0237] Distributed storage is used to ensure high availability. For log data, a time window strategy is adopted (e.g., creating a new log file every 24 hours) to archive and clean up old data regularly and prevent disk overflow. The storage replication factor is set to 3 to ensure that data can be safely stored and recovered even if some nodes fail.

[0238] Enable message compression (such as Snappy or LZ4) to reduce data storage space requirements and optimize network transmission efficiency.

[0239] In one application scenario of this embodiment, the self-service terminal connects to the system software via an internal local area network. This step is carried out entirely within the internal network of the location of the self-service terminal (such as a restaurant) without the need for internet access, thereby fundamentally cutting off the external network's access path to the restaurant's internal data.

[0240] When a user makes a top-up through the mobile app, the app connects to the internet to complete the payment and related operations. Importantly, the mobile app can be designed to ensure that it does not record any personal information of the person making the top-up, such as names, facial photos, or other sensitive data (this can be further customized according to user needs), thereby reducing the risk of information leakage.

[0241] After a user completes a top-up on their mobile device, the system generates a unique top-up QR code. The user must then present this QR code to the self-service terminal for scanning. The self-service terminal verifies the top-up information and completes the top-up process by scanning the QR code.

[0242] Through the above design, the present invention achieves physical isolation between personnel information and the Internet. The self-service terminal is not directly connected to the Internet, thereby avoiding unauthorized access and theft of personnel information from external networks. At the same time, although the mobile software is connected to the Internet, it does not store any sensitive information, further enhancing the security of the entire recharge process.

[0243] This invention discloses an intelligent self-service recharge system and its security optimization method, which solves the technical problems of providing modular services, improving system flexibility and scalability, enhancing data security, and optimizing event handling mechanisms. The invention features a flexible microservice architecture, with each microservice running independently, facilitating expansion and maintenance, improving data interaction efficiency, and efficient event handling. It utilizes the Kafka event bus to implement an event-driven architecture, supporting asynchronous communication and high-concurrency processing. Event stream optimization reduces system latency and improves data real-time performance. Enhanced data security is achieved through the full implementation of encrypted communication protocols to ensure secure data transmission. An intelligent recommendation engine supports real-time feedback mechanisms, continuously optimizing recommendation strategies to improve user experience. The system offers an innovative user experience, seamlessly integrating identity verification, payment, photo upload, and feedback processes, significantly improving ease of use. Furthermore, the introduction of a social recommendation mechanism enhances employee interaction and the overall consumption experience.

Claims

1. An intelligent self-service recharge system, characterized in that: This includes the main application server, event bus cluster, NAS storage device, API gateway, payment gateway server, anomaly detection server, LAN switch, self-service terminal, card reader, firewall gateway, and external payment system interface; The LAN switch communicates with the main application server, event bus cluster, NAS storage device, API gateway, payment gateway server, anomaly detection server, self-service terminal and card reader via the LAN; The main application server communicates with the event bus cluster, API gateway, and NAS storage device via a LAN switch. The event bus cluster communicates with the main application server, payment gateway server, anomaly detection server, and self-service terminal via a local area network switch. The payment gateway server communicates with the API gateway and the event bus cluster via a local area network switch. The anomaly detection server communicates with the event bus cluster and the main application server via a LAN switch; The firewall gateway connects to the payment gateway server, and the external payment system interface communicates with the payment gateway server through the firewall gateway. The intelligent self-service recharge system also includes security optimization methods, specifically including the following steps: Step 1: Establish an intelligent self-service recharge system and deploy a microservice architecture within it; Employees select an identity verification method at the self-service terminal, and the self-service terminal collects the identity verification data; The identity verification service verifies employee identities by interacting with the user management service's database; If identity verification is successful, the employee ID will be returned, and the process will proceed to the next step; if verification fails, a prompt message will be returned. The authentication service publishes a "user authentication successful event" to Kafka, and the user management service subscribes to the event and updates the session state. Employees enter the recharge page, and the self-service terminal displays recommended payment methods; The recommendation service analyzes employees' historical spending records, environmental data, and social data to return personalized payment method recommendations, which are then displayed on the page. The recommendation service publishes "recommendation update events" to Kafka, and the self-service terminal subscribes to the events to dynamically update the recommended content; Employees select a payment method and confirm the recharge amount; the intelligent self-service recharge system then calls the payment gateway to complete the transaction. The payment service calls the payment gateway to process the transaction, update the employee's account balance, and after the payment is completed, generates a payment voucher and returns it to the terminal. The payment service publishes a "payment success event" to Kafka, the recommendation service subscribes to the event to update the recommendation strategy, the anomaly detection service subscribes to the event to check for abnormal payment behavior, and the user management service subscribes to the event to update the account balance and recharge records. Step 2: Employees take photos at the self-service terminal, which then transmits the photos to the photo upload service, which stores the photos on the NAS storage device. The photo upload service publishes a "photo upload successful" event to Kafka, and the user management service subscribes to the event to update employee photo information. Step 3: The intelligent self-service recharge system periodically analyzes employee behavior and environmental factors to generate recommended content. The recommended service generates recommended content based on the latest data. The recommendation service publishes "recommendation update events" to Kafka, and the self-service terminal subscribes to the events and updates the page in real time; Employees submit feedback information through self-service terminals. The feedback service receives and stores the feedback data for subsequent optimization and analysis. The feedback service publishes a "feedback submission event" to Kafka, and the recommendation service subscribes to the event and adjusts the algorithm to optimize subsequent recommendation content. The recommendation service publishes recommendation update events to Kafka based on employee behavior data. The self-service terminal subscribes to the events and updates the page in real time. The feedback service publishes feedback submission events to Kafka. The recommendation service subscribes to the events and optimizes the recommendation algorithm. When specifically adopting recommendation algorithms, a hybrid recommendation algorithm is used, which combines collaborative filtering and content-based recommendation algorithms, while also incorporating environmental data and real-time feedback. Collaborative filtering recommends payment methods or packages related to group preferences based on employees' similar consumption behaviors, as detailed below: The similarity between employees is calculated using a user-item matrix, as shown in the following formula: ; in, R(u,i) User u For items i Predicted score; sim(u,v) User u and users v Similarity; r(v,i) User v For items i The rating, U (i) It is an item i The set of users who rate items, and their ratings or behavioral data, will be used to predict other users' opinions on the items. i Potential preferences; Collaborative filtering first generates a user-item rating matrix based on the user's historical behavior, and then makes recommendations using similar users or items; it uses neighborhood-based collaborative filtering to predict items that the user may be interested in. Content-based recommendation involves analyzing user preferences, extracting features, and then recommending similar content to users based on these features, as detailed below: Using a feature weight model, the similarity of payment methods is calculated based on employee spending records: ; in, S(i,j) Payment method i and payment methods j Similarity, w k It is the feature weight. f i,k Payment method i Features k ; The following is the process for calculating recommended content: S1: Data collection and preprocessing, as detailed below: Data source: Consumer behavior data; Environmental data; Social data; Data processing: standardization, deduplication, dimensionality reduction; S2: Feature extraction and weight allocation, as detailed below: Use a weighted mechanism to assign weights to features from different data sources: W final = α×W 消费 + β×W 环境 + γ×W 社交 ; in, α,β,γ These are all weighted parameters, optimized using historical data; W 消费 Historical consumption weights are weight matrices generated based on users' historical consumption behavior, reflecting users' consumption habits and preferences; W 环境 The environmental factor weights are weight matrices generated based on environmental data, reflecting users' possible preferences in different environments; W 社交 Social data weights are weight matrices generated using social interaction data, reflecting users' possible choices influenced by social networks; W final This represents the final rating matrix of users for items, where each element is represented as... W final (u,i) Specifically, it refers to the user. u For items i Recommended rating; S3: Recommended content generation, as detailed below: The results of collaborative filtering and content-based recommendation are weighted and fused together to obtain the final recommendation result according to the preset weights, generating a preliminary recommendation list. The recommendation list is reordered using a weighted approach, incorporating environmental and feedback factors as adjustments. R final (i) = R base (i) +λF(i) ; in, R final (i) Payment method i The final recommended score; R base (i) It is the basic recommendation score, which is usually calculated from the user's historical behavior and is the core foundation of the recommendation system; F(i) It is an adjusted score based on environment and feedback, including environmental data, social factors, and dynamic context, reflecting the dynamic impact of external factors on recommended content; λ It's the weighting ratio, which controls... F(i) The importance of; when λ =0, then the recommendation system is entirely based on historical behavior and does not consider external factors; when λ >0, then external factors F(i) It begins to influence recommended content. λ The larger the value, the more significant the effect of the influencing factor. Step 4: The intelligent self-service recharge system encrypts the transmission of all sensitive data; The security service generates and manages encryption keys, enables mTLS for microservice communication, publishes "data encryption events," and the log service subscribes to record compliance information. When employee identity verification fails, the intelligent self-service recharge system requires the user to enter an SMS verification code or complete App authentication. The identity verification service works in conjunction with the SMS service or App authentication service to complete multi-factor authentication, and the identity verification service publishes an "identity verification failure event" or an "identity verification success event". The system monitors transaction behavior in real time and detects abnormal payment patterns; The anomaly detection service analyzes transaction logs, locks accounts when anomalies are detected, and notifies users to perform secondary verification. The anomaly detection service also issues an "abnormal transaction event" to notify relevant services to respond.

2. The intelligent self-service recharge system as described in claim 1, characterized in that: The main application server is connected to the LAN switch via Gigabit Ethernet, and communicates with the API gateway via a REST interface. The event bus cluster uses Kafka's publish-subscribe mechanism to communicate with the main application server, payment gateway server, anomaly detection server, and self-service terminal. The API gateway acts as a proxy for external interfaces, and also communicates with the payment gateway server to forward payment requests and receive results. The payment gateway server is used to process payment requests and send payment results; The anomaly detection server is used to subscribe to payment and consumption behavior events, and publish abnormal behavior events after detecting anomalies; Firewall gateways are used to manage communication between the public network and the internal network, protecting data security; The external payment system interface communicates with the payment gateway server through a firewall gateway, using the HTTPS protocol to ensure data security.

3. The intelligent self-service recharge system as described in claim 1, characterized in that: The event bus cluster consists of 3 Kafka servers, enabling message passing in an event-driven architecture; the NAS storage device is a 12TB RAID 10 storage array.

4. The intelligent self-service recharge system as described in claim 1, characterized in that: The self-service terminal is equipped with a card swiping module, a facial recognition camera, and a touch screen; the external payment system interface connects to a third-party payment system.

5. The intelligent self-service recharge system as described in claim 1, characterized in that: The microservice architecture specifically includes authentication service, payment service, recommendation service, anomaly detection service, user management service, photo upload service, security service, logging and monitoring service, and event handling service.

6. The intelligent self-service recharge system as described in claim 1, characterized in that: In a microservice architecture, communication between microservices includes synchronous and asynchronous communication. Synchronous communication uses RESTful APIs or GraphQL APIs for real-time data interaction, which is suitable for authentication and payment processing. Asynchronous communication uses Apache Kafka as a message queue to implement event-driven asynchronous communication, which is suitable for recommendation updates and anomaly detection.

7. The intelligent self-service recharge system as described in claim 1, characterized in that: For each microservice, establish an independent database: Authentication service: Employee identity data is stored using the relational database PostgreSQL; Payment services: Use a relational database to record payment transaction information; Recommendation service: Uses NoSQL databases to store user behavior data and recommendation strategies; Anomaly detection service: Uses the time-series database InfluxDB to monitor transaction behavior; User management services: Establish a database to centrally manage employee account information and spending records; Photo upload service: Establish a database to store employee photos; Security services: Establish a database using stored encryption keys and security policies to store encrypted information; Logs and monitoring services: Use the ELK Stack for log collection and analysis.

8. The intelligent self-service recharge system as described in claim 1, characterized in that: For Kafka operations, the specific deployment involves an event-driven architecture, including user authentication success events, recommendation update events, payment success events, photo upload success events, recommendation update events, feedback submission events, data encryption events, authentication failure events, authentication success events, and abnormal transaction events.

Citation Information

Patent Citations

  • Safe and controllable smart network system based on self service and constructing method

    CN105049528A

  • Customized short message sending system

    CN106533920A

  • Multimode identification payment and invoice printing self-service terminal and printing method

    CN110111507A

  • Open data API gateway system based on big data artificial intelligence

    CN111212038A

  • Linux white list-based vehicle-mounted machine IC (Integrated Circuit) card replenishment and recharging method and system

    CN117350728A