CN118211999A - Data prediction method, device, computer equipment and storage medium - Google Patents

Data prediction method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN118211999A
CN118211999A CN202410193364.XA CN202410193364A CN118211999A CN 118211999 A CN118211999 A CN 118211999A CN 202410193364 A CN202410193364 A CN 202410193364A CN 118211999 A CN118211999 A CN 118211999A
Authority
CN
China
Prior art keywords
date
target
current
month
dates
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410193364.XA
Other languages
Chinese (zh)
Inventor
陈晓静
林昂基
赵雄洲
段艳会
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN202410193364.XA priority Critical patent/CN118211999A/en
Publication of CN118211999A publication Critical patent/CN118211999A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to the technical field of data processing, and discloses a data prediction method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: after receiving the transaction data prediction instruction, acquiring a target data set according to the current date and the current month; acquiring daily transaction data of each month according to the acquisition time, determining the duty ratio of the month, and acquiring a plurality of daily duty ratios; according to the acquisition time and the current date, carrying out average value processing on all daily occupation ratios corresponding to each target date to obtain a occupation ratio average value; and inputting all the duty ratio average values and daily transaction data which are cut off to the current date in the current month into a prediction model to obtain the predicted transaction total amount in the current month, and feeding back to the client. According to the invention, the data prediction is carried out on all daily transaction data and all duty ratio average values which are cut off to the current date in the current month through the prediction model, so that the prediction of the total amount of the transaction predicted in the current month is realized, and the accuracy and the flexibility of the data prediction are further improved.

Description

