Anaerobic fermentation system gas production prediction method, device, equipment and medium

Through the XGBoost model and particle swarm optimization algorithm, the decision-making leaf node weight was optimized, and the gas production prediction model of anaerobic fermentation system was constructed, which solved the problems of low gas production prediction accuracy and poor adaptability in the existing technology, and achieved efficient and stable gas production prediction and resource optimization.

CN120299567APending Publication Date: 2025-07-11SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510448239.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The existing anaerobic fermentation gas production prediction methods have problems such as low accuracy, poor dynamic adaptability and insufficient environmental adaptability, and it is difficult to effectively control the gas production during the fermentation process.

Method used

The XGBoost model is used combined with the particle swarm optimization algorithm to build a gas production prediction model of the anaerobic fermentation system by training and optimizing the decision-making leaf node weights, adjust the model parameters in real time to adapt to environmental changes, and accurately predict the gas production characteristic parameters.

Benefits of technology

It improves the accuracy and stability of gas production prediction in anaerobic fermentation system, optimizes resource utilization, reduces manual intervention, ensures that the system maintains efficient gas production under variable conditions, and provides comprehensive monitoring support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120299567A_ABST
    Figure CN120299567A_ABST
Patent Text Reader

Abstract

The invention relates to a gas production prediction method, device and equipment of an anaerobic fermentation system and a medium, and the method comprises the following steps: training a preset fermentation methane production prediction model by adopting a gas production characteristic parameter and the accumulated methane production amount of each time step corresponding to the gas production characteristic parameter; calling a preset particle swarm optimization algorithm to initialize each particle in the particle swarm; obtaining a loss function and a boundary condition corresponding to the fermentation methane production prediction model, and determining a global optimal solution of a particle population corresponding to the decision leaf node weight combination according to the loss function and the boundary condition; and determining an optimal decision leaf node weight combination corresponding to the fermentation methane production prediction model according to the globally optimal solution, and when the number of the fermentation methane production prediction model reaches a preset decision leaf node number, determining an optimal fermentation methane production prediction model so as to predict a methane accumulation amount corresponding to each time step in the future. According to the method, the accumulated methane yield of each time step of the anaerobic fermentation system can be accurately predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of fermentation technology, and in particular, to a method for predicting gas production of an anaerobic fermentation system, a corresponding device, an electronic device, and a computer-readable storage medium. Background Art

[0002] Anaerobic fermentation refers to the process of obtaining biogas rich in methane by decomposing organic matter through microorganisms under suitable conditions. It is one of the large-scale biomass energy utilization methods, especially suitable for the efficient utilization of low-calorie biomass such as livestock manure and wet straw. Integrated semi-continuous dry anaerobic fermentation is a new type of semi-continuous fermentation technology. In this fermentation process, temperature is one of the key factors affecting biogas production. In order to maintain stable and high gas production, appropriate heating and heat preservation measures need to be taken to strictly control the anaerobic fermentation temperature and make it not affected by factors such as the external environmental temperature.

[0003] Existing methods for predicting anaerobic fermentation gas production still have problems such as low accuracy, poor dynamic adaptability, and insufficient environmental adaptability. With the in-depth understanding of the biological fermentation process and the improvement of computing power, more accurate and flexible prediction models may appear in the future to better address these problems.

[0004] In summary, since the existing methods for predicting anaerobic fermentation gas production still have problems such as low accuracy, poor dynamic adaptability, and insufficient environmental adaptability, the applicant has made corresponding explorations in consideration of solving this problem. Summary of the Invention

[0005] The purpose of the present application is to solve the above problems and provide a method for predicting gas production of an anaerobic fermentation system, a corresponding device, an electronic device, and a computer-readable storage medium.

[0006] To meet the various purposes of the present application, the following technical solutions are adopted:

[0007] A method for predicting gas production of an anaerobic fermentation system proposed for one of the purposes of the present application includes:

[0008] In response to a command for predicting gas production of the anaerobic fermentation system, obtaining gas production characteristic parameters in the anaerobic fermentation system and the cumulative methane production at each corresponding time step, where the gas production characteristic parameters are constructed by solid content, recycling ratio, fermentation temperature, and fermentation time;

[0009] Training a preset fermentation methane production prediction model using the gas production characteristic parameters and the cumulative methane production at each corresponding time step, and initializing each particle in the particle population by invoking a preset particle swarm optimization algorithm, where the particle represents a decision tree leaf node weight combination constructed by the weights of each decision tree leaf node in the fermentation methane production prediction model;

[0010] Obtain the loss function and boundary conditions corresponding to the fermentation methane production prediction model, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions, where the boundary conditions characterize the weight thresholds corresponding to the weights of each decision tree leaf node in the fermentation methane production prediction model, and the sum of the weights of each decision tree leaf node is equal to 1;

[0011] Determine the optimal decision tree leaf node weight combination corresponding to the fermentation methane production prediction model according to the global optimal solution. When the fermentation methane production prediction model reaches the preset number of decision tree leaf nodes, an optimal fermentation methane production prediction model is determined;

[0012] Input the preset gas production characteristic parameters into the optimal fermentation methane production prediction model to predict the methane accumulation corresponding to each future time step of the anaerobic fermentation system, so as to complete the gas production prediction of the anaerobic fermentation system.

[0013] Optionally, the expression of the loss function corresponding to the fermentation methane production prediction model is:

[0014]

[0015] where MSE represents the loss function corresponding to the fermentation methane production prediction model, represents the actual methane accumulation of the i-th gas production characteristic parameter at the j-th time step, represents the predicted methane accumulation of the i-th gas production characteristic parameter at the j-th time step.

[0016] Optionally, the steps of constructing a fermentation methane production prediction model include:

[0017] Obtain a sample training set, where the sample training set includes multiple training samples, and each training sample includes each gas production characteristic parameter and the methane accumulation corresponding to each time step thereof;

[0018] For each training sample, calculate and determine the first-order gradient and second-order gradient of the loss function of the current model with respect to the predicted value;

[0019] Based on the first-order gradient and the second-order gradient, use the greedy algorithm to construct a decision tree, traverse each gas production characteristic parameter and possible splitting points, and calculate the gain after splitting;

[0020] Select the gas production characteristic parameter and splitting point with the largest gain for node splitting, and repeat the above process until the maximum depth of the tree is reached or the preset stop condition is met.

[0021] Optionally, the steps of training the fermentation methane production prediction model include:

[0022] Obtain a sample training set, where the sample training set includes a plurality of training samples, and each training sample includes each gas production characteristic parameter and the corresponding methane cumulative amount at each time step;

[0023] Use the sample training set to train a preset fermentation methane production prediction model, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function corresponding to the fermentation methane production prediction model and the boundary conditions;

[0024] Determine the optimal decision tree leaf node weight combination corresponding to the fermentation methane production prediction model according to the global optimal solution. When the fermentation methane production prediction model reaches the preset number of decision tree leaf nodes, determine the optimal fermentation methane production prediction model to complete the training of the fermentation methane production prediction model.

[0025] Optionally, the steps of obtaining the loss function and boundary conditions corresponding to the fermentation methane production prediction model and determining the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions include:

[0026] Use a preset particle swarm optimization algorithm according to the loss function corresponding to the fermentation methane production prediction model and the boundary conditions, take the loss function corresponding to the fermentation methane production prediction model as the fitness function of the particle swarm optimization algorithm, and initialize the current velocity and current position of each particle in the particle swarm;

[0027] Obtain the current fitness value and current individual optimal solution corresponding to each particle, and determine the current global optimal solution of the particle population according to the current fitness value and the current individual optimal solution;

[0028] Based on a preset particle velocity formula, the loss function corresponding to the fermentation methane production prediction model, and the boundary conditions, determine the iterative position and iterative velocity of each particle;

[0029] Determine the latest fitness value corresponding to each particle according to the iterative position and the iterative velocity, determine the iterative individual optimal solution of each particle based on the iterative position, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the latest fitness value and the iterative individual optimal solution;

[0030] Repeat the above steps until the preset maximum number of iterations is satisfied to determine the optimal decision tree leaf node weight combination corresponding to the global optimal solution.

[0031] Optionally, the solid content is the percentage of the mass of pure solids (dry basis) in the total mass of the fermentation material (wet basis); the recycling ratio is the ratio of the mass of ammoniated straw (dry basis) in the newly added anaerobic fermentation material to the mass of biogas residue after anaerobic fermentation (dry basis); the fermentation temperature is the stable temperature of the anaerobic fermentation system provided by the super constant temperature water bath sandwich of the anaerobic fermentation system; the cumulative methane production is the cumulative total of the methane gas continuously produced by the anaerobic fermentation system over the fermentation time.

[0032] Optionally, the basic network architecture of the fermentation methane production prediction model is the XGBoost model; the particle swarm optimization algorithm includes the particle swarm optimization algorithm.

[0033] An anaerobic fermentation system gas production prediction device provided to meet another object of the present application includes:

[0034] A characteristic parameter acquisition module, configured to respond to an instruction for gas production prediction of the anaerobic fermentation system, and acquire the gas production characteristic parameters in the anaerobic fermentation system and the cumulative methane production at each corresponding time step, wherein the gas production characteristic parameters are constructed by the solid content, the recycling ratio, the fermentation temperature, and the fermentation time;

[0035] An initialization module, configured to train a preset fermentation methane production prediction model by using the gas production characteristic parameters and the cumulative methane production at each corresponding time step, and call a preset particle swarm optimization algorithm to initialize each particle in the particle population, wherein the particle represents a decision tree leaf node weight combination constructed by the weights of each decision tree leaf node in the fermentation methane production prediction model;

[0036] A global optimal solution determination module, configured to obtain the loss function and boundary conditions corresponding to the fermentation methane production prediction model, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions, wherein the boundary conditions represent the weight thresholds corresponding to the weights of each decision tree leaf node in the fermentation methane production prediction model, and the sum of the weights of each decision tree leaf node is equal to 1;

[0037] An optimal prediction model determination module, configured to determine the optimal decision tree leaf node weight combination corresponding to the fermentation methane production prediction model according to the global optimal solution, and when the fermentation methane production prediction model reaches the preset number of decision tree leaf nodes, to determine the optimal fermentation methane production prediction model;

[0038] A gas production prediction module, configured to input the preset gas production characteristic parameters into the optimal fermentation methane production prediction model to predict the methane accumulation corresponding to each future time step of the anaerobic fermentation system, so as to complete the gas production prediction of the anaerobic fermentation system.

[0039] An electronic device provided to meet another object of the present application includes a central processing unit and a memory. The central processing unit is used to call and run a computer program stored in the memory to execute the steps of the anaerobic fermentation system gas production prediction method described in the present application.

[0040] A computer-readable storage medium provided to meet another object of the present application stores a computer program implemented based on the anaerobic fermentation system gas production prediction method in the form of computer-readable instructions. When the computer program is called and run by a computer, it executes the steps included in the corresponding method.

[0041] Compared with the prior art, the anaerobic fermentation gas production prediction method in the present application still has problems such as low accuracy, poor dynamic adaptability, and insufficient environmental adaptability. The present application includes but is not limited to the following beneficial effects:

[0042] First, by using the XGBoost model and combining it with the particle swarm optimization algorithm, the gas production of the anaerobic fermentation system can be predicted more accurately. Traditional gas production prediction methods have problems such as low accuracy and poor dynamic adaptability. This method overcomes these disadvantages by refining the optimization of the weights of the decision tree leaf nodes, improving the accuracy of the prediction.

[0043] Second, the particle swarm optimization algorithm (PSO) can adapt to environmental changes in real time by continuously adjusting the state of the particles. Especially during the fermentation process, changes in the external environment, such as temperature fluctuations and changes in the organic matter composition, may affect the gas production. This method can dynamically adjust the parameters of the model according to the actual fermentation conditions, improving the adaptability and stability of the model.

[0044] Third, temperature is a key factor affecting biogas production. By strictly controlling the temperature during the anaerobic fermentation process, the stability and efficiency of the fermentation process can be ensured. Using this prediction model can help operators predict the methane accumulation in future time steps, so that they can adjust the heating and insulation measures more accurately, ensure that the system operates within the optimal temperature range, and avoid gas production fluctuations caused by temperature fluctuations.

[0045] Fourth, by accurately predicting the gas production characteristic parameters (such as solid content, recycling ratio, fermentation temperature, fermentation time), the resource utilization rate during the fermentation process can be optimized. The system can adjust the input amount and treatment method of the raw materials according to the prediction results, so as to achieve the best energy utilization efficiency. Especially when dealing with low-calorie biomass (such as livestock manure and wet straw), it can improve the resource utilization rate and economic benefits.

[0046] Fifthly, the accurate prediction of this application not only helps to improve the stability of the fermentation process, but also reduces the frequency of manual intervention. The system can automatically adjust and optimize the fermentation process. The operator only needs to make timely adjustments according to the prediction results of the model, reducing excessive experimental operations and manual judgments, and improving production efficiency.

[0047] Sixthly, this application can perform optimization calculations according to complex environmental factors to ensure that the system can still maintain stable gas production performance under changing external conditions. By introducing a prediction model with strong environmental adaptability, the fermentation system can always maintain a high biogas production under different production conditions.

[0048] By accurately predicting the cumulative methane production of each time step of the anaerobic fermentation system, it can provide comprehensive monitoring support for the system operation. This not only provides data support for future gas production trends, but also can early warn of possible abnormalities, avoiding situations such as system overload or insufficient gas production, and ensuring the smooth progress of the entire fermentation process.

[0049] In summary, this application can effectively improve the efficiency, stability and dynamic adaptability of the anaerobic fermentation system, has high application value, and can provide a more efficient solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The above and / or additional aspects and advantages of this application will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0051] Figure 1 is a schematic flow chart of the gas production prediction method for the anaerobic fermentation system in the embodiment of this application;

[0052] Figure 2 is a schematic diagram of the "integrated-semi-continuous" fermentation tank in the embodiment of this application;

[0053] Figure 3 is a schematic diagram of the cycle of the semi-continuous dry fermentation system in the embodiment of this application;

[0054] Figure 4 is a schematic block diagram of the principle of the gas production prediction device for the anaerobic fermentation system in the embodiment of this application;

[0055] Figure 5 is a schematic structural diagram of the computer device in the embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0056] Embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where like or similar reference numerals denote like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application and should not be construed as limiting the present application.

[0057] Those skilled in the art of the present technology can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the", and "said" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more of the associated listed items.

[0058] Those skilled in the art of the present technology can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those of ordinary skill in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have a meaning consistent with the meaning in the context of the prior art, and will not be interpreted in an idealized or overly formal sense unless specifically defined as here.

[0059] Those skilled in the art can understand that the "client", "terminal", and "terminal device" used herein include both devices with wireless signal receivers that only have the ability to receive and no ability to transmit, and devices with receiving and transmitting hardware that can perform two-way communication on a two-way communication link. Such devices can include: cellular or other communication devices such as personal computers and tablet computers, which have a single-line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which can combine voice, data processing, fax, and / or data communication capabilities; PDA (Personal Digital Assistant), which can include a radio frequency receiver, a pager, Internet / intranet access, a web browser, a notepad, a calendar, and / or a GPS (Global Positioning System) receiver; conventional laptop and / or palm computers or other devices, which are conventional laptop and / or palm computers or other devices with and / or including a radio frequency receiver. The "client", "terminal", and "terminal device" used herein can be portable, transportable, installed in a vehicle (air, sea, and / or land), or suitable for and / or configured to run locally, and / or run in a distributed form at any other location on the earth and / or in space. The "client", "terminal", and "terminal device" used herein can also be a communication terminal, an Internet access terminal, a music / video playback terminal, for example, it can be a PDA, a MID (Mobile Internet Device), and / or a mobile phone with music / video playback function, or it can also be a smart TV, a set-top box, and other devices.

[0060] The hardware referred to by names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer, which is a hardware device with the necessary components disclosed by the von Neumann principle, including a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit loads the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input / output devices to complete specific functions.

[0061] It should be noted that the concept of "server" in this application can similarly be extended to apply to server clusters. According to the network deployment principles understood by those skilled in the art, the servers should be logically divided. Physically, these servers can either be independent of each other but can be called through interfaces, or integrated into a single physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility and should not be restricted by it in the implementation of the network deployment method of this application.

[0062] One or several technical features of this application, unless expressly specified, can either be deployed on the server for the client to remotely call and obtain the online service interface provided by the server for access, or directly deployed and run on the client for access.

[0063] The neural network models cited or possibly cited in this application, unless expressly specified, can either be deployed on a remote server and remotely called on the client, or deployed on a client with sufficient device capabilities for direct calling. In some embodiments, when it runs on the client, its corresponding intelligence can be obtained through transfer learning to reduce the requirements for the client's hardware operating resources and avoid excessive occupation of the client's hardware operating resources.

[0064] All kinds of data involved in this application, unless expressly specified, can either be remotely stored on the server or stored on the local terminal device, as long as it is suitable for being called by the technical solution of this application.

[0065] Those skilled in the art should be aware that although the various methods of this application are described based on the same concept and thus show commonality with each other, unless otherwise specified, these methods can all be executed independently. Similarly, for the various embodiments disclosed in this application, they are all proposed based on the same inventive concept. Therefore, for concepts with the same expression, as well as concepts that are only appropriately transformed for convenience although the concept expressions are different, they should be equivalently understood.

[0066] For the various embodiments to be disclosed in this application, unless expressly stated to be mutually exclusive, the relevant technical features involved in each embodiment can be cross-combined to flexibly construct new embodiments, as long as such combination does not deviate from the creative spirit of this application and can meet the requirements in the prior art or solve certain deficiencies in the prior art. Those skilled in the art should be aware of this flexibility.

[0067] Anaerobic fermentation refers to the process of obtaining biogas rich in methane through the decomposition of organic matter by microorganisms under suitable conditions. It is one of the ways to utilize biomass energy on a large scale, especially suitable for the efficient utilization of low calorific value biomass such as livestock manure and wet straw. Integrated semi - continuous dry anaerobic fermentation is a new type of semi - continuous fermentation technology. In this fermentation process, temperature is one of the key factors affecting biogas production. To maintain stable and high gas production, appropriate heating and insulation measures need to be taken to strictly control the anaerobic fermentation temperature and prevent it from being interfered by factors such as the external environmental temperature.

[0068] In addition, the solid content of the fermentation substrate will affect the biogas production performance, substrate degradation rate, system stability, microbial community distribution and its metabolic pathway of anaerobic fermentation. Increasing the solid content will increase the organic load of the reactor and the methane production rate per unit volume, improve the treatment efficiency of the fermentation tank, but reduce the methane production rate per unit raw material. Excessively high solid content may lead to the failure of the fermentation system. The recycling ratio is the ratio of ammoniated straw to fermented biogas residue. A higher recycling ratio can enhance the microbial community of the fermentation system, thereby improving the biogas production performance and the organic matter degradation rate.

[0069] The fermentation device of semi - continuous dry fermentation refers to, based on batch dry fermentation, periodically discharging the old dry fermentation materials and supplementing fresh materials, so that the culture conditions of the reaction system supplemented with new materials are the same as those of batch dry fermentation. In existing research, semi - continuous dry fermentation operations are mainly achieved by connecting multiple fermentation tanks in series.

