Credit evaluation method and system based on medical retail terminal behavior data

CN122928496APending Publication Date: 2026-10-16SHANGYIZHILIAN (GUANGZHOU) HEALTH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611233282.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

仅依赖财务报表和历史交易等静态信息,无法及时捕捉终端经营行为的变化,导致信用评估结果存在滞后性,难以及时反映终端真实的信用风险状况

Benefits of technology

[0016]The aforementioned credit assessment method, system, computer equipment, and storage medium based on pharmaceutical retail terminal behavioral data acquire multi-source behavioral data from pharmaceutical retail terminals within a preset historical time period. This data is then cleaned and time-series aligned to obtain aligned behavioral data with a unified timeline. This achieves effective integration and standardized processing of operational data from different sources and frequencies of pharmaceutical retail terminals, overcoming the problems of single data sources and lack of quantitative modeling in traditional assessments. By extracting the temporal features of the aligned behavioral data to generate input feature vectors, which are then input into a temporal convolutional network model to obtain credit assessment scores, the modeling capability of temporal convolutional networks for long-term time-series data allows for the extraction of deep-level temporal dependencies from the terminal's operational behavior sequence. This approach enables precise quantitative assessment of terminal credit status. By acquiring actual credit event data from pharmaceutical retail terminals after credit assessment as feedback data, and based on this feedback data, an incremental learning method is used to update the parameters of the temporal convolutional network model. This method involves constructing a historical risk probe set, calculating the spatial distribution distance between the feature distribution of newly added training task samples in the model's hidden layer and the feature distribution of historical risk probe set samples in the model's hidden layer, and dynamically adjusting the weight of the historical risk probe set in the global loss function based on this spatial distribution distance. This allows the model to maintain its ability to identify key historical risk features while continuously learning from new terminal data, achieving dynamic adaptive optimization of the credit assessment model and thus improving the accuracy and timeliness of credit assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928496A_ABST
    Figure CN122928496A_ABST
Patent Text Reader

Abstract

The application relates to a credit evaluation method and system based on medical retail terminal behavior data, a computer device and a storage medium. The method comprises the following steps: acquiring multi-source behavior data of a medical retail terminal in a preset historical period, and obtaining aligned behavior data after cleaning and time sequence alignment; extracting time sequence features to generate an input feature vector, inputting the time sequence convolution network model to obtain a credit evaluation score; acquiring credit event data as feedback, and updating the model parameters in an incremental learning mode; the incremental learning mode comprises constructing a historical risk probe set, calculating the spatial distance of the feature distribution of the newly added samples and the probe set samples in the model hidden layer before each incremental update, and dynamically adjusting the weight of the probe set in the global loss function according to the distance. The application can improve the accuracy and timeliness of credit evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of credit assessment technology, and in particular to a credit assessment method, system, computer equipment and storage medium based on behavioral data from pharmaceutical retail terminals. Background Technology

[0002] Pharmaceutical retail outlets (including pharmacies, clinics, and health centers) are a core link in pharmaceutical distribution, and their creditworthiness directly affects pharmaceutical distribution companies' credit terms, credit lines, cooperation access, and risk control. As the market size of the pharmaceutical distribution industry continues to expand, pharmaceutical distribution companies have an increasingly urgent need for credit assessment of downstream retail outlets.

[0003] Currently, credit assessments of pharmaceutical retail outlets in the industry primarily rely on static information such as financial statements, historical transaction records, and manual ratings. For example, historical pharmaceutical order data from distribution clients is used to extract time-series characteristics, or client payment and sales data are collected for risk rating. These assessment methods are typically completed manually on a quarterly or annual basis, constituting a delayed assessment.

[0004] However, the actual business operations of pharmaceutical retail outlets are dynamic, with daily operational data such as purchase frequency, inventory turnover, compliance records, and medical insurance settlements constantly being generated and updated in real time. Relying solely on static information such as financial statements and historical transactions cannot capture changes in the outlets' operational behavior in a timely manner, resulting in a lag in credit assessment results and making it difficult to reflect the true credit risk status of the outlets in a timely manner. Summary of the Invention

[0005] Based on this, it is necessary to provide a credit assessment method, system, computer equipment, and storage medium for pharmaceutical retail terminal behavioral data that can perform temporal alignment and temporal convolutional network evaluation on multi-source behavioral data of pharmaceutical retail terminals, and dynamically adjust incremental learning weights based on actual credit feedback by detecting the spatial distribution offset of historical risk probe sets.

[0006] Firstly, this application provides a credit assessment method based on behavioral data from pharmaceutical retail terminals. The method includes: Acquire multi-source behavioral data of pharmaceutical retail terminals within a preset historical time period, and perform cleaning and time-series alignment processing on the multi-source behavioral data to obtain aligned behavioral data with a unified time axis; After extracting the temporal features of the alignment behavior data, an input feature vector is generated. The input feature vector is then input into a temporal convolutional network model, and the credit assessment score of the pharmaceutical retail terminal output by the temporal convolutional network model is obtained. The system acquires actual credit event data of the pharmaceutical retail terminal after credit assessment as feedback data, and updates the parameters of the temporal convolutional network model using an incremental learning approach based on the feedback data. The incremental learning approach includes: constructing a historical risk probe set composed of terminal samples from historical credit samples that meet preset risk conditions; calculating the spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the model and the feature distribution of the historical risk probe set samples in the hidden layer of the model before each incremental update; and dynamically adjusting the weight of the historical risk probe set in the global loss function based on the spatial distribution distance.

[0007] In one embodiment, the multi-source behavioral data includes: institutional compliance dimension data, transaction behavior dimension data, business behavior dimension data, market behavior dimension data, and external association dimension data.

[0008] In one embodiment, the cleaning process for the multi-source behavioral data includes: Determine whether the timestamps of each behavioral data item acquired in the current batch are valid; Invalid timestamp behavior data is marked as unavailable time series data. The business field values ​​of the unavailable time series data are extracted. The sum, mean and count of the business field values ​​are calculated for each terminal. The calculated sum, mean and count are used as static features. The static features are used to be fused with time series features in the process of generating credit assessment scores. The behavior data with valid timestamps are used as the existing sequence data. The timestamps of each behavior data in the existing sequence data are extracted. The existing sequence data is then sorted in global ascending order to obtain the sorted existing sequence data. For the sorted existing sequence data, the time interval between the timestamps of two adjacent behavioral data is detected. If the time interval is greater than a preset time threshold, a time-series missing window is marked between the two adjacent behavioral data. For behavioral data in the sorted existing sequence data that has valid timestamps but missing business field values, the following filling operation is performed: If the behavioral data has both adjacent valid forward timestamps and valid backward timestamps on the timeline, linear interpolation is performed using the business field values ​​of the valid forward timestamps and the valid backward timestamps; if only the valid forward timestamps or only the valid backward timestamps exist, the business field values ​​of the valid timestamps on the existing side are used for filling; if there are no valid timestamps from the same terminal in the sorted existing sequence data, a preset industry default value is used for filling. After the ascending sort is completed, the newly collected behavioral data in the subsequent operation of the existing sequence data will be used as incremental behavioral data. When the incremental behavior data is obtained, the adjacent preceding timestamp and adjacent following timestamp of the timestamp of the incremental behavior data are searched in the sorted existing sequence data. The first difference between the timestamp of the incremental behavior data and the adjacent preceding timestamp and the second difference between the timestamp of the incremental behavior data and the adjacent following timestamp are calculated respectively. If the first difference is negative or the second difference is positive, the incremental behavior data is determined to be time-overlapping abnormal data. For incremental behavioral data that is determined to be time-series overlapping abnormal data, a binary search algorithm is used to locate the standard insertion position of the incremental behavioral data in the sorted existing sequence data, and the incremental behavioral data is inserted into the standard insertion position.

[0009] In one embodiment, the temporal alignment processing of the multi-source behavioral data includes: Using a preset number of days as a unified time series standard, for behavioral data sequences with a time span greater than the preset number of days, redundant time series data at the end is truncated, and valid operational feature sequences at the front end are retained; for behavioral data sequences with a time span less than the preset number of days, zero padding at the end is used to pad to the preset number of days. A dynamic time warping algorithm is used to perform cross-scale feature alignment between high-frequency and low-frequency behavioral data sequences, calculating the matching path between them. The dynamic time warping algorithm employs a constraint window with a preset window radius and fixes the standardized boundary conditions as follows: ,in, Represents the cumulative distance matrix. The time-series index representing the high-frequency behavioral data sequence. The time-series index represents the low-frequency behavior data sequence; For the low-frequency behavior data sequence, a linear interpolation algorithm is used, and the low-frequency behavior data sequence is interpolated and completed to a daily unified time series axis based on the matching path to obtain a daily low-frequency behavior data sequence; for the high-frequency behavior data sequence, the original daily data is retained without interpolation processing.

[0010] In one embodiment, the step of generating an input feature vector after extracting the temporal features of the alignment behavior data includes: The alignment behavior data is transformed into a standardized feature vector of a first preset dimension, and a relative position encoding vector of a second preset dimension is generated, wherein the relative position encoding vector is initialized using a sine-cosine function. The standardized feature vector and the relative position encoding vector are fused using the following formula: in This represents the standardized feature vector. This represents the relative position encoding vector. This represents the input feature vector obtained after fusion. These are learnable weight parameters, with values ​​ranging from [0,1]. The learnable weight parameters are synchronously used in backpropagation and joint training with the backbone parameters of the temporal convolutional network model, and L2 regularization constraints are introduced.