Data prediction method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data prediction method, a data prediction device, a computer device, and a storage medium.
Background
In the field of electronic commerce, accurate prediction of monthly commodity transaction totals (GMV, gross Merchandise Volume) in an e-commerce platform is critical to enterprise operational decisions, inventory management, and supply chain planning. The traditional GMV prediction method is mainly based on a statistical model or artificial experience, and lacks accuracy and flexibility for real-time data and complex business scenes. The existing prediction method often cannot fully consider factors such as special date, so that a prediction result is unstable and has larger error. Thus, there is a need for a more accurate GMV prediction method to accurately provide monthly GMV prediction results.
Disclosure of Invention
The invention provides a data prediction method, a data prediction device, computer equipment and a storage medium, which are used for solving the problem that the accuracy and the flexibility for real-time data and complex business scenes are lacked based on a simple statistical model or artificial experience in the prior art.
A method of data prediction, comprising:
After receiving a transaction data prediction instruction sent by a client, acquiring a target data set according to the current date and the current month; the target data set comprises a plurality of daily transaction data in a preset number of months before the current date and acquisition time corresponding to each daily transaction data;
Acquiring all daily transaction data of each month according to the acquisition time, determining the ratio of each daily transaction data to the total sum of all daily transaction data of the month in which the daily transaction data are located, and acquiring a plurality of daily ratio values;
determining a preset number of daily occupation ratios corresponding to each target date in the current month according to the acquisition time and the current date, and carrying out average processing on the preset number of daily occupation ratios corresponding to each target date to obtain an average value of occupation ratios corresponding to each target date one by one;
and inputting all the duty ratio average values and all the daily transaction data which are cut off to the current date in the current month into a prediction model to obtain the current month predicted transaction total amount output by the prediction model, and feeding back the current month predicted transaction total amount to a client.
A data prediction apparatus comprising:
the data acquisition module is used for acquiring a target data set according to the current date and the current month after receiving a transaction data prediction instruction sent by the client; the target data set comprises a plurality of daily transaction data in a preset number of months before the current date and acquisition time corresponding to each daily transaction data;
The duty ratio determining module is used for acquiring all daily transaction data of each month according to the acquisition time, determining the duty ratio between each daily transaction data and the total sum of all daily transaction data of the month where the daily transaction data are located, and acquiring a plurality of daily duty ratios;
The average value determining module is used for determining the preset number of daily occupation ratios corresponding to each target date in the current month according to the acquisition time and the current date, and carrying out average value processing on the preset number of daily occupation ratios corresponding to each target date to obtain an average value of the occupation ratios corresponding to each target date one by one;
And the data prediction module is used for inputting all the duty ratio average values and all the daily transaction data which are cut off to the current date in the current month into a prediction model, obtaining the current month predicted transaction total amount output by the prediction model, and feeding back the current month predicted transaction total amount to the client.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the data prediction method described above when executing the computer program.
A computer readable storage medium storing a computer program which when executed by a processor implements the data prediction method described above.
According to the data prediction method, the data prediction device, the computer equipment and the storage medium, the target data set comprises the daily transaction data in the preset number of months before the current date and the acquisition time corresponding to each daily transaction data, so that the determination of the duty ratio between the daily transaction data and the total daily transaction data of the month where the daily transaction data is located is realized, and the determination of the daily duty ratio is realized. According to the acquisition time and the current date, the daily occupation ratio of the preset number corresponding to each target date in the current month is determined, and the average value of the daily occupation ratio of the preset number corresponding to each target date is processed, so that the selection of the daily occupation ratio of the preset number is realized, and the calculation of the average value of the occupation ratios corresponding to each target date is realized. All duty ratio average values and all daily transaction data which are cut off to the current date in the current month are input into a prediction model, so that the prediction of the total amount of the predicted transaction of the current month is realized, and the accuracy and the flexibility of data prediction are further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of data prediction in an embodiment of the invention;
fig. 2 is a schematic block diagram of a data prediction apparatus according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The invention provides a data prediction method, in an embodiment, as shown in fig. 1, the technical scheme mainly comprises the following steps S10-S40:
S10, after a transaction data prediction instruction sent by a client is received, a target data set is obtained according to the current date and the current month; the target data set comprises a plurality of daily transaction data in a preset number of months before the current date and acquisition time corresponding to each daily transaction data.
The target data set is understandably a set of daily transaction data for a preset period of time (e.g., a preset number of months prior to the current date). The daily transaction data is GMV data (Gross Merchandise Volume, commodity transaction total) of each day in a preset time period. The collection time refers to the date of the daily transaction data, for example, 9 months 8 and so on. Further, a data prediction instruction is issued at the client, after the transaction data prediction instruction sent by the client is received, the current date and the current month are determined through the transaction data prediction instruction, that is, the month and the date included in the instruction or the month and the date when the instruction is issued can be obtained, and the current date and the current month are determined. Then, all daily transaction data of the current date and transaction dates corresponding to the daily transaction data in the current month are collected, or daily transaction data of each day in a preset time period are collected in real time, the collected transaction dates corresponding to the daily transaction data are determined to be collection time, and then a target data set is built according to all daily transaction data of the current date in the current month and the collection time corresponding to each daily transaction data, and the built target data set is stored in a database, so that the target data set can be directly called from the database. For example, GMV data of the last six months up to the current date in the current month is collected, or GMV data of the last three months up to the current date in the current month is collected, or the like.
S20, acquiring all daily transaction data of each month according to the acquisition time, determining the duty ratio between each daily transaction data and the total sum of all daily transaction data of the month where the daily transaction data are located, and acquiring a plurality of daily duty ratios.
The daily accounting value is understood to mean the proportion of daily transaction data to the sum of all transaction data accumulated in the current month.
Specifically, all daily transaction data are divided according to the acquisition time, namely all daily transaction data corresponding to each month are divided together through the acquisition time, and then all daily transaction data of each month after division are summed up, so that total transaction data accumulated in each month are calculated. Then, the ratio of each daily transaction data to the total daily transaction data of the month in which the daily transaction data is located is determined, namely, daily transaction data corresponding to each acquisition time in each month is divided with the total transaction data accumulated in each month, so that the ratio of the daily transaction data to the total transaction data accumulated in each month is calculated, and the ratio is determined to be the daily ratio corresponding to the daily transaction data of the acquisition time. Thus, the daily occupation ratio corresponding to the daily transaction data of each acquisition time one by one is determined in the mode. The daily occupation ratio corresponding to the daily transaction data of each acquisition time one by one can be calculated through training the neural network model and through the neural network model.
S30, determining the preset number of daily occupation ratios corresponding to each target date in the current month according to the acquisition time and the current date, and carrying out average processing on the preset number of daily occupation ratios corresponding to each target date to obtain the average value of the occupation ratios corresponding to the target dates one by one.
The duty cycle average is understood to mean the average of a predetermined number of daily duty cycles. Each target date refers to a date in the current month that is past or equal to the current date, i.e., the current date is also the target date.
Specifically, the daily duty ratio of the preset number corresponding to each target date in the current month is determined according to the collection time and the current date, that is, the daily duty ratio of the preset number corresponding to each target date is selected through the collection time, for example, the current month is 2 months, the current date is 29 days, the target date is 2 months and 21 days, the preset number is 3, 1 month and 21 days, 12 months and 21 days of the last year, and the daily duty ratio of 11 months and 21 days of the last year are selected. Then, average processing is carried out on the preset number of daily occupation ratios corresponding to each target date in the current month, namely, the selected preset number of daily occupation ratios are summed and then averaged, so that the average of the occupation ratios corresponding to each target date is obtained. For example, the target date is September first, and three daily occupancy values corresponding to the target date, namely, daily occupancy values corresponding to June first, june first and August first, are selected according to the acquisition time and the current date. And then adding the three daily duty ratios, and dividing by three to obtain the duty ratio average value corresponding to September I.
S40, inputting all the duty ratio average values and all the daily transaction data which are cut off to the current date in the current month into a prediction model to obtain the current month predicted transaction total amount output by the prediction model, and feeding back the current month predicted transaction total amount to a client.
Understandably, predicting the total amount of transactions in the current month refers to predicting all daily transaction data and all duty cycle averages of the current month by the prediction model. The prediction model is obtained by training a neural network.
Specifically, a prediction model is obtained from a database, all the duty ratio average values and all the daily transaction data, which correspond to the daily transaction data of each target date, of the current month are input into the prediction model, the data prediction processing is carried out on all the duty ratio average values and all the daily transaction data of the current month, which are up to the current date, through the prediction model, namely, the data prediction processing is carried out on all the duty ratio average values and all the daily transaction data of the current month, which are up to the current date, through the learning of an invisible relation during the training of the prediction model, so that the current month prediction transaction total amount output by the prediction model is obtained.
According to the embodiment of the invention, the target data set comprises a plurality of daily transaction data in a preset number of months before the current date and the acquisition time corresponding to each daily transaction data, so that the determination of the duty ratio between the target data set and the total daily transaction data of the month in which the daily transaction data is located is realized, and the determination of the daily duty ratio is realized. According to the acquisition time and the current date, the daily occupation ratio of the preset number corresponding to each target date in the current month is determined, and the average value of the daily occupation ratio of the preset number corresponding to each target date is processed, so that the selection of the daily occupation ratio of the preset number is realized, and the calculation of the average value of the occupation ratios corresponding to each target date is realized. All duty ratio average values and all daily transaction data which are cut off to the current date in the current month are input into a prediction model, so that the prediction of the total amount of the predicted transaction of the current month is realized, and the accuracy and the flexibility of data prediction are further improved.
In an embodiment, in the step S30, that is, according to the collection time and the current date, a preset number of daily occupation ratios corresponding to each target date in the current month is determined, and average processing is performed on the preset number of daily occupation ratios corresponding to each target date to obtain an average value of occupation ratios corresponding to each target date one to one, including:
S301, respectively selecting a collection time which is the same as the date in the target date from a preset number of first historical months before the current month, and determining the collection time as the first historical date corresponding to the target date.
S302, acquiring a special date table containing all preset special dates, and determining whether preset special dates are contained in the preset number of first historical dates according to the special date table.
S303, when all the first history dates do not contain preset special dates, determining a duty ratio average value corresponding to the target date according to the preset number of daily duty ratios corresponding to the first history dates.
The first historical month is understood to mean the month preceding the current month, for example, the first historical month in which both the month of junior and month of junior are the month of junior. The first history date refers to a date corresponding to a date of the target dates in the first history month, for example, a first history date corresponding to a first number of June, a first number of July, and a first number of August, which is a first number of September (target date). The preset special date refers to legal holidays, such as five-one and spring festival, etc.
Specifically, after obtaining the daily ratio values, selecting a first history date which is the same as the date in the target date from a preset number of first history months before the current month, namely, firstly determining the preset number of first history months before the current month through the collection time, the current date and the preset number, selecting a date which is the same as the date in the target date from each first history month, and determining the selected preset number of dates as the first history date. And then, acquiring a special date table containing all preset special dates, determining whether the preset special dates are contained in the preset number of first historical dates according to the special date table, namely, matching the date of each first historical date with the month and the date of the preset special date with the month to judge whether the first historical dates are identical, and determining that the preset special dates are contained in the preset number of first historical dates corresponding to the target date when the date of any one of the first historical dates is identical with the date of the month and the date of the preset special date is identical with the month. When the dates and the months of all the first historical dates are different from the dates and the months of the preset special dates, determining that the preset number of first historical dates corresponding to the target date does not contain the preset special date. Further, when all the first history dates do not contain the preset special date, the average value of the duty ratio corresponding to the target date is determined according to the preset number of daily duty ratios corresponding to the first history dates, namely the preset number of daily duty ratios corresponding to the first history dates are added, and the average value of the duty ratio corresponding to the target date is obtained by dividing the preset number.
Similarly, when all the first historical dates do not contain preset special dates, the duty ratio average value corresponding to each target date is calculated by adopting the method, and the duty ratio average value corresponding to each target date one by one can be obtained.
When the date of the target date is 31 # and a preset number of third historical months before the current month, selecting a third historical date which is the same as the date of the target date respectively, namely when the date of the historical month before the current month comprises 31 #, selecting a preset number of historical months comprising 31 # and determining the selected historical month as the third historical month, selecting a third historical date corresponding to the date of the target date from all the third historical months respectively, summing daily occupation ratios corresponding to the selected preset number of third historical dates, and carrying out average value processing on the summation result to obtain the duty ratio average value corresponding to 31 #. In another embodiment, when the collection time of the daily transaction data in the collected target data set does not satisfy the preset number of third history dates, and when the date of the target date is 31 # a duty mean value of the day before the target date of the current month is adopted as the duty mean value of the target date, that is, the duty mean value of 30 # is determined as the duty mean value of 31 #.
In this embodiment, the first history date is obtained by respectively selecting a first history date corresponding to the target date from a preset number of first history months before the current month. By determining whether the preset number of first historical dates corresponding to the target date contains the preset special date, whether the first historical dates contain the preset special date or not is judged, and further when all the first historical dates do not contain the preset special date, the calculation of the duty ratio average value corresponding to the target date is realized.
In an embodiment, after the step S302, that is, after determining whether the preset number of first history dates includes the preset special date according to the special date table, the method further includes:
s304, when all the first historical dates contain preset special dates, determining the target number of the preset special dates contained in all the first historical dates; the target number is less than or equal to the preset number;
S305, selecting a target number of second historical months corresponding to the first historical month from the historical months before the first historical month, and respectively selecting a second historical date which is the same as the date in the target date from each second historical month;
S306, determining whether the second historical dates of the target number corresponding to the target date contain preset special dates according to the special date table;
s307, when all the second historical dates do not contain preset special dates, determining the average value of the duty ratios corresponding to the target dates according to the preset number of daily duty ratios corresponding to the target historical dates; the target history date refers to a target number of the second history dates and the first history dates except for the target number of the preset special dates.
The target number is understood to mean the number of the preset special dates contained in all the first history dates, and the target number is smaller than or equal to the preset number. The target history date refers to the target number of second history dates and first history dates except for a preset special date. The second historical month refers to the month that precedes the first historical month.
Specifically, after determining whether the preset special date is included in the preset number of first history dates according to the special date table, when the preset special date is included in all the first history dates, determining the number of the preset special dates included in all the first history dates, namely determining the number of successful matching with the preset special date in all the first history dates, and thus obtaining the target number. Then, among the historic months preceding the first historic month, a target number of historic months is selected, and the selected target number of historic months is determined as second historic months, namely, a target number of consecutive second historic months are selected among the historic months preceding the preset number of first historic months, and a second history date which is the same as the target date is selected from each of the second historic months, namely, a date which is the same as the daily value in the target date is selected from each of the second historic months, and is determined as the second history date.
Further, the month and the day of the target number of second history dates are matched with the month and the day of the preset special date in the special date table, so that whether the target number of second history dates corresponding to the target date contains the preset special date or not is judged, and when the month and the day of any one second history date are identical with the month and the day of the preset special date, the preset number of second history dates corresponding to the target date is determined to contain the preset special date. When the month and the day of all the second history dates are different from the month and the day of the preset special date, determining that the preset number of second history dates corresponding to the target date does not contain the preset special date. When all the second history dates do not contain preset special dates, the average value of the duty ratios corresponding to the target dates is determined according to the preset number of daily duty ratios corresponding to the target history dates, namely the preset number of daily duty ratios corresponding to the second history dates are added, and the average value of the duty ratios corresponding to the target dates is obtained by dividing the preset number. Similarly, when all the second historical dates contain at least one preset special date, the duty ratio average value corresponding to each target date is calculated by adopting the method, and the duty ratio average value corresponding to each target date one by one can be obtained.
In a specific embodiment, when predicting data of the tenth month, data of the eighth month, the September and the three months of the October are needed to be used for prediction, and the average of the duty ratios of the first to the seventh of the October, the first to the seventh of the August and the first to the seventh of the September are used for prediction because the first to the seventh of the October belong to preset special dates. And in predicting from october eight to october thirty, data from october, september, and october are used for prediction.
In this embodiment, when at least one preset special date is included in all the first history dates, the determination of the target number of the preset special dates is achieved, and then the selection of the second history month and the selection of the second history date are achieved. By determining whether the second historical dates of the target number corresponding to the target dates contain preset special dates or not, judgment of whether the second historical dates contain the preset special dates or not is achieved, and further calculation of the duty ratio average value corresponding to each target date is achieved.
In an embodiment, in the step S40, all the duty average values and all the daily transaction data from the current month to the current date are input into a prediction model, so as to obtain a current month predicted transaction total output by the prediction model, which includes:
s401, judging whether the current date in the current month and all the target dates contain preset special dates or not.
S402, when the current date and all the target dates are determined to contain preset special dates, acquiring target weights corresponding to the preset special dates.
S403, repairing the duty ratio average value of the target date corresponding to the preset special date through the target weight to obtain the repaired target duty ratio average value.
The target weight is understood to mean the weight of the average value of the duty ratio corresponding to the preset special date, and the weight is smaller than 1.
Specifically, a special date table is obtained, the day of each target date in the current month is matched with the month of each target date in the current month and the day of each preset special date in the special date table, whether each target date in the current month contains the preset special date or not is judged according to the matching result, when the day of each target date in the current month is identical with the month and any one of the days of the preset special dates is identical with the month, all the target dates and all the current dates are determined to contain the preset special date, and when the day value day of each target date in the current month is different from the month and all the days of the preset special dates are determined to be identical with the month, all the target dates and all the current dates are determined to not contain the preset special date. And when all the target dates and the current date contain preset special dates, acquiring target weights corresponding to the preset special dates from a database, and repairing the duty ratio average value of the target dates corresponding to the preset special dates according to the target weights, namely multiplying the target weights by the duty ratio average value to reduce the duty ratio average value when the target dates are the preset special dates, so as to obtain the target duty ratio average value corresponding to each preset special date after repairing.
In one embodiment, in predicting the data of the month of October by July, august and September, since the month of October to October belong to a preset special date, the daily ratio of this period is low compared to usual, and thus the repair is performed by the target weight.
And S404, normalizing all the target duty ratio average values cut off to the current date in the current month and all the duty ratio average values which are not subjected to restoration processing to obtain first normalized duty ratio average values which are in one-to-one correspondence with the target dates, and determining all the first normalized duty ratio average values as target normalized average values.
And S405, carrying out data prediction processing on all daily transaction data and all target normalization means which are cut off to the current date in the current month through a prediction model to obtain the predicted transaction total in the current month.
It is to be understood that, when all the target dates and the current date include the preset special date, the first normalized duty mean value is obtained by normalizing each target duty mean value of the current month and each duty mean value which is not subjected to repair treatment. The target normalized mean value refers to the first normalized duty cycle mean value.
Further, normalization processing is carried out on all target duty mean values which are cut off to the current date and all duty mean values which are not subjected to restoration processing in the current month, namely, all target duty mean values of the current month and all duty mean values which are not subjected to restoration processing are divided by the sum of all duty mean values accumulated in the current month respectively, namely, summation processing is carried out on all target duty mean values and all duty mean values which are not subjected to restoration processing firstly, and all target duty mean values and all duty mean values are divided by summation results respectively, so that the duty mean values of all target dates and current dates in the current month are accumulated as percentages according to the current month, and accordingly, first normalization duty mean values which correspond to daily transaction data of all target dates respectively are obtained, and all first normalization duty mean values are determined to be target normalization mean values. And then, inputting all daily transaction data and all target normalization means which are cut off to the current date in the current month into a prediction model, and carrying out data prediction processing on all daily transaction data and all target normalization means which are cut off to the current date in the current month through the prediction model, namely dividing the sum of all daily transaction data cut off to the current date in the current month by the sum of all target normalization means by the prediction model, thereby obtaining the current month predicted transaction total corresponding to the current month.
In the embodiment, when all the target dates and the current date contain preset special dates, the repair of the duty ratio average value corresponding to the preset special dates is realized, and the calculation of the target duty ratio average value is realized. By carrying out normalization processing on each target duty ratio mean value cut off to the current date in the current month and each duty ratio mean value which is not subjected to restoration processing, calculation of each first normalization duty ratio mean value is realized, and determination of the target normalization mean value is realized. The data prediction processing is carried out through the prediction model, so that the prediction of the total amount of the transaction predicted in the current month is realized, and the accuracy of the data prediction is further improved.
In an embodiment, after the step S401, that is, after determining whether the current date in the current month and all the target dates include a preset special date, the method further includes:
S406, when the current date and all the target dates do not contain preset special dates, normalizing all the duty ratio average values which are cut off to the current date in the current month to obtain second normalized duty ratio average values which are in one-to-one correspondence with the target dates, and determining all the second normalized duty ratio average values as target normalized average values.
S407, carrying out data prediction processing on all daily transaction data and all target normalization means which are cut off to the current date in the current month through a prediction model to obtain the current month predicted transaction total.
The second normalized duty ratio average value is obtained by normalizing each duty ratio average value of the current month when all the target dates and the current dates in the current month do not contain the preset special date. The target normalized mean value is the second normalized duty cycle mean value.
Specifically, after judging whether the current date and all the target dates in the current month contain preset special dates, when all the target dates and the current date in the current month do not contain preset special dates, carrying out normalization processing on each duty ratio mean value which is cut off to the current date in the current month, namely dividing the duty ratio mean value which corresponds to each target date in the current month and the duty ratio mean value which corresponds to the current date by the sum of all the duty ratio mean values which are cut off to the current date in the current month, namely summing the duty ratio mean value which corresponds to each target date in the current month and the duty ratio mean value which corresponds to the current date, and dividing the summed result by the duty ratio mean value respectively, so that the duty ratio mean value of each target date and the duty ratio mean value of the current date are accumulated to be percentage according to the current month, and obtaining second normalization duty ratio mean values which correspond to daily transaction data of each target date respectively, and determining all the second duty ratio mean values as target normalization mean values. Further, all daily transaction data and all target normalized mean values cut off to the current date in the current month are input into a prediction model, data prediction processing is carried out on all daily transaction data and all target normalized mean values in the current month through the prediction model, namely the prediction model divides the sum of all daily transaction data of the current month by the sum of all target normalized mean values, and accordingly the current month predicted transaction total corresponding to the current month is obtained.
In this embodiment, when all the target dates and the current date do not include the preset special date, normalization processing is performed on all the duty ratio average values of the current month which are cut off to the current date, so as to calculate the second normalized duty ratio average value and determine the target normalized average value. The data prediction is carried out through the prediction model, so that the prediction of the total amount of the transaction predicted on the current month is realized, and the accuracy of the data prediction is further improved.
In an embodiment, in step S405, the data prediction process is performed on all the daily transaction data and all the target normalized average values of the current month that are up to the current date by using a prediction model, so as to obtain a predicted transaction total of the current month, including:
s4051, determining actual transaction data in the current month according to all daily transaction data which are up to the current date in the current month.
S4052, determining a current month duty ratio average value according to all the target normalized average values which are cut off to the current date in the current month.
S4053, carrying out data prediction processing on the current month actual transaction data and the current month duty ratio mean value through the prediction model to obtain the current month predicted transaction total.
The actual transaction data for the current month is understood to mean the sum of all daily transaction data in the current month up to the current date. The current month duty average value refers to the sum of all target normalized average values which are cut off to the current date in the current month.
Specifically, all daily transaction data corresponding to the current date from the expiration of the current month are screened out through the collection time, and then all daily transaction data from the expiration of the current month to the current date are summed, so that the actual transaction data of the current month is obtained. For example, when the current date is 2 months and 20 days, daily transaction data of each day from 2 months and 1 day to 20 days are collected, and all daily transaction data are accumulated, so that the actual transaction total amount of the current month from 2 months to 20 days is obtained. And then, acquiring a target normalization average value corresponding to each target date cut-off to the current date in the current month and a target normalization average value corresponding to the current date, and then, carrying out summation processing on all target normalization average values cut-off to the current date in the current month, thereby obtaining the current month duty ratio average value. Further, a prediction model is obtained from the database, the current month duty ratio average value and current month actual transaction data are input into the prediction model, the current month actual transaction data and the current month duty ratio average value are subjected to data prediction according to the invisible relation learned by the prediction model, namely, the result of dividing the current month actual transaction data by the current month duty ratio average value is calculated, and accordingly the current month predicted transaction total corresponding to the current month is obtained.
In this embodiment, the determination of the actual transaction data of the month is implemented through all daily transaction data from the expiration date to the current date in the current month. And determining the average value of the duty ratio of the current month is realized by normalizing all targets in the current month until the current date. The data prediction is carried out on the actual transaction data of the current month and the average value of the current month duty ratio through the prediction model, so that the prediction of the total amount of the transaction predicted by the current month is realized, and the accuracy rate of the data prediction is further improved.
In an embodiment, after the step S4053, that is, after performing data prediction processing on the current month actual transaction data and the current month duty average value by using the prediction model, the method further includes:
S4054, acquiring the current month actual transaction total of the month corresponding to the current month predicted transaction total of the current month.
S4055, calibrating the prediction model and the target weight corresponding to the preset special date according to the current month actual transaction total and the current month predicted transaction total to obtain an updated prediction model and an updated target weight.
The actual transaction total for the month is understandably accumulated from the actual GMV data for each day from the expiration of the current month to the current date.
Specifically, daily transaction data of each day from the expiration date to the current date in the current month corresponding to the current month predicted transaction total is collected, and all collected daily transaction data of the month from the expiration date to the current date is summed up, so that the current month actual transaction total of the month corresponding to the current month predicted transaction total is obtained. Further, the prediction model and the target weight corresponding to the preset special date are calibrated according to the current month actual transaction total and the current month predicted transaction total, namely parameters of the prediction model are updated through the current month actual transaction total and the current month predicted transaction total corresponding to the same month, so that a predicted result of the prediction model is close to the current month actual transaction total, and the updated prediction model is obtained. And then, calibrating the target weight corresponding to the preset special date according to the current month actual transaction total and the current month predicted transaction total, namely adjusting the target weight corresponding to the preset special date so that the predicted result after weight adjustment corresponding to the preset special date is closer to actual daily transaction data, and thus updated target weight is obtained.
In the embodiment, the prediction model and the target weight corresponding to the preset special date are calibrated respectively through the current month actual transaction total and the current month predicted transaction total, so that the updated prediction model and the updated target weight are obtained, and the prediction accuracy is improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In one embodiment, a data prediction apparatus is provided, where the data prediction apparatus corresponds to the data prediction method in the above embodiment one by one. As shown in fig. 2, the data predicting apparatus includes a data acquisition module 10, a duty ratio determination module 20, a mean determination module 30, and a data predicting module 40. The functional modules are described in detail as follows:
The data acquisition module 10 is configured to acquire a target data set according to a current date and a current month after receiving a transaction data prediction instruction sent by the client; the target data set comprises a plurality of daily transaction data in a preset number of months before the current date and acquisition time corresponding to each daily transaction data;
The duty ratio determining module 20 is configured to obtain all daily transaction data of each month according to the collection time, determine a duty ratio between each daily transaction data and a sum of all daily transaction data of the month where the daily transaction data is located, and obtain a plurality of daily duty ratios;
The average value determining module 30 is configured to determine, according to the collection time and the current date, a preset number of daily occupation ratios corresponding to each target date in the current month, and perform average value processing on the preset number of daily occupation ratios corresponding to each target date, so as to obtain an average value of occupation ratios corresponding to each target date one to one;
The data prediction module 40 is configured to input all the duty average values and all the daily transaction data that are cut off to the current date in the current month into a prediction model, obtain a current month predicted transaction total output by the prediction model, and feed back the current month predicted transaction total to the client.
In one embodiment, the mean determination module 30 includes:
The first historical date selecting unit is used for respectively selecting one acquisition time which is the same as the date in the target date from a preset number of first historical months before the current month, and determining the acquisition time as a first historical date corresponding to the target date;
The first preset special date determining unit is used for acquiring a special date table containing all preset special dates and determining whether preset special dates are contained in a preset number of first historical dates according to the special date table;
And the first none-containing unit is used for determining a duty ratio average value corresponding to the target date according to a preset number of daily duty ratios corresponding to each first historical date when all the first historical dates do not contain preset special dates.
In an embodiment, the first preset special date determining unit includes:
A target number unit, configured to determine, when all the first history dates include preset special dates, a target number of preset special dates included in all the first history dates; the target number is less than or equal to the preset number;
A second history date selecting unit, configured to select a target number of second history months corresponding to the first history month from among history months before the first history month, and select a second history date identical to the date in the target date from each of the second history months;
A second preset special date determining unit configured to determine whether a target number of second history dates corresponding to the target date include a preset special date according to the special date table;
The second none-containing unit is used for determining the average value of the duty ratios corresponding to the target date according to the daily duty ratios corresponding to the target historical date in a preset number when all the second historical dates do not contain preset special dates; the target history date refers to a target number of the second history dates and the first history dates except for the target number of the preset special dates.
In one embodiment, the data prediction module 40 includes:
A special date judging sub-module, configured to judge whether the current date in the current month and all the target dates include preset special dates;
The special date containing sub-module is used for acquiring target weights corresponding to preset special dates when the current date and all the target dates are determined to contain the preset special dates;
The restoration processing sub-module is used for carrying out restoration processing on the duty ratio average value of the target date corresponding to the preset special date through the target weight to obtain a restored target duty ratio average value;
The normalization sub-module is used for carrying out normalization processing on all the target duty ratio average values which are cut off to the current date in the current month and all the duty ratio average values which are not subjected to restoration processing, obtaining first normalization duty ratio average values which are in one-to-one correspondence with the target dates, and determining all the first normalization duty ratio average values as target normalization average values;
And the first prediction sub-module is used for carrying out data prediction processing on all daily transaction data and all target normalization means which are cut off to the current date in the current month through a prediction model to obtain the current month predicted transaction total.
In one embodiment, the data prediction module 40 further comprises:
the sub-module without special date is used for carrying out normalization processing on all the duty ratio average values which are cut off to the current date in the current month when the current date and all the target dates do not contain preset special dates, obtaining second normalization duty ratio average values which are in one-to-one correspondence with the target dates, and determining all the second normalization duty ratio average values as target normalization average values;
And the second prediction sub-module is used for carrying out data prediction processing on all daily transaction data and all target normalization means which are cut off to the current date in the current month through a prediction model to obtain the current month predicted transaction total.
In an embodiment, the first prediction submodule includes:
The actual transaction unit is used for determining actual transaction data of the current month according to all daily transaction data which are cut off to the current date in the current month;
The current month duty ratio unit is used for determining a current month duty ratio average value according to all target normalized average values which are cut off to the current date in the current month;
And the current month predicting unit is used for carrying out data predicting processing on the current month actual transaction data and the current month duty ratio mean value through the predicting model to obtain the current month predicted transaction total.
In an embodiment, the device further comprises:
A current month actual transaction total unit, configured to obtain a current month actual transaction total of a month corresponding to the current month predicted transaction total of the current month up to a current date;
And the weight model calibration updating unit is used for calibrating the prediction model and the target weight corresponding to the preset special date according to the current month actual transaction total and the current month predicted transaction total to obtain an updated prediction model and an updated target weight.
For specific limitations of the data prediction apparatus, reference may be made to the above limitations of the data prediction method, and no further description is given here. The respective modules in the above-described data prediction apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a readable storage medium, an internal memory. The readable storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the readable storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data prediction method.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the data prediction method described above when executing the computer program.
A computer readable storage medium storing a computer program which when executed by a processor implements the data prediction method described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (10)

