Microflora abundance trajectory prediction method, device, equipment and medium

By acquiring and segmenting the abundance time series of fermentation bodies, and utilizing the Transformer encoder and a self-supervised training time series prediction model, the problem of dynamic changes in microbial communities was solved, enabling accurate prediction and process optimization in the brewing process of Maotai-flavor liquor, thereby improving product quality and production stability.

CN121938465APending Publication Date: 2026-04-28KWEICHOW MOUTAI COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511952788.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies make it difficult to track and predict the dynamic changes of microbial communities in the brewing process of Maotai-flavor liquor in real time, which affects the optimization of fermented food quality.

Method used

By acquiring the target abundance time series of fermentation bodies, the model is divided into first and second abundance time series. The first time series prediction model is used to train the second time series prediction model to predict the abundance changes of microbial communities at different fermentation stages. The time series prediction model is constructed using a Transformer encoder and a self-attention mechanism. Combined with a self-supervised training strategy, the robustness of the model in scenarios with irregular sampling and missing data is improved.

Benefits of technology

It enables accurate prediction of the trajectory of microbial community abundance changes, provides data support for timely adjustment of fermentation processes, improves the repeatability and quality stability of fermented products, and promotes the intelligent upgrading of traditional Maotai-flavor liquor fermentation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121938465A_ABST
    Figure CN121938465A_ABST
Patent Text Reader

Abstract

The invention provides a microflora abundance trajectory prediction method, device and equipment and a medium, and relates to the technical field of biological information, and the method comprises the steps: obtaining at least one target abundance time sequence corresponding to a plurality of fermentation bodies of a first production team; the target abundance time sequence comprises abundance data of the target microorganism class group in the complete fermentation stage according to fermentation time sorting; dividing each target abundance time sequence to obtain a corresponding first abundance time sequence and a corresponding second abundance time sequence; the first abundance time sequence corresponds to a first fermentation stage, and the second abundance time sequence corresponds to a second fermentation stage after the first fermentation stage; and training the first time sequence prediction model by taking each first abundance time sequence as an input and taking the corresponding second abundance time sequence as a training label to obtain a second time sequence prediction model. The method can accurately predict the abundance change track of the target microorganism class group based on the second time sequence prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of bioinformatics, and in particular to a method, apparatus, device, and medium for predicting the abundance trajectory of microbial communities. Background Technology

[0002] Understanding the dynamic changes in microbial communities is crucial for improving the quality of fermented foods. Maotai-flavor baijiu, a typical representative of Chinese baijiu, is a traditional fermented food formed through multiple rounds of solid-state natural fermentation in an environment where various microorganisms coexist. Real-time tracking and predictive regulation of the dynamic changes in microorganisms during baijiu brewing will significantly promote real-time monitoring and process optimization. Therefore, predicting the temporal trajectory of microbial community changes is an urgent problem to be solved. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, device, and medium for predicting the abundance trajectory of microbial communities, so as to solve the above-mentioned technical problems.

[0004] On the one hand, a method for predicting the abundance trajectory of microbial communities is provided, including: Obtain at least one target abundance time series corresponding to multiple fermentation bodies of the first production team; wherein, one target abundance time series corresponds to one target microbial group, and the target abundance time series contains the abundance data of the target microbial group sorted by fermentation time during the complete fermentation stage; Each target abundance time series is divided to obtain a corresponding first abundance time series and a second abundance time series; the first abundance time series corresponds to the first fermentation stage, and the second abundance time series corresponds to the second fermentation stage after the first fermentation stage. The first fermentation stage and the second fermentation stage together constitute the complete fermentation stage. Using each of the first abundance time series as input and the corresponding second abundance time series as training labels, the first time series prediction model is trained to obtain the second time series prediction model; the second time series prediction model is used to predict the abundance time series of the target microbial group in the second fermentation stage based on the abundance time series of the target microbial group in the first fermentation stage.

[0005] In some embodiments, obtaining at least one target abundance time series corresponding to multiple fermentation bodies of the first production shift includes: Metagenomic sequencing was performed on multiple fermentation samples corresponding to multiple fermentation bodies of the first production team to obtain sequencing results; wherein, the multiple fermentation samples include fermentation samples collected in multiple rounds of stacking fermentation stage and fermentation stage in cellar during the complete fermentation stage. Based on the sequencing results, the abundance of the target microbial groups in each of the fermented mash samples was determined; The abundance of the same fermentation body and the same target microbial group is sorted according to the time of the multiple rounds of stacked fermentation and cellar fermentation to obtain at least one target abundance time series of the same fermentation body, and then at least one target abundance time series corresponding to multiple fermentation bodies.

[0006] In some embodiments, the plurality of fermentation cycles include sand introduction, sand making, a first fermentation cycle, a second fermentation cycle, a third fermentation cycle, a fourth fermentation cycle, and a fifth fermentation cycle. The first fermentation stage includes sand introduction, sand making, and a first fermentation cycle, and the second fermentation stage includes the second fermentation cycle, the third fermentation cycle, the fourth fermentation cycle, and the fifth fermentation cycle.

[0007] In some embodiments, when there are multiple target microbial groups, each target abundance time series is bound to a corresponding identifier, and the first abundance time series and the second abundance time series corresponding to each target abundance time series are simultaneously bound to corresponding identifiers, the identifiers including target microbial group identifiers; The training of the first time-series prediction model includes: The first time series prediction model is trained by using multiple first abundance time series of any fermentation body and their respective bound identifiers as parallel inputs and the corresponding second abundance time series as training labels; wherein, multiple first abundance time series correspond one-to-one with multiple target microbial groups.

[0008] In some embodiments, the training of the first time-series prediction model further includes: At least one of the first abundance time series of the fermentation organisms is randomly masked to obtain at least one random sample; wherein, the random masking includes randomly processing the abundance of at least one fermentation time node as a blank label; The first time-series prediction model is trained based on the at least one random sample.