[0011] In one embodiment, constructing a historical risk probe set consisting of terminal samples that meet preset risk conditions from historical credit samples includes: screening terminal samples that meet the preset risk conditions from historical credit assessment samples to construct a historical risk probe set of preset capacity; rotating and updating a preset proportion of samples in the historical risk probe set according to a preset period; and, according to the preset period, re-screening terminal samples that meet the preset risk conditions based on the latest historical credit assessment samples to replace an equal number of original samples in the historical risk probe set, with the replacement proportion being the preset proportion. The spatial distribution distance between the feature distribution of the newly added training task samples in the hidden layer of the model and the feature distribution of the historical risk probe set samples in the hidden layer of the model is calculated using the maximum mean difference algorithm. The step of dynamically adjusting the weight of the historical risk probe set in the global loss function based on the spatial distribution distance includes: when the spatial distribution distance is greater than a preset offset threshold, increasing the weight of the historical risk probe set in the global loss function by a preset adjustment step size.

[0012] In one embodiment, the incremental learning method further includes: Solve for the Fisher information matrix of the convolution kernel weights and fully connected layer parameters of the temporal convolutional network model, and apply regularization constraints with regularization coefficients to the convolution kernel weights and fully connected layer parameters of the temporal convolutional network model based on the Fisher information matrix. The Fischer information matrix is ​​fitted using Monte Carlo sampling of the historical credit sample data at a preset ratio. The regularization coefficient is obtained by grid search within a preset value range, and the optimal regularization coefficient value is selected by cross-validation of the validation set.

[0013] Secondly, this application also provides a credit assessment system based on behavioral data from pharmaceutical retail terminals. The system includes: The data processing module is used to acquire multi-source behavioral data of pharmaceutical retail terminals within a preset historical time period, and to perform cleaning and time-series alignment processing on the multi-source behavioral data to obtain aligned behavioral data with a unified time axis. The credit assessment module is used to extract the temporal features of the aligned behavior data to generate an input feature vector, input the input feature vector into the temporal convolutional network model, and obtain the credit assessment score of the pharmaceutical retail terminal output by the temporal convolutional network model. The incremental update module is used to acquire credit event data that actually occurs in the pharmaceutical retail terminal after credit assessment as feedback data, and update the parameters of the temporal convolutional network model based on the feedback data using an incremental learning method. The incremental learning method includes: constructing a historical risk probe set composed of terminal samples that meet preset risk conditions from historical credit samples; calculating the spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the model and the feature distribution of the historical risk probe set samples in the hidden layer of the model before each incremental update; and dynamically adjusting the weight of the historical risk probe set in the global loss function according to the spatial distribution distance.

[0014] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the aforementioned credit assessment method based on pharmaceutical retail terminal behavioral data.

[0015] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the aforementioned credit assessment method based on pharmaceutical retail terminal behavioral data.

[0016] The aforementioned credit assessment method, system, computer equipment, and storage medium based on pharmaceutical retail terminal behavioral data acquire multi-source behavioral data from pharmaceutical retail terminals within a preset historical time period. This data is then cleaned and time-series aligned to obtain aligned behavioral data with a unified timeline. This achieves effective integration and standardized processing of operational data from different sources and frequencies of pharmaceutical retail terminals, overcoming the problems of single data sources and lack of quantitative modeling in traditional assessments. By extracting the temporal features of the aligned behavioral data to generate input feature vectors, which are then input into a temporal convolutional network model to obtain credit assessment scores, the modeling capability of temporal convolutional networks for long-term time-series data allows for the extraction of deep-level temporal dependencies from the terminal's operational behavior sequence. This approach enables precise quantitative assessment of terminal credit status. By acquiring actual credit event data from pharmaceutical retail terminals after credit assessment as feedback data, and based on this feedback data, an incremental learning method is used to update the parameters of the temporal convolutional network model. This method involves constructing a historical risk probe set, calculating the spatial distribution distance between the feature distribution of newly added training task samples in the model's hidden layer and the feature distribution of historical risk probe set samples in the model's hidden layer, and dynamically adjusting the weight of the historical risk probe set in the global loss function based on this spatial distribution distance. This allows the model to maintain its ability to identify key historical risk features while continuously learning from new terminal data, achieving dynamic adaptive optimization of the credit assessment model and thus improving the accuracy and timeliness of credit assessment. Attached Figure Description

[0017] Figure 1 This is a diagram illustrating the application environment of a credit assessment method based on pharmaceutical retail terminal behavior data in one embodiment. Figure 2 This is a flowchart illustrating a credit assessment method based on pharmaceutical retail terminal behavior data in one embodiment. Figure 3 This is a schematic diagram of the process for cleaning multi-source behavioral data in one embodiment; Figure 4 This is a structural block diagram of a credit assessment system based on pharmaceutical retail terminal behavior data in one embodiment; Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. First, to facilitate understanding of the technical solutions provided by the embodiments of this application, the background technology involved in the embodiments of this application will be described below.

[0019] Pharmaceutical retail outlets (including pharmacies, clinics, and health centers) are a core link in the pharmaceutical distribution industry chain. Pharmaceutical distribution companies typically supply medicines to retail outlets on a payment or credit basis. The creditworthiness of these retail outlets directly determines the financial security, cooperation decisions, and risk control strategies of the distribution companies. As the market size of the pharmaceutical distribution industry continues to expand and industry concentration increases, the need for credit assessment of downstream retail outlets is becoming increasingly urgent for pharmaceutical distribution companies. Accurately assessing the creditworthiness of these outlets is a crucial prerequisite for reducing bad debt rates, preventing cross-selling risks, and ensuring compliant operations.

[0020] Currently, credit assessment of pharmaceutical retail outlets in the industry primarily relies on static information such as financial statements, historical transaction records, and manual rating. For example, historical order data from pharmaceutical distribution clients is used to extract time-series characteristics, or client payment and sales data are collected for risk classification, followed by a comprehensive assessment completed manually on a quarterly or annual basis. This assessment method has long been used in the pharmaceutical distribution industry and is considered a lagging assessment.

[0021] However, the actual operations of pharmaceutical retail outlets are constantly changing. Their daily purchasing frequency and product category structure, inventory turnover efficiency, GSP (Good Supply Practice) compliance inspection records, abnormal medical insurance settlements, patient complaint rates, and other operational data, as well as external regulatory information such as business registration changes, legal proceedings, and administrative penalties, are all continuously generated and updated in real time. These data reflect the true operating conditions and potential risks of the outlets from different dimensions. For example, a sharp drop in purchasing frequency may indicate operational difficulties, while an increase in GSP violations directly reflects quality management risks.

[0022] Traditional assessment methods rely solely on static financial and transaction data. On one hand, the aforementioned dynamic operational data is not incorporated into the assessment system, severely limiting the assessment dimensions and preventing the results from fully depicting the true creditworthiness of the end user. On the other hand, the quarterly or annual manual assessment cycle causes the assessment results to lag significantly behind real-time operational changes at the end user. By the time the assessment report is issued, the end user may have already experienced operational deterioration or compliance risk events, making it difficult to reflect the true credit risk situation in a timely manner. This assessment lag directly hinders distribution companies from adjusting credit lines or payment terms in a timely manner, increasing bad debt and compliance risks.

[0023] Therefore, in order to perform temporal alignment and temporal convolutional network evaluation on multi-source behavioral data of pharmaceutical retail terminals, and to dynamically adjust incremental learning weights based on actual credit feedback by detecting the spatial distribution offset of historical risk probe sets, this application provides a credit assessment method, system, computer equipment, and storage medium based on behavioral data of pharmaceutical retail terminals.

[0024] The credit assessment method based on pharmaceutical retail terminal behavior data provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the pharmaceutical retail terminal device 102 communicates with the credit assessment server 104 via a network. The credit assessment server 104 obtains multi-source behavioral data of the pharmaceutical retail terminal within a preset historical period from the pharmaceutical retail terminal device 102, and performs cleaning, temporal alignment, and temporal feature extraction on this multi-source behavioral data before inputting it into a temporal convolutional network model to output a credit assessment score. It also obtains actual credit event data that occurs after the credit assessment of the pharmaceutical retail terminal as feedback data. The parameters of the temporal convolutional network model are updated by constructing a historical risk probe set, calculating the spatial offset distance of the feature distribution, and dynamically adjusting the weight of the probe set in the global loss function. The data storage system can store the data that the credit assessment server 104 needs to process. The data storage system can be integrated on the credit assessment server 104 or placed on the cloud or other network servers. The pharmaceutical retail terminal device 102 can be a pharmacy POS terminal, clinic information management terminal, health center drug management terminal, medical insurance settlement terminal, or other device with data acquisition and communication functions. The credit assessment server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0025] Furthermore, all the aforementioned multi-source behavioral data originates from data legally authorized for collection and transmission by pharmaceutical retail terminals, and the data acquisition methods comply with relevant laws and regulations. For data involving personal information (including but not limited to medical insurance settlement data, patient complaint information, etc.), the data provider has fulfilled its obligation to inform the data subject in accordance with the law and obtained their separate consent with full knowledge of the data subject; the data subject has the right to withdraw consent at any time. Data involving personal information is processed using de-identification or anonymization methods during transmission, storage, and processing to ensure that it cannot directly or indirectly identify a specific natural person. For enterprise operating data (including but not limited to purchase amount, purchase frequency, inventory turnover rate, etc.), its acquisition and use are based on legitimate business relationships with pharmaceutical retail terminals, and the data is used solely for the credit assessment purpose of this application and will not be used for other purposes. Moreover, the credit assessment scores and credit ratings output by the embodiments of this application are statistical risk assessment results, do not involve discriminatory judgments against specific natural persons, and do not output information that can directly identify a specific natural person.

