Electronic commerce data processing method

Through distributed multi-level order encryption models and machine learning algorithms, combined with business coverage information and hierarchical encryption, the problems of low e-commerce data processing efficiency and insufficient security are solved, and efficient and secure data processing and privacy protection are achieved.

CN118864050AInactive Publication Date: 2024-10-29CHONGQING SHENDU TECH CO LTD
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202410885290.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-10-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing e-commerce data processing technology is inefficient and difficult to cope with the real-time processing needs of massive data. Data security and privacy protection are difficult to meet strict security compliance requirements. Traditional encryption algorithms are computationally intensive, which increases overhead and affects efficiency.

Method used

Adopt a distributed multi-level order encryption model, use machine learning algorithms to select appropriate encryption components based on historical order data patterns and system loads, combine business coverage information to build order encryption node sequences, hierarchically encrypt data of different sensitivity levels, and use local sensitivity Algorithms such as hashing and cyclic redundancy check are used for feature extraction and encryption processing.

Benefits of technology

It improves data processing efficiency and throughput, optimizes system performance, achieves refined data protection and privacy compliance, reduces encryption overhead, and adapts to changes in business needs and data scale.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864050A_ABST
    Figure CN118864050A_ABST
Patent Text Reader

Abstract

The invention discloses an e-commerce data processing method, which relates to data processing, and comprises the following steps: receiving an e-commerce order, and extracting an order feature; selecting an order encryption component from a preset encryption component pool according to the historical order data mode, the current system load and the order characteristics; the method comprises the steps of obtaining service coverage information of an electronic commerce order in a generation process, and constructing an order encryption node sequence; associating order item information contained in the e-commerce order to the constructed order encryption node sequence according to a preset association sequence; encrypting order basic information of different sensitivity levels in the e-commerce order; in the order encryption node sequence, according to the selected order encryption component, determining a target order encryption node; encrypting the order item information associated to the encryption node sequence by adopting an encryption algorithm and a key corresponding to the target order encryption node; in view of low electronic commerce data processing efficiency in the prior art, the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to an e-commerce data processing method. Background Art

[0002] With the rapid development of Internet technology and the increasing popularity of e-commerce, online transactions have become an indispensable part of people's daily lives. E-commerce platforms generate massive amounts of transaction order data every day. Efficient and secure processing and storage of this data is the key to ensuring the normal operation and sustainable development of e-commerce.

[0003] However, the existing e-commerce data processing technology still has many shortcomings and challenges. First, the scale of e-commerce data is huge, and the types and formats of data are complex and diverse, which places high demands on the efficiency and performance of data processing. The traditional centralized data processing architecture is difficult to cope with the real-time processing needs of massive data, and is prone to performance bottlenecks and single points of failure. Secondly, e-commerce data contains a large amount of user privacy and commercial secrets, and data security and privacy protection are crucial. Simple encryption schemes are difficult to meet increasingly stringent security compliance requirements, while complex encryption algorithms will significantly increase computing overhead and affect data processing efficiency. In addition, e-commerce data processing involves multiple business links and system modules, and lacks a unified data management and scheduling mechanism, resulting in complex and time-consuming data processing processes, making it difficult to achieve agile and efficient business responses.

[0004] In the related art, for example, Chinese patent document CN111310207B provides an e-commerce data processing method, device, e-commerce system and server, which records the order encryption component corresponding to the e-commerce order, obtains the business coverage information of the e-commerce order in the generation process, and establishes an order encryption node sequence corresponding to the business coverage information, and associates each order item information included in the e-commerce order to the order encryption node sequence according to a preset association order, thereby determining at least part of the target order encryption nodes in the order encryption node sequence based on the order encryption component corresponding to the e-commerce order, and encrypts the corresponding order item information included in the e-commerce order according to the target order encryption node. However, this scheme associates the order data with specific nodes in these node sequences, and each node needs to execute a complex encryption algorithm to ensure the security of the data. The encryption algorithm is usually computationally intensive, so the data processing efficiency of this scheme needs to be further improved. Summary of the invention

[0005] In view of the problem of low efficiency in e-commerce data processing in the prior art, the present application provides an e-commerce data processing method, which constructs a distributed multi-level order encryption by introducing business coverage information and order encryption node sequence, thereby improving efficiency.

[0006] Technical solution, the purpose of this application is achieved through the following technical solution.

[0007] The present specification provides an e-commerce data processing method, which is applied to a server, and the server is communicatively connected with multiple e-commerce terminals, including: S1, receiving an e-commerce order generated by an e-commerce terminal, and extracting order features; wherein the e-commerce order includes basic order information and order item information; the basic order information includes an order ID and an amount; the order item information includes a product ID, name, quantity and amount; the order features include an order amount and a product type; specifically, the basic order information includes an order ID, a user ID, a total order amount and an order time; the order item information includes the ID, name, quantity, unit price and subtotal amount of each product; extracting order features, wherein the order features include a total order amount, a product type, an order time and a user level; S2, using a machine learning algorithm, selecting an order encryption component from a preset encryption component pool according to historical order data patterns, current system load and extracted order features; S3, obtaining business coverage information of the e-commerce order during the generation process, wherein the business coverage information includes a target business accessed during the order generation process; the target business represents the target business accessed during the e-commerce order generation process business process; S4, construct an order encryption node sequence according to the business coverage information; associate the order item information contained in the received e-commerce order with the constructed order encryption node sequence according to the preset association order; S5, perform sensitivity analysis on the received e-commerce order, and divide the e-commerce order into three sensitivity levels of high, medium and low; assign different encryption algorithms to each sensitivity level; according to the sensitivity analysis results, encrypt the order basic information of different sensitivity levels in the received e-commerce order; S6, in the order encryption node sequence constructed in S4, determine the target order encryption node according to the order encryption component selected in S2; use the encryption algorithm and key corresponding to the target order encryption node to encrypt the order item information associated with the encryption node sequence in S4; S7, store the order basic information encrypted by S5 and the order item information encrypted by S6 in the database; when a user requests to access the e-commerce order, select the corresponding decryption method according to the requested data sensitivity level and user authority, decrypt the stored encrypted order data, and return the decrypted order data to the user.

[0008] Among them, order basic information refers to the basic attributes and summary information in e-commerce orders, usually including order ID (number that uniquely identifies the order) and order amount (total amount of the order). This information is the key feature of the order and is used to identify and describe the basic situation of the order. Order item information refers to the detailed information of the specific goods or services contained in the e-commerce order. It usually includes the product ID (number that uniquely identifies the product), product name, purchase quantity and amount. The order item information describes the specific content and amount of each product or service in the order, reflecting the detailed composition of the order. Machine learning algorithm is a computer algorithm that automatically extracts patterns and rules through data training and learning. In e-commerce data processing, machine learning algorithms can automatically select appropriate order encryption components based on historical order data patterns, current system load and order characteristics to optimize the efficiency of data encryption and processing. System load refers to the workload and resource consumption of the e-commerce system at a certain moment. It reflects the current busyness and performance status of the system. When selecting order encryption components, considering the system load, the encryption strategy can be dynamically adjusted according to the real-time status of the system to ensure the stability and performance of the system. Order characteristics refer to the key attributes and characteristics in e-commerce orders, such as order amount, product type, etc. These characteristics can reflect the importance, sensitivity and processing requirements of the order. By extracting and analyzing order features, we can better understand the nature of the order and select appropriate encryption components and processing methods based on the features. Order encryption components refer to software modules or algorithms used to encrypt e-commerce orders. They usually include different encryption algorithms, key management mechanisms, and security protocols to protect the confidentiality and integrity of order data. According to the sensitivity and characteristics of the order, different encryption components can be selected to meet different security requirements. Target business refers to the business process or business link involved in the e-commerce order generation process. It can include different business functions such as user login, product browsing, shopping cart management, and payment processing. By obtaining the target business information accessed during the order generation process, we can understand the business context and process of the order, providing a basis for building the order encryption node sequence. Sensitivity analysis refers to the classification and evaluation of data in e-commerce orders to determine the sensitivity and protection requirements of different data. By classifying order data into three sensitivity levels of high, medium, and low, corresponding encryption measures can be taken according to the sensitivity of the data to provide more fine-grained security protection. Sensitivity analysis helps to optimize the efficiency and security of data encryption and meet the protection requirements of different data.