[0009] In some embodiments, after obtaining the second time-series prediction model, the method further includes: Based on the target abundance time series, the target abundance is determined; wherein, the target abundance is the abundance of the target microbial group in the target fermentation body at the target fermentation time node; Based on the target abundance time series, the abundance of the target microbial community in the target fermentation body at multiple fermentation time nodes before the target fermentation time node is determined to obtain a third abundance time series. The third abundance time series is used as the input to the second time series prediction model, and the target abundance is used as the training label to optimize and train the second time series prediction model.

[0010] In some embodiments, the first time-series prediction model and the second time-series prediction model include, in sequence, an instance normalization and block layer, a projection and position coding layer, a Transformer encoder, and a flattening and linear output layer.

[0011] Furthermore, a device for predicting the abundance trajectory of a microbial community is also provided, comprising: The acquisition module is used to acquire at least one target abundance time series corresponding to multiple fermentation bodies of the first production team; wherein, one target abundance time series corresponds to one target microbial group, and the target abundance time series contains the abundance data of the target microbial group sorted by fermentation time during the complete fermentation stage; The segmentation module is used to segment each of the target abundance time series to obtain a corresponding first abundance time series and a second abundance time series; the first abundance time series corresponds to the first fermentation stage, and the second abundance time series corresponds to the second fermentation stage after the first fermentation stage, and the first fermentation stage and the second fermentation stage constitute the complete fermentation stage; The training module is used to train the first time series prediction model with each of the first abundance time series as input and the corresponding second abundance time series as training labels to obtain the second time series prediction model; the second time series prediction model is used to predict the abundance time series of the target microbial group in the second fermentation stage based on the abundance time series of the target microbial group in the first fermentation stage.

[0012] In some embodiments, the acquisition module is specifically used for: Metagenomic sequencing was performed on multiple fermentation samples corresponding to multiple fermentation bodies of the first production team to obtain sequencing results; wherein, the multiple fermentation samples include fermentation samples collected in multiple rounds of stacking fermentation stage and fermentation stage in cellar during the complete fermentation stage. Based on the sequencing results, the abundance of the target microbial groups in each of the fermented mash samples was determined; The abundance of the same fermentation body and the same target microbial group is sorted according to the time of the multiple rounds of stacked fermentation and cellar fermentation to obtain at least one target abundance time series of the same fermentation body, and then at least one target abundance time series corresponding to multiple fermentation bodies.

[0013] In some embodiments, the plurality of fermentation cycles include sand introduction, sand making, a first fermentation cycle, a second fermentation cycle, a third fermentation cycle, a fourth fermentation cycle, and a fifth fermentation cycle. The first fermentation stage includes sand introduction, sand making, and a first fermentation cycle, and the second fermentation stage includes the second fermentation cycle, the third fermentation cycle, the fourth fermentation cycle, and the fifth fermentation cycle.

[0014] In some embodiments, when there are multiple target microbial groups, each target abundance time series is bound to a corresponding identifier, and the first abundance time series and the second abundance time series corresponding to each target abundance time series are simultaneously bound to corresponding identifiers, the identifiers including target microbial group identifiers; The training module is specifically used for: The first time series prediction model is trained by using multiple first abundance time series of any fermentation body and their respective bound identifiers as parallel inputs and the corresponding second abundance time series as training labels; wherein, multiple first abundance time series correspond one-to-one with multiple target microbial groups.

[0015] In some embodiments, the training module is further configured to: At least one of the first abundance time series of the fermentation organisms is randomly masked to obtain at least one random sample; wherein, the random masking includes randomly processing the abundance of at least one fermentation time node as a blank label; The first time-series prediction model is trained based on the at least one random sample.

[0016] In some embodiments, the training module is further configured to: Based on the target abundance time series, the target abundance is determined; wherein, the target abundance is the abundance of the target microbial group in the target fermentation body at the target fermentation time node; Based on the target abundance time series, the abundance of the target microbial community in the target fermentation body at multiple fermentation time nodes before the target fermentation time node is determined to obtain a third abundance time series. The third abundance time series is used as the input to the second time series prediction model, and the target abundance is used as the training label to optimize and train the second time series prediction model.

[0017] In some embodiments, the first time-series prediction model and the second time-series prediction model include, in sequence, an instance normalization and block layer, a projection and position coding layer, a Transformer encoder, and a flattening and linear output layer.

[0018] Furthermore, an electronic device is also provided, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the methods described above.

[0019] Furthermore, a computer-readable storage medium is also provided, the computer-readable storage medium storing a computer program, which, when executed by at least one processor, implements the method as described above.

[0020] In this embodiment, at least one target abundance time series corresponding to a plurality of fermentation bodies is obtained; each target abundance time series is divided to obtain a corresponding first abundance time series and a second abundance time series; wherein, the first abundance time series corresponds to the first fermentation stage, and the second abundance time series corresponds to the second fermentation stage after the first fermentation stage; using each first abundance time series as input and the corresponding second abundance time series as training labels, a first time series prediction model is trained, enabling the first time series prediction model to learn the abundance evolution law of the target microbial community during the brewing process. The second time series prediction model obtained by this training can accurately predict the abundance change trajectory of the target microbial community, thereby providing data support for timely adjustment of the fermentation process. Attached Figure Description

[0021] Figure 1 A flowchart illustrating the method for predicting the abundance trajectory of microbial communities provided in this application embodiment; Figure 2 This is a schematic diagram of the structure of the time series prediction model provided in the embodiments of this application; Figure 3-a One of the schematic diagrams provided for model evaluation in the embodiments of this application; Figure 3-b A second schematic diagram for model evaluation provided in an embodiment of this application; Figure 3-c The third schematic diagram provided for model evaluation in the embodiments of this application; Figure 4-a A schematic diagram of the predicted and actual change trajectories of Bacillus subtilis in a production team, provided for an embodiment of this application; Figure 4-b A schematic diagram of the predicted and actual change trajectories of Bacillus in another production team provided in this application embodiment; Figure 5 A schematic diagram of the structure of the microbial community abundance trajectory prediction device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0023] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.

