A transaction data generation method and apparatus
Patent Information
- Application Number
- CN202511264321.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2045-09-04
AI Technical Summary
[0004]本申请提供了一种交易数据生成方法和装置,用以解决现有技术生成的交易数据准确性较差的问题
[0010]考虑到现有技术中的数据生成方法生成的数据无法满足金融消费数据生成的要求,本申请提出了一种基于Levy分布反向去噪模型和多项式分布反向去噪模型的交易数据生成方法。具体的,随机生成多项式分布噪声和Levy分布噪声之后;基于Levy分布反向去噪模型,对Levy分布噪声进行反向去噪,对反向去噪得到的第一数据进行标准化逆变换,生成Levy分布的交易数据;基于多项式分布反向去噪模型,对多项式分布噪声进行反向去噪,对反向去噪得到的第二数据进行独热编码逆变换,生成多项式分布的交易数据。本申请所提出的Levy分布反向去噪模型,采用更加符合金融数据长尾分布特点的Levy分布函数对数值型、日期型和时间型数据进行建模,有助于捕获长尾分布数据的更加完整特点,特别是对尾部数据样本建模的能力,有助于提升金融数据生成场景下,生成更加符合真实数据分布的样本,提升合成数据的实际可用性。从而实现了一种准确的交易数据生成方法。
Smart Images

