Model training method, prediction method, device, equipment and storage medium
By conducting federated learning on multiple application terminals, combining transaction volume and covariate data, and training transaction volume prediction models, the problem of low prediction accuracy in the existing technology is solved, and prediction accuracy and data security are improved.
Patent Information
- Application Number
- CN202210310844.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In the prior art, only the time series data itself is considered during model training, resulting in low prediction accuracy and inability to meet the needs.
A model training method applied to transaction volume prediction is adopted. Through multiple participants participating in federated learning, the underlying network and upper network of each application end are used, and the transaction volume sample data and covariate sample data are combined to conduct model training and prediction.
It improves the accuracy of the transaction volume prediction model, realizes the secure interaction of data on different application sides through federated learning, and enhances the security of data.
Smart Images

Figure CN114638343B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of Internet, artificial intelligence and big data technology, and in particular to a model training method, prediction method, device, equipment and storage medium applied to transaction volume prediction. Background Art
[0002] With the development of artificial intelligence technology, various network models have been widely used in various fields.
[0003] For time series prediction, traditional autoregressive models, ARIMA (Autoregressive Integrated Moving Average Mode) models or LSTM (Long Short Term Memory) and other deep learning models are usually used.
[0004] However, in the process of implementing the present invention, the inventors found that the solutions based on the above-mentioned prior art have at least the following technical problems: since only the time series data itself is considered during model training, which is only data from a single platform, the prediction accuracy is low and cannot meet the needs. Summary of the invention
[0005] Embodiments of the present invention provide a model training method, prediction method, device, equipment and storage medium for transaction volume prediction, which are used to solve the problem of low accuracy of model training.
[0006] In a first aspect, an embodiment of the present invention provides a model training method for transaction volume prediction, which is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The method is applied to the first application end, and the method includes:
[0007] The transaction volume sample data corresponding to each time window is input into the underlying network of the first application end in turn to obtain the status data corresponding to each time window; the spliced status data corresponding to each time window sent by the server end is input into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window, wherein the spliced status data corresponding to each time window is spliced by the status data corresponding to the time window output by the server end to the underlying network of each application end, and the status data corresponding to each time window of the second application end is generated by the underlying network of the second application end according to the covariate sample data corresponding to the time window, and the covariate is a characteristic variable related to the transaction volume; for each A time window is generated, and a first gradient corresponding to the time window is generated according to the predicted transaction volume and the actual transaction volume corresponding to the time window, and the model parameters of the upper network of the first application end are updated according to the first gradient corresponding to the time window; a second gradient corresponding to the time window is generated according to the upper network after the model parameters are updated and the first gradient corresponding to the time window, and the second gradient corresponding to the time window is sent to the server, so that the second gradient corresponding to the time window is split into third gradients corresponding to the time window of each application end through the server, so as to update the model parameters of the underlying network of each application end based on the third gradients corresponding to the time window, so as to obtain an updated transaction volume prediction model.
[0008] In a specific implementation, the underlying network includes an input layer and a hidden layer consisting of a long short-term memory network with a preset number of layers, and the transaction volume sample data corresponding to each time window is sequentially input into the underlying network of the first application end to obtain the state data corresponding to each time window, including:
[0009] For each time window, the transaction volume sample data corresponding to the time window is input into the input layer of the underlying network of the first application end; based on the hidden layer of the underlying network of the first application end, the transaction volume sample data corresponding to the time window is feature extracted to obtain the state data corresponding to the time window.
[0010] In a specific implementation, the input layer is an encoder, and the transaction volume sample data corresponding to the time window is input into the input layer of the underlying network of the first application end, including:
[0011] Based on the underlying network encoder of the first application end, the transaction volume sample data corresponding to each time window is encoded to obtain feature encoding data.
[0012] Correspondingly, based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the transaction volume sample data corresponding to the time window to obtain state data corresponding to the time window, including:
[0013] Based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the feature encoding data corresponding to the time window to obtain state data corresponding to the time window.
[0014] In a specific implementation, the upper network includes a data conversion layer and an output layer, and the splicing state data corresponding to each time window sent by the server is input into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window, including:
[0015] The splicing state data corresponding to each time window sent by the server is input into the data conversion layer of the upper network of the first application end in sequence to output the state conversion data corresponding to each time window; based on the output layer of the upper network, feature extraction is performed on the state conversion data corresponding to each time window to obtain the predicted transaction volume corresponding to each time window.
[0016] In a specific implementation, generating a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window, and updating the model parameters of the upper network of the first application end based on the first gradient corresponding to the time window includes:
[0017] According to the preset transaction volume and the actual transaction volume corresponding to the time window, the first gradient of the loss function of the upper network corresponding to the time window is calculated; and the model parameters of the upper network are updated by reversely conducting the first gradient corresponding to the time window in the upper network.
[0018] In a specific implementation, after obtaining the status data corresponding to each time window, the method further includes:
[0019] The status data corresponding to each time window is encrypted, and the encrypted status data of each time window is sent to the server, so that the server decrypts and splices the status data of each time window received from each application end to obtain the spliced status data corresponding to each time window.
[0020] In a specific implementation, generating a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window includes:
[0021] According to the preset transaction volume and actual transaction volume corresponding to the time window, the value of the loss function corresponding to the time window is calculated; whether the values of the loss function corresponding to the time window and a preset number of time windows before the time window meet the preset conditions is determined; if not, the first gradient corresponding to the time window is generated according to the predicted transaction volume and actual transaction volume corresponding to the time window.
[0022] In a second aspect, an embodiment of the present invention provides a model training method for transaction volume prediction, which is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The method is applied to the second application end, and the method includes:
[0023] The covariate sample data corresponding to each time window is sequentially input into the underlying network of the second application end to obtain the state data corresponding to each time window; the state data corresponding to each time window is sent to the server end, so that the server end splices the state data corresponding to the second application end and the first application end received in each time window to obtain the spliced state data corresponding to each time window, wherein the state data corresponding to each time window of the first application end is obtained by inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end; for each time window, the second application end is updated according to the third gradient of the second application end corresponding to the time window The model parameters of the underlying network, wherein the third gradient corresponding to the time window is obtained by splitting the second gradient corresponding to the time window by the server, the second gradient corresponding to the time window is generated by the upper network of the first application end after updating the model parameters based on the first gradient corresponding to the time window and the first gradient corresponding to the time window, the first gradient corresponding to the time window is generated by the first application end according to the predicted transaction volume and the actual transaction volume output by the upper network of the first application end corresponding to the time window, and the predicted transaction volume corresponding to the time window is obtained by inputting the splicing state data corresponding to the time window sent by the server into the upper network of the first application end.
[0024] In a specific implementation, the underlying network includes an input layer and a hidden layer consisting of a long short-term memory network with a preset number of layers, and the covariate sample data corresponding to each time window is sequentially input into the underlying network of the second application end to obtain the state data corresponding to each time window, including:
[0025] For each time window, input the covariate sample data corresponding to the time window into the input layer of the underlying network of the second application end;
[0026] Based on the hidden layer of the underlying network of the second application end, feature extraction is performed on the transaction volume sample data corresponding to the time window to obtain state data corresponding to the time window.
[0027] In a specific implementation, the input layer is an encoder, and inputting the covariate sample data corresponding to the time window into the input layer of the underlying network of the second application end includes:
[0028] Based on the underlying network encoder of the second application end, the covariate sample data corresponding to each time window is encoded to obtain feature encoded data.
[0029] Correspondingly, based on the hidden layer of the underlying network of the second application end, feature extraction is performed on the covariate sample data corresponding to the time window to obtain state data corresponding to the time window, including:
[0030] Based on the hidden layer of the underlying network of the second application end, feature extraction is performed on the feature encoding data corresponding to the time window to obtain state data corresponding to the time window.
[0031] In a specific implementation, after obtaining the status data corresponding to each time window, the method further includes:
[0032] The status data corresponding to each time window is encrypted, and the encrypted status data of each time window is sent to the server, so that the server decrypts and splices the status data of each time window received from each application end to obtain the spliced status data corresponding to each time window.
[0033] In a third aspect, an embodiment of the present invention provides a model training method for transaction volume prediction, which is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a server end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The method is applied to the server end, and the method includes:
[0034] For each time window, receiving the state data of the time window sent by each application end, wherein the state data corresponding to the time window of the first application end is obtained by inputting the transaction volume sample data corresponding to the time window into the underlying network of the first application end, and the state data corresponding to the time window of the second application end is obtained by inputting the covariate sample data corresponding to the time window into the underlying network of the second application end;
[0035] splicing the state data of the time window sent by each application end to obtain spliced state data corresponding to the time window;
[0036] Sending the splicing state data corresponding to the time window to the upper network of the first application end, so as to obtain the predicted transaction volume corresponding to the time window by inputting the splicing state data corresponding to the time window into the upper network of the first application end, so as to generate a first gradient corresponding to the time window based on the predicted transaction volume corresponding to the time window, updating the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window, and generating a second gradient corresponding to the time window according to the upper network after the model parameters are updated and the first gradient corresponding to the time window;
[0037] Receive the second gradient corresponding to the time window, and split the second gradient corresponding to the time window to generate a third gradient corresponding to the time window of each application end, so as to update the model parameters of the underlying network of each application end based on the third gradient corresponding to the time window to obtain an updated transaction volume prediction model.
[0038] In a specific implementation manner, the state data of the time window sent by each application end is encrypted state data, and the state data of the time window sent by each application end is spliced to obtain the spliced state data corresponding to the time window, including:
[0039] The state data of the time window sent by each application terminal is decrypted and spliced to obtain the spliced state data corresponding to the time window.
[0040] In a fourth aspect, an embodiment of the present invention provides a model-based transaction volume prediction method, the method is applied to a first application end, and the method includes:
[0041] Obtain historical trading volume; based on a pre-trained trading volume prediction model, process the historical trading volume and covariate data corresponding to the historical trading volume to generate a predicted trading volume corresponding to the historical trading volume, wherein the trading volume prediction model is generated by a model training method for trading volume prediction provided in any embodiment corresponding to the first aspect of the present invention.
[0042] In a specific implementation, based on a pre-trained transaction volume prediction model, the historical transaction volume and the covariate data corresponding to the historical transaction volume are processed, including:
[0043] Inputting the historical transaction volume into the underlying network of the first application end to obtain status data output by the underlying network of the first application end;
[0044] The spliced status data sent by the server is input into the upper network of the first application terminal to generate the predicted transaction volume corresponding to the historical transaction volume, wherein the spliced status data is generated by the server after splicing the status data of each application terminal, the each application terminal includes the first application terminal and at least one second application terminal, and the status data of the second application terminal is generated by the underlying network of the second application terminal according to the covariate data corresponding to the historical transaction volume.
[0045] In a specific implementation, the underlying network includes an input layer and a hidden layer consisting of a long short-term memory network with a preset number of layers, and the historical transaction volume is input into the underlying network of the first application end to obtain the state data output by the underlying network of the first application end, including:
[0046] Inputting the historical transaction volume into the input layer of the underlying network of the first application end;
[0047] Based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the historical transaction volume to obtain status data corresponding to the historical transaction volume.
[0048] In a specific implementation, the input layer is an encoder, and the historical transaction volume is input into the input layer of the underlying network of the first application end, including:
[0049] Based on the underlying network encoder of the first application end, the historical transaction volume is encoded to obtain feature encoding data.
[0050] Accordingly, based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the historical transaction volume to obtain status data corresponding to the historical transaction volume, including:
[0051] Based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the feature encoding data to obtain status data corresponding to the historical transaction volume.
[0052] In a specific implementation, the upper network includes a data conversion layer and an output layer, and the splicing state data corresponding to each time window sent by the server is input into the upper network of the first application end to generate a predicted transaction volume corresponding to the historical transaction volume, including:
[0053] Input the splicing state data sent by the server into the data conversion layer of the upper network of the first application end to output state conversion data;
[0054] Based on the output layer of the upper network, feature extraction is performed on the state transition data to obtain the predicted transaction volume corresponding to the historical transaction volume.
[0055] In a specific implementation, after obtaining the status data output by the underlying network of the first application end, the method further includes:
[0056] The state data is encrypted and sent to the server, so that the server decrypts and splices the state data received from each application terminal to obtain spliced state data.
[0057] In a fifth aspect, an embodiment of the present invention provides a model training device for transaction volume prediction, the model training device for transaction volume prediction is applied to multiple participants participating in federated learning, the multiple participants include a first application end, a service end and at least one second application end, the transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end, the device is applied to the first application end, and the device includes:
[0058] The first input module is used to input the transaction volume sample data corresponding to each time window into the underlying network of the first application end in turn to obtain the state data corresponding to each time window; the second input module is used to input the spliced state data corresponding to each time window sent by the server end into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window, wherein the spliced state data corresponding to each time window is spliced by the state data corresponding to each time window output by the server end to the underlying network of each application end, and the state data corresponding to each time window of the second application end is generated by the underlying network of the second application end according to the covariate sample data corresponding to each time window, and the covariate is a characteristic variable related to the transaction volume; the first gradient generator A module is provided for generating, for each time window, a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window, and updating the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window; a first parameter updating module is provided for generating a second gradient corresponding to the time window according to the upper network after the model parameters are updated and the first gradient corresponding to the time window, and sending the second gradient corresponding to the time window to the server end, so as to split the second gradient corresponding to the time window into third gradients corresponding to the time window of each application end via the server end, so as to update the model parameters of the underlying network of each application end based on the third gradients corresponding to the time window, and obtain an updated transaction volume prediction model.
[0059] In a sixth aspect, an embodiment of the present invention provides a model training device for transaction volume prediction, which is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The device is applied to the second application end, and the device includes:
[0060] The third input module is used to input the covariate sample data corresponding to each time window into the underlying network of the second application end in turn to obtain the state data corresponding to each time window; the first data sending module is used to send the state data corresponding to each time window to the server end, so that the server end splices the state data corresponding to the second application end and the first application end received in each time window to obtain the spliced state data corresponding to each time window, wherein the state data corresponding to each time window of the first application end is obtained by inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end; the second parameter updating module is used to update the state data corresponding to each time window according to the second application end corresponding to the time window. The third gradient corresponding to the time window is obtained by the server side splitting the second gradient corresponding to the time window, the second gradient corresponding to the time window is generated by the upper network of the first application side after the model parameters are updated based on the first gradient corresponding to the time window and the first gradient corresponding to the time window, the first gradient corresponding to the time window is generated by the first application side according to the predicted transaction volume and the actual transaction volume output by the upper network of the first application side corresponding to the time window, and the predicted transaction volume corresponding to the time window is obtained by inputting the splicing state data corresponding to the time window sent by the server side into the upper network of the first application side.
[0061] In a seventh aspect, an embodiment of the present invention provides a model training device for transaction volume prediction, which is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a server end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The device is applied to the server end, and the device includes:
[0062] A data receiving module is used to receive the status data of the time window sent by each application end for each time window, wherein the status data corresponding to the time window of the first application end is obtained by inputting the transaction volume sample data corresponding to the time window into the underlying network of the first application end, and the status data corresponding to the time window of the second application end is obtained by inputting the covariate sample data corresponding to the time window into the underlying network of the second application end; a data splicing module is used to splice the status data of the time window sent by each application end to obtain the spliced status data corresponding to the time window; a second data sending module is used to send the spliced status data corresponding to the time window to the upper network of the first application end to obtain the spliced status data corresponding to the time window by The state data is input into the upper network of the first application end to obtain the predicted transaction volume corresponding to the time window, so as to generate the first gradient corresponding to the time window based on the predicted transaction volume corresponding to the time window, update the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window, and generate the second gradient corresponding to the time window according to the upper network after the model parameters are updated and the first gradient corresponding to the time window; a gradient splitting module is used to receive the second gradient corresponding to the time window, and split the second gradient corresponding to the time window to generate a third gradient corresponding to the time window of each application end, so as to update the model parameters of the underlying network of each application end based on the third gradient corresponding to the time window, so as to obtain an updated transaction volume prediction model.
[0063] In an eighth aspect, an embodiment of the present invention provides a model-based transaction volume prediction device, the device is applied to a first application end, and the device includes:
[0064] A historical trading volume acquisition module is used to obtain historical trading volume; a trading volume prediction module is used to process the historical trading volume and the covariate data corresponding to the historical trading volume based on a pre-trained trading volume prediction model to generate a predicted trading volume corresponding to the historical trading volume, wherein the trading volume prediction model is generated by the model training method for trading volume prediction provided in any embodiment corresponding to the first aspect of the present invention.
[0065] In a ninth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor; the memory is used to store instructions executable by the processor; wherein the processor is configured to execute the method described in any one of the above embodiments by executing the executable instructions.
[0066] In a tenth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0067] In an eleventh aspect, an embodiment of the present invention provides a computer program product, including a computer program, which is used to implement the method described in any of the above embodiments when executed by a processor.
[0068] The embodiment of the present invention provides a model training method, prediction method, device, equipment and storage medium for transaction volume prediction. For multiple participants participating in federated learning, namely, a first application end, a service end and at least one second application end, a transaction prediction model and a training method thereof are provided. The transaction prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The training method mainly includes: inputting sample data through the underlying network set at each application end, including transaction volume sample data corresponding to the first application end and covariate sample data corresponding to each second application end, and outputting each application end through the underlying network of each application end. The state data of each application end is spliced based on the server end, and the spliced state data is sent to the upper network of the first application end, so as to obtain the predicted transaction volume, realizing an iterative process, and updating the model parameters through the gradient corresponding to each iteration and sending the gradient of different application ends based on the server end until the model training is completed, thereby outputting the trained transaction volume prediction model, and predicting the transaction volume based on the transaction volume prediction model, realizing transaction volume prediction based on multi-party data, improving the prediction accuracy, and through the way of federated learning, realizing the interaction of data of different application ends through the server end, and improving the security of data of each application end. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0070] Figure 1 It is a schematic diagram of a transaction volume prediction model in the related art;
[0071] Figure 2 A schematic diagram of a time series data prediction model provided by an embodiment of the present invention;
[0072] Figure 3 A schematic diagram of a flow chart of a model training method for transaction volume prediction provided by one embodiment of the present invention;
[0073] Figure 4 For the present invention Figure 3 A schematic diagram of the structure of the transaction volume prediction model in the illustrated embodiment;
[0074] Figure 5 A schematic flow chart of a model training method for transaction volume prediction provided by another embodiment of the present invention;
[0075] Figure 6 A schematic flow chart of a model training method for transaction volume prediction provided by another embodiment of the present invention;
[0076] Figure 7 A schematic flow chart of a model training method for transaction volume prediction provided by another embodiment of the present invention;
[0077] Figure 8 A schematic diagram of a flow chart of a model-based transaction volume prediction method provided by one embodiment of the present invention;
[0078] Fig. 9 A schematic diagram of a model training device for transaction volume prediction provided by an embodiment of the present invention;
[0079] Fig.10 A schematic diagram of a model training device for transaction volume prediction provided by another embodiment of the present invention;
[0080] Fig.11 A schematic diagram of a model training device for transaction volume prediction provided by another embodiment of the present invention;
[0081] Fig.12 A schematic diagram of the structure of a transaction volume prediction device based on a model provided by an embodiment of the present invention;
[0082] Fig.13 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0083] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0084] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0086] Time series forecasting analysis uses the time characteristics of transactions in the past to predict the time characteristics of the transactions in the future, such as the flow of people in a business district, the price of goods, and sales volume.
[0087] Traditional time series prediction algorithms mostly use autoregression, moving average and other algorithms, such as the ARIMA algorithm. With the continuous development of artificial intelligence technology, more fine-grained data analysis algorithms based on deep learning are applied to time series analysis, such as XGBoost (Extreme Gradient Boosting), LSTM and other algorithms.
[0088] Figure 1 It is a schematic diagram of the transaction volume prediction model in the related technology, such as Figure 1 As shown, the transaction volume prediction model is often set at the application end 100, and the historical transaction volume of the application end 100 collected at historical time is input into the transaction prediction model for model training, so as to obtain a trained transaction prediction model, so as to predict the transaction volume in the future based on the transaction prediction model, that is, output the predicted transaction volume.
[0089] However, based on Figure 1 When the trading volume prediction model shown is trained, since the model training is only based on the trading volume of a single application end, that is, only sample data of a single dimension is used for model training, the reliability of the training may be low, thereby causing the problem of low accuracy of the trading volume prediction model.
[0090] In order to solve the above problems, the inventors of the present invention, after creative work, obtained the inventive concept of the present invention: combining samples in other dimensions for model training, that is, combining sample data corresponding to multiple application terminals, performing model training through federated learning, and generating a transaction volume prediction model to improve the accuracy of the transaction volume prediction model.
[0091] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0092] Figure 2 A schematic diagram of a time series data prediction model provided by an embodiment of the present invention, such as Figure 2 As shown, the time series data prediction model includes an underlying network set at each application end (Party) and an upper network set at a first application end (Active Party), wherein each application end (Party) includes a first application end (Active Party) and at least one second application end (Passive Party). Figure 2 A second application end is taken as an example. The underlying network is used to receive the input data of the corresponding application end, such as time series data and covariate data corresponding to the time series data, and output state data. The state data corresponding to each application end is spliced through the server end, such as through the intermediate network of the server end, to obtain the spliced state data of the input data involving each application end, and then the server end transmits the spliced state data to the upper network of the first application end, so as to obtain the predicted transaction volume output by the transaction volume prediction model, and then calculate the loss function and gradient, update the upper network based on the gradient, and split the gradient through the server end, so as to obtain the corresponding gradient of each application end, realize the update of the underlying network of each application end, and obtain the updated time series data prediction model, so as to complete an iterative process, and execute the above iterative process in a loop until a stable time series data prediction model is obtained, so as to make predictions based on the stable time series data prediction model.
[0093] By participating in various applications and servers of federated learning, the training of time series data prediction models based on multi-platform data is realized, the accuracy of the time series data prediction models is improved, and data security is improved by data interaction through federated learning.
[0094] The time series data prediction model provided by the embodiment of the present invention can be applied to the analysis of any time series data, such as business circle traffic, price prediction, sales volume prediction, etc. For ease of description, the following embodiment of the present invention takes the time series data of transaction volume as an example for explanation.
[0095] Figure 3A flow chart of a model training method for transaction volume prediction provided in an embodiment of the present invention. The transaction volume prediction model mentioned in the embodiment of the present invention includes an underlying network set at each application terminal and an upper network set at a first application terminal. The transaction volume prediction model is applied to multiple participants participating in federated learning, including a first application terminal, a service terminal and at least one second application terminal. The model training method provided in this embodiment is applied to the first application terminal, which is a provider of historical data corresponding to the transaction volume, such as Figure 3 As shown, the model training method includes:
[0096] S301: Inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end in turn to obtain the status data corresponding to each time window.
[0097] The time window may include one or more time nodes, each of which corresponds to a transaction volume sample data. The transaction volume sample data is the transaction volume corresponding to the first application end at a historical time.
[0098] Specifically, the underlying network of the first application end includes an input layer and a hidden layer. The input layer is used to receive the transaction volume sample data input by the first application end, process the sample data, such as data dimension reduction, format conversion, etc., and then pass the processed transaction volume sample data to the hidden layer, extract features of the transaction volume sample data through the hidden layer, generate state data, and then send the state data to the server. The input layer and hidden layer of the underlying network can be of any structure, and the embodiment of the present invention is not limited to this.
[0099] Specifically, training data may be obtained first, including trading volume training data and covariate training data, and then, according to a preset window length, the trading volume training data and the covariate training data may be divided into trading volume sample data and covariate sample data corresponding to each time window. The preset window length may be customizable and may include 3, 4, 5 or other number of time nodes or time steps.
[0100] Optionally, the method further includes: obtaining transaction volume training data of the first application end, wherein the transaction volume training data includes the transaction volume corresponding to each time node; based on a preset window length, dividing the transaction volume training data to obtain transaction volume sample data corresponding to each time window.
[0101] Specifically, for each application end, before the sample data, transaction volume sample data or covariate sample data is input into the underlying network, the sample data needs to be preprocessed, such as determining the data identifier or ID of each sample data, and aligning the sample data so that the dimensions of the sample data from different application ends are consistent, to ensure that when performing federated learning, the data identifiers from different application ends corresponding to the same time series or time node can be extracted.
[0102] Optionally, the underlying network includes an input layer and a hidden layer composed of a long short-term memory network with a preset number of layers, and the transaction volume sample data corresponding to each time window is input into the underlying network of the first application end in sequence to obtain the state data corresponding to each time window, including: for each time window, the transaction volume sample data corresponding to the time window is input into the input layer of the underlying network of the first application end; based on the hidden layer of the underlying network of the first application end, the transaction volume sample data corresponding to the time window is feature extracted to obtain the state data corresponding to the time window. The preset number of layers can be 2 or 3.
[0103] In some embodiments, in order to improve the security of data interaction, after the status data is generated, the status data can also be encrypted, so that the encrypted status data can be sent to the server. The server needs to decrypt and splice the encrypted status data sent by each application terminal to obtain spliced status data including the status data of each application terminal.
[0104] Optionally, after obtaining the status data corresponding to each time window, the method further includes: encrypting the status data corresponding to each time window, and sending the encrypted status data of each time window to the server, so that the server decrypts and splices the status data of each time window received from each application end to obtain the spliced status data corresponding to each time window.
[0105] Each application end can encrypt the status data after generating the status data corresponding to each time window, and then send the encrypted status data to the server end. When the server end is initialized, it stores the decryption algorithm of the status data of each application end, and then decrypts each encrypted status data based on the corresponding decryption algorithm to obtain the status data of each time window of each application end, and then splices the status data of each application end corresponding to each time window to obtain the spliced status data corresponding to the time window.
[0106] Specifically, the formula for forward transmission of the hidden layer of the underlying network of the first application end can be:
[0107] h active,i,t =H(h active,i,t-1 ,zi,t-1 ,θ 1 )
[0108] Among them, θ 1 h is the model parameter of the underlying network of the first application end; active,i,t is the state data of the i-th time window t output by the hidden layer of the underlying network of the first application end; i,t-1 is the transaction volume sample data of the i-th time window t-1; H(·) is the function corresponding to the hidden layer of the underlying network of the first application end.
[0109] The formula for forward transmission of the hidden layer of the underlying network of the second application end can be:
[0110] h passive,i,t =H(h passive,i,t-1 ,x i,t-1 ,θ 2 )
[0111] Among them, θ 2 h is the model parameter of the underlying network of the second application end; passive,i,t x is the state data of the i-th time window t output by the hidden layer of the underlying network of the second application end; i,t-1 is the covariate sample data of the i-th time window t-1 corresponding to the second application end; the function corresponding to the hidden layer of the underlying network of the second application end is the same as the function corresponding to the hidden layer of the underlying network of the first application end, both of which are H(·).
[0112] After the server decrypts the status data received from each application, the specific splicing formula is:
[0113] h i,t =concat_func(h active,i,t ,h passive,i,t )
[0114] Among them, concat_func(·) is the function corresponding to the server-side concatenation.
[0115] The server splices the status data of each time node in each time window to obtain the spliced status data h including the status data of all application ends. i,t , which realizes the collection of data from each application end in each time window, while avoiding the leakage of source data and improving data security.
[0116] S302: Input the splicing status data corresponding to each time window sent by the server into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window.
[0117] Among them, the spliced status data corresponding to each time window is spliced by the status data corresponding to the time window output by the server to the underlying network of each application end, and the status data corresponding to each time window of the second application end is generated by the underlying network of the second application end according to the covariate sample data corresponding to the time window, and the covariate is a characteristic variable related to the transaction volume.
[0118] The transaction volume mentioned in the embodiment of the present invention can be the transaction volume of any commodity, such as fresh food sales, gold transaction volume, etc., and the covariate is one or more factors that affect the transaction volume. Taking the fresh food sales in market A as an example, the covariate can include weather data, such as precipitation, temperature, wind speed, etc., and can also include the fresh food sales of various fresh food sellers located near market A. Taking the sales of juice as an example, the covariate can include the yield of the fruit corresponding to the juice, and can also include factors such as the number of readings of the advertisement corresponding to the juice.
[0119] In each time window, the upper network of the first application end is used to receive the spliced state data composed of the state data of the time window of each application end sent by the service end, and output the preset transaction volume corresponding to the time window. The upper network can be of any structure, and the embodiment of the present invention is not limited to this.
[0120] In some embodiments, the upper network may update or learn the parameters of the network by calculating the parameters of the log-likelihood function in a manner that maximizes the log-likelihood function.
[0121] Optionally, the upper network includes a data conversion layer and an output layer, and the splicing state data corresponding to each time window sent by the server is input into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window, including: sequentially inputting the splicing state data corresponding to each time window sent by the server into the data conversion layer of the upper network of the first application end to output the state conversion data corresponding to each time window; based on the output layer of the upper network, performing feature extraction on the state conversion data corresponding to each time window to obtain the predicted transaction volume corresponding to each time window.
[0122] Among them, the data conversion layer of the upper network can use linear or nonlinear functions to transform the splicing state data h i,t Perform data conversion.
[0123] In some embodiments, the expression of the data conversion layer of the upper network can be:
[0124]
[0125] Among them, μ(h i,t ) is the splicing state data h i,tThe corresponding state transition data; and b μ are the model parameters of the data conversion layer respectively.
[0126] The expression of the output layer can be:
[0127]
[0128] in, is the predicted transaction volume at time t in the i-th time window.
[0129] For example, Figure 4 For the present invention Figure 3 The structural diagram of the transaction volume prediction model in the embodiment shown is as follows: Figure 4 As shown, the transaction volume prediction model includes an underlying network set at each application end, an upper network set at the first application end, and an intermediate layer set at the service end. Figure 4 In the example of a second application end, the second application end data may be multiple, such as 2, 3, 4 or other data. The input layer of the underlying network uses an embedding layer. Figure 4 In the example, the length of the time window is 3. Assume that the transaction volume y at time t needs to be predicted. t , then the transaction volume sample data y t-3 ,y t-2 and t-1 As the model input corresponding to the current time window, and the covariate sample data x t-2 、x t-1 and x t As the model input corresponding to the current time window, the transaction volume sample data and the covariate sample data are respectively embedded into the hidden layer of the corresponding underlying network through Embedding. The hidden layer can be composed of a 3-layer LSTM network model. The LSTM is used to extract features and generate the state data corresponding to each time node in the current time window, that is, h t-3 、h t-2 and h t-1 , and encrypt the state data of the current time window to generate encrypted state data encryped(h active ) and encryped(h passive The encrypted state data is transmitted to the server, and the encrypted state data is decrypted and spliced through the middle layer of the server to obtain the spliced state data h i,t , and then the server will splice the status data h i,t The data is sent to the upper network of the first application end, and the upper network generates a predicted transaction volume based on the splicing state data.
[0130] In some embodiments, the specific structure of the underlying network of each application end may be the same.
[0131] S303: For each time window, generate a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window, and update the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window.
[0132] Specifically, for each time window or each iteration process, after generating the predicted transaction volume corresponding to the time window, based on the predicted transaction volume corresponding to the time window and the actual transaction volume corresponding to the time window, a first gradient for updating the model parameters is calculated, thereby updating the model parameters of the upper network of the first application end based on the first gradient.
[0133] Furthermore, for each time window, after generating the predicted transaction volume corresponding to the time window, the value of the loss function and the first gradient of the loss function can be calculated based on the actual transaction volume and the predicted transaction corresponding to the time window.
[0134] Specifically, the model parameters of the upper network can be updated by reversely conducting the first gradient.
[0135] S304, based on the upper network after the model parameters are updated and the first gradient corresponding to the time window, generate the second gradient corresponding to the time window, and send the second gradient corresponding to the time window to the server, so as to split the second gradient corresponding to the time window into third gradients corresponding to the time window of each application end through the server, so as to update the model parameters of the underlying network of each application end based on the third gradients corresponding to the time window, and obtain an updated transaction volume prediction model.
[0136] Specifically, in each time window, after the upper network is updated, based on the chain rule, according to the model parameters of the upper network after the model parameters are updated and the first gradient, a second gradient for updating the model parameters of each underlying network is calculated.
[0137] In some embodiments, before sending the second gradient to the server, in order to improve the security of data interaction, the second gradient can be encrypted, and then the encrypted second gradient is decrypted and split by the server to obtain the third gradient corresponding to the underlying network of each application end. Among them, the splicing operation and splitting operation of the server can be two inverse operations. The service sends each third gradient to the corresponding application end, so as to update the model parameters of each underlying network through the reverse conduction of the third gradient in the underlying network, so as to obtain an updated transaction volume prediction model, thus completing an iterative process, which can be repeated multiple times until a stable transaction volume prediction model is obtained, or the number of iterations reaches a preset maximum number.
[0138] The state data and gradient are interacted through the set server, which avoids the data interaction between different application terminals and improves the security of application terminal data.
[0139] Based on the above analysis, it can be seen that an embodiment of the present invention provides a model training method for transaction volume prediction, wherein the transaction prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The training method mainly includes: inputting sample data through the underlying network set at each application end, including transaction volume sample data corresponding to the first application end and covariate sample data corresponding to each second application end, outputting status data of each application end through the underlying network of each application end, splicing the status data of each application end based on the server end, and sending the spliced status data to the upper network of the first application end, thereby obtaining the predicted transaction volume, realizing an iterative process, and updating the model parameters through the gradient corresponding to each iteration and the gradient of different application ends based on the server end until the model training is completed, thereby outputting the trained transaction volume prediction model, and predicting the transaction volume based on the transaction volume prediction model, realizing transaction volume prediction based on multi-party data, improving prediction accuracy, and through the method of federated learning, realizing the interaction of data of different application ends through the server end, improving the security of data of each application end.
[0140] Figure 5 A flow chart of a model training method for transaction volume prediction provided by another embodiment of the present invention is provided in Figure 3 Based on the embodiment shown, step S301 and step S303 are further refined, as shown in FIG. Figure 5 As shown, the model training method provided in this embodiment may include the following steps:
[0141] S501, inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end in turn, encoding the transaction volume sample data corresponding to each time window based on the encoder of the underlying network of the first application end to obtain feature encoding data.
[0142] Specifically, based on the encoder in the underlying network of each application end, the sample data corresponding to each time window is self-encoded to obtain feature encoding data corresponding to each time window, such as 128-dimensional feature encoding data.
[0143] S502: Based on the hidden layer of the underlying network of the first application end, extract features from the feature coded data corresponding to the time window to obtain state data corresponding to the time window.
[0144] S503, encrypting the status data corresponding to each time window, and sending the encrypted status data of each time window to the server.
[0145] The server decrypts and splices the status data of each time window received from each application end, thereby generating spliced status data corresponding to each time window.
[0146] S504: input the splicing status data corresponding to each time window sent by the server into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window.
[0147] Among them, the spliced status data corresponding to each time window is spliced by the status data corresponding to the time window output by the server to the underlying network of each application end, and the status data corresponding to each time window of the second application end is generated by the underlying network of the second application end according to the covariate sample data corresponding to the time window, and the covariate is a characteristic variable related to the transaction volume.
[0148] S505 , for each time window, calculating a value of a loss function corresponding to the time window according to a preset transaction volume and an actual transaction volume corresponding to the time window.
[0149] The loss function may be any loss function, such as a mean square error (MSE) loss function, a mean absolute error (MAE) loss function, or the like.
[0150] In each time window, after the upper network outputs the predicted transaction volume value of the time window, the actual transaction volume value of the time window and the loss function are combined to determine the prediction error corresponding to the time window, that is, the value of the loss function corresponding to the time window.
[0151] S506, determining whether the values of the loss functions corresponding to the time window and a preset number of time windows before the time window meet preset conditions.
[0152] Among them, the preset number can be 3, 4, 5 or other values, and can be customized.
[0153] Specifically, if the values of the loss function corresponding to the current time window and a preset number of time windows before the current time window are less than or equal to the preset threshold, then the preset condition is established, that is, the preset condition is met; otherwise, it is not met.
[0154] If the preset conditions are met, the model training is completed and a stable transaction volume prediction model is obtained, so that transaction volume prediction can be performed based on the trained transaction volume prediction model.
[0155] In some embodiments, an upper limit value for the number of iterations, such as a maximum number of iterations, may also be set. When the number of iterations reaches the maximum number of iterations, the model training is forcibly stopped.
[0156] S507: If not, then calculating the first gradient of the loss function of the upper network corresponding to the time window according to the preset transaction volume and the actual transaction volume corresponding to the time window.
[0157] When the preset conditions are not met, it means that the trading volume prediction model is not stable yet, and the model parameters need to be updated through the reverse conduction of the gradient.
[0158] Specifically, when the preset conditions are not met, the first gradient of the loss function of the upper network in the time window can be calculated based on the gradient descent algorithm according to the preset transaction volume and actual transaction volume corresponding to the time window, so as to determine the gradient that makes the loss function decrease the fastest, thereby accelerating the speed of model convergence or stabilization and improving the efficiency of model training.
[0159] S508: Update the model parameters of the upper network by reversely transmitting the first gradient corresponding to the time window in the upper network.
[0160] S509, based on the upper network after the model parameters are updated and the first gradient corresponding to the time window, generate the second gradient corresponding to the time window, and send the second gradient corresponding to the time window to the server, so as to split the second gradient corresponding to the time window into third gradients corresponding to the time window of each application end through the server, so as to update the model parameters of the underlying network of each application end based on the third gradients corresponding to the time window, and obtain an updated transaction volume prediction model.
[0161] In this embodiment, for each application terminal, the sample data is encoded by the encoder of the underlying network set by the application terminal to obtain feature encoded data, and then the feature encoded data is input into the hidden layer of the underlying network of the application terminal, and the state data of the application terminal is output through the hidden layer. Each application terminal sends the encrypted state data to the server, and the encrypted state data is decrypted and spliced based on the server to obtain spliced state data, and the spliced state data is sent to the upper network of the first application terminal, so as to obtain the predicted transaction volume. When the model is determined to be unstable based on the loss function, the gradient of the loss function is calculated to achieve an iterative method. In the process of iteration, the upper network is updated through the gradient corresponding to each iteration, and the gradient is split and sent to each application end based on the server, so as to realize the update of the underlying network of each application end, thereby obtaining the updated model parameters, and through multiple iterations, until the transaction volume prediction model is stable or the number of iterations reaches the preset number, the trained transaction volume prediction model is output, and the transaction volume is predicted based on the transaction volume prediction model, which realizes the transaction volume prediction based on multi-party data and improves the prediction accuracy. In addition, through the method of federated learning, the interaction of data of different application ends is realized through the server, which improves the security of data of each application end.
[0162] Figure 6 A flow chart of a model training method for transaction volume prediction provided in another embodiment of the present invention, wherein the transaction volume prediction model mentioned in the embodiment of the present invention includes an underlying network set at each application end, and an upper network set at the first application end, and the transaction volume prediction model is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end, and the model training method provided in this embodiment is applied to the second application end, and the second application end is a provider of historical data of covariates of transaction volume, such as Figure 6 As shown, the model training method includes:
[0163] S601, input the covariate sample data corresponding to each time window into the underlying network of the second application end in turn to obtain the state data corresponding to each time window.
[0164] S602, sending the status data corresponding to each time window to the server, so that the server splices the status data corresponding to the second application end and the first application end received in each time window to obtain the spliced status data corresponding to each time window.
[0165] The status data corresponding to each time window of the first application end is obtained by inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end.
[0166] S603: For each time window, update the model parameters of the underlying network of the second application end according to the third gradient of the second application end corresponding to the time window.
[0167] Among them, the third gradient corresponding to the time window is obtained by splitting the second gradient corresponding to the time window by the server, the second gradient corresponding to the time window is generated by the upper network of the first application end after updating the model parameters based on the first gradient corresponding to the time window and the first gradient corresponding to the time window, the first gradient corresponding to the time window is generated by the first application end according to the predicted transaction volume and actual transaction volume output by the upper network of the first application end corresponding to the time window, and the predicted transaction volume corresponding to the time window is obtained by inputting the splicing state data corresponding to the time window sent by the server into the upper network of the first application end.
[0168] Optionally, the underlying network includes an input layer and a hidden layer composed of a preset number of long short-term memory networks, and the covariate sample data corresponding to each time window is input into the underlying network of the second application end in turn to obtain the state data corresponding to each time window, including: for each time window, inputting the covariate sample data corresponding to the time window into the input layer of the underlying network of the second application end; based on the hidden layer of the underlying network of the second application end, performing feature extraction on the transaction volume sample data corresponding to the time window to obtain the state data corresponding to the time window.
[0169] Optionally, the input layer is an encoder, which inputs the covariate sample data corresponding to the time window into the input layer of the underlying network of the second application end, including: based on the underlying network encoder of the second application end, encoding the covariate sample data corresponding to each time window to obtain feature encoding data.
[0170] Correspondingly, based on the hidden layer of the underlying network of the second application end, feature extraction is performed on the covariate sample data corresponding to the time window to obtain the state data corresponding to the time window, including: based on the hidden layer of the underlying network of the second application end, feature extraction is performed on the feature coding data corresponding to the time window to obtain the state data corresponding to the time window.
[0171] Optionally, after obtaining the status data corresponding to each time window, the method further includes: encrypting the status data corresponding to each time window, and sending the encrypted status data of each time window to the server, so that the server decrypts and splices the status data of each time window received from each application end to obtain the spliced status data corresponding to each time window.
[0172] Since the second application end is only provided with the underlying network, its corresponding model training method can be similar to the part about the underlying network training in the model training method corresponding to the first application end. Only the data input to the underlying network is replaced by the transaction volume sample data with the covariate sample data, which will not be elaborated here.
[0173] Figure 7 A flow chart of a model training method for transaction volume prediction provided by another embodiment of the present invention. The transaction volume prediction model mentioned in the embodiment of the present invention includes an underlying network set at each application end, and an upper network set at the first application end. The transaction volume prediction model is applied to multiple participants participating in federated learning, including a first application end, a server end, and at least one second application end. The model training method provided in this embodiment is applied to the server end, which is not a data provider and is only used for data splicing, splitting and transfer, such as Figure 7 As shown, the model training method includes:
[0174] S701: For each time window, receive status data of the time window sent by each application terminal.
[0175] Among them, the status data corresponding to the time window of the first application end is obtained by inputting the transaction volume sample data corresponding to the time window into the underlying network of the first application end, and the status data corresponding to the time window of the second application end is obtained by inputting the covariate sample data corresponding to the time window into the underlying network of the second application end.
[0176] S702: splicing the state data of the time window sent by each application terminal to obtain spliced state data corresponding to the time window.
[0177] S703: Send the splicing status data corresponding to the time window to an upper network of the first application end.
[0178] The predicted transaction volume corresponding to the time window is obtained by inputting the splicing state data corresponding to the time window into the upper network of the first application end, and the first gradient corresponding to the time window is generated based on the predicted transaction volume corresponding to the time window and the actual transaction volume, the model parameters of the upper network of the first application end are updated according to the first gradient corresponding to the time window, and the second gradient corresponding to the time window is generated according to the upper network after the model parameters are updated and the first gradient corresponding to the time window.
[0179] S704, receiving the second gradient corresponding to the time window, and splitting the second gradient corresponding to the time window to generate a third gradient corresponding to the time window of each application end, so as to update the model parameters of the underlying network of each application end based on the third gradient corresponding to the time window, so as to obtain an updated transaction volume prediction model.
[0180] Optionally, the status data of the time window sent by each application end is encrypted status data, and the status data of the time window sent by each application end is spliced to obtain the spliced status data corresponding to the time window, including: decrypting and splicing the status data of the time window sent by each application end to obtain the spliced status data corresponding to the time window.
[0181] Optionally, after generating the third gradient corresponding to the time window of each application end, the method further includes:
[0182] The third gradient corresponding to the time window of each application end is encrypted.
[0183] Correspondingly, after receiving the encrypted third gradient corresponding to the time window, each application end decrypts the encrypted third gradient and updates the model parameters of the underlying network of the application end based on the third gradient corresponding to the time window.
[0184] Figure 8 A flow chart of a model-based transaction volume prediction method provided for an embodiment of the present invention. The transaction volume prediction model mentioned in the embodiment of the present invention includes an underlying network set at each application end, and an upper network set at a first application end. The transaction volume prediction model is applied to multiple participants participating in federated learning, including a first application end, a service end, and at least one second application end. The model training method provided in this embodiment is applied to the first application end, such as Figure 8 As shown, the model training method includes:
[0185] S801, obtain historical transaction volume.
[0186] The historical transaction volume may be the latest transaction volume of the first application end within a preset time length, and the preset time length may be the length corresponding to the above-mentioned time window.
[0187] Specifically, the first application end can obtain the above-mentioned historical transaction volume by monitoring the transaction volume at each time node in the historical time, and then input the historical transaction volume into a pre-trained transaction volume prediction model, so as to perform transaction volume prediction based on the transaction volume prediction model.
[0188] S802: Based on a pre-trained transaction volume prediction model, the historical transaction volume and covariate data corresponding to the historical transaction volume are processed to generate a predicted transaction volume corresponding to the historical transaction volume.
[0189] Among them, the transaction volume prediction model is based on Figure 3 or Figure 5 Generated by the model training method provided by any corresponding embodiment.
[0190] Optionally, based on a pre-trained transaction volume prediction model, the historical transaction volume and the covariate data corresponding to the historical transaction volume are processed, including: inputting the historical transaction volume into the underlying network of the first application end to obtain the status data output by the underlying network of the first application end; inputting the spliced status data sent by the server end into the upper network of the first application end to generate the predicted transaction volume corresponding to the historical transaction volume, wherein the spliced status data is generated by splicing the status data of each application end through the server end, the each application end includes the first application end and at least one second application end, and the status data of the second application end is generated by the underlying network of the second application end according to the covariate data corresponding to the historical transaction volume.
[0191] Optionally, the underlying network includes an input layer and a hidden layer consisting of a long short-term memory network with a preset number of layers, and the historical transaction volume is input into the underlying network of the first application end to obtain status data output by the underlying network of the first application end, including: inputting the historical transaction volume into the input layer of the underlying network of the first application end; and performing feature extraction on the historical transaction volume based on the hidden layer of the underlying network of the first application end to obtain status data corresponding to the historical transaction volume.
[0192] Optionally, the input layer is an encoder, and the historical transaction volume is input into the input layer of the underlying network of the first application end, including: encoding the historical transaction volume based on the underlying network encoder of the first application end to obtain feature encoding data.
[0193] Correspondingly, based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the historical transaction volume to obtain status data corresponding to the historical transaction volume, including: based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the feature encoding data to obtain status data corresponding to the historical transaction volume.
[0194] Optionally, the upper network includes a data conversion layer and an output layer, and inputs the splicing status data corresponding to each time window sent by the server into the upper network of the first application end to generate a predicted transaction volume corresponding to the historical transaction volume, including: inputting the splicing status data sent by the server into the data conversion layer of the upper network of the first application end to output state conversion data; and performing feature extraction on the state conversion data based on the output layer of the upper network to obtain the predicted transaction volume corresponding to the historical transaction volume.
[0195] Optionally, after obtaining the status data output by the underlying network of the first application end, the method further includes: encrypting the status data and sending the encrypted status data to the server end, so that the server end decrypts and splices the status data received from each application end to obtain spliced status data.
[0196] Fig. 9 A schematic diagram of a model training device for transaction volume prediction provided by an embodiment of the present invention, wherein the transaction volume prediction model is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end, and the transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end, and the device is applied to the first application end, such as Fig. 9 As shown, the model training device includes: a first input module 910, a second input module 920, a first gradient generation module 930 and a first parameter updating module 940.
[0197] Among them, the first input module 910 is used to input the transaction volume sample data corresponding to each time window into the underlying network of the first application end in turn to obtain the state data corresponding to each time window; the second input module 920 is used to input the spliced state data corresponding to each time window sent by the server end into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window, wherein the spliced state data corresponding to each time window is spliced by the state data corresponding to each time window output by the server end to the underlying network of each application end, and the state data corresponding to each time window of the second application end is generated by the underlying network of the second application end according to the covariate sample data corresponding to each time window, and the covariate is a characteristic variable related to the transaction volume; the first gradient A generation module 930 is used to generate, for each time window, a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window, and update the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window; a first parameter updating module 940 is used to generate a second gradient corresponding to the time window according to the upper network after the model parameters are updated and the first gradient corresponding to the time window, and send the second gradient corresponding to the time window to the server end, so as to split the second gradient corresponding to the time window into third gradients corresponding to the time window of each application end via the server end, so as to update the model parameters of the underlying network of each application end based on the third gradients corresponding to the time window, and obtain an updated transaction volume prediction model.
[0198] Optionally, the underlying network includes an input layer and a hidden layer consisting of a long short-term memory network with a preset number of layers. The first input module 910 is specifically used to: for each time window, input the transaction volume sample data corresponding to the time window into the input layer of the underlying network of the first application end; based on the hidden layer of the underlying network of the first application end, perform feature extraction on the transaction volume sample data corresponding to the time window to obtain status data corresponding to the time window.
[0199] Optionally, the input layer is an encoder, and the first input module 910 is specifically used to: input the transaction volume sample data corresponding to the time window into the input layer of the underlying network of the first application end, and based on the encoder of the underlying network of the first application end, encode the transaction volume sample data corresponding to each time window to obtain feature encoding data; based on the hidden layer of the underlying network of the first application end, perform feature extraction on the feature encoding data corresponding to the time window to obtain state data corresponding to the time window.
[0200] Optionally, the upper network includes a data conversion layer and an output layer, and the second input module 920 is specifically used to: input the splicing state data corresponding to each time window sent by the server into the data conversion layer of the upper network of the first application end in sequence to output the state conversion data corresponding to each time window; based on the output layer of the upper network, perform feature extraction on the state conversion data corresponding to each time window to obtain the predicted transaction volume corresponding to each time window.
[0201] Optionally, the first gradient generation module 930 is specifically used to: for each time window, calculate the first gradient of the loss function of the upper network corresponding to the time window according to the preset transaction volume and the actual transaction volume corresponding to the time window; and update the model parameters of the upper network by reversely conducting the first gradient corresponding to the time window in the upper network.
[0202] Optionally, the device also includes: a first encryption module, which is used to encrypt the status data corresponding to each time window after obtaining the status data corresponding to each time window, and send the encrypted status data of each time window to the server, so that the server can decrypt and splice the status data of each time window received from each application end to obtain the spliced status data corresponding to each time window.
[0203] Optionally, the first gradient generation module 930 is specifically used to: for each time window, calculate the value of the loss function corresponding to the time window according to the preset transaction volume and actual transaction volume corresponding to the time window; determine whether the values of the loss function corresponding to the time window and a preset number of time windows before the time window meet preset conditions; if not, generate a first gradient corresponding to the time window according to the predicted transaction volume and actual transaction volume corresponding to the time window, and update the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window.
[0204] The model training device for transaction volume prediction provided in this embodiment can execute the present invention Figure 3 or Figure 5 The model training method for transaction volume prediction provided in any embodiment has the corresponding functional modules and beneficial effects of the execution method.
[0205] Fig.10 A schematic diagram of a model training device for transaction volume prediction provided in another embodiment of the present invention, wherein the transaction volume prediction model is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end, and the transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end, and the device is applied to the second application end, such as Fig.10 As shown, the model training device includes: a third input module 1010, a first data sending module 1020 and a second parameter updating module 1030.
[0206] Among them, the third input module 1010 is used to input the covariate sample data corresponding to each time window into the underlying network of the second application end in turn to obtain the state data corresponding to each time window; the first data sending module 1020 is used to send the state data corresponding to each time window to the server end, so that the server end splices the state data corresponding to the second application end and the first application end received in each time window to obtain the spliced state data corresponding to each time window, wherein the state data corresponding to each time window of the first application end is obtained by inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end; the second parameter updating module 1030 is used to update the state data corresponding to each time window according to the state data corresponding to the time window. The third gradient of the second application end updates the model parameters of the underlying network of the second application end, wherein the third gradient corresponding to the time window is obtained by splitting the second gradient corresponding to the time window by the server end, the second gradient corresponding to the time window is generated by the upper network of the first application end after updating the model parameters based on the first gradient corresponding to the time window and the first gradient corresponding to the time window, the first gradient corresponding to the time window is generated by the first application end according to the predicted transaction volume and the actual transaction volume output by the upper network of the first application end corresponding to the time window, and the predicted transaction volume corresponding to the time window is obtained by inputting the splicing state data corresponding to the time window sent by the server end into the upper network of the first application end.
[0207] Optionally, the underlying network includes an input layer and a hidden layer consisting of a long short-term memory network with a preset number of layers. The third input module 1010 is specifically used to: for each time window, input the covariate sample data corresponding to the time window into the input layer of the underlying network of the second application end; based on the hidden layer of the underlying network of the second application end, perform feature extraction on the transaction volume sample data corresponding to the time window to obtain the state data corresponding to the time window.
[0208] Optionally, the input layer is an encoder, and the third input module 1010 is specifically used to: input the covariate sample data corresponding to each time window into the underlying network of the second application end in sequence, and based on the underlying network encoder of the second application end, encode the covariate sample data corresponding to each time window to obtain feature encoded data; based on the hidden layer of the underlying network of the second application end, perform feature extraction on the feature encoded data corresponding to the time window to obtain state data corresponding to the time window.
[0209] Optionally, the device also includes: a second encryption module, which is used to encrypt the status data corresponding to each time window after obtaining the status data corresponding to each time window, and send the encrypted status data of each time window to the server, so that the server can decrypt and splice the status data of each time window received from each application end to obtain the spliced status data corresponding to each time window.
[0210] The model training device for transaction volume prediction provided in this embodiment can execute the present invention Figure 6 The model training method for transaction volume prediction provided by the corresponding embodiment has the corresponding functional modules and beneficial effects of the execution method.
[0211] Fig.11 A schematic diagram of a model training device for transaction volume prediction provided in another embodiment of the present invention, wherein the transaction volume prediction model is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end, and the transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end, and the device is applied to the service end, such as Fig.11 As shown, the model training device includes: a data receiving module 1110, a data splicing module 1120, a second data sending module 1130 and a gradient splitting module 1140.
[0212] The data receiving module 1110 is used to receive the status data of the time window sent by each application end for each time window, wherein the status data corresponding to the time window of the first application end is obtained by inputting the transaction volume sample data corresponding to the time window into the underlying network of the first application end, and the status data corresponding to the time window of the second application end is obtained by inputting the covariate sample data corresponding to the time window into the underlying network of the second application end; the data splicing module 1120 is used to splice the status data of the time window sent by each application end to obtain the spliced status data corresponding to the time window; the second data sending module 1130 is used to send the spliced status data corresponding to the time window to the upper network of the first application end, so as to obtain the spliced status data corresponding to the time window by inputting the spliced status data corresponding to the time window into the underlying network of the second application end. The state data is input into the upper network of the first application end to obtain the predicted transaction volume corresponding to the time window, so as to generate the first gradient corresponding to the time window based on the predicted transaction volume corresponding to the time window and the actual transaction volume, update the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window, and generate the second gradient corresponding to the time window according to the upper network after the model parameters are updated and the first gradient corresponding to the time window; the gradient splitting module 1140 is used to receive the second gradient corresponding to the time window, and split the second gradient corresponding to the time window to generate the third gradient corresponding to the time window of each application end, so as to update the model parameters of the underlying network of each application end based on the third gradient corresponding to the time window, so as to obtain an updated transaction volume prediction model.
[0213] Optionally, the status data of the time window sent by each application terminal is encrypted status data, and the data splicing module 1120 is specifically used to: decrypt and splice the status data of the time window sent by each application terminal to obtain the spliced status data corresponding to the time window.
[0214] Optionally, the device further includes: a third encryption module, configured to encrypt the third gradient corresponding to the time window of each application end after generating the third gradient corresponding to the time window of each application end.
[0215] The model training device for transaction volume prediction provided in this embodiment can execute the present invention Figure 7 The model training method for transaction volume prediction provided by the corresponding embodiment has the corresponding functional modules and beneficial effects of the execution method.
[0216] Fig.12 A schematic diagram of the structure of a model-based transaction volume prediction device provided by an embodiment of the present invention, wherein the device is applied to a first application end, such as Fig.12As shown, the transaction volume prediction device includes: a historical transaction volume acquisition module 1210 and a transaction volume prediction module 1220.
[0217] The historical transaction volume acquisition module 1210 is used to acquire the historical transaction volume; the transaction volume prediction module 1220 is used to process the historical transaction volume and the covariate data corresponding to the historical transaction volume based on the pre-trained transaction volume prediction model to generate the predicted transaction volume corresponding to the historical transaction volume, wherein the transaction volume prediction model is based on Figure 3 or Figure 5 Generated by the model training method provided by any corresponding embodiment.
[0218] Optionally, the transaction volume prediction module 1220 includes: a state data generation unit, used to input the historical transaction volume into the underlying network of the first application end to obtain the state data output by the underlying network of the first application end; a transaction volume prediction unit, used to input the spliced state data sent by the server end into the upper network of the first application end to generate a predicted transaction volume corresponding to the historical transaction volume, wherein the spliced state data is generated by splicing the state data of each application end through the server end, the each application end includes the first application end and at least one second application end, and the state data of the second application end is generated by the underlying network of the second application end according to the covariate data corresponding to the historical transaction volume.
[0219] Optionally, the underlying network includes an input layer and a hidden layer consisting of a long short-term memory network with a preset number of layers, and the state data generation unit is specifically used to: input the historical transaction volume into the input layer of the underlying network of the first application end; based on the hidden layer of the underlying network of the first application end, perform feature extraction on the historical transaction volume to obtain state data corresponding to the historical transaction volume.
[0220] Optionally, the input layer is an encoder, and the state data generating unit is specifically used to: input the historical transaction volume into the input layer of the underlying network of the first application end, and encode the historical transaction volume based on the underlying network encoder of the first application end to obtain feature encoding data; based on the hidden layer of the underlying network of the first application end, perform feature extraction on the feature encoding data to obtain state data corresponding to the historical transaction volume.
[0221] Optionally, the upper network includes a data conversion layer and an output layer, and a transaction volume prediction unit, which is specifically used to: input the splicing state data sent by the server into the data conversion layer of the upper network of the first application end to output state conversion data; based on the output layer of the upper network, perform feature extraction on the state conversion data to obtain the predicted transaction volume corresponding to the historical transaction volume.
[0222] Optionally, the device also includes: a data encryption module, which is used to encrypt the status data after obtaining the status data output by the underlying network of the first application end, and send the encrypted status data to the server end, so that the server end can decrypt and splice the status data received from each application end to obtain spliced status data.
[0223] The model-based transaction volume prediction device provided in this embodiment can execute the present invention Figure 8 The model-based transaction volume prediction method provided by the corresponding embodiment has the corresponding functional modules and beneficial effects of the execution method.
[0224] Fig.13 The following is a schematic diagram of the structure of an electronic device provided by one embodiment of the present invention. Fig.13 As shown, the electronic device includes: a memory 1310 and at least one processor 1320; the memory 1310 is used to store executable instructions of the processor 1320; wherein the processor 1320 is configured to execute the model training method for transaction volume prediction provided by any embodiment of the present invention, and / or, a model-based transaction volume prediction method, by executing the executable instructions.
[0225] Optionally, the memory 1310 may be independent or integrated with the processor 1320 .
[0226] Optionally, when the memory 1310 is a device independent of the processor 1320, the electronic device may further include:
[0227] The bus 1330 is used to connect the above devices, namely the memory 1310 and the processor 1320 .
[0228] For related instructions, please refer to Figure 3 , Figure 5 as well as Figures 6 to 8 The relevant descriptions and effects corresponding to the steps are understood, and no further elaboration is given here.
[0229] An embodiment of the present invention further provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the model training method for transaction volume prediction or the model-based transaction volume prediction method provided by any embodiment of the present invention is implemented.
[0230] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the model training method for transaction volume prediction or the model-based transaction volume prediction method provided by any embodiment of the present invention.
[0231] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0232] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A model training method for transaction volume prediction, characterized in that: The method is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end and an upper network set at the first application end. The method is applied to the first application end, and the method includes: Inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end in turn to obtain the status data corresponding to each time window; Input the spliced state data corresponding to each time window sent by the server into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window, wherein the spliced state data corresponding to each time window is spliced by the state data corresponding to the time window output by the server to the underlying network of each application end, and the state data corresponding to each time window of the second application end is generated by the underlying network of the second application end according to the covariate sample data corresponding to the time window, and the covariate is a characteristic variable related to the transaction volume; For each time window, generating a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window, and updating the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window; According to the upper network after the model parameters are updated and the first gradient corresponding to the time window, a second gradient corresponding to the time window is generated, and the second gradient corresponding to the time window is sent to the server, so that the second gradient corresponding to the time window is split into third gradients corresponding to the time window of each application end via the server, so as to update the model parameters of the underlying network of each application end based on the third gradients corresponding to the time window, so as to obtain an updated transaction volume prediction model.
2. The method according to claim 1, characterized in that The underlying network includes an input layer and a hidden layer consisting of a long short-term memory network with a preset number of layers. The transaction volume sample data corresponding to each time window is input into the underlying network of the first application end in turn to obtain the state data corresponding to each time window, including: For each time window, inputting the transaction volume sample data corresponding to the time window into the input layer of the underlying network of the first application end; Based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the transaction volume sample data corresponding to the time window to obtain state data corresponding to the time window.
3. The method according to claim 2, characterized in that The input layer is an encoder, which inputs the transaction volume sample data corresponding to the time window into the input layer of the underlying network of the first application end, including: Based on the underlying network encoder of the first application end, the transaction volume sample data corresponding to each time window is encoded to obtain feature encoding data; Correspondingly, based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the transaction volume sample data corresponding to the time window to obtain state data corresponding to the time window, including: Based on the hidden layer of the underlying network of the first application end, feature extraction is performed on the feature encoding data corresponding to the time window to obtain state data corresponding to the time window.
4. The method according to claim 1, characterized in that The upper network includes a data conversion layer and an output layer, and inputs the splicing state data corresponding to each time window sent by the server into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window, including: sequentially inputting the splicing state data corresponding to each time window sent by the server into the data conversion layer of the upper network of the first application end to output the state conversion data corresponding to each time window; Based on the output layer of the upper network, feature extraction is performed on the state transition data corresponding to each time window to obtain the predicted transaction volume corresponding to each time window.
5. The method according to any one of claims 1 to 4, characterized in that: Generating a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window, and updating a model parameter of an upper network of the first application end according to the first gradient corresponding to the time window, including: Calculate the first gradient of the loss function of the upper network corresponding to the time window according to the preset transaction volume and the actual transaction volume corresponding to the time window; The model parameters of the upper network are updated by reversely conducting the first gradient corresponding to the time window in the upper network.
6. The method according to any one of claims 1 to 4, characterized in that: After obtaining the status data corresponding to each time window, the method further includes: The status data corresponding to each time window is encrypted, and the encrypted status data of each time window is sent to the server, so that the server decrypts and splices the status data of each time window received from each application end to obtain the spliced status data corresponding to each time window.
7. The method according to any one of claims 1 to 4, characterized in that: Generating a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window includes: Calculating the value of the loss function corresponding to the time window according to the preset transaction volume and the actual transaction volume corresponding to the time window; Determine whether the values of the loss function corresponding to the time window and a preset number of time windows before the time window meet preset conditions; If not, a first gradient corresponding to the time window is generated according to the predicted transaction volume and actual transactions corresponding to the time window.
8. A model training method for transaction volume prediction, characterized in that: The method is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end and an upper network set at the first application end. The method is applied to the second application end, and the method includes: Inputting the covariate sample data corresponding to each time window into the underlying network of the second application end in turn to obtain the state data corresponding to each time window; Sending the status data corresponding to each time window to the server, so that the server splices the status data corresponding to the second application end and the first application end received in each time window to obtain the spliced status data corresponding to each time window, wherein the status data corresponding to each time window of the first application end is obtained by inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end; For each time window, the model parameters of the underlying network of the second application end are updated according to the third gradient of the second application end corresponding to the time window, wherein the third gradient corresponding to the time window is obtained by splitting the second gradient corresponding to the time window by the server end, the second gradient corresponding to the time window is generated by the upper network of the first application end after updating the model parameters based on the first gradient corresponding to the time window and the first gradient corresponding to the time window, the first gradient corresponding to the time window is generated by the first application end according to the predicted transaction volume and actual transaction volume output by the upper network of the first application end corresponding to the time window, and the predicted transaction volume corresponding to the time window is obtained by inputting the splicing state data corresponding to the time window sent by the server end into the upper network of the first application end.
9. A model training method for transaction volume prediction, characterized in that: The method is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The method is applied to the service end, and the method includes: For each time window, receiving the state data of the time window sent by each application end, wherein the state data corresponding to the time window of the first application end is obtained by inputting the transaction volume sample data corresponding to the time window into the underlying network of the first application end, and the state data corresponding to the time window of the second application end is obtained by inputting the covariate sample data corresponding to the time window into the underlying network of the second application end; splicing the state data of the time window sent by each application end to obtain spliced state data corresponding to the time window; Sending the splicing state data corresponding to the time window to the upper network of the first application end, so as to obtain the predicted transaction volume corresponding to the time window by inputting the splicing state data corresponding to the time window into the upper network of the first application end, so as to generate the first gradient corresponding to the time window based on the predicted transaction volume corresponding to the time window and the actual transaction volume, updating the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window, and generating the second gradient corresponding to the time window according to the upper network after the model parameters are updated and the first gradient corresponding to the time window; Receive the second gradient corresponding to the time window, and split the second gradient corresponding to the time window to generate a third gradient corresponding to the time window of each application end, so as to update the model parameters of the underlying network of each application end based on the third gradient corresponding to the time window to obtain an updated transaction volume prediction model.
10. A model-based transaction volume prediction method, characterized in that: The method is applied to a first application end, and the method includes: Get historical transaction volume; Based on a pre-trained transaction volume prediction model, the historical transaction volume and the covariate data corresponding to the historical transaction volume are processed to generate a predicted transaction volume corresponding to the historical transaction volume, wherein the transaction volume prediction model is generated based on the method described in any one of claims 1 to 7.
11. The method according to claim 10, characterized in that Based on the pre-trained transaction volume prediction model, the historical transaction volume and the covariate data corresponding to the historical transaction volume are processed, including: Inputting the historical transaction volume into the underlying network of the first application end to obtain status data output by the underlying network of the first application end; The spliced status data sent by the server is input into the upper network of the first application terminal to generate the predicted transaction volume corresponding to the historical transaction volume, wherein the spliced status data is generated by the server after splicing the status data of each application terminal, the each application terminal includes the first application terminal and at least one second application terminal, and the status data of the second application terminal is generated by the underlying network of the second application terminal according to the covariate data corresponding to the historical transaction volume.
12. A model training device for transaction volume prediction, characterized in that: The device is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end and an upper network set at the first application end. The device is applied to the first application end, and the device includes: A first input module, used to sequentially input the transaction volume sample data corresponding to each time window into the underlying network of the first application end to obtain the status data corresponding to each time window; A second input module is used to input the spliced state data corresponding to each time window sent by the server into the upper network of the first application end to obtain the predicted transaction volume corresponding to each time window, wherein the spliced state data corresponding to each time window is spliced by the state data corresponding to each time window output by the server end to the underlying network of each application end, and the state data corresponding to each time window of the second application end is generated by the underlying network of the second application end according to the covariate sample data corresponding to each time window, and the covariate is a characteristic variable related to the transaction volume; A first gradient generating module, configured to generate, for each time window, a first gradient corresponding to the time window according to the predicted transaction volume and the actual transaction volume corresponding to the time window, and update the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window; The first parameter updating module is used to generate a second gradient corresponding to the time window according to the upper network after the model parameters are updated and the first gradient corresponding to the time window, and send the second gradient corresponding to the time window to the server, so as to split the second gradient corresponding to the time window into third gradients corresponding to the time window of each application end via the server, so as to update the model parameters of the underlying network of each application end based on the third gradients corresponding to the time window, so as to obtain an updated transaction volume prediction model.
13. A model training device for transaction volume prediction, characterized in that: The method is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The device is applied to the second application end, and the device includes: A third input module is used to sequentially input the covariate sample data corresponding to each time window into the underlying network of the second application end to obtain the state data corresponding to each time window; A first data sending module is used to send the status data corresponding to each time window to the server, so that the server splices the status data corresponding to the second application end and the first application end received in each time window to obtain the spliced status data corresponding to each time window, wherein the status data corresponding to each time window of the first application end is obtained by inputting the transaction volume sample data corresponding to each time window into the underlying network of the first application end; The second parameter updating module is used to update the model parameters of the underlying network of the second application end according to the third gradient of the second application end corresponding to the time window for each time window, wherein the third gradient corresponding to the time window is obtained by splitting the second gradient corresponding to the time window by the server end, the second gradient corresponding to the time window is generated by the upper network of the first application end after updating the model parameters based on the first gradient corresponding to the time window and the first gradient corresponding to the time window, the first gradient corresponding to the time window is generated by the first application end according to the predicted transaction volume and actual transaction volume output by the upper network of the first application end corresponding to the time window, and the predicted transaction volume corresponding to the time window is obtained by inputting the splicing state data corresponding to the time window sent by the server end into the upper network of the first application end.
14. A model training device for transaction volume prediction, characterized in that: The method is applied to multiple participants participating in federated learning, wherein the multiple participants include a first application end, a service end, and at least one second application end. The transaction volume prediction model includes an underlying network set at each application end, and an upper network set at the first application end. The device is applied to the service end, and the device includes: A data receiving module, configured to receive, for each time window, state data of the time window sent by each application end, wherein the state data corresponding to the time window of the first application end is obtained by inputting the transaction volume sample data corresponding to the time window into the underlying network of the first application end, and the state data corresponding to the time window of the second application end is obtained by inputting the covariate sample data corresponding to the time window into the underlying network of the second application end; A data splicing module, used for splicing the state data of the time window sent by each application end to obtain splicing state data corresponding to the time window; A second data sending module is used to send the splicing state data corresponding to the time window to the upper network of the first application end, so as to obtain the predicted transaction volume corresponding to the time window by inputting the splicing state data corresponding to the time window into the upper network of the first application end, so as to generate a first gradient corresponding to the time window based on the predicted transaction volume and the actual transaction volume corresponding to the time window, update the model parameters of the upper network of the first application end according to the first gradient corresponding to the time window, and generate a second gradient corresponding to the time window according to the upper network after the model parameters are updated and the first gradient corresponding to the time window; A gradient splitting module is used to receive the second gradient corresponding to the time window and split the second gradient corresponding to the time window to generate a third gradient corresponding to the time window of each application end, so as to update the model parameters of the underlying network of each application end based on the third gradient corresponding to the time window to obtain an updated transaction volume prediction model.
15. A model-based transaction volume prediction device, characterized in that: The device is applied to a first application end, and the device includes: Historical transaction volume acquisition module, used to obtain historical transaction volume; A trading volume prediction module, used to process the historical trading volume and the covariate data corresponding to the historical trading volume based on a pre-trained trading volume prediction model to generate a predicted trading volume corresponding to the historical trading volume, wherein the trading volume prediction model is generated based on the method described in any one of claims 1 to 7.
16. An electronic device, characterized in that: include: Memory and processor; The memory is used to store instructions executable by the processor; The processor is configured to execute the method of any one of claims 1-9 and / or the method of any one of claims 10-11 by executing the executable instructions.
17. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
18. A computer program product, characterized in that The invention comprises a computer program, which is used to implement the method according to any one of claims 1 to 11 when being executed by a processor.
Citation Information
Patent Citations
Personal credit risk prediction model training method and device
CN113487423A
Data commodity recommendation method and device, electronic equipment and computer readable storage medium
CN113807921A