[0009] Further, S2, using a machine learning algorithm, selects an order encryption component from a preset encryption component pool according to historical order data patterns, current system load and extracted order features, including: constructing a mapping model of order features and encryption component selection based on historical order data; wherein the mapping model takes order features as input and encryption component selection results as output; using the constructed mapping model, predicting the probability of each encryption component selection according to current order features and system load; wherein the system load includes CPU occupancy, memory occupancy, network bandwidth, etc. According to the prediction results, select the encryption component with the highest probability from the preset encryption component pool as the order encryption component; wherein the encryption component includes an encryption algorithm and a key; the encryption component pool includes multiple encryption algorithms and keys of different lengths; using the selected order encryption component, encrypt the received e-commerce order to obtain encrypted order data.

[0010] Furthermore, the mapping model includes: an input layer for receiving order features; a hidden layer, which adopts a multi-layer perceptron structure and learns the nonlinear relationship between order features and encryption component selection through training; wherein the activation function of the hidden layer adopts a ReLU function to introduce nonlinear transformation; wherein the first hidden layer adopts a fully connected structure, and the number of neurons is greater than the number of input layer features, which is used to extract high-dimensional features; and the ReLU activation function is used to introduce nonlinear transformation and enhance the expression ability of the model; the second hidden layer adopts a fully connected structure, and the number of neurons is less than the first hidden layer, which is used to compress high-dimensional features and extract key information; and the ReLU activation function is used to further enhance the nonlinear expression ability; the third hidden layer adopts a fully connected structure, and the number of neurons is less than the second hidden layer, which is used to deeply compress features and obtain the most critical feature representation; and the ReLU activation function is used to maintain nonlinear transformation ability; an output layer, which is used to output the selection probability of each encryption component; wherein the number of neurons in the output layer is consistent with the number of encryption components; the Softmax function is used to perform weighted summation on the selection probability of each encryption component and output a weighted probability distribution.

[0011] Among them, the training process of the mapping model includes: using historical order data to construct a training sample set, each sample contains order features and corresponding encryption component selection results; using the improved Focal Loss function as the loss function to measure the difference between the model prediction results and the actual results; using the Mini-batch gradient descent method to input the training sample set into the mapping model in batches; calculating the loss function value of each batch, and calculating the gradient of the mapping model parameters based on the loss function value, using the gradient descent algorithm to update the mapping model parameters and minimize the loss function.

[0012] Among them, the multilayer perceptron is a feedforward neural network structure, which consists of an input layer, one or more hidden layers and an output layer. Each layer consists of multiple neurons, and information is transmitted between neurons through weighted connections. The multilayer perceptron can learn the nonlinear relationship between input features and output targets, and continuously optimize the prediction ability of the network by adjusting the connection weights and biases. In this mapping model, the multilayer perceptron structure is used to learn the complex relationship between order features and encryption component selection to achieve intelligent encryption component selection. Focal Loss is a loss function used to deal with the problem of class imbalance, especially for the situation where there is class imbalance in classification tasks. Compared with the traditional cross entropy loss function, Focal Loss gives higher weight to difficult-to-classify samples and reduces the weight of easy-to-classify samples by introducing focusing factors and balancing factors. This helps the model pay more attention to difficult-to-classify samples and improves the performance of the model on unbalanced data sets. In this mapping model, the improved Focal Loss function is used as the loss function, which can better deal with the imbalance problem of different encryption component selection results and improve the classification accuracy of the model. Mini-batch gradient descent is a commonly used neural network optimization algorithm, which is between batch gradient descent and stochastic gradient descent. Mini-batch gradient descent divides the training sample set into several small batches (mini-batches), each batch contains a certain number of samples. During the training process, each iteration randomly selects a mini-batch from the training set, inputs it into the model to calculate the loss function and gradient, and then updates the model parameters according to the gradient. Compared with batch gradient descent, mini-batch gradient descent can update model parameters more frequently and accelerate the convergence speed; compared with stochastic gradient descent, mini-batch gradient descent can take advantage of parallel computing and improve training efficiency. In the training process of this mapping model, the mini-batch gradient descent method is used to achieve rapid optimization and convergence of model parameters while ensuring training efficiency.

[0013] Furthermore, the improved Focal Loss function expression is as follows:

[0014]

[0015] Among them, p t Represents the probability value of the target category predicted by the model; f(p t ,β,δ) is the probability scaling function used to adjust p tPerform nonlinear transformation and scale it to the interval [0, 1]; β is the scaling control parameter, which is used to adjust the shape and range of the scaling function; δ is the scaling offset parameter, which is used to control the offset of the scaling function; γ is the modulation coefficient, which is used to adjust the difference in loss weights between easy-to-classify samples and difficult-to-classify samples; h(p t ,μ,σ) is the dynamic adjustment function of the modulation coefficient, which dynamically adjusts the value of γ according to the predicted probability of the sample; μ is the mean of the predicted probability, σ is the standard deviation of the predicted probability; a t is a balancing factor used to balance the importance of samples of different categories; when the sample belongs to the target category, a t =a, otherwise a t =1-a; α is the weight of the target category; g(p t ,λ,η) is the probability logarithm function, which is used to calculate p t Logarithmic transformation is performed to map the probability value to the logarithmic space, making the loss function smoother; λ is the control parameter of the logarithmic transformation, which is used to adjust the strength of the logarithmic transformation; η is the offset parameter of the logarithmic transformation, which is used to control the offset of the logarithmic transformation; w(t) is the time decay function, which is used to gradually reduce the weight of the loss as the number of training rounds increases. The improved Focal Loss function can adjust the loss weight of the sample more flexibly and finely to adapt to different data distributions and classification tasks. The probability scaling function introduces an offset parameter δ, which can control the offset of the scaling function; the dynamic adjustment function of the modulation coefficient introduces an offset constant c, which can control the value range of the modulation coefficient; the probability logarithmic function introduces an offset parameter η, which can control the offset of the logarithmic transformation; the time decay function w(t) can gradually reduce the weight of the loss as the number of training rounds increases, so that the model pays more attention to difficult-to-classify samples in later training.

[0016] Furthermore, the probability scaling function f(p t ,β,δ) is: Where k is the scaling factor, which controls the steepness of the scaling. The dynamic adjustment function of the modulation coefficient h(p t ,μ,σ) is: Where c is the offset constant, which is used to control the value range of the modulation coefficient; the probability logarithmic function g(p t ,λ,η) is: Among them, ε is the smoothing coefficient to prevent the logarithm from being zero; the expression of the time decay function w(t) is: Among them, t is the current training round number, t 0 is the number of decay starting rounds, and s is the decay rate control parameter.

[0017] Further, S4, constructs an order encryption node sequence according to the business coverage information, including: analyzing the business coverage information, extracting the target business to be accessed, and constructing a directed acyclic graph (DAG); wherein the target business includes key business modules and processes such as user authentication, product browsing, inventory query, discount calculation, delivery management, payment control, and order generation; each node in the constructed directed acyclic graph is used as an order encryption node, and the node attributes include a target business ID, an access timestamp, and a status identifier; wherein the target business ID is used to identify the business module corresponding to the node, the access timestamp records the call time of the business module, and the status identifier indicates the execution of the business module. The order encryption node sequence is constructed according to the directed edges in the constructed directed acyclic graph, and the order encryption node sequence is constructed; wherein the directed edges represent the calling relationship and data dependency between the business modules, and the direction of the directed edges represents the order of calling; the order item information is matched with the order encryption node sequence, and the order item information is associated with the corresponding order encryption node according to the generation timestamp of the order item; wherein the generation timestamp of the order item falls within the access timestamp interval of the order encryption node, indicating that the order item is generated during the execution of the corresponding business module and is associated with the node.