[0024] This application provides a method, apparatus, device, and medium for predicting the abundance trajectory of microbial communities, in order to predict the temporal change trajectory of microbial communities.

[0025] The following is a detailed description of the method for predicting the abundance trajectory of microbial communities according to embodiments of this application.

[0026] See Figure 1 , Figure 1 This is a flowchart of a method for predicting the abundance trajectory of a microbial community provided in this application, such as... Figure 1 As shown, the method includes: Step 101: Obtain at least one target abundance time series corresponding to multiple fermentation bodies of the first production team.

[0027] Each fermentation body corresponds to an independent fermentation tracking object.

[0028] For example, in the fermentation of baijiu, the fermentation body is an independent material formed after the raw materials are mixed. By collecting samples of the mash from each round of the complete fermentation process of this independent material, and then by metagenomic sequencing and abundance ranking, at least one target abundance time series corresponding to the aforementioned fermentation body can be obtained.

[0029] Each fermentation body corresponds to at least one target abundance time series. A target abundance time series includes the abundance of a target microbial taxa sorted by fermentation time throughout the entire fermentation process. Therefore, the number of target abundance time series corresponding to each fermentation body is equal to the number of target microbial taxa. If only the abundance trajectory of a single target microbial taxa A needs to be predicted, then each fermentation body corresponds to one target abundance time series A for target microbial taxa A, which includes the abundance of target microbial taxa A sorted by fermentation time throughout the entire fermentation process. Similarly, if the abundance trajectories of both target microbial taxa A and target microbial taxa B need to be predicted simultaneously, then each fermentation body corresponds to two target abundance time series: target abundance time series A for target microbial taxa A and target abundance time series B for target microbial taxa B.

[0030] It is worth noting that a target microbial group in the embodiments of this application may correspond to a single key microbial species, or it may correspond to a class of functionally related or taxonomically similar microbial species.

[0031] The target abundance time series contains abundance data of the target microbial community sorted by fermentation time during the complete fermentation stage. Specifically, the target abundance time series includes fermentation time nodes, constructed with the chronological order of these fermentation time nodes as the time axis. For fermentation time nodes for which abundance data was acquired during data collection, the target abundance time series retains their actual abundance (which can be relative abundance). For fermentation time nodes for which no abundance data was acquired during data collection, a preset "blank marker" is used for replacement, without zero-value filling or interpolation. This avoids bias caused by interpolation and helps maintain the robustness of the time series prediction model in scenarios with irregular sampling and missing data.

[0032] It is worth mentioning that, in order to reduce the impact of individual differences or accidental factors on the results and improve the prediction accuracy of the second time series prediction model during the training and validation process of the first time series prediction model, training and validation operations can be carried out based on the microbial abundance data of multiple production teams. The core processes such as data collection and processing of the first production team are consistent, and will not be elaborated further to avoid duplication.

[0033] Step 102: Divide each target abundance time series separately to obtain the corresponding first abundance time series and second abundance time series.

[0034] The first abundance time series corresponds to the first fermentation stage, and the second abundance time series corresponds to the second fermentation stage after the first fermentation stage. The first fermentation stage and the second fermentation stage together constitute a complete fermentation stage.

[0035] The complete fermentation process includes: initial fermentation, sand making, first fermentation, second fermentation, third fermentation, fourth fermentation, and fifth fermentation.

[0036] In some embodiments, the first fermentation stage includes initial fermentation, fermentation formation, and a first fermentation cycle, while the corresponding second fermentation stage includes a second, third, fourth, and fifth fermentation cycle. This allows for the accurate prediction of the abundance trajectory of target microbial groups in the key aroma-producing stages (second to fifth fermentation cycles) by leveraging the succession characteristics of the microbial community already formed in the early to mid-stages (from initial fermentation to the first fermentation cycle).

[0037] Step 103: Using each first abundance time series as input and the corresponding second abundance time series as training labels, train the first time series prediction model to obtain the second time series prediction model.

[0038] The aforementioned second time-series prediction model is used to predict the abundance time series of the target microbial community in the second fermentation stage based on the abundance time series of the target microbial community in the first fermentation stage.

[0039] It is worth noting that the second time-series prediction model in this application embodiment can be used for abundance trajectory prediction of a single production shift and a single target microbial group. In this case, a corresponding identifier can be bound to the target abundance time series, or no corresponding identifier can be bound.

[0040] The second time-series prediction model in this embodiment can also be used for abundance trajectory prediction of multiple production teams and multiple target microbial groups. In this case, it is necessary to bind a corresponding identifier to the target abundance time series. Specifically, in the case of abundance prediction for multiple target microbial groups, one fermentation body corresponds to multiple target abundance time series, and the identifier to be bound to the target abundance time series includes the corresponding target microbial group identifier, which is used to distinguish the target microbial group to which the target abundance time series belongs; in the case of multiple production teams, it is necessary to obtain the target abundance time series corresponding to multiple fermentation bodies of multiple production teams, and the identifier to be bound to each target abundance time series also includes the corresponding production team identifier, which is used to determine the production team to which the target abundance time series belongs.

[0041] With the target abundance time series bound to a corresponding identifier, in step 102, the first abundance time series and the second abundance time series must be simultaneously bound to corresponding identifiers. Furthermore, in step 103, each first abundance time series and its bound identifier must be used as input so that the aforementioned first time series prediction model can distinguish the input sequences. Thus, after the second time series prediction model is trained and obtained, by inputting the production team identifier, the target microbial group identifier, and the abundance time series of the first fermentation stage, the abundance time series of the corresponding production team and the corresponding target microbial group in the second fermentation stage can be predicted, i.e., the abundance trajectory.

[0042] In this embodiment, each first abundance time series is used as input, and the corresponding second abundance time series is used as training labels to train the first time series prediction model, enabling it to learn the abundance evolution patterns of the target microbial community during the brewing process. The resulting second time series prediction model can accurately predict the abundance change trajectory of the target microbial community, thereby allowing for early prediction of the changing trends of the microbial community and its key species during the brewing process, providing data support for timely adjustments to the fermentation process. This not only helps improve the repeatability and quality stability of fermented products but also promotes the intelligent upgrading of traditional fermentation systems such as Maotai-flavor liquor.

[0043] In some embodiments, obtaining at least one target abundance time series corresponding to multiple fermentation bodies of the first production shift includes: Metagenomic sequencing was performed on multiple mash samples corresponding to multiple fermentation bodies in the first production team, and the sequencing results were obtained. Among them, multiple mash samples included mash samples collected from multiple rounds of stack fermentation during the complete fermentation stage and mash samples collected during the fermentation stage in the cellar.

[0044] Based on the sequencing results, the abundance of the target microbial groups in each fermentation mash sample was determined.

[0045] The abundance of the same fermentation body and the same target microbial group is sorted according to the time of multiple rounds of stack fermentation and cellar fermentation to obtain at least one target abundance time series for the same fermentation body, and then at least one target abundance time series for multiple fermentation bodies.

[0046] In this embodiment, multiple fermentation time points can be preset to guide the collection of mash samples. These multiple fermentation time points include specific time points within the stacking fermentation stage and the fermentation stage within the cellar, as described above. Data gaps may occur during actual collection; therefore, when sorting abundance data by fermentation time, blank markers need to be added at the fermentation time points where data is missing. The fermentation time points can be specific fermentation days, or they can be time information composed of "stage," "stack days," or "number of grains in the cellar."

[0047] In this embodiment, by acquiring mash samples collected during multiple rounds of stacked fermentation and fermentation in the cellar, abundance data for multiple rounds of stacked fermentation and fermentation in the cellar can be obtained, which is beneficial for fully capturing the succession dynamics of the target microbial community throughout the entire fermentation process.

[0048] To better understand the technical solutions of the embodiments of this application, the following is combined with... Figure 2 The structure of the time series prediction model (including the first time series prediction model and the second time series prediction model) is explained.

[0049] like Figure 2 As shown, the time series prediction model includes, in sequence, an instance normalization and block layer, a projection and position encoding layer, a Transformer encoder, and a flattening and linear output layer.

[0050] By setting up a time-series prediction module based on the Transformer architecture as described above, the advantages of multi-head self-attention mechanism and feedforward neural network can be effectively integrated. Even in the case of missing time points, it can still accurately predict the dynamic changes in microbial abundance. A dynamic simulation closed loop of "data acquisition - virtual modeling - real-time prediction" can be constructed in the fermentation system to realize digital twin.

[0051] The following provides a detailed explanation of each layer of the time series prediction model.

[0052] The instance normalization and block layer is used to first normalize the data, and then divide the input sequence (including the normalized first abundance time series) into continuous patches as tokens according to the length and stride.

[0053] The projection and location coding layer is used to inject temporal location coding to preserve information about irregular sampling intervals.

[0054] Transformer encoders are used to learn long-term temporal dependencies across patches using multi-head self-attention.

[0055] The flattening and linear output layer is used to convert the feature sequence output by the Transformer encoder into the predicted abundance time series corresponding to the second fermentation stage.

[0056] As an example, the specific parameters of the above time series prediction model can be: embedding dimension 64, attention head number 4, feedforward layer dimension 256, patch stride 1, and prediction window equal to the total time point minus the context length.

[0057] Furthermore, the time-series prediction model of this application embodiment can be applied online after offline training is completed. It continuously receives new data as a twin to update parameters or correct state, and combines the attention weights and the importance of Shapley Additive exPlanations (SHAP) in the Transformer encoder to identify key time windows and key groups for early warning.

[0058] The formula for calculating the self-attention function in the Transformer encoder is as follows: ; Where Q, K, and V represent the query matrix, key matrix, and value matrix, respectively. is the dimension of the key vector.

[0059] Furthermore, as an example, the training parameters of the time series prediction model are set as follows: the learning rate is... The batch size is 8, and the training epochs are 8000 (with sub-batches of 64). To prevent overfitting, an early stopping strategy is adopted during training (the training epoch at which the minimum loss value on the validation set is selected to terminate training early, while the best time series prediction model during the process is saved as the second time series prediction model), and the loss function is the mean squared error (MSE).

[0060] In some embodiments, when there are multiple target microbial groups, each target abundance time series is bound to a corresponding identifier, and the first abundance time series and the second abundance time series corresponding to each target abundance time series are simultaneously bound to corresponding identifiers, the identifiers including the target microbial group identifiers; Training the first time-series prediction model includes: using multiple first abundance time series of any fermentation body and their respective bound identifiers as parallel inputs, and using the corresponding second abundance time series as training labels to train the first time-series prediction model; wherein, multiple first abundance time series correspond one-to-one with multiple target microbial groups.

[0061] In this implementation, when multiple target microbial taxa are involved, the Transformer encoder can independently encode the first abundance time series of each target microbial taxa by inputting multiple first abundance time series of any fermenter and their respective bound identifiers in parallel. Furthermore, the Transformer encoder can also capture cross-species cooperative variations by sharing parameters.

[0062] Furthermore, the aforementioned identifier may also include a production shift identifier, so that the Transformer encoder can perform channel-independent encoding of the group information.

[0063] The above settings facilitate the subsequent training of the second time-series prediction model, enabling it to accurately predict the composition and abundance time-series changes of the fermentation microbial community.

[0064] In some embodiments, training the first time-series prediction model further includes: At least one abundance time series of at least one fermentation organism is randomly masked to obtain at least one random sample. The random masking includes randomly assigning the abundance of at least one fermentation time point to a blank label.

[0065] The first time-series prediction model is trained based on at least one random sample.

[0066] In this implementation, random samples are obtained by randomly masking the first abundance time series. This introduces a self-supervised training strategy of random time point masking, enabling the time series prediction model to learn the implicit patterns of missing observations. At the same time, by using position encoding to directly treat blank markers as missing data (instead of using zero-filling or interpolation), the bias caused by filling operations can be avoided, thereby improving the robustness of the model in irregular sampling and missing data scenarios.

[0067] In some embodiments, after obtaining the second time-series prediction model, the above method further includes: The target abundance is determined based on the target abundance time series. The target abundance is the abundance of the target microbial group in the target fermentation body at the target fermentation time point.

[0068] Based on the target abundance time series, the abundance of target microbial groups at multiple fermentation time points before the target fermentation time point of the target fermentation body is determined, and a third abundance time series is obtained.

[0069] Using the third abundance time series as input and the target abundance as training label, the second time series prediction model is optimized and trained.

[0070] In this embodiment, the aforementioned multiple fermentation time nodes can be selected as 30% of the fermentation time nodes before the target fermentation time node.

[0071] If the target abundance time series is bound to a corresponding identifier, it needs to be bound to the third abundance time series, and the third abundance time series and its bound identifier are used as inputs to the second time series prediction model.

[0072] In this implementation, the optimization training through the above steps helps to improve the prediction accuracy of abundance trajectories.

[0073] To better understand the technical solutions of the embodiments of this application, the following description is provided in conjunction with specific embodiments.

[0074] 1. Data Collection Collect fermented grains (FG) samples covering two production years during the brewing process of Moutai liquor for metagenomic sequencing, and obtain 657 metagenomic samples of fermented grains microorganisms. Divide them into a training group according to the year: 335 fermented grains samples (下沙: 34; 造沙: 52; 一轮次: 61; 二轮次: 50; 三轮次: 56; 四轮次: 52; 五轮次: 30); verification group: 322 fermented grains samples (下沙: 87; 造沙: 83; 一轮次: 76; 二轮次: 41; 三轮次: 14; 四轮次: 18; 五轮次: 3), which are used to independently verify the generalization performance of the microbial prediction model. Among them, each round mainly includes stacking fermentation and in-pit fermentation, and the sampling time points for in-pit fermentation are mainly at the time of pit entry, 7 days, 14 days, and 21 days in the pit. The sampling time points of fermented grains samples for each round are as follows: 7 fermentation time points for 下沙: 3 stacking (sampling every day during stacking for 2 - 4 days) and 4 in-pit (pit entry, 7 days, 14 days, 21 days in the pit) fermentation time points; 9 fermentation time points for 造沙: 4 stacking (stacking for 1 - 4 days) and 5 in-pit time points; the first round includes 13 fermentation time points: 8 stacking (stacking for 2 - 9 days) and 5 in-pit time points; the second round has 9 fermentation time points: 4 stacking (stacking for 2 / 4 / 8 / 10) and 5 in-pit fermentation time points; the third round: 5 stacking (stacking for 2 - 6 days) and 5 in-pit fermentation time points; the fourth round: 4 stacking (stacking for 2 - 5 days) and 5 in-pit fermentation time points; the fifth round: 3 stacking (stacking for 2 - 4 days) and 5 in-pit fermentation time points. To ensure the representativeness and repeatability of the experimental results, samples from 6 production teams are taken as biological replicates at each fermentation node of each round to reduce the influence of individual differences or accidental factors on the results. In addition, to establish the longitudinal change trajectory of the microbial community, all samples are recorded with detailed labels in chronological order, including production teams, rounds, sampling dates, and fermentation days, to ensure subsequent time series modeling and stage association can be achieved.

[0075] 2. Sample Processing Perform metagenomic sequencing on all samples using the Illumina NovaSeq 6000 platform. The original reads data is processed by Trimmomatic (v0.39) to remove adapter sequences and low-quality fragments. Use Bowtie2 (v2.5.2) to align the reads to the reference genomes of sorghum (GCF_000003195.3), rice (GCA_026167685.1), and wheat (GCF_018294505.1) to remove the influence of host sequences. Use Kraken2 (v2.1.3) to classify and annotate the cleaned reads. Use Bracken (v2.9) to estimate the species abundance and obtain the relative abundance table of microorganisms in the fermented grains. Finally, a total of 4.9 Tbp of high-quality data is obtained, covering hundreds of microbial taxonomic units.

[0076] 3. Construction and Training of Time Series Prediction Models The structure of the time series prediction model is as follows Figure 2 As shown.

[0077] Taking the microbial community information from the first sand production stage, sand making stage, and first fermentation cycle as an example (data such as microbial abundance, cycle, production team, sampling time, and fermentation time nodes), a time-series prediction model for the microbial community change trajectory during fermentation is constructed. The specific construction steps include: (1) Data normalization and time series model encoding: The model input is the first abundance time series of the early fermentation stage (Xia Sha, Zao Sha and each fermentation node of one round, in units of days). The abundance of microorganisms is normalized to the range of 0-1 through instance normalization and block layer, and patched according to patch length and stride to form continuous time slices as tokens. The first time node of fermentation (i.e., the microbial abundance information of Xia Sha accumulation for 1 day) is used as the starting point of the model. Learnable location information encoding is superimposed on the token dimension to retain the real sampling interval information and avoid the loss of time sequence caused by irregular sampling. The typical configuration is a stride of 1 and a patch length ranging from 2 to 4 and less than the context length.

[0078] (2) The patch sequences of each group are input into a Transformer encoder consisting of a multi-head self-attention network and a feedforward network. The encoder has 2 layers with an embedding dimension of 64, 4 attention heads, and a feedforward layer dimension of 256. The activation function is GELU, and layer normalization and residual connections are used in each layer. Self-attention learns long-range dependencies between time slices, channel-independent encoding preserves species-level individual dynamics, and shared parameters enable the model to capture cross-group co-variate changes. The encoded results are flattened and then fed into a linear prediction head, which outputs the abundance vector of the prediction interval.

[0079] (3) Model Training: Using the microbial community data of fermented mash samples from the 2022 production year as the training set, the model was trained using leave-one-workshop-out cross-validation based on the microbial abundance data of 6 independent production teams at the workshop level to avoid data leakage. During training, the first 30% of observation points were used as context to predict the trajectory of subsequent fermentation nodes of microorganisms. The parameters were continuously optimized by calculating the loss function until the loss function was minimized and the result was closest to the true value, at which point the abundance of microorganisms was output. Here, the loss function was MSE, the optimizer was AdamW, the batch size was 8, the maximum training epochs were 8000, and an early stopping strategy and gradient clipping were used to suppress overfitting and gradient explosion. To enhance the robustness to missing observations, a self-supervised task of random time point occlusion was introduced. Without interpolation, the model learned to recover the occluded time slices based on the context. The position encoding treated the missing as "blank" rather than zero-value filling.