1. A method of data prediction, comprising:
After receiving a transaction data prediction instruction sent by a client, acquiring a target data set according to the current date and the current month; the target data set comprises a plurality of daily transaction data in a preset number of months before the current date and acquisition time corresponding to each daily transaction data;
Acquiring all daily transaction data of each month according to the acquisition time, determining the ratio of each daily transaction data to the total sum of all daily transaction data of the month in which the daily transaction data are located, and acquiring a plurality of daily ratio values;
determining a preset number of daily occupation ratios corresponding to each target date in the current month according to the acquisition time and the current date, and carrying out average processing on the preset number of daily occupation ratios corresponding to each target date to obtain an average value of occupation ratios corresponding to each target date one by one;
and inputting all the duty ratio average values and all the daily transaction data which are cut off to the current date in the current month into a prediction model to obtain the current month predicted transaction total amount output by the prediction model, and feeding back the current month predicted transaction total amount to a client.
2. The method of claim 1, wherein determining a preset number of daily occupancy values corresponding to each target date in the current month according to the collection time and the current date, and performing average processing on the preset number of daily occupancy values corresponding to each target date to obtain an average value of occupancy values corresponding to each target date one to one, comprises:
Respectively selecting one acquisition time which is the same as the day of the target date from a preset number of first history months before the current month, and determining the acquisition time as a first history date corresponding to the target date;
Acquiring a special date table containing all preset special dates, and determining whether preset special dates are contained in a preset number of first historical dates according to the special date table;
And when all the first historical dates do not contain preset special dates, determining a duty ratio average value corresponding to the target date according to a preset number of daily duty ratios corresponding to the first historical dates.
3. The data prediction method as claimed in claim 2, wherein after determining whether the preset number of the first history dates includes a preset special date according to the special date table, further comprising:
When all the first historical dates contain preset special dates, determining the target quantity of the preset special dates contained in all the first historical dates; the target number is less than or equal to the preset number;
Selecting a target number of second history months corresponding to the first history month from the history months before the first history month, and selecting a second history date which is the same as the date in the target date from each second history month respectively;
Determining whether the target number of second history dates corresponding to the target date contains a preset special date according to the special date table;
when all the second historical dates do not contain preset special dates, determining the average value of the duty ratios corresponding to the target dates according to the preset number of daily duty ratios corresponding to the target historical dates; the target history date refers to a target number of the second history dates and the first history dates except for the target number of the preset special dates.
4. The data prediction method as claimed in claim 1, wherein said inputting all the duty mean values and all the daily transaction data of the current month up to the current date into a prediction model to obtain a current month predicted transaction total outputted by the prediction model comprises:
judging whether the current date in the current month and all the target dates contain preset special dates or not;
When the current date and all the target dates are determined to contain preset special dates, acquiring target weights corresponding to the preset special dates;
repairing the duty ratio average value of the target date corresponding to the preset special date through the target weight to obtain a repaired target duty ratio average value;
Normalizing all the target duty ratio average values cut off to the current date in the current month and all the duty ratio average values which are not subjected to restoration processing to obtain first normalized duty ratio average values which are in one-to-one correspondence with the target dates, and determining all the first normalized duty ratio average values as target normalized average values;
And carrying out data prediction processing on all daily transaction data and all target normalization means which are cut off to the current date in the current month through a prediction model to obtain the predicted transaction total in the current month.
5. The data prediction method according to claim 4, wherein said determining whether or not said current date in said current month and all of said target dates contain a preset special date further comprises:
When the current date and all the target dates do not contain preset special dates, carrying out normalization processing on all the duty ratio average values which are cut off to the current date in the current month to obtain second normalized duty ratio average values which are in one-to-one correspondence with the target dates, and determining all the second normalized duty ratio average values as target normalized average values;
And carrying out data prediction processing on all daily transaction data and all target normalization means which are cut off to the current date in the current month through a prediction model to obtain the predicted transaction total in the current month.
6. The data prediction method as claimed in claim 4 or 5, wherein said performing, by the prediction model, data prediction processing on all the daily transaction data and all the target normalized average values of the current month up to the current date to obtain a predicted transaction total of the current month includes:
Determining actual transaction data of the current month according to all daily transaction data which are cut off to the current date in the current month;
determining a current month duty ratio average value according to all the target normalized average values which are cut off to the current date in the current month;
and carrying out data prediction processing on the current month actual transaction data and the current month duty ratio mean value through the prediction model to obtain the current month predicted transaction total.
7. The method for predicting data according to claim 6, wherein the data predicting process is performed on the current month actual transaction data and the current month duty average value by the prediction model, so as to obtain the current month predicted transaction total, and further comprising:
Acquiring the current month actual transaction total of the month corresponding to the current month predicted transaction total of the current month which is up to the current date;
And calibrating the prediction model and the target weight corresponding to the preset special date according to the current month actual transaction total and the current month predicted transaction total to obtain an updated prediction model and an updated target weight.
8. A data prediction apparatus, comprising:
the data acquisition module is used for acquiring a target data set according to the current date and the current month after receiving a transaction data prediction instruction sent by the client; the target data set comprises a plurality of daily transaction data in a preset number of months before the current date and acquisition time corresponding to each daily transaction data;
The duty ratio determining module is used for acquiring all daily transaction data of each month according to the acquisition time, determining the duty ratio between each daily transaction data and the total sum of all daily transaction data of the month where the daily transaction data are located, and acquiring a plurality of daily duty ratios;
The average value determining module is used for determining the preset number of daily occupation ratios corresponding to each target date in the current month according to the acquisition time and the current date, and carrying out average value processing on the preset number of daily occupation ratios corresponding to each target date to obtain an average value of the occupation ratios corresponding to each target date one by one;
And the data prediction module is used for inputting all the duty ratio average values and all the daily transaction data which are cut off to the current date in the current month into a prediction model, obtaining the current month predicted transaction total amount output by the prediction model, and feeding back the current month predicted transaction total amount to the client.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the data prediction method of any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the data prediction method according to any one of claims 1 to 7.
CN202410193364.XA 2024-02-21 2024-02-21 Data prediction method, device, computer equipment and storage medium Pending CN118211999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410193364.XA CN118211999A (en) 2024-02-21 2024-02-21 Data prediction method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410193364.XA CN118211999A (en) 2024-02-21 2024-02-21 Data prediction method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118211999A true CN118211999A (en) 2024-06-18