[0018] Preferably, an order encryption node sequence is constructed according to the business coverage information, including: according to the business coverage information, obtaining the target business accessed during the order processing process, and constructing a directed acyclic graph (DAG) based on the dependency relationship and call order between the target businesses; wherein the nodes of the directed acyclic graph represent the target business, and the directed edges represent the dependency relationship and access order between the businesses, and the topological sorting and other algorithms are used to ensure that there is no circular dependency in the graph; each node in the constructed directed acyclic graph is used as an order encryption node, and the attributes of the node include the unique identification ID of the target business, the business type, the access timestamp and the encryption parameters; wherein the target business ID is used to uniquely identify a business node, the business type is used to distinguish the data characteristics and processing logic of different businesses, the access timestamp is used to record the access time of the business node, and the encryption parameters are used to specify the configuration information such as the encryption algorithm and key of the node; according to the directed edges in the constructed directed acyclic graph, the association order between the order encryption nodes is determined, and a linear order encryption node sequence is constructed; wherein, by performing a depth-first search or a breadth-first search on the directed acyclic graph, a topologically sorted node sequence is obtained, and the sequence satisfies that the predecessor node of each node is in Its appearance before ensures the dependency and execution order of the encryption nodes; matches the order item information with the order encryption node sequence, and associates each order item to an order encryption node with the closest timestamp according to the generation timestamp of the order item; wherein, by comparing the generation timestamp of the order item with the access timestamp of the encryption node, an encryption node with the smallest time difference is found, and a mapping relationship between the order item and the encryption node is established, thereby realizing the distributed storage and processing of the order data on the encryption node; on the order encryption node, the order item is encrypted according to the associated order item information and the encryption parameters of the node to generate encrypted order data; wherein different encryption nodes can adopt different encryption algorithms and keys, and can be flexibly configured according to the business type and security requirements, thereby realizing the divide-and-conquer and differentiated encryption of order data; the encrypted order data is assembled and spliced ​​in the order of the order encryption node sequence to generate a complete encrypted order; wherein, by traversing the encryption node sequence, the encrypted order data on each node is connected in sequence to form an encrypted order data flow that conforms to the business logic and dependency relationship, thereby ensuring the integrity and consistency of the order data. The order encryption node sequence is dynamically constructed according to the business coverage information, and the order item information is distributed to different encryption nodes for encryption processing, realizing the distributed storage and differentiated encryption of order data, and improving the security and scalability of the data. At the same time, the dependency and execution order of the encryption nodes are determined through directed acyclic graphs and topological sorting, ensuring the correctness and efficiency of the encryption process.

[0019] Furthermore, the order item information contained in the received e-commerce order is associated with the constructed order encryption node sequence according to a preset association order, including: traversing each order encryption node in the order encryption node sequence, obtaining a subset of order item information associated with the current node, the subset including the product ID, name, quantity and amount; preferably, before traversing each order encryption node in the order encryption node sequence, the order encryption node sequence is topologically sorted to ensure that the traversal order of the nodes is consistent with the execution order of the business process to avoid data dependency and call conflicts. After obtaining the subset of order item information associated with the current node, the subset is preprocessed to filter out abnormal order items with zero amount or negative quantity to ensure the validity and legality of the order data.

[0020] The quantity and amount of the associated order item information subset are normalized to obtain normalized order item features; preferably, a minimum-maximum normalization method is used to map the attribute value to the interval [0, 1], and the calculation formula for the normalization is: Among them, x is the original attribute value, min and max are the minimum and maximum values ​​of the attribute respectively, and x' is the normalized attribute value.

[0021] The normalized order item features are hash mapped using the local sensitive hashing algorithm LSH; the calculation steps of the LSH algorithm include: selecting a random projection vector, performing a projection transformation on the feature vector, and obtaining a projection value; assigning the feature vector to a hash bucket according to the projection value and a preset threshold value, and obtaining a hash value; repeating the above steps multiple times to generate multiple hash tables to improve the accuracy of the hash mapping; preferably, when performing local sensitive hashing (LSH) mapping on the normalized order item features, a Min-Hash algorithm is used to convert the high-dimensional feature vector into a low-dimensional hash signature through multiple random permutations and minimum hash value selection, thereby realizing fast feature retrieval and similarity calculation.

[0022] The obtained hash value is binary-encoded using a cyclic redundancy check (CRC) algorithm to obtain a feature vector of the order item; the feature vectors of the obtained order item are sorted and spliced ​​according to a preset association rule to generate a feature sequence of the current order encryption node; the feature sequence of each order encryption node is spliced ​​according to the order of the node in the order encryption node sequence to generate a complete feature sequence of the order item; preferably, after generating the feature sequence of the current order encryption node, the feature sequence is hashed to obtain a hash summary of a fixed length as the feature fingerprint of the current node for rapid comparison and matching of order item information. After generating a complete feature sequence of the order item, the feature sequence is compressed and encoded, and algorithms such as run length encoding (RLE) are used to reduce the storage overhead and transmission cost of the feature sequence. After generating a complete feature sequence of the order item, the feature sequence is encrypted, and a symmetric encryption algorithm (such as AES) or an asymmetric encryption algorithm (such as RSA) is used to ensure the confidentiality and integrity of the feature sequence.

[0023] Among them, the preset association rules include descending sorting according to the amount of the order items. Then the order items are sorted in lexicographic order according to the product ID to ensure the consistency and comparability of the feature sequence. Among them, normalization processing can reduce the scale difference between features and improve the comparability of features; the LSH algorithm can achieve dimension reduction and hash mapping of features, improve the discreteness and uniformity of features; the CRC algorithm can verify and encode hash values ​​to improve the integrity and robustness of feature vectors; the above algorithms can be used in combination to extract representative and distinguishing features from massive order item information, provide high-quality input for subsequent encryption algorithm selection and encryption processing, and improve the accuracy and efficiency of order encryption.

[0024] Among them, the order item information subset refers to a part of the order item information associated with the current order encryption node. In the process of traversing the order encryption node sequence, for each order encryption node, the order item information associated with it is obtained, and this information constitutes a subset. The order item information subset contains attributes such as the product ID, name, quantity and amount related to the current node, which are used for subsequent feature extraction and encryption processing. The local sensitive hashing algorithm is an algorithm for fast approximate nearest neighbor search of high-dimensional data. It achieves fast similarity search by mapping high-dimensional data to low-dimensional space and using hash functions to map similar data to the same hash bucket. The core idea of ​​the LSH algorithm is that similar data has a higher probability of being mapped to the same hash bucket after hash mapping. In this method, the normalized order item features are hash mapped using the LSH algorithm, and similar order items are mapped to the same hash value, providing a basis for subsequent feature vector generation. The cyclic redundancy check algorithm is a commonly used error detection and data integrity check algorithm. It generates a fixed-length check value (usually called CRC value or CRC code) by performing polynomial division on the data. The CRC algorithm has good error detection capabilities and can detect bit errors and data corruption during data transmission or storage. In this method, the hash value obtained by the LSH algorithm is binary encoded using the CRC algorithm to generate a feature vector for the order item. The CRC algorithm can ensure that the generated feature vector has good randomness and uniqueness, and improve the robustness of the feature representation.

[0025] Furthermore, the obtained hash value is binary-encoded using a cyclic redundancy check (CRC) algorithm to obtain a feature vector of the order item, including: constructing a generating polynomial P(x) of the CRC algorithm, setting the number of bits of the check code and the initial value R init ; Among them, the initial value R init 0xFFFFFFFF, that is, all 32 bits are 1, which is used to initialize the CRC register and perform an XOR operation with the hash block; the hash value H obtained by the LSH algorithm is filled with zeros so that the filled hash value H padded The length of the filled hash value H padded Group by 32 bits to get n hash blocks H 1 ,H 2 ,.....,H n ; Among them, the zero padding and grouping operations are to meet the requirements of the CRC-32 algorithm for data length, ensuring that each hash block can perform a complete CRC-32 calculation; preferably, the length of the hash value H is 128 bits, and the padded hash value H padded The length of is 160 bits, and after grouping, 5 hash blocks are obtained, and the length of each hash block is 32 bits.

[0026] Compare all bits of the hash block Hi with the initial value R init Perform an XOR operation to obtain the initial CRC register value R0. The number of bits in the CRC register is the same as the order of the generating polynomial P(x), both of which are 32 bits. It is used to store intermediate calculation results and local check codes. j-1 Shift left 1 bit to get the middle CRC register value R jtemp R jtemp ; Among them, R j-1 Indicates the CRC register value obtained in the previous iteration, R jtemp It indicates the intermediate result after 1 bit left shift. The bitwise left shift operation is to shift the contents of the CRC register 1 bit to the left. The highest bit shifted out is used to determine whether an XOR operation with the generating polynomial is required, and the lowest bit shifted in is 0.

