A method and system for calculating customer indicators in the Internet field based on rule engine
By introducing a rule engine into the customer metric calculation method, the problems of large computing resource consumption and complex feature selection of traditional machine learning methods are solved, and customer metric calculations are realized with fast response and efficient calculations.
Patent Information
- Application Number
- CN202411657495.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-20
AI Technical Summary
The use of machine learning technology in the existing customer indicator calculation methods requires a large amount of computing resources, and cannot respond to market changes and customer needs in a timely manner. High-dimensional data makes the feature selection process complex and time-consuming.
A method for calculating customer indicators in the Internet field based on rules engine is proposed, including data preprocessing, encryption, feature extraction and rule triggering condition matching, and data processing is carried out through rules engine to reduce the demand for computing resources.
It greatly reduces the demand for computing resources, can quickly respond to market changes and customer needs, improves the timeliness and transparency of decisions, and protects data security through data encryption.
Smart Images

Figure CN119167110B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method for calculating customer image indicators in the Internet field based on a rule engine. Background Art
[0002] In the customer indicator calculation method, machine learning technology is usually used to extract features and make model predictions based on historical data. Traditional machine learning models consume a lot of computing resources during the training and prediction stages, especially when the amount of data is very large, the training time may be as long as several hours or even days. This delay makes the model unable to respond to market changes and customer needs in a timely manner, thus affecting the timeliness of decision-making.
[0003] Moreover, customer indicators usually involve multiple dimensions and complex features, and there may be nonlinear relationships between these features. High-dimensional data makes the feature selection process complicated and time-consuming, which can easily lead to the "dimensionality disaster" and reduce the training and reasoning efficiency of the model. In customer behavior analysis, the interactive relationships between features may be very complex, and traditional feature selection methods often cannot fully capture these relationships. At this point, the model cannot accurately reflect the essence of customer behavior, resulting in inaccurate predictions. Summary of the invention
[0004] The present invention aims at the problem that the existing customer index calculation method uses machine learning technology for data processing, which consumes a lot of computing resources and cannot respond to market changes and customer needs in a timely manner. In addition, customer indicators usually involve multiple dimensions and complex features. High-dimensional data makes the feature selection process complicated and time-consuming. A customer index calculation method in the Internet field based on a rule engine is proposed. The method includes:
[0005] Step 1: Obtain customer data and product data information, and pre-process the customer data and product data information;
[0006] Step 2: Encrypt the pre-processed customer data and product data information to obtain encrypted data information;
[0007] Step 3: construct a feature extraction model, and extract features of the encrypted data information according to the feature extraction model;
[0008] Step 4: Construct rule trigger conditions, and use the rule trigger conditions to match the data after feature extraction to calculate customer indicators.
[0009] Furthermore, a preferred method is proposed, wherein step 1 comprises:
[0010] Review the acquired customer data and product data information to check whether there is any abnormal data or missing data;
[0011] Replace or delete abnormal and missing data.
[0012] Furthermore, a preferred method is proposed, wherein step 2 comprises:
[0013] The client sends a connection request to the server, including a list of supported SSL / TLS versions and cipher suites;
[0014] The server selects a cipher suite and sends a digital certificate containing the public key to the client;
[0015] The client verifies the server's digital certificate and generates a random session key, encrypts the session key with the server's public key, and then sends it to the server, including:
[0016] Generate a 256-bit AES key on the client;
[0017] Generate a 16-byte random IV using a secure random number generator for use in CBC mode;
[0018] Check the length of the data to be encrypted. If the data length is not a multiple of 16 bytes, use the PKCS#7 padding method to fill the data.
[0019] XOR the generated IV with the first plaintext data block to get a new data block;
[0020] Use the AES-256 algorithm to encrypt this new data block to generate the first ciphertext block;
[0021] Repeat the ciphertext block acquisition process, and store or transmit the encrypted ciphertext and the generated IV together;
[0022] Receive the transmitted ciphertext and IV, use the received IV to perform an XOR operation with the first ciphertext block to obtain the first plaintext block;
[0023] Use the AES-256 algorithm to decrypt the first ciphertext block to get the original plaintext block;
[0024] Repeat the decryption process, remove the extra padding bytes from the decrypted data according to the rules of the PKCS#7 padding method, and restore the original data.
[0025] Furthermore, a preferred embodiment is proposed, wherein the feature extraction model in step 3 includes:
[0026] Collect the original data set and divide it into feature sets and target variables;
[0027] Use SelectKBest for feature selection, including:
[0028] Calculate the relevance score of each feature, select the K most relevant features, and generate a feature subset;
[0029] Input the feature subset into the random forest algorithm for training to obtain a feature training model based on selection;
[0030] Set the hyperparameters of random forest and optimize them according to Bayesian optimization algorithm and genetic algorithm;
[0031] The optimization process of the selected feature-based training model is accelerated through a distributed computing framework, and the model performance is evaluated through stratified K-fold cross-validation.
[0032] Furthermore, a preferred method is proposed, wherein the optimization process of the feature training model based on selection is accelerated by using a distributed computing framework, including:
[0033] Use Spark's MLlib library to train the random forest algorithm and distribute the task to multiple computing nodes for parallel processing;
[0034] When performing hyperparameter optimization, genetic algorithms and Bayesian optimization are also executed in parallel in a distributed environment.
[0035] Furthermore, a preferred method is proposed, wherein step 4 comprises:
[0036] Establish a mathematical model for rule triggering:
[0037]
[0038] in, represents the probability of the rule being triggered, represents the probability of the intersection of rule R and condition C, represents the probability of condition C;
[0039] Build a mathematical model for rule execution:
[0040]
[0041] in, represents the probability of rule R being executed, represents the probability of the intersection of rule R and execution result E, represents the probability of rule R;
[0042] Regular expressions and NLP natural language processing techniques are used to match customer reviews of products, extract complex information from text, identify specific entities, including: names of people, cities, names of purchased products and satisfaction levels, and complete customer indicator calculations.
[0043] Furthermore, a preferred method is proposed, wherein step S4 also includes: using the Rete algorithm to convert the rules into a node-connected network structure Rete network. When a fact enters the rule engine, the rule engine propagates the fact in the Rete network. During the propagation process, each node will check whether the fact meets the conditions represented by the node. If the fact meets the conditions, it will be passed to the next node. If the conditions are not met, the fact will be discarded.
[0044] Based on the same technical concept, the present invention also proposes a rule engine-based Internet customer image index calculation system, the system comprising:
[0045] A preprocessing unit, used to obtain customer data and product data information, and preprocess the customer data and product data information;
[0046] An encryption unit, used to encrypt the pre-processed customer data and product data information to obtain encrypted data information;
[0047] A feature extraction unit, used to construct a feature extraction model and extract features from encrypted data information according to the feature extraction model;
[0048] The rule triggering unit is used to construct the rule triggering conditions, and use the rule triggering conditions to match the data after feature extraction and calculate the customer indicators.
[0049] Based on the same inventive concept, the present invention also proposes a computer device, including a memory and a processor, wherein a computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes a method for calculating customer indicators in the Internet field based on a rule engine as described in any one of the above items.
[0050] Based on the same inventive concept, the present invention also proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a method for calculating customer indicators in the Internet field based on a rule engine as described in any one of claims 1-7 are executed.
[0051] The present invention is beneficial in that:
[0052] The present invention proposes a method for calculating customer indicators in the Internet field based on a rule engine. The rule engine is used to calculate customer indicators. Compared with traditional machine learning methods, the demand for computing resources is greatly reduced, and the market changes and customer needs can be quickly responded to. The rule engine processes data based on predefined rules, avoiding complex calculations in the process of selecting high-dimensional data features. Systems based on rule engines usually have good interpretability. Users can directly understand and trace the calculation process of customer indicators, which enhances the transparency of decision-making. Through data encryption processing, the security of customer and product data information is protected, and the risk of data leakage is reduced. During data transmission and storage, the privacy of sensitive information is ensured. This method can flexibly adapt to various types of customer and product data and is suitable for different business scenarios. It supports the processing of data with multi-dimensional and complex features, making the calculation of customer indicators more comprehensive. Through the feature extraction model, data from different sources can be effectively integrated to provide richer information for customer indicator calculation.
[0053] The present invention can be applied to the fields of risk assessment and e-commerce. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A flow chart of a method for calculating customer indicators in the Internet field based on a rule engine according to implementation mode 1;
[0055] Figure 2 This is a diagram of the customer indicator calculation framework described in Implementation Method 11. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0057] Implementation method 1, see Figure 1 The present embodiment describes a method for calculating customer indicators in the Internet field based on a rule engine, the method comprising:
[0058] Step 1: Obtain customer data and product data information, and pre-process the customer data and product data information;
[0059] Step 2: Encrypt the pre-processed customer data and product data information to obtain encrypted data information;
[0060] Step 3: construct a feature extraction model, and extract features of the encrypted data information according to the feature extraction model;
[0061] Step 4: Construct rule trigger conditions, and use the rule trigger conditions to match the data after feature extraction to calculate customer indicators.
[0062] In this implementation, customer satisfaction information, basic customer information, and product information are collected through a variety of methods, including websites and mobile applications, customer surveys, and satisfaction questionnaires.
[0063] This embodiment proposes a method for calculating customer indicators in the Internet field based on a rule engine. The rule engine is used to calculate customer indicators. Compared with traditional machine learning methods, it greatly reduces the demand for computing resources and can quickly respond to market changes and customer needs. The rule engine processes data based on predefined rules, avoiding complex calculations in the process of selecting high-dimensional data features. Systems based on rule engines usually have good interpretability. Users can directly understand and trace the calculation process of customer indicators, which enhances the transparency of decision-making. Through data encryption processing, the security of customer and product data information is protected and the risk of data leakage is reduced. During data transmission and storage, the privacy of sensitive information is ensured. This method can flexibly adapt to various types of customer and product data and is suitable for different business scenarios. It supports the processing of data with multi-dimensional and complex features, making the calculation of customer indicators more comprehensive. Through the feature extraction model, data from different sources can be effectively integrated to provide richer information for customer indicator calculation.
[0064] This embodiment proposes a method for calculating customer indicators in the Internet field based on a rule engine, the principle of which is:
[0065] First, obtain customer and product data information from various data sources, and clean, format and standardize the data to ensure the accuracy and consistency of subsequent analysis. Encrypt the preprocessed data to ensure that the data will not be illegally accessed or tampered with during transmission and storage, and protect customer privacy. By building a feature extraction model, extract key features from the encrypted data information. These features include customer behavior patterns, purchasing habits, product performance and other information. Feature extraction helps to simplify data dimensions and reduce the complexity of subsequent processing. Build rule trigger conditions related to business needs. Match the data after feature extraction and calculate customer indicators based on the rule trigger conditions. For example, if the purchase frequency of a customer exceeds a certain threshold, the corresponding customer indicator is triggered. Finally, calculate the customer indicator based on the matching results, which provides strong support for the company's market decision-making, product optimization and customer relationship management.
[0066] Implementation method 2: This implementation method further limits the method for calculating Internet customer indicators based on a rule engine described in implementation method 1. Step 1 includes:
[0067] Review the acquired customer data and product data information to check whether there is any abnormal data or missing data;
[0068] Replace or delete abnormal and missing data.
[0069] In this implementation, the acquired customer data and product data information is reviewed to check whether there are abnormal data and empty data. For example, when the user fills in the questionnaire, some required items are too concise. At the same time, a user may fill in the questionnaire repeatedly. Therefore, it is necessary to remove the duplicates of the customer's filled-in content based on the customer's name, ID number, etc. When filling in the questionnaire, the mobile phone number and address may be omitted or filled in incorrectly. For these abnormal data, manual review, deletion, replacement, etc. are used according to the situation.
[0070] Implementation method 3: This implementation method further limits the method for calculating Internet customer indicators based on a rule engine described in implementation method 1, and step 2 includes:
[0071] The client sends a connection request to the server, including a list of supported SSL / TLS versions and cipher suites;
[0072] The server selects a cipher suite and sends a digital certificate containing the public key to the client;
[0073] The client verifies the server's digital certificate and generates a random session key, encrypts the session key with the server's public key, and then sends it to the server, including:
[0074] Generate a 256-bit AES key on the client;
[0075] Generate a 16-byte random IV using a secure random number generator for use in CBC mode;
[0076] Check the length of the data to be encrypted. If the data length is not a multiple of 16 bytes, use the PKCS#7 padding method to fill the data.
[0077] XOR the generated IV with the first plaintext data block to get a new data block;
[0078] Use the AES-256 algorithm to encrypt this new data block to generate the first ciphertext block;
[0079] Repeat the ciphertext block acquisition process, and store or transmit the encrypted ciphertext and the generated IV together;
[0080] Receive the transmitted ciphertext and IV, use the received IV to perform an XOR operation with the first ciphertext block to obtain the first plaintext block;
[0081] Use the AES-256 algorithm to decrypt the first ciphertext block to get the original plaintext block;
[0082] Repeat the decryption process, remove the extra padding bytes from the decrypted data according to the rules of the PKCS#7 padding method, and restore the original data.
[0083] In this implementation, secure communication between the client and the server is ensured by using the SSL / TLS protocol to prevent man-in-the-middle attacks (MITM) and data eavesdropping. The client uses the server's public key to encrypt the session key, ensuring that only the server can decrypt and use the key, thereby increasing data security. The AES-256 algorithm is used for data encryption, providing high-strength security and fast encryption and decryption speed on modern hardware. Symmetric encryption algorithms have higher encryption and decryption efficiency than asymmetric encryption algorithms (such as RSA), and are very suitable for large-scale data transmission. The PKCS#7 padding method is used to process data so that the data length meets the requirements of AES encryption. This flexibility ensures that data of any length can be processed and the integrity of the encryption process is maintained. A random initialization vector (IV) is generated for encryption, which enhances the unpredictability of encryption. Even if the same plaintext is encrypted at different times, different ciphertexts will be generated, reducing the risk of being cracked. The encryption suite list sent by the client allows the server to select the most appropriate encryption method, adapt to different security requirements and performance standards, and enhance the compatibility and scalability of the system. The random session key generated for each connection allows each communication to have different encryption parameters, increasing security and reducing the risk of key reuse. The original data can be effectively restored by XORing with IV and AES-256 decryption process. This method ensures the integrity of data during transmission and can effectively handle the recovery of encrypted data. Randomly generated IV and session keys can effectively prevent replay attacks, ensure the confidentiality and integrity of data, and further enhance the security of customer data calculation process.
[0084] Implementation method 4: This implementation method further limits the method for calculating Internet customer indicators based on a rule engine described in implementation method 1. The feature extraction model in step 3 includes:
[0085] Collect the original data set and divide it into feature sets and target variables;
[0086] Use SelectKBest for feature selection, including:
[0087] Calculate the relevance score of each feature, select the K most relevant features, and generate a feature subset;
[0088] Input the feature subset into the random forest algorithm for training to obtain a feature training model based on selection;
[0089] Set the hyperparameters of random forest and optimize them according to Bayesian optimization algorithm and genetic algorithm;
[0090] The optimization process of the selected feature-based training model is accelerated through a distributed computing framework, and the model performance is evaluated through stratified K-fold cross-validation.
[0091] In this embodiment, the input and output of model training are clarified by dividing the original data set into a feature set and a target variable. This clear structure can effectively reduce the complexity of subsequent model construction. The SelectKBest method effectively screens out the features most relevant to the target variable by calculating the correlation score of the features. This process ensures that the model only uses important features, thereby improving computational efficiency and reducing the risk of overfitting. Selecting K features can be flexibly adjusted to optimize the input of the model according to the characteristics of the specific data set and the problem background, thereby improving the accuracy and stability of the model. Random forest is an integrated learning method that improves the generalization ability of the model by building multiple decision trees. Inputting a feature subset into the random forest algorithm for training can make full use of the anti-noise ability of the random forest and the advantages of processing high-dimensional data. By optimizing the hyperparameters of the random forest through the Bayesian optimization algorithm and the genetic algorithm, a better combination of parameters can be found at a lower computational cost, thereby further improving the model performance. The use of a distributed computing framework can significantly speed up the model training and optimization process. This method is particularly suitable for large-scale data sets, can improve computational efficiency, and shorten the model development cycle. The model performance is evaluated by stratified K-fold cross validation to ensure the reliability and stability of the evaluation. This method can effectively avoid the impact of uneven data set division on model performance, making model evaluation more convincing. Through the process of feature selection, users can more clearly understand which features have a significant impact on customer indicators, thereby providing a basis for business decision-making. The design of this model allows adjustment and expansion according to different business needs and data characteristics, enhancing the versatility of the method.
[0092] Implementation mode 5: This implementation mode further limits the Internet customer index calculation method based on the rule engine described in Implementation mode 4. The optimization process of accelerating the feature training model based on selection through the distributed computing framework includes:
[0093] Use Spark's MLlib library to train the random forest algorithm and distribute the task to multiple computing nodes for parallel processing;
[0094] When performing hyperparameter optimization, genetic algorithms and Bayesian optimization are also executed in parallel in a distributed environment.
[0095] In this implementation, a distributed computing framework (such as Spark) is used to calculate customer indicators, which can process large-scale data sets. This distributed architecture can divide data into multiple small blocks and process them in parallel on multiple computing nodes, thereby significantly improving computing speed and efficiency. In particular, when faced with massive amounts of customer data, traditional single-machine processing methods are often difficult to meet the needs, and distributed computing can effectively avoid computing bottlenecks.
[0096] By using the random forest algorithm in Spark's MLlib library, model training can be performed on multiple nodes simultaneously, thus shortening the model training time. The random forest algorithm itself has the characteristics of parallelization. By assigning tasks to multiple computing nodes, the computing resources of the cluster can be fully utilized to accelerate the training process.
[0097] When performing hyperparameter optimization, the parallel execution of genetic algorithms and Bayesian optimization makes parameter adjustment more flexible and efficient. The combination of the two optimization methods can find better model parameters in a shorter time and improve the accuracy and stability of the model. Genetic algorithms can effectively explore parameter space by simulating the natural selection process, while Bayesian optimization can efficiently select the next parameter based on the existing results.
[0098] By optimizing multiple hyperparameters in parallel, we can more comprehensively explore the potential parameter combinations of the model and find the best configuration, thereby improving the prediction accuracy and generalization ability of the model. Especially in the Internet field, customer behavior and preferences change rapidly, and the accuracy of the model is crucial for business decision-making.
[0099] The distributed computing framework enables the calculation and analysis of customer indicators to be performed in real time as data arrives. For Internet companies, this enables them to quickly respond to market changes and customer needs and improve the timeliness of decision-making.
[0100] Implementation method 6: This implementation method further limits the method for calculating Internet customer indicators based on a rule engine described in implementation method 1, and step 4 includes:
[0101] Establish a mathematical model for rule triggering:
[0102]
[0103] in, represents the probability of the rule being triggered, represents the probability of the intersection of rule R and condition C, represents the probability of condition C;
[0104] Build a mathematical model for rule execution:
[0105]
[0106] in, represents the probability of rule R being executed, represents the probability of the intersection of rule R and execution result E, represents the probability of rule R;
[0107] Regular expressions and NLP natural language processing techniques are used to match customer reviews of products, extract complex information from text, identify specific entities, including: names of people, cities, names of purchased products and satisfaction levels, and complete customer indicator calculations.
[0108] The rules for calculating customer indicators usually involve complex logic and conditions when they are written, and the associations between different indicators, thresholds, abnormal situations, etc. need to be considered. Designing and managing these complex rule logics may increase the complexity of implementation and maintenance. In this implementation, the rules are decomposed into smaller units, which reduces the complexity of the rules and improves readability and maintainability.
[0109] By building a probability model for rule triggering, the possibility of a rule being triggered under specific conditions can be more accurately evaluated. This mathematical model can quantify the relationship between various conditions and rules, making the decision-making process more scientific and reasonable. By building a probability model for rule execution, the success rate of rule execution under specific conditions can be effectively predicted. This modeling method makes the results of rule execution more predictable and helps enterprises optimize decision-making.
[0110] Natural language processing technology can extract complex information from customers' textual evaluations, such as names of people, cities, names of purchased products, and satisfaction levels. This method makes it more efficient and automated to extract key information from unstructured data, thereby reducing the workload of manual processing and improving data processing efficiency. Through in-depth analysis of text, entities that have a significant impact on business decisions can be identified, such as the geographical distribution and satisfaction level of customers. The acquisition of this information provides data support for further market analysis and customer service. This method can fully reflect the real needs and feelings of customers by calculating indicators based on multiple dimensions in customer evaluations (such as satisfaction, purchased products, etc.). This comprehensive analysis capability enables companies to better understand customer expectations and optimize products and services.
[0111] Implementation method seven, this implementation method is a further limitation of the method for calculating customer indicators in the Internet field based on a rule engine described in implementation method one, and step S4 also includes: using the Rete algorithm to convert the rules into a node-connected network structure Rete network. When a fact enters the rule engine, the rule engine propagates the fact in the Rete network. During the propagation process, each node will check whether the fact meets the conditions represented by the node. If the fact meets the conditions, it will be passed to the next node. If the conditions are not met, the fact will be discarded.
[0112] Embodiment 8: A method for calculating customer image indicators in the Internet field based on a rule engine according to this embodiment, the method comprises:
[0113] A preprocessing unit, used to obtain customer data and product data information, and preprocess the customer data and product data information;
[0114] An encryption unit, used to encrypt the pre-processed customer data and product data information to obtain encrypted data information;
[0115] A feature extraction unit, used to construct a feature extraction model and extract features from encrypted data information according to the feature extraction model;
[0116] The rule triggering unit is used to construct the rule triggering conditions, and use the rule triggering conditions to match the data after feature extraction and calculate the customer indicators.
[0117] Implementation method 9. A computer device described in this implementation method includes a memory and a processor, wherein a computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes a method for calculating customer indicators in the Internet field based on a rule engine as described in any one of implementation methods 1 to 7.
[0118] Implementation method ten, a computer-readable storage medium described in this implementation method, on which a computer program is stored, and when the computer program is executed by a processor, the steps of a method for calculating customer indicators in the Internet field based on a rule engine as described in any one of implementation methods one to seven are executed.
[0119] Implementation Method 11: See Figure 2 This embodiment provides a specific example of the Internet customer index calculation method based on the rule engine described in the first embodiment, and is also used to explain the second to seventh embodiments. Specifically:
[0120] In this embodiment, a customer indicator calculation method based on a rule engine is proposed. The implementation of this method includes data processing, tool class writing, rule writing, data input, rule triggering, data writing back, and data visualization display process.
[0121] In order to facilitate subsequent rule writing and rule triggering, it is necessary to process the original data first. The original data includes customer purchase information, product information, product satisfaction, etc. The main steps for data processing of customer data are as follows:
[0122] 1. Data Integration:
[0123] Customer data and product data are usually obtained through multiple channels, and customer satisfaction information, customer basic information, and product information are collected through websites and mobile applications, customer surveys, and satisfaction questionnaires.
[0124] 2. Data cleaning and preprocessing:
[0125] The obtained data is reviewed to check whether there are abnormal data and empty data. For example, when users fill out the questionnaire, some mandatory items are too concise. At the same time, a user may fill in the questionnaire repeatedly. Therefore, it is necessary to deduplicate the customer's information based on the customer's name, ID number, etc. When filling in the questionnaire, the mobile phone number and address may be omitted or filled in incorrectly. For these abnormal data, manual review, deletion, replacement, etc. are used according to the situation.
[0126] 3. Data encryption:
[0127] After obtaining the pre-processed customer data, the obtained customer data must be encrypted to ensure customer privacy and improve security. The encryption methods used in this implementation include SSL / TLS, AES-256 bit encryption, CBC encryption mode, PKCS5Padding filling method, and initialization vector (IV), specifically:
[0128] SSL / TLS is mainly used to protect the security of data transmitted on the network and prevent data from being intercepted or tampered with during transmission. The main process is as follows:
[0129] Handshake phase: The client sends a connection request to the server, which includes all SSL / TLS versions and encryption suites supported by the client. The server selects an encryption suite and sends its certificate to the client, which includes the public key. The client verifies the validity of the certificate and uses the public key in the certificate to encrypt a randomly generated session key and sends it to the server. The server uses its own private key to decrypt the session key.
[0130] Encrypted communication: Both parties use the negotiated session key to encrypt and decrypt data. All data transmission is encrypted using the session key to ensure data security.
[0131] AES (Advanced Encryption Standard) is a symmetric encryption algorithm that uses a 256-bit key length and provides very high security. The encryption process is:
[0132] Key generation: Use the key generator to generate a 256-bit key. The key needs to be kept properly and used during encryption and decryption.
[0133] Encrypt data: Encrypt the data using the generated key.
[0134] The CBC (Cipher Block Chaining) mode increases the complexity of the encrypted data by performing an XOR operation (XOR) with the result of the previous encrypted block and the current plaintext block, making it more difficult to crack.
[0135] Initialization Vector (IV) Generation: Use a secure random number generator to generate a random IV with a length of 16 bytes (for AES). The IV needs to be stored or transmitted with the encrypted data so that it can be used during decryption.
[0136] Encrypted data: For the first plaintext block, XOR it with the IV and then encrypt it using the AES-256 algorithm. For each subsequent plaintext block, XOR the current plaintext block with the result of the previous encrypted block and then encrypt it using the AES-256 algorithm.
[0137] PKCS5Padding (actually PKCS#7 padding) is used to ensure that the data length is a multiple of the encryption algorithm block size. The specific process is as follows:
[0138] Padding data: If the data length is not a multiple of 16 bytes, use the PKCS#7 padding method to make it up. Add a number of bytes to the end of the padding data block, and the value of each byte is equal to the number of bytes padded.
[0139] Remove padding data: After decryption, remove the extra bytes according to the number of padding bytes.
[0140] IV is used for encryption in CBC mode to ensure that each encryption process is independent. The specific process is as follows:
[0141] Generate IV: A random IV is generated each time encryption is performed. The IV needs to be stored or transmitted together with the encrypted data for use during decryption.
[0142] Use IV: When encrypting, use the IV to XOR the first plaintext block. When decrypting, use the same IV to XOR the first ciphertext block.
[0143] When encrypting data, first use the AES key generator to generate a 256-bit key, and use the secure random number generator to generate a 16-byte IV. If the data length is not a multiple of 16 bytes, use the PKCS#7 padding method to make it up, and then use the AES-256 / CBC mode and the generated key and IV to encrypt the padded data. Finally, the encrypted ciphertext and IV are stored or transmitted together. When decrypting, the ciphertext is decrypted using the same key and IV, and the removal of the PKCS#7 padding is automatically processed.
[0144] 4. Feature extraction and selection:
[0145] Further extract feature information from existing customer data, such as customer gender, age, city of residence, product satisfaction, etc. By analyzing this feature information, we can determine which factors have a greater impact on customers' purchases, thereby providing an important reference for rule writing. This feature extraction and analysis process helps to establish an accurate customer portrait model and improve the decision-making ability and accuracy of the rule engine. These features can also be used for subsequent rule judgments to help companies better understand customer needs and make corresponding product improvements. The feature extraction and selection process is as follows:
[0146] A feature selection algorithm (SelectKBest) is used to select the most relevant K features based on statistical tests. This algorithm is mainly used for filter feature selection (Filter Methods), that is, before training the model, the most relevant feature subset is selected by evaluating and sorting the features, thereby improving the performance and generalization ability of the model. Predictions are made by constructing multiple decision trees, each of which is trained on a different random subset. During prediction, each tree predicts the input data, and finally obtains the final prediction result by voting or averaging. After obtaining the random forest model, the model needs to be tuned. The model tuning algorithms used in this implementation include the Bayesian optimization algorithm and the Bayesian optimization algorithm:
[0147] The Bayesian optimization algorithm is an optimization method based on Bayesian statistics and Gaussian processes, which is usually used to optimize black box functions, such as hyperparameter tuning. The main idea is to establish a proxy model (usually a Gaussian process) in the parameter space and use this proxy model to guide the next parameter selection to find the optimal solution in a finite number of iterations.
[0148] The Bayesian optimization algorithm is an optimization algorithm inspired by biological evolution theory, which searches for the optimal solution by simulating processes such as natural selection, crossover and mutation. Genetic algorithms are suitable for solving complex optimization problems, especially in the optimization of large search spaces or multi-modal functions.
[0149] Appropriate features are extracted through feature selection algorithm and random forest algorithm, and the model is optimized by Bayesian optimization algorithm and genetic algorithm for subsequent rule writing. In order to screen out the most suitable model, in addition to cleaning and preprocessing the original data to make the data more regular, cross-validation technology is also used to evaluate the performance of the model to prevent overfitting problems. The random forest contains multiple decision trees. When performing parameter tuning and model training, distributed computing is performed through the big data processing framework to speed up the model training process. When tuning parameters, the Bayesian optimization algorithm and genetic algorithm are also run through a distributed computing environment, which can significantly speed up the parameter optimization process and improve the performance of the model. The specific methods used here are as follows:
[0150] Stratified K-fold cross-validation is a commonly used cross-validation technique, which is particularly suitable for dealing with class imbalance in classification problems. In this cross-validation method, the dataset is divided into K folds, and each fold maintains the proportion of samples of each category in the original dataset.
[0151] After completing cross-validation, a distributed computing framework is used to train and optimize the model. Spark decomposes the task into multiple small tasks and assigns them to multiple computing nodes in the cluster for parallel execution. At the same time, it uses memory computing to accelerate data processing and reduce disk reading and writing. When training the random forest algorithm, the random forest algorithm interface in Spark's MLlib library specifies hyperparameters such as the number of trees and the depth of the tree, and performs model training. It combines genetic algorithms and Bayesian optimization algorithms to search for hyperparameters, optimizes the population through genetic algorithms, and uses Bayesian optimization algorithms to search for hyperparameters in each iteration.
[0152] Writing common tool classes based on the subsequent rule quality control, such as processing XML format data, AES encryption, and time data processing, can improve code reusability and speed up the execution efficiency of the rule engine.
[0153] For specific customer data processing needs, rules can be written using a rule engine or rule language to achieve automated decision-making, data processing, or business logic execution.
[0154] The data after data integration and data processing is obtained according to the database connection string, and the customer's purchase, satisfaction, etc. are queried based on the customer number. These data can trigger the corresponding customer portrait indicator calculation rules to obtain the results.
[0155] After the data is passed in, the data integrity is checked, and then the rules and input data are matched to determine which rule condition parts match the data. Once the conditions are met, the corresponding rules will be triggered to execute, and the rule action part will be operated, calculated or logically processed to generate the final required customer and product indicators.
[0156] First, establish a mathematical model for rule triggering:
[0157]
[0158] in, represents the probability of the rule being triggered, represents the probability of the intersection of rule R and condition C, represents the probability of condition C;
[0159] Secondly, establish a mathematical model for rule execution:
[0160]
[0161] in, represents the probability of rule R being executed, represents the probability of the intersection of rule R and execution result E, represents the probability of rule R;
[0162] When executing customer portrait calculation rules, it is crucial to ensure accurate matching with customer information, product information, customer satisfaction, etc. In this implementation, regular expressions and NLP natural language processing technology are used to match customer evaluations of products, extract complex information from text, and identify specific entities, such as names of people, cities, names of purchased products, satisfaction levels, etc., which helps to improve the quality and efficiency of subsequent customer services.
[0163] The Rete algorithm is used when processing rules to convert a large number of rules into a network structure connected by nodes. This network is called a Rete network. When a fact enters the rule engine, the rule engine will propagate the fact in the Rete network. During the propagation process, each node will check whether the fact meets the conditions represented by the node. If the fact meets the conditions, it will be passed to the next node. If it does not meet the conditions, the fact will be discarded. The principle of locality is adopted when processing, and there is no need to repeatedly check irrelevant conditions, which improves matching efficiency.
[0164] After the rule execution is completed, corresponding results will be generated. These results can be customer satisfaction with related products, purchase records, purchase frequency, basic customer information, complaint records, etc. Finally, these data will be stored according to the specified path to assist enterprises in more accurate marketing, customer service and decision making.
[0165] The rule engine evaluates the probability of a customer purchasing a certain product by analyzing customer data, and displays the results calculated by the rule engine on the data screen, showing the predicted probability of a customer purchasing a specific product, customer group distribution, customer satisfaction, product purchase time, age group distribution, gender ratio, regional distribution and other information.
[0166] In this implementation, rules are written through specific logic based on the products purchased by each customer, their evaluation of the products, their region, age, gender, nature of work, etc., to generate accurate customer portraits. Natural language processing technology is used to process customers' emotional tendencies and satisfaction with products, which are used for content matching when writing rules, which can improve the accuracy of user portraits. Since the training time of the random forest algorithm is long and parameter tuning is difficult, it requires multiple parameter adjustments and repeated tests. In this regard, this implementation uses a big data distributed computing framework to train and adjust the random forest model. Multiple decision trees can be trained with different parameters to select the best parameter combination. The Bayesian optimization algorithm and the genetic algorithm are run at the same time to find the best parameter combination, which significantly improves the training speed of the model.
[0167] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0168] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.
[0169] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit its protection scope. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that after reading the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims of the invention.
Claims
1. A method for calculating customer indicators in the Internet field based on a rule engine, characterized in that: The method comprises: Step 1: Obtain customer data and product data information, and pre-process the customer data and product data information; Step 2: Encrypt the pre-processed customer data and product data information to obtain encrypted data information; Step 3: construct a feature extraction model, and extract features of the encrypted data information according to the feature extraction model; Step 4: Construct rule trigger conditions, and use the rule trigger conditions to match the data after feature extraction to calculate customer indicators; The step 1 comprises: Review the acquired customer data and product data information to check whether there is any abnormal data or missing data; Replace or delete abnormal and missing data; The step 2 comprises: The client sends a connection request to the server, including a list of supported SSL / TLS versions and cipher suites; The server selects a cipher suite and sends a digital certificate containing the public key to the client; The client verifies the server's digital certificate and generates a random session key, encrypts the session key with the server's public key, and then sends it to the server, including: Generate a 256-bit AES key on the client; Generate a 16-byte random IV using a secure random number generator for use in CBC mode; Check the length of the data to be encrypted. If the data length is not a multiple of 16 bytes, use the PKCS#7 padding method to fill the data. XOR the generated IV with the first plaintext data block to get a new data block; Use the AES-256 algorithm to encrypt this new data block to generate the first ciphertext block; Repeat the ciphertext block acquisition process, and store or transmit the encrypted ciphertext and the generated IV together; Receive the transmitted ciphertext and IV, use the received IV to perform an XOR operation with the first ciphertext block to obtain the first plaintext block; Use the AES-256 algorithm to decrypt the first ciphertext block to obtain the original plaintext block; Repeat the decryption process, remove the extra padding bytes from the decrypted data according to the rules of the PKCS#7 padding method, and restore the original data; The feature extraction model in step 3 includes: Collect the original data set and divide it into feature sets and target variables; Use SelectKBest for feature selection, including: Calculate the relevance score of each feature, select the K most relevant features, and generate a feature subset; Input the feature subset into the random forest algorithm for training to obtain a feature training model based on selection; Set the hyperparameters of random forest and optimize them according to Bayesian optimization algorithm and genetic algorithm; Accelerate the optimization process of the selected feature training model through a distributed computing framework, and evaluate the model performance through stratified K-fold cross-validation; The step 4 comprises: Establish a mathematical model for rule triggering: in, represents the probability of the rule being triggered, represents the probability of the intersection of rule R and condition C, represents the probability of condition C; Build a mathematical model for rule execution: in, represents the probability of rule R being executed, represents the probability of the intersection of rule R and execution result E, represents the probability of rule R; Regular expressions and NLP natural language processing techniques are used to match customer reviews of products, extract complex information from text, identify specific entities, including: names of people, cities, names of purchased products and satisfaction levels, and complete customer indicator calculations.
2. According to claim 1, a method for calculating Internet customer indicators based on a rule engine is characterized in that: The method of accelerating the optimization process of the selected feature training model through a distributed computing framework includes: Use Spark's MLlib library to train the random forest algorithm and distribute the task to multiple computing nodes for parallel processing; When performing hyperparameter optimization, genetic algorithms and Bayesian optimization are also executed in parallel in a distributed environment.
3. The method for calculating Internet customer indicators based on a rule engine according to claim 1, characterized in that: The step 4 also includes: using the Rete algorithm to convert the rules into a node-connected network structure Rete network. When a fact enters the rule engine, the rule engine propagates the fact in the Rete network. During the propagation process, each node will check whether the fact meets the conditions represented by the node. If the fact meets the conditions, it will be passed to the next node. If it does not meet the conditions, the fact will be discarded.
4. A rule engine-based Internet customer image index calculation system, characterized in that: The system comprises: The preprocessing unit is used to obtain customer data and product data information and preprocess the customer data and product data information, including: Review the acquired customer data and product data information to check whether there is any abnormal data or missing data; Replace or delete abnormal and missing data; The encryption unit is used to encrypt the pre-processed customer data and product data information and obtain the encrypted data information, including: The client sends a connection request to the server, including a list of supported SSL / TLS versions and cipher suites; The server selects a cipher suite and sends a digital certificate containing the public key to the client; The client verifies the server's digital certificate and generates a random session key, encrypts the session key with the server's public key, and then sends it to the server, including: Generate a 256-bit AES key on the client; Generate a 16-byte random IV using a secure random number generator for use in CBC mode; Check the length of the data to be encrypted. If the data length is not a multiple of 16 bytes, use the PKCS#7 padding method to fill the data. XOR the generated IV with the first plaintext data block to get a new data block; Use the AES-256 algorithm to encrypt this new data block to generate the first ciphertext block; Repeat the ciphertext block acquisition process, and store or transmit the encrypted ciphertext and the generated IV together; Receive the transmitted ciphertext and IV, use the received IV to perform an XOR operation with the first ciphertext block to obtain the first plaintext block; Use the AES-256 algorithm to decrypt the first ciphertext block to obtain the original plaintext block; Repeat the decryption process, remove the extra padding bytes from the decrypted data according to the rules of the PKCS#7 padding method, and restore the original data; The feature extraction unit is used to construct a feature extraction model and extract features from the encrypted data information according to the feature extraction model, including: Collect the original data set and divide it into feature sets and target variables; Use SelectKBest for feature selection, including: Calculate the relevance score of each feature, select the K most relevant features, and generate a feature subset; Input the feature subset into the random forest algorithm for training to obtain a feature training model based on selection; Set the hyperparameters of random forest and optimize them according to Bayesian optimization algorithm and genetic algorithm; Accelerate the optimization process of the selected feature training model through a distributed computing framework, and evaluate the model performance through stratified K-fold cross-validation; The rule trigger unit is used to construct the rule trigger conditions, and use the rule trigger conditions to match the data after feature extraction and calculate customer indicators, including: Establish a mathematical model for rule triggering: in, represents the probability of the rule being triggered, represents the probability of the intersection of rule R and condition C, represents the probability of condition C; Build a mathematical model for rule execution: in, represents the probability of rule R being executed, represents the probability of the intersection of rule R and execution result E, represents the probability of rule R; Regular expressions and NLP natural language processing techniques are used to match customer reviews of products, extract complex information from text, identify specific entities, including: names of people, cities, names of purchased products and satisfaction levels, and complete customer indicator calculations.
5. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes a method for calculating customer indicators in the Internet field based on a rule engine according to any one of claims 1-3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of a method for calculating customer indicators in the Internet field based on a rule engine as described in any one of claims 1-3.
Citation Information
Patent Citations
System and method for web-based marketing and campaign management
US20030041050A1
Padding oracle elimination in RSA encryption
US20210367771A1
Method of fraud detection in telecommunication using big data mining techniques
US20230208875A1
Method and device for loading digital certificate in SSL or TLS communication
WO2017045552A1