[0026] Firstly, in the context of credit assessment at pharmaceutical retail terminals, traditional assessment methods rely on quarterly or annual manual ratings. These methods have long assessment cycles and slow updates, failing to capture dynamic changes in terminal operations in a timely manner, resulting in credit assessment results lagging behind actual changes in terminal credit risk. Therefore, in one embodiment, such as... Figure 2As shown, a credit assessment method based on pharmaceutical retail terminal behavioral data is provided, and this method is applied to... Figure 1 Taking the pharmaceutical retail terminal equipment 102 as an example, the explanation includes the following steps: S1: Obtain multi-source behavioral data of pharmaceutical retail terminals within a preset historical time period, clean and align the multi-source behavioral data to obtain aligned behavioral data with a unified time axis; S2: After extracting the temporal features of the alignment behavior data, generate the input feature vector, input the input feature vector into the temporal convolutional network model, and obtain the credit assessment score of the pharmaceutical retail terminal output by the temporal convolutional network model; S3: Obtain actual credit event data of pharmaceutical retail terminals after credit assessment as feedback data, and update the parameters of the temporal convolutional network model using incremental learning based on the feedback data; wherein, the incremental learning method includes: constructing a historical risk probe set composed of terminal samples that meet preset risk conditions from historical credit samples; before each incremental update, calculating the spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the model and the feature distribution of historical risk probe set samples in the hidden layer of the model, and dynamically adjusting the weight of the historical risk probe set in the global loss function according to the spatial distribution distance.

[0027] Specifically, the preset historical period is used to limit the time span of historical data on which credit assessment is based. In this embodiment, 365 days is used as the preset historical period, which matches the 6 to 12-month cycle typically involved in drug expiration date management in the pharmaceutical industry. Multi-source behavioral data refers to various types of data from different business systems that reflect the operational behavior of pharmaceutical retail terminals, including but not limited to procurement data obtained from enterprise resource planning systems, sales data obtained from customer relationship management systems, inventory data obtained from warehouse management systems, and external data obtained from third-party data service providers or publicly available regulatory channels. Cleaning is used to remove or correct invalid, duplicate, and abnormal records in multi-source behavioral data, and to standardize the field formats, units, and codes of different data sources. Time-series alignment is used to map data sequences with different sampling frequencies to a unified time axis, making the data in each dimension comparable in the time dimension. A unified time axis refers to the time benchmark that all data sequences follow. In this embodiment, a unified time axis is constructed with the natural day as the smallest time granularity. Time-series feature extraction refers to extracting the statistical characteristics and change patterns of each dimension's values ​​over time from the aligned behavioral data. Temporal convolutional network models are time-series data processing models based on causal convolution and dilated convolution. Through residual connection structures, they can extract deep temporal dependency features from long-sequence data. Credit assessment scores are the result of a quantitative evaluation of the credit status of pharmaceutical retail terminals; in this embodiment, the credit assessment score ranges from 0 to 1000.

[0028] Credit event data refers to event information that actually occurs on the terminal after the credit assessment, reflecting changes in its credit status, including but not limited to overdue payments, defaults, and administrative penalties. Incremental learning refers to a learning strategy that continuously updates and optimizes model parameters based on existing training results using newly acquired feedback data, unlike full retraining which requires retraining with all historical data for each update. The historical risk probe set is a collection of representative and typical high-risk terminal samples selected from a large number of historical credit samples. New training task samples refer to the training sample set containing the latest feedback data used in this round of incremental updates. The hidden layer of the model refers to the intermediate layer between the input and output layers in a temporal convolutional network model. The feature vector output by this layer can represent an abstract representation of the input data. In this embodiment, the hidden layer specifically refers to the feature vector output by the 4th layer residual block. Feature distribution refers to the probability distribution of samples in the hidden layer feature space. In this embodiment, it specifically represents the statistical distribution of each sample's hidden layer feature vector in a high-dimensional space. Spatial distribution distance is used to quantify the degree of difference in the distribution of two sample sets in the feature space. The global loss function measures the difference between the model's predicted values ​​and the actual values. In this embodiment, the global loss function includes two parts: the main task loss function and the historical risk probe set loss function. Dynamic adjustment refers to adaptively adjusting the weight of the historical risk probe set in the global loss function based on the specific numerical value of the spatial distribution distance, rather than keeping it fixed.

[0029] By acquiring multi-source behavioral data and performing cleaning and alignment processing, the system effectively integrates and standardizes operational data from different sources and frequencies in pharmaceutical retail terminals. Temporal feature extraction and credit assessment are performed on the aligned behavioral data using a temporal convolutional network model. The dilated convolutional structure of the temporal convolutional network enables the modeling of long-term temporal data, achieving accurate quantitative assessment of terminal credit status. By acquiring credit event data as feedback and employing an incremental learning approach that includes constructing historical risk probe sets, calculating the spatial distance of feature distributions, and dynamically adjusting probe set weights to update model parameters, the model maintains its ability to identify key historical risk features while continuously learning from new terminal data, thereby effectively improving the accuracy and timeliness of credit assessment.

[0030] In credit assessment scenarios, single-dimensional assessment data cannot fully depict the true credit status of pharmaceutical retail terminals. It is necessary to collect behavioral data from multiple dimensions to cover all aspects of the terminal's business activities. Therefore, in one embodiment, multi-source behavioral data includes: institutional compliance data, transaction behavior data, operational behavior data, market behavior data, and external relational data.

[0031] Specifically, the institutional compliance dimension data reflects the compliance level of pharmaceutical retail terminals with Good Manufacturing Practices (GMP) and pharmaceutical regulatory laws. This includes GMP compliance inspection records, drug regulatory department verification and penalty records, drug business licenses and medical institution practice licenses, and regulatory records of any illegal business practices within a preset historical period. This data can be obtained from the drug regulatory department's public information platform, third-party credit reporting agencies, or the company's internal compliance management system. The transaction behavior dimension data reflects the transactions between pharmaceutical retail terminals and upstream suppliers. This includes the terminal's drug procurement amount, procurement frequency, procurement category structure and its stability, payment cycle, and order fulfillment rate within a preset historical period. Procurement amount refers to the cumulative or average procurement amount within the preset historical period; procurement frequency refers to the number of orders placed within the preset historical period; category stability refers to the degree of fluctuation in the procurement drug variety structure; payment cycle refers to the average number of days from procurement to payment completion; and order fulfillment rate refers to the proportion of procurement orders fulfilled on time. This data can be obtained from enterprise resource planning (ERP) systems or supply chain management systems.

[0032] The operational behavior dimension data reflects the internal operational management level of pharmaceutical retail terminals, specifically including the terminal's inventory turnover rate, slow-moving inventory ratio, and the rationality of seasonal inventory replenishment within a preset historical period. Inventory turnover rate measures the efficiency of inventory management; its calculation formula is: inventory turnover rate = cost of sales within the preset historical period divided by average inventory balance. The slow-moving inventory ratio reflects the terminal's ability to control the risk of inventory backlog; its calculation formula is: slow-moving inventory ratio = slow-moving inventory value divided by total inventory value. The rationality of seasonal inventory replenishment assesses whether the terminal reasonably adjusts its inventory structure according to seasonal changes. The above data can be obtained from warehouse management systems or inventory management systems. The market behavior dimension data reflects the performance of pharmaceutical retail terminals in marketing and patient services, specifically including the terminal's participation in promotional activities, cooperation in new product promotion, patient complaint rate, and member activity within a preset historical period. Participation in promotional activities measures the terminal's enthusiasm for cooperating with suppliers in marketing activities; cooperation in new product promotion assesses the terminal's support for new product launches; the patient complaint rate reflects the terminal's service quality level; and member activity measures the effectiveness of maintaining customer relationships. The aforementioned data can be obtained from customer relationship management systems, membership management systems, or complaint management systems. External correlation dimension data reflects the credit status of pharmaceutical retail terminals in the external environment and publicly available information. Specifically, this includes the terminal's medical insurance settlement data, business registration change information, legal proceedings information, administrative penalty information, and records of dishonesty within a preset historical period. Medical insurance settlement data reflects whether the terminal has engaged in any abnormal or illegal activities during the medical insurance settlement process; business registration change information reflects changes in the terminal's business status; legal proceedings and administrative penalty information reflect the terminal's risk exposure at the judicial and administrative levels; and records of dishonesty reflect whether the terminal has been included in the list of dishonest persons subject to enforcement or has engaged in other serious acts of dishonesty. The aforementioned data can be obtained from the medical insurance settlement system, the National Enterprise Credit Information Publicity System, China Judgments Online, or third-party data service providers, with the acquisition of medical insurance settlement data contingent upon terminal authorization.

[0033] By collecting multi-source behavioral data from five dimensions—institutional compliance, transaction behavior, business behavior, market behavior, and external connections—it is possible to more comprehensively cover all aspects of the business activities of pharmaceutical retail terminals, providing a richer data foundation for subsequent credit assessments and thus improving the comprehensiveness of credit assessments.

[0034] In the actual process of collecting multi-source behavioral data, differences in data format, encoding system, and data quality among different data sources, as well as potential delays, out-of-order delivery, or missing data during transmission, render the raw data unusable for direct model training and evaluation. Therefore, in one embodiment, such as... Figure 3 As shown, the cleaning process for multi-source behavioral data includes: Determine whether the timestamps of each behavioral data item acquired in the current batch are valid; Invalid timestamp behavior data is marked as unavailable time series data. The business field values ​​of the unavailable time series data are extracted. The sum, mean and count of the business field values ​​are calculated for each terminal. The calculated sum, mean and count are used as static features. The static features are used to fuse with the time series features in the process of generating credit assessment scores. The behavior data with valid timestamps is used as the existing sequence data. The timestamps of each behavior data in the existing sequence data are extracted. The existing sequence data is then sorted in global ascending order to obtain the sorted existing sequence data. For the sorted existing sequence data, detect the time interval between the timestamps of two adjacent action data. If the time interval is greater than a preset time threshold, mark that there is a time-series missing window between two adjacent action data. For behavioral data in the sorted existing sequence data that has valid timestamps but missing business field values, the following filling operations are performed: If the behavioral data has both adjacent valid forward and valid backward timestamps on the timeline, linear interpolation is performed using the business field values ​​of the valid forward timestamps and the valid backward timestamps; if only valid forward timestamps or only valid backward timestamps exist, the business field values ​​of the valid timestamps on the existing side are used for filling; if there are no valid timestamps from the same terminal in the sorted existing sequence data, the preset industry default values ​​are used for filling. After the ascending order is completed, the newly collected behavioral data in the subsequent operation of the existing sequence data will be used as incremental behavioral data. When incremental behavior data is obtained, the adjacent preceding timestamp and adjacent following timestamp of the incremental behavior data are searched in the sorted existing sequence data. The first difference between the timestamp of the incremental behavior data and the adjacent preceding timestamp and the second difference between the timestamp of the incremental behavior data and the adjacent following timestamp are calculated respectively. If the first difference is negative or the second difference is positive, the incremental behavior data is determined to be time-overlapping abnormal data. For incremental behavioral data that is determined to be time-series overlapping abnormal data, a binary search algorithm is used to locate the standard insertion position of the incremental behavioral data in the sorted existing sequence data, and then the incremental behavioral data is inserted into the standard insertion position.