[0027] Determine whether the highest bit shifted out is 1. If it is 1, perform an XOR operation on the intermediate CRC register value P(x) and the generating polynomial P(x) to obtain the updated CRC register value R j ; If it is 0, the intermediate CRC register value P(x) is used as the updated CRC register value R j ; XOR operation is to perform bitwise XOR operation on the content of CRC register and the generating polynomial P(x), that is, the corresponding bits are 0 if they are the same and 1 if they are different, and the updated CRC register value is obtained. Repeat the above steps until the hash block H i All bits of are shifted out to obtain the final CRC register value R32, which is used as the local check code C of the corresponding hash block. i ; Repeat the left shift and XOR operation for a number of times equal to the number of bits in the hash block, that is, 32 times, and process each bit of the hash block in turn until all bits are shifted out. Local check code C i is the hash block H i The 32-bit remainder obtained by CRC-32 calculation reflects the verification property of the hash block and is used for error detection and location.

[0028] The local checksum of each hash block {C i} Perform bitwise XOR operation to obtain the global check code C of the entire hash value H global , as the result of CRC encoding; global check code C global It is the 32-bit result obtained by bitwise XOR of all local checksums, which reflects the checksum characteristics of the entire hash value H and is used to verify data integrity and consistency. global Concatenate with the hash value H to get the CRC-encoded feature vector V crc The splicing operation is to convert the global check code C globalAppended to the hash value H, a new data unit is formed, namely the CRC-encoded feature vector V crc , whose length is the hash value length plus 32 bits.

[0029] Among them, the CRC-32 algorithm is used to perform binary encoding and error checking on the hash value obtained by LSH, and convert it into a feature vector containing a check code, thereby realizing the compressed representation and integrity verification of the order item features; CRC-32 encoding constructs a generating polynomial, uses initial values, left shifts, XOR and other operations, calculates the check code according to the hash value, and through the comparison and verification of the check code, it can detect and locate bit errors in the calculation and transmission process, thereby improving the reliability and security of the hash feature; at the same time, CRC-32 encoding adopts the IEEE802.3 standard polynomial, which is consistent with communication protocols such as Ethernet, thereby improving the interoperability and compatibility of order features.

[0030] Among them, the XOR operation is a binary logic operation, represented by the symbol "⊕". For two binary bits a and b, the result of the XOR operation is: when a and b are different, the result is 1; when a and b are the same, the result is 0. In the CRC algorithm, the XOR operation is used to operate the CRC register value with the generating polynomial, hash block, etc. to generate a check code. The register value refers to the variable used to store the intermediate calculation results during the calculation process of the CRC algorithm. In each iteration, the register value is updated according to the shift operation and the XOR operation. The local check code refers to the check code calculated separately for each hash block in the CRC algorithm. After the padded hash value is grouped according to 32 bits, the CRC calculation is performed on each hash block Hi to obtain the corresponding local check code C i The local check code reflects the data integrity and correctness of each hash block and is used for subsequent global check code calculation. The global check code refers to the final check code obtained by combining the local check codes of all hash blocks in the CRC algorithm. i} performs bitwise XOR operation to obtain the global check code Cglobal of the entire hash value H. The global check code reflects the data integrity and correctness of the entire hash value as the final result of CRC encoding. The global check code and the original hash value together constitute the feature vector after CRC encoding.

[0031] Among them, the generator polynomial P(x) of the CRC algorithm is expressed as follows:

[0032] P(x)=x 32 +x 26 +x 23 +x 22 +x 16 +x 12 +x11 +x 10 +x 8 +x 7 +x 5 +x 4 +x 2 +x+1, where the number of checksum bits is 32 and the initial value is 0xFFFFFFFF; where IEEE802.3 polynomial is a generating polynomial widely used in Ethernet standards, and has good error detection and correction performance; the 32-bit checksum can provide a hash value space of 2^32-1 to meet the needs of large-scale data processing; the initial value 0xFFFFFFFF can detect data errors and omissions to the greatest extent.

[0033] Further, according to the sensitivity analysis results, the order basic information of different sensitivity levels in the received e-commerce orders is encrypted, including: highly sensitive data is encrypted by AES-256 algorithm; medium sensitive data is encrypted by AESS-128 algorithm; low sensitive data is encrypted by ChaCha20 algorithm. Among them, AES-256 is a variant of the Advanced Encryption Standard (AES) algorithm, which uses a 256-bit key for encryption and decryption operations. AES is a symmetric encryption algorithm that is widely used in various security fields. AES-256 provides very high security, with a key length of 256 bits, which can resist brute force cracking and other attack methods. In this method, for highly sensitive order basic information, the AES-256 algorithm is used for encryption to ensure the confidentiality and integrity of the data. AES-128 is another variant of the AES algorithm, which uses a 128-bit key for encryption and decryption operations. Compared with AES-256, AES-128 has a shorter key length, but still provides sufficiently high security to meet the security requirements of most application scenarios. AES-128 has relatively high computational efficiency and fast encryption and decryption speeds. In this method, the AES-128 algorithm is used to encrypt the basic information of medium-sensitivity orders, which ensures data security while taking into account the requirements of encryption performance. ChaCha20 is a stream cipher algorithm designed by Daniel J.Berstein. It is based on the Salsa20 algorithm and has made some improvements and optimizations. ChaCha20 uses a 256-bit key and a 64-bit random number (nonce) to generate a key stream for encrypting and decrypting data. Compared with the AES algorithm, ChaCha20 has higher performance and lower resource consumption, and is particularly suitable for scenarios such as mobile devices and embedded systems. In this method, the ChaCha20 algorithm is used to encrypt the basic information of low-sensitivity orders, which reduces the computational overhead of encryption operations while ensuring data security.

[0034] Specifically, for highly sensitive data, the AES-256 algorithm is used for encryption, using a 256-bit key, a block length of 128 bits, the CBC mode, the PKCS7 padding method, and 14 encryption rounds; among them, the AES-256 algorithm provides the highest level of security, the key length is sufficient to resist brute force attacks, the CBC mode introduces an initialization vector, which enhances the randomness and unpredictability of encryption, the PKCS7 padding method ensures the groupability of the plaintext length, and 14 encryption iterations ensure the encryption strength; for medium-sensitivity data, the AES-128 algorithm is used for encryption, using a 128-bit key, a block length of 128 bits, the CTR mode, no padding, and 10 encryption rounds; among them, the AES-128 algorithm reduces the computational complexity while ensuring high security compared to AES-256 The CTR mode generates a key stream by XORing the key with a counter, achieving parallel encryption and random access to the data. The 10 rounds of encryption iterations strike a balance between efficiency and security. For low-sensitivity data, the ChaCha20 algorithm is used for encryption, using a 256-bit key, a block length of 512 bits, nonce and a counter for initialization, and 20 encryption rounds. The ChaCha20 algorithm is a stream cipher based on the ARX structure with excellent performance and parallelism. The key length is 256 bits, and the security strength is comparable to that of AES-256. The block length is 512 bits, which is suitable for encryption scenarios with large amounts of data. The introduction of nonce and counters increases the randomness and unpredictability of encryption. The 20 rounds of encryption iterations ensure sufficient obfuscation and diffusion effects.

[0035] Furthermore, when using the AES-256 algorithm to encrypt highly sensitive data, it is encrypted using a dynamically generated key, and each order uses a separate key; when using the AESS-128 algorithm to encrypt medium-sensitivity data, it is encrypted using an order-level key, and the medium-sensitivity data of the same order uses the same key; when using the ChaCha20 algorithm to encrypt low-sensitivity data, it is encrypted using a session-level key, and the low-sensitivity data within the same session uses the same key.

[0036] Compared with the prior art, the advantages of this application are:

[0037] E-commerce orders are split and encrypted according to business logic and dependencies, and a distributed, multi-level order encryption model is constructed. This distributed processing method makes full use of system resources, realizes parallel encryption and storage of order data, avoids single-point bottlenecks and performance hotspots, and greatly improves data processing efficiency and throughput. At the same time, through the introduction of order encryption node sequences, pipeline processing of order data in encryption, storage, access and other links is realized, reducing data transmission and waiting delays between different nodes, and further optimizing system performance.