Family

ID=91445363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410193364.XA Pending CN118211999A (en) 2024-02-21 2024-02-21 Data prediction method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118211999A (en)

Similar Documents

Publication Publication Date Title
CN112101675B (en) Method, device, equipment and medium for measuring resource allocation reasonableness based on KL divergence
KR102574244B1 (en) A method and apparatus for generating future demand forecast data based on attention mechanism
CN110084606A (en) Risk control method, device, computer equipment and storage medium
US9942416B2 (en) Telecommunication price-based routing apparatus, system and method
CN110069364B (en) Spare part data error correction method and device, computer equipment and storage medium
CN110458633A (en) Invoice data generation method, system and computer equipment based on block chain technology
CN118211999A (en) Data prediction method, device, computer equipment and storage medium
CN110647724B (en) Method for constructing banknote adding and clearing model, model construction equipment and storage medium
CN111553558A (en) Building cost budgeting method, device and storage medium thereof
US7752109B2 (en) Method of determining parameters of a long-term lease
CN110135695A (en) Asset allocation methods of risk assessment, device, computer equipment and storage medium
CN113743893B (en) Intelligent cooperative processing system and method for whole life cycle of engineering project
CN115375413A (en) ERP purchasing calculation method and system
EP2693378A1 (en) Risk-management device
CN109584061A (en) Information generating method, device, computer equipment and storage medium
CN112581295A (en) Product data processing method, device, equipment and medium based on field splitting
Bacinello A full Monte Carlo approach to the valuation of the surrender option embedded in life insurance contracts
CN110766307A (en) Intelligent power grid real-time fund monitoring method, device, equipment and medium
CN112749821B (en) Express delivery quantity prediction method, device, computer equipment and storage medium
CN113436022B (en) Matching method and device for product data adjustment, computer equipment and storage medium
CN112712207B (en) Load prediction method, load prediction device, computer readable storage medium and electronic equipment
US20240070552A1 (en) Methods and systems for determining payment behaviours
CN115719271A (en) Method, device, equipment and medium for predicting risk parameters of financial products
JP2008530686A (en) Product analysis method
CN117788171A (en) Product fluidity pressure testing method and device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination