Machine learning-based traditional Chinese medicine decoction piece resource dynamic adjustment method, medium and equipment
By using machine learning and multi-objective optimization algorithms, real-time collection and analysis of multi-source data on Chinese herbal medicine pieces has solved the problems of inaccurate inventory and unreasonable resource allocation in the supply chain management of Chinese herbal medicine pieces, achieving accurate demand forecasting and resource optimization, and improving the flexibility and efficiency of the supply chain.
Patent Information
- Application Number
- CN202511684224.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-10
AI Technical Summary
The existing supply chain management of Chinese herbal medicine pieces relies on static data analysis, manual decision-making, and decentralized data management, resulting in inaccurate inventory management, unreasonable resource allocation, and difficulty in responding to market fluctuations and changes in demand.
By employing machine learning-based methods, multi-source data is collected in real time through the Internet of Things, and the data is cleaned, standardized, and synchronized. Combined with multi-dimensional data interaction models and dynamic feature selection, a demand forecasting model is established, and multi-objective optimization algorithms are used for resource allocation and inventory adjustment to achieve self-learning and adaptive management.
It has improved the accuracy of demand forecasting for traditional Chinese medicine decoction pieces and the efficiency of the supply chain, reduced inventory costs, reduced the risks of surplus and shortage, and achieved flexibility and sustainability in resource allocation.
Smart Images