[0038] By adopting machine learning algorithms, the optimal encryption components are adaptively selected according to historical order data patterns, current system load and order characteristics, realizing dynamic optimization and elastic scaling of encryption schemes. When the data scale and business load change, the system can intelligently adjust encryption strategies and resource allocation to ensure the efficiency and reliability of data processing. At the same time, based on the distributed multi-level order encryption model, encryption nodes can be easily added or deleted, and data processing capabilities can be horizontally expanded and dynamically adjusted, which improves the flexibility and scalability of the system and can adapt to changing business needs and data scale.

[0039] By performing sensitivity analysis on e-commerce orders and adopting a hierarchical encryption method, different encryption algorithms of different strengths are used for data of different sensitivity levels, thus achieving refined data protection and privacy compliance. High-intensity encryption algorithms, such as AES-256, are used for highly sensitive core data to ensure the confidentiality and integrity of the data; relatively lightweight encryption algorithms, such as ChaCha20, are used for ordinary data with lower sensitivity, which reduces encryption overhead while ensuring security. At the same time, feature extraction and integrity verification of order data are performed through algorithms such as local sensitive hashing and cyclic redundancy check, preventing security risks such as data leakage and tampering.

[0040] Through sensitivity analysis and hierarchical encryption of e-commerce orders, refined data management and differentiated protection are achieved. Different encryption strategies and access control mechanisms are adopted according to the sensitivity of the data and the importance of the business, meeting the security compliance requirements in different business scenarios. At the same time, when data access is requested, the corresponding decryption method is dynamically selected according to user permissions and data sensitivity level, achieving accurate authorization and fine-grained control of data access, and maximizing the protection of user privacy and data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is an exemplary flow chart of an e-commerce data processing method according to some embodiments of this specification;

[0042] Figure 2is an exemplary flow chart of obtaining encrypted order data according to some embodiments of this specification;

[0043] Figure 3 This is an exemplary flow chart of obtaining an order item feature sequence according to some embodiments of this specification. DETAILED DESCRIPTION

[0044] The method and system provided in the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0045] Figure 1 This is an exemplary flow chart of an e-commerce data processing method shown in some embodiments of the present specification, an e-commerce data processing method, applied to a server, the server is in communication connection with multiple e-commerce terminals, including: S1, receiving an e-commerce order generated by an e-commerce terminal, and extracting order features; wherein the e-commerce order includes basic order information and order item information; the basic order information includes order ID and amount; the order item information includes commodity ID, name, quantity and amount; the order features include order amount and commodity type; S2, using a machine learning algorithm, according to historical order data patterns, current system load and extracted order features, select an order encryption component from a preset encryption component pool; S3, obtain business coverage information of the e-commerce order during the generation process, the business coverage information includes the target business accessed during the order generation process; the target business represents the business process in the e-commerce order generation process; S4, construct an order encryption node sequence according to the business coverage information; the received e-commerce The order item information contained in the service order is associated with the constructed order encryption node sequence according to a preset association order; S5, sensitivity analysis is performed on the received e-commerce order, and the e-commerce order is divided into three sensitivity levels: high, medium and low; different encryption algorithms are assigned to each sensitivity level; according to the sensitivity analysis results, the order basic information of different sensitivity levels in the received e-commerce order is encrypted; S6, in the order encryption node sequence constructed in S4, according to the order encryption component selected in S2, the target order encryption node is determined; the order item information associated with the encryption node sequence in S4 is encrypted using the encryption algorithm and key corresponding to the target order encryption node; S7, the order basic information encrypted by S5 and the order item information encrypted by S6 are stored in the database; when a user requests to access the e-commerce order, the corresponding decryption method is selected according to the requested data sensitivity level and user authority, the stored encrypted order data is decrypted, and the decrypted order data is returned to the user.

[0046] The server receives the e-commerce order data generated and transmitted by the e-commerce terminal through the communication interface between the e-commerce terminal and the server. The e-commerce terminal can be a server of an e-commerce website, a mobile application or other types of client devices. After receiving the e-commerce order, the server parses and extracts the order data to obtain the basic information and item information of the order. The basic order information includes the order ID that uniquely identifies the order and the total amount of the order. The order ID can be a globally unique string or digital sequence generated by the e-commerce terminal, which is used to identify and track the life cycle of the entire order. The order amount represents the total transaction amount of the entire order, usually expressed in monetary units.

[0047] The order item information includes detailed information about each commodity or service that makes up the order. Each order item has a unique commodity ID that is used to identify the commodity or service. The commodity name indicates the name or description information of the commodity or service. The quantity indicates the quantity of the commodity or service purchased in the order. The amount indicates the transaction amount of the commodity or service, that is, the result of multiplying the unit price by the quantity. On the basis of extracting the order information, the server further extracts the characteristic information of the order, including the order amount and the commodity type. The order amount feature can be directly obtained from the basic order information. The commodity type feature indicates the category or type to which the commodity or service included in the order belongs. In order to obtain the commodity type feature, the server can maintain a predefined commodity type mapping table to map the commodity ID to the corresponding type label. For example, the commodity with the commodity ID "A001" can be mapped to the "electronic product" type, and the commodity with the commodity ID "B002" can be mapped to the "clothing" type.

[0048] When extracting order features, the server can use a variety of data processing and feature engineering techniques. For example, the order amount can be normalized and the amount value can be mapped to the interval [0, 1] to eliminate the influence of the amount size. For the product type feature, the one-hot encoding method can be used to convert the type label into a binary vector representation. Each dimension corresponds to a product type and takes a value of 0 or 1, indicating whether the order contains this type of product. The extracted order features can be used for subsequent order encryption component selection, order sensitivity analysis and other links to provide necessary input information for intelligent processing of orders. At the same time, the extracted order basic information and project information will also be used in the subsequent encryption and storage process to ensure the integrity and traceability of the order data.

[0049] Figure 2This is an exemplary flow chart for obtaining encrypted order data according to some embodiments of this specification. The server uses a machine learning algorithm to implement intelligent order encryption component selection. Based on historical order data, the server analyzes the association pattern between order features and encryption component selection, and constructs a mapping model between order features and encryption component selection. Specifically, the server obtains a large number of historical order samples from the historical order database, each sample containing feature information of the order (such as order amount, product type, etc.) and encryption component information actually used by the order (including encryption algorithm and key). The server uses these historical order samples as training data and uses a supervised learning algorithm to train the mapping model.

[0050] The mapping model can be implemented using a variety of machine learning algorithms, such as logistic regression, decision tree, random forest, support vector machine, etc. Taking logistic regression as an example, the model uses order features as input features and encryption component selection results as binary output labels (0 or 1, indicating whether the encryption component is selected). By minimizing the loss function (such as cross entropy loss), the model learns the association between order features and encryption component selection and generates a set of model parameters. After training, the server can use the trained mapping model to predict the encryption component selection for new orders. For each newly received e-commerce order, the server first extracts its order features and then inputs the features into the mapping model. The model calculates the probability of each encryption component being selected based on the input order features.

[0051] In addition to order characteristics, the server also considers the current system load. System load can be measured by monitoring CPU occupancy, memory usage, network bandwidth and other indicators. The server uses the system load indicators together with the order characteristics as the input of the mapping model so that the model can dynamically adjust the encryption component selection strategy according to the real-time status of the system. Based on the prediction results of the mapping model and the system load information, the server selects the encryption component with the highest probability from the preset encryption component pool as the encryption component for the order. The encryption component pool is a predefined collection containing multiple encryption algorithms (such as AES, RSA, ChaCha20, etc.) and keys of different lengths (such as 128 bits, 256 bits, etc.). The server pre-configures these encryption components for selection based on security requirements and performance considerations. After the encryption component is selected, the server uses the encryption component to encrypt the received e-commerce order. The server encrypts the sensitive information of the order (such as order amount, product information, etc.) according to the encryption algorithm and key to generate encrypted order data. The encrypted order data can be securely stored and transmitted to prevent unauthorized access and tampering.

[0052] The mapping model adopts the structure of a multi-layer perceptron (MLP), which learns the nonlinear relationship between order features and encryption component selection through the combination of input layer, hidden layer and output layer. The input layer receives order features as input to the model. Order features can be a vector of fixed length, containing various attributes of the order, such as order amount, product type, etc. The number of neurons in the input layer is consistent with the dimension of the order features, and each neuron receives a feature value.