[0080] (4) External validation of the model: Using the time series data of microbial community of mash in the 2023 production year (from the first five rounds of fermentation) as an independent external validation set, the same preprocessing, patch segmentation and inference process were maintained to evaluate the generalization ability across years and workshops. The inference stage adopts a rolling prediction and feedback update mechanism: after obtaining a new time point, it is incorporated into the context and the next prediction is executed, while a lightweight fine-tuning interface is retained to perform state calibration as needed.

[0081] (5) Model evaluation: Pearson correlation coefficient and cosine similarity are used as the main consistency measures; RMSE (Root MSE) is reported as a supplementary indicator for time series fitting and shape preservation; attention weight and SHAP value are used to perform interpretability analysis on key groups and key time windows to identify fermentation nodes and warning signals that have an important impact on the brewing process.

[0082] 4. Predicting the composition and temporal trajectory of fermentation microbial communities. Based on the aforementioned time-series prediction model, the composition and abundance of microbial communities in samples from different workshops within the training group are predicted, such as... Figures 3-a to 3-c As shown, the time series prediction model exhibits stable prediction performance across different batches.

[0083] See Figure 3-a In the five production teams (corresponding to) Figure 3-a (Workshop 1 to Workshop 5) and an external verification queue (corresponding to) Figure 3-aThe predicted microbial community composition and abundance were compared with the actual microbial community in the validation cohort. The model was evaluated using Pearson correlation coefficient and cosine similarity indices. The bar chart represents the Pearson correlation (yellow) and cosine similarity (green) between the predicted microbial community results and abundance and the actual microbial community. As shown in Figure 3, the predicted microbial community of the above time-series prediction model has a Pearson correlation coefficient and cosine similarity of approximately 0.90 with the actual microbial community; furthermore, the model also demonstrates high accuracy on the 2023 production year microbial dataset (external validation cohort validation).

[0084] Regarding the prediction of microbial community structure, this application uses a time-series prediction model to predict the composition of the microbial community in Workshop3, taking one production year (2023) as an example (see [link to relevant documentation]). Figure 3-b The results showed that Workshop 3 accurately predicted the structure and abundance of the microbial community in five rounds of production in Xiasha over a production year, and compared the actual structure and abundance of the microbial community (see...). Figure 3-c The high similarity between the two models indicates that the above time-series prediction model has extremely high robustness in predicting the trajectory of microbial community changes and community structure composition during the brewing process of Baijiu.

[0085] 5. Application in tracking the temporal changes of specific microbial groups Bacillus plays multiple crucial roles in the fermentation process, synthesizing various flavor compounds (such as pyrazines and esters) and antimicrobial peptides (such as lichenin), imparting the characteristic aroma to baijiu and maintaining the stability of the brewing microbial community. Furthermore, Bacillus not only serves as a precise fermentation agent to enhance the quality of baijiu during brewing, but also possesses significant ecological value in environmental protection. For example, lichenin produced by Bacillus licheniformis can be developed into a biosurfactant for use in environmental remediation and other fields.

[0086] Based on the significant value of Bacilli, this invention uses the abundance of Bacilli in sand making and one round of fermentation in production workshop 1 and production workshop 2 during a production year, along with the production workshop identifier, as inputs. It then uses a microbial community change trajectory prediction model during fermentation to predict the abundance changes of Bacilli in the second to fifth rounds of Baijiu brewing.

[0087] See prediction results Figures 4-a to 4-b The results showed that the predicted abundance trajectory of the Bacilli taxa was in high agreement with the measured values. Figure 4-a As shown, the accuracy of Workshop 1 is 98%; Figure 4-b As shown, the accuracy of Workshop 2 is 97%, indicating that the time-series prediction model has high sensitivity and is suitable for monitoring the dynamic changes of microorganisms in the fermentation process.

[0088] This application innovatively proposes a method for predicting the abundance trajectory of microbial communities in fermentation systems. This method, without relying on supplementary data, can accurately predict the temporal change trajectory of microbial communities in the early stages of fermentation based on incomplete longitudinal data, demonstrating strong robustness and generalization ability. By integrating the Transformer framework with the model's rolling prediction and feedback update mechanism, it can deeply fuse temporal data of the mash metagenomics during the Baijiu brewing process, achieving full-process digital simulation from data acquisition and stability assessment to dynamic prediction and regulation.

[0089] This application deeply applies dynamic simulation technology to the modeling of traditional fermentation systems, accurately simulating the nonlinear dynamic changes of microbial communities with a prediction accuracy exceeding 90%. It effectively tracks and predicts the changing trends of microbial communities (especially core microorganisms) during fermentation, providing a basis for real-time control. Secondly, this application constructs a closed-loop technology system of "data-driven - virtual simulation - real-time control," achieving a 97% similarity between the predicted and actual microbial communities in the new production year verification. Furthermore, through the virtual-real interaction of dynamic simulation, this application can continuously optimize fermentation conditions and processes, providing a scalable intelligent monitoring solution for fermentation systems and powerfully promoting the high-quality development of the fermentation industry. Simultaneously, this application can be quickly adapted to traditional fermentation systems such as soy sauce and vinegar, providing standardized technical support for the digital upgrade of the fermentation industry.