Figure CN121301916B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method and apparatus for generating structured transaction data. Background Technology
[0002] In the field of data processing technology, generating transaction data that conforms to the characteristics of real data distribution and does not reveal the true data is of great significance. Existing technologies for generating structured transaction data mainly fall into two categories: The first uses Generative Adversarial Networks (GANs), where a generator and a discriminator are trained adversarially. The generator learns the latent distribution of real tabular data and generates synthetic samples, while the discriminator distinguishes between generated and real data, ultimately making the generated data approximate the real distribution. Typical examples of this type of research include models such as CTGAN. The second approach uses diffusion models, which gradually add noise to disrupt the original data distribution through a forward process, then train the neural network to learn the inverse denoising process, ultimately iteratively reconstructing structured tabular data that conforms to the real distribution from random noise.
[0003] GAN models generally suffer from pattern collapse, leading to insufficient diversity in generated data. Their poor training stability causes deviations in convergence states during each training iteration, resulting in inconsistent data distribution. Furthermore, GAN models have limited ability to handle high-dimensional data, producing low-quality data. Diffusion models address these shortcomings, offering more stable training, greater data diversity, and better handling of mixed-type data. However, existing diffusion model-based methods (FinDiff, TabDiff, etc.) fail to consider the peaked, heavy-tailed characteristics of tabular data in real-world applications, particularly in financial and consumer data and transaction data, which exhibit significant long-tailed distributions. This makes it difficult for existing models to generate long-tailed data with limited sample sizes. Therefore, current data generation methods cannot meet the requirements for generating financial and consumer data. Developing an accurate data generation method for financial and consumer data is a pressing technical problem that needs to be solved. Summary of the Invention
[0004] This application provides a method and apparatus for generating transaction data to solve the problem of poor accuracy of transaction data generated by existing technologies.
[0005] Firstly, this application provides a method for generating transaction data, the method comprising:
[0006] Randomly generated multinomial and Levy distribution noise;
[0007] Based on the pre-trained Levy distribution inverse denoising model, the Levy distribution noise is inversely denoised, and the first data obtained by inverse denoising is subjected to inverse standardization transformation to generate Levy distribution transaction data. The Levy distribution transaction data includes at least one of the following: numerical field data, date field data, and time field data.
[0008] Based on a pre-trained multinomial distribution inverse denoising model, inverse denoising is performed on the multinomial distribution noise, and one-hot encoding inverse transformation is performed on the second data obtained by inverse denoising to generate multinomial distribution transaction data, wherein the multinomial distribution transaction data includes at least one of Boolean field data and enumerated field data.
[0009] The above technical solution has the following advantages or beneficial effects:
[0010] Considering that existing data generation methods cannot meet the requirements for generating financial consumer data, this application proposes a transaction data generation method based on a Levy distribution inverse denoising model and a multinomial distribution inverse denoising model. Specifically, after randomly generating multinomial and Levy distribution noise, the Levy distribution noise is inversely denoised using the Levy distribution inverse denoising model. The first data obtained from inverse denoising is then subjected to inverse standardization transformation to generate Levy distribution transaction data. Similarly, the multinomial distribution noise is inversely denoised using the multinomial distribution inverse denoising model. The second data obtained from inverse denoising is then subjected to one-hot encoding inverse transformation to generate multinomial distribution transaction data. The proposed Levy distribution inverse denoising model uses a Levy distribution function that better reflects the long-tail distribution characteristics of financial data to model numerical, date, and time-based data. This helps capture more complete characteristics of long-tail distribution data, especially its ability to model tail data samples. This improves the generation of samples that more closely match the real data distribution in financial data generation scenarios, enhancing the practical usability of synthesized data. Thus, an accurate transaction data generation method is achieved.
[0011] Secondly, this application provides a transaction data generation apparatus, the apparatus comprising:
[0012] The first generation module is used to randomly generate multinomial distribution noise and Levy distribution noise;
[0013] The second generation module is used to perform inverse denoising on the Levy distribution noise based on a pre-trained Levy distribution inverse denoising model, and to perform inverse normalization transformation on the first data obtained by inverse denoising to generate Levy distribution transaction data, wherein the Levy distribution transaction data includes at least one of numerical field data, date field data and time field data.
[0014] The third generation module is used to perform inverse denoising on the multinomial distribution noise based on a pre-trained multinomial distribution inverse denoising model, and to perform one-hot encoding inverse transformation on the second data obtained by inverse denoising to generate multinomial distribution transaction data, wherein the multinomial distribution transaction data includes at least one of Boolean field data and enumerated field data.
[0015] Thirdly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0016] Memory, used to store computer programs;
[0017] A processor, used to execute a program stored in memory, implements the method described.
[0018] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described herein.
[0019] Fifthly, this application provides a computer program product comprising an executable program that is executed by a processor to implement the method described. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A schematic diagram illustrating the transaction data generation process provided in this application;
[0022] Figure 2 A schematic diagram illustrating the process of pre-training the Levy distribution inverse denoising model and the multinomial distribution inverse denoising model provided in this application;
[0023] Figure 3 A flowchart illustrating the Levy distribution-enhanced structured transaction data generation method provided in this application;
[0024] Figure 4 A schematic diagram of the transaction data generation device provided in this application;
[0025] Figure 5 A schematic diagram of the electronic device structure provided in this application. Detailed Implementation
[0026] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.
[0027] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0028] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0029] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0030] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0032] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
[0033] In the process of conducting data business cooperation, it is necessary to provide modeling experimental data to facilitate model building and data product exploration. To generate modeling experimental data that better reflects the characteristics of real data distribution and does not leak real data, this application proposes a Levy distribution-enhanced structured transaction data generation method, based on research into the latest algorithm models. Testing and verification show that the data generated based on this method better reflects the actual data distribution, and the downstream task models trained using the generated data achieve results closer to those of real data.
[0034] Data generation methods based on diffusion models in related technologies do not take into account the characteristics of peaked and heavy-tailed data in real-world applications, especially since financial and consumer data have a distinct long-tailed distribution, making it difficult for existing models to generate long-tailed data with a small sample size.
[0035] Leptokurtosis: Data clusters around the mean to a degree far greater than a normal distribution (kurtosis coefficient > 3, while the kurtosis of a normal distribution is 3). For example, daily stock returns are often concentrated in the "reasonable range" of -1% to 1%, but this "concentration" is not stable and can amplify the impact of extreme events—when market consensus breaks down, concentrated positions can trigger a collective sell-off or buy-off, leading to a price crash / boom.
[0036] Fat Tail: The probability density at the tail of the data (extreme value range) is much higher than that of a normal distribution (e.g., the probability of returns <-5% or >5%). In a normal distribution, the probability of extreme events "beyond 3 standard deviations" is about 0.27%, but in financial data, this probability can be as high as 5% or more (e.g., during the 2008 subprime mortgage crisis, the S&P 500 index fell by 16% in a single month, far exceeding the expectation of a normal distribution).
[0037] This application improves upon the existing TabDiff model by: (1) optimizing the Gaussian noise modeling numerical features in the TabDiff model into a Levy-distributed noise model that better reflects the long-tail distribution characteristics of financial data, thus forming a Levy-Enhanced Diffusion Model, which can generate structured data that better reflects the distribution characteristics of long-tailed data. (2) The design of the noise scheduling hyperparameters in the Levy-Enhanced Diffusion Model is crucial and affects the final generated data. Therefore, this application proposes an exponential scheduling strategy to assist in the design of the noise scheduling hyperparameters.
[0038] The Levy distribution is a heavy-tailed, stable, continuous probability distribution proposed by the French mathematician Paul Lévy. It is a core special case of the stable distribution (characteristic exponent α = 1 / 2, skewness parameter β = 1). Its core value lies in describing real-world phenomena with frequent extreme events (such as financial collapses and natural disasters), and it is widely used in many fields due to its "heavy-tailedness" and "stability".
[0039] The Levy-Enhanced Diffusion Model proposed in this application uses a Levy distribution function that better reflects the long-tail distribution characteristics of financial data to model numerical data. This helps to capture more complete characteristics of long-tail data, especially the ability to model tail data samples. It helps to improve the generation of samples that are more consistent with the real data distribution in financial data generation scenarios, enhance the actual usability of synthetic data, and support the exploration of data business.
[0040] The process of generating the transaction data provided in this application is described in detail below.
[0041] Figure 1 The transaction data generation process diagram provided for this application includes the following steps:
[0042] S101: Randomly generated multinomial distribution noise and Levy distribution noise;
[0043] S102: Based on the pre-trained Levy distribution inverse denoising model, the Levy distribution noise is inversely denoised, and the first data obtained by inverse denoising is subjected to inverse standardization transformation to generate Levy distribution transaction data, wherein the Levy distribution transaction data includes at least one of numerical field data, date field data and time field data.
[0044] S103: Based on the pre-trained multinomial distribution inverse denoising model, the multinomial distribution noise is inversely denoised, and the second data obtained by inverse denoising is subjected to one-hot encoding inverse transformation to generate multinomial distribution transaction data, wherein the multinomial distribution transaction data includes at least one of Boolean field data and enumerated field data.
[0045] The transaction data generation method provided in this application is applied to electronic devices, such as PCs, computers, smart terminals, servers, etc.
[0046] In this application, the electronic device is equipped with a pre-trained Levy distribution inverse denoising model and a multinomial distribution inverse denoising model. The electronic device first randomly generates multinomial distribution noise and Levy distribution noise; then, based on the pre-trained Levy distribution inverse denoising model, it performs inverse denoising on the Levy distribution noise to obtain first data; then, it performs an inverse normalization transform on the first data obtained through inverse denoising to generate Levy distribution transaction data, wherein the Levy distribution transaction data includes at least one of numerical field data, date field data, and time field data; based on the pre-trained multinomial distribution inverse denoising model, it performs inverse denoising on the multinomial distribution noise to obtain second data; then, it performs an inverse one-hot encoding transform on the second data obtained through inverse denoising to generate multinomial distribution transaction data, wherein the multinomial distribution transaction data includes at least one of Boolean field data and enumerated field data.
[0047] Structured transaction data is generated based on transaction data with Levy and multinomial distributions. This structured transaction data includes both the generated Levy and multinomial distribution transaction data.
[0048] Considering that existing data generation methods cannot meet the requirements for generating financial consumer data, this application proposes a transaction data generation method based on a Levy distribution inverse denoising model and a multinomial distribution inverse denoising model. Specifically, after randomly generating multinomial and Levy distribution noise, the Levy distribution noise is inversely denoised using the Levy distribution inverse denoising model. The first data obtained from inverse denoising is then subjected to inverse standardization transformation to generate Levy distribution transaction data. Similarly, the multinomial distribution noise is inversely denoised using the multinomial distribution inverse denoising model. The second data obtained from inverse denoising is then subjected to one-hot encoding inverse transformation to generate multinomial distribution transaction data. The proposed Levy distribution inverse denoising model uses a Levy distribution function that better reflects the long-tail distribution characteristics of financial data to model numerical, date, and time-based data. This helps capture more complete characteristics of long-tail distribution data, especially its ability to model tail data samples. This improves the generation of samples that more closely match the real data distribution in financial data generation scenarios, enhancing the practical usability of synthesized data. Thus, an accurate transaction data generation method is achieved.
[0049] Figure 2 The process diagrams for pre-training the Levy distribution inverse denoising model and the multinomial distribution inverse denoising model provided in this application include the following steps:
[0050] S201: Obtain the original structured transaction data in the training set, and split the original structured transaction data into numeric field data, date field data, time field data, boolean field data, and enumeration field data according to the field data type;
[0051] S202: Standardize the numerical field data, date field data, and time field data, and input them into the Levy distribution noise forward diffusion model to be trained to obtain the sample Levy distribution noise;
[0052] S203: Perform one-hot encoding on the Boolean field data and enumerated field data, and input them into the multinomial distribution noise forward diffusion model to be trained to obtain sample multinomial distribution noise;
[0053] S204: Based on the Levy distribution inverse denoising model to be trained, the Levy distribution noise of the sample is inversely denoised, and the first sample data obtained by inverse denoising is standardized inversely transformed to generate the predicted Levy distribution transaction data.
[0054] S205: Based on the multinomial distribution inverse denoising model to be trained, the sample multinomial distribution noise is inversely denoised, and the second sample data obtained by inverse denoising is subjected to one-hot encoding inverse transformation to generate the predicted multinomial distribution transaction data.
[0055] S206: Based on the predicted Levy-distributed transaction data and the predicted multinomial-distributed transaction data, obtain the predicted structured transaction data;
[0056] S207: Determine the loss value based on the first distribution of the original structured transaction data and the second distribution of the predicted structured transaction data, and train the Levy distribution noise forward diffusion model, the multinomial distribution noise forward diffusion model, the Levy distribution reverse denoising model, and the multinomial distribution reverse denoising model based on the loss value.
[0057] During the training phase, it is necessary to train the Levy distribution noise forward diffusion model, the multinomial distribution noise forward diffusion model, the Levy distribution inverse denoising model, and the multinomial distribution inverse denoising model.
[0058] In one optional implementation, standardizing the numeric field data, date field data, and time field data includes:
[0059] Robustly standardize the numerical field data;
[0060] The date field data is converted to a relative date length based on a preset date anchor point, and the date field data after the relative date length conversion is robustly standardized.
[0061] The time-type field data is converted to relative time length based on a preset time anchor point, and the time-type field data after relative time length conversion is robustly standardized.
[0062] In one optional implementation, the step of performing a standardized inverse transform on the first data obtained from the inverse denoising to generate Levy-distributed transaction data includes:
[0063] If the Levy distribution transaction data includes numerical field data, perform a robust standardization inverse transform on the first data obtained from the reverse denoising to obtain the numerical field data.
[0064] If the transaction data in the Levy distribution includes date field data, the date field data is obtained by performing robust standardization inverse transformation and date inverse conversion based on the preset date anchor.
[0065] If the transaction data in the Levy distribution includes time-type field data, the time-type field data can be obtained by performing robust standardization inverse transformation and time inverse transformation based on preset time anchors.
[0066] In one optional implementation, the step of performing a one-hot encoding inverse transform on the second data obtained from inverse denoising to generate multinomial-distributed transaction data includes:
[0067] The second data obtained by reverse denoising is subjected to softmax normalization and one-hot encoding inverse transformation to generate multinomial distribution transaction data.
[0068] In one optional implementation, the hyperparameter design process for the Levy distribution noise forward diffusion model and the Levy distribution reverse denoising model includes:
[0069] According to the formula: Perform hyperparameter design;
[0070] Where T is the total number of diffusion steps; c min The preset initial scale; c max λ is the preset maximum scale; λ is the preset growth rate control parameter.
[0071] To generate sample data that better reflects the long-tail distribution characteristics of financial transaction data, Figure 3 The overall flowchart of the Levy distribution-enhanced structured transaction data generation method provided in this application.
[0072] 1. Model training, the specific steps are as follows:
[0073] Selecting original structured transaction data: The head office, in conjunction with the actual business needs of its subsidiaries, and under the premise of ensuring compliance with laws and regulations and data security protection requirements, selects original structured transaction data samples that can be used for joint modeling with its subsidiaries.
[0074] Data partitioning: The original structured transaction data is split into numeric, date, time, boolean, and enumeration fields according to the data type of the fields, so as to facilitate subsequent classification and processing.
[0075] Data standardization: Data is processed and transformed according to different data types to quantify and standardize data values. Specifically:
[0076] For numeric fields: use the RobustScaler algorithm directly to process them and obtain the standardized values.
[0077] For date and time fields, a relative date or time length transformation method is used for numerical processing. The difference between the date or time and a pre-selected date or time anchor point (such as January 1, 2025, 12:00:00) is calculated, and the date or time length value is transformed using a robust normalization algorithm to obtain the normalized value.
[0078] For Boolean and enumeration fields, a one-hot encoding algorithm is used to convert them into encoded values.
[0079] Forward diffusion: Different forward diffusion models are used depending on the data type. For numerical data after robust standardization, the Levy distribution noise forward diffusion model is used, and for coded data after one-hot coding, the multinomial distribution noise forward diffusion model is used.
[0080] Levy distribution noise forward diffusion model:
[0081] The Levy distribution is a heavy-tailed distribution with the following probability density function:
[0082]
[0083] Where μ is the position parameter and c>0 is the scale parameter.
[0084] The Levy distribution noise forward diffusion process, based on a Markov chain, gradually transforms the original data distribution q(x0) into noisy data conforming to a Levy distribution by progressively adding Levy distribution noise. This process can be represented by the conditional probability distribution q(x0). t |x t-1 To describe, where x tThis represents the data at time step t. Specifically, at each time step t, from x... t-1 To x t The transformation follows the following Levy distribution:
[0085] q(x t |x t-1 ) = Levy(x t μ t (x t-1 ),c t );
[0086] Where, μ t (x t-1 ) is a positional parameter, set to c t This is the scaling parameter, used to adjust the scheduling strategy to adapt to the skipping characteristics of the Levy distribution, and is set to c. t =α t .
[0087] Multinomial distribution noise forward diffusion model: This application reuses the TabDiff model for the multinomial diffusion model of coded data.
[0088] Inverse denoising: The inverse process requires approximation of p θ (x t-1 |x t ) = Levy(x t-1 μ θ (x t ,t),c θ (x t Considering that the Levy distribution has no closed-form PDF (Probability Density Function) and KL divergence (Kullback-Leibler divergence, relative entropy), this invention proposes to use a score matching method to approximate the calculation, i.e., training a neural network model. Make it as close as possible to the true distribution p θ (x t-1 |x t In other words, the training objective of a neural network model is to minimize the difference between the predicted score and the actual score.
[0089]
[0090] For the Levy distribution score The PDF can be approximated by finite difference or calculated using the properties of Fourier transform.
[0091] Hyperparameter optimization design: After introducing Levy-distributed noise into the Diffusion Model, the scale parameter ct The scheduling design is crucial, as traditional linear or cosine scheduling (designed for Gaussian distributions) is no longer applicable due to the heavy-tailed nature of the Levy distribution. This application proposes an exponential scheduling strategy, as shown in the following formula:
[0092]
[0093] Where T is the total number of diffusion steps; c min The initial scale is c0 = c min =10 -4 c max The maximum scale needs to be adjusted experimentally; a default value of 1.0 is recommended. λ is used to control the growth rate; a default value of 4 is recommended.
[0094] Model Sampling Process: To verify the effectiveness of the generated data during model training, this invention proposes an annealing Langevin dynamics method based on score matching. This method uses an annealing strategy to gradually reduce the noise level and leverages score matching to estimate the gradient of the data distribution, guiding the sampling of initial noise x from the final noise distribution. T This allows for iterative optimization of the sample generation path to approximate the target distribution.
[0095] For multinomial distributed noise, the TabDiff model is used; for Levy distributed noise, this proposal uses the following calculation formula:
[0096]
[0097] Where δ t Let step size be the parameter, ∈ t The noise is generated through reparameterization of the Levy distribution. After T steps, the denoised data x0 is obtained.
[0098] Model iterative training: Traverse the entire dataset until the model converges or reaches the expected performance.
[0099] 2. Model Application: After model training, the trained model is used to generate samples by using a backdiffusion process to generate new data samples from random noise. The specific functions of this process are as follows:
[0100] Noise sampling: Two parts are randomly generated: multinomial distribution noise and Levy distribution noise. The multinomial distribution noise is used to generate Boolean and enumeration field data, while the Levy distribution noise is used to generate numeric, time, and date field data.
[0101] Inverse denoising: For Levy-distributed noise, a Levy-distributed inverse denoising model is used; for multinomial-distributed noise, a multinomial-distributed inverse denoising model is used.
[0102] Numerical transformation: For the denoised data, the data is transformed inversely using the standardized parameters of the data to obtain the actual field data values.
[0103] 3. Testing and Validation: In two scenarios—high-value user identification and high-risk user identification—the same training sample data was used to train the proposed method and the TabDiff method respectively. Test sample data was then generated using the trained models. Based on the test sample data and real data, high-value user identification models and high-risk user identification models were trained respectively. The model results show that the model trained on the data generated by the proposed method performs more closely to the model trained on real data, indicating that the data generated by the proposed method is closer to the real data distribution, which helps ensure the effectiveness of downstream tasks.
[0104] Table 1 below compares the results of the TabDiff method and the method of this application.
[0105]
[0106]
[0107] Table 1
[0108] The four-party clearing and settlement model represents the largest potential user of this application. It can be used for data product development and testing within subsidiaries and branches, as well as for joint modeling with external clients, fully leveraging UnionPay's data resources and enhancing the value of UnionPay data. In addition, other payment institutions such as Alipay and WeChat, as well as large shopping malls and government agencies, are also potential users.
[0109] Table 2 below is a table of definitions for the English terms used in this application.
[0110]
[0111]
[0112] Table 2
[0113] Figure 4 The schematic diagram of the transaction data generation device provided in this application includes:
[0114] The first generation module 11 is used to randomly generate multinomial distribution noise and Levy distribution noise;
[0115] The second generation module 12 is used to perform reverse denoising on the Levy distribution noise based on the pre-trained Levy distribution reverse denoising model, and to perform inverse standardization transformation on the first data obtained by reverse denoising to generate Levy distribution transaction data, wherein the Levy distribution transaction data includes at least one of numerical field data, date field data and time field data.
[0116] The third generation module 13 is used to perform inverse denoising on the multinomial distribution noise based on a pre-trained multinomial distribution inverse denoising model, and to perform one-hot encoding inverse transformation on the second data obtained by inverse denoising to generate multinomial distribution transaction data, wherein the multinomial distribution transaction data includes at least one of Boolean field data and enumerated field data.
[0117] The device further includes:
[0118] Training module 14 is used to acquire the original structured transaction data in the training set, and split the original structured transaction data into numeric field data, date field data, time field data, Boolean field data, and enumeration field data according to the field data type; standardize the numeric field data, date field data, and time field data, and input them into the Levy distribution noise forward diffusion model to be trained to obtain sample Levy distribution noise; perform one-hot encoding on the Boolean field data and enumeration field data, and input them into the multinomial distribution noise forward diffusion model to be trained to obtain sample multinomial distribution noise; based on the Levy distribution inverse denoising model to be trained, perform inverse denoising on the sample Levy distribution noise, and process the inverse denoising result... The first sample data undergoes a standardized inverse transform to generate predicted Levy-distributed transaction data. Based on the multinomial distribution inverse denoising model to be trained, the multinomial distribution noise of the sample data is inversely denoised. The second sample data obtained from the inverse denoising is then subjected to a one-hot encoding inverse transform to generate predicted multinomial-distributed transaction data. Based on the predicted Levy-distributed and multinomial-distributed transaction data, predicted structured transaction data is obtained. Based on the first distribution of the original structured transaction data and the second distribution of the predicted structured transaction data, a loss value is determined. The Levy-distributed noise forward diffusion model, the multinomial-distributed noise forward diffusion model, the Levy-distributed inverse denoising model, and the multinomial-distributed inverse denoising model are then trained based on the loss value.
[0119] The training module 14 is specifically used to perform robust standardization on the numerical field data; to perform relative date length conversion on the date field data according to a preset date anchor point, and to perform robust standardization on the date field data after relative date length conversion; and to perform relative time length conversion on the time field data according to a preset time anchor point, and to perform robust standardization on the time field data after relative time length conversion.
[0120] The second generation module 12 is specifically used to: if the Levy-distributed transaction data includes numerical field data, perform a robust inverse normalization transformation on the first data obtained by inverse denoising to obtain numerical field data; if the Levy-distributed transaction data includes date field data, perform a robust inverse normalization transformation and a date inverse conversion based on a preset date anchor to obtain date field data; if the Levy-distributed transaction data includes time field data, perform a robust inverse normalization transformation and a time inverse conversion based on a preset time anchor to obtain time field data.
[0121] The third generation module 13 is specifically used to perform softmax normalization and one-hot encoding inverse transformation on the second data obtained by reverse denoising to generate multinomial distribution transaction data.
[0122] The training module 14 is also used to perform training according to the formula: Perform hyperparameter design; where T is the total number of diffusion steps; c min The preset initial scale; c max λ is the preset maximum scale; λ is the preset growth rate control parameter.
[0123] This application also provides an electronic device, such as Figure 5 As shown, it includes: processor 301, communication interface 302, memory 303 and communication bus 304, wherein processor 301, communication interface 302 and memory 303 communicate with each other through communication bus 304;
[0124] The memory 303 stores a computer program, which, when executed by the processor 301, causes the processor 301 to perform any of the above method steps.
[0125] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0126] Communication interface 302 is used for communication between the above-mentioned electronic device and other devices.
[0127] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0128] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0129] This application also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform any of the above method steps.
[0130] This application provides a computer program product, which includes an executable program that, when executed by a processor, implements the method described herein.
[0131] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0132] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for generating transaction data, characterized in that, The method includes: Randomly generated multinomial and Levy distribution noise; Based on the pre-trained Levy distribution inverse denoising model, the Levy distribution noise is inversely denoised, and the first data obtained by inverse denoising is subjected to inverse standardization transformation to generate Levy distribution transaction data. The Levy distribution transaction data includes at least one of the following: numerical field data, date field data, and time field data. Based on a pre-trained multinomial distribution inverse denoising model, inverse denoising is performed on the multinomial distribution noise, and one-hot encoding inverse transformation is performed on the second data obtained by inverse denoising to generate multinomial distribution transaction data, wherein the multinomial distribution transaction data includes at least one of Boolean field data and enumerated field data.
2. The method as described in claim 1, characterized in that, The process of pre-training the Levy distribution inverse denoising model and the multinomial distribution inverse denoising model includes: Obtain the original structured transaction data in the training set, and split the original structured transaction data into numeric field data, date field data, time field data, boolean field data, and enumeration field data according to the field data type; The numerical, date, and time field data are standardized and input into the Levy distribution noise forward diffusion model to be trained to obtain the sample Levy distribution noise. One-hot encoding is performed on the Boolean field data and the enumerated field data, and then input into the multinomial distribution noise forward diffusion model to be trained to obtain the sample multinomial distribution noise. Based on the Levy distribution inverse denoising model to be trained, the Levy distribution noise of the sample is inversely denoised, and the first sample data obtained by inverse denoising is standardized inversely transformed to generate the predicted Levy distribution transaction data. Based on the multinomial distribution inverse denoising model to be trained, the sample multinomial distribution noise is inversely denoised, and the second sample data obtained by inverse denoising is subjected to one-hot encoding inverse transformation to generate the predicted multinomial distribution transaction data. Based on the predicted Levy distribution transaction data and the predicted multinomial distribution transaction data, the predicted structured transaction data is obtained. Based on the first distribution of the original structured transaction data and the second distribution of the predicted structured transaction data, a loss value is determined, and the Levy distribution noise forward diffusion model, the multinomial distribution noise forward diffusion model, the Levy distribution inverse denoising model, and the multinomial distribution inverse denoising model are trained based on the loss value.
3. The method as described in claim 2, characterized in that, Standardizing the numeric, date, and time data fields includes: Robustly standardize the numerical field data; The date field data is converted to a relative date length based on a preset date anchor point, and the date field data after the relative date length conversion is robustly standardized. The time-type field data is converted to relative time length based on a preset time anchor point, and the time-type field data after relative time length conversion is robustly standardized.
4. The method as described in claim 1, characterized in that, The step of performing a standardized inverse transform on the first data obtained from the inverse denoising to generate Levy-distributed transaction data includes: If the Levy distribution transaction data includes numerical field data, perform a robust standardization inverse transform on the first data obtained from the reverse denoising to obtain the numerical field data. If the transaction data in the Levy distribution includes date field data, the date field data is obtained by performing robust standardization inverse transformation and date inverse conversion based on the preset date anchor. If the transaction data in the Levy distribution includes time-type field data, the time-type field data can be obtained by performing robust standardization inverse transformation and time inverse transformation based on preset time anchors.
5. The method as described in claim 1, characterized in that, The step of performing a one-hot encoding inverse transform on the second data obtained by inverse denoising to generate multinomial-distributed transaction data includes: The second data obtained by reverse denoising is subjected to softmax normalization and one-hot encoding inverse transformation to generate multinomial distribution transaction data.
6. The method as described in claim 2, characterized in that, The hyperparameter design process for the Levy distribution noise forward diffusion model and the Levy distribution reverse denoising model includes: According to the formula: Perform hyperparameter design; Where T is the total number of diffusion steps; c min The preset initial scale; c max λ is the preset maximum scale; λ is the preset growth rate control parameter.
7. A transaction data generation device, characterized in that, The device includes: The first generation module is used to randomly generate multinomial distribution noise and Levy distribution noise; The second generation module is used to perform inverse denoising on the Levy distribution noise based on a pre-trained Levy distribution inverse denoising model, and to perform inverse normalization transformation on the first data obtained by inverse denoising to generate Levy distribution transaction data, wherein the Levy distribution transaction data includes at least one of numerical field data, date field data and time field data. The third generation module is used to perform inverse denoising on the multinomial distribution noise based on a pre-trained multinomial distribution inverse denoising model, and to perform one-hot encoding inverse transformation on the second data obtained by inverse denoising to generate multinomial distribution transaction data, wherein the multinomial distribution transaction data includes at least one of Boolean field data and enumerated field data.
8. The apparatus as claimed in claim 7, characterized in that, The device further includes: The training module is used to acquire the original structured transaction data in the training set, and split the original structured transaction data into numerical field data, date field data, time field data, Boolean field data, and enumeration field data according to the field data type. The numerical field data, date field data, and time field data are standardized and input into the Levy distribution noise forward diffusion model to be trained, obtaining sample Levy distribution noise. The Boolean field data and enumeration field data are one-hot encoded and input into the multinomial distribution noise forward diffusion model to be trained, obtaining sample multinomial distribution noise. Based on the Levy distribution inverse denoising model to be trained, the sample Levy distribution noise is inversely denoised, and the resulting multinomial distribution noise is... A sample data is subjected to inverse standardization transformation to generate predicted Levy-distributed transaction data. Based on the multinomial distribution inverse denoising model to be trained, the sample multinomial distribution noise is inversely denoised, and the second sample data obtained by inverse denoising is subjected to one-hot encoding inverse transformation to generate predicted multinomial distribution transaction data. Based on the predicted Levy-distributed transaction data and the predicted multinomial distribution transaction data, predicted structured transaction data is obtained. Based on the first distribution of the original structured transaction data and the second distribution of the predicted structured transaction data, a loss value is determined, and the Levy distribution noise forward diffusion model, the multinomial distribution noise forward diffusion model, the Levy distribution inverse denoising model, and the multinomial distribution inverse denoising model are trained based on the loss value.
9. The apparatus as claimed in claim 8, characterized in that, The training module is specifically used to perform robust standardization on the numerical field data; to perform relative date length conversion on the date field data according to a preset date anchor, and to perform robust standardization on the date field data after relative date length conversion; and to perform relative time length conversion on the time field data according to a preset time anchor, and to perform robust standardization on the time field data after relative time length conversion.
10. The apparatus as claimed in claim 7, characterized in that, The second generation module is specifically used to: if the Levy-distributed transaction data includes numerical field data, perform a robust inverse normalization transformation on the first data obtained by inverse denoising to obtain numerical field data; if the Levy-distributed transaction data includes date field data, perform a robust inverse normalization transformation and a date inverse conversion based on a preset date anchor to obtain date field data; if the Levy-distributed transaction data includes time field data, perform a robust inverse normalization transformation and a time inverse conversion based on a preset time anchor to obtain time field data.
11. The apparatus as claimed in claim 7, characterized in that, The third generation module is specifically used to perform softmax normalization and one-hot encoding inverse transformation on the second data obtained by reverse denoising to generate multinomial distribution transaction data.
12. The apparatus as claimed in claim 8, characterized in that, The training module is also used to perform training according to the formula: Perform hyperparameter design; where T is the total number of diffusion steps; c min The preset initial scale; c max λ is the preset maximum scale; λ is the preset growth rate control parameter.
13. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-6.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.
15. A computer program product, characterized in that, The computer program product includes an executable program that is executed by a processor to implement the method of any one of claims 1-6.
Citation Information
Patent Citations
Conditional variational self-encoding data synthesis method based on unbalanced financial data
CN118210796A
Small sample photovoltaic data generation method based on diffusion model
CN119537938A