[0053] The hidden layer adopts a multi-layer perceptron structure, which consists of one or more fully connected layers. Each hidden layer contains multiple neurons, which convert the output of the previous layer into the input of the current layer through the weight matrix and bias vector. The hidden layer uses the ReLU (Rectified Linear Unit) activation function to perform nonlinear transformation on the input of the neuron. The mathematical expression of the ReLU function is: f(x) = max(0, x), that is, negative input is mapped to 0, and positive input remains unchanged. The ReLU function introduces nonlinear characteristics, which enables the model to learn the complex nonlinear relationship between order characteristics and encryption component selection.

[0054] The output layer is used to output the selection probability of each encryption component. The number of neurons in the output layer is consistent with the number of encryption components, and each neuron corresponds to one encryption component. The output layer uses the Softmax function to normalize the output of the neuron and convert it into a probability distribution.

[0055] During the model training process, we first use historical order data to construct a training sample set. Each training sample contains order features as input and the encryption components actually used in the corresponding order as labels. The training sample set is used to train the mapping model so that it learns the relationship between order features and encryption component selection. In order to train the mapping model, an improved Focal Loss function is used as the loss function. The Focal Loss function is a loss function used to deal with class imbalance problems. By introducing modulation factors and balance factors, the loss weights of easy-to-classify samples and difficult-to-classify samples are adjusted to increase the model's attention to minority class samples. In the Focal Loss function,

[0056]

[0057] Mini-batch gradient descent method is used to train the mapping model. Mini-batch gradient descent is a commonly used training method that divides the training sample set into multiple small batches (batches). Only one batch of samples is used for gradient calculation and parameter update each time training, instead of using the entire training set. This can reduce memory usage, speed up training, and improve the generalization ability of the model to a certain extent. The training sample set is randomly divided into multiple batches, each batch contains a fixed number of samples (such as 32, 64, or 128 samples). Initialize the parameters of the mapping model, including the weight matrix and bias vector of each layer. Randomly initialized or pre-trained parameters can be used as initial values.

[0058] Start training iterations, and each iteration follows the following steps: Randomly select a batch of samples from the training sample set as the input of the current iteration. Input the samples of the current batch into the mapping model, and calculate the predicted output of the model through forward propagation. The predicted output selects the probability distribution of the encryption component corresponding to each sample. Calculate the Focal Loss value of the current batch based on the predicted output and the actual label. For each sample, use the actually selected encryption component as the target category and calculate its corresponding Focal Loss. Then average the Focal Loss of all samples in the batch to get the average Focal Loss value of the current batch. Calculate the gradient of the model parameters based on the average Focal Loss value. Use the backpropagation algorithm to pass the gradient of the loss value back to each layer of the model and calculate the gradient value of each parameter. Use the gradient descent algorithm to update the model parameters. Commonly used gradient descent algorithms include stochastic gradient descent (SGD), AdaGrad, RMSprop, and Adam. Taking the Adam optimizer as an example, it adaptively adjusts the learning rate of each parameter based on the first-order moment estimate and second-order moment estimate of the gradient to accelerate the convergence process. Repeat until all batches are traversed. After completing one iteration, the validation set is used to evaluate the performance of the model. The validation set is a sample set independent of the training set, which is used to evaluate the generalization ability of the model. The samples of the validation set are input into the model to calculate the prediction accuracy or other evaluation indicators of the model. If the performance of the model on the validation set has not reached the expected goal, the next iteration is started. If the model performance has met the requirements or reached a certain number of iterations, the training process is stopped. After the training is completed, the final performance of the model is evaluated using the test set. The test set is another independent sample set used to evaluate the performance of the model on unknown data. The samples of the test set are input into the model to calculate the prediction accuracy, precision, recall and other evaluation indicators of the model. Through multiple iterations of training, the parameters of the mapping model are continuously updated, and the loss function is gradually minimized, so that the prediction results of the model are as close as possible to the actual encryption component selection results. The Mini-batch gradient descent method reduces memory usage and computational complexity by processing training samples in batches, thereby improving training efficiency. At the same time, using a gradient descent algorithm with an adaptive learning rate such as the Adam optimizer can accelerate the convergence process and find the optimal model parameters more quickly. After sufficient training and verification, the mapping model is able to learn the complex relationship between order characteristics and encryption component selection, and make reasonable encryption component selection predictions on new orders to achieve an adaptive order encryption strategy.

[0059] Figure 3This is an exemplary flowchart for obtaining an order item feature sequence according to some embodiments of this specification. A directed acyclic graph (DAG) is constructed based on the business coverage information, and the nodes in the graph are used as order encryption nodes. The order encryption node sequence is generated by traversing the DAG, and finally the order item information is matched with the order encryption node sequence, and the order item features are normalized and locally sensitive hash mapped. The business coverage information is analyzed to determine all target businesses to be accessed, and each target business represents a node in the DAG. The dependencies between businesses are analyzed. If business A depends on business B, a directed edge is added between node B and node A, indicating that the access order is from B to A. Repeat the above steps until all dependencies between businesses are represented as directed edges and a complete DAG is constructed.

[0060] Traverse each node in the DAG and treat it as an order encryption node. Assign a unique node ID to each order encryption node as the target business ID to identify the specific business corresponding to the node. Record the access timestamp of each order encryption node to indicate the access time of the business. Topologically sort the DAG to obtain the access order of the nodes. According to the result of the topological sorting, add the order encryption nodes to the order encryption node sequence in sequence to form an ordered node sequence. The order of nodes in the order encryption node sequence indicates the access order of the business, that is, the order of dependency. Obtain the order item information, including attributes such as product ID, name, quantity, amount, and generation timestamp. Traverse each node in the order encryption node sequence and compare the generation timestamp of the order item with the access timestamp of the node. Associate the order item to the nearest order encryption node, that is, the node whose generation timestamp is closest to the access timestamp. Repeat the above steps until all order items are associated with the corresponding order encryption node. For each order encryption node, obtain all order item information associated with it. The associated order item information is formed into a subset, which includes attributes such as product ID, name, quantity, and amount. For each subset of order item information associated with the encrypted order node, extract the quantity and amount attributes.

[0061] The quantity and amount are normalized to their maximum and minimum values, respectively, and mapped to the interval [0, 1]. The normalization formula is: Normalized value = (original value - minimum value) / (maximum value - minimum value). Normalization eliminates the dimensionality of quantity and amount, making the features of different order items comparable.

[0062] The normalized order item features are hash mapped using the local sensitive hashing algorithm (LSH) to map the high-dimensional feature space to the low-dimensional hash space, thereby improving the retrieval efficiency of similar features. Determine the type of hash function, commonly used ones include Min Hash, Sim Hash, etc. In this embodiment, Min Hash is selected as the hash function. Determine the number of hash functions, that is, the length of the generated hash signature. The more hash functions there are, the smaller the probability of hash collision, but the higher the computational cost. In this embodiment, 100 hash functions are selected for use. Determine the number of hash tables, that is, the number of substrings into which the hash signature is divided. The more hash tables there are, the higher the retrieval efficiency, but the greater the memory consumption. In this embodiment, 5 hash tables are selected for use. For the normalized order item features associated with each order encryption node, extract its feature vector. Apply the Min Hash hash function to the feature vector to generate a hash signature with a length of 100.

[0063] The calculation process of the Min Hash hash function is as follows: Initialize a hash signature vector of length 100, and the initial value of each element is positive infinity. For each non-zero element in the feature vector, calculate its hash value. For the i-th hash function, update the i-th element of the hash signature vector to the minimum value of the hash value of the current element and the original value. Repeat the above steps until all non-zero elements in the feature vector are traversed. Obtain a hash signature vector of length 100 as the hash representation of the order item feature. Divide the hash signature vector of length 100 into 5 substrings of length 20. For each substring, build a hash table with the substring as the key and the corresponding order item feature as the value. The construction process of the hash table is as follows: Initialize an empty hash table. For the hash signature of each order item feature, extract the corresponding substring as the key. Insert the order item feature into the hash table with the substring as the key. Repeat the above steps until all order item features are inserted into the corresponding hash table. Given a query order item feature, normalize it to obtain the normalized query feature. Apply the same Min Hash hash function to the query feature to generate a hash signature of length 100. Split the hash signature of the query feature into 5 substrings and search them in the corresponding hash table respectively. For each substring, find the same key in the corresponding hash table to obtain the corresponding order item feature. Merge the retrieved order item features to obtain a candidate set similar to the query feature. Calculate the similarity between the order item features in the candidate set and the query feature, and select the one with the highest similarity as the final retrieval result.

