Live pig price long-term aging prediction method and system based on multi-model aggregation
By collecting and cleaning historical data on pig prices and related indicators, using multiple time series models for prediction, and aggregating the results through consistent modular operators, we solve the problems of multi-period superposition and long-term effectiveness in pig price prediction, and improve the accuracy of predictions. accuracy.
Patent Information
- Application Number
- CN202310899185.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art is difficult to effectively solve the problems of multi-cycle superposition characteristics and long-term prediction in pig price analysis and prediction.
By collecting 5,000 days of historical pig price data from the China Pig Network and nearly ten years of historical data on 16 indicators from four major latitudes of the Ministry of Agriculture and Rural Affairs, the National Bureau of Statistics, the Chinese Academy of Social Sciences, and the China Food Safety Database, 30 days of smoothed data were carried out After cleaning, use multiple time series models (such as ARIMA, STL decomposition model, NNAR model) for processing, and aggregate multiple long-term prediction results through the consistent modular operator to obtain long-term live pig price prediction results.
It effectively improves the accuracy of long-term pig price prediction, and can better explain the law of pig price changes and identify abnormal changes.
Smart Images

Figure CN119338490A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and more specifically, to a method and system for long-term prediction of pig prices based on multi-model aggregation. Background Art
[0002] According to the data from the National Bureau of Statistics, China's pork production in 2021 was 52.9593 million tons, making it the world's largest pork producer. According to the data from the U.S. Department of Agriculture, China's pork consumption in 2021 was 51.726 million tons, accounting for 48.26% of the global pork consumption of 107.193 million tons in the same period, making it the world's largest pork consumer. At the same time, pork has long been a dominant force in my country's meat consumption. According to the data from the National Bureau of Statistics, in 2021, my country's pork production was 52.9593 million tons, accounting for 59.59% of the total meat production. Recently, the price of live pigs has rebounded, and the losses of farmers have decreased, but the downturn has not completely changed. The concentration of the live pig industry has increased again, and large pig companies have begun to try to introduce live pig price forecasting technology based on big data analysis to improve their risk resistance and maintain a good level of profitability.
[0003] At present, the main methods for pig price prediction include Elman neural network model, Hurst value analysis, machine learning, and multi-zone smooth transfer autoregressive model. These methods have certain reference value in explaining the changing patterns of pig prices, identifying abnormal changes in pig prices, and grasping the relationship between regional market price changes. However, they cannot solve the multi-period superposition characteristics and long-term prediction problems of pig price analysis and prediction. Summary of the invention
[0004] The present invention discloses a long-term prediction method for pig prices based on multi-model aggregation, which collects historical data on pig prices in the past 5,000 days from China Pig Farming Network; collects historical data on 16 indicators in four dimensions from the Ministry of Agriculture and Rural Affairs, the National Bureau of Statistics, the Chinese Academy of Social Sciences, and the China Food Safety Database in the past ten years; performs 30-day smoothing data cleaning on all acquired historical data to obtain valid historical data; takes pig prices as dependent variables and indicators of various dimensions as independent variables, and processes the cleaned historical data with multiple time series models to obtain multiple long-term prediction results; aggregates multiple long-term prediction results through a consistent modulus operator to obtain long-term pig price prediction results, effectively improving the accuracy of long-term pig price prediction. The method includes:
[0005] For the prediction of live pig prices, we collected historical data on live pig prices for the past 5,000 days from China Pig Farming Network; and collected historical data of 16 indicators in four dimensions from the Ministry of Agriculture and Rural Affairs, the National Bureau of Statistics, the Chinese Academy of Social Sciences, and the China Food Safety Database in the past ten years.
[0006] In some embodiments, the historical pig price data is the first-hand quotes obtained by China Pig Network from major pig farmers every day. The data is the original data owned by China Pig Network that is dynamically updated in real time every day across the country and is cited by major pig industry websites and third-party institutions across the country. The four dimensions are cost dimension, supply dimension, demand dimension and policy dimension, and the 16 indicators are sow price, piglet price, corn price, soybean meal price, disease data, sow inventory data, pig production capacity data, market data, per capita disposable income, seasonal factors, food safety factors, national reserve policy, import policy, subsidy policy and environmental protection policy.
[0007] All historical data obtained are cleaned by smoothing for 30 days to obtain valid historical data.
[0008] In some embodiments, the data cleaning includes filtering out invalid data, fitting and completing missing data, 30-day smoothing, and period alignment.
[0009] Taking pig price as the prediction variable and 16 indicators of four dimensions as prediction parameters, the cleaned historical data were processed by multiple time series models to obtain multiple long-term prediction results.
[0010] In some embodiments, the multiple time series models include an ARIMA model, an STL decomposition model, and an NNAR model, and the 16 indicators of the four major latitudes include daily frequency data, weekly frequency data, monthly frequency data, seasonal frequency data, and annual data.
[0011] By aggregating multiple long-term prediction results through the consistent modulus operator, the long-term prediction result of pig prices is obtained;
[0012] In some embodiments, the consistent modulus operator is a type of aggregation operator, which is a generalization and unification of the triangle modulus and triangle comodulus.
[0013] Accordingly, the present invention also proposes a long-term prediction system for pig prices based on NNAR multi-model aggregation, the system comprising:
[0014] The data collection module, for pig price forecasting, collects historical data on pig prices in the past 5,000 days from China Pig Farming Network, as well as historical data of 16 indicators in four dimensions from the Ministry of Agriculture and Rural Affairs, the National Bureau of Statistics, the Chinese Academy of Social Sciences, and the China Food Safety Database over the past ten years.
[0015] The data cleaning module cleans all acquired historical data, including filtering out invalid data, fitting and completing missing data, 30-day smoothing and cycle alignment, to obtain valid historical data.
[0016] The multi-model long-term prediction module uses pig prices as prediction variables and 16 indicators in four major dimensions as prediction parameters. It processes the cleaned historical data with multiple time series models to obtain multiple long-term prediction results.
[0017] The long-term consistent modulus prediction module aggregates multiple long-term prediction results through the consistent modulus operator to obtain the long-term pig price prediction results.
[0018] In some embodiments, the historical pig price data collected by the system is the first-hand quotes obtained by China Pig Farming Network from major pig farmers every day. This data is China Pig Farming Network's own original data that is dynamically updated in real time every day across the country and is cited by major pig farming industry websites and third-party organizations across the country.
[0019] In some embodiments, the four dimensions of data collected by the system are cost dimension, supply dimension, demand dimension and policy dimension, and the 16 indicators are sow price, piglet price, corn price, soybean meal price, disease data, sow inventory data, pig production capacity data, slaughter data, per capita disposable income, seasonal factors, food safety factors, national reserve policy, import policy, subsidy policy and environmental protection policy.
[0020] In some embodiments, the data cleaning performed by the system includes filtering out invalid data, fitting and completing missing data, 30-day smoothing, and period alignment.
[0021] In some embodiments, the system uses multiple time series models including ARIMA model, STL decomposition model, NNAR model, and the 16 indicators of the four major latitudes include daily data, weekly data, monthly data, seasonal data and annual data.
[0022] In some embodiments, the consistent modulus operator in the system is a type of aggregation operator, which is a generalization and unification of the triangle modulus and triangle comodulus.
[0023] By applying the above technical solutions, for the prediction of pig prices, the historical data of pig prices in the past 5,000 days from China Pig Farming Network are collected; the historical data of 16 indicators in four dimensions of the Ministry of Agriculture and Rural Affairs, the National Bureau of Statistics, the Chinese Academy of Social Sciences, and the China Food Safety Database are collected in the past ten years; all the acquired historical data are cleaned by 30-day smoothing data to obtain valid historical data; with pig prices as the dependent variable and indicators of each dimension as independent variables, the cleaned historical data are processed by multiple time series models respectively to obtain multiple long-term prediction results; multiple long-term prediction results are aggregated by the consistent modulus operator to obtain long-term pig price prediction results. The pig price prediction method and system disclosed in this application can effectively improve the accuracy of long-term pig price prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 A schematic flow chart of a method for long-term prediction of pig prices based on multi-model aggregation proposed in an embodiment of the present invention is shown;
[0026] Figure 2 A schematic diagram of the structure of a pig price long-term prediction system based on multi-model aggregation proposed in an embodiment of the present invention is shown;
[0027] Figure 3 The forecast results of the national pig price using the ARIMA model are shown;
[0028] Figure 4 The decomposition results of the national pig price using the STL decomposition model are shown;
[0029] Figure 5 The NNAR model structure is shown;
[0030] Figure 6 The NNAR model's prediction results for national pig prices are shown;
[0031] Figure 7 The long-term pig price forecast results are shown. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0033] The embodiment of the present application provides a long-term prediction method for pig prices based on multi-model aggregation, which aggregates multiple long-term prediction results through data cleaning, multiple time series model predictions and consistent modulus operators to obtain long-term pig price prediction results, thereby improving the accuracy of pig price prediction, especially long-term prediction.
[0034] like Figure 1 As shown, the method comprises the following steps:
[0035] Step S101, for the prediction of live pig prices, collect the historical data of live pig prices in the past 5000 days from China Pig Farming Network.
[0036] In this embodiment, the historical pig price data is the first-hand quotes obtained by China Pig Farming Network from major pig farmers every day. This data is China Pig Farming Network's own original data that is dynamically updated in real time every day across the country and is cited by major pig farming industry websites and third-party organizations across the country.
[0037] Step S102, collect historical data of the past ten years on 16 indicators from four dimensions including the Ministry of Agriculture and Rural Affairs, the National Bureau of Statistics, the Chinese Academy of Social Sciences, and the China Food Safety Database.
[0038] In this embodiment, the four dimensions are cost dimension, supply dimension, demand dimension and policy dimension, and the 16 indicators are sow price, piglet price, corn price, soybean meal price, disease data, sow inventory data, pig production capacity data, slaughter data, per capita disposable income, seasonal factors, food safety factors, national reserve policy, import policy, subsidy policy and environmental protection policy.
[0039] Step S103, performing 30-day smoothing data cleaning on all acquired historical data to obtain valid historical data.
[0040] In this embodiment, the data cleaning includes invalid data filtering, missing data fitting and completion, 30-day smoothing and cycle alignment. The 30-day smoothing alignment algorithm is as follows:
[0041]
[0042] where Y i is the smoothed data, X i is the effective historical data after cleaning, w k is the smoothing weight of the kth valid historical data in the smoothing window,
[0043] Step S104, using the live pig price as the prediction variable and the 16 indicators of the four dimensions as prediction parameters, the cleaned historical data are processed using multiple time series models to obtain multiple long-term prediction results.
[0044] In this embodiment, the multiple time series models include an ARIMA model, an STL decomposition model, and an NNAR model, and the 16 indicators of the four major latitudes include daily frequency data, weekly frequency data, monthly frequency data, seasonal frequency data, and annual data.
[0045] In this embodiment, the structure of the ARIMA model is as follows:
[0046] y′ t =c+φ1y′ t-1 +…+φ p y′ t-p+θ1ε t-1 +…+θ q ε t-q +ε t
[0047] where y′ t is the original time series y t The sequence after d-order difference can be simplified as:
[0048] Φ p (L)Δ d y t =Θ q (L)ε t
[0049] The ARIMA model structure is relatively simple, requiring only endogenous variables without the need for other exogenous variables. The prediction results of the national pig price using the ARIMA model are as follows: Figure 3 As shown (the short line with horn shadow on the right is the predicted data).
[0050] In this embodiment, the expression of the STL decomposition model is:
[0051] y t =T t +S t +R t
[0052] Where T t represents the trend term after smoothing, S t represents the seasonal term, R t Represents the residual term. Multiplicative decomposition can first logarithmically transform the data and then reversely transform each component. The decomposition results of the national pig price using the STL decomposition model are as follows: Figure 4 shown.
[0053] In this embodiment, the NNAR model adopts a nonlinear autoregressive neural network model with 4-period lagged input and 3 node hidden layers. The model structure is as follows: Figure 5 shown.
[0054] Among them, the input of the hidden layer neurons is linearly combined as follows:
[0055]
[0056] The nonlinear correction function in the hidden layer is:
[0057]
[0058] Taking into account the seasonality of pig prices, the last observation of the same season can be added as input to the model. The prediction results of the national pig prices using the NNAR model are as follows: Figure 6 As shown (the short line with horn shadow on the right is the predicted data).
[0059] Step S105, aggregating multiple long-term prediction results through a consistent modulus operator to obtain a long-term pig price prediction result such as Figure 7 shown.
[0060] Obviously, after the consistent modulus operator is used to aggregate multiple long-term prediction results, the predicted trend and volatility are more in line with the actual situation of pig price changes.
[0061] In this embodiment, the consistent modulus operator is a type of aggregation operator, which is a generalization and unification of the triangle modulus and the triangle co-modulus. The consistent modulus U can be generated by the consistent modulus generating function g p It is expressed as follows:
[0062]
[0063] By applying the above technical solution, the following beneficial effects are achieved:
[0064] 1. By cleaning historical data, the validity and reliability of relevant data are ensured.
[0065] 2. By introducing multiple time series models to process historical data, the ability to analyze and process multi-period superimposed data is enhanced.
[0066] The present application also proposes a long-term prediction system for pig prices based on NNAR multi-model aggregation, such as Figure 2 As shown, the system comprises:
[0067] Accordingly, the present invention also proposes a long-term prediction system for pig prices based on NNAR multi-model aggregation, the system comprising:
[0068] The data collection module aims at predicting live pig prices, collecting the historical data of live pig prices in the past 5,000 days from China Pig Farming Network, and the historical data of 16 indicators in four dimensions from the Ministry of Agriculture and Rural Affairs, the National Bureau of Statistics, the Chinese Academy of Social Sciences, and the China Food Safety Database in the past ten years;
[0069] The data cleaning module cleans all acquired historical data, including filtering out invalid data, fitting and completing missing data, 30-day smoothing, and period alignment, to obtain valid historical data;
[0070] The multi-model long-term prediction module uses pig prices as the prediction variable and 16 indicators from four dimensions as prediction parameters. It processes the cleaned historical data with multiple time series models to obtain multiple long-term prediction results.
[0071] The long-term consistent modulus prediction module aggregates multiple long-term prediction results through the consistent modulus operator to obtain the long-term pig price prediction results.
[0072] In a specific application scenario, the historical pig price data collected by the system is the first-hand quotes obtained by China Pig Farming Network from major pig farmers every day. This data is China Pig Farming Network's own original data that is dynamically updated in real time every day across the country and is cited by major pig farming industry websites and third-party organizations across the country.
[0073] In specific application scenarios, the four dimensions of data collected by the system are cost dimension, supply dimension, demand dimension and policy dimension; the 16 indicators are sow price, piglet price, corn price, soybean meal price, disease data, sow inventory data, pig production capacity data, slaughter data, per capita disposable income, seasonal factors, food safety factors, national reserve policy, import policy, subsidy policy and environmental protection policy.
[0074] In specific application scenarios, the data cleaning performed by the system includes filtering out invalid data, fitting and completing missing data, 30-day smoothing, and period alignment.
[0075] In specific application scenarios, the system uses multiple time series models including ARIMA model, STL decomposition model, NNAR model, and 16 indicators in four major latitudes including daily data, weekly data, monthly data, seasonal data and annual data.
[0076] In a specific application scenario, the consistent modulus operator in the system is a type of aggregation operator, which is a generalization and unification of the triangle modulus and triangle comodulus.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for long-term prediction of pig prices based on multi-model aggregation, characterized in that: The method comprises: Step S101, collecting historical data of pig prices in the past 5000 days; Step S102, collecting ten-year historical data of 16 indicators of four latitude meters; The four dimensions are cost, supply, demand and policy, and the 16 indicators are sow price, piglet price, corn price, soybean meal price, disease data, sow inventory data, pig production capacity data, market data, per capita disposable income, seasonal factors, food safety factors, national reserve policy, import policy, subsidy policy and environmental protection policy. Step S103, performing 30-day smoothing data cleaning on all acquired historical data to obtain valid historical data; The data cleaning includes invalid data filtering, missing data fitting and completion, 30-day smoothing and cycle alignment, where the 30-day smoothing alignment algorithm is as follows: ,in is the smoothed data, For the effective historical data after cleaning, is the first k The smoothing weights of valid historical data are ; Step S104, using the pig price as the prediction variable and the 16 indicators of the four latitudes as the prediction parameters, the cleaned historical data are processed using multiple time series models to obtain multiple long-term prediction results; The multiple time series models include ARIMA model, STL decomposition model, NNAR model, and the 16 indicators of the four latitudes include daily frequency data, weekly frequency data, monthly frequency data, seasonal frequency data and annual data; The structure of the ARIMA model is as follows: ,in The original time series go through d The sequence after order difference can be simplified as: ; The expression of STL decomposition model is: ,in T t represents the trend term after smoothing, S t represents the seasonal term, R t Represents the residual term. The multiplicative decomposition can first logarithmically transform the data and then inversely transform each component. The NNAR model uses a nonlinear autoregressive neural network model with 4-period lagged input and 3-node hidden layers, where the input of the hidden layer neurons is linearly combined as follows: , where the nonlinear correction function in the hidden layer is: ; Step S105, aggregating multiple long-term prediction results through a consistent modulus operator to obtain a long-term pig price prediction result; The consistent modulus operator is a type of aggregation operator, which is a generalization and unification of the triangle modulus and the triangle comodulus. U The function can be generated by a uniform module It is expressed as follows: 。 2. A long-term prediction system for pig prices based on NNAR multi-model aggregation, characterized in that: The method for long-term prediction of pig prices based on multi-model aggregation as claimed in claim 1 is adopted, and the system comprises: The data collection module aims at predicting live pig prices, collecting the historical data of live pig prices in the past 5,000 days from China Pig Farming Network, and the historical data of 16 indicators in four dimensions from the Ministry of Agriculture and Rural Affairs, the National Bureau of Statistics, the Chinese Academy of Social Sciences, and the China Food Safety Database in the past ten years; The data cleaning module cleans all acquired historical data, including filtering out invalid data, fitting and completing missing data, 30-day smoothing and period alignment, to obtain valid historical data; The multi-model long-term prediction module uses pig prices as the prediction variable and 16 indicators from four dimensions as prediction parameters. It processes the cleaned historical data with multiple time series models to obtain multiple long-term prediction results. The long-term consistent modulus prediction module aggregates multiple long-term prediction results through the consistent modulus operator to obtain the long-term pig price prediction results.