Figure CN121504049A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traditional Chinese medicine supply chain management technology, and more specifically to a method, medium, and equipment for dynamic adjustment of traditional Chinese medicine decoction piece resources based on machine learning. Background Technology
[0002] Currently, the supply chain management of traditional Chinese medicine decoction pieces generally adopts traditional inventory management methods. These methods typically rely on historical data and human experience for decision-making, and inventory management systems mostly determine procurement and production plans through simple inventory records and sales forecasts. Existing technologies mainly rely on the following methods: Static historical data analysis: Traditional demand forecasting is usually based on historical sales data, using methods such as time series analysis and linear regression to predict future demand. These methods typically do not consider real-time market changes and environmental factors, but only rely on past data for trend prediction.
[0003] Human decision-making and experience-based management: Enterprises typically rely on human decision-making in areas such as inventory management, procurement, and production. Managers adjust inventory and resource allocation based on market conditions, seasonal changes, and other factors. This approach is often subject to significant human interference and struggles to handle complex, multi-factor changes.
[0004] Rule-based supply chain management: In traditional supply chain management, inventory management and supply chain optimization are usually based on fixed rules and standards, such as setting upper and lower limits for inventory and specifying replenishment cycles. These rules are usually static and difficult to adjust flexibly in actual operations according to demand fluctuations, market changes, or the external environment.
[0005] Distributed data management: Traditional inventory management systems often suffer from information silos, where data from different stages is not shared and processed collaboratively in real time, leading to data lag or inconsistency and affecting the accuracy and timeliness of decision-making.
[0006] Therefore, existing technologies have many shortcomings in responding to market fluctuations, changes in demand, emergencies, and optimizing resource allocation. There is an urgent need to introduce more advanced technologies to optimize inventory management and supply chain processes, improve response speed and decision-making accuracy, thereby reducing inventory costs and mitigating the risks of shortages and surpluses. Summary of the Invention
[0007] The present invention provides a method, medium, and equipment for dynamic adjustment of Chinese herbal medicine resources based on machine learning, which can accurately predict the short-term and long-term demand trends of Chinese herbal medicine pieces, optimize inventory and resource allocation, and significantly improve supply chain efficiency, and can solve at least one of the above-mentioned technical problems.
[0008] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A machine learning-based method for dynamically adjusting traditional Chinese medicine decoction piece resources includes the following steps: S1. Utilize IoT devices to collect multi-source data related to Chinese herbal medicine slices in real time, and perform real-time synchronization and adaptive processing on the collected data. S2. Jointly analyze the collected historical data and real-time data streams, identify potential influencing factors and correlations based on a multi-dimensional data interaction model, and use a dynamic feature selection method to determine the key variables affecting demand fluctuations. S3. Based on the data after joint analysis, construct a demand forecasting model and use a machine learning model to forecast demand. Combine historical data and real-time data streams, adjust the parameters of the machine learning model in real time to achieve self-learning and adaptive demand forecasting, predict short-term and long-term demand trends, and identify potential demand change patterns. S4. Based on the demand forecast results, resource allocation and inventory adjustment are carried out using a multi-objective optimization algorithm to generate inventory and supply chain resource allocation plans and perform dynamic optimization. S5. The optimized inventory and supply chain resource allocation plan will be automatically executed through smart contracts to achieve resource allocation and supply chain management operations without human intervention. S6. Monitor the inventory status of Chinese herbal medicine pieces in real time, and dynamically adjust the demand forecasting model and inventory and supply chain resource allocation plan based on real-time data to ensure the adaptability and flexibility of the system.
[0009] Furthermore, in S1, the multi-source data includes at least sales data. Inventory data Climate change data Disease epidemic trend data Holiday data and additional related influencing factors data .
[0010] Furthermore, S1 further includes: S1.1, For the collected data of various types Data cleaning includes at least removing duplicate data, imputing missing values, and removing outliers. Missing values are imputed using the mean imputation method, and outliers are removed by setting a threshold. Determine that the threshold Dynamically adjusted based on changes in the real-time data stream; S1.2. Standardize the cleaned data. Standardization should include at least data normalization to normalize various data types. Converted to dimensionless standard form, the expression is:
[0011] in, This represents the standardized data. For data The mean, For data Standard deviation; S1.3. Real-time synchronization of standardized data ensures consistency across different sources. This real-time synchronization is achieved through a distributed data processing framework that merges and synchronizes data from different sources, aligning and integrating the data within a unified time window. The expression is as follows:
[0012] in, This represents the synchronized data vector for the k-th time window. This represents the original data of the i-th data source within window k. Agg(·) represents the aggregation operation, and Concat(·) represents concatenating the features of each source. S1.4 Based on the real-time synchronized data, an adaptive feedback mechanism is used to monitor data changes in real time. When significant changes occur in the data stream, the data acquisition strategy and data cleaning rules are automatically adjusted, utilizing dynamic thresholds. Anomalies are detected and adjustments are made based on the data acquisition strategy. The expression is:
[0013] in, and Let X represent the mean and standard deviation of the data at time t, respectively. Both are updated in real time with the data stream. t λ represents the real-time observation value or data sample collected at time point t, and λ represents the sensitivity coefficient or threshold multiple of anomaly detection, which is used to control the strictness of anomaly judgment.
[0014] Furthermore, S2 further includes: S2.1. Conduct joint analysis on the collected data and identify potential correlations between various data sources through a multi-dimensional data interaction model. These correlations include temporal correlations, spatial correlations, and causal relationships. S2.2, Based on historical data With real-time data stream The system employs a dynamic feature selection method to automatically identify key variables affecting the fluctuations in demand for traditional Chinese medicine decoction pieces. This feature selection method includes correlation analysis, information gain, and mutual information measurement, and dynamically adjusts the feature selection process based on changes in real-time data streams. S2.3. Weight the data after joint analysis, and assign weighting coefficients. The adjustment is made dynamically based on the influence of each data source, as shown in the expression:
[0015] in, For the weighted data, The original data, For data The weighting coefficients, and the weighting coefficients Automatically adjusted based on the real-time impact of the data source.
[0016] Furthermore, S3 further includes: S3.1, Based on weighted data Establish a demand forecasting model, wherein the function of the demand forecasting model is: Machine learning algorithms are used to predict future demand trends, and the confidence level of the prediction results is calculated. The expression is:
[0017] in, The confidence level of the prediction results is used to assess the reliability of the prediction results and to manage risks. This is a demand forecasting model function based on weighted data; S3.2 Predicting the demand for traditional Chinese medicine decoction pieces using machine learning models based on historical data. and real-time data stream Real-time data streams are collected and synchronized in real time via IoT devices; S3.3. In the demand forecasting process, historical data should be incorporated. and real-time data stream The parameters of the machine learning model are dynamically adjusted, enabling the model to learn and adapt to changing market demands and environmental factors in real time. The adjustment process uses gradient descent to update the parameters, as expressed in the following expression:
[0018] in, Let be the model parameters at time t. For learning rate, The gradient of the loss function. This is the loss function for the model; S3.4, Based on historical data and real-time data stream The adaptive forecasting results predict future short-term and long-term demand trends and identify potential demand change patterns. The expression is:
[0019] in, This represents the demand forecast result, where f(·) is based on historical data. and real-time data stream The prediction function is used to assess the strength of future demand trends and adjust the prediction results in conjunction with model parameters; S3.5 The demand forecasting model accurately predicts short-term demand by updating learning data in real time, and responds to market fluctuations in advance by identifying potential demand change patterns, thereby optimizing the risks of excess inventory and shortages.
[0020] Furthermore, S4 further includes: S4.1 Based on demand forecast results A multi-objective optimization algorithm is employed to optimize resource allocation and inventory adjustment. This algorithm considers multiple objective functions, including inventory cost. Supply chain efficiency Inventory cycle and the risk of product expiration The expression for the multi-objective function M is obtained as follows:
[0021] Wherein, λ1, λ2 and λ3 are the weight coefficients of each objective function, which are used to dynamically adjust and balance different objectives; S4.2 Dynamically adjust the inventory and supply chain resource allocation scheme (RAP) based on a multi-objective optimization algorithm, wherein the RAP meets the demand forecast results. At the same time, it achieves optimal allocation of inventory and supply chain resources. This resource allocation scheme includes inventory levels. Procurement Plan and distribution strategies The expression is: RAP = (S inventory,t P order,t D distribution,t ) Among them, S inventory,t P represents the inventory level at the end of time period t. order,t D represents the quantity of purchase orders placed in time period t. distribution,t This represents the amount of goods distributed downstream during time period t. S4.3 When allocating inventory and supply chain resources, combine real-time data streams. and historical data The parameters and constraints in the optimization process are dynamically adjusted to adapt to changes in market demand and supply capacity over different time periods. These constraints include inventory limits. Minimum inventory and supply cycle The expressions are as follows: S min (t)=f min (H t ,R t ) S max (t)=f max (H t ,R t ) T supply (t)=f lead (H t ,R t ) Among them, S min (t) represents the dynamic minimum inventory level in time period t, S max (t) represents the dynamic maximum inventory limit for time period t, where T supply (t) represents the dynamic supply cycle in time period t, H t R represents historical data at time t. t f represents the real-time data stream at time t. min f max and f lead All are dynamic mapping functions; S4.4 The inventory and supply chain resource allocation scheme obtained based on the multi-objective optimization algorithm is fed back to the supply chain management system in real time to realize the automatic adjustment of inventory, production and distribution plans, maximize supply chain efficiency, optimize inventory costs and expiration risks, and maintain product supply continuity.
[0022] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the above-described method for dynamically adjusting traditional Chinese medicine decoction piece resources based on machine learning.
[0023] A computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the above-described machine learning-based method for dynamically adjusting traditional Chinese medicine decoction piece resources.
[0024] The beneficial effects of this invention are reflected in: 1. This invention, by combining machine learning, big data analysis, IoT technology, and multi-objective optimization algorithms, achieves dynamic adjustment of Chinese herbal medicine (TCM) decoction piece resources. It overcomes common problems in traditional TCM decoction piece supply chain management, such as excess inventory, shortages, and unreasonable resource allocation. By collecting, cleaning, standardizing, and synchronizing multi-source data in real time, it ensures data integrity and consistency, providing a reliable foundation for subsequent demand forecasting and resource optimization. The dynamic demand forecasting model based on historical and real-time data streams can not only accurately predict TCM decoction piece demand trends but also adaptively adjust according to market changes and environmental factors, thereby improving the accuracy and reliability of forecasts. Through joint analysis of various data, the model can identify potential demand change patterns and conduct intelligent inventory management, reducing the risk of inventory backlog and shortages.
[0025] 2. This invention employs a multi-objective optimization algorithm to dynamically allocate inventory and supply chain resources, making resource allocation more rational and flexible. It can take into account multiple factors such as inventory costs, supply chain efficiency, inventory cycle, and product expiration risk, thereby maximizing the overall efficiency of the supply chain. This method not only improves the supply chain efficiency of Chinese herbal medicine pieces, but also reduces resource waste through precise inventory control, and reduces economic losses caused by excess and shortage of inventory. As the model's self-learning and adaptive capabilities continue to improve, this invention can continuously optimize and adjust in a constantly changing market environment, ensuring the flexibility and sustainable development of the Chinese herbal medicine piece supply chain. Attached Figure Description
[0026] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.
[0027] Figure 1 This is a flowchart of the method for dynamically adjusting traditional Chinese medicine decoction piece resources based on machine learning, according to an embodiment of the present invention.
[0028] Figure 2 This is a flowchart illustrating inventory resource allocation based on a multi-objective optimization algorithm, according to an embodiment of the present invention.
[0029] Figure 3 This is a simulation diagram of the daily demand prediction effect of traditional Chinese medicine decoction pieces in an embodiment of the present invention.
[0030] Figure 4 This is a schematic diagram comparing the strategies of dynamic inventory and static inventory in an embodiment of the present invention.
[0031] Figure 5 This is a radar chart showing the multi-target optimization effect of an embodiment of the present invention.
[0032] Figure 6This is a simulation diagram illustrating the change of key feature weights over time in an embodiment of the present invention.
[0033] Figure 7 This is a structural block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0034] The technical solutions of the embodiments of the present invention 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 the present invention, and not all of them. Unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] It should be noted that the meaning of "and / or" throughout the text includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or a solution that simultaneously satisfies A and B. Furthermore, "multiple" refers to two or more. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0036] See Figures 1-2 This invention provides a method for dynamically adjusting traditional Chinese medicine decoction piece resources based on machine learning, comprising the following steps: S1. Utilize IoT devices to collect multi-source data related to Chinese herbal medicine slices in real time, and perform real-time synchronization and adaptive processing on the collected data. S2. Jointly analyze the collected historical data and real-time data streams, identify potential influencing factors and correlations based on a multi-dimensional data interaction model, and use a dynamic feature selection method to determine the key variables affecting demand fluctuations. S3. Based on the data after joint analysis, construct a demand forecasting model and use a machine learning model to forecast demand. Combine historical data and real-time data streams, adjust the parameters of the machine learning model in real time to achieve self-learning and adaptive demand forecasting, predict short-term and long-term demand trends, and identify potential demand change patterns. S4. Based on the demand forecast results, resource allocation and inventory adjustment are carried out using a multi-objective optimization algorithm to generate inventory and supply chain resource allocation plans and perform dynamic optimization. S5. The optimized inventory and supply chain resource allocation plan will be automatically executed through smart contracts to achieve resource allocation and supply chain management operations without human intervention. S6. Monitor the inventory status of Chinese herbal medicine pieces in real time, and dynamically adjust the demand forecasting model and inventory and supply chain resource allocation plan based on real-time data to ensure the adaptability and flexibility of the system.
[0037] In this embodiment, in step S1, the multi-source data includes at least sales data. Inventory data Climate change data Disease epidemic trend data Holiday data and additional related influencing factors data .
[0038] The aforementioned data is acquired from various data sources via sensors, smart devices, or external interfaces, with a collection cycle of once per hour, and is updated synchronously in real time via a high-speed network. This step achieves high-frequency, automated sensing of influencing factors across the entire value chain of traditional Chinese medicine decoction pieces, solving the problems of data lag and incomplete coverage caused by traditional manual data entry.
[0039] In this embodiment, S1 further includes: S1.1, For the collected data of various types Data cleaning includes at least removing duplicate data, imputing missing values, and removing outliers. Missing values are imputed using the mean imputation method, and outliers are removed by setting a threshold. Determine if the data Meet the conditions and If the threshold value is not met, it is considered an outlier and will be processed accordingly. Dynamically adjusted based on changes in the real-time data stream; This step effectively improves the quality and reliability of the raw data, avoiding interference with subsequent modeling and decision-making due to noise, missing data, or extreme values. S1.2. Standardize the cleaned data. Standardization should include at least data normalization to normalize various data types. Converted to dimensionless standard form, the expression is:
[0040] in, This represents the standardized data. For data The mean, For data Standard deviation; This step eliminates the differences in units and numerical scales between different data sources, providing a unified input space for subsequent multi-source feature fusion and machine learning model training; S1.3. Real-time synchronization of standardized data ensures consistency across different sources. This real-time synchronization is achieved through a distributed data processing framework that merges and synchronizes data from different sources, aligning and integrating the data within a unified time window. The expression is as follows:
[0041] in, This represents the synchronized data vector for the k-th time window. This represents the original data of the i-th data source within window k. Agg(·) represents the aggregation operation, and Concat(·) represents concatenating the features of each source. This step constructs a time-aligned, structurally unified multi-source feature matrix to support subsequent dynamic modeling and real-time prediction. S1.4 Based on the real-time synchronized data, an adaptive feedback mechanism is used to monitor data changes in real time. When significant changes occur in the data stream, the data acquisition strategy and data cleaning rules are automatically adjusted, utilizing dynamic thresholds. Anomalies are detected and adjustments are made based on the data acquisition strategy. The expression is:
[0042] in, and Let X represent the mean and standard deviation of the data at time t, respectively. Both are updated in real time with the data stream. t λ represents the real-time observation or data sample collected at time point t, and λ represents the sensitivity coefficient or threshold multiple of anomaly detection, which is used to control the strictness of anomaly judgment. This step enhances the system's robustness and adaptability to unexpected events, ensuring that data quality and model inputs remain effective in dynamic environments.
[0043] In this embodiment, S2 further includes: S2.1. Conduct joint analysis on the collected data and identify potential correlations between various data sources through a multi-dimensional data interaction model. These correlations include temporal correlations, spatial correlations, and causal relationships. Among them, the multi-dimensional data interaction model is a multi-source heterogeneous data joint analysis framework constructed by integrating dynamic Bayesian networks (temporal causality) and Granger causality tests (predictive causality). It is an existing mature technology used to systematically explore the temporal and causal relationships among factors related to traditional Chinese medicine decoction pieces. S2.2, Based on historical data With real-time data stream The system employs a dynamic feature selection method to automatically identify key variables affecting the fluctuations in demand for traditional Chinese medicine (TCM) decoction pieces. These key variables include multi-source dynamic factors with distinct TCM characteristics, such as seasonal changes, climate anomalies (sudden changes in temperature / humidity), epidemic indices of diseases like influenza, the season for taking tonic pastes, price fluctuations in TCM raw material producing areas, TCM-related policies, and public opinion. The feature selection method includes correlation analysis, information gain, and mutual information measurement, and dynamically adjusts the feature selection process based on changes in real-time data streams. Dynamic feature selection methods are a combination of online / dynamic feature selection methods, which include three methods: correlation analysis, information gain, and mutual information. Correlation analysis is used to quickly screen features that have a linear relationship with the target variable; Information gain is used to select the most discriminative features in classification or discretization tasks. Its expression is: IG(y;x j )=H(y) H(y∣x j ) Among them, IG(y;x) j ) is based on the known feature x j Under the given conditions, the information gain of the target variable y, H(y) is the entropy of the target variable y, representing its uncertainty, H(y|x) j Given feature x j Afterwards, the conditional entropy of y represents the remaining uncertainty, x j y represents the input features (usually discretized into a finite number of categories), and y represents the target variable (often a category label or a discretized sales grade). Mutual information is used to detect any type of dependency between features and targets, and is suitable for nonlinear and non-Gaussian scenarios. Its expression is:
[0044] Where I(x) j ;y) represents feature x j Mutual information between the target y and the target y is used to measure the amount of information shared between them (≥0), p(x) j (,y) represents x j The joint probability distribution of x and y, p(x) j ) represents x j Let p(y) represent the marginal probability distribution of y. Represents all possible x j The values of y and y are iterated and summed. S2.3. Weight the data after joint analysis, and assign weighting coefficients. The adjustment is made dynamically based on the influence of each data source, as shown in the expression:
[0045] in, For the weighted data, The original data, For data The weighting coefficients, and the weighting coefficients Automatically adjusted based on the real-time impact of the data source.
[0046] In this embodiment, step S3 further includes: S3.1, Based on weighted data Establish a demand forecasting model, wherein the function of the demand forecasting model is: Machine learning algorithms are used to predict future demand trends, and the confidence level of the prediction results is calculated. The expression is:
[0047] in, The confidence level of the prediction results is used to assess the reliability of the prediction results and to manage risks. This is a demand forecasting model function based on weighted data; S3.2 Predicting the demand for traditional Chinese medicine decoction pieces using machine learning models based on historical data. and real-time data stream Real-time data streams are collected and synchronized in real time via IoT devices; S3.3. In the demand forecasting process, historical data should be incorporated. and real-time data stream The parameters of the machine learning model are dynamically adjusted, enabling the model to learn and adapt to changing market demands and environmental factors in real time. The adjustment process uses gradient descent to update the parameters, as expressed in the following expression:
[0048] in, Let be the model parameters at time t. For learning rate, The gradient of the loss function. This is the loss function for the model; S3.4, Based on historical data and real-time data stream The adaptive forecasting results predict future short-term and long-term demand trends and identify potential demand change patterns. The expression is:
[0049] in, This represents the demand forecast result, where f(·) is based on historical data. and real-time data stream The prediction function is used to assess the strength of future demand trends and adjust the prediction results in conjunction with model parameters; S3.5 The demand forecasting model accurately predicts short-term demand by updating learning data in real time, and responds to market fluctuations in advance by identifying potential demand change patterns, thereby optimizing the risks of excess inventory and shortages.
[0050] In this embodiment, S4 further includes: S4.1 Based on demand forecast results A multi-objective optimization algorithm is employed to optimize resource allocation and inventory adjustment. This algorithm considers multiple objective functions, including inventory cost. Supply chain efficiency Inventory cycle and the risk of product expiration The expression for the multi-objective function M is obtained as follows:
[0051] Wherein, λ1, λ2 and λ3 are the weight coefficients of each objective function, which are used to dynamically adjust and balance different objectives; S4.2 Dynamically adjust the inventory and supply chain resource allocation scheme (RAP) based on a multi-objective optimization algorithm, wherein the RAP meets the demand forecast results. At the same time, it achieves optimal allocation of inventory and supply chain resources. This resource allocation scheme includes inventory levels. Procurement Plan and distribution strategies The expression is: RAP = (S inventory,t P order,t D distribution,t )
[0052] Among them, S inventory,t P represents the inventory level at the end of time period t. order,t D represents the quantity of purchase orders placed in time period t. distribution,t P represents the amount of goods distributed downstream in time period t. forecast,t T represents the demand for traditional Chinese medicine decoction pieces predicted by the model in time period t. supply This indicates the lead time for procurement (the number of days from order placement to delivery). Indicates the maximum allowable stockout percentage (e.g., 0.05 means 95% of demand is met), S min and S max These represent the lower and upper limits of safe inventory (used to prevent stockouts and overstocking); S4.3 When allocating inventory and supply chain resources, combine real-time data streams. and historical data The parameters and constraints in the optimization process are dynamically adjusted to adapt to changes in market demand and supply capacity over different time periods. These constraints include inventory limits. Minimum inventory and supply cycle The expressions are as follows: S min (t)=f min (H t ,R t ) S max (t)=f max (H t ,R t ) T supply (t)=f lead (H t ,R t ) Among them, S min (t) represents the dynamic minimum inventory level in time period t, S max (t) represents the dynamic maximum inventory limit for time period t, where T supply H(t) represents the dynamic supply cycle in time period t. t R represents historical data at time t. t f represents the real-time data stream at time t. min f max and f lead All are dynamic mapping functions; S4.4 The inventory and supply chain resource allocation scheme obtained based on the multi-objective optimization algorithm is fed back to the supply chain management system in real time to realize the automatic adjustment of inventory, production and distribution plans, maximize supply chain efficiency, optimize inventory costs and expiration risks, and maintain product supply continuity.
[0053] To further verify the feasibility and superiority of this method, the present invention provides the following practical simulation case for illustration: This simulation case 1 is: Demand prediction for traditional Chinese medicine decoction pieces vs. actual demand (with confidence level). Figure 3 As shown; The purpose of this simulation is to verify the accuracy of the demand forecasting model, Furong, and to demonstrate the confidence level P. yThe rationality; The highlight of this simulation is that it closely tracks the actual values during periods of high demand (such as the winter solstice and flu season).
[0054] This simulation case 2 compares dynamic and static inventory strategies for traditional Chinese medicine decoction pieces. Figure 4 As shown; The purpose of this simulation is to: dynamically adjust S min (t), S max (t) Avoid stockouts and overstocking.
[0055] This simulation case 3 is as follows Figure 5 As shown, this is a radar chart of the multi-objective optimization effect, which aims to visually compare the performance of the method with two baselines in multiple dimensions.
[0056] This simulation case 4 is as follows Figure 6 As shown, the key feature weights change over time (dynamic feature selection), the purpose of which is to prove that the system can automatically identify "when and what factors are most important".
[0057] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the above-described method for dynamically adjusting traditional Chinese medicine decoction piece resources based on machine learning.
[0058] See Figure 7 The present invention also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-described method for dynamically adjusting the resources of traditional Chinese medicine decoction pieces based on machine learning.
[0059] This invention also provides a computer program product containing instructions that, when run on a computer, causes the computer to perform the steps of the above-described machine learning-based method for dynamically adjusting the resources of traditional Chinese medicine decoction pieces.
[0060] It is understood that the systems, devices and storage media provided in the embodiments of the present invention correspond to the methods provided in the embodiments of the present invention, and the explanations, examples and beneficial effects of the relevant content can be referred to the corresponding parts of the above-mentioned method for dynamic adjustment of traditional Chinese medicine decoction piece resources based on machine learning.
[0061] It should be noted that those skilled in the art will understand that all or part of the steps implemented in the embodiments of the present invention can be implemented entirely or partially by software, hardware, firmware, or any combination thereof. When implemented in hardware, it can be implemented entirely or partially by purchasing standard parts or modifications. When implemented in software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state disks (SSDs)).
[0062] In summary, to address the numerous shortcomings of existing technologies in responding to market fluctuations, demand changes, unforeseen events, and optimizing resource allocation, this invention proposes a machine learning-based method for dynamically adjusting the resources of traditional Chinese medicine (TCM) decoction pieces. This method fully utilizes machine learning, big data analytics, IoT technology, and multi-objective optimization algorithms. It details algorithms for intelligent demand forecasting, inventory optimization, and supply chain resource allocation. By dynamically adjusting model parameters, collecting multi-source data in real time, and performing adaptive learning, it can accurately predict short-term and long-term demand trends for TCM decoction pieces, optimize inventory and resource allocation, significantly improve supply chain efficiency, reduce inventory costs, and minimize the risks of excess inventory and stockouts. This method possesses advantages such as self-learning, strong adaptability, precise inventory management, and optimized resource allocation.
[0063] It should be understood that the examples and embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Those skilled in the art can make various modifications or changes based on them. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A method for dynamically adjusting traditional Chinese medicine decoction piece resources based on machine learning, characterized in that, Includes the following steps: S1. Utilize IoT devices to collect multi-source data related to Chinese herbal medicine slices in real time, and perform real-time synchronization and adaptive processing on the collected data. S2. Jointly analyze the collected historical data and real-time data streams, identify potential influencing factors and correlations based on a multi-dimensional data interaction model, and use a dynamic feature selection method to determine the key variables affecting demand fluctuations. S3. Based on the data after joint analysis, construct a demand forecasting model and use a machine learning model to forecast demand. Combine historical data and real-time data streams, adjust the parameters of the machine learning model in real time to achieve self-learning and adaptive demand forecasting, predict short-term and long-term demand trends, and identify potential demand change patterns. S4. Based on the demand forecast results, resource allocation and inventory adjustment are carried out using a multi-objective optimization algorithm to generate inventory and supply chain resource allocation plans and perform dynamic optimization. S5. The optimized inventory and supply chain resource allocation plan will be automatically executed through smart contracts to achieve resource allocation and supply chain management operations without human intervention. S6. Monitor the inventory status of Chinese herbal medicine pieces in real time, and dynamically adjust the demand forecasting model and inventory and supply chain resource allocation plan based on real-time data to ensure the adaptability and flexibility of the system.
2. The method for dynamic adjustment of traditional Chinese medicine decoction piece resources based on machine learning as described in claim 1, characterized in that, In S1, the multi-source data includes at least sales data. Inventory data Climate change data Disease epidemic trend data Holiday data and additional related influencing factors data .
3. The method for dynamic adjustment of traditional Chinese medicine decoction piece resources based on machine learning as described in claim 1, characterized in that, S1 further includes: S1.1, For the collected data of various types Data cleaning includes at least removing duplicate data, imputing missing values, and removing outliers. Missing values are imputed using the mean imputation method, and outliers are removed by setting a threshold. Determine that the threshold Dynamically adjusted based on changes in the real-time data stream; S1.
2. Standardize the cleaned data. Standardization should include at least data normalization to normalize various data types. Converted to dimensionless standard form, the expression is: in, This represents the standardized data. For data The mean, For data Standard deviation; S1.
3. Real-time synchronization of standardized data ensures consistency across different sources. This real-time synchronization is achieved through a distributed data processing framework that merges and synchronizes data from different sources, aligning and integrating the data within a unified time window. The expression is as follows: in, This represents the synchronized data vector for the k-th time window. This represents the original data of the i-th data source within window k. Agg(·) represents the aggregation operation, and Concat(·) represents concatenating the features of each source. S1.4 Based on the real-time synchronized data, an adaptive feedback mechanism is used to monitor data changes in real time. When significant changes occur in the data stream, the data acquisition strategy and data cleaning rules are automatically adjusted, utilizing dynamic thresholds. Anomalies are detected and adjustments are made based on the data acquisition strategy. The expression is: in, and Let X represent the mean and standard deviation of the data at time t, respectively. Both are updated in real time with the data stream. t λ represents the real-time observation value or data sample collected at time point t, and λ represents the sensitivity coefficient or threshold multiple of anomaly detection, which is used to control the strictness of anomaly judgment.
4. The method for dynamic adjustment of traditional Chinese medicine decoction piece resources based on machine learning as described in claim 1, characterized in that, S2 further includes: S2.
1. Conduct joint analysis on the collected data and identify potential correlations between various data sources through a multi-dimensional data interaction model. These correlations include temporal correlations, spatial correlations, and causal relationships. S2.2, Based on historical data With real-time data stream The system employs a dynamic feature selection method to automatically identify key variables affecting the fluctuations in demand for traditional Chinese medicine decoction pieces. This feature selection method includes correlation analysis, information gain, and mutual information measurement, and dynamically adjusts the feature selection process based on changes in real-time data streams. S2.
3. Weight the data after joint analysis, and assign weighting coefficients. The adjustment is made dynamically based on the influence of each data source, as shown in the expression: in, For the weighted data, The original data, For data The weighting coefficients, and the weighting coefficients Automatically adjusted based on the real-time impact of the data source.
5. The method for dynamic adjustment of traditional Chinese medicine decoction piece resources based on machine learning as described in claim 1, characterized in that, S3 further includes: S3.1, Based on weighted data Establish a demand forecasting model, wherein the function of the demand forecasting model is: Machine learning algorithms are used to predict future demand trends, and the confidence level of the prediction results is calculated. The expression is: in, The confidence level of the prediction results is used to assess the reliability of the prediction results and to manage risks. This is a demand forecasting model function based on weighted data; S3.2 Predicting the demand for traditional Chinese medicine decoction pieces using machine learning models based on historical data. and real-time data stream Real-time data streams are collected and synchronized in real time via IoT devices; S3.
3. In the demand forecasting process, historical data should be incorporated. and real-time data stream The parameters of the machine learning model are dynamically adjusted, enabling the model to learn and adapt to changing market demands and environmental factors in real time. The adjustment process uses gradient descent to update the parameters, as expressed in the following expression: in, Let be the model parameters at time t. For learning rate, The gradient of the loss function. This is the loss function for the model; S3.4, Based on historical data and real-time data stream The adaptive forecasting results predict future short-term and long-term demand trends and identify potential demand change patterns. The expression is: in, This represents the demand forecast result, where f(·) is based on historical data. and real-time data stream The prediction function is used to assess the strength of future demand trends and adjust the prediction results in conjunction with model parameters; S3.5 The demand forecasting model accurately predicts short-term demand by updating learning data in real time, and responds to market fluctuations in advance by identifying potential demand change patterns, thereby optimizing the risks of excess inventory and shortages.
6. The method for dynamic adjustment of traditional Chinese medicine decoction piece resources based on machine learning as described in claim 1, characterized in that, S4 further includes: S4.1 Based on demand forecast results A multi-objective optimization algorithm is employed to optimize resource allocation and inventory adjustment. This algorithm considers multiple objective functions, including inventory cost. Supply chain efficiency Inventory cycle and the risk of product expiration The expression for the multi-objective function M is obtained as follows: Wherein, λ1, λ2 and λ3 are the weight coefficients of each objective function, which are used to dynamically adjust and balance different objectives; S4.2 Dynamically adjust the inventory and supply chain resource allocation scheme (RAP) based on a multi-objective optimization algorithm, wherein the RAP meets the demand forecast results. At the same time, it achieves optimal allocation of inventory and supply chain resources. This resource allocation scheme includes inventory levels. Procurement Plan and distribution strategies The expression is: RAP=(S inventory,t ,P order,t ,D distribution,t ) Among them, S inventory,t P represents the inventory level at the end of time period t. order,t D represents the quantity of purchase orders placed in time period t. distribution,t This represents the amount of goods distributed downstream during time period t. S4.3 When allocating inventory and supply chain resources, combine real-time data streams. and historical data The parameters and constraints in the optimization process are dynamically adjusted to adapt to changes in market demand and supply capacity over different time periods. These constraints include inventory limits. Minimum inventory and supply cycle The expressions are as follows: S min (t)=f min (H t ,R t ) S max (t)=f max (H t ,R t ) T supply (t)=f lead (H t ,R t ) Among them, S min (t) represents the dynamic minimum inventory level in time period t, S max (t) represents the dynamic maximum inventory limit for time period t, where T supply H(t) represents the dynamic supply cycle in time period t. t R represents historical data at time t. t f represents the real-time data stream at time t. min f max and f lead All are dynamic mapping functions; S4.4 The inventory and supply chain resource allocation scheme obtained based on the multi-objective optimization algorithm is fed back to the supply chain management system in real time to realize the automatic adjustment of inventory, production and distribution plans, maximize supply chain efficiency, optimize inventory costs and expiration risks, and maintain product supply continuity.
7. A computer-readable storage medium, characterized in that, The system contains a computer program that, when executed by a processor, causes the processor to perform the steps of the machine learning-based dynamic adjustment method for traditional Chinese medicine decoction piece resources as described in any one of claims 1-6.
8. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, which, when executed by the processor, causes the processor to perform the steps of the machine learning-based dynamic adjustment method for traditional Chinese medicine decoction piece resources as described in any one of claims 1-6.