[0070] Please refer to Figure 1 , the semi - continuous dry fermentation experiment of ammoniated straw and pig manure biogas residue was carried out in an "integrated - semi - continuous" fermentation tank. The inside of the fermentation tank is hollow and is equipped with 5 hollow partitions, which divide the fermentation materials into 5 layers to complete the semi - continuous feeding operation. During the fermentation process, the fermentation waste liquid generated by the fermenting substances. This fermentation method has the characteristics of short startup time, low continuous operation pressure, and convenient feeding and discharging process compared with the traditional batch fermentation method.

[0071] Please refer to Figure 2 , the fermentation experiment was divided into three stages. Among them, the startup stage had four cycles, and both of the two operation stages had five cycles. At startup, three layers of pig manure biogas residue were placed in each tank as inoculum, and a layer of mixed dry fermentation substrate was placed on top of the inoculum. By measuring the gas production efficiency of the fermentation system every day, the gas production data was recorded.

[0072] When the methane production peak appears, start the ammoniation pretreatment of the straw, and then add the second layer of mixed substrate. Here, it is regarded as the end of the first cycle and the start of the second cycle. At the end of the second cycle, a feeding operation is carried out. And so on, until all four layers of materials added to the fermentation tank at the start of the fourth cycle are discharged, thus dividing the startup stage and the operation stage.

[0073] Then, the feeding operation was continued, and the formal operation stage began from the fifth cycle. The operations of methane production peak appearance - ammoniated straw - feeding were repeated until the gas production was stable in the fourteenth cycle, and the daily gas production data were recorded, indicating the completion of the entire semi - continuous dry fermentation experiment.

[0074] Currently, there is less research on the fermentation of integrated - semi - continuous fermenters. At the same time, there are many influencing factors in the fermentation process. For example, the solid content, recycling ratio, temperature, etc. of the fermentation will all affect the fermentation process. Different ratios of influencing factors lead to fluctuations in the gas production data of the device, and it is difficult to precisely control the fermentation gas production process by only controlling a single factor such as temperature.

[0075] Regarding the existing technical requirements of the current device, in order to better improve and serve the integrated - semi - continuous fermenter, it is necessary to develop a more efficient and energy - saving fermentation methane production prediction model to optimize the control system.

[0076] Please refer to Figure 1 , in one embodiment of the gas production prediction method for the anaerobic fermentation system of the present application, it includes:

[0077] Step S10: Responding to the instruction for gas production prediction of the anaerobic fermentation system, obtaining the gas production characteristic parameters in the anaerobic fermentation system and the cumulative methane production at each corresponding time step. Among them, the gas production characteristic parameters are constructed by the solid content, recycling ratio, fermentation temperature, and fermentation time;

[0078] The gas production prediction system of the anaerobic fermentation system in the terminal device can respond to the instruction for gas production prediction of the anaerobic fermentation system, obtain the gas production characteristic parameters in the anaerobic fermentation system and the cumulative methane production at each corresponding time step. Among them, the gas production characteristic parameters are constructed by the solid content, recycling ratio, fermentation temperature, and fermentation time; where the solid content is the percentage of the mass of pure solid (dry basis) in the total mass of the fermentation material (wet basis); the recycling ratio is the ratio of the mass of ammoniated straw (dry basis) in the newly added anaerobic fermentation material to the mass of biogas residue (dry basis) after anaerobic fermentation; the fermentation temperature is the stable temperature of the anaerobic fermentation system provided by the super constant temperature water bath sandwich of the anaerobic fermentation system; the cumulative methane production is the cumulative total of the methane gas continuously produced by the anaerobic fermentation system over the fermentation time; the fermentation time is the cumulative time of operation of the anaerobic fermentation system.

[0079] In some embodiments, the daily methane production data of semi - continuous dry fermentation of pig manure co - ammoniated straw under different conditions (the solid content rates of the substrate are 20%, 25%, and 30% respectively; the recycling ratios are 1:1, 1:0.7, 1:0.4, 1:0 (calculated by TS); the temperatures are 25°C, 37°C, and 55°C respectively) can be measured by a gas composition analyzer for the daily gas collection bags, and the cumulative methane production data of the fermentation gas production system can be obtained by accumulation.

[0080] Step S20: Use the gas production characteristic parameters and the cumulative methane production at each corresponding time step to train a preset fermentation methane production prediction model, and call a preset particle swarm optimization algorithm to initialize each particle in the particle population, where the particle represents a decision tree leaf node weight combination constructed by the weights of each decision tree leaf node in the fermentation methane production prediction model;

[0081] After obtaining the gas production characteristic parameters and the cumulative methane production at each corresponding time step in the anaerobic fermentation system, use the gas production characteristic parameters and the cumulative methane production at each corresponding time step to train a preset fermentation methane production prediction model, and call a preset particle swarm optimization algorithm to initialize each particle in the particle population, where the particle represents a decision tree leaf node weight combination constructed by the weights of each decision tree leaf node in the fermentation methane production prediction model; among them, the basic network architecture of the fermentation methane production prediction model is an XGBoost model.

[0082] In some embodiments, XGBoost (Extreme Gradient Boosting) is an efficient gradient - boosting decision tree (GBDT) algorithm. It makes predictions through the combination of multiple decision trees. Each tree optimizes the overall performance by learning the residuals (i.e., the error parts) of the previous tree model. The basic architecture of the XGBoost model consists of the following parts: Each tree in the model is used for prediction. The structure of each tree consists of features and split points, which are used to divide the data set into different regions, so that the predicted values within each region are as close as possible to the true values. The tree is gradually constructed to reduce the residuals (errors). Each tree is trained based on the prediction errors of the previous tree, thus continuously improving the model. The output value of each tree is usually a weighted sum, and these weights determine the contribution of different trees to the final prediction result.

[0083] The Particle Swarm Optimization (PSO) algorithm is an optimization algorithm that simulates the foraging behavior of bird flocks in nature. Each "particle" represents a potential solution, which moves in the search space to find the optimal position that can minimize (or maximize) the objective function. Specifically, PSO includes the following key steps: Each particle represents a possible combination of decision tree leaf node weights, that is, the weights of each tree in the XGBoost model. The position of a particle is a set of these weights. Each particle adjusts its velocity according to its own position, velocity, and the best position in the group, so as to move in the search space. The position of each particle represents a combination of decision tree leaf node weights, so its fitness can be evaluated by calculating the prediction performance of this combination in the XGBoost model (such as by calculating the error or loss function). The fitness value of the particle is related to the prediction error of the XGBoost model. Each particle records the best position it encounters during the search process, and at the same time, the global best position in the group is updated with each iteration.