[0035] Specifically, a timestamp is a time stamp used to identify the time when each piece of behavioral data was generated. Its format can be "YYYY-MM-DD HH:MM:SS" or a date and time format conforming to the International Organization for Standardization (ISO) standard 8601. A valid timestamp means that the timestamp exists and its format conforms to preset parsing rules, such as being successfully parsed by a date and time parsing function. Time-series unavailable data refers to behavioral data that cannot be located in the time series due to missing timestamps or incorrect formats. Business field values ​​refer to the numerical values ​​of business attribute fields in the behavioral data other than timestamps, such as purchase amount and inventory quantity. The sum is the cumulative sum of the values ​​of this business field in all time-series unavailable data for this terminal, i.e. ,in Indicates the first Values ​​for business fields containing unavailable time-series data. This indicates the total number of data entries that are unavailable at this terminal. The mean is the ratio of the sum to the count, i.e. .count This refers to the number of unavailable time-series data entries at this terminal. Static features do not participate in time-series alignment and feature extraction, but they are fused with time-series features during the credit assessment score generation process through feature concatenation or weighted summation, ensuring that the information from this data can still be utilized by the model. Global ascending order sorting refers to ranking all existing sequence data according to their timestamps from earliest to latest. The time interval is the absolute value of the difference between the timestamps of two adjacent behavioral data entries, i.e. ,in and These represent the timestamps of two adjacent behavioral data sets. A preset time threshold is used to determine whether there is data loss between two adjacent data sets; in this embodiment, it is set to 24 hours, meaning the smallest time granularity is the calendar day. The time-series missing window is used to identify data collection gaps within that time period.

[0036] A forward valid timestamp refers to a valid timestamp that is closest to the data's time position before the data's current time position and whose business field value is not missing. A backward valid timestamp refers to a valid timestamp that is closest to the data's time position after the data's current time position and whose business field value is not missing. The linear interpolation fill is calculated as follows: Let the business field value corresponding to the forward valid timestamp be... The business field corresponding to the backward valid timestamp takes the value of Forward timestamp is The backward timestamp is The timestamp of the data to be filled is Then fill value If only a valid forward timestamp exists, then fill in the value. If only a backward valid timestamp exists, then fill in the value. Preset industry default values ​​are industry-wide reference values ​​pre-defined for specific business fields. For example, for the inventory turnover rate field, the preset industry default value could be 3 times / year. Incremental behavioral data refers to behavioral data newly received from various data sources during continuous system operation after the existing sequence data has been sorted and cleaned. Adjacent preceding timestamps are the most recent and closest valid timestamps in the sorted existing sequence data compared to the timestamp of the incremental behavioral data; adjacent following timestamps are the most recent and closest valid timestamps in the sorted existing sequence data compared to the timestamp of the incremental behavioral data. First Difference ,in The timestamp represents the incremental behavior data. Indicates the adjacent preceding timestamp; second difference ,in Indicates the adjacent subsequent timestamp. If A negative value indicates that the timestamp of the incremental data is earlier than the timestamp of its preceding data, meaning there is a temporal overlap with the preceding data; if A positive value indicates that the timestamp of the incremental data is later than the timestamp of its subsequent data, meaning there is a temporal overlap. The binary search algorithm is a search algorithm for quickly locating the position of a target element in an ordered sequence. Its basic idea is to compare the target value with the value at the middle position of the sequence each time. If the target value is less than the middle value, the search continues in the left half; otherwise, the search continues in the right half, until the standard insertion position is found. In this embodiment, the binary search algorithm is used to find the position where the incremental data should be inserted in the ordered sequence data, ensuring that the entire sequence maintains an ascending timestamp order after insertion.

[0037] By first separating invalid timestamp data for static feature extraction, and then performing ascending sorting and temporal continuity detection on valid timestamp data, the order of steps conforms to the basic technical logic of data processing. By performing targeted interpolation to fill in missing values ​​in business fields, the integrity of the data is ensured. By using a binary search algorithm to locate the standard insertion position for incremental out-of-order data, the orderliness and correctness of the data input to the temporal convolutional network model in the time dimension are guaranteed.

[0038] In the collection of multi-source behavioral data, the data collection frequencies of different data sources are different. For example, purchase records are recorded daily while inventory reports are recorded monthly. Directly inputting data sequences with different frequencies into a temporal convolutional network model will lead to a timeline mismatch problem. Therefore, in one embodiment, temporal alignment processing is performed on the multi-source behavioral data, including: Using a preset number of days as a unified time series standard, for behavioral data sequences with a time span greater than the preset number of days, redundant time series data at the end is truncated, and the effective operational feature sequences at the front end are retained; for behavioral data sequences with a time span less than the preset number of days, zero padding at the end is used to pad to the preset number of days. A dynamic time warping algorithm is employed to perform cross-scale feature alignment between high-frequency and low-frequency behavioral data sequences, calculating the matching path between them. The dynamic time warping algorithm uses a constraint window with a preset window radius and fixes the standardized boundary conditions as follows: ,in, Represents the cumulative distance matrix. A time-series index representing a high-frequency behavioral data sequence. A time-series index representing a low-frequency behavior data sequence; For low-frequency behavioral data sequences, a linear interpolation algorithm is used, and the low-frequency behavioral data sequences are interpolated and completed to a daily unified time series axis based on the matching path to obtain daily low-frequency behavioral data sequences; for high-frequency behavioral data sequences, the original daily data is retained without interpolation processing.

