Intelligent drug flow direction monitoring method and system based on competition analysis
Through the intelligent monitoring method of drug flow direction based on competition analysis, using time series and improved clustering algorithms, firefly optimization algorithms and BP neural networks, the problem of inefficient monitoring of traditional drug flow direction is solved, and efficient monitoring and analysis of drug flow direction data is realized. , improve decision-making accuracy and loss monitoring accuracy.
Patent Information
- Application Number
- CN202510074755.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional drug flow monitoring methods are inefficient, resulting in errors in drug sales decisions and failure to effectively analyze competitors' drug profit and loss data.
Using intelligent monitoring of drug flow direction based on competition analysis, by obtaining competitor drug flow data, identifying abnormal data using time series, improving k-means algorithm for clustering processing, establishing competitor profit monitoring models and using improved firefly optimization algorithm Solve and train the BP neural network early warning model.
It realizes efficient monitoring and analysis of drug flow data, improves the accuracy of drug sales decisions, reduces labor costs, and improves the accuracy of loss monitoring.
Smart Images

Figure CN119515206A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent monitoring, and in particular to a method and system for intelligent monitoring of drug flow based on competition analysis. Background Art
[0002] Traditional methods of drug flow monitoring often involve establishing a database to store drug flow-related data, and then querying the database's in-and-out records to achieve the purpose of flow monitoring. However, drug flow data are often large in quantity and redundant in types, wasting a lot of manpower costs on drug flow monitoring. At the same time, there is no analysis of competitors' drug profit and loss data, and no use of high-tech technologies such as neural networks, which can easily lead to errors in drug sales decisions and put the company at a disadvantage in the drug sales market. Summary of the invention
[0003] In response to the problems in the related art, the present invention provides a method and system for intelligently monitoring drug flow based on competition analysis to overcome the above-mentioned technical problems existing in the existing related art.
[0004] In order to solve the above technical problems, the present invention is achieved through the following technical solutions: The present invention is a method for intelligently monitoring drug flow based on competition analysis, comprising the following steps: S1. Obtain the data related to the flow of competitor drugs and medical device products to obtain a set of competitor drug flow data, identify and delete abnormal data in the set of competitor drug flow data based on the time series, and obtain a processed set of competitor drug flow data; S2. Using an improved k-means algorithm to perform data integration on the processed competitor drug flow data set to obtain a preliminary clustering result, and then performing secondary clustering processing on the preliminary clustering result to obtain a profitable drug flow data set and a loss-making drug flow data set; S3. Establish a competitor profit monitoring model based on the profitable drug flow data set, solve the competitor profit monitoring model based on the improved firefly optimization algorithm, calculate the optimal profit solution, obtain the final competitor profit monitoring model, and realize drug flow profit monitoring; S4. Use principal component analysis to perform factor analysis on the loss-making drug flow data set to obtain a loss-making drug flow data sample set, and combine the loss-making drug flow data sample set to train a BP neural network early warning model to complete drug flow loss monitoring.
[0005] The invention obtains a set of competitor drug flow data, identifies and deletes abnormal data in the set of competitor drug flow data based on time series, and finds local outlier factors to identify abnormal data by establishing a time subsequence of the competitor drug flow data. This method uses time subsequences to accurately reflect the changing trend of the original data, which can not only eliminate noise interference, but also quickly process a large amount of data with high real-time performance. Secondly, the improved k-means algorithm performs two clustering processes on the processed competitor drug flow data set. The first clustering helps avoid the interference of individual outlier data and screens out the clusters that need to be processed. The second clustering is based on the size of the cluster. A large cluster represents a large amount of drug flow data, which is considered profitable, otherwise it is considered a loss. This method cleverly divides drug flow data into profit data and loss data. Compared with traditional clustering algorithms, the improved clustering algorithm has good optimization effect and reduces dependence on the initial clustering center selection; then a competitor profit monitoring model is established, and the competitor profit monitoring model is solved based on the improved firefly optimization algorithm. The model is convenient for testing profitable drug flow data and realizing drug flow profit monitoring; the algorithm solves the problem of premature convergence of the traditional firefly optimization algorithm by introducing the global optimal solution, thereby improving the global search capability and convergence speed; finally, the BP neural network early warning model is trained to facilitate early warning of drug flow data and realize drug flow loss monitoring; this method reduces correlation through factor analysis, reduces data processing costs, and improves the accuracy of loss monitoring.
[0006] Preferably, the S1 comprises the following steps: S11. Obtain the data related to the flow of competitors' drugs and medical devices, record the data related to the flow of competitors' drugs and medical devices as the main indicator, the main indicator includes sub-indicators such as drug sales quantity, drug production cost, and drug sales price, collect m sub-indicators, each of which contains n competitor drug flow data, and generate a competitor drug flow data set ,in represents the mth sub-index and ,in Indicates the drug flow data of the nth competitor of the mth sub-indicator; S12: assign a time series to the competitor drug flow data set, record the time point at which each competitor drug flow data in the competitor drug flow data set is generated, and generate a drug flow time series set. ,in Indicates The nth time point of the sub-indicator; based on the time series, abnormal subsequence identification is performed on the competitor drug flow data set to obtain the subsequence identification result. The specific steps are as follows: S121, draw the image of the drug flow time series set, obtain the time series image, select the Sub-indicator time point and time point , calculate the connection time point and time point The slope and length of the straight line give the time point Length and timing The slope of subsequence of ,in Indicates time point Length, Indicates time point , sequentially calculating the subsequences of all drug flow time series in the drug flow time series set to obtain a processed drug flow time series set; Select the first Sub-indicator time point Subsequences and time points Subsequence of , calculate the time point Subsequences and time points The Euclidean distance of the subsequence is calculated as follows: ; in, Indicates time point Subsequences and time points The Euclidean distance of the subsequences of Indicates time point Length, Indicates time point The slope of Indicates time point Length, Indicates time point The slope of The Euclidean distances of all subsequences in the processed drug flow time series set are calculated in sequence to obtain a subsequence set; S122, select any subsequence from the subsequence set, record it as a core subsequence, select the core subsequence adjacent to subsequences to form a core subsequence neighborhood, and calculate the local reachability density of the cth subsequence in the core subsequence neighborhood. The calculation formula is as follows: ; in, represents the local reachability density of the cth subsequence in the neighborhood of the core subsequence, represents the core subsequence neighborhood, represents the distance between the cth subsequence and the core subsequence; According to the local reachability density of the cth subsequence in the neighborhood of the core subsequence, the local outlier factor of the cth subsequence is calculated to obtain a set of local outlier factors; the first threshold is set to , when the local outlier factor in the local outlier factor set is greater than the first threshold, the subsequence corresponding to the local outlier factor is abnormal, otherwise the subsequence corresponding to the local outlier factor is normal; further, traverse the subsequence set in turn to obtain a subsequence recognition result; S13. According to the subsequence identification result, delete the abnormal subsequence, that is, the abnormal competitor drug flow data, until the competitor drug flow data set is traversed completely to obtain a processed competitor drug flow data set.
[0007] The invention identifies and deletes abnormal data in the competitor drug flow data set based on time series, and uses the competitor drug flow data to establish a time sub-sequence. The use of time sub-sequences can accurately reflect the changing trend of the original data, which can not only eliminate noise interference, but also quickly process large amounts of data with high real-time performance.
[0008] Preferably, S2 comprises the following steps: S21, selecting any processed sub-indicator from the processed competitor drug flow data set, recorded as a to-be-processed sub-indicator, the to-be-processed sub-indicator comprising d competitor drug flow data, constituting a to-be-processed competitor drug flow data set, randomly selecting k cluster centers from the to-be-processed competitor drug flow data set, recorded as initial cluster centers; traversing the to-be-processed competitor drug flow data set, finding the to-be-processed competitor drug flow data closest to the initial cluster center, and adding it to the corresponding initial cluster center to form a number of cluster clusters; Calculate the mean of the competitor drug flow data to be processed in several clusters to obtain the cluster mean, and use the cluster mean as the next cluster center; continue to search for the cluster of the next cluster center until the mean of the competitor drug flow data to be processed in the cluster no longer changes, end the first clustering, and obtain the final cluster; cluster the final clusters of other sub-indicators in turn to obtain preliminary clustering results; S22. Based on the preliminary clustering results, the processed competitor drug flow data set is subjected to secondary clustering using an improved k-means algorithm to obtain a final loss clustering set and a final profit clustering set. The specific steps are as follows: S221, counting the number of clusters in the preliminary clustering results, setting the second threshold to , when the number of clusters in the preliminary clustering result is less than the second threshold, the corresponding cluster is regarded as an irrelevant set of drug flow data and deleted, otherwise the corresponding cluster is retained to obtain the processed clustering result; S222. Set the profit and loss threshold to , when the number of clusters in the processed clustering result is less than the profit and loss threshold, the corresponding cluster is included in the loss cluster set, otherwise the corresponding cluster is included in the profit cluster set; select any cluster in the loss cluster set as the new cluster center, record it as the first cluster center, calculate the cluster with the largest distance from the first cluster center, record it as the first farthest cluster, and then find the cluster with the smallest distance from the first farthest cluster from other clusters, record it as the first nearest cluster; set the distance between the first cluster center and the first farthest cluster to , the distance between the first farthest cluster and the first nearest cluster is , Indicates between When the constant between When the first nearest cluster is used as the new cluster center, until the new cluster center no longer changes, a final loss cluster set is obtained; the profit cluster set repeats S222 to obtain a final profit cluster set, completing the secondary clustering process; S23. The clusters within the final loss clustering set contain loss-making drug flow data, and the loss-making drug flow data is classified according to sub-indicators to obtain a loss-making drug flow data set; the clusters within the final profit clustering set contain profit-making drug flow data, and the profit-making drug flow data is classified according to sub-indicators to obtain a profit-making drug flow data set.
[0009] This invention uses an improved k-means algorithm to perform two clustering processes. The first clustering helps avoid the interference of individual outlier data and screens out the clusters that need to be processed. The second clustering cleverly divides the drug flow data into profit data and loss data based on the size of the clusters. Compared with traditional clustering algorithms, the improved clustering algorithm has good optimization effect and reduces dependence on the selection of initial cluster centers.
[0010] Preferably, S3 comprises the following steps: S31. According to the profitable drug flow data set, the daily drug sales volume is set to , the daily drug sales cost is , then the profit objective function is ; Set the The sales volume of drugs is , No. The sales price of the drug is , No. The production cost of the drug is , No. The transportation and storage cost of the drug is ,but , ; Assign constraints on drug sales quantity, drug sales price, drug production cost, and drug transportation and storage cost, establish profit constraints, and combine the profit objective function and profit constraints to obtain a competitor profit monitoring model; S32. Using the improved firefly optimization algorithm to solve the competitor profit monitoring model to obtain the optimal profit solution, the specific steps are as follows: S321, taking the competitor profit monitoring model as the fitness function, assuming that there is a firefly population in the search space, the individual dimension of fireflies in the firefly population is g, and each firefly corresponds to a solution of the competitor profit monitoring model; after initializing the firefly population, select the first i firefly individuals, select any firefly individual from the firefly population, record it as a random firefly individual, and calculate the i The Euclidean distance between individual fireflies and random fireflies is used to obtain the initial distance. The light absorption coefficient is set to , the firefly attraction coefficient is , then i The formula for calculating the attractiveness of a firefly is as follows: ; in, Indicates i The individual attraction of fireflies p represents the initial distance, e represents a constant; Set i The initial position of each firefly is , the initial position of a random firefly individual is , Represents a random number between [0, 1], for the i The initial position of each firefly is updated, and the calculation formula is as follows: ; Set the current number of iterations to h , random number Continuously iterate and update, set the h Iteration random number , No. h +1 iteration of random number ; S322, with the i The initial position of each firefly is updated, and the optimal position of the current firefly is found. At this time, the optimal position of the current firefly corresponds toh The optimal solution of the competitor profit monitoring model is obtained by iterating the global optimal guide to generate mutations in the firefly population. It is set to select any firefly individual in the firefly population, denoted as the first firefly individual and the second firefly individual, and the random coefficients are and , the mutation vector calculation formula is as follows: ; in, Indicates i The mutation vector of each firefly individual, Indicates the position of the first firefly individual, represents the position of the second firefly individual, Indicates the current optimal individual position of fireflies; The firefly population updates its position according to the mutation vector, calculates the best fitness function value of the current iteration, and compares the best fitness function value of the current iteration with the best fitness function value of the previous iteration, and selects the current best fitness function value. At this time, the firefly individual corresponding to the current best fitness function value is the optimal solution of the competitor profit monitoring model; S323, set the maximum number of iterations to H In the continuous iteration process, the individual positions of fireflies are continuously updated, and the optimal firefly individual is selected as the initial firefly population for the next iteration. At the same time, the optimal fitness function value is continuously updated until the current iteration number reaches the maximum iteration number, and the iteration is stopped to obtain the first i The final position of each firefly individual, and the optimal profit solution is obtained at the final position; S33. The optimal profit solution satisfies the profit objective function and profit constraints. The competitor profit monitoring model is adjusted according to the optimal profit solution to obtain a final competitor profit monitoring model. The competitor drug flow data of previous years is re-acquired to obtain a new competitor drug flow data set. After abnormal data deletion and clustering processing, a new profitable drug flow data set and a new loss-making drug flow data set are obtained. The new profitable drug flow data set is input into the final competitor profit monitoring model, and the profit value is output to realize drug flow profit monitoring.
[0011] This invention establishes a competitor profit monitoring model and solves the competitor profit monitoring model based on an improved firefly optimization algorithm. The algorithm solves the problem of premature convergence of the traditional firefly optimization algorithm by introducing a global optimal solution, thereby improving the global search capability and convergence speed. At the same time, it is convenient to check the profitable drug flow data and realize drug flow profit monitoring.
[0012] Preferably, S4 comprises the following steps: S41, using principal component analysis to perform factor analysis on the loss-making drug flow data set, constructing a loss-making drug flow data matrix based on the loss-making drug flow data set, standardizing the loss-making drug flow data matrix to obtain a standardized matrix and a correlation coefficient matrix, calculating the eigenvalues and eigenvectors of the correlation coefficient matrix, calculating the contribution and score of each sub-indicator in the loss-making drug flow data matrix based on the eigenvalues, setting a score threshold, marking the sub-indicator corresponding to a score greater than the score threshold as a principal component, combining the principal components to obtain a loss-making drug flow data sample set, and completing factor analysis; S42. Select j loss-making drug flow data samples for each sub-indicator in the loss-making drug flow data sample set, and then normalize them to form a training sample set and a training test set respectively. Input the training sample set into the BP (backward propagation) neural network, start the BP neural network learning, and iterate continuously until the BP neural network converges to obtain a trained BP neural network; then input the training test set into the trained BP neural network, set an accuracy threshold, and when the output result accuracy is less than the accuracy threshold, stop iterating to obtain a BP neural network early warning model, otherwise adjust the weight until the output result accuracy is less than the accuracy threshold; input the new loss-making drug flow data set into the BP neural network early warning model, output the early warning result, set the early warning threshold, when the early warning result is less than the early warning threshold, the drug is slightly lost, otherwise the drug is severely lost, and the drug flow loss monitoring is completed.
[0013] The invention obtains a BP neural network early warning model by training the BP neural network, reduces correlation through factor analysis, reduces data processing costs, facilitates early warning of drug flow data, realizes drug flow loss monitoring, and improves the accuracy of loss monitoring.
[0014] This embodiment also discloses a system for the intelligent monitoring method of drug flow based on competition analysis, which specifically includes: a drug flow data anomaly identification module, a drug flow data clustering module, a drug flow profit monitoring module and a drug flow loss monitoring module; The drug flow data anomaly identification module is used to identify and delete abnormal data of competitor drug flow data based on time series; The drug flow data clustering module is used to perform secondary clustering on the processed competitor drug flow data using an improved clustering algorithm; The drug flow profit monitoring module is used to establish a monitoring model and use an improved firefly optimization algorithm to solve the optimal solution of the monitoring model; The drug flow loss monitoring module is used to train a BP neural network early warning model to perform loss monitoring on drug flow data.
[0015] The present invention has the following beneficial effects: 1. The invention identifies and deletes abnormal data based on time series, and uses competitor drug flow data to establish time sub-series. The use of time sub-series can accurately reflect the changing trend of the original data, which can not only eliminate noise interference, but also quickly process large amounts of data with high real-time performance.
[0016] 2. The invention performs two clustering processes through an improved k-means algorithm. The first clustering helps to avoid the interference of individual outlier data and screen out the clusters that need to be processed. The second clustering cleverly divides the drug flow data into profit data and loss data according to the size of the clusters. Compared with the traditional clustering algorithm, the improved clustering algorithm has good optimization effect and reduces the dependence on the initial cluster center selection.
[0017] 3. The invention establishes a competitor profit monitoring model and solves the competitor profit monitoring model based on an improved firefly optimization algorithm. By introducing a global optimal solution, the premature convergence problem of the traditional firefly optimization algorithm is solved, thereby improving the global search capability and convergence speed. At the same time, it is convenient to check the profitable drug flow data and realize drug flow profit monitoring.
[0018] 4. The invention obtains a BP neural network early warning model by training the BP neural network, reduces the correlation through factor analysis, reduces the data processing cost, facilitates early warning of drug flow data, realizes drug flow loss monitoring, and improves the accuracy of loss monitoring.
[0019] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying any creative work.
[0021] Figure 1 A schematic diagram of the process of intelligent monitoring of drug flow in the drug flow intelligent monitoring system based on competition analysis provided by the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0024] Example 1 See also Figure 1 This implementation discloses a method for intelligently monitoring drug flow based on competition analysis, which specifically includes the following contents: S1. Obtain the data related to the flow of competitor drugs and medical device products to obtain a set of competitor drug flow data, identify and delete abnormal data in the set of competitor drug flow data based on the time series, and obtain a processed set of competitor drug flow data; The S1 comprises the following steps: S11. Obtain the data related to the flow of competitors' drugs and medical devices, record the data related to the flow of competitors' drugs and medical devices as the main indicator, the main indicator includes sub-indicators such as drug sales quantity, drug production cost, and drug sales price, collect m sub-indicators, each of which contains n competitor drug flow data, and generate a competitor drug flow data set ,in represents the mth sub-index and ,in Indicates the drug flow data of the nth competitor of the mth sub-indicator; S12: assign a time series to the competitor drug flow data set, record the time point at which each competitor drug flow data in the competitor drug flow data set is generated, and generate a drug flow time series set. ,in Indicates The nth time point of the sub-indicator; based on the time series, abnormal subsequence identification is performed on the competitor drug flow data set to obtain the subsequence identification result. The specific steps are as follows: S121, draw the image of the drug flow time series set, obtain the time series image, select the Sub-indicator time point and time point , calculate the connection time point and time point The slope and length of the straight line give the time point Length and timing The slope of subsequence of ,in Indicates time point Length, Indicates time point , sequentially calculating the subsequences of all drug flow time series in the drug flow time series set to obtain a processed drug flow time series set; Select the first Sub-indicator time point Subsequences and time points Subsequence of , calculate the time point Subsequences and time points The Euclidean distance of the subsequence is calculated as follows: ; in, Indicates time point Subsequences and time points The Euclidean distance of the subsequences of Indicates time point Length, Indicates time point The slope of Indicates time point Length, Indicates time point The slope of The Euclidean distances of all subsequences in the processed drug flow time series set are calculated in sequence to obtain a subsequence set; S122, select any subsequence from the subsequence set, record it as a core subsequence, select the core subsequence adjacent to subsequences to form a core subsequence neighborhood, and calculate the local reachability density of the cth subsequence in the core subsequence neighborhood. The calculation formula is as follows: ; in, represents the local reachability density of the cth subsequence in the neighborhood of the core subsequence, represents the core subsequence neighborhood, represents the distance between the cth subsequence and the core subsequence; According to the local reachability density of the cth subsequence in the neighborhood of the core subsequence, the local outlier factor of the cth subsequence is calculated to obtain a set of local outlier factors; the first threshold is set to , when the local outlier factor in the local outlier factor set is greater than the first threshold, the subsequence corresponding to the local outlier factor is abnormal, otherwise the subsequence corresponding to the local outlier factor is normal; further, traverse the subsequence set in turn to obtain a subsequence recognition result; S13, according to the subsequence identification result, delete the abnormal subsequence, that is, the abnormal competitor drug flow data, until the competitor drug flow data set is traversed to obtain a processed competitor drug flow data set; S2. Using an improved k-means algorithm to perform data integration on the processed competitor drug flow data set to obtain a preliminary clustering result, and then performing secondary clustering processing on the preliminary clustering result to obtain a profitable drug flow data set and a loss-making drug flow data set; The S2 comprises the following steps: S21, selecting any processed sub-indicator from the processed competitor drug flow data set, recorded as a to-be-processed sub-indicator, the to-be-processed sub-indicator comprising d competitor drug flow data, constituting a to-be-processed competitor drug flow data set, randomly selecting k cluster centers from the to-be-processed competitor drug flow data set, recorded as initial cluster centers; traversing the to-be-processed competitor drug flow data set, finding the to-be-processed competitor drug flow data closest to the initial cluster center, and adding it to the corresponding initial cluster center to form a number of cluster clusters; Calculate the mean of the competitor drug flow data to be processed in several clusters to obtain the cluster mean, and use the cluster mean as the next cluster center; continue to search for the cluster of the next cluster center until the mean of the competitor drug flow data to be processed in the cluster no longer changes, end the first clustering, and obtain the final cluster; cluster the final clusters of other sub-indicators in turn to obtain preliminary clustering results; S22. Based on the preliminary clustering results, the processed competitor drug flow data set is subjected to secondary clustering using an improved k-means algorithm to obtain a final loss clustering set and a final profit clustering set. The specific steps are as follows: S221, counting the number of clusters in the preliminary clustering results, setting the second threshold to , when the number of clusters in the preliminary clustering result is less than the second threshold, the corresponding cluster is regarded as an irrelevant set of drug flow data and deleted, otherwise the corresponding cluster is retained to obtain the processed clustering result; S222. Set the profit and loss threshold to , when the number of clusters in the processed clustering result is less than the profit and loss threshold, the corresponding cluster is included in the loss cluster set, otherwise the corresponding cluster is included in the profit cluster set; select any cluster in the loss cluster set as the new cluster center, record it as the first cluster center, calculate the cluster with the largest distance from the first cluster center, record it as the first farthest cluster, and then find the cluster with the smallest distance from the first farthest cluster from other clusters, record it as the first nearest cluster; set the distance between the first cluster center and the first farthest cluster to , the distance between the first farthest cluster and the first nearest cluster is , Indicates between When the constant between When the first nearest cluster is used as the new cluster center, until the new cluster center no longer changes, a final loss cluster set is obtained; the profit cluster set repeats S222 to obtain a final profit cluster set, completing the secondary clustering process; S23, the clusters in the final loss cluster set contain loss-making drug flow data, and the loss-making drug flow data is classified according to the sub-indicators to obtain a loss-making drug flow data set; the clusters in the final profit cluster set contain profit-making drug flow data, and the profit-making drug flow data is classified according to the sub-indicators to obtain a profit-making drug flow data set; S3. Establish a competitor profit monitoring model based on the profitable drug flow data set, solve the competitor profit monitoring model based on the improved firefly optimization algorithm, calculate the optimal profit solution, obtain the final competitor profit monitoring model, and realize drug flow profit monitoring; The S3 comprises the following steps: S31. According to the profitable drug flow data set, the daily drug sales volume is set to , the daily drug sales cost is , then the profit objective function is ; Set the The sales volume of drugs is , No. The sales price of the drug is , No. The production cost of the drug is , No. The transportation and storage cost of the drug is ,but , ; Assign constraints on drug sales quantity, drug sales price, drug production cost, and drug transportation and storage cost, establish profit constraints, and combine the profit objective function and profit constraints to obtain a competitor profit monitoring model; S32. Using the improved firefly optimization algorithm to solve the competitor profit monitoring model to obtain the optimal profit solution, the specific steps are as follows: S321, taking the competitor profit monitoring model as the fitness function, assuming that there is a firefly population in the search space, the individual dimension of fireflies in the firefly population is g, and each firefly corresponds to a solution of the competitor profit monitoring model; after initializing the firefly population, select the first i firefly individuals, select any firefly individual from the firefly population, record it as a random firefly individual, and calculate the i The Euclidean distance between individual fireflies and random fireflies is used to obtain the initial distance. The light absorption coefficient is set to , the firefly attraction coefficient is , then i The formula for calculating the attractiveness of a firefly is as follows: ; in, Indicates i The individual attraction of fireflies p represents the initial distance, e represents a constant; Set i The initial position of each firefly is , the initial position of a random firefly individual is , Represents a random number between [0, 1], for the i The initial position of each firefly is updated, and the calculation formula is as follows: ; Set the current number of iterations to h , random number Continuously iterate and update, set the h Iteration random number , No. h +1 iteration of random number ; S322, with the i The initial position of each firefly is updated, and the optimal position of the current firefly is found. At this time, the optimal position of the current firefly corresponds to h The optimal solution of the competitor profit monitoring model is obtained by iterating the global optimal guide to generate mutations in the firefly population. It is set to select any firefly individual in the firefly population, denoted as the first firefly individual and the second firefly individual, and the random coefficients are and , the mutation vector calculation formula is as follows: ; in, Indicates i The mutation vector of each firefly individual, Indicates the position of the first firefly individual, represents the position of the second firefly individual, Indicates the current optimal individual position of fireflies; The firefly population updates its position according to the mutation vector, calculates the best fitness function value of the current iteration, and compares the best fitness function value of the current iteration with the best fitness function value of the previous iteration, and selects the current best fitness function value. At this time, the firefly individual corresponding to the current best fitness function value is the optimal solution of the competitor profit monitoring model; S323, set the maximum number of iterations to H In the continuous iteration process, the individual positions of fireflies are continuously updated, and the optimal firefly individual is selected as the initial firefly population for the next iteration. At the same time, the optimal fitness function value is continuously updated until the current iteration number reaches the maximum iteration number, and the iteration is stopped to obtain the first i The final position of each firefly individual, and the optimal profit solution is obtained at the final position; S33, the profit optimal solution satisfies the profit objective function and profit constraint conditions, the competitor profit monitoring model is applied to the profit optimal solution to obtain a final competitor profit monitoring model, the competitor drug flow data of previous years is reacquired to obtain a new competitor drug flow data set, after abnormal data deletion and clustering processing, a new profitable drug flow data set and a new loss-making drug flow data set are obtained, the new profitable drug flow data set is input into the final competitor profit monitoring model, the profit value is output, and drug flow profit monitoring is realized; S4, using principal component analysis to perform factor analysis on the loss-making drug flow data set to obtain a loss-making drug flow data sample set, combining the loss-making drug flow data sample set, training a BP neural network early warning model to complete drug flow loss monitoring; The S4 comprises the following steps: S41, using principal component analysis to perform factor analysis on the loss-making drug flow data set, constructing a loss-making drug flow data matrix based on the loss-making drug flow data set, standardizing the loss-making drug flow data matrix to obtain a standardized matrix and a correlation coefficient matrix, calculating the eigenvalues and eigenvectors of the correlation coefficient matrix, calculating the contribution and score of each sub-indicator in the loss-making drug flow data matrix based on the eigenvalues, setting a score threshold, marking the sub-indicator corresponding to a score greater than the score threshold as a principal component, combining the principal components to obtain a loss-making drug flow data sample set, and completing factor analysis; S42. Select j loss-making drug flow data samples for each sub-indicator in the loss-making drug flow data sample set, and then normalize them to form a training sample set and a training test set respectively. Input the training sample set into the BP neural network, start the BP neural network learning, and iterate continuously until the BP neural network converges to obtain a trained BP neural network; then input the training test set into the trained BP neural network, set an accuracy threshold, and when the output result accuracy is less than the accuracy threshold, stop iterating to obtain a BP neural network early warning model, otherwise adjust the weight until the output result accuracy is less than the accuracy threshold; input the new loss-making drug flow data set into the BP neural network early warning model, output the early warning result, set the early warning threshold, when the early warning result is less than the early warning threshold, the drug is slightly lost, otherwise the drug is severely lost, and the drug flow loss monitoring is completed.
[0025] Example 2 This embodiment also discloses a system for the intelligent monitoring method of drug flow based on competition analysis, which specifically includes: a drug flow data anomaly identification module, a drug flow data clustering module, a drug flow profit monitoring module and a drug flow loss monitoring module; The drug flow data anomaly identification module is used to identify and delete abnormal data of competitor drug flow data based on time series; The drug flow data clustering module is used to perform secondary clustering on the processed competitor drug flow data using an improved clustering algorithm; The drug flow profit monitoring module is used to establish a monitoring model and use an improved firefly optimization algorithm to solve the optimal solution of the monitoring model; The drug flow loss monitoring module is used to train a BP neural network early warning model to perform loss monitoring on drug flow data.
[0026] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0027] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. An intelligent monitoring method for drug flow based on competition analysis, characterized in that: The steps include: S1. Obtain data related to the flow of competitor drugs and medical device products to obtain a set of competitor drug flow data, identify and delete abnormal data in the competitor drug flow data set based on the time series, and obtain a processed set of competitor drug flow data; S2. Using an improved k-means algorithm to perform data integration on the processed competitor drug flow data set to obtain a preliminary clustering result, and then performing secondary clustering processing on the preliminary clustering result to obtain a profitable drug flow data set and a loss-making drug flow data set; S3. Establish a competitor profit monitoring model based on the profitable drug flow data set, solve the competitor profit monitoring model, calculate the optimal profit solution, obtain the final competitor profit monitoring model, and realize drug flow profit monitoring; S4. Use principal component analysis to perform factor analysis on the loss-making drug flow data set to obtain a loss-making drug flow data sample set, and combine the loss-making drug flow data sample set to train a BP neural network early warning model to complete drug flow loss monitoring.
2. The method for intelligently monitoring drug flow based on competition analysis according to claim 1, characterized in that: The S1 comprises the following steps: S11. Obtain the data related to the flow of competitors' drugs and medical devices. The data related to the flow of competitors' drugs and medical devices includes several sub-indicators, and generate a set of competitor drug flow data; S12, assigning a time series to the competitor's drug flow data set, and performing abnormal subsequence identification on the competitor's drug flow data set based on the time series to obtain a subsequence identification result; S13. According to the subsequence identification result, delete the abnormal subsequence, that is, the abnormal competitor drug flow data, until the competitor drug flow data set is traversed completely to obtain a processed competitor drug flow data set.
3. The method for intelligently monitoring drug flow based on competition analysis according to claim 2 is characterized in that: The S12 comprises the following steps: S121, obtaining a time series image according to the drug flow time series set, calculating the length and slope of the time points in the time series image, recording them as subsequences, and constituting a processed drug flow time series set; Calculate the Euclidean distances of all subsequences in the processed drug flow time series set to obtain a subsequence set; S122, selecting a core subsequence from the subsequence set, selecting adjacent subsequences of the core subsequence subsequences to form a core subsequence neighborhood, calculate the local reachable density and local outlier factor of the subsequences in the core subsequence neighborhood; set a first threshold, compare the local outlier factor with the first threshold, identify abnormal subsequences, and obtain a subsequence identification result.
4. The method for intelligently monitoring drug flow based on competition analysis according to claim 3 is characterized in that: The S2 comprises the following steps: S21, integrating the processed competitor drug flow data set to obtain a preliminary clustering result; S22, according to the preliminary clustering results, using an improved k-means algorithm to perform secondary clustering processing on the processed competitor drug flow data set to obtain a final loss clustering set and a final profit clustering set; S23, the final loss cluster set and the final profit cluster set are classified according to the sub-indicators, Obtain the data set of loss-making drug flow and the data set of profitable drug flow.
5. The method for intelligent monitoring of drug flow based on competition analysis according to claim 4 is characterized in that: The S22 comprises the following steps: S221, setting a second threshold, comparing the number of clusters in the preliminary clustering result with the second threshold, screening the clusters, and obtaining a processed clustering result; S222, setting a profit and loss threshold, comparing the number of clusters in the processed clustering result with the profit and loss threshold, and obtaining a loss cluster set and a profit cluster set; A secondary clustering process is performed on the loss cluster set and the profit cluster set to obtain a final loss cluster set and a final profit cluster set.
6. The method for intelligently monitoring drug flow based on competition analysis according to claim 5, characterized in that: The S3 comprises the following steps: S31. Based on the profitable drug flow data set, using drug sales quantity, drug sales price, drug production cost, and drug transportation and storage cost, establish a profit objective function and profit constraint conditions to obtain a competitor profit monitoring model; S32, using the improved firefly optimization algorithm to solve the competitor profit monitoring model to obtain the optimal profit solution; S33. The competitor profit monitoring model obtains the final competitor profit monitoring model according to the optimal profit solution, outputs the profit value, and realizes drug flow profit monitoring.
7. The method for intelligently monitoring drug flow based on competition analysis according to claim 6, characterized in that: The S32 comprises the following steps: S321, taking the competitor profit monitoring model as the fitness function, assuming that there is a firefly population in the search space, the individual dimension of fireflies in the firefly population is g, and each firefly corresponds to a solution of the competitor profit monitoring model; after initializing the firefly population, select the first i firefly individuals, select any firefly individual from the firefly population, record it as a random firefly individual, and calculate the i The Euclidean distance between individual fireflies and random fireflies is used to obtain the initial distance. The light absorption coefficient is set to , the firefly attraction coefficient is , then i The formula for calculating the attractiveness of a firefly is as follows: ; in, Indicates i The individual attraction of fireflies p represents the initial distance, e represents a constant; Set i The initial position of each firefly is , the initial position of a random firefly individual is , Represents a random number between [0, 1], for the i The initial position of each firefly is updated, and the calculation formula is as follows: ; Set the current number of iterations to h , random number Continuously iterate and update, set the h Iteration random number , No. h +1 random number iteration ; S322, with the i The initial position of each firefly is updated to find the current optimal position of the firefly. h The optimal solution of the competitor profit monitoring model is obtained by iterating the global optimal guide to generate mutations in the firefly population. It is set to select any firefly individual in the firefly population, denoted as the first firefly individual and the second firefly individual, and the random coefficients are and , the mutation vector calculation formula is as follows: ; in, Indicates i The mutation vector of each firefly individual, Indicates the position of the first firefly individual, represents the position of the second firefly individual, Indicates the current optimal individual position of fireflies; The firefly population updates its position according to the mutation vector, calculates the best fitness function value of the current iteration, and compares the best fitness function value of the current iteration with the best fitness function value of the previous iteration, and selects the current best fitness function value. At this time, the firefly individual corresponding to the current best fitness function value is the optimal solution of the competitor profit monitoring model; S323, set the maximum number of iterations to H In the continuous iteration process, the individual positions of fireflies are continuously updated, and the optimal firefly individual is selected as the initial firefly population for the next iteration. At the same time, the optimal fitness function value is continuously updated until the current iteration number reaches the maximum iteration number, and the iteration is stopped to obtain the first i The final position of each firefly individual, and the optimal profit solution is obtained at the final position.
8. The method for intelligently monitoring drug flow based on competition analysis according to claim 7, characterized in that: The S4 comprises the following steps: S41, using principal component analysis to perform factor analysis on the loss-making drug flow data set to obtain principal components, and combining the principal components to obtain a loss-making drug flow data sample set; S42, selecting j loss-making drug flow data samples for each sub-indicator in the loss-making drug flow data sample set, and then performing normalization processing to form a training sample set and a training test set respectively, inputting the training sample set into the BP neural network, starting the BP neural network learning, and continuously iterating until the BP neural network converges to obtain a trained BP neural network; Then the training test set is input into the trained BP neural network, and the accuracy threshold is set. When the accuracy of the output result is less than the accuracy threshold, the iteration is stopped to obtain the BP neural network early warning model, otherwise the weight is adjusted until the accuracy of the output result is less than the accuracy threshold; Input the new loss-making drug flow data set into the BP neural network early warning model, output the early warning result, and set the early warning threshold. When the early warning result is less than the early warning threshold, the drug has a slight loss, otherwise the drug has a severe loss, and the drug flow loss monitoring is completed.
9. A system for implementing the intelligent drug flow monitoring method based on competition analysis as claimed in any one of claims 1 to 8, characterized in that: Specifically include: Drug flow data anomaly identification module, drug flow data clustering module, drug flow profit monitoring module and drug flow loss monitoring module; The drug flow data anomaly identification module is used to identify and delete abnormal data of competitor drug flow data based on time series; The drug flow data clustering module is used to perform secondary clustering on the processed competitor drug flow data using an improved clustering algorithm; The drug flow profit monitoring module is used to establish a monitoring model and use an improved firefly optimization algorithm to solve the optimal solution of the monitoring model; The drug flow loss monitoring module is used to train a BP neural network early warning model to perform loss monitoring on drug flow data.