[0084] In some embodiments, the steps of constructing a fermentation methane production prediction model include:

[0085] Step S201, obtain a sample training set, where the sample training set includes a plurality of training samples, and each training sample includes each gas production characteristic parameter and its corresponding methane cumulative amount at each time step;

[0086] Step S202, for each training sample, calculate and determine the first-order gradient and the second-order gradient of the loss function of the current model with respect to the predicted value;

[0087] Step S203, based on the first-order gradient and the second-order gradient, use a greedy algorithm to construct a decision tree, traverse each gas production characteristic parameter and possible split points, and calculate the gain after splitting;

[0088] Step S204, select the gas production characteristic parameter and split point with the largest gain for node splitting, and repeat the above process until the maximum depth of the tree is reached or a preset stop condition is satisfied.

[0089] Specifically, XGBoost (eXtreme Gradient Boosting) is a machine learning model based on the gradient boosting framework, mainly used for classification and regression tasks. Its core principle is to gradually optimize the model performance by iteratively constructing a series of decision trees. In each round of iteration in XGBoost, first, the gradients of the current model's loss function (such as mean squared error or logarithmic loss) with respect to the predicted values are calculated, and then based on this gradient information, a new decision tree is constructed to fit the residuals (i.e., the difference between the true value and the current predicted value). The uniqueness of XGBoost lies in its high efficiency and flexibility. It adopts the weighted quantile technique to accelerate the search for feature split points and processes missing values and sparse data through a sparse-aware algorithm. In addition, XGBoost supports parallel computing and uses multi-threading to optimize the tree construction process. Finally, the model weights and sums the prediction results of all trees to obtain the final output. This iterative optimization mechanism based on gradient boosting enables XGBoost to perform excellently in dealing with complex data and high-dimensional features and becomes the basic network architecture in the anaerobic fermentation gas prediction model of this application.

[0090] The establishment process of XGBoost (eXtreme Gradient Boosting) is a process of gradually iteratively optimizing the model, and its core idea is to minimize the loss function by constructing a series of decision trees. The establishment process of its model is as follows:

[0091] First, the model initializes a basic predicted value, usually a constant (such as the mean or median of the target variable). This initial value is used to calculate the initial residuals (the difference between the true value and the predicted value).

[0092] XGBoost gradually optimizes the model through multiple rounds of iteration, and a new decision tree is constructed in each round of iteration. The specific steps are as follows:

[0093] (1) Calculate the gradient and second derivative

[0094] For each training sample, calculate the first-order gradient and second-order gradient of the current model's loss function with respect to the predicted value. Among them, the expression of the first-order gradient is:

[0095]

[0096] The expression of the second-order gradient is:

[0097]

[0098] where y i represents the true value, represents the predicted value, represents the loss function, which is used to represent the gap between the predicted value and the true value, and gi represents the first - order gradient, which represents the partial derivative of the loss function with respect to the predicted value of each training sample; h i represents the second - order gradient, which represents the second - order partial derivative of the loss function with respect to the predicted value of each training sample;

[0099] The above first - order gradient and second - order gradient information are used to guide the construction of a new tree.

[0100] Based on the gradient information, XGBoost uses a greedy algorithm to construct a decision tree. The specific steps are as follows:

[0101] Feature selection: Traverse all features and possible split points, and calculate the gain after splitting. The gain formula is:

[0102]

[0103] where, I L represents the set of samples in the left child node after splitting the current node, I R represents the set of samples in the right child node after splitting the current node, and each training sample will be assigned to the left or right child node according to its feature value; I P is the set of samples in the parent node of the current node, representing the entire node before splitting. λ represents the regularization parameter, which is usually used to prevent overfitting. When calculating the gain, λ is used to penalize the complexity of each child node. It controls the tolerance for the number of splits of leaf nodes during splitting; γ represents the complexity control parameter, which is used to penalize the complexity of the tree. When the depth of the tree increases, the model becomes more complex and may lead to overfitting. By setting γ, the penalty for increasing the node complexity during splitting can be controlled. Only when the gain brought by splitting is greater than γ will the splitting be performed.

[0104] Its splitting characteristics are as follows:

[0105] Select the optimal split: Select the feature and split point with the largest gain for node splitting.

[0106] Recursive splitting: Repeat the above process until the maximum depth of the tree is reached or the stopping condition (such as the minimum number of samples) is met.

[0107] XGBoost controls the complexity of the tree through the regularization parameter to prevent overfitting. If the gain after splitting is less than the threshold γ, the splitting stops to avoid generating an overly complex tree.

[0108] After each new tree is constructed, the predicted value of the model is updated to:

[0109]

[0110] where, is the predicted value after the t-th round of iteration, η is the learning rate, and f t (x i ) is the output of the t-th tree.

[0111] Repeat the above process until the preset number of iterations is reached or the model performance no longer improves significantly. The predicted value of the final model is the weighted sum of the predicted values of all trees:

[0112]

[0113] where represents the final predicted value.

[0114] In some embodiments, the collected samples are divided into a test set and a training set by the stratified sampling method. The training set of the fermentation methane production prediction model is:

[0115] X(k) = [t(k), t(k - 1),..., t(k - n), T1(k), T2(k), T3(k)] T , and the test set is T(k) = [t(k + 1), t(k + 2),..., t(k + p)] T , where X(k) is the input vector, T(k) is the target vector, k is the fermentation time, T1, T2, and T3 are the solid content, recycling ratio, and fermentation temperature respectively, t is the output parameter, i.e., the cumulative methane production, n is the output delay order, representing the number of past time steps used for prediction in the input data. For example, if n = 3, it means using the data of the past 3 time steps for prediction. p represents the number of time steps for prediction, representing the values of the target variable in the next p time steps.

[0116] The data is standardized according to the following formula, which is expressed as:

[0117]

[0118] where y i is the standardized data value, x i is the original data value, μ is the mean of this feature, and σ is the standard deviation of this feature.

[0119] Step S30: Obtain the loss function and boundary conditions corresponding to the fermentation methane production prediction model, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions, where the boundary conditions characterize the weight thresholds corresponding to the weights of each decision tree leaf node in the fermentation methane production prediction model, and the sum of the weights of each decision tree leaf node is equal to 1;

[0120] The preset fermentation methane production prediction model is trained using the gas production characteristic parameters and the cumulative methane production at each corresponding time step. After initializing each particle in the particle population by invoking the preset particle swarm optimization algorithm, the loss function and boundary conditions corresponding to the fermentation methane production prediction model are obtained. The global optimal solution of the particle population corresponding to the decision tree leaf node weight combination is determined according to the loss function and the boundary conditions, where the boundary conditions characterize the weight thresholds corresponding to the weights of each decision tree leaf node in the fermentation methane production prediction model, and the sum of the weights of each decision tree leaf node is equal to 1;