[0039] Specifically, the preset number of days is used to determine the length of the time window for a unified time series standard. In this embodiment, 365 days is used as the preset number of days, which matches the annual operating cycle of the pharmaceutical industry. The effective operational feature sequence at the front end refers to the part of the sequence starting from the beginning time and having a length of the preset number of days when the time span is greater than the preset number of days, while discarding data from the end of the sequence that exceeds the preset number of days. Zero padding at the end refers to adding data points with zero values ​​to the end of the sequence when the time span is less than the preset number of days, so that the sequence length reaches the preset number of days. High-frequency behavioral data sequences refer to behavioral data sequences with a high density of data points per unit time, such as daily procurement flow data sequences, with a sampling interval of 1 day. Low-frequency behavioral data sequences refer to behavioral data sequences with a low density of data points per unit time, such as monthly inventory report data sequences, with a sampling interval of approximately 30 days. The dynamic time warping algorithm is an algorithm used to measure the similarity between two time series and align them. Its core idea is to find an optimal matching path through dynamic programming. This algorithm aims to minimize the cumulative distance between corresponding points on the time axis of two sequences. The specific calculation process is as follows: Let the high-frequency sequence be... The low-frequency sequence is ,in and These are the lengths of the high-frequency sequence and the low-frequency sequence, respectively. If... and If it is a multidimensional vector, then The calculation can be performed using multidimensional Euclidean distance, i.e. ,in Let be the dimension of the vector. This represents the value of the q-th dimension at the i-th time step of the high-frequency sequence. This represents the value of the q-th dimension at the j-th time step of the low-frequency sequence. Construct the cumulative distance matrix. Its dimensions are According to standardized boundary conditions , (for ), (for After initializing the matrix, calculate according to the following recursive formula. : After the recursive calculation is completed, from Start backtracking The path traversed is the matching path. Preset window radius Used to limit the offset range of the matching path, i.e., requires To avoid distortion of original business characteristics due to excessive distortion, the window radius rr is set to 5 natural days in this embodiment. Boundary conditions This indicates that the cumulative distance from the starting point is 0; This indicates that any path that only matches data points in the high-frequency sequence but not in the low-frequency sequence is an invalid path; This indicates that any path that only matches data points in the low-frequency sequence but not in the high-frequency sequence is an invalid path. Linear interpolation is an interpolation method that estimates the value of an intermediate unknown data point based on the linear relationship between adjacent known data points. When interpolating based on matching paths, for each time point on the daily unified time series axis... In matching path Find with Corresponding low-frequency sequence position Then according to Adjacent monthly data points are interpolated using a linear interpolation formula to calculate their values ​​at that time point, resulting in a daily-based low-frequency sequence aligned with the high-frequency data sequence on the time axis. For high-frequency behavioral data sequences, the original daily data is retained without interpolation to avoid introducing errors from human estimation.

[0040] By first truncating or padding to a preset number of days as a unified time series standard, and then using a dynamic time warping algorithm to perform cross-scale feature alignment and calculate matching paths for the high-frequency and low-frequency behavioral data sequences at the original scale, the low-frequency behavioral data sequences are linearly interpolated and padded to a unified daily time series axis based on the matching path. This makes the matching path output by the dynamic time warping algorithm serve as the time series constraint for the interpolation process, thus achieving accurate fusion and logical closure of high- and low-frequency features.

[0041] Before inputting alignment behavior data into a temporal convolutional network model, the alignment behavior data needs to be transformed into a numerical feature representation that the model can process. Simultaneously, the model needs to be able to perceive the data's positional information within the time series to enhance its temporal modeling capabilities. Therefore, in one embodiment, the process of extracting temporal features from the alignment behavior data to generate an input feature vector includes: The alignment behavior data is transformed into a standardized feature vector of the first preset dimension, and a relative position encoding vector of the second preset dimension is generated, wherein the relative position encoding vector is initialized using a sine-cosine function; The standardized feature vector and the relative position encoding vector are fused using the following formula: in Represents the standardized feature vector. Represents a relative position encoding vector. This represents the input feature vector obtained after fusion. These are learnable weight parameters, with values ​​ranging from [0,1]. Learnable weight parameters are synchronously used in backpropagation and joint training with the backbone parameters of the temporal convolutional network model, and L2 regularization constraints are introduced.

[0042] Specifically, the first preset dimension is the number of dimensions of the pre-defined standardized feature vector. In this embodiment, 32 dimensions are used as the first preset dimension. This 32-dimensional standardized feature vector specifically includes: 3-dimensional transaction frequency features, 2-dimensional inventory turnover rate features, 1-dimensional compliance deduction features, 1-dimensional medical insurance settlement anomaly features, 1-dimensional procurement amount features, 23-dimensional time-series location coding features, and 1-dimensional behavioral volatility features. All of the above features are extracted from aligned behavioral data and obtained through standardization (i.e., subtracting the mean and dividing by the standard deviation). The second preset dimension is the number of dimensions of the pre-defined relative location coding vector. In this embodiment, 24 dimensions are used as the second preset dimension, corresponding to the 24-hour time-series cycle of a natural day. The relative location coding vector is initialized using a sine-cosine function, and its initialization method is as follows: for position... and dimensions (k=0,1,…,23), encoded values The calculation formula is: when k is even, When k is odd, This initialization method enables the model to capture the relative relationships between different locations in the time series. This represents the 32-dimensional standardized feature vector. This represents the 24-dimensional relative position encoding vector, while the input feature vector has a dimension of 32.

[0043] Learnable weight parameters The initial value is set to 0.8, and this parameter is updated iteratively through backpropagation during model training. Learnable weight parameters are parameters that are updated iteratively through backpropagation during model training. Their values ​​are not fixed in advance, but are automatically learned by the model based on the training data.

[0044] The backbone parameters refer to all trainable parameters in a temporal convolutional network model, excluding learnable weights, that participate in feature extraction and mapping, including convolutional kernel weights and fully connected layer weights. Backpropagation is an optimization method based on the chain rule to calculate the gradient of model parameters, used to update model parameters during training. Joint training refers to updating the learnable weights α and backbone parameters simultaneously during the same training process. L2 regularization is a regularization strategy that adds a sum of squared weights to the loss function to limit the size of parameter values ​​and avoid overfitting. In this embodiment, the L2 regularization coefficient is set to 1×10⁻⁶. −4 .

[0045] By transforming alignment behavior data into standardized feature vectors and generating relative position encoding vectors, and then fusing the two with learnable weights, the fused input feature vectors retain the original business features while incorporating temporal positional information. By synchronously participating in backpropagation and joint training with the backbone parameters of the temporal convolutional network model, the model can adaptively balance the contributions of the original features and temporal encoded features, thereby enhancing the model's ability to model temporal dependencies.

[0046] During incremental learning, the model may easily forget key risk features from historical credit samples when learning new terminal data, especially features related to high-risk violations such as counterfeit drug distribution and medical insurance fraud in the pharmaceutical industry. To address this, in one embodiment, a historical risk probe set is constructed, consisting of terminal samples from historical credit samples that meet preset risk conditions. This includes: selecting terminal samples that meet preset risk conditions from historical credit assessment samples to construct a historical risk probe set of preset size; rotating and updating samples in the historical risk probe set at a preset ratio according to a preset period; and, according to a preset period, re-selecting terminal samples that meet preset risk conditions based on the latest historical credit assessment samples to replace an equal number of original samples in the historical risk probe set, with the replacement ratio being a preset ratio.

[0047] The spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the model and the feature distribution of historical risk probe set samples in the hidden layer of the model is calculated. The maximum mean difference algorithm is used to calculate the spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the temporal convolutional network model and the feature distribution of historical risk probe set samples in the hidden layer of the temporal convolutional network model.

[0048] The weight of the historical risk probe set in the global loss function is dynamically adjusted based on the spatial distribution distance, including: when the spatial distribution distance is greater than a preset offset threshold, the weight of the historical risk probe set in the global loss function is increased according to a preset adjustment step size.

[0049] Specifically, the preset risk conditions include at least one of the following: a historical default probability greater than 90%, a risk loss amount greater than 100,000 yuan, or records of specific violations such as counterfeit drug distribution, medical insurance fraud, or illegal purchase and sale. The preset capacity is the upper limit of the number of samples contained in the historical risk probe set, set to 1000 in this embodiment. The preset period is the preset update interval of the historical risk probe set, set to monthly in this embodiment. The preset ratio is the proportion of the number of samples replaced in each update to the total capacity of the historical risk probe set, set to 10% in this embodiment, i.e., 100 samples are replaced per month. The maximum mean difference algorithm is a nonparametric statistical method based on kernel functions, used to measure the distance between two probability distributions in the reproducing kernel Hilbert space. Its specific calculation process is as follows: Let the set of feature vectors of the newly added training task samples in the hidden layer of the model be... The set of feature vectors of historical risk probe samples in the hidden layer of the model is as follows: ,in and These represent the sample sizes of the two sets, respectively. A Gaussian radial basis function kernel is used. , where σ is the bandwidth parameter of the kernel function. Maximum mean difference distance The calculation formula is: The larger the distance value, the greater the difference between the two feature distributions. The preset offset threshold is a pre-set critical value used to determine whether a feature distribution has undergone a significant shift; in this embodiment, it is set to 0.2, that is, when... A significant offset is determined at that time. The preset adjustment step size is the change range of a single weight adjustment, which is set to 0.1 in this embodiment, and the weight values ​​are constrained within the range of [0.1, 0.9]. During each incremental update, if the spatial distribution distance is greater than 0.2, the weight of the historical risk probe set in the global loss function is increased by 0.1 (but not exceeding 0.9); if the spatial distribution distance is less than or equal to 0.2, the weight is not adjusted or the weight is reduced by the same step size (but not lower than 0.1).

[0050] By selecting high-risk terminal samples from historical credit assessment samples to construct a historical risk probe set and continuously iterating and updating it according to a preset cycle, the probe set can anchor the core historical risk characteristics of the industry. The spatial distribution distance between the feature distribution of newly added training task samples and historical risk probe set samples in the hidden layer of the model is calculated by the maximum mean difference algorithm, realizing the accurate quantification of feature distribution shift. When the spatial distribution distance exceeds a preset shift threshold, the weight of the historical risk probe set in the global loss function is automatically increased, so that the model can stably retain high-dimensional historical risk features while learning the features of newly added terminal data, thereby effectively solving the catastrophic forgetting problem in incremental learning.

[0051] In incremental learning, simply relying on adjusting the loss weights of historical risk probe sets may not be sufficient to completely suppress the model's forgetting of key historical features; auxiliary constraints on the model's core parameters are also necessary. Therefore, in one embodiment, the incremental learning approach further includes: Solve for the Fisher information matrix of the kernel weights and fully connected layer parameters of the temporal convolutional network model, and apply regularization constraints with regularization coefficients to the kernel weights and fully connected layer parameters of the temporal convolutional network model based on the Fisher information matrix. A Monte Carlo sampling method was used to fit the Fischer information matrix to historical credit sample data with a preset proportion. The regularization coefficient is selected by grid search within a preset value range, and the optimal regularization coefficient value is selected by cross-validation of the validation set.

[0052] Specifically, the Fischer information matrix is ​​a mathematical tool used to measure the sensitivity of model parameters to data changes. In incremental learning, it is used to evaluate the importance of each parameter to historical tasks. For the parameters of temporal convolutional network models... (Including convolutional kernel weights and fully connected layer parameters), its distribution in historical data Fisher Information Matrix Defined as: ,in This represents the gradient of the log-likelihood function with respect to the parameter θ. In actual calculations, the diagonal elements of the Fischer information matrix... This reflects the importance of the k-th parameter to the historical task. Monte Carlo sampling is a statistical method that approximates the calculation of complex mathematical quantities through random sampling. In this embodiment, the preset proportion is set to 5%, that is, 5% of the samples are randomly selected from all historical credit sample data to fit the Fisher information matrix, in order to reduce computational overhead. Regularization coefficient To control the strength of the constraints, a term is added to the loss function of incremental learning. ,in This represents the optimal parameter values ​​obtained through training on historical tasks. This regularization term constrains the model parameters to avoid deviating too much from their historical optimal values ​​during updates; the degree of deviation is determined by the diagonal elements of the Fischer information matrix corresponding to each parameter. Weighted control. Grid search is a method to find the optimal hyperparameter by traversing all candidate values ​​within a preset range. In this embodiment, the preset range is [100, 1000], with a step size of 50, meaning the candidate regularization coefficients are 100, 150, 200, 250, ..., 950, 1000. Cross-validation is a validation method that divides the training data into multiple subsets and uses different subsets as validation sets in turn to evaluate model performance. In this embodiment, five-fold cross-validation is used, which randomly divides the training data into 5 equal parts, uses 4 parts to train the model and 1 part to validate the model performance in turn, and finally selects the regularization coefficient value that optimizes the average validation performance.

[0053] By solving the Fisher information matrix of the convolutional kernel weights and fully connected layer parameters of the temporal convolutional network model, the importance of each parameter to the historical task is quantified. The Fisher information matrix is ​​fitted by Monte Carlo sampling with a preset ratio, reducing the computational cost. The optimal regularization coefficient value is selected by grid search and cross-validation within a preset value range, so that the regularization constraint strength adapts to the data distribution characteristics of different incremental training tasks. Thus, together with the dynamic weight adjustment mechanism of the historical risk probe set, a hybrid constraint architecture is formed, which enhances the forgetting suppression effect of historical key risk features.

[0054] Considering the long-term dependence of pharmaceutical retail terminal data, such as the fact that drug expiration management often involves inventory trajectories over 6 to 12 months, traditional recurrent neural networks may lack the ability to capture long-term features due to gradient vanishing when processing extremely long sequences. Therefore, in one embodiment, a temporal convolutional network model includes an 8-layer residual block stacked structure; the hidden layers of this temporal convolutional network model use the LeakyReLU activation function with a negative slope of 0.01; the output layer of this temporal convolutional network model is configured with the Sigmoid activation function; the dilation coefficient sequence corresponding to the 8 residual blocks is (1,2,4,8,16,32,64,128), and the receptive field of this temporal convolutional network model is 511 time steps; this temporal convolutional network model applies one-dimensional causal convolution in the time dimension, padding only on the left side of the input sequence, so that the output of any time step depends only on the historical behavioral data of that time step and the time steps prior to that time step; each residual block in the 8 layers contains skip connections, superimposing the original input of the residual block onto the output of the residual block.

[0055] Specifically, a residual block is a basic building block of a neural network that contains skip connections. The structure of each residual block is as follows: the input first passes through a first one-dimensional causal convolutional layer (kernel size 3, dilation factor 1). , Representation layer index, Then, it goes through a batch normalization layer and a LeakyReLU activation function, followed by a second one-dimensional causal convolutional layer (with a kernel size of 3 and an inflation factor of 1). Then, after passing through a batch normalization layer, the input is added to the output of the second convolutional layer via a skip connection to obtain the final output of the residual block. An 8-layer residual block stacked structure refers to sequentially connecting eight of the above residual blocks to form a deep network, where the first... coefficient of expansion of layer residual blocks The first in the above expansion coefficient sequence LeakyReLU is a variant of the modified linear unit activation function that outputs a small, non-zero slope when the input is negative. A negative slope of 0.01 indicates that when the input is negative... When, the output is When input When, the output is This activation function is used to suppress gradient sparsity and failure issues that may occur in neurons during training. Sigmoid is a non-linear activation function that maps input values ​​to the interval [0,1], and its mathematical expression is: The dilation coefficient controls the sampling interval of the convolution kernel on the input sequence. (The dilation coefficient is used to...) Taking a kernel size of 3 as an example, the sampling position of the kernel on the input sequence is: , , That is, the sampling interval is The dilation coefficient sequence (1, 2, 4, 8, 16, 32, 64, 128) grows exponentially, corresponding one-to-one with the 8 residual blocks. The receptive field refers to the temporal range of the input sequence upon which the model output depends. The receptive field of this 8-layer dilated convolutional structure... Satisfy the formula ,in This indicates the number of residual block layers. Substituting the 8 residual block layers and the expansion coefficient sequence in this embodiment, the effective receptive field is... Each time step can fully cover the entire time-series operational data for a preset historical period (365 days) and reserve redundant intervals. Causal convolution is a convolution method that ensures no future information leakage in time series modeling, requiring the output of time step t to be... Only inputs at time step t and earlier Calculated, i.e. and not dependent on Left padding refers to padding the input sequence with zeros before the beginning (the number of zeros is equal to the kernel size minus 1) during convolution calculation, instead of padding after the end, to ensure causality. Skip connections refer to directly passing the residual block input across layers and adding it to the main path output of that residual block as its final output. ,in This represents the transformation performed on the input by the main path. This is the input for the residual block.

[0056] By using an 8-layer residual block stacking structure and an exponentially growing expansion coefficient sequence, a receptive field of 511 time steps is obtained without increasing the number of parameters, which can fully cover the full-time operation data within the preset historical period. One-dimensional causal convolution and left padding are used to ensure that credit assessment strictly follows the time logic. Skip connections are used to alleviate the gradient vanishing problem in deep network training, thereby achieving effective extraction of long-term time-series operation characteristics of pharmaceutical retail terminals.

[0057] After the temporal convolutional network model completes the temporal feature extraction, the extracted temporal features need to be mapped to the final credit assessment score, and the corresponding loss function and optimizer need to be configured to ensure the stability and generalization ability of the model training. Therefore, in one embodiment, the credit assessment score output by the temporal convolutional network model is generated as follows: the backbone network of the temporal convolutional network model extracts temporal features, performs global average pooling dimensionality reduction, and then inputs them into a two-layer cascaded fully connected network. The first fully connected layer of this two-layer cascaded fully connected network has a neuron dimension of 64, and the second fully connected layer has a neuron dimension of 1. The original value output by the second fully connected layer is transformed using a linear scaling formula, and then mapped by a sigmoid function to output a credit assessment score within a preset numerical range.

[0058] Specifically, global average pooling is an operation that reduces the dimensionality of features in the time dimension. Let the feature tensor output by the backbone of a temporal convolutional network model have a dimension of... ,in This indicates the number of time steps (365 in this example). This represents the number of feature channels. The global average pooling operation is performed on each feature channel. ( The average is taken over the time dimension, i.e. ,in Let represent the feature value of the c-th channel at time step t. After global average pooling, a fixed-length vector of dimension C is obtained. A two-layer cascaded fully connected network refers to a network structure consisting of two fully connected layers connected in series. The input of the first fully connected layer is z (with dimension C), and the output dimension is 64. ,in This is the weight matrix of the first fully connected layer (dimension 64×C). The bias vector is 64-dimensional. The first fully connected layer is followed by the Leaky ReLU activation function. The input to the second fully connected layer is... The output dimension is 1, that is ,in This is the weight matrix of the second fully connected layer (dimension 1×64). This is a bias scalar. The original value output by the second fully connected layer. It is an unnormalized scalar value, expressed by a linear scaling formula. The numerical conversion is completed, initially adjusting the numerical range to around the [0, 1000] interval. This scaling factor of 1000 corresponds to the upper limit of the preset numerical range [0, 1000]. Then, the value is processed by the Sigmoid function. Constrain the value to the interval (0,1), and finally pass... Output the final credit score within the range [0, 1000].

[0059] Secondly, the training loss function for the temporal convolutional network model adopts Huber Loss. Huber Loss is a loss function that combines the characteristics of mean squared error and mean absolute error, and it is defined as: for the predicted value... Compared with the true value Error between ,when hour, ;when hour, .in In this embodiment, to control the parameter of the switching threshold between squared loss and linear loss, Set to 1.0. This loss function is robust to outliers.

[0060] The temporal convolutional network model uses the AdamW optimizer. AdamW is a variant of the adaptive moment estimation optimization algorithm, which improves upon the Adam optimizer by decoupling weight decay from the gradient calculation of the loss function. The parameter update rule of the AdamW optimizer is as follows: for the current iteration number... ( , (Total number of iterations), first calculate the gradient of the loss function with respect to the parameter θ. Then update the first-order moment estimates respectively. and second-order moment estimation ,in , , and These are the exponential decay rates of the first and second moments, respectively. Then, the bias-corrected estimates are calculated. and Finally, update the parameters. ,in For learning rate, This is the weight decay coefficient. A small constant to maintain numerical stability. In this embodiment, the initial learning rate is... Set to 3×10 −4 Weight decay coefficient Set to 0.01, Set to 0.9, Set to 0.999. Set to 10 −8 .

[0061] In this embodiment, a cosine annealing dynamic adjustment strategy is adopted for the learning rate, and the dynamic range of the learning rate is 3×10. −6 (Minimum value) ) to 3×10 −4 (maximum value) The model checkpoint is saved every 5 training epochs. The specific implementation of the cosine annealing learning rate scheduling strategy is as follows: for the current training epoch ((0,1,…,E−1), where E is the total number of training epochs, E=100 in this embodiment), the current learning rate... The calculation formula is: This scheduling strategy keeps the learning rate high in the early stages of training to accelerate convergence, and gradually reduces it to a smaller value in the later stages of training to fine-tune the parameters, thereby improving the model's generalization performance. In this embodiment, the training batch size is set to 64, meaning that the parameters are updated once after calculating the gradient using 64 samples per batch.

[0062] The training process of the temporal convolutional network model in this embodiment is as follows: First, the input feature vectors, obtained after cleaning, alignment, feature extraction, and encoding, are input into the temporal convolutional network model in batches of 64. For each batch of data, the model performs forward propagation calculation, sequentially passing through an 8-layer residual block stacked structure for feature extraction, global average pooling dimensionality reduction, and mapping through a two-layer cascaded fully connected network, outputting the predicted credit assessment score for each sample in that batch. Then, the predicted value and the true value are substituted into the Huber Loss function to calculate the loss value. Next, the gradient of the loss value with respect to each model parameter is calculated using the backpropagation algorithm, and the model parameters are updated using the AdamW optimizer according to the aforementioned parameter update rules. After each training epoch (i.e., all training data is traversed once), the learning rate is updated according to the cosine annealing formula. Every 5 training epochs, the current model parameters are saved as checkpoints. This process is repeated until all 100 training epochs are completed, and finally, the checkpoint with the best performance on the validation set is selected as the training result. In the incremental learning scenario, after the initial training, whenever new feedback data is obtained, the model is fine-tuned for several epochs on the new data, starting from the current model parameters, following the same training process. Simultaneously, the aforementioned catastrophic forgetting suppression mechanism takes effect during the training process.

[0063] By compressing temporal features into a fixed-length vector representation through global average pooling, and then mapping this vector to a credit assessment score through a two-layer cascaded fully connected network, the transformation from temporal features to standardized credit assessment scores is realized. The robustness of Huber Loss to outliers and the decoupling of AdamW optimizer for weight decay, as well as the dynamic adjustment of the learning rate through the cosine annealing learning rate scheduling strategy, jointly ensure the stability and generalization ability of model training.

[0064] When a pharmaceutical retail terminal is a newly established terminal or has a short operating cycle, and the time span of its historical behavioral data is insufficient to support an effective evaluation by a temporal convolutional network model, credit assessment methods based on long-term time-series data cannot be directly applied. Therefore, in one embodiment, when the time span of the pharmaceutical retail terminal's historical behavioral data is less than a preset time span threshold, a cold start assessment is performed. A three-layer fully connected domain discriminator network was constructed, with the neurons in each layer having the first preset dimension, the second preset dimension, and 1 respectively, and the LeakyReLU activation function was used in each hidden layer. Binary cross-entropy is used as the loss function of the domain discriminator network, and domain adversarial training is carried out in combination with gradient inversion layer to align the feature distribution of the source domain pharmaceutical retail terminal with the feature distribution of the target domain pharmaceutical retail terminal. The cosine similarity metric is used to measure the consistency of feature distribution between the source and target domains, and a preset similarity threshold is set. When the cosine similarity is greater than or equal to a preset similarity threshold, a preset number of pharmaceutical retail terminals with the highest cosine similarity in the source domain are selected as reference samples. An initial credit vector for pharmaceutical retail terminals in the target domain is generated using a similarity-weighted average algorithm. The calculation formula is as follows: ,in This represents the cosine similarity of the i-th reference sample. Let i represent the standardized credit vector of the i-th reference sample. For preset quantity; When the cosine similarity is lower than the preset similarity threshold, the weighted average of the credit assessment scores of all pharmaceutical retail terminals in the source domain is used as the credit assessment score of pharmaceutical retail terminals in the target domain.

[0065] Specifically, a preset time span threshold is used to determine whether the terminal's historical behavior data is sufficient. In this embodiment, the preset time span threshold is 365 days. When the historical behavior data time span of the terminal is less than 365 days, the terminal is considered to have insufficient data, and a cold start assessment is performed. The source domain refers to a set of mature pharmaceutical retail terminals with sufficient historical behavior data (time span greater than or equal to 365 days), and the target domain refers to a set of newly added pharmaceutical retail terminals with insufficient data. The preset first dimension is set to 128 in this embodiment, and the preset second dimension is set to 64. The structure of the three-layer fully connected domain discriminator network is as follows: the input dimension of the first fully connected layer is the feature dimension C (consistent with the feature dimension of the temporal convolutional network model), and the output dimension is 128; the input dimension of the second fully connected layer is 128, and the output dimension is 64; the input dimension of the third fully connected layer is 64, and the output dimension is 1. Each hidden layer (the first fully connected layer and the second fully connected layer) is followed by a LeakyReLU activation function (with a negative slope of 0.01). The input to the domain discriminator network is the feature vector output from the hidden layer of the temporal convolutional network model, and the output is the probability that the feature vector belongs to the source domain. The binary cross-entropy loss function is defined as: Where N is the total number of samples, Let be the domain label of the k-th sample (source domain is 1, target domain is 0). The neighborhood discriminator network predicts the probability that a sample belongs to the source domain. The gradient reversal layer acts as an identity function during forward propagation (i.e., it does not change the input value), and multiplies the gradient by a negative value during backward propagation (i.e., it does not change the input value). ,in The gradient reversal coefficient causes the domain discriminator network and the feature extraction network to optimize towards opposite targets during adversarial training. Domain adversarial training forces the feature extraction network to learn domain-invariant feature representations by making the domain discriminator unable to accurately distinguish the features of the source and target domains, thereby achieving feature distribution alignment. The cosine similarity is calculated using existing techniques, with a value range of [-1, 1]. The closer the value is to 1, the more similar the two vectors are. A preset similarity threshold is used to determine whether the feature distributions of the source and target domains are sufficiently consistent for feature transfer; in this embodiment, it is set to 0.85. The preset number n is the number of selected reference samples; in this embodiment, it is set to 5. The weighted average algorithm means that the standardized credit vectors of all reference samples are weighted and averaged using the cosine similarity of each reference sample as the weight to obtain the initial credit vector of the target domain. When the maximum cosine similarity between the target domain terminal and each terminal in the source domain is lower than the preset similarity threshold of 0.85, it indicates that there are no terminals in the source domain that are sufficiently similar to the feature distribution of the target domain. In this case, the weighted average of the credit assessment scores of all pharmaceutical retail terminals in the source domain (with the sample size or confidence level of each terminal as the weight) is used as the credit assessment score of the target domain terminal. This method serves as a fallback solution for cold start assessment, ensuring that credit assessment results can be output without omissions under any circumstances.

[0066] By constructing a three-layer fully connected domain discriminator network and implementing domain adversarial training, the distribution alignment of mature terminal features in the source domain and newly added terminal features in the target domain was achieved. The consistency of domain feature distribution was quantified by using cosine similarity, and the reference sample with the highest similarity was selected for weighted averaging to generate the initial credit vector of the target domain, thus achieving accurate credit assessment of newly added terminals in scenarios with insufficient data. The industry benchmark score was used as a fallback solution to ensure that all terminals could be assessed without omission.

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

[0068] Secondly, based on the same inventive concept, this application also provides a system for implementing the credit assessment method based on pharmaceutical retail terminal behavioral data as described above. The solution provided by this system is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more system embodiments provided below can be found in the limitations of the credit assessment method based on pharmaceutical retail terminal behavioral data described above, and will not be repeated here.

[0069] In one embodiment, such as Figure 4 As shown, the system includes: a data processing module, a credit assessment module, and an incremental update module. Among them: The data processing module is used to acquire multi-source behavioral data of pharmaceutical retail terminals within a preset historical time period, clean and align the multi-source behavioral data to obtain aligned behavioral data with a unified time axis. The credit assessment module is used to extract the temporal features of aligned behavioral data and generate an input feature vector. The input feature vector is then fed into a temporal convolutional network model, and the credit assessment score of the pharmaceutical retail terminal is obtained from the output of the temporal convolutional network model. The incremental update module is used to obtain credit event data that actually occurs in pharmaceutical retail terminals after credit assessment as feedback data, and to update the parameters of the temporal convolutional network model based on the feedback data using an incremental learning approach. The incremental learning approach includes: constructing a historical risk probe set composed of terminal samples that meet preset risk conditions from historical credit samples; calculating the spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the model and the feature distribution of historical risk probe set samples in the hidden layer of the model before each incremental update; and dynamically adjusting the weight of the historical risk probe set in the global loss function based on the spatial distribution distance.

[0070] In one embodiment, the data processing module includes a data acquisition unit. This data acquisition unit is used to acquire multi-source behavioral data, which includes: institutional compliance dimension data, transaction behavior dimension data, operational behavior dimension data, market behavior dimension data, and external correlation dimension data.

[0071] In one embodiment, the data processing module includes a data cleaning unit. The data cleaning unit determines whether the timestamps of each behavioral data item acquired in the current batch are valid. It marks behavioral data with invalid timestamps as time-series unusable data, extracts the business field values ​​from the time-series unusable data, calculates the sum, mean, and count of the business field values ​​for each terminal, and uses the calculated sum, mean, and count as static features. These static features are then fused with the time-series features during the generation of the credit assessment score. The data cleaning unit also treats behavioral data with valid timestamps as existing sequence data, extracts the timestamps of each behavioral data item from the existing sequence data, and performs a global ascending sort on the existing sequence data to obtain the sorted existing sequence data. Finally, for the sorted existing sequence data, the data cleaning unit detects the time interval between the timestamps of two adjacent behavioral data items. If the time interval is greater than a preset time threshold, it marks a time-series missing window between the two adjacent behavioral data items. The data cleaning unit performs the following fill operations on behavioral data with valid timestamps but missing business field values ​​in the sorted existing sequence data: If the behavioral data has both adjacent valid forward and backward timestamps on the timeline, linear interpolation is used to fill the data using the business field values ​​of the valid forward and backward timestamps; if only valid forward or backward timestamps exist, the business field values ​​of the existing timestamps are used for filling; if no valid timestamps from the same terminal exist in the sorted existing sequence data, preset industry default values ​​are used for filling. After completing the ascending sort, the data cleaning unit uses newly collected behavioral data during subsequent operations of the existing sequence data as incremental behavioral data. The data cleaning unit, upon acquiring incremental behavioral data, searches for the adjacent preceding and following timestamps of the incremental behavioral data's timestamp in the sorted existing sequence data. It calculates a first difference between the incremental behavioral data's timestamp and its adjacent preceding timestamp, and a second difference between its timestamp and its adjacent following timestamp. If the first difference is negative or the second difference is positive, the incremental behavioral data is determined to be temporally overlapping anomalous data. For incremental behavioral data determined to be temporally overlapping anomalous data, the data cleaning unit uses a binary search algorithm to locate the standard insertion position of the incremental behavioral data in the sorted existing sequence data and inserts the incremental behavioral data into that position.

[0072] In one embodiment, the data processing module includes a time-series alignment unit. This unit uses a preset number of days as a unified time-series standard. For behavioral data sequences with a time span greater than the preset number of days, it truncates redundant time-series data at the tail, retaining only the effective operational feature sequences at the front end. For behavioral data sequences with a time span less than the preset number of days, it pads the data to the preset number of days using zero-padding. The time-series alignment unit also uses a dynamic time warping algorithm to perform cross-scale feature alignment between high-frequency and low-frequency behavioral data sequences, calculating the matching path between them. The dynamic time warping algorithm uses a constraint window with a preset window radius and fixes the standardized boundary conditions as follows: ,in, Represents the cumulative distance matrix. A time-series index representing a high-frequency behavioral data sequence. This represents the time-series index of the low-frequency behavior data sequence. The time-series alignment unit is used to interpolate and complete the low-frequency behavior data sequence to a daily unified time-series axis based on the matching path using a linear interpolation algorithm, resulting in a daily-level low-frequency behavior data sequence; for high-frequency behavior data sequences, the original daily data is retained without interpolation processing.

[0073] In one embodiment, the credit assessment module includes a feature extraction unit. This feature extraction unit transforms the aligned behavior data into a standardized feature vector of a first preset dimension and generates a relative position encoding vector of a second preset dimension, wherein the relative position encoding vector is initialized using a sine-cosine function. The feature extraction unit then fuses the standardized feature vector and the relative position encoding vector using the following formula: ,in Represents the standardized feature vector. Represents a relative position encoding vector. This represents the input feature vector obtained after fusion. The learnable weight parameters take values ​​in the range [0,1]. The feature extraction unit is used to synchronously participate in backpropagation and joint training with the backbone parameters of the temporal convolutional network model, and introduces L2 regularization constraints.

[0074] In one embodiment, the incremental update module includes a probe construction unit. This probe construction unit is used to select terminal samples that meet preset risk conditions from historical credit assessment samples to construct a historical risk probe set of preset capacity; and to rotate and update a preset proportion of samples in the historical risk probe set according to a preset period.

[0075] In one embodiment, the incremental update module includes a ratio setting unit. This ratio setting unit is used to re-select terminal samples that meet preset risk conditions based on the latest historical credit assessment samples according to a preset period, replacing an equal number of original samples in the historical risk probe set, with the replacement ratio being a preset ratio.

[0076] In one embodiment, the incremental update module includes a distribution offset calculation unit. This unit uses the maximum mean difference algorithm to calculate the spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the temporal convolutional network model and the feature distribution of historical risk probe set samples in the hidden layer of the temporal convolutional network model.

[0077] In one embodiment, the incremental update module includes a weight dynamic adjustment unit. This weight dynamic adjustment unit is used to increase the weight of the historical risk probe set in the global loss function by a preset adjustment step size when the spatial distribution distance is greater than a preset offset threshold.

[0078] In one embodiment, the incremental update module is further used to solve the Fisher information matrix of the convolution kernel weights and fully connected layer parameters of the temporal convolutional network model, and to apply regularization constraints with regularization coefficients to the convolution kernel weights and fully connected layer parameters of the temporal convolutional network model based on the Fisher information matrix; to perform Monte Carlo sampling to fit the Fisher information matrix using historical credit sample data of a preset proportion; wherein the regularization coefficient is performed in a grid search within a preset value range, and the optimal regularization coefficient value is selected by cross-validation of the validation set.

[0079] The modules in the aforementioned credit assessment system based on pharmaceutical retail terminal behavioral data can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can invoke and execute the corresponding operations of each module.

[0080] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores all data required for system operation. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a credit assessment method based on behavioral data from pharmaceutical retail terminals.

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

[0082] Thirdly, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described in the above method embodiments.

[0083] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of any of the methods described in the above method embodiments.

[0084] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

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

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

Claims

1. A credit assessment method based on behavioral data from pharmaceutical retail terminals, characterized in that, The method includes: Acquire multi-source behavioral data of pharmaceutical retail terminals within a preset historical time period, and perform cleaning and time-series alignment processing on the multi-source behavioral data to obtain aligned behavioral data with a unified time axis; After extracting the temporal features of the alignment behavior data, an input feature vector is generated. The input feature vector is then input into a temporal convolutional network model, and the credit assessment score of the pharmaceutical retail terminal output by the temporal convolutional network model is obtained. The system acquires actual credit event data of the pharmaceutical retail terminal after credit assessment as feedback data, and updates the parameters of the temporal convolutional network model using an incremental learning approach based on the feedback data. The incremental learning approach includes: constructing a historical risk probe set composed of terminal samples from historical credit samples that meet preset risk conditions; calculating the spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the model and the feature distribution of the historical risk probe set samples in the hidden layer of the model before each incremental update; and dynamically adjusting the weight of the historical risk probe set in the global loss function based on the spatial distribution distance.

2. The method according to claim 1, characterized in that, The multi-source behavioral data includes: institutional compliance data, transaction behavior data, business behavior data, market behavior data, and external relationship data.

3. The method according to claim 1, characterized in that, The cleaning process for the multi-source behavioral data includes: Determine whether the timestamps of each behavioral data item acquired in the current batch are valid; Invalid timestamp behavior data is marked as unavailable time series data. The business field values ​​of the unavailable time series data are extracted. The sum, mean and count of the business field values ​​are calculated for each terminal. The calculated sum, mean and count are used as static features. The static features are used to be fused with time series features in the process of generating credit assessment scores. The behavior data with valid timestamps are used as the existing sequence data. The timestamps of each behavior data in the existing sequence data are extracted. The existing sequence data is then sorted in global ascending order to obtain the sorted existing sequence data. For the sorted existing sequence data, the time interval between the timestamps of two adjacent behavioral data is detected. If the time interval is greater than a preset time threshold, a time-series missing window is marked between the two adjacent behavioral data. For behavioral data in the sorted existing sequence data that has valid timestamps but missing business field values, the following filling operation is performed: If the behavioral data has both adjacent valid forward timestamps and valid backward timestamps on the timeline, linear interpolation is performed using the business field values ​​of the valid forward timestamps and the valid backward timestamps; if only the valid forward timestamps or only the valid backward timestamps exist, the business field values ​​of the valid timestamps on the existing side are used for filling; if there are no valid timestamps from the same terminal in the sorted existing sequence data, a preset industry default value is used for filling. After the ascending sort is completed, the newly collected behavioral data in the subsequent operation of the existing sequence data will be used as incremental behavioral data. When the incremental behavior data is obtained, the adjacent preceding timestamp and adjacent following timestamp of the timestamp of the incremental behavior data are searched in the sorted existing sequence data. The first difference between the timestamp of the incremental behavior data and the adjacent preceding timestamp and the second difference between the timestamp of the incremental behavior data and the adjacent following timestamp are calculated respectively. If the first difference is negative or the second difference is positive, the incremental behavior data is determined to be time-overlapping abnormal data. For incremental behavioral data that is determined to be time-series overlapping abnormal data, a binary search algorithm is used to locate the standard insertion position of the incremental behavioral data in the sorted existing sequence data, and the incremental behavioral data is inserted into the standard insertion position.

4. The method according to claim 1, characterized in that, The temporal alignment processing of the multi-source behavioral data includes: Using a preset number of days as a unified time series standard, for behavioral data sequences with a time span greater than the preset number of days, redundant time series data at the end is truncated, and valid operational feature sequences at the front end are retained; for behavioral data sequences with a time span less than the preset number of days, zero padding at the end is used to pad to the preset number of days. A dynamic time warping algorithm is used to perform cross-scale feature alignment between high-frequency and low-frequency behavioral data sequences, calculating the matching path between them. The dynamic time warping algorithm employs a constraint window with a preset window radius and fixes the standardized boundary conditions as follows: ,in, Represents the cumulative distance matrix. The time-series index representing the high-frequency behavioral data sequence. The time-series index represents the low-frequency behavior data sequence; For the low-frequency behavior data sequence, a linear interpolation algorithm is used, and the low-frequency behavior data sequence is interpolated and completed to a daily unified time series axis based on the matching path to obtain a daily low-frequency behavior data sequence; for the high-frequency behavior data sequence, the original daily data is retained without interpolation processing.

5. The method according to claim 1, characterized in that, The step of extracting the temporal features of the alignment behavior data and generating the input feature vector includes: The alignment behavior data is transformed into a standardized feature vector of a first preset dimension, and a relative position encoding vector of a second preset dimension is generated, wherein the relative position encoding vector is initialized using a sine-cosine function. The standardized feature vector and the relative position encoding vector are fused using the following formula: in This represents the standardized feature vector. This represents the relative position encoding vector. This represents the input feature vector obtained after fusion. These are learnable weight parameters, with values ​​ranging from [0,1]. The learnable weight parameters are synchronously used in backpropagation and joint training with the backbone parameters of the temporal convolutional network model, and L2 regularization constraints are introduced.

6. The method according to claim 1, characterized in that, The construction of a historical risk probe set consisting of terminal samples that meet preset risk conditions from historical credit samples includes: screening terminal samples that meet the preset risk conditions from historical credit assessment samples to construct a historical risk probe set of preset capacity; rotating and updating samples in the historical risk probe set at a preset ratio according to a preset period; and, according to the preset period, re-screening terminal samples that meet the preset risk conditions based on the latest historical credit assessment samples to replace an equal number of original samples in the historical risk probe set, with the replacement ratio being the preset ratio. The spatial distribution distance between the feature distribution of the newly added training task samples in the hidden layer of the model and the feature distribution of the historical risk probe set samples in the hidden layer of the model is calculated using the maximum mean difference algorithm. The step of dynamically adjusting the weight of the historical risk probe set in the global loss function based on the spatial distribution distance includes: when the spatial distribution distance is greater than a preset offset threshold, increasing the weight of the historical risk probe set in the global loss function by a preset adjustment step size.

7. The method according to claim 6, characterized in that, The incremental learning method also includes: Solve for the Fisher information matrix of the convolution kernel weights and fully connected layer parameters of the temporal convolutional network model, and apply regularization constraints with regularization coefficients to the convolution kernel weights and fully connected layer parameters of the temporal convolutional network model based on the Fisher information matrix. The Fischer information matrix is ​​fitted using Monte Carlo sampling of the historical credit sample data at a preset ratio. The regularization coefficient is obtained by grid search within a preset value range, and the optimal regularization coefficient value is selected by cross-validation of the validation set.

8. A credit assessment system based on pharmaceutical retail terminal behavioral data, characterized in that, The system includes: The data processing module is used to acquire multi-source behavioral data of pharmaceutical retail terminals within a preset historical time period, and to perform cleaning and time-series alignment processing on the multi-source behavioral data to obtain aligned behavioral data with a unified time axis. The credit assessment module is used to extract the temporal features of the aligned behavior data to generate an input feature vector, input the input feature vector into the temporal convolutional network model, and obtain the credit assessment score of the pharmaceutical retail terminal output by the temporal convolutional network model. The incremental update module is used to acquire credit event data that actually occurs in the pharmaceutical retail terminal after credit assessment as feedback data, and update the parameters of the temporal convolutional network model based on the feedback data using an incremental learning method. The incremental learning method includes: constructing a historical risk probe set composed of terminal samples that meet preset risk conditions from historical credit samples; calculating the spatial distribution distance between the feature distribution of newly added training task samples in the hidden layer of the model and the feature distribution of the historical risk probe set samples in the hidden layer of the model before each incremental update; and dynamically adjusting the weight of the historical risk probe set in the global loss function according to the spatial distribution distance.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the credit assessment method based on pharmaceutical retail terminal behavior data as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the credit assessment method based on pharmaceutical retail terminal behavior data as described in any one of claims 1 to 7.