[0064] The hash value obtained by the LSH algorithm is binary-encoded using the CRC algorithm. The generator polynomial P(x) of the CRC algorithm is constructed, and the number of bits of the check code is set to 32 bits, and the initial value R_init is 0xFFFFFFFF. The hash value H obtained by the LSH algorithm is padded with zeros so that the length of the padded hash value H_padded is an integer multiple of 32. The padded hash value is grouped according to 32 bits to obtain multiple hash blocks. Each hash block is XORed with the initial value R_init to obtain the initial CRC register value R0. Iteratively calculate each bit of each hash block to update the CRC register value. The specific steps are as follows: Shift the current CRC register value left by 1 bit and record it as R_temp. Determine whether the highest bit shifted out is 1: If it is 1, XOR R_temp with the generator polynomial P(x) to obtain the updated CRC register value R_new. If it is 0, directly use R_temp as the updated CRC register value R_new. Use R_new as the CRC register value for the next iteration. Repeat until all bits of the hash block are shifted out to obtain the final CRC register value as the local check code of the corresponding hash block. Perform bitwise XOR operation on the local check codes of each hash block to obtain the global check code of the entire hash value as the result of CRC encoding. Concatenate the global check code with the hash value to obtain the CRC-encoded feature vector.

[0065] Traverse each node in the order encryption node sequence. For the current node, obtain all the order items associated with it. For each order item, extract its corresponding feature vector. Store the extracted feature vectors in a list as the order item feature vector set of the current node. For the order item feature vector set of each order encryption node, sort according to the preset association rule. In this embodiment, the association rule is to sort in descending order according to the amount of the order item. The specific implementation can use quick sort or other efficient sorting algorithms, with the amount as the sorting keyword. In the sorted feature vector set, the order of the feature vectors is the order from large to small of the order item amount. For each order encryption node, obtain its sorted feature vector set. According to the order of the feature vectors in the set, splice them in turn to form a feature sequence with a length of the number of feature vectors. The splicing method can be simple string splicing or other appropriate methods to ensure that the order of the feature vectors in the feature sequence is consistent with the sorted order. The generated feature sequence represents the feature representation of the current order encryption node, which contains the sequence of the order item feature vectors associated with the node sorted according to the amount. According to the order of the order encryption node in the order encryption node sequence, traverse each node in turn. For each node, obtain its generated feature sequence. Store the obtained feature sequence in a list, keeping the order of the nodes unchanged. For the list storing the feature sequence, splice them in sequence according to the order of the feature sequences in the list. The splicing method can be simple string splicing or other appropriate methods to ensure that the order of the feature sequences in the spliced ​​sequence is consistent with the order of the nodes in the order encryption node sequence. The generated complete order item feature sequence represents the feature representation of the entire order, which contains the result of splicing the feature sequences of all order encryption nodes in the order of the nodes.

[0066] Conduct sensitivity analysis on received e-commerce orders, classify orders into three sensitivity levels: high, medium, and low, and assign different encryption algorithms to each level. Encrypt basic order information of different sensitivity levels based on the sensitivity analysis results. Receive pending order data from an e-commerce platform or system. Order data includes basic information such as order number, user information, product information, amount, and delivery address. Analyze and evaluate order data based on predefined sensitivity rules. Sensitivity rules can be defined based on business needs and data security requirements. For example, orders with an order amount exceeding a certain threshold are considered high-sensitivity orders. Orders containing sensitive user information (such as ID card number, bank card number, etc.) are considered high-sensitivity orders. Orders with ordinary order amounts and user information that do not trigger high-sensitivity rules are considered medium-sensitivity orders. Orders that do not contain sensitive information and have a low amount are considered low-sensitivity orders. Evaluate each order based on the sensitivity rules to determine its sensitivity level. Assign appropriate encryption algorithms to each level based on the sensitivity level. High-sensitivity data is encrypted using the AES-256 algorithm to provide the highest level of security protection. Medium-sensitivity data is encrypted using the AES-128 algorithm, providing a higher level of security protection. Low-sensitivity data is encrypted using the ChaCha20 algorithm, providing basic security protection. According to the sensitivity level of the order, select the corresponding encryption algorithm to encrypt the basic order information.

[0067] For high-sensitivity orders: Use the AES-256 algorithm to encrypt sensitive fields of the order, such as user information, delivery address, etc. The encryption process requires the use of a secure key management mechanism to ensure the confidentiality and integrity of the key. The encrypted data replaces the original sensitive fields to form the encrypted order data. For medium-sensitivity orders: Use the AES-128 algorithm to encrypt sensitive fields of the order, such as user information, delivery address, etc. The encryption process requires the use of a secure key management mechanism to ensure the confidentiality and integrity of the key. The encrypted data replaces the original sensitive fields to form the encrypted order data.

[0068] For low-sensitivity orders: Use the ChaCha20 algorithm to encrypt sensitive fields of the order, such as user information, delivery address, etc. The encryption process requires the use of a secure key management mechanism to ensure the confidentiality and integrity of the key. The encrypted data replaces the original sensitive fields to form encrypted order data. Store the encrypted order data in a secure database or storage system. Ensure the security of the storage environment to prevent unauthorized access and data leakage.

[0069] According to the selected order encryption component, the target order encryption node is determined in the order encryption node sequence, and the encryption algorithm and key corresponding to the node are used to encrypt the order item information associated with the encryption node sequence. The encrypted order basic information and order item information are then stored in the database. When a user request to access an e-commerce order is received, the corresponding decryption method is selected to decrypt the stored encrypted order data according to the requested data sensitivity level and user authority, and the decrypted order data is returned to the user.

[0070] In the order encryption node sequence, according to the order encryption component selected in step S2, the target order encryption node is determined, and the order item information is encrypted. According to the order encryption component selected in step S2, the corresponding order encryption node is searched in the order encryption node sequence. The found order encryption node is determined as the target order encryption node. The encryption algorithm and key associated with the target order encryption node are obtained. The order item information associated with the encryption node sequence is encrypted: sensitive fields in the order item information are extracted, such as product name, quantity, unit price, etc. The sensitive fields are encrypted using the encryption algorithm and key corresponding to the target order encryption node. The encrypted data replaces the original sensitive fields to form the encrypted order item information. The encrypted order basic information and order item information are stored in the database, and decrypted and returned according to the user request. The order basic information encrypted in step S5 and the order item information encrypted in step S6 are stored in the database together. Establish an association between the order basic information and the order item information to ensure that they can be correctly matched and retrieved.

[0071] When receiving a user request to access an e-commerce order: Verify the user's identity and permissions to ensure that they have access to the requested order data. Select the corresponding decryption method based on the requested data sensitivity level and user permissions. Retrieve the requested encrypted order data from the database, including the order basic information and the associated order item information. Decrypt the retrieved encrypted order data: Select the corresponding decryption algorithm and key for decryption based on the sensitivity level of the order basic information. Select the corresponding decryption algorithm and key for decryption based on the order encryption node associated with the order item information. Concatenate and assemble the decrypted order basic information and order item information to form complete order data. Return the decrypted order data to the user for review and processing.

Claims

1. An e-commerce data processing method, applied to a server, the server being communicatively connected with a plurality of e-commerce terminals, comprising: S1, receiving an e-commerce order generated by an e-commerce terminal and extracting order features; wherein the e-commerce order includes basic order information and order item information; the basic order information includes order ID and amount; the order item information includes product ID, name, quantity and amount; the order features include order amount and product type; S2, using machine learning algorithms, selects order encryption components from a preset encryption component pool based on historical order data patterns, current system load, and extracted order features; S3, obtaining the business coverage information of the e-commerce order during the generation process, where the business coverage information includes the target business accessed during the order generation process; the target business represents the business process during the e-commerce order generation process; S4, constructing an order encryption node sequence according to the business coverage information; associating the order item information contained in the received e-commerce order with the constructed order encryption node sequence according to a preset association order; S5, performing sensitivity analysis on the received e-commerce orders, and classifying the e-commerce orders into three sensitivity levels: high, medium, and low; assigning a different encryption algorithm to each sensitivity level; and encrypting order basic information of different sensitivity levels in the received e-commerce orders according to the sensitivity analysis results; S6, in the order encryption node sequence constructed in S4, according to the order encryption component selected in S2, determines the target order encryption node; uses the encryption algorithm and key corresponding to the target order encryption node to encrypt the order item information associated with the encryption node sequence in S4; S7, stores the order basic information encrypted by S5 and the order item information encrypted by S6 in the database; when a user requests to access an e-commerce order, a corresponding decryption method is selected according to the data sensitivity level of the request and the user's authority, the stored encrypted order data is decrypted, and the decrypted order data is returned to the user.

