Method and device for quantitatively evaluating cross-scene data adaptation degree, equipment and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN SHUCHUANG FUTURE TECH CO LTD
- Filing Date
- 2026-04-30
- Publication Date
- 2026-08-07
AI Technical Summary
[0005]本发明提出一种跨场景数据适配度的量化评估方法、装置、设备及介质,以解决现有跨场景数据适配度评估方法评估维度单一、对数据类型敏感、实时性差、计算成本高、泛化能力弱、缺乏场景自适应机制、评估结果鲁棒性差的问题
本发明跨场景数据适配度的量化评估方法、装置、设备及介质评估方法能够实现多类型数据跨场景适配度续值输出、摆脱了标注与预训练模型依赖、提高了实时性和泛化能力、降低了计算成本、强化了场景自适应机制,评估结果鲁棒性优异。
Smart Images

Figure CN122528098A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cross-scenario data processing technology, and in particular to a method, apparatus, device and medium for quantitatively evaluating cross-scenario data adaptability. Background Technology
[0002] Current cross-scenario data adaptation evaluation mainly includes: Evaluation based on distribution differences: using KL divergence, JS divergence, MMD, etc., to calculate the data distribution distance between the source and target domains for domain adaptation and transfer learning. Evaluation based on metadata and rules: performing compliance checks and scoring based on field names, data types, value ranges, completeness, and format specifications. Evaluation based on feature similarity: extracting shallow features from the data and calculating matching degree using cosine similarity, Euclidean distance, etc. Evaluation based on task performance: applying the data to the target task and using performance indicators such as model accuracy, error, and recall to evaluate data adaptability. Evaluation based on statistical indicators: using statistical measures such as mean, variance, quantiles, and correlation coefficients to compare data consistency.
[0003] The aforementioned existing technologies have the following drawbacks: they have a single evaluation dimension, focusing only on one aspect among distribution, structure, and semantics, and cannot comprehensively characterize cross-scenario adaptability; they are sensitive to data types, making it difficult to simultaneously and uniformly process heterogeneous data such as structured, unstructured, time-series, and streaming data; they rely on labeled data, model training, or manual rules, resulting in poor real-time performance, high computational costs, and weak generalization ability; they lack a scenario adaptation mechanism, with fixed weights for evaluation dimensions in different business scenarios, leading to a disconnect between results and business needs; and the evaluation results have poor robustness, being susceptible to noise, outliers, and distribution drift, and lack calibration and correction mechanisms.
[0004] Therefore, a quantitative evaluation method, device, equipment, and medium for cross-scenario data adaptability was developed to solve the above problems. Summary of the Invention
[0005] This invention proposes a quantitative evaluation method, device, equipment, and medium for cross-scenario data adaptability, in order to solve the problems of existing cross-scenario data adaptability evaluation methods, such as single evaluation dimension, sensitivity to data type, poor real-time performance, high computational cost, weak generalization ability, lack of scenario adaptation mechanism, and poor robustness of evaluation results.
[0006] The present invention achieves the above objectives through the following technical solutions: This invention provides a quantitative evaluation method for cross-scenario data adaptability, comprising: Acquire source scenario data, target scenario data, and current scenario data. Source scenario data includes store product information data, store transaction data, and store user interaction data. Target scenario data includes platform-unified product profile data, cross-store transaction summary data, and integrated store user profile data. Current scenario data includes store product information data, store transaction data, and store user interaction data for the current scenario. The current scenario refers to the current business scenario for which the cross-scenario data adaptation assessment is being performed.
[0007] Data cleaning and standardization are performed on the source scene data, target scene data, and current scene data to obtain the processed source scene data and target scene data. Structured data features, unstructured data features, and time-series data features are extracted from the source scene data, target scene data, and current scene data, respectively, to obtain the standardized feature vectors of the source scene, the standardized feature vector of the target scene, and the feature vector of the current scene. Calculate the structural fit, semantic fit, distribution fit, and dynamic stability fit of the standardized feature vectors of the source scene and the standardized feature vectors of the target scene; Using the current scene feature vector as input and the historical best weight as label, the initial weights of each fitness level are obtained by training a linear regression model with L1 regularization. The initial weights of each fitness level are then adjusted according to the scene type to obtain the final weights of each fitness level. The final cross-scenario data adaptation degree is obtained by calculating the weighted sum of structural adaptation degree, semantic adaptation degree, distribution adaptation degree, and dynamic stability adaptation degree based on the weights of each adaptation degree.
[0008] Furthermore, data cleaning and standardization processing is performed on the source scene data, target scene data, and current scene data, including: Missing values are handled for source scene data, target scene data, and current scene data; Filter outliers from the source scene data, target scene data, and current scene data; Standardize the format of source scene data, target scene data, and current scene data; The source scene data, target scene data, and current scene data are sampled using a stratified sampling method.
[0009] Furthermore, structured data features, unstructured data features, and time-series data features are extracted from the source scene data, target scene data, and current scene data, respectively, to obtain standardized feature vectors for the source scene, target scene, and current scene, including: Structured data features are extracted from the structured data in the source scene data, target scene data, and current scene data. The structured data features include field set, field matching pairs, data type, non-empty rate, value range, and field correlation coefficient. Unstructured data features are extracted from the unstructured data in the source scene data, target scene data, and current scene data. The unstructured data features include semantic vectors, topic distribution, length statistics, and word overlap. Temporal data features are extracted from the source scene data, target scene data, and current scene data. The temporal data features include basic statistics, fluctuation coefficient, autocorrelation coefficient, and trend features. The basic statistics include the mean, variance, and quartiles within each time window. The structured data features, unstructured data features, and time-series data features extracted from the source scene data are concatenated sequentially to obtain the standardized feature vector of the source scene. The structured data features, unstructured data features, and time-series data features extracted from the target scene data are sequentially concatenated to obtain the standardized feature vector of the target scene; The structured data features, unstructured data features, and time-series data features extracted from the current scene data are concatenated in sequence to obtain the current scene feature vector.
[0010] Furthermore, the structural fit, semantic fit, distribution fit, and dynamic stability fit of the source scene standardized feature vector and the target scene standardized feature vector are calculated, including: Calculate the field matching rate, type consistency rate, integrity similarity, and value range overlap of the standardized feature vectors of the source scene and the standardized feature vectors of the target scene. Calculate the weighted sum of the field matching rate, type consistency rate, integrity similarity, and value range overlap based on the preset first weighted reorganization to obtain the structural fit. Calculate the semantic vector cosine similarity, topic similarity, and common vocabulary ratio of the standardized feature vectors of the source scene and the standardized feature vectors of the target scene. Calculate the weighted sum of the semantic vector cosine similarity, topic similarity, and common vocabulary ratio based on the preset second weighting to obtain the semantic fit. Based on the key numerical features in the standardized feature vectors of the source scene and the target scene, respectively construct the source scene histogram and the target scene histogram, calculate the intersection-union ratio and quantile similarity of the source scene histogram and the target scene histogram, and calculate the weighted sum of the intersection-union ratio and quantile similarity based on the preset third weighted reorganization to obtain the distribution fit. Based on the preset window size and window overlap rate, the source scene standardized feature vector and the target scene standardized feature vector are divided into continuous sliding windows. The basic statistics of all windows corresponding to the source scene standardized feature vector and the target scene standardized feature vector are calculated respectively, and the source scene statistics change sequence and the target scene statistics change sequence are obtained respectively. Based on the source scene statistics change sequence and the target scene statistics change sequence, the source scene statistics drift and the target scene statistics drift of each window are calculated. Based on the source scene statistics drift and the target scene statistics drift of each window, the source scene average window drift and the target scene average window drift are calculated. The dynamic drift coefficient is calculated by the ratio of the source scene average window drift and the target scene average window drift to the preset global maximum allowable drift. Windows whose source scene statistics drift and the target scene statistics drift exceed the preset drift threshold are counted as abnormal windows. The abnormal fluctuation ratio is calculated by the ratio of the abnormal window number to the total number of windows. The dynamic stability fit is calculated by the difference between the dynamic drift coefficient and the abnormal fluctuation ratio.
[0011] Furthermore, the scenario types include structured scenarios, unstructured scenarios, data migration scenarios, and streaming real-time scenarios. The initial weights of each adaptation level are adjusted according to the scenario type to obtain the final weights for each adaptation level, including: The corrected weights for each fitness level in the structured scenario are calculated based on the pre-defined structured scenario weight reorganization and the weights of each fitness level. The corrected weights for each fitness level in the unstructured scenario are calculated based on the pre-defined unstructured scenario weight reorganization and the weights of each fitness level. The corrected weights for each fitness level under the data migration scenario are calculated based on the pre-defined data migration scenario weight reorganization and the weights of each fitness level. The corrected weights for each adaptation degree in the streaming real-time scene are calculated based on the preset weight reorganization of the streaming real-time scene and the weights of each adaptation degree. The corrected weights for each fitness level in structured scenarios, unstructured scenarios, data migration scenarios, and streaming real-time scenarios are normalized using the softmax function to obtain the final weights for each fitness level.
[0012] Furthermore, it also includes deviation calibration, which includes: Collect historical data pairs and true adaptation tags. Historical data pairs include source scenario historical data and target scenario historical data that have been paired. True adaptation tags refer to the actual scores (between 0 and 1) of the paired S and T data after manual annotation or business effect verification. An isotonic regression model is used, with the final cross-scene data fit degree corresponding to the paired source scene historical data and target scene historical data as input, and the real fit label as output, to train the isotonic regression model to obtain the calibrated model. The final cross-scenario data fit is corrected based on the calibration model to obtain the calibrated score.
[0013] Furthermore, it also includes anomaly correction for calibrated scores, including: An anomaly threshold is pre-set. If the fit of any dimension of structural fit, semantic fit, distribution fit, or dynamic stability fit is less than the anomaly threshold, the corresponding fit is marked as an anomaly. Anomaly penalty correction is performed. The correction calculation formula is: Corrected score = Calibrated score × (1 - 0.1 × Number of anomaly dimensions). The number of anomaly dimensions refers to the total number of dimensions of anomaly fit. The corrected score is ≥ 0.
[0014] The present invention also provides an apparatus for the quantitative evaluation method of cross-scenario data adaptability, comprising: The acquisition module is used to acquire source scene data, target scene data and current scene data. The source scene data and current scene data include store product information data, store transaction data and store user interaction data under the source scene and current scene, respectively. The target scene data includes platform unified product profile data, cross-store transaction summary data and store user profile integration data under the target scene. The processing module is used to perform data cleaning and standardization on the source scene data, target scene data and current scene data to obtain the processed source scene data and target scene data. The extraction module is used to extract structured data features, unstructured data features, and time-series data features from the source scene data, target scene data, and current scene data, respectively, to obtain a standardized feature vector of the source scene, a standardized feature vector of the target scene, and a feature vector of the current scene. The calculation module is used to calculate the structural fit, semantic fit, distribution fit, and dynamic stability fit of the source scene standardized feature vector and the target scene standardized feature vector. The weight module is used to train the initial weights of each fitness level based on a linear regression model with L1 regularization, with the current scene feature vector as input and the historical best weights as labels. The initial weights of each fitness level are then adjusted according to the scene type to obtain the final weights of each fitness level. The weighting module calculates the weighted sum of structural adaptability, semantic adaptability, distribution adaptability, and dynamic stability adaptability based on the weights of each adaptability, and obtains the final cross-scene data adaptability.
[0015] This invention also provides a quantitative evaluation device for cross-scenario data adaptability, comprising: Memory, used to store computer programs; A processor is used to implement the steps of the quantitative evaluation method for cross-scenario data adaptability when executing the computer program.
[0016] The present invention also provides a medium, which is a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the quantitative evaluation method for cross-scenario data adaptability.
[0017] The beneficial effects of this invention are as follows: The present invention provides a quantitative evaluation method, device, equipment, and medium for cross-scene data adaptability. This method can achieve continuous output of cross-scene adaptability values for multiple types of data, eliminates the dependence on annotation and pre-trained models, improves real-time performance and generalization ability, reduces computational costs, strengthens scene adaptation mechanisms, and provides excellent robustness in evaluation results.
[0018] Construct a unified quantization framework to achieve cross-scenario adaptation of various data types, such as structured, unstructured, and time-series data, with continuous values of [0,1]. It provides an unsupervised, lightweight, and real-time executable end-to-end evaluation algorithm, eliminating the dependence on labeled and pre-trained models; Establish a four-dimensional joint evaluation mechanism encompassing structure, semantics, distribution, and dynamic stability to enhance comprehensiveness and robustness; Implement adaptive allocation of scene weights, automatically adjusting the weights of each dimension based on scene type, data type, and business attributes; To suppress evaluation biases caused by noise, outliers, and distribution drift, a result calibration and anomaly correction process is added. Attached Figure Description
[0019] Figure 1 This is a flowchart of the quantitative evaluation method for cross-scenario data adaptability in this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0022] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0023] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0024] like Figure 1 As shown, a quantitative evaluation method for cross-scenario data adaptability includes: S1: Obtain source scenario data, target scenario data, and current scenario data. Source scenario data includes store product information data, store transaction data, and store user interaction data. Target scenario data includes platform unified product profile data, cross-store transaction summary data, and store user profile integration data. Current scenario data includes store product information data, store transaction data, and store user interaction data for the current scenario. The current scenario refers to the current business scenario for which the cross-scenario data adaptation assessment is being performed.
[0025] S2: Perform data cleaning and standardization on the source scene data, target scene data, and current scene data to obtain the processed source scene data and target scene data; S3: Extract structured data features, unstructured data features, and time-series data features from the source scene data, target scene data, and current scene data respectively to obtain the standardized feature vectors of the source scene, target scene, and current scene. S4: Calculate the structural fit, semantic fit, distribution fit, and dynamic stability fit of the source scene standardized feature vector and the target scene standardized feature vector; S5: Using the current scene feature vector as input and the historical best weight as label, a linear regression model with L1 regularization is used to train and obtain the initial weights of each fitness level. The initial weights of each fitness level are then adjusted according to the scene type to obtain the final weights of each fitness level. S6: Calculate the weighted sum of structural fit, semantic fit, distribution fit, and dynamic stability fit based on the weights of each fit degree to obtain the final cross-scene data fit degree.
[0026] The specific steps of a quantitative evaluation method for cross-scenario data adaptability are as follows: Step 1: Data cleaning and standardized preprocessing.
[0027] Sub-step 1: Handling missing values.
[0028] The missing rate of each field in the source scenario data S and the target scenario data T is calculated separately. The missing rate threshold is set to 30% (which can be adjusted according to the scenario configuration). Fields with a missing rate > 30% are marked as "low availability fields" and their weight is reduced in subsequent evaluations. The fields mentioned above refer to structured data, including: Product data fields: Product ID, Title, Price, Inventory, Category, Sales Volume; Order data fields: Order number, User ID, Payment amount, Order time, Status; User data fields: User ID, Gender, Age, Region, Membership Level; Perform data population for different data types: Numeric fields are populated with the median of the field (to avoid the mean being affected by outliers); categorical fields are populated with the mode of the field; text fields are uniformly populated with empty placeholders (□) without changing the original semantic structure of the text. Numeric fields include price and quantity; text fields include title and description; categorical fields include payment method and logistics status.
[0029] Sub-step 2: Outlier filtering.
[0030] Numerical fields: Outliers are identified using the interquartile range (IQR) method. The IQR is calculated as IQR = Q3 - Q1 (where Q1 is the lower quartile and Q3 is the upper quartile). Data values less than Q1 - 1.5 × IQR or greater than Q3 + 1.5 × IQR are considered outliers and are directly removed (if the outlier percentage is <5%) or corrected using Q3 + 1.5 × IQR (upper limit) or Q1 - 1.5 × IQR (lower limit) (if the outlier percentage is ≥5%). Text fields: Remove text containing garbled characters or special symbols that account for more than 20% of the text, and remove excessively long / excessively short noisy text with a length of less than 3 characters or more than 1000 characters.
[0031] Sub-step 3: Standardize the format.
[0032] Structured data: Unified field naming rules (lowercase letters + underscores, such as user_id), numerical units (such as length being uniformly "meters", time being uniformly "seconds"), numerical precision (keeping 2 decimal places), encoding format (UTF-8), timestamp format (yyyy-MM-ddHH:mm:ss); Unstructured data: uniformly encoded as UTF-8, uniform length (truncated to 1000 characters for excessively long texts, padded to 3 characters for excessively short texts, with "□" as a placeholder for padding); Time series data: uniform sampling frequency (e.g., 1 minute / time, padding for insufficient sampling frequency, downsampling for excessive sampling frequency), uniform time window (e.g., 1 hour / window), aligned time axis (based on the target scene time axis, filling missing time points in the source scene data with padding values).
[0033] Sub-step 4: Data subset sampling.
[0034] If the amount of data in S or T is greater than 10,000, a stratified sampling method is adopted, sampling up to 10,000 data points according to data category (structured / unstructured / time series) and data distribution ratio, ensuring that the difference in the amount of data between S and T is ≤20%, so as to avoid the difference in the amount of data affecting the evaluation results.
[0035] Step 2: Multimodal unified feature extraction.
[0036] Sub-step 1: Structured data feature extraction.
[0037] For the preprocessed structured data, six core features are extracted to form a structured feature set: Field sets: The field set of S is F_S_struct={f_S1,f_S2,...,f_Sn}, and the field set of T is F_T_struct={f_T1,f_T2,...,f_Tm}; Field matching pairs: Matching is performed based on string similarity (threshold ≥ 0.8) to obtain matching field pairs {(f_Si,f_Tj)}; String similarity is calculated using a weighted method combining edit distance and Jaccard similarity: First, S and T are standardized by removing special characters, unifying word segmentation, character formatting, and eliminating meaningless prefixes and suffixes. The minimum number of character additions / deletions / modifications required to convert one field name to another is calculated and then normalized to a similarity score. Edit distance similarity is calculated using the formula on the left, with a value range of [0,1]. Higher values indicate higher character-level matching. The weighting ratio is 0.6. Next, Jaccard lexical similarity is calculated, splitting the field name into independent semantic lexical units. The intersection and union ratio of these lexical units is calculated using the formula on the left, with a value range of [0,1]. Higher values indicate higher semantic-level matching. The weighting ratio is 0.4, which can be adjusted according to actual conditions, with a default of 6:4. Finally, the final similarity is calculated using the weighted average formula: Final Similarity = 0.6 * Edit Distance Similarity + 0.4 * Jaccard Dimensional Similarity. If the final similarity is ≥ 0.8, it is considered a valid matching field and included in the set.
[0038] Data type: Records the data type of each field (int, float, string, datetime, etc.); Non-null rate: The number of non-null fields in each field / the total number of non-null fields; Value range: [minimum value, maximum value] for numeric fields, and the set of values for categorical fields; Field correlation coefficient: Calculates the Pearson correlation coefficient between numerical fields (value range [-1, 1]).
[0039] Sub-step 2: Feature extraction from unstructured data.
[0040] For the preprocessed unstructured text data, three types of core features are extracted to form an unstructured feature set: Semantic Vectors: Lightweight semantic models (such as MiniLM-L6-v2) are used to convert each text into a 384-dimensional fixed-length semantic vector, avoiding the high computational cost of pre-trained models; Topic distribution: The LDA topic model is used (the number of topics is set to 5-10, which can be configured according to the scenario) to calculate the topic distribution probability vector for each text. Length statistics and vocabulary overlap: Count the number of effective words in each text (excluding stop words), and calculate the number of common words between S and T (excluding stop words).
[0041] Sub-step 3: Time series data feature extraction.
[0042] For the preprocessed time series data, five core features are extracted according to a unified time window to form a time series feature set: Basic statistics: mean μ, variance σ², and quartiles (Q1, Q2, Q3) within each window; Fluctuation coefficient: CV = σ / μ (eliminating the influence of dimensions and reflecting the degree of data fluctuation); Autocorrelation coefficient: Calculate the autocorrelation coefficient with lag 1 (reflecting the continuity of time series data); Trend characteristics: The slope k of the data within each window is calculated by linear regression to determine the trend (k>0 indicates an upward trend, k<0 indicates a downward trend, and k=0 indicates a stable trend).
[0043] Sub-step 4: Feature vector output.
[0044] The extracted structured, unstructured, and temporal features are concatenated in the order of "structured features → unstructured features → temporal features" to form the source scene standardized feature vector F_S and the target scene standardized feature vector F_T, ensuring that the dimensions of F_S and F_T are consistent (insufficient dimensions are padded with 0).
[0045] Step 3: Calculate the structural fit S1.
[0046] Sub-step 1: Calculate the field matching rate.
[0047] Formula: Field matching rate = Number of valid matching field pairs / max(Total number of fields S, Total number of fields T); Note: Valid matching field pairs refer to field pairs with a string similarity ≥ 0.8. max(total number of fields S, total number of fields T) avoids deviations caused by differences in the number of fields on both sides, and the value range is [0,1].
[0048] Sub-step 2: Calculate the type consistency rate.
[0049] Formula: Type consistency rate = Number of matching field pairs with completely identical data types / Number of valid matching field pairs; Note: If the data types of a matching field pair are different (e.g., int and float), it is not included in the numerator; if the number of valid matching field pairs is 0, the type consistency rate is recorded as 0, with a value range of [0,1].
[0050] Sub-step 3: Calculate integrity similarity.
[0051] First, calculate the overall integrity of S and T: Overall integrity = average of the non-null rates of all fields; Formula: Integrity Similarity = 1 - |Overall Integrity_S - Overall Integrity_T|; Note: |Overall Integrity_S-Overall Integrity_T| is the absolute difference between the integrity of the two, with a value range of [0,1]. The smaller the difference, the higher the integrity similarity.
[0052] Sub-step 4: Calculate the overlap of the value ranges.
[0053] Numeric fields: Intersection length of value ranges = max(0, min(maximum value_T, maximum value_S) - max(minimum value_T, minimum value_S)); Union length of value ranges = max(maximum value_T, maximum value_S) - min(minimum value_T, minimum value_S); If the union length is 0, the overlap of value ranges is recorded as 1. Categorical fields: Value range overlap = Number of common categories / Total number of categories (Total number of categories = Number of elements in category set_S ∪ category set_T); Overall value range overlap = the average value range overlap of all matching field pairs, with a value range of [0,1].
[0054] Sub-step 5: Calculate the original value of S1.
[0055] Formula: S1_raw = Field matching rate × 0.3 + Type consistency rate × 0.2 + Completeness similarity × 0.3 + Value range overlap × 0.2; The core indicators have higher weights, while the auxiliary indicators have lower weights. The field matching rate measures the degree of alignment between field names / semantics between two data structures, which is consistent with the weight of the integrity similarity, which also reflects the overall quality of the structure. The type consistency rate and value range overlap are only supplementary verification indicators after structure matching, so their weights are slightly lower, resulting in a weight allocation of 0.3, 0.2, 0.3, and 0.2.
[0056] Note: The weight allocation is based on the core influencing factors of structural adaptation and can be fine-tuned according to the scenario configuration. The value range of S1_raw is [0,1].
[0057] Sub-step 6: S1 normalization.
[0058] Using min-max normalization, the formula is: S1=(S1_raw-min_S1) / (max_S1-min_S1); Explanation: min_S1 is the minimum value of S1_raw in the historical data (default is 0), max_S1 is the maximum value of S1_raw in the historical data (default is 1), and after normalization, S1∈[0,1].
[0059] Step 4: Calculate the semantic fit S2.
[0060] Sub-step 1: Calculate the cosine similarity of semantic vectors.
[0061] Calculate the mean vectors of the unstructured semantic vectors in F_S and F_T respectively: vec_S=mean(semantic vector_S), vec_T=mean(semantic vector_T); Formula: Cosine similarity = (vec_S·vec_T) / (||vec_S||×||vec_T||); Note: vec_S·vec_T is the vector dot product, ||vec_S|| and ||vec_T|| are the L2 norms of the vectors, with values ranging from [-1, 1], and the absolute values are mapped to [0, 1].
[0062] Sub-step 2: Calculate topic similarity.
[0063] Calculate the mean values of the topic distributions for S and T respectively: topic_S = mean(topic distribution vector_S), topic_T = mean(topic distribution vector_T); Calculate the JS divergence between the two: JS(topic_S, topic_T) = 0.5 × KL(topic_S||(topic_S+topic_T) / 2) + 0.5 × KL(topic_T||(topic_S+topic_T) / 2); Formula: Topic similarity = 1 - JS(topic_S, topic_T); Note: KL represents KL divergence, JS divergence ranges from [0, ln2], and the transformed topic similarity is ∈ [1-ln2, 1], approximately [0.306, 1].
[0064] Sub-step 3: Calculate the percentage of common vocabulary.
[0065] Formula: Percentage of common vocabulary = Number of common words / (Total number of words - S + Total number of words - T - Number of common words); Note: The number of common words is the number of words in the intersection of S and T after removing stop words, and the value ranges from [0,1].
[0066] Sub-step 4: Calculate the original value of S2.
[0067] Formula: S2_raw = Cosine similarity × 0.5 + Topic similarity × 0.3 + Common vocabulary ratio × 0.2; Note: The weight allocation focuses on the core matching of semantic vectors, and the value range of S2_raw is [0,1].
[0068] Sub-step 5: S2 normalization.
[0069] Using the same min-max normalization method as S1, S2 is normalized to [0,1].
[0070] Step 5: Calculate the distribution fitness S3.
[0071] Sub-step 1: Construct the feature histogram.
[0072] Select key numerical features (such as numerical fields and time series mean) from F_S and F_T, construct a histogram for each feature, and set the number of bins in the histogram to 10 (which can be adjusted according to the data distribution) to ensure that the number of bins and intervals of the histograms of S and T are consistent.
[0073] Key numerical features refer to numerical features that can comprehensively reflect the overall distribution differences between the source and target scene data and have strong discriminative power in cross-scene comparisons. Features that do not have distributional discriminative significance, such as constants and non-variable fields, are excluded as key features.
[0074] Complete key numerical features specifically include: Structured numerical fields: Product price, inventory quantity, order amount, rating, monthly sales; Time-series statistical characteristics: average daily sales, order volume variance, and website visit volatility coefficient; Completeness characteristics: non-empty rate of commodity prices, mean of overall transaction data completeness; Value range characteristics: minimum selling price, maximum selling price, minimum order amount, maximum order amount.
[0075] Sub-step 2: Calculate the histogram intersection-union ratio (HI).
[0076] For each feature's histogram, calculate the intersection area: intersection area = Σmin(histogram frequency_S[i], histogram frequency_T[i]) (i is the i-th bin); Calculate the area of the union: Area of union = Σmax(histogram frequency_S[i], histogram frequency_T[i]); Formula: HI = Area of intersection / Area of union; Note: The value of HI ranges from [0,1]. The larger the value of HI, the closer the distribution.
[0077] Sub-step 3: Calculate quantile similarity (Q_sim).
[0078] Five key quantiles were selected: 0.1, 0.25, 0.5, 0.75, and 0.9. The quantiles of the corresponding features of S and T were calculated respectively. The key quantiles are the quantiles of the key numerical features themselves.
[0079] The key quantiles are fixed preset fractions. 0.1 is the smallest 10% position in the data, 0.9 is the largest 10% position in the data, and 0.25, 0.5, and 0.75 are the 25%, 50%, and 75% positions of the quartiles, respectively, corresponding to the left tail, lower quartile, median, upper quartile, and right tail of the data distribution.
[0080] Calculate the mean absolute difference of quantiles: quantile difference = (1 / 5) × Σ|quantile_S[k] - quantile_T[k]| (k is 5 quantiles); Perform min-max normalization on the quantile differences to obtain normalized quantile differences (∈[0,1]); Formula: Q_sim = 1 - Normalized quantile difference; Note: Q_sim ranges from [0,1]. The larger Q_sim is, the more consistent the quantile distribution.
[0081] Sub-step 4: Calculate the original value of S3.
[0082] Formula: S3_raw=HI×0.6+Q_sim×0.4; Note: The weight allocation focuses on the overall distribution reflected by the histogram, and the value range of S3_raw is [0,1].
[0083] Sub-step 5: S3 normalization.
[0084] Using the same min-max normalization method as S1 and S2, S3 is normalized to [0,1].
[0085] Step 6: Calculate the dynamic stability fit S4. S4 is used to calculate the difference in statistics between the source scene S and the target scene T on the corresponding sliding window to measure the degree of fit between the two temporal changes.
[0086] Sub-step 1: Divide the sliding window The preprocessed S and T are divided into continuous sliding windows, with the window size set to 1 hour (which can be adjusted according to the scenario configuration) and the window overlap rate set to 50% to ensure that the window covers all data.
[0087] Sub-step 2: Calculate the sequence of statistical changes within the window.
[0088] For each window, calculate the core statistics (mean, variance, and fluctuation coefficient) to form the statistical change sequence of S, Seq_S=[stat_S1,stat_S2,...,stat_Sk], and the statistical change sequence of T, Seq_T=[stat_T1,stat_T2,...,stat_Tk] (where k is the number of windows).
[0089] Sub-step 3: Calculate the drift between windows.
[0090] For each window i, calculate the statistical drift between S and T: drift_i = (1 / 3) × Σ|stat_Si[j] - stat_Ti[j]| (j represents the three core statistics); Calculate the average window drift: Average drift = (1 / k) × Σ drift_i (i = 1 to k).
[0091] Sub-step 4: Calculate the dynamic drift coefficient.
[0092] Preset the global maximum allowable drift (set based on historical data, the default value is 10% of the global maximum value of the statistics); Formula: Dynamic drift coefficient = Average drift amount / Global maximum allowable drift amount; Note: The dynamic drift coefficient ranges from [0, +∞). If it exceeds 1, it is calculated as 1 (indicating that the drift exceeds the allowable range).
[0093] Sub-step 5: Calculate the abnormal fluctuation ratio.
[0094] Set the drift threshold (the default value is 50% of the global maximum allowable drift). The number of windows whose drift amount _i > drift threshold is recorded as the number of abnormal windows; Formula: Abnormal fluctuation ratio = Number of abnormal windows / Total number of windows k; Note: The abnormal fluctuation ratio ranges from [0,1].
[0095] Sub-step 6: Calculate S4 and normalize it.
[0096] Formula: S4_raw = 1 - Dynamic drift coefficient - Abnormal fluctuation ratio; If S4_raw < 0, set it to 0; Using min-max normalization, S4∈[0,1] is normalized.
[0097] Scene weight adaptive learning and normalization Sub-step 1: Input scene feature parameters.
[0098] Input four types of scene feature parameters and construct a scene feature vector X: Data types: Structured (1,0,0), Unstructured (0,1,0), Time-series (0,0,1); Scene type: Static (1,0), Streaming (0,1); Business sensitivity: structural sensitivity (1,0,0), semantic sensitivity (0,1,0), distribution sensitivity (0,0,1). Historical assessment error: The average error of the last 30 assessments (normalized to [0,1]).
[0099] Sub-step 2: Train the initial weights.
[0100] A linear regression model with L1 regularization is adopted, with the scene feature vector X as input and the historical optimal weight (determined by minimizing the historical evaluation error) as the label. The initial weights w1_init, w2_init, w3_init, and w4_init are obtained by training. w1_init, w2_init, w3_init, and w4_init correspond to the initial weights corresponding to the structural fitness S1, semantic fitness S2, distribution fitness S3, and dynamic stability fitness S4, respectively. The regularization parameter λ is set to 0.01 to avoid overfitting. The model loss function is: Loss=Σ(w_i-w_i_true)²+λ×Σ|w_i| (w_i_true is the historical optimal weight).
[0101] Sub-step 3: Weight adjustment.
[0102] Adjust the weights according to the scenario type to ensure that the weights align with business needs: Structured scenario: w1_init = w1_init × 1.2, w2_init = w2_init × 0.9, w3_init = w3_init × 0.9, w4_init = w4_init × 0.9; For unstructured (text) scenarios: w2_init = w2_init × 1.2, and the remaining weights × 0.9; Data migration scenario: w3_init = w3_init × 1.2, other weights × 0.9; For streaming real-time scenarios: w4_init = w4_init × 1.2, and the remaining weights × 0.9.
[0103] The scenario type on which the weight adjustment is based is a comprehensive type of fusion task, including structured, unstructured, data migration, and streaming real-time types.
[0104] Sub-step 4: softmax normalization.
[0105] Formula: w_i=exp(w_i_init) / Σexp(w_j_init) (j=1,2,3,4); Note: After normalization, w1+w2+w3+w4=1 and each weight w_i>0, ensuring reasonable weight allocation.
[0106] Sub-step 5: Output the final weights.
[0107] Output the final weights adapted to the current scenario: w1 (structural adaptation weight), w2 (semantic adaptation weight), w3 (distribution adaptation weight), and w4 (dynamic stability weight).
[0108] Step 7: Four-dimensional fractional weighted fusion.
[0109] Sub-step 1: Calculate the original total score.
[0110] Formula: Score_raw=w1×S1+w2×S2+w3×S3+w4×S4; Note: The value range of Score_raw is [0,1], which directly reflects the original level of cross-scene data adaptation.
[0111] Sub-step 2: Total score range constraint.
[0112] If Score_raw < 0, set it to 0; if Score_raw > 1, set it to 1 to ensure that the original total score is within the range [0,1].
[0113] Step 8: Deviation calibration and anomaly correction.
[0114] Sub-step 1: Build a historical calibration library.
[0115] Collect historical data pairs (S_hist, T_hist) and their corresponding real-world adaptation labels (obtained through manual annotation or business performance verification) to build a calibration library. The calibration library should contain at least 100 sets of data to ensure coverage of different scenarios and data types.
[0116] Sub-step 2: Fraction calibration.
[0117] An isotonic regression model is used, with Score_raw as input and historical true labels as output, to train and calibrate the model, correct the current Score_raw, and obtain the calibrated score Score_cal. Note: Isotonic regression can resolve nonlinear bias and ensure that the calibrated score is consistent with the true fit, where Score_cal∈[0,1].
[0118] Sub-step 3: Anomaly detection and penalty correction.
[0119] Set the anomaly threshold to 0.2. If any sub-score (S1, S2, S3, S4) < 0.2, it is marked as an anomaly in the corresponding dimension (e.g., S1 < 0.2 is marked as "structural anomaly"). Exception penalty correction: Score_cal 修正 =Score_cal × (1 - 0.1 × number of outlier dimensions); Note: The more outlier dimensions there are, the stronger the penalty. This is to prevent a single outlier from skewing the overall result. The corrected Score_cal 修正 ≥0.
[0120] Sub-step 4: Final score constraint.
[0121] The corrected Score_cal 修正 Constrained again within the range of [0,1], the final fitness score is obtained.
[0122] Step 9: Output the results.
[0123] Output four core categories of content to support business decisions: The final cross-scene data adaptation score (∈[0,1]) is calculated as follows: Score ≥ 0.8 indicates high adaptation, 0.5 ≤ Score < 0.8 indicates medium adaptation, and Score < 0.5 indicates low adaptation. Four-dimensional sub-fractions: S1 (structure), S2 (semantics), S3 (distribution), and S4 (dynamics), clarifying the adaptation of each dimension; Weight configuration: w1, w2, w3, w4, indicating the evaluation focus of the current scenario; Anomaly Dimensions and Improvement Suggestions: Identify anomaly dimensions and provide targeted improvement suggestions (e.g., for structural anomalies, suggest unifying fields and data types). The present invention also provides an apparatus for the quantitative evaluation method of cross-scenario data adaptability, comprising: The acquisition module is used to acquire source scene data, target scene data and current scene data. The source scene data and current scene data include store product information data, store transaction data and store user interaction data under the source scene and current scene, respectively. The target scene data includes platform unified product profile data, cross-store transaction summary data and store user profile integration data under the target scene. The processing module is used to perform data cleaning and standardization on the source scene data, target scene data and current scene data to obtain the processed source scene data and target scene data. The extraction module is used to extract structured data features, unstructured data features, and time-series data features from the source scene data, target scene data, and current scene data, respectively, to obtain a standardized feature vector of the source scene, a standardized feature vector of the target scene, and a feature vector of the current scene. The calculation module is used to calculate the structural fit, semantic fit, distribution fit, and dynamic stability fit of the source scene standardized feature vector and the target scene standardized feature vector. The weighting module is used to train the initial weights of each fitness level based on a linear regression model with L1 regularization, with the current scene feature vector as input and the historical best weights as labels. The initial weights of each fitness level are then adjusted according to the scene type to obtain the final weights of each fitness level. The weighting module calculates the weighted sum of structural adaptability, semantic adaptability, distribution adaptability, and dynamic stability adaptability based on the weights of each adaptability, and obtains the final cross-scene data adaptability.
[0124] This invention also provides a quantitative evaluation device for cross-scenario data adaptability, comprising: Memory, used to store computer programs; A processor is used to implement the steps of the quantitative evaluation method for cross-scenario data adaptability when executing the computer program.
[0125] The present invention also provides a medium, which is a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the quantitative evaluation method for cross-scenario data adaptability.
[0126] The beneficial effects of the present invention's method, apparatus, equipment, and medium for quantitatively evaluating cross-scenario data adaptability are as follows: Construct a unified quantization framework to achieve cross-scenario adaptation of various data types, such as structured, unstructured, and time-series data, with continuous values of [0,1]. It provides an unsupervised, lightweight, and real-time executable end-to-end evaluation algorithm, eliminating the dependence on labeled and pre-trained models; Establish a four-dimensional joint evaluation mechanism encompassing structure, semantics, distribution, and dynamic stability to enhance comprehensiveness and robustness; Implement adaptive allocation of scene weights, automatically adjusting the weights of each dimension based on scene type, data type, and business attributes; To suppress evaluation biases caused by noise, outliers, and distribution drift, a result calibration and anomaly correction process is added.
[0127] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A quantitative evaluation method for cross-scenario data adaptability, characterized in that, include: Acquire source scene data, target scene data, and current scene data. The source scene data and current scene data include store product information data, store transaction data, and store user interaction data under the source scene and current scene, respectively. The target scene data includes platform unified product profile data, cross-store transaction summary data, and store user profile integration data under the target scene. Data cleaning and standardization are performed on the source scene data, target scene data, and current scene data to obtain the processed source scene data and target scene data. Structured data features, unstructured data features, and time-series data features are extracted from the source scene data, target scene data, and current scene data, respectively, to obtain the standardized feature vectors of the source scene, the standardized feature vector of the target scene, and the feature vector of the current scene. Calculate the structural fit, semantic fit, distribution fit, and dynamic stability fit of the standardized feature vectors of the source scene and the standardized feature vectors of the target scene; Using the current scene feature vector as input and the historical best weight as label, the initial weights of each fitness level are obtained by training a linear regression model with L1 regularization. The initial weights of each fitness level are then adjusted according to the scene type to obtain the final weights of each fitness level. The final cross-scenario data adaptation degree is obtained by calculating the weighted sum of structural adaptation degree, semantic adaptation degree, distribution adaptation degree, and dynamic stability adaptation degree based on the weights of each adaptation degree.
2. The quantitative evaluation method for cross-scenario data adaptability according to claim 1, characterized in that, Data cleaning and standardization processes are performed on the source scene data, target scene data, and current scene data, including: Missing values are handled for source scene data, target scene data, and current scene data; Filter outliers from the source scene data, target scene data, and current scene data; Standardize the format of source scene data, target scene data, and current scene data; The source scene data, target scene data, and current scene data are sampled using a stratified sampling method.
3. The quantitative evaluation method for cross-scenario data adaptability according to claim 1, characterized in that, Structured data features, unstructured data features, and time-series data features are extracted from the source scene data, target scene data, and current scene data, respectively, to obtain standardized feature vectors for the source scene, target scene, and current scene, including: Structured data features are extracted from the structured data in the source scene data, target scene data, and current scene data. The structured data features include field set, field matching pairs, data type, non-empty rate, value range, and field correlation coefficient. Unstructured data features are extracted from the unstructured data in the source scene data, target scene data, and current scene data. The unstructured data features include semantic vectors, topic distribution, length statistics, and word overlap. Temporal data features are extracted from the source scene data, target scene data, and current scene data. The temporal data features include basic statistics, fluctuation coefficient, autocorrelation coefficient, and trend features. The basic statistics include the mean, variance, and quartiles within each time window. The structured data features, unstructured data features, and time-series data features extracted from the source scene data are concatenated sequentially to obtain the standardized feature vector of the source scene. The structured data features, unstructured data features, and time-series data features extracted from the target scene data are sequentially concatenated to obtain the standardized feature vector of the target scene; The structured data features, unstructured data features, and time-series data features extracted from the current scene data are concatenated in sequence to obtain the current scene feature vector.
4. The quantitative evaluation method for cross-scenario data adaptability according to claim 1, characterized in that, Calculate the structural fit, semantic fit, distribution fit, and dynamic stability fit of the source scene standardized feature vector and the target scene standardized feature vector, including: Calculate the field matching rate, type consistency rate, integrity similarity, and value range overlap of the standardized feature vectors of the source scene and the standardized feature vectors of the target scene. Calculate the weighted sum of the field matching rate, type consistency rate, integrity similarity, and value range overlap based on the preset first weighted reorganization to obtain the structural fit. Calculate the semantic vector cosine similarity, topic similarity, and common vocabulary ratio of the standardized feature vectors of the source scene and the standardized feature vectors of the target scene. Calculate the weighted sum of the semantic vector cosine similarity, topic similarity, and common vocabulary ratio based on the preset second weighting to obtain the semantic fit. Based on the key numerical features in the standardized feature vectors of the source scene and the target scene, respectively construct the source scene histogram and the target scene histogram, calculate the intersection-union ratio and quantile similarity of the source scene histogram and the target scene histogram, and calculate the weighted sum of the intersection-union ratio and quantile similarity based on the preset third weighted reorganization to obtain the distribution fit. Based on the preset window size and window overlap rate, the source scene standardized feature vector and the target scene standardized feature vector are divided into continuous sliding windows. The basic statistics of all windows corresponding to the source scene standardized feature vector and the target scene standardized feature vector are calculated respectively, and the source scene statistics change sequence and the target scene statistics change sequence are obtained respectively. Based on the source scene statistics change sequence and the target scene statistics change sequence, the source scene statistics drift and the target scene statistics drift of each window are calculated. Based on the source scene statistics drift and the target scene statistics drift of each window, the source scene average window drift and the target scene average window drift are calculated. The dynamic drift coefficient is calculated by the ratio of the source scene average window drift and the target scene average window drift to the preset global maximum allowable drift. Windows whose source scene statistics drift and the target scene statistics drift exceed the preset drift threshold are counted as abnormal windows. The abnormal fluctuation ratio is calculated by the ratio of the abnormal window number to the total number of windows. The dynamic stability fit is calculated by the difference between the dynamic drift coefficient and the abnormal fluctuation ratio.
5. The quantitative evaluation method for cross-scenario data adaptability according to claim 1, characterized in that, The scenario types include structured scenarios, unstructured scenarios, data migration scenarios, and streaming real-time scenarios. The initial weights for each fit are adjusted according to the scenario type to obtain the final weights for each fit, including: The corrected weights for each fitness level in the structured scenario are calculated based on the pre-defined structured scenario weight reorganization and the weights of each fitness level. The corrected weights for each fitness level in the unstructured scenario are calculated based on the pre-defined unstructured scenario weight reorganization and the weights of each fitness level. The corrected weights for each fitness level under the data migration scenario are calculated based on the pre-defined data migration scenario weight reorganization and the weights of each fitness level. The corrected weights for each adaptation degree in the streaming real-time scene are calculated based on the preset weight reorganization of the streaming real-time scene and the weights of each adaptation degree. The corrected weights for each fitness level in structured scenarios, unstructured scenarios, data migration scenarios, and streaming real-time scenarios are normalized using the softmax function to obtain the final weights for each fitness level.
6. The quantitative evaluation method for cross-scenario data adaptability according to claim 1, characterized in that, It also includes deviation calibration, which includes: Collect paired source scene historical data and target scene historical data, and obtain the true matching tags based on the paired source scene historical data and target scene historical data; An isotonic regression model is used, with the final cross-scene data fit degree corresponding to the paired source scene historical data and target scene historical data as input, and the real fit label as output, to train the isotonic regression model to obtain the calibrated model. The final cross-scenario data fit is corrected based on the calibration model to obtain the calibrated score.
7. The quantitative evaluation method for cross-scenario data adaptability according to claim 6, characterized in that, This also includes anomaly correction for calibrated scores, including: An anomaly threshold is pre-set. If the fit of any dimension of structural fit, semantic fit, distribution fit, or dynamic stability fit is less than the anomaly threshold, the corresponding fit is marked as an anomaly. Anomaly penalty correction is performed. The correction calculation formula is: Corrected score = Calibrated score × (1 - 0.1 × Number of anomaly dimensions). The number of anomaly dimensions refers to the total number of dimensions of anomaly fit. The corrected score is ≥ 0.
8. An apparatus for a quantitative evaluation method of cross-scenario data adaptability as described in any one of claims 1-7, characterized in that, include: The acquisition module is used to acquire source scene data, target scene data and current scene data. The source scene data and current scene data include store product information data, store transaction data and store user interaction data under the source scene and current scene, respectively. The target scene data includes platform unified product profile data, cross-store transaction summary data and store user profile integration data under the target scene. The processing module is used to perform data cleaning and standardization on the source scene data, target scene data and current scene data to obtain the processed source scene data and target scene data. The extraction module is used to extract structured data features, unstructured data features, and time-series data features from the source scene data, target scene data, and current scene data, respectively, to obtain a standardized feature vector of the source scene, a standardized feature vector of the target scene, and a feature vector of the current scene. The calculation module is used to calculate the structural fit, semantic fit, distribution fit, and dynamic stability fit of the source scene standardized feature vector and the target scene standardized feature vector. The weight module is used to train the initial weights of each fitness level based on a linear regression model with L1 regularization, with the current scene feature vector as input and the historical best weights as labels. The initial weights of each fitness level are then adjusted according to the scene type to obtain the final weights of each fitness level. The weighting module calculates the weighted sum of structural adaptability, semantic adaptability, distribution adaptability, and dynamic stability adaptability based on the weights of each adaptability, and obtains the final cross-scene data adaptability.
9. A quantitative evaluation device for cross-scenario data adaptability, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of a quantitative evaluation method for cross-scenario data adaptability as described in any one of claims 1 to 7 when executing the computer program.
10. A medium, characterized in that, The medium is a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the quantitative evaluation method for cross-scenario data adaptability as described in any one of claims 1 to 7.