[0121] In some embodiments, the expression of the loss function corresponding to the fermentation methane production prediction model is:

[0122]

[0123] where MSE represents the loss function corresponding to the fermentation methane production prediction model, represents the actual cumulative methane amount of the i-th gas production characteristic parameter at the j-th time step, represents the predicted cumulative methane amount of the i-th gas production characteristic parameter at the j-th time step.

[0124] In some embodiments, the steps of obtaining the loss function and boundary conditions corresponding to the fermentation methane production prediction model and determining the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions include:

[0125] Step S301: Using the preset particle swarm optimization algorithm, according to the loss function corresponding to the fermentation methane production prediction model and the boundary conditions, taking the loss function corresponding to the fermentation methane production prediction model as the fitness function of the particle swarm optimization algorithm, and initializing the current velocity and current position of each particle in the particle swarm;

[0126] Step S302: Obtaining the current fitness value and current individual optimal solution corresponding to each particle, and determining the current global optimal solution of the particle population according to the current fitness value and the current individual optimal solution;

[0127] Step S303: Based on the preset particle velocity formula, the loss function corresponding to the fermentation methane production prediction model, and the boundary conditions, determining the iterative position and iterative velocity of each particle;

[0128] Step S304: Determine the latest fitness value corresponding to each particle according to the iteration position and the iteration speed, determine the individual optimal solution after iteration of each particle based on the iteration position, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the latest fitness value and the individual optimal solution after iteration;

[0129] Step S305: Repeat the above steps until the preset maximum number of iterations is satisfied to determine the optimal decision tree leaf node weight combination corresponding to the global optimal solution.

[0130] Step S40: Determine the optimal decision tree leaf node weight combination corresponding to the methane production prediction model for fermentation according to the global optimal solution. When the methane production prediction model for fermentation reaches the preset number of decision tree leaf nodes, determine the optimal methane production prediction model for fermentation;

[0131] Obtain the loss function and boundary conditions corresponding to the methane production prediction model for fermentation. After determining the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions, determine the optimal decision tree leaf node weight combination corresponding to the methane production prediction model for fermentation. When the methane production prediction model for fermentation reaches the preset number of decision tree leaf nodes, determine the optimal methane production prediction model for fermentation;

[0132] In some embodiments, the steps of training the methane production prediction model for fermentation include:

[0133] Step S201: Obtain a sample training set, where the sample training set includes multiple training samples, and each training sample includes each gas production characteristic parameter and the corresponding methane accumulation at each time step;

[0134] Step S202: Use the sample training set to train a preset methane production prediction model for fermentation, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions corresponding to the methane production prediction model for fermentation;

[0135] Step S203: Determine the optimal decision tree leaf node weight combination corresponding to the methane production prediction model for fermentation according to the global optimal solution. When the methane production prediction model for fermentation reaches the preset number of decision tree leaf nodes, determine the optimal methane production prediction model for fermentation to complete the training of the methane production prediction model for fermentation.

[0136] After the optimal methane production prediction model for fermentation is to be determined, it can be put into production use. Input the gas production characteristic parameters into the optimal methane production prediction model for fermentation to predict the corresponding methane accumulation at each future time step of the anaerobic fermentation system.

[0137] Step S50: Input the preset gas production characteristic parameters into the optimal methane production prediction model for anaerobic fermentation to predict the methane accumulation corresponding to each future time step of the anaerobic fermentation system, thereby completing the gas production prediction of the anaerobic fermentation system.

[0138] Determine the weight combination of the leaf nodes of the optimal decision tree corresponding to the methane production prediction model according to the global optimal solution. After determining the optimal methane production prediction model when the methane production prediction model reaches the preset number of leaf nodes of the decision tree, input the preset gas production characteristic parameters into the optimal methane production prediction model for anaerobic fermentation to predict the methane accumulation corresponding to each future time step of the anaerobic fermentation system, thereby completing the gas production prediction of the anaerobic fermentation system.

[0139] Specifically, the XGBoost model predicts the target variable (such as methane production) by making a series of judgments on the input features. The XGBoost model has multiple leaf nodes of the decision tree, and each leaf node of the decision tree has a weight. The optimal weight combination of the leaf nodes of the decision tree means that we have found the weight configuration of the decision tree nodes that can most accurately predict the methane accumulation. After obtaining the optimal weight combination of the leaf nodes of the decision tree through the global optimal solution, the entire methane production prediction model will be adjusted according to this weight configuration of the decision tree nodes, and then the optimal prediction model is obtained. This optimal model can make the most accurate prediction for the input parameters. The preset gas production characteristic parameters are some known input variables, usually related to the control conditions or environmental factors during the fermentation process, such as temperature, solid content, recycle ratio, etc. These parameters are set in advance and used to be input into the optimal methane production prediction model for anaerobic fermentation.

[0140] In some embodiments, the time step refers to the methane accumulation at some specific future time points during the prediction process. The prediction model needs to infer the future methane generation situation based on the current and past conditions. For example, the model can predict the methane production in the next hour, day, or week. The methane accumulation is the target variable to be predicted, that is, during the anaerobic fermentation process, the total amount of methane produced by the system. By predicting the methane accumulation at these time steps, the model helps to understand the gas production situation of the future anaerobic fermentation system.

[0141] Through the above steps, the methane accumulation predictions for each future time step are obtained. This means that the gas production behavior of the fermentation system can be accurately predicted, helping decision-makers optimize the fermentation process and adjust parameters according to the prediction results, so as to achieve a more efficient fermentation gas production effect.

[0142] As can be seen from Table 1, the model prediction values of the test samples are close to the on-site measured values, and the absolute errors are all less than 1%. At the same time, the mean square error was calculated using the MSE function to obtain MSE = 3.319. It can be seen that the fermentation gas production prediction model established based on the XGBoost model has high accuracy and stability.

[0143] Table 1 Prediction Values, On-site Measured Values and Absolute Errors of the XGBoost Model

[0144]

[0145] As can be seen from the above embodiments, compared with the prior art, there are still problems in the anaerobic fermentation gas production prediction method of the present application, such as low accuracy, poor dynamic adaptability, and insufficient environmental adaptability. The present application includes but is not limited to the following beneficial effects:

[0146] First, by using the XGBoost model and combining it with the particle swarm optimization algorithm, the gas production of the anaerobic fermentation system can be predicted more accurately. Traditional gas production prediction methods have problems such as low accuracy and poor dynamic adaptability. However, this method overcomes these shortcomings by refining the optimization of the weights of the decision tree leaf nodes, improving the accuracy of the prediction.

[0147] Second, the particle swarm optimization algorithm (PSO) can continuously adjust the state of the particles to adapt to environmental changes in real time. Especially during the fermentation process, changes in the external environment, such as temperature fluctuations and changes in the organic matter composition, may affect the gas production. This method can dynamically adjust the parameters of the model according to the actual fermentation conditions, improving the adaptability and stability of the model.

[0148] Third, temperature is a key factor affecting biogas production. By strictly controlling the temperature during the anaerobic fermentation process, the stability and efficiency of the fermentation process can be ensured. Using this prediction model can help operators predict the methane accumulation in future time steps, so that heating and insulation measures can be adjusted more accurately to ensure that the system operates within the optimal temperature range and avoid gas production fluctuations caused by temperature fluctuations.

[0149] Fourth, by accurately predicting the gas production characteristic parameters (such as solid content, recycling ratio, fermentation temperature, fermentation time), the resource utilization rate during the fermentation process can be optimized. The system can adjust the input amount and treatment method of the raw materials according to the prediction results, so as to achieve the best energy utilization efficiency. Especially when dealing with low-calorie biomass (such as livestock manure and wet straw), the resource utilization rate and economic benefits can be improved.

[0150] Fifthly, the accurate prediction of this application not only helps to improve the stability of the fermentation process, but also reduces the frequency of manual intervention. The system can automatically adjust and optimize the fermentation process. The operator only needs to make timely adjustments according to the prediction results of the model, reducing excessive experimental operations and manual judgments, and improving production efficiency.

[0151] Sixthly, this application can perform optimization calculations based on complex environmental factors to ensure that the system can still maintain stable gas production performance under changing external conditions. By introducing a prediction model with strong environmental adaptability, the fermentation system can always maintain a high biogas production under different production conditions.

[0152] By accurately predicting the cumulative methane production of each time step of the anaerobic fermentation system, it can provide comprehensive monitoring support for the system operation. This not only provides data support for future gas production trends, but also can early warn of possible abnormalities, avoiding situations of system overload or insufficient gas production, and ensuring the smooth progress of the entire fermentation process.

[0153] In summary, this application can effectively improve the efficiency, stability and dynamic adaptability of the anaerobic fermentation system, has high application value, and can provide a more efficient solution.

[0154] Please refer to Figure 4, An anaerobic fermentation system gas production prediction device provided to meet one of the purposes of the present application, including a characteristic parameter acquisition module 1100, an initialization module 1200, a global optimal solution determination module 1300, an optimal prediction model determination module 1400, and a gas production prediction module 1500. Among them, the characteristic parameter acquisition module 1100 is set to respond to an instruction for gas production prediction of the anaerobic fermentation system, and acquire the gas production characteristic parameters in the anaerobic fermentation system and the cumulative methane production at each corresponding time step. Among them, the gas production characteristic parameters are constructed by the solid content, the recycling ratio, the fermentation temperature, and the fermentation time; the initialization module 1200 is set to train a preset fermentation methane production prediction model using the gas production characteristic parameters and the cumulative methane production at each corresponding time step, and call a preset particle swarm optimization algorithm to initialize each particle in the particle population. Among them, the particle represents a decision tree leaf node weight combination constructed by the weights of each decision tree leaf node in the fermentation methane production prediction model; the global optimal solution determination module 1300 is set to obtain the loss function and boundary conditions corresponding to the fermentation methane production prediction model, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions. Among them, the boundary conditions represent the weight thresholds corresponding to the weights of each decision tree leaf node in the fermentation methane production prediction model, and the sum of the weights of each decision tree leaf node is equal to 1; the optimal prediction model determination module 1400 is set to determine the optimal decision tree leaf node weight combination corresponding to the fermentation methane production prediction model according to the global optimal solution. When the fermentation methane production prediction model reaches the preset number of decision tree leaf nodes, the optimal fermentation methane production prediction model is determined; the gas production prediction module 1500 is set to input the preset gas production characteristic parameters into the optimal fermentation methane production prediction model to predict the methane cumulative amount corresponding to each future time step of the anaerobic fermentation system, so as to complete the gas production prediction of the anaerobic fermentation system.

[0155] Based on any embodiment of the present application, please refer to Figure 5 , Another embodiment of the present application further provides an electronic device, which can be implemented by a computer device, such as Figure 5As shown, it is a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database can store a control information sequence. When the computer-readable instructions are executed by the processor, the processor can implement a gas production prediction method for an anaerobic fermentation system. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device can store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute the gas production prediction method of the present application for the anaerobic fermentation system. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art can understand that Figure 5 The structure shown in [figure reference] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0156] In this embodiment, the processor is used to execute Figure 4 the specific functions of each module in [module reference]. The memory stores the program codes and various types of data required to execute the above-mentioned modules or sub-modules. The network interface is used for data transmission between the user terminal and the server. The memory in this embodiment stores the program codes and data required to execute all modules in the gas production prediction device of the anaerobic fermentation system of the present application. The server can call the program codes and data of the server to execute the functions of all modules.

[0157] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to execute the steps of the gas production prediction method for an anaerobic fermentation system according to any embodiment of the present application.

[0158] The present application also provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by one or more processors, the steps of the gas production prediction method for an anaerobic fermentation system according to any embodiment of the present application are implemented.

[0159] Those of ordinary skill in the art can understand that all or part of the processes in the above-described embodiments of the method of this application can be completed by instructing relevant hardware through a computer program. This computer program can be stored in a computer-readable storage medium. When this program is executed, it can include the processes of the embodiments of the above-described various methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.

[0160] The above are only some implementation manners of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A method for predicting gas production in an anaerobic fermentation system, characterized in that, Including: Responding to an instruction for methane production prediction of an anaerobic fermentation system, obtaining gas production characteristic parameters in the anaerobic fermentation system and the cumulative methane production at each corresponding time step, wherein the gas production characteristic parameters are constructed by solid content, recycling ratio, fermentation temperature, and fermentation time; Using the gas production characteristic parameters and the cumulative methane production at each corresponding time step to train a preset fermentation methane production prediction model, and initializing each particle in the particle population by calling a preset particle swarm optimization algorithm, wherein the particle represents a decision tree leaf node weight combination constructed by the weights of each decision tree leaf node in the fermentation methane production prediction model; Obtaining the loss function and boundary conditions corresponding to the fermentation methane production prediction model, and determining the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions, wherein the boundary conditions represent the weight thresholds corresponding to the weights of each decision tree leaf node in the fermentation methane production prediction model, and the sum of the weights of each decision tree leaf node is equal to 1; Determining the optimal decision tree leaf node weight combination corresponding to the fermentation methane production prediction model according to the global optimal solution, and when the fermentation methane production prediction model reaches the preset number of decision tree leaf nodes, determining the optimal fermentation methane production prediction model; Inputting the preset gas production characteristic parameters into the optimal fermentation methane production prediction model to predict the methane accumulation corresponding to each future time step of the anaerobic fermentation system, so as to complete the gas production prediction of the anaerobic fermentation system.