[0090] It should be understood that although the steps in the flowchart above are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart above may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0091] Based on the same inventive concept, please refer to Figure 5As shown, this embodiment provides a device for predicting the abundance trajectory of a microbial community, including: an acquisition module 501, used to acquire at least one target abundance time series corresponding to multiple fermentation bodies of a first production team; wherein, one target abundance time series corresponds to one target microbial group, and the target abundance time series includes the abundance data of the target microbial group sorted by fermentation time during the complete fermentation stage; a partitioning module 502, used to partition each target abundance time series to obtain a corresponding first abundance time series and a second abundance time series; the first abundance time series corresponds to a first fermentation stage, and the second abundance time series corresponds to a second fermentation stage after the first fermentation stage, the first fermentation stage and the second fermentation stage constitute the complete fermentation stage; a training module 503, used to train a first time series prediction model with each of the first abundance time series as input and the corresponding second abundance time series as training labels to obtain a second time series prediction model; the second time series prediction model is used to predict the abundance time series of the target microbial group in the second fermentation stage based on the abundance time series of the target microbial group in the first fermentation stage.

[0092] In some embodiments, the acquisition module 501 is specifically used for: performing metagenomic sequencing on multiple mash samples corresponding to multiple fermentation bodies of the first production team to obtain sequencing results; wherein, the multiple mash samples include mash samples collected during multiple rounds of stacked fermentation and fermentation in the cellar during the complete fermentation stage; based on the sequencing results, determining the abundance of the target microbial group in each mash sample; sorting the abundance of the same fermentation body and the same target microbial group according to the time of the multiple rounds of stacked fermentation and fermentation in the cellar to obtain at least one target abundance time series for the same fermentation body, thereby obtaining at least one target abundance time series corresponding to multiple fermentation bodies.

[0093] In some embodiments, the plurality of fermentation cycles include sand introduction, sand making, a first fermentation cycle, a second fermentation cycle, a third fermentation cycle, a fourth fermentation cycle, and a fifth fermentation cycle. The first fermentation stage includes sand introduction, sand making, and a first fermentation cycle, and the second fermentation stage includes the second fermentation cycle, the third fermentation cycle, the fourth fermentation cycle, and the fifth fermentation cycle.

[0094] In some embodiments, when there are multiple target microbial groups, each target abundance time series is bound to a corresponding identifier, and the first abundance time series and the second abundance time series corresponding to each target abundance time series are simultaneously bound to corresponding identifiers, the identifiers including target microbial group identifiers; the training module 503 is specifically used to: train the first time series prediction model by using multiple first abundance time series of any fermentation body and their respective bound identifiers as parallel inputs, and using the corresponding second abundance time series as training labels; wherein, the multiple first abundance time series correspond one-to-one with the multiple target microbial groups.

[0095] In some embodiments, the training module 503 is further configured to: randomly mask the first abundance time series of at least one of the fermentation organisms to obtain at least one random sample; wherein, the random masking includes randomly processing the abundance of at least one fermentation time node as a blank label; and train the first time series prediction model based on the at least one random sample.

[0096] In some embodiments, the training module 503 is further configured to: determine a target abundance based on the target abundance time series; wherein the target abundance is the abundance of the target microbial community of the target fermenter at the target fermentation time node; determine the abundance of the target microbial community of the target fermenter at multiple fermentation time nodes prior to the target fermentation time node based on the target abundance time series, thereby obtaining a third abundance time series; use the third abundance time series as input to the second time series prediction model, and use the target abundance as training label to optimize and train the second time series prediction model.

[0097] In some embodiments, the first time-series prediction model and the second time-series prediction model include, in sequence, an instance normalization and block layer, a projection and position coding layer, a Transformer encoder, and a flattening and linear output layer.

[0098] It should be understood that, for the sake of brevity, some of the content described in the previous embodiments will not be repeated in this embodiment.

[0099] Based on the same inventive concept, embodiments of this application provide a computer device, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a text classification method.

[0100] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0101] Based on the same inventive concept, this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: Obtain at least one target abundance time series corresponding to multiple fermentation bodies of the first production team; wherein, one target abundance time series corresponds to one target microbial group, and the target abundance time series contains the abundance data of the target microbial group sorted by fermentation time during the complete fermentation stage; Each target abundance time series is divided to obtain a corresponding first abundance time series and a second abundance time series; the first abundance time series corresponds to the first fermentation stage, and the second abundance time series corresponds to the second fermentation stage after the first fermentation stage. The first fermentation stage and the second fermentation stage together constitute the complete fermentation stage. Using each of the first abundance time series as input and the corresponding second abundance time series as training labels, the first time series prediction model is trained to obtain the second time series prediction model; the second time series prediction model is used to predict the abundance time series of the target microbial group in the second fermentation stage based on the abundance time series of the target microbial group in the first fermentation stage.

[0102] In some embodiments, when the processor executes the computer program, it performs the following steps: metagenomic sequencing on multiple mash samples corresponding to multiple fermentation bodies of the first production team to obtain sequencing results; wherein, the multiple mash samples include mash samples collected during multiple rounds of stacked fermentation and fermentation in the cellar during the complete fermentation stage; based on the sequencing results, the abundance of the target microbial group in each mash sample is determined; the abundance of the same fermentation body and the same target microbial group is sorted according to the time of the multiple rounds of stacked fermentation and fermentation in the cellar to obtain at least one target abundance time series for the same fermentation body, thereby obtaining at least one target abundance time series corresponding to multiple fermentation bodies.

[0103] In some embodiments, the plurality of fermentation cycles include sand introduction, sand making, a first fermentation cycle, a second fermentation cycle, a third fermentation cycle, a fourth fermentation cycle, and a fifth fermentation cycle. The first fermentation stage includes sand introduction, sand making, and a first fermentation cycle, and the second fermentation stage includes the second fermentation cycle, the third fermentation cycle, the fourth fermentation cycle, and the fifth fermentation cycle.

[0104] In some embodiments, when there are multiple target microbial groups, each target abundance time series is bound to a corresponding identifier, and the first abundance time series and the second abundance time series corresponding to each target abundance time series are simultaneously bound to corresponding identifiers, the identifiers including target microbial group identifiers; in some embodiments, when the processor executes the computer program, it implements the following steps: using multiple first abundance time series of any fermentation body and their respective bound identifiers as parallel inputs, and using the corresponding second abundance time series as training labels, to train the first time series prediction model; wherein, the multiple first abundance time series correspond one-to-one with the multiple target microbial groups.

