Intelligent supervision method and system for whole process of network drug sales
By hash encryption and blockchain storage of online drug sales information, combining LSTM and MLP neural networks for timing prediction, and deploying smart contracts, the regulatory challenges and risks in online drug sales are solved, and the security, transparency and supply chain management of drug sales information are optimized.
Patent Information
- Application Number
- CN202510313046.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-04-15
AI Technical Summary
Online drug sales bring about regulatory challenges and potential risks in drug quality assurance, circulation transparency and complex supply chains, and an effective full-process intelligent supervision method is needed.
The hash function is used to encrypt and store the information of online drug sales on the blockchain. Time sequence prediction is performed by combining neural networks with LSTM and MLP, and hyperparameters are optimized to obtain models that predict drug sales prices, sales volumes, and inventory. At the same time, obtain the abnormal detection value of data points in the blockchain, calculate the risk probability, and deploy smart contracts to automatically trigger the abnormal flag and alarm signals.
The security and transparency of drug sales information are realized, accurate timing prediction is carried out through deep learning algorithms, supply chain management is optimized, real-time and automated monitoring is ensured, management transparency and system efficiency are improved, and abnormal online drug sales transactions are effectively supervised.
Smart Images

Figure CN119831606A_ABST
Abstract
Description
Technical Field
[0001] The present invention proposes a method and system for intelligently supervising the entire process of online drug sales, and relates to the technical field of online drug sales supervision. Background Art
[0002] In modern society, with the popularization of the Internet and the rapid development of e-commerce, online drug sales have become one of the important ways of drug circulation. The rise of this sales model, while providing convenience and wider access to drugs, also brings a series of regulatory challenges and potential risks. These challenges include drug quality assurance, drug circulation, and transparency issues in complex supply chains. Therefore, it is particularly important to establish an effective intelligent supervision method for the entire process of online drug sales. Summary of the invention
[0003] The present invention provides a method and system for intelligent supervision of the entire process of online drug sales to solve the above-mentioned problems: The present invention proposes a method for intelligently supervising the entire process of online drug sales, the method comprising: Use hash functions to encrypt online drug sales information, and store the encrypted online drug sales information on the blockchain; By extracting and integrating drug sales and contextual data from blockchain and external databases of blockchain, applying a neural network combining LSTM and MLP for time series prediction, optimizing hyperparameters, verifying and evaluating model performance, a neural network model for predicting drug sales price, sales volume and inventory is obtained. The normal thresholds of predicted price, predicted sales volume and predicted inventory of drugs sold online are obtained through the neural network model. Obtain anomaly detection values of data points in the blockchain, and calculate the risk probability of the data points in the blockchain based on the anomaly detection values; A smart contract is deployed, and an abnormal mark is automatically triggered when the risk probability exceeds a second preset threshold. The smart contract detects the online drug sales data stored on the blockchain in real time and generates an alarm signal.
[0004] Furthermore, the online drug sales information is encrypted using a hash function, and the encrypted online drug sales information is stored on the blockchain, including: Collect online drug sales information, including: drug production information, drug storage information, drug transportation information and drug sales information. The drug production information includes the production batch of the drug and the source of the raw materials of the drug. The drug storage information includes: drug inventory, drug storage temperature, drug storage humidity and drug storage light intensity. The drug transportation information includes: drug transportation time, drug transportation route and location, and drug transportation handler. The drug sales information includes: drug name, drug sales price, drug sales volume, drug sales platform and purchaser information. Prescription drug sales information also includes electronic prescriptions submitted by users and information on pharmacists who review prescriptions. The collected online drug sales information is encrypted using the hash function SHA-256 to generate a hash value of a fixed length, which serves as a summary of the online drug sales information; The encrypted hash value and the related online drug sales information are constructed into a block, wherein the block header includes a version number, a hash value of the previous block and a current timestamp, and the block body includes specific online drug sales information; Through the consensus mechanism of the blockchain network, which includes proof of work (PoW) and proof of stake (PoS), the validity of the new block storing the online drug sales information is verified and linked to the blockchain.
[0005] Furthermore, by extracting and integrating drug sales and contextual data from blockchain and external databases of blockchain, applying a neural network combining LSTM and MLP for time series prediction, optimizing hyperparameters, verifying and evaluating model performance, a neural network model for predicting drug sales price, sales volume and inventory is obtained. The normal thresholds of predicted price, predicted sales volume and predicted inventory of drugs sold online are obtained through the neural network model, including: Obtaining relevant sales data of block data on the blockchain, the relevant sales data including: drug price, drug sales, drug inventory and timestamp, obtaining relevant context data of drug sales, the relevant context data including: promotion activities, market trends and seasonal factors, the seasonal factors including whether it is a holiday and climate change, the relevant context data is stored in an external database combined with the blockchain; Extract useful features from drug prices, drug sales and drug inventory in block data, including long-term and short-term time tags and lag features, and introduce sliding window technology to integrate relevant sales data, relevant context data and useful features to generate a time series data set; Select the LSTM neural network model suitable for time series data and combine it with the MLP structure to enhance the capture of nonlinear features; Determine the number of layers and nodes in each layer of the neural network model, select the activation function ReLU, select the loss function as mean square error, and the optimizer as Adam; The time series data set is divided into a training set, a validation set, and a test set, wherein the split ratios of the training set, the validation set, and the test set are 70%, 15%, and 15%; Using the training set to train the neural network model, and using grid search to optimize the hyperparameters of the neural network model, the hyperparameters including the learning rate and the batch size; Test the model performance on the validation set, adjust the model parameters, and use the test set for final performance evaluation to ensure the generalization ability of the model; Select indicators to evaluate model performance, the indicators include: mean square error, root mean square error and mean absolute error, when the indicator is less than a preset threshold, a trained neural network model is obtained; Use the trained model to predict future data points and obtain normal thresholds for predicted prices, predicted sales, and predicted inventory of drugs sold online.
[0006] Furthermore, an anomaly detection value of a data point in the blockchain is obtained, and the risk probability of the data point in the blockchain is calculated based on the anomaly detection value, including: Get the price anomaly detection value of online-sold drugs: , where x p represents the actual price of drugs sold online, T p represents the price prediction threshold of online-sold drugs; Get the sales volume anomaly detection value of online drug sales: , where y t represents the actual sales volume of drugs sold online, T s represents the sales volume prediction threshold of online-sold drugs; Get the inventory anomaly detection value of online sales drugs: , where x i represents the actual inventory of drugs sold online, T i represents the inventory forecast threshold for online-sold drugs; Get the comprehensive anomaly score for the data point based on the above calculated values: , where A(x) represents the comprehensive anomaly score, , where p jk represents the distribution probability of all attributes j of online sales of drugs, p ik represents the probability that the current attribute i of online-sold drugs is in the kth interval. All attributes of online-sold drugs include: price, sales volume, and inventory. m is the number of intervals into which the attribute value is divided. Calculate the risk probability results based on the comprehensive abnormality score: , where R(x) represents the risk probability value.
[0007] Furthermore, a smart contract is deployed to automatically trigger an abnormal flag when the risk probability exceeds a second preset threshold value. The smart contract detects the online drug sales data stored on the blockchain in real time and generates an alarm signal, including: Deploy a smart contract, wherein the smart contract obtains a risk probability value; The smart contract automatically triggers an abnormal flag when the risk probability value exceeds a second preset threshold, generates an alarm signal, and reminds relevant personnel to review abnormal online drug sales transactions.
[0008] The present invention proposes an intelligent supervision system for the entire process of online drug sales, the system comprising: The encryption module is used to encrypt the online drug sales information using a hash function and store the encrypted online drug sales information on the blockchain; Training online drug sales prediction model module, which is used to extract and integrate drug sales and context data from blockchain and external databases of blockchain, apply LSTM and MLP combined neural network for time series prediction, optimize hyperparameters, verify and evaluate model performance, so as to obtain a neural network model for predicting drug sales price, sales volume and inventory, and obtain normal thresholds of predicted price, predicted sales volume and predicted inventory of online sales drugs through the neural network model; A risk probability calculation module is used to obtain anomaly detection values of data points in the blockchain and calculate the risk probability of data points in the blockchain based on the anomaly detection values; The exception triggering module is used to deploy a smart contract and set an exception mark to be automatically triggered when the risk probability exceeds a second preset threshold. The smart contract detects the online drug sales data stored on the blockchain in real time and generates an alarm signal.
[0009] Furthermore, the encryption uplink module includes: A module for collecting online drug sales information is used to collect online drug sales information, wherein the online drug sales information includes: drug production information, drug storage information, drug transportation information and drug sales information. The drug production information includes the production batch of the drug and the source of the raw materials of the drug. The drug storage information includes: drug inventory, drug storage temperature, drug storage humidity and drug storage light intensity. The drug transportation information includes: drug transportation time, drug transportation route and location and drug transportation handler. The drug sales information includes: drug name, drug sales price, drug sales volume, drug sales platform and purchaser information. The prescription drug sales information also includes the electronic prescription submitted by the user and the pharmacist information who reviews the prescription. A hash value generation module is used to encrypt the collected online drug sales information using the hash function SHA-256 to generate a hash value of a fixed length, and the hash value serves as a summary of the online drug sales information; A block building module is used to build a block from the encrypted hash value and related online drug sales information, wherein the block header includes a version number, a hash value of a previous block and a current timestamp, and the block body includes specific online drug sales information; The link module is used to verify the validity of the new block storing the online drug sales information and link it to the blockchain through the consensus mechanism of the blockchain network, which consensus mechanism includes proof of work PoW and proof of stake PoS.
[0010] Furthermore, the training network drug sales prediction model module includes: A module for obtaining relevant data is used to obtain relevant sales data of block data on the blockchain, the relevant sales data including: drug price, drug sales, drug inventory and timestamp, and obtain relevant context data of drug sales, the relevant context data including: promotion activities, market trends and seasonal factors, the seasonal factors including whether it is a holiday and climate change, and the relevant context data is stored in an external database combined with the blockchain; Generate a dataset module, which is used to extract useful features from the drug price, drug sales volume and drug inventory of the block data. The useful features include: long-term and short-term time tags and lag features. The sliding window technology is introduced to integrate the relevant sales data, relevant context data and useful features to generate a time series dataset. The model selection module is used to select the LSTM neural network model suitable for time series data and combine it with the multi-layer perceptron MLP structure to enhance the capture of nonlinear features; Initially build a model module to determine the number of layers and nodes in each layer of the neural network model, select the activation function ReLU, select the loss function as mean square error, and the optimizer as Adam; A data set partitioning module is used to divide the time series data set into a training set, a validation set, and a test set, wherein the split ratios of the training set, the validation set, and the test set are 70%, 15%, and 15%; A training module, used to train a neural network model using a training set, and to optimize hyperparameters of the neural network model using a grid search, wherein the hyperparameters include a learning rate and a batch size; The evaluation module is used to test the model performance on the validation set, adjust the model parameters, and use the test set for final performance evaluation to ensure the generalization ability of the model; Obtaining the final model module, which is used to select indicators to evaluate model performance, the indicators include: mean square error, root mean square error and mean absolute error. When the indicator is less than a preset threshold, a trained neural network model is obtained; The prediction module is used to use the trained model to predict future data points and obtain the normal thresholds of predicted price, predicted sales volume and predicted inventory of drugs sold online.
[0011] Furthermore, the risk probability calculation module includes: The module for obtaining price anomaly detection values is used to obtain price anomaly detection values of drugs sold online: , where x p represents the actual price of drugs sold online, T p represents the price prediction threshold of online-sold drugs; The module for obtaining sales anomaly detection values is used to obtain sales anomaly detection values of online-sold drugs: , where y t represents the actual sales volume of drugs sold online, T s represents the sales volume prediction threshold of online-sold drugs; The module for obtaining abnormal inventory detection values is used to obtain abnormal inventory detection values of online-sold drugs: , where x i represents the actual inventory of drugs sold online, T i represents the inventory forecast threshold for online sales of medicines; Get the anomaly score module, and get the comprehensive anomaly score of the data point based on the above calculated value: , where A(x) represents the comprehensive anomaly score, , where p jk represents the distribution probability of all attributes j of online sales of drugs, p ik represents the probability that the current attribute i of online-sold drugs is in the kth interval. All attributes of online-sold drugs include: price, sales volume, and inventory. m is the number of intervals into which the attribute value is divided. The risk probability calculation result module is used to calculate the risk probability result based on the comprehensive anomaly score: , where R(x) represents the risk probability value.
[0012] Furthermore, the triggering exception module includes: A contract deployment module is used to deploy a smart contract, and the smart contract obtains a risk probability value; The module for reminding and reviewing abnormal transactions is used for the smart contract to automatically trigger an abnormal mark when the risk probability value exceeds a second preset threshold, generate an alarm signal, and remind relevant personnel to review abnormal online drug sales transactions.
[0013] The beneficial effects of the present invention are as follows: data security is improved, the integrity and privacy protection of drug sales information are achieved through hash encryption and blockchain storage, and data tampering or leakage is prevented; the deep learning algorithms combined with LSTM and MLP can perform accurate time series predictions to help optimize drug supply chain management; real-time and automated monitoring, the application of smart contracts ensures real-time monitoring and alerts for abnormal transactions or risk events, thereby quickly responding to potential threats or problems; management transparency is improved, the transparent nature of blockchain enhances the credibility of the system, and stakeholders can verify and track through public on-chain data; system efficiency is optimized, reducing the need for manual monitoring and manual error handling, and improving the efficiency and response speed of the overall system operation; by applying the above technical solutions, companies can manage drug sales more intelligently, improve operational efficiency, effectively supervise abnormal network drug sales transactions, and maintain a competitive advantage in the market. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is a schematic diagram of a method for intelligently supervising the entire process of online drug sales described in the present invention. DETAILED DESCRIPTION
[0015] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0016] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than 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.
[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0018] One embodiment of the present invention provides a method for intelligently supervising the entire process of online drug sales, the method comprising: Use hash functions to encrypt online drug sales information, and store the encrypted online drug sales information on the blockchain; By extracting and integrating drug sales and contextual data from blockchain and external databases of blockchain, applying a neural network combining LSTM and MLP for time series prediction, optimizing hyperparameters, verifying and evaluating model performance, a neural network model for predicting drug sales price, sales volume and inventory is obtained. The normal thresholds of predicted price, predicted sales volume and predicted inventory of drugs sold online are obtained through the neural network model. Obtain anomaly detection values of data points in the blockchain, and calculate the risk probability of the data points in the blockchain based on the anomaly detection values; A smart contract is deployed, and an abnormal mark is automatically triggered when the risk probability exceeds a second preset threshold. The smart contract detects the online drug sales data stored on the blockchain in real time and generates an alarm signal.
[0019] The working principle and effect of the above technical solution are as follows: before storing drug sales information in the blockchain, the data is encrypted using a hash function. Hash encryption ensures the integrity and privacy of the data, and provides a unique identifier to verify the authenticity of the data; using the decentralized and tamper-proof characteristics of the blockchain, the encrypted drug sales information is stored on the blockchain to ensure the security and openness and transparency of the data; combining the drug sales information in the blockchain and the contextual data in the external database (such as market trends, historical sales data, etc.) to build a data set for time series prediction; using the deep neural network model constructed by combining LSTM (Long Short-Term Memory Network) and MLP (Multi-layer Perceptron) to perform time series prediction on drug sales prices, sales volume and inventory. The model further improves performance through hyperparameter optimization; based on the results predicted by the neural network model, the normal thresholds of drug prices, sales volume and inventory are defined; monitoring the abnormal detection values of data points in the blockchain, and calculating the risk probability of each data point. If the probability exceeds the set warning threshold, the data point is marked as abnormal; smart contracts are deployed on the blockchain to monitor sales data in real time; when the risk probability exceeds the second preset threshold, the contract automatically triggers the abnormal mark and alarm signal, and the alarm signal is sent to relevant personnel through the contract mechanism for rapid response and processing. Data security is improved, and the integrity and privacy protection of drug sales information are achieved through hash encryption and blockchain storage to prevent data tampering or leakage; combined with the deep learning algorithms of LSTM and MLP, accurate time series prediction can be performed to help optimize drug supply chain management; real-time and automated monitoring, the application of smart contracts ensures real-time monitoring and alarms for abnormal transactions or risk events, so as to quickly respond to potential threats or problems; management transparency is improved, and the transparent characteristics of blockchain enhance the credibility of the system, and stakeholders can verify and track through public on-chain data; system efficiency is optimized, reducing the need for manual monitoring and manual error handling, and improving the efficiency and response speed of the overall operation of the system; by applying the above technical solutions, enterprises can manage drug sales more intelligently, improve operational efficiency, effectively supervise abnormal network drug sales transactions, and maintain competitive advantages in the market.
[0020] One embodiment of the present invention is a method for intelligently supervising the entire process of online drug sales, which uses a hash function to encrypt online drug sales information and stores the encrypted online drug sales information on a blockchain, including: Collect online drug sales information, including: drug production information, drug storage information, drug transportation information and drug sales information. The drug production information includes the production batch of the drug and the source of the raw materials of the drug. The drug storage information includes: drug inventory, drug storage temperature, drug storage humidity and drug storage light intensity. The drug transportation information includes: drug transportation time, drug transportation route and location, and drug transportation handler. The drug sales information includes: drug name, drug sales price, drug sales volume, drug sales platform and purchaser information. Prescription drug sales information also includes electronic prescriptions submitted by users and information on pharmacists who review prescriptions. The collected online drug sales information is encrypted using the hash function SHA-256 to generate a hash value of a fixed length, which serves as a summary of the online drug sales information; The encrypted hash value and the related online drug sales information are constructed into a block, wherein the block header includes a version number, a hash value of the previous block and a current timestamp, and the block body includes specific online drug sales information; Through the consensus mechanism of the blockchain network, which includes proof of work (PoW) and proof of stake (PoS), the validity of the new block storing the online drug sales information is verified and linked to the blockchain.
[0021] The working principle and effect of the above technical solution are as follows: Collect comprehensive online drug sales information, including information on multiple stages such as production, warehousing, transportation and sales, to ensure coverage of the entire supply chain; Correspond to specific data items, such as drug production batches, raw material sources, storage conditions (temperature, humidity, light), transportation process (time, route, handling party), and sales information (price, sales volume, platform, prescription, etc.); Use the SHA-256 hash function to encrypt the collected drug sales information and generate a fixed-length hash value as a summary of the data. The hash value provides a method for data integrity verification, and any data changes will cause changes in the hash value; The encrypted hash value and the original drug sales information are combined into a new block. The block header contains the version number, the hash value of the previous block and the current timestamp to ensure the position of the block in the chain and the previous and next associations. The block body stores the actual drug sales information, and structures these data for subsequent traceability and review. Through the consensus mechanism, the validity of the new block is verified. Consensus algorithms such as proof of work (PoW) and proof of stake (PoS) ensure the security and fairness of the verification and addition process of the block. After the verification is passed, the new block is linked to the existing blockchain to form an unchangeable data chain. Hash function encryption ensures the integrity of the data, that is, information tampering can be quickly detected. The decentralized storage and tamper-proof nature of the blockchain provide a high degree of security to prevent data from being accessed or modified without authorization; transparency and traceability, through the blockchain, whether it is the production or circulation of drugs, all the information involved can be publicly traced on the chain, improving the transparency of the drug supply chain; using the consensus mechanism (PoW and PoS), the new block must be verified by the network nodes to ensure the authenticity and legality of the data, and build a record system that all participants can trust; consensus mechanisms such as PoS are more efficient in resource consumption than PoW, bringing sustainability and low energy consumption advantages to the operation of the entire system; it can achieve safe storage and efficient management of online drug sales information, while improving information transparency and trust in the supply chain. This is of great significance for reducing the risk of counterfeit drugs and enhancing user confidence.
[0022] In one embodiment of the present invention, by extracting and integrating drug sales and context data from blockchain and external databases of blockchain, applying a neural network combining LSTM and MLP to perform time series prediction, optimizing hyperparameters, verifying and evaluating model performance, a neural network model for predicting drug sales price, sales volume and inventory is obtained, and normal thresholds for predicted price, predicted sales volume and predicted inventory of drugs sold online are obtained through the neural network model, including: Obtaining relevant sales data of block data on the blockchain, the relevant sales data including: drug price, drug sales, drug inventory and timestamp, obtaining relevant context data of drug sales, the relevant context data including: promotion activities, market trends and seasonal factors, the seasonal factors including whether it is a holiday and climate change, the relevant context data is stored in an external database combined with the blockchain; Extract useful features from drug prices, drug sales and drug inventory in block data, including long-term and short-term time tags and lag features, and introduce sliding window technology to integrate relevant sales data, relevant context data and useful features to generate a time series data set; Select the LSTM neural network model suitable for time series data and combine it with the MLP structure to enhance the capture of nonlinear features; Determine the number of layers and nodes in each layer of the neural network model, select the activation function ReLU, select the loss function as mean square error, and the optimizer as Adam; The time series data set is divided into a training set, a validation set, and a test set, wherein the split ratios of the training set, the validation set, and the test set are 70%, 15%, and 15%; Using the training set to train the neural network model, and using grid search to optimize the hyperparameters of the neural network model, the hyperparameters including the learning rate and the batch size; Test the model performance on the validation set, adjust the model parameters, and use the test set for final performance evaluation to ensure the generalization ability of the model; Select indicators to evaluate model performance, the indicators include: mean square error, root mean square error and mean absolute error, when the indicator is less than a preset threshold, a trained neural network model is obtained; Use the trained model to predict future data points and obtain normal thresholds for predicted prices, predicted sales, and predicted inventory of drugs sold online.
[0023] The working principle and effect of the above technical solution are as follows: data acquisition and integration, blockchain data extraction, extracting information such as drug prices, drug sales, drug inventory and timestamps from the blockchain; context data collection, obtaining context data of drug sales from an external database combined with the blockchain, including promotional activities, market trends, seasonal factors (such as holidays and climate change); data processing and feature extraction, feature extraction, including extracting features suitable for time series analysis from the above data, such as long-term and short-term time tags and lag features; integrating the extracted features with context information through sliding window technology to form a time series data set, which helps capture time dependencies and trends; selecting LSTM neural networks suitable for time series data, combined with MLP (multi-layer perceptron) to enhance Capture nonlinear features; determine the number of network layers and the number of nodes in each layer, use the ReLU activation function, the mean square error as the loss function, and Adam as the optimizer; divide the data set into training set, validation set, and test set, with an allocation ratio of 70%, 15%, and 15%, use the training set to train the model, and optimize the hyperparameters (such as learning rate and batch size) through grid search to improve model performance; test the model performance on the validation set, adjust the model parameters, and finally use the test set to evaluate the generalization ability; use indicators such as mean square error, root mean square error, and mean absolute error to evaluate the model, and ensure that all indicators are less than the preset thresholds to confirm the effectiveness of the model; use the trained model to predict drug sales data at future time points and generate normal thresholds for predicting prices, sales, and inventory. Data-driven decision support provides reliable forecasts of drug prices, sales and inventory, helping companies make more accurate market decisions and resource management; improves supply chain efficiency, enhances inventory management through predicted normal thresholds, and reduces the risk of overstorage and shortages in the supply chain; uses a combination of LSTM and MLP models to improve the ability to capture nonlinear relationships between complex time series data and provide more accurate forecasts; integrates contextual data to enable the solution to adapt to market changes such as promotions, holidays, etc., and maintain the adaptability of the model in a dynamic market environment; uses sales data recorded in blockchain to help improve the reliability and transparency of information and effectively prevent data manipulation; through the combination of deep learning and blockchain technology, it provides an efficient forecasting tool for online drug sales, supports data-driven strategy formulation, promotes business optimization and growth, and helps improve the accuracy of identifying abnormal transactions in online drug sales.
[0024] In one embodiment of the present invention, an abnormality detection value of a data point in a blockchain is obtained, and a risk probability of the data point in the blockchain is calculated based on the abnormality detection value, including: Get the price anomaly detection value of online-sold drugs: , where x p represents the actual price of drugs sold online, T prepresents the price prediction threshold of online-sold drugs; Get the sales volume anomaly detection value of online drug sales: , where y t represents the actual sales volume of drugs sold online, T s represents the sales volume prediction threshold of online-sold drugs; Get the inventory anomaly detection value of online sales drugs: , where x i represents the actual inventory of drugs sold online, T i represents the inventory forecast threshold for online sales of medicines; Get the comprehensive anomaly score for the data point based on the above calculated values: , where A(x) represents the comprehensive anomaly score, , where p jk represents the distribution probability of all attributes j of online sales of drugs, p ik represents the probability that the current attribute i of online-sold drugs is in the kth interval. All attributes of online-sold drugs include: price, sales volume, and inventory. m is the number of intervals into which the attribute value is divided. Calculate the risk probability results based on the comprehensive abnormality score: , where R(x) represents the risk probability value.
[0025] When calculating the weight of price (i=1), the p in the numerator ik :Specifically p 11 , p 12 , ..., p 110 , that is, the probability that the price is in the 10 intervals, the p in the denominator jk : The probability of including all attributes, that is, p 11 , p 12 , ..., p 110 (price), p 21 , p 22 , ..., p 210 (sales volume), p 31 , p 32 , ..., p 310 (in stock).
[0026] The working principle and effect of the above technical solution are as follows: by combining the anomaly detection value with the overall situation, the solution can more accurately identify abnormal data points that may indicate problems or risks; the comprehensive anomaly scoring method provides an integrated risk perspective involving multiple aspects such as price, sales volume and inventory, helping to comprehensively assess sales risks; achieving real-time calculation and updating of anomaly detection values and risk probabilities, helping to quickly respond to market fluctuations and inventory changes, and take timely measures; providing decision support based on clear data indicators to help business managers optimize inventory management and sales strategies and reduce losses and waste; through the combination of mathematical formulas and machine learning methods, a set of continuous and precise risk management tools is provided, which is particularly suitable for pharmaceutical supply chains and sales scenarios that require frequent adjustments and forecasts, and helps to improve the accuracy of identifying abnormal transactions in online drug sales.
[0027] In one embodiment of the present invention, a smart contract is deployed to automatically trigger an abnormal flag when the risk probability exceeds a second preset threshold value. The smart contract detects online drug sales data stored on the blockchain in real time and generates an alarm signal, including: Deploy a smart contract, wherein the smart contract obtains a risk probability value; The smart contract automatically triggers an abnormal flag when the risk probability value exceeds a second preset threshold, generates an alarm signal, and reminds relevant personnel to review abnormal online drug sales transactions.
[0028] One embodiment of the present invention is a full-process intelligent supervision system for online drug sales, the system comprising: The encryption module is used to encrypt the online drug sales information using a hash function and store the encrypted online drug sales information on the blockchain; Training online drug sales prediction model module, which is used to extract and integrate drug sales and context data from blockchain and external databases of blockchain, apply LSTM and MLP combined neural network for time series prediction, optimize hyperparameters, verify and evaluate model performance, so as to obtain a neural network model for predicting drug sales price, sales volume and inventory, and obtain normal thresholds of predicted price, predicted sales volume and predicted inventory of online sales drugs through the neural network model; A risk probability calculation module is used to obtain anomaly detection values of data points in the blockchain and calculate the risk probability of data points in the blockchain based on the anomaly detection values; The exception triggering module is used to deploy a smart contract and set an exception mark to be automatically triggered when the risk probability exceeds a second preset threshold. The smart contract detects the online drug sales data stored on the blockchain in real time and generates an alarm signal.
[0029] In one embodiment of the present invention, the encryption uplink module includes: A module for collecting online drug sales information is used to collect online drug sales information, wherein the online drug sales information includes: drug production information, drug storage information, drug transportation information and drug sales information. The drug production information includes the production batch of the drug and the source of the raw materials of the drug. The drug storage information includes: drug inventory, drug storage temperature, drug storage humidity and drug storage light intensity. The drug transportation information includes: drug transportation time, drug transportation route and location and drug transportation handler. The drug sales information includes: drug name, drug sales price, drug sales volume, drug sales platform and purchaser information. The prescription drug sales information also includes the electronic prescription submitted by the user and the pharmacist information who reviews the prescription. A hash value generation module is used to encrypt the collected online drug sales information using the hash function SHA-256 to generate a hash value of a fixed length, and the hash value is used as a summary of the online drug sales information; A block building module is used to build the encrypted hash value and related online drug sales information into a block, wherein the block header includes a version number, a hash value of a previous block and a current timestamp, and the block body includes specific online drug sales information; The link module is used to verify the validity of the new block storing the online drug sales information and link it to the blockchain through the consensus mechanism of the blockchain network, which includes proof of work (PoW) and proof of stake (PoS).
[0030] In one embodiment of the present invention, the training network drug sales prediction model module includes: A module for obtaining relevant data is used to obtain relevant sales data of block data on the blockchain, the relevant sales data including: drug price, drug sales, drug inventory and timestamp, and obtain relevant context data of drug sales, the relevant context data including: promotion activities, market trends and seasonal factors, the seasonal factors including whether it is a holiday and climate change, and the relevant context data is stored in an external database combined with the blockchain; Generate a dataset module, which is used to extract useful features from the drug price, drug sales volume and drug inventory of the block data, including long-term and short-term time tags and lag features, and introduce a sliding window technology to integrate relevant sales data, relevant context data and useful features to generate a time series dataset; The model selection module is used to select the LSTM neural network model suitable for time series data and combine it with the multi-layer perceptron MLP structure to enhance the capture of nonlinear features; Initially build a model module to determine the number of layers and nodes in each layer of the neural network model, select the activation function ReLU, select the loss function as mean square error, and the optimizer as Adam; A data set partitioning module is used to divide the time series data set into a training set, a validation set, and a test set, wherein the split ratios of the training set, the validation set, and the test set are 70%, 15%, and 15%; A training module, used to train a neural network model using a training set, and to optimize hyperparameters of the neural network model using a grid search, wherein the hyperparameters include a learning rate and a batch size; The evaluation module is used to test the model performance on the validation set, adjust the model parameters, and use the test set for final performance evaluation to ensure the generalization ability of the model; Obtaining the final model module, which is used to select indicators to evaluate model performance, the indicators include: mean square error, root mean square error and mean absolute error. When the indicator is less than a preset threshold, a trained neural network model is obtained; The prediction module is used to use the trained model to predict future data points and obtain the normal thresholds of predicted price, predicted sales volume and predicted inventory of drugs sold online.
[0031] In one embodiment of the present invention, the risk probability calculation module includes: The module for obtaining price anomaly detection values is used to obtain price anomaly detection values of drugs sold online: , where x p represents the actual price of drugs sold online, T p represents the price prediction threshold of online-sold drugs; The module for obtaining sales anomaly detection values is used to obtain sales anomaly detection values of online-sold drugs: , where y t represents the actual sales volume of drugs sold online, T s represents the sales volume prediction threshold of online-sold drugs; The module for obtaining abnormal inventory detection values is used to obtain abnormal inventory detection values of online-sold drugs: , where x i represents the actual inventory of drugs sold online, T i represents the inventory forecast threshold for online-sold drugs; Get the anomaly score module, and get the comprehensive anomaly score of the data point based on the above calculated value: , where A(x) represents the comprehensive anomaly score, , where p jk represents the distribution probability of all attributes j of online sales of drugs, p ik represents the probability that the current attribute i of online-sold drugs is in the kth interval. All attributes of online-sold drugs include: price, sales volume, and inventory. m is the number of intervals into which the attribute value is divided. The risk probability calculation result module is used to calculate the risk probability result based on the comprehensive anomaly score: , where R(x) represents the risk probability value.
[0032] In one embodiment of the present invention, the abnormality triggering module includes: A contract deployment module is used to deploy a smart contract, and the smart contract obtains a risk probability value; The module for reminding and reviewing abnormal transactions is used for the smart contract to automatically trigger an abnormal mark when the risk probability value exceeds a second preset threshold, generate an alarm signal, and remind relevant personnel to review abnormal online drug sales transactions.
[0033] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for intelligent supervision of the entire process of online drug sales, characterized in that: The method comprises: Use hash functions to encrypt online drug sales information, and store the encrypted online drug sales information on the blockchain; By extracting and integrating drug sales and contextual data from blockchain and external databases of blockchain, applying a neural network combining LSTM and MLP for time series prediction, optimizing hyperparameters, verifying and evaluating model performance, a neural network model for predicting drug sales price, sales volume and inventory is obtained. The normal thresholds of predicted price, predicted sales volume and predicted inventory of drugs sold online are obtained through the neural network model. Obtain anomaly detection values of data points in the blockchain, and calculate the risk probability of the data points in the blockchain based on the anomaly detection values; A smart contract is deployed, and an abnormal mark is automatically triggered when the risk probability exceeds a second preset threshold. The smart contract detects the online drug sales data stored on the blockchain in real time and generates an alarm signal.
2. According to claim 1, a method for intelligent supervision of the entire process of online drug sales is characterized in that: The online drug sales information is encrypted using a hash function and stored on the blockchain, including: Collect online drug sales information, including: drug production information, drug storage information, drug transportation information and drug sales information. The drug production information includes the production batch of the drug and the source of the raw materials of the drug. The drug storage information includes: drug inventory, drug storage temperature, drug storage humidity and drug storage light intensity. The drug transportation information includes: drug transportation time, drug transportation route and location, and drug transportation handler. The drug sales information includes: drug name, drug sales price, drug sales volume, drug sales platform and purchaser information. Prescription drug sales information also includes electronic prescriptions submitted by users and information on pharmacists who review prescriptions. The collected online drug sales information is encrypted using the hash function SHA-256 to generate a hash value of a fixed length, which serves as a summary of the online drug sales information; The encrypted hash value and the related online drug sales information are constructed into a block, wherein the block header of the block includes a version number, a hash value of the previous block and a current timestamp, and the block body of the block includes specific online drug sales information; Through the consensus mechanism of the blockchain network, which includes proof of work (PoW) and proof of stake (PoS), the validity of the new block storing the online drug sales information is verified and linked to the blockchain.
3. According to claim 1, a method for intelligent supervision of the entire process of online drug sales is characterized in that: By extracting and integrating drug sales and contextual data from blockchain and external databases of blockchain, applying a neural network combining LSTM and MLP for time series prediction, optimizing hyperparameters, verifying and evaluating model performance, a neural network model for predicting drug sales price, sales volume, and inventory is obtained. The normal thresholds for predicted price, predicted sales volume, and predicted inventory of drugs sold online are obtained through the neural network model, including: Obtaining relevant sales data of block data on the blockchain, the relevant sales data including: drug price, drug sales, drug inventory and timestamp, obtaining relevant context data of drug sales, the relevant context data including: promotion activities, market trends and seasonal factors, the seasonal factors including whether it is a holiday and climate change, the relevant context data is stored in an external database combined with the blockchain; Extract useful features from drug prices, drug sales and drug inventory in block data, including long-term and short-term time tags and lag features, and introduce sliding window technology to integrate relevant sales data, relevant context data and useful features to generate a time series data set; Select the LSTM neural network model suitable for time series data and combine it with the MLP structure to enhance the capture of nonlinear features; Determine the number of layers and nodes in each layer of the neural network model, select the activation function ReLU, select the loss function as mean square error, and the optimizer as Adam; The time series data set is divided into a training set, a validation set, and a test set, wherein the split ratios of the training set, the validation set, and the test set are 70%, 15%, and 15%; Using the training set to train the neural network model, and using grid search to optimize the hyperparameters of the neural network model, the hyperparameters including the learning rate and the batch size; Test the model performance on the validation set, adjust the model parameters, and use the test set for final performance evaluation to ensure the generalization ability of the model; Select indicators to evaluate model performance, the indicators include: mean square error, root mean square error and mean absolute error, when the indicator is less than a preset threshold, a trained neural network model is obtained; Use the trained model to predict future data points and obtain normal thresholds for predicted prices, predicted sales, and predicted inventory of drugs sold online.
4. According to claim 1, a method for intelligent supervision of the entire process of online drug sales is characterized in that: Obtain the anomaly detection value of the data point in the blockchain, and calculate the risk probability of the data point in the blockchain based on the anomaly detection value, including: Get the price anomaly detection value of online-sold drugs: , where x p represents the actual price of drugs sold online, T p represents the price prediction threshold of online-sold drugs; Get the sales volume anomaly detection value of online drug sales: , where y t represents the actual sales volume of drugs sold online, T s represents the sales volume prediction threshold of online-sold drugs; Get the inventory anomaly detection value of online sales drugs: , where x i represents the actual inventory of drugs sold online, T i represents the inventory forecast threshold for online sales of medicines; Obtain a comprehensive anomaly score for the data point based on the price anomaly detection value, the sales anomaly detection value, and the inventory anomaly detection value: , where A(x) represents the comprehensive anomaly score, , where p jk represents the distribution probability of all attributes j of online sales of drugs, p ik represents the probability that the current attribute i of online-sold drugs is in the kth interval. All attributes of online-sold drugs include: price, sales volume, and inventory. m is the number of intervals divided by the attribute value. Calculate the risk probability results based on the comprehensive abnormality score: , where R(x) represents the risk probability value.
5. According to claim 1, a method for intelligent supervision of the entire process of online drug sales is characterized in that: Deploy a smart contract and set it to automatically trigger an abnormal mark when the risk probability exceeds a second preset threshold. The smart contract detects the online drug sales data stored on the blockchain in real time and generates an alarm signal, including: Deploy a smart contract, wherein the smart contract obtains a risk probability value; The smart contract automatically triggers an abnormal flag when the risk probability value exceeds a second preset threshold, generates an alarm signal, and reminds relevant personnel to review abnormal online drug sales transactions.
6. An intelligent supervision system for the entire process of online drug sales, characterized in that: The system comprises: The encryption module is used to encrypt the online drug sales information using a hash function and store the encrypted online drug sales information on the blockchain; Training online drug sales prediction model module, which is used to extract and integrate drug sales and context data from blockchain and external databases of blockchain, apply LSTM and MLP combined neural network for time series prediction, optimize hyperparameters, verify and evaluate model performance, so as to obtain a neural network model for predicting drug sales price, sales volume and inventory, and obtain normal thresholds of predicted price, predicted sales volume and predicted inventory of online sales drugs through the neural network model; A risk probability calculation module is used to obtain anomaly detection values of data points in the blockchain and calculate the risk probability of data points in the blockchain based on the anomaly detection values; The exception triggering module is used to deploy a smart contract and set an exception mark to be automatically triggered when the risk probability exceeds a second preset threshold. The smart contract detects the online drug sales data stored on the blockchain in real time and generates an alarm signal.
7. According to claim 6, a full-process intelligent supervision system for online drug sales is characterized in that: The encryption uplink module includes: A module for collecting online drug sales information is used to collect online drug sales information, wherein the online drug sales information includes: drug production information, drug storage information, drug transportation information and drug sales information. The drug production information includes the production batch of the drug and the source of the raw materials of the drug. The drug storage information includes: drug inventory, drug storage temperature, drug storage humidity and drug storage light intensity. The drug transportation information includes: drug transportation time, drug transportation route and location and drug transportation handler. The drug sales information includes: drug name, drug sales price, drug sales volume, drug sales platform and purchaser information. The prescription drug sales information also includes the electronic prescription submitted by the user and the pharmacist information who reviews the prescription. A hash value generation module is used to encrypt the collected online drug sales information using the hash function SHA-256 to generate a hash value of a fixed length, and the hash value is used as a summary of the online drug sales information; A block building module is used to build the encrypted hash value and related online drug sales information into a block, wherein the block header includes a version number, a hash value of a previous block and a current timestamp, and the block body includes specific online drug sales information; The link module is used to verify the validity of the new block storing the online drug sales information and link it to the blockchain through the consensus mechanism of the blockchain network, which includes proof of work (PoW) and proof of stake (PoS).
8. According to claim 6, a full-process intelligent supervision system for online drug sales is characterized in that: The training network drug sales prediction model module includes: A module for obtaining relevant data is used to obtain relevant sales data of block data on the blockchain, the relevant sales data including: drug price, drug sales, drug inventory and timestamp, and obtain relevant context data of drug sales, the relevant context data including: promotion activities, market trends and seasonal factors, the seasonal factors including whether it is a holiday and climate change, and the relevant context data is stored in an external database combined with the blockchain; Generate a dataset module, which is used to extract useful features from the drug price, drug sales volume and drug inventory of the block data, including long-term and short-term time tags and lag features, and introduce a sliding window technology to integrate relevant sales data, relevant context data and useful features to generate a time series dataset; The model selection module is used to select the LSTM neural network model suitable for time series data and combine it with the multi-layer perceptron MLP structure to enhance the capture of nonlinear features; Initially build a model module to determine the number of layers and nodes in each layer of the neural network model, select the activation function ReLU, select the loss function as mean square error, and the optimizer as Adam; A data set partitioning module is used to divide the time series data set into a training set, a validation set, and a test set, wherein the split ratios of the training set, the validation set, and the test set are 70%, 15%, and 15%; A training module, used to train a neural network model using a training set, and to optimize hyperparameters of the neural network model using a grid search, wherein the hyperparameters include a learning rate and a batch size; The evaluation module is used to test the model performance on the validation set, adjust the model parameters, and use the test set for final performance evaluation to ensure the generalization ability of the model; Obtaining the final model module, which is used to select indicators to evaluate model performance, the indicators include: mean square error, root mean square error and mean absolute error. When the indicator is less than a preset threshold, a trained neural network model is obtained; The prediction module is used to use the trained model to predict future data points and obtain the normal thresholds of predicted price, predicted sales volume and predicted inventory of drugs sold online.
9. According to claim 6, a full-process intelligent supervision system for online drug sales is characterized in that: The risk probability calculation module includes: The module for obtaining price anomaly detection values is used to obtain price anomaly detection values of drugs sold online: , where x p represents the actual price of drugs sold online, T p represents the price prediction threshold of online-sold drugs; The module for obtaining sales anomaly detection values is used to obtain sales anomaly detection values of online-sold drugs: , where y t represents the actual sales volume of drugs sold online, T s represents the sales volume prediction threshold of online-sold drugs; The module for obtaining abnormal inventory detection values is used to obtain abnormal inventory detection values of online-sold drugs: , where x i represents the actual inventory of drugs sold online, T i represents the inventory forecast threshold for online sales of medicines; The abnormality score acquisition module acquires the comprehensive abnormality score of the data point based on the price abnormality detection value, the sales abnormality detection value and the inventory abnormality detection value: , where A(x) represents the comprehensive anomaly score, , where p jk represents the distribution probability of all attributes j of online sales of drugs, p ik represents the probability that the current attribute i of online-sold drugs is in the kth interval. All attributes of online-sold drugs include: price, sales volume, and inventory. m is the number of intervals into which the attribute value is divided. The risk probability calculation result module is used to calculate the risk probability result based on the comprehensive anomaly score: , where R(x) represents the risk probability value.
10. According to claim 6, a full-process intelligent supervision system for online drug sales is characterized in that: The triggering exception module includes: A deployment contract module is used to deploy a smart contract, and the smart contract obtains a risk probability value; The module for reminding and reviewing abnormal transactions is used for the smart contract to automatically trigger an abnormal mark when the risk probability value exceeds a second preset threshold, generate an alarm signal, and remind relevant personnel to review abnormal online drug sales transactions.
Citation Information
Patent Citations
Intelligent power grid load prediction method based on federated learning
CN116706888A
Drug inventory dynamic optimization method based on deep learning
CN118710194A
Knowledge graph-driven sales data multi-dimensional analysis and visualization method and system
CN119248989A
Medical supply data intelligent tracing and risk early warning system based on block chain
CN119601190A
Cited By
Medical medicine informatization management system and method based on big data
CN120338605A