2. The anaerobic fermentation system gas production prediction method according to claim 1, characterized in that The expression of the loss function corresponding to the fermentation methane production prediction model is: The expression of the loss function corresponding to the fermentation methane production prediction model is: Among them, MSE represents the loss function corresponding to the fermentation methane production prediction model, represents the actual methane cumulative amount of the i-th gas production characteristic parameter at the j-th time step, represents the predicted methane cumulative amount of the i-th gas production characteristic parameter at the j-th time step.

3. The anaerobic fermentation system gas production prediction method according to claim 1, wherein The steps of constructing a fermentation methane production prediction model include: Obtaining a sample training set, wherein the sample training set includes multiple training samples, and each training sample includes each gas production characteristic parameter and the methane accumulation at each corresponding time step; For each training sample, calculating and determining the first-order gradient and second-order gradient of the loss function of the current model with respect to the predicted value; Based on the first-order gradient and the second-order gradient, constructing a decision tree using a greedy algorithm, traversing each gas production characteristic parameter and possible splitting points, and calculating the gain after splitting; Selecting the gas production characteristic parameter and splitting point with the largest gain for node splitting, and repeating the above process until the maximum depth of the tree is reached or the preset stop condition is satisfied.

4. The anaerobic fermentation system gas production prediction method according to claim 1, characterized in that, The steps of training a fermentation methane production prediction model include: Obtaining a sample training set, wherein the sample training set includes multiple training samples, and each training sample includes each gas production characteristic parameter and the methane accumulation at each corresponding time step; Training a preset fermentation methane production prediction model using the sample training set, and determining the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions corresponding to the fermentation methane production prediction model; Determine the weight combination of the optimal decision tree leaf nodes corresponding to the methane production prediction model according to the global optimal solution. When the methane production prediction model reaches the preset number of decision tree leaf nodes, determine the optimal methane production prediction model to complete the training of the methane production prediction model.

5. The anaerobic fermentation system gas production prediction method according to claim 1, wherein The steps of obtaining the loss function and boundary conditions corresponding to the methane production prediction model and determining the global optimal solution of the particle population corresponding to the weight combination of the decision tree leaf nodes according to the loss function and the boundary conditions include: Using a preset particle swarm optimization algorithm, according to the loss function and the boundary conditions corresponding to the methane production prediction model, taking the loss function corresponding to the methane production prediction model as the fitness function of the particle swarm optimization algorithm, and initializing the current velocity and current position of each particle in the particle swarm; Obtain the current fitness value and the current individual optimal solution corresponding to each particle, and determine the current global optimal solution of the particle population according to the current fitness value and the current individual optimal solution; Based on a preset particle velocity formula, the loss function corresponding to the methane production prediction model, and the boundary conditions, determine the iterative position and iterative velocity of each particle; Determine the latest fitness value corresponding to each particle according to the iterative position and the iterative velocity, determine the iterative individual optimal solution of each particle based on the iterative position, and determine the global optimal solution of the particle population corresponding to the weight combination of the decision tree leaf nodes according to the latest fitness value and the iterative individual optimal solution; Repeat the above steps until the preset maximum number of iterations is satisfied to determine the optimal decision tree leaf node weight combination corresponding to the global optimal solution.

6. The anaerobic fermentation system gas production prediction method according to claim 1, characterized in that The solid content is the percentage of the pure solid mass (dry basis) in the total mass of the fermentation material (wet basis); the recycling ratio is the ratio of the ammoniated straw mass (dry basis) in the newly added anaerobic fermentation material to the mass of the biogas residue after anaerobic fermentation (dry basis); the fermentation temperature is the stable temperature of the anaerobic fermentation system provided by the super constant temperature water bath sandwich of the anaerobic fermentation system; the cumulative methane production is the cumulative total of the methane gas continuously produced by the anaerobic fermentation system over the fermentation time.

7. The anaerobic fermentation system gas production prediction method according to any one of claims 1 to 6, characterized in that The basic network architecture of the methane production prediction model is the XGBoost model.

8. An anaerobic fermentation system gas production prediction device, characterized in that, Including: A feature parameter acquisition module, configured to respond to an instruction for gas production prediction of an anaerobic fermentation system, and acquire the gas production feature parameters in the anaerobic fermentation system and the cumulative methane production at each corresponding time step, where the gas production feature parameters are constructed by the solid content, the recycling ratio, the fermentation temperature, and the fermentation time; An initialization module, configured to train a preset methane production prediction model using the gas production feature parameters and the cumulative methane production at each corresponding time step, and call a preset particle swarm optimization algorithm to initialize each particle in the particle swarm, where the particle represents a decision tree leaf node weight combination constructed by the weights of each decision tree leaf node in the methane production prediction model; The global optimal solution determination module is configured to obtain the loss function corresponding to the methane production prediction model by fermentation and the boundary conditions, and determine the global optimal solution of the particle population corresponding to the decision tree leaf node weight combination according to the loss function and the boundary conditions, where the boundary conditions characterize the weight thresholds corresponding to the weights of each decision tree leaf node in the methane production prediction model by fermentation, and the sum of the weights of each decision tree leaf node is equal to 1; The optimal prediction model determination module is configured to determine the optimal decision tree leaf node weight combination corresponding to the methane production prediction model by fermentation according to the global optimal solution, and when the methane production prediction model by fermentation reaches the preset number of decision tree leaf nodes, to determine the optimal methane production prediction model by fermentation; The gas production prediction module is configured to input the preset gas production characteristic parameters into the optimal methane production prediction model by fermentation to predict the methane accumulation amount corresponding to each future time step of the anaerobic fermentation system, so as to complete the gas production prediction of the anaerobic fermentation system.

9. An electronic device, comprising a central processing unit and a memory, characterized in that, The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores in the form of computer-readable instructions a computer program implemented according to the method according to any one of claims 1 to 7, and when the computer program is called and run by the computer, it executes the steps included in the corresponding method.