2. The electronic commerce data processing method according to claim 1, characterized in that: S2, using machine learning algorithms, selects order encryption components from a preset encryption component pool based on historical order data patterns, current system load, and extracted order features, including: Based on historical order data, a mapping model between order features and encryption component selection is constructed; wherein the mapping model takes order features as input and encryption component selection results as output; Using the constructed mapping model, the probability of selecting each encryption component is predicted according to the current order characteristics and system load; According to the prediction results, the encryption component with the highest probability is selected from the preset encryption component pool as the order encryption component; wherein the encryption component includes an encryption algorithm and a key; the encryption component pool includes multiple encryption algorithms and keys of different lengths; The received e-commerce order is encrypted using the selected order encryption component to obtain encrypted order data.

3. The electronic commerce data processing method according to claim 2, characterized in that: Mapping model, including: Input layer, receiving order features; The hidden layer uses a multi-layer perceptron structure to learn the nonlinear relationship between order features and encryption component selection through training; the activation function of the hidden layer uses the ReLU function to introduce nonlinear transformation; The output layer is used to output the selection probability of each encryption component. The number of neurons in the output layer is consistent with the number of encryption components. The Softmax function is used to perform weighted summation on the selection probability of each encryption component and output the weighted probability distribution. The training process of the mapping model includes: Use historical order data to build a training sample set, each sample contains order features and corresponding encryption component selection results; The improved Focal Loss function is used as the loss function to measure the difference between the model prediction results and the actual results; The Mini-batch gradient descent method is used to input the training sample set into the mapping model in batches; the loss function value of each batch is calculated, and the gradient of the mapping model parameters is calculated based on the loss function value. The mapping model parameters are updated using the gradient descent algorithm to minimize the loss function.

4. The electronic commerce data processing method according to claim 3, characterized in that: The improved Focal Loss function expression is as follows: Among them, p t Represents the probability value of the target category predicted by the model; f(p t ,β,δ) is the probability scaling function used to adjust p t Perform nonlinear transformation and scale it to the interval [0, 1]; β is the scaling control parameter, which is used to adjust the shape and range of the scaling function; δ is the scaling offset parameter, which is used to control the offset of the scaling function; γ is the modulation coefficient, which is used to adjust the difference in loss weights between easy-to-classify samples and difficult-to-classify samples; h(p t ,μ,σ) is the dynamic adjustment function of the modulation coefficient, which dynamically adjusts the value of γ according to the predicted probability of the sample; μ is the mean of the predicted probability, σ is the standard deviation of the predicted probability; a t is a balancing factor used to balance the importance of samples of different categories; when the sample belongs to the target category, a t =a, otherwise a t =1-a; α is the weight of the target category; g(p t ,λ,η) is the probability logarithm function, which is used to calculate p t A logarithmic transformation is performed to map the probability value to the logarithmic space to make the loss function smoother; λ is the control parameter of the logarithmic transformation, which is used to adjust the strength of the logarithmic transformation; η is the offset parameter of the logarithmic transformation, which is used to control the offset of the logarithmic transformation; w(t) is the time decay function, which is used to gradually reduce the weight of the loss as the number of training rounds increases.

5. The electronic commerce data processing method according to claim 4, characterized in that: The probability scaling function f(p t ,β,δ) is: Where k is the scaling factor, which controls the steepness of the scaling; The dynamic adjustment function of the modulation coefficient h(p t ,μ,σ) is: Where c is the offset constant, which is used to control the value range of the modulation coefficient; The probability logarithm function g(p t ,λ,η) is: Among them, ε is the smoothing coefficient to prevent the logarithm from being zero; The expression of the time decay function w(t) is: Where t is the current training round number, t0 is the decay starting round number, and s is the decay rate control parameter.

6. The electronic commerce data processing method according to claim 1, characterized in that: S4, constructing an order encryption node sequence according to the business coverage information, including: According to the business coverage information, obtain the target business to be visited and build a directed acyclic graph; Each node in the constructed directed acyclic graph is used as an order encryption node, and the node attributes include the target business ID and access timestamp; According to the directed edges in the constructed directed acyclic graph, the association order between the order encryption nodes is determined, and the order encryption node sequence is constructed; Match the order item information with the order encryption node sequence, and associate the order item information with the corresponding order encryption node according to the generation timestamp of the order item.

7. The electronic commerce data processing method according to claim 6, characterized in that: The order item information contained in the received e-commerce order is associated with the constructed order encryption node sequence according to a preset association order, including: Traverse each order encryption node in the order encryption node sequence, and obtain the order item information subset associated with the current node, the subset including the product ID, name, quantity and amount; Normalizing the quantity and amount of the associated order item information subset to obtain normalized order item features; The local sensitive hashing algorithm LSH is used to perform hash mapping on the normalized order item features; The obtained hash value is binary-encoded using a cyclic redundancy check (CRC) algorithm to obtain a feature vector of the order item; According to the preset association rules, the feature vectors of the obtained order items are sorted and concatenated to generate the feature sequence of the current order encryption node; The feature sequence of each order encryption node is concatenated according to the order of the nodes in the order encryption node sequence to generate a complete order item feature sequence; Among them, the preset association rule includes sorting in descending order according to the amount of the order items.

8. The electronic commerce data processing method according to claim 7, characterized in that: The obtained hash value is binary-encoded using the cyclic redundancy check CRC algorithm to obtain the feature vector of the order item, including: Construct the generator polynomial P(x) of the CRC algorithm and set the number of bits of the check code and the initial value R init ; Among them, the initial value R init is 0xFFFFFFFF; The hash value H obtained by the LSH algorithm is zero-filled so that the filled hash value H padded The length of the filled hash value H padded Group by 32 bits to obtain multiple hash blocks; Hash block H i All bits are equal to the initial value R init Perform XOR operation to obtain the initial CRC register value R0; Set the register value R j-1 Shift left 1 bit to get the middle CRC register value R jtemp ; Among them, R j-1 Indicates the CRC register value obtained in the previous iteration, R jtemp Indicates the intermediate result after shifting left by 1 bit; Determine whether the highest bit shifted out is 1. If it is 1, the middle CRC register value R jtemp Perform XOR operation with the generating polynomial P(x) to obtain the updated CRC register value R j ; If it is 0, the intermediate CRC register value R jtemp As the updated CRC register value R j ; Repeat the above steps until the hash block H i All bits of are shifted out to obtain the final CRC register value R32, which is used as the local check code C of the corresponding hash block. i ; The local checksum of each hash block {C i } Perform bitwise XOR operation to obtain the global check code C of the entire hash value H global , as the result of CRC encoding; The global check code C global Concatenate with the hash value H to get the CRC-encoded feature vector V crc .

9. The electronic commerce data processing method according to claim 8, characterized in that: According to the sensitivity analysis results, the basic order information of different sensitivity levels in the received e-commerce orders is encrypted, including: Highly sensitive data is encrypted using the AES-256 algorithm; Medium-sensitivity data is encrypted using the AESS-128 algorithm; Low-sensitivity data is encrypted using the ChaCha20 algorithm.

10. The electronic commerce data processing method according to claim 9, characterized in that: When using the AES-256 algorithm to encrypt highly sensitive data, encryption is performed using a dynamically generated key, with a separate key for each order; When using the AESS-128 algorithm to encrypt medium-sensitivity data, it is encrypted using the order-level key, and the medium-sensitivity data of the same order uses the same key; When the ChaCha20 algorithm is used to encrypt low-sensitivity data, encryption is performed using a session-level key, and the same key is used for low-sensitivity data within the same session.

Citation Information

Cited By

  • Data hierarchical encryption method and device, equipment and medium

    CN119720238A

  • A data hierarchical encryption method, device, equipment and medium

    CN119720238B

  • Communication method and device and electronic equipment

    CN119814851A

  • File management system and method based on cloud storage

    CN120257350A

  • Hydrological data encryption transmission method and system

    CN121887546A