[0105] In some embodiments, when the processor executes a computer program, it performs the following steps: randomly masking the first abundance time series of at least one of the fermentation organisms to obtain at least one random sample; wherein, the random masking includes randomly processing the abundance of at least one fermentation time node as a blank label; and training the first time series prediction model based on the at least one random sample.

[0106] In some embodiments, when a processor executes a computer program, it performs the following steps: determining a target abundance based on the target abundance time series; wherein the target abundance is the abundance of the target microbial community of the target fermenter at a target fermentation time node; determining the abundance of the target microbial community of the target fermenter at multiple fermentation time nodes prior to the target fermentation time node based on the target abundance time series, thereby obtaining a third abundance time series; using the third abundance time series as input to the second time series prediction model, and using the target abundance as a training label to optimize and train the second time series prediction model.

[0107] In some embodiments, the first time-series prediction model and the second time-series prediction model include, in sequence, an instance normalization and block layer, a projection and position coding layer, a Transformer encoder, and a flattening and linear output layer.

[0108] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0109] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0110] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for predicting the abundance trajectory of a microbial community, characterized in that, The method includes: Obtain at least one target abundance time series corresponding to multiple fermentation bodies of the first production team; wherein, one target abundance time series corresponds to one target microbial group, and the target abundance time series contains the abundance data of the target microbial group sorted by fermentation time during the complete fermentation stage; Each target abundance time series is divided to obtain a corresponding first abundance time series and a second abundance time series; the first abundance time series corresponds to the first fermentation stage, and the second abundance time series corresponds to the second fermentation stage after the first fermentation stage. The first fermentation stage and the second fermentation stage together constitute the complete fermentation stage. Using each of the first abundance time series as input and the corresponding second abundance time series as training labels, the first time series prediction model is trained to obtain the second time series prediction model; the second time series prediction model is used to predict the abundance time series of the target microbial group in the second fermentation stage based on the abundance time series of the target microbial group in the first fermentation stage.

2. The method for predicting the abundance trajectory of microbial communities according to claim 1, characterized in that, The step of obtaining at least one target abundance time series corresponding to multiple fermentation bodies of the first production team includes: Metagenomic sequencing was performed on multiple fermentation samples corresponding to multiple fermentation bodies of the first production team to obtain sequencing results; wherein, the multiple fermentation samples include fermentation samples collected in multiple rounds of stacking fermentation stage and fermentation stage in cellar during the complete fermentation stage. Based on the sequencing results, the abundance of the target microbial groups in each of the fermented mash samples was determined; The abundance of the same fermentation body and the same target microbial group is sorted according to the time of the multiple rounds of stacked fermentation and cellar fermentation to obtain at least one target abundance time series of the same fermentation body, and then at least one target abundance time series corresponding to multiple fermentation bodies.

3. The method for predicting the abundance trajectory of microbial communities according to claim 2, characterized in that, The multiple fermentation stages include sand introduction, sand making, first fermentation, second fermentation, third fermentation, fourth fermentation, and fifth fermentation. The first fermentation stage includes sand introduction, sand making, and first fermentation. The second fermentation stage includes second fermentation, third fermentation, fourth fermentation, and fifth fermentation.

4. The method for predicting the abundance trajectory of microbial communities according to claim 1, characterized in that, When there are multiple target microbial groups, each target abundance time series is bound to a corresponding identifier, and the first abundance time series and the second abundance time series corresponding to each target abundance time series are simultaneously bound to corresponding identifiers, the identifiers including the target microbial group identifiers; The training of the first time-series prediction model includes: The first time series prediction model is trained by using multiple first abundance time series of any fermentation body and their respective bound identifiers as parallel inputs and the corresponding second abundance time series as training labels; wherein, multiple first abundance time series correspond one-to-one with multiple target microbial groups.

5. The method for predicting the abundance trajectory of microbial communities according to claim 4, characterized in that, The training of the first time-series prediction model also includes: At least one of the first abundance time series of the fermentation organisms is randomly masked to obtain at least one random sample; wherein, the random masking includes randomly processing the abundance of at least one fermentation time node as a blank label; The first time-series prediction model is trained based on the at least one random sample.

6. The method for predicting the abundance trajectory of microbial communities according to claim 1, characterized in that, After obtaining the second time-series prediction model, the method further includes: Based on the target abundance time series, the target abundance is determined; wherein, the target abundance is the abundance of the target microbial group in the target fermentation body at the target fermentation time node; Based on the target abundance time series, the abundance of the target microbial community in the target fermentation body at multiple fermentation time nodes before the target fermentation time node is determined to obtain a third abundance time series. The third abundance time series is used as the input to the second time series prediction model, and the target abundance is used as the training label to optimize and train the second time series prediction model.

7. The method for predicting the abundance trajectory of microbial communities according to claim 1, characterized in that, The first and second time-series prediction models include, in sequence, an instance normalization and block layer, a projection and position coding layer, a Transformer encoder, and a flattening and linear output layer.

8. A device for predicting the abundance trajectory of a microbial community, characterized in that, The device includes: The acquisition module is used to acquire at least one target abundance time series corresponding to multiple fermentation bodies of the first production team; wherein, one target abundance time series corresponds to one target microbial group, and the target abundance time series contains the abundance data of the target microbial group sorted by fermentation time during the complete fermentation stage; The segmentation module is used to segment each of the target abundance time series to obtain a corresponding first abundance time series and a second abundance time series; the first abundance time series corresponds to the first fermentation stage, and the second abundance time series corresponds to the second fermentation stage after the first fermentation stage, and the first fermentation stage and the second fermentation stage constitute the complete fermentation stage; The training module is used to train the first time series prediction model with each of the first abundance time series as input and the corresponding second abundance time series as training labels to obtain the second time series prediction model; the second time series prediction model is used to predict the abundance time series of the target microbial group in the second fermentation stage based on the abundance time series of the target microbial group in the first fermentation stage.

9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by at least one processor, implements the method as described in any one of claims 1-7.