Cross-device compatibility test method and system based on meta-learning

By using a meta-learning-based cross-device compatibility testing method, device features are dynamically collected and fused, and hierarchical scoring is performed by combining historical and real-time data. This solves the problems of high redundancy and insufficient accuracy in traditional methods, and achieves efficient and accurate device compatibility testing.

CN120935084APending Publication Date: 2025-11-11FUJIAN TQ DIGITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511002759.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Traditional cross-device compatibility testing methods suffer from high redundancy, low efficiency, and insufficient accuracy, especially in long-tail scenarios and device heterogeneity.

Method used

A meta-learning-based cross-device compatibility testing method is adopted. By collecting hardware, protocol and timing features, performing feature encoding and cross-modal fusion, a fused feature vector is generated. The meta-learning model is used for hierarchical scoring, and the score is combined with historical test results and real-time data.

Benefits of technology

It significantly improves the efficiency and accuracy of cross-device compatibility testing, reduces redundant test cases, and enhances the scientific rigor and rationality of device compatibility testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120935084A_ABST
    Figure CN120935084A_ABST
Patent Text Reader

Abstract

The invention discloses a meta-learning-based cross-device compatibility test method and system. The method comprises the steps of collecting hardware features, protocol features and time sequence features of different target devices; performing feature coding and cross-modal fusion on the collected features to obtain a fusion feature vector; and matching the fusion feature vector with a historical feature vector, if matching succeeds, returning a historical compatibility score corresponding to the historical feature vector, and otherwise, performing hierarchical scoring and weighted calculation on the fusion feature vector by adopting a meta-learning model to obtain a current compatibility score. According to the method, multi-dimensional equipment compatibility detection can be realized, the problem of uniform characterization of heterogeneous features is solved, redundancy tests are effectively reduced, and the efficiency and accuracy of cross-equipment compatibility detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cross-device compatibility testing technology, and in particular to a cross-device compatibility testing method and system based on meta-learning. Background Technology

[0002] Traditional cross-device compatibility testing methods mainly include full-scale testing, rule engine methods, and federated learning methods. These methods suffer from the following core shortcomings in practical applications: 1. Full-scale testing method: The test cases are decoupled from the hardware features of the device, resulting in redundancy of up to 70% or more and low testing efficiency.

[0003] 2. Rule Engine Method: Relies on expert rule base, only covers 15 common protocols, and has a missing rate of more than 40% for long-tail scenarios (referring to edge compatibility issues that occur infrequently but are diverse, such as protocols of niche devices, special configuration combinations, etc.), resulting in insufficient scalability.

[0004] 3. Federated learning method: The global model is difficult to adapt to the heterogeneity of devices, with a false alarm rate as high as 18% and insufficient accuracy. Summary of the Invention

[0005] The technical problem to be solved by this invention is to provide a cross-device compatibility testing method and system based on meta-learning, so as to improve the efficiency and accuracy of cross-device compatibility testing.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A cross-device compatibility testing method based on meta-learning includes the following steps: The system collects hardware features, protocol features, and timing features of different target devices; it performs feature encoding and cross-modal fusion on the collected features to obtain a fused feature vector; it matches the fused feature vector with historical feature vectors. If the match is successful, it returns the historical compatibility score corresponding to the historical feature vector. Otherwise, it uses a meta-learning model to perform hierarchical scoring and weighted calculation on the fused feature vector to obtain the current compatibility score.

[0007] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A meta-learning-based cross-device compatibility testing system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the meta-learning-based cross-device compatibility testing method described above.

[0008] The beneficial effects of this invention are as follows: It provides a cross-device compatibility testing method and system based on meta-learning. By dynamically collecting hardware features, protocol features, and timing features of cross-devices, it achieves multi-dimensional device compatibility detection. At the same time, it uses feature encoding and cross-modal fusion technology to generate a unified-dimensional fusion feature vector, solving the problem of unified representation of heterogeneous features. Furthermore, it reuses historical test results by matching them, which effectively reduces redundant test cases compared to the traditional full-scale testing method. Finally, for fusion feature vectors that cannot be reused using historical test results, it calculates hierarchical scores through a meta-learning model, which significantly improves the efficiency and accuracy of cross-device compatibility testing. Attached Figure Description

[0009] Figure 1 This is an overall flowchart of a cross-device compatibility testing method based on meta-learning according to an embodiment of the present invention; Figure 2 This is a system architecture diagram of a cross-device compatibility testing method based on meta-learning according to an embodiment of the present invention; Figure 3 The diagram shows the LSTM-GRU hybrid network structure used in a meta-learning-based cross-device compatibility testing method according to an embodiment of the present invention. Figure 4 This is a schematic diagram of the structure of a cross-device compatibility testing system based on meta-learning according to an embodiment of the present invention.

[0010] Label Explanation: 1. A cross-device compatibility testing system based on meta-learning; 2. Memory; 3. Processor. Detailed Implementation

[0011] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0012] Please refer to Figures 1 to 3 A cross-device compatibility testing method based on meta-learning includes the following steps: The system collects hardware features, protocol features, and timing features of different target devices; it performs feature encoding and cross-modal fusion on the collected features to obtain a fused feature vector; it matches the fused feature vector with historical feature vectors. If the match is successful, it returns the historical compatibility score corresponding to the historical feature vector. Otherwise, it uses a meta-learning model to perform hierarchical scoring and weighted calculation on the fused feature vector to obtain the current compatibility score.

[0013] As can be seen from the above description, the beneficial effects of the present invention are as follows: by dynamically collecting hardware features, protocol features, and timing features across devices, multi-dimensional device compatibility testing is achieved. At the same time, feature encoding and cross-modal fusion technology are used to generate a unified dimension fusion feature vector, solving the problem of unified representation of heterogeneous features. Furthermore, by reusing historical test results, redundant test cases are effectively reduced compared to the traditional full-scale testing method. Finally, for fusion feature vectors that cannot be reused using historical test results, hierarchical scoring is calculated through a meta-learning model, which significantly improves the efficiency and accuracy of cross-device compatibility testing.

[0014] Furthermore, the collection of hardware characteristics, protocol characteristics, and timing characteristics of different target devices specifically includes: By parsing the system files of different target devices, we can obtain the instruction set fingerprints and memory topology of different target devices to obtain hardware characteristics; capture the communication protocol parameters of different target devices to obtain protocol characteristics; and collect the memory access delay sequences of different target devices within a preset time window to obtain timing characteristics.

[0015] As described above, by extracting instruction set fingerprints and memory topology from the device's system files, the differences between different device system architectures can be accurately identified. At the same time, by capturing the interaction characteristics of the protocol stack in real time through communication protocol parameters, the data update cycle can be effectively reduced. In addition, the memory access latency sequence of the device is sampled by sampling at a preset time window frequency. Subsequently, it can be combined with LSTM network to detect microsecond-level timing problems such as NUMA node access anomalies.

[0016] Furthermore, the feature encoding of the collected features specifically involves: Based on the instruction set fingerprints and memory topology of different target devices, calculate the instruction set Hamming distance and memory topology matching degree of different target devices to generate hardware vectors; The communication protocol parameters of different target devices are normalized to generate protocol vectors; Access patterns are extracted from memory access latency sequences of different target devices to generate time-series vectors.

[0017] As described above, the hardware vector is calculated using the instruction set Hamming distance, which allows for a quantifiable comparison of the differences between DISC-V and ARM architectures; meanwhile, the protocol vector uses a normalization method to dynamically reflect the importance of parameters; and the timing vector is extracted through memory access delay sequences, which can achieve a certain degree of dimensionality reduction and effectively reduce memory usage.

[0018] Furthermore, the cross-modal fusion of the collected features specifically includes: The hardware vector, protocol vector, and timing vector are aligned and concatenated using a cross-modal attention mechanism, and then compressed into a fusion feature vector of a preset dimension through a fully connected layer.

[0019] As described above, the introduction of a cross-modal attention mechanism effectively solves the semantic alignment problem of hardware, protocol, and temporal features. At the same time, the fully connected layer compresses the concatenated hardware, protocol, and temporal vectors into a preset dimension, reducing the amount of data transmission while maintaining the matching degree, and facilitating efficient subsequent queries of the meta-knowledge base.

[0020] Furthermore, the process of matching the fused feature vector with historical feature vectors, and if a match is successful, returning the historical compatibility score corresponding to the historical feature vector, specifically involves: The fused feature vector is stored in a preset meta-knowledge base. The fused feature vector is then compared with the historical feature vectors in the meta-knowledge base for similarity. If the similarity reaches a first threshold, the historical compatibility score of the corresponding historical feature vector stored in the meta-knowledge base is returned directly.

[0021] As described above, similarity matching balances recall and precision, reduces the false matching rate of historical feature vectors, and directly outputs the corresponding historical compatibility score for the matched historical feature vectors, saving testing time.

[0022] Furthermore, the training steps of the meta-learning model are as follows: The training task is divided into hardware layer, protocol layer, and application layer, and offline pre-training is performed: The learning rate of each layer parameter is dynamically adjusted during the online phase to obtain the meta-learning model.

[0023] As described above, the offline phase involves stratified training based on a large amount of historical data, while the online phase involves adjusting the learning rate of the training model every time real-time data is acquired, making the stratified scoring of the meta-learning model more accurate and efficient.

[0024] Furthermore, the step of using a meta-learning model to perform hierarchical scoring on the fused feature vector specifically involves: In the hardware layer, the hardware vector is input into the meta-learning model, and the instruction set similarity and memory topology matching degree are output and weighted to serve as the hardware layer score. The protocol vector is input into the meta-learning model at the protocol layer, and the similarity of communication protocol parameter features is output as the protocol layer score. In the application layer, the time-series vector is input into the meta-learning model, and the output interface calls the sequence edit distance as the application layer score.

[0025] As described above, the hardware layer score is calculated by weighting instruction set similarity and memory topology matching degree, accurately reflecting the underlying compatibility of different target devices; the protocol layer score is based on the similarity of communication protocol parameter features, effectively identifying the deviation of protocol stacks between different target devices, and thus reflecting the protocol compatibility of different target devices; the application layer score is based on the edit distance of interface call timing, detecting interface adaptation problems between different target devices, and thus reflecting the interface compatibility of different target devices.

[0026] Furthermore, the step of using a meta-learning model to weight the fused feature vector to obtain the current compatibility score specifically involves: Different weight coefficients are assigned to each layer, and the current compatibility score is calculated by weighting the hardware layer score, the protocol layer score, and the application layer score with their corresponding weight coefficients.

[0027] As described above, by assigning different weight coefficients to different layers, the different contributions of each layer to the compatibility of different target devices are reflected. At the same time, the scores of different layers are calculated by weighting to output the final compatibility score, ensuring the scientific and reasonable nature of the score.

[0028] Furthermore, after obtaining the compatibility score, the process also includes: The corresponding response operation is triggered based on the historical compatibility score or the current compatibility score.

[0029] As described above, by triggering different preset responses based on the compatibility score, the accuracy of compatibility testing for different target devices can be improved.

[0030] Please refer to Figure 4 A meta-learning-based cross-device compatibility testing system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor performs the steps of a meta-learning-based cross-device compatibility testing method as described above.

[0031] The present invention provides a cross-device compatibility testing method and system based on meta-learning, which is applicable to cross-device compatibility testing scenarios. The following description is based on specific embodiments.

[0032] Please refer to Figure 1 Embodiment 1 of the present invention is as follows: A cross-device compatibility testing method based on meta-learning, such as Figure 1 As shown, the steps include: S1. Collect hardware characteristics, protocol characteristics, and timing characteristics of different target devices.

[0033] S2. The collected hardware features, protocol features, and timing features are encoded and fused across modes to obtain a fused feature vector.

[0034] S3. Match the fused feature vector with the historical feature vector. If the match is successful, return the historical compatibility score corresponding to the historical feature vector. Otherwise, use the meta-learning model to perform hierarchical scoring and weighted calculation on the fused feature vector to obtain the current compatibility score. The historical feature vector is historical data stored in the meta-knowledge base, and the meta-learning model is a pre-trained model.

[0035] In this embodiment, multi-dimensional device compatibility testing is achieved by dynamically collecting hardware features, protocol features, and timing features across devices. At the same time, feature encoding and cross-modal fusion technology are used to generate a unified fusion feature vector, solving the problem of unified representation of heterogeneous features. Furthermore, historical test results are reused by matching them, which effectively reduces redundant test cases compared to the traditional full-scale testing method. Finally, for fusion feature vectors that cannot be reused using historical test results, hierarchical scoring is calculated through a meta-learning model, which significantly improves the efficiency and accuracy of cross-device compatibility testing.

[0036] In this embodiment, after obtaining the compatibility score in step S3, the method further includes: The corresponding response action is triggered based on the historical compatibility score or the current compatibility score, specifically: If the compatibility score is greater than or equal to the first threshold, it is considered a high-risk protocol conflict and an alarm is triggered. High-risk alarms can be sent via WebSocket push notifications of protocol conflict details (e.g., indicating a DICOM quantization table bit width mismatch).

[0037] If the compatibility score is greater than or equal to the second threshold and less than the first threshold, then compatibility optimization suggestions are generated and output. For example, a device counterweight patch is generated (such as suggesting modification of the Modbus register address mapping table).

[0038] If the compatibility score is less than the second threshold, it is determined to be a compatible device and output.

[0039] The first threshold is greater than the second threshold.

[0040] In this embodiment, the scoring threshold can be dynamically calculated based on historical test data. Specifically, the first threshold can be obtained from (μ + 3σ), and the second threshold can be obtained from (μ - σ), where μ is the mean of the historical test data and σ is the standard deviation of the historical test data. Furthermore, in this embodiment, μ and σ can be updated after every 50 tests.

[0041] This involves determining the threshold range within which the compatibility score falls, thereby making different decisions and improving the accuracy of compatibility testing for different target devices.

[0042] In addition, the meta-knowledge base can be updated after each test, and the new device feature vectors can be written into the meta-knowledge base.

[0043] Please refer to Figure 2 Embodiment two of the present invention is as follows: A cross-device compatibility testing method based on meta-learning, building upon the above-described embodiment one, specifically involves collecting hardware characteristics, protocol characteristics, and timing characteristics of different target devices in step S1. S11. By parsing the / proc / cpuinfo file in the system files of different target devices, the instruction set fingerprints of different target devices (e.g., ARMv8.2 vs ×86_64 AVX512) are obtained. Simultaneously, the memory topology is obtained by using the / proc / meminfo file to obtain the NUMA node distribution and cache hierarchy relationship. The instruction set fingerprints and memory topology are used as hardware features. Additionally, the clock offset between different target devices can be measured (accuracy ±1μ) based on the PTP protocol, which is also used as a hardware feature.

[0044] S12. Capture the communication protocol parameters of different target devices, such as the dynamic parameters of the TCP / IP protocol stack five-tuple as protocol features. In this embodiment, the dynamic parameters of the TCP / IP protocol stack five-tuple include SYN delay parameters, ACK response time parameters, CRC check difference parameters, MTU negotiation parameters, and timeout retransmission parameters.

[0045] S13. Collect memory access delay sequences of different target devices within a preset time window as timing features. In this embodiment, the preset time can be set to 60s (sampling rate 1kHz).

[0046] In this embodiment, the instruction set fingerprint and memory topology are extracted from the / proc / cpuinfo file of the device system, which can accurately identify the differences between different device system architectures. At the same time, the interaction characteristics of the protocol stack are captured in real time through communication protocol parameters, which can effectively reduce the data update cycle. In addition, the memory access latency sequence of the device is sampled at a preset time window sampling frequency. Subsequently, it can be combined with LSTM network to detect microsecond-level timing problems such as NUMA node access anomalies.

[0047] Furthermore, such as Figure 2 As shown, in step S2, the collected hardware features, protocol features, and timing features are encoded using a feature encoder. The specific steps are as follows: S21. In the hardware feature channel, based on the instruction set fingerprint and memory topology of different target devices, calculate the Hamming distance of the instruction set (such as the difference bit ratio between RISC-V and ARM Thumb-2) and the memory topology matching degree of different target devices, and generate hardware vectors.

[0048] S22. In the protocol feature channel, the five weights of the dynamic parameters of the TCP / IP protocol stack quintuple are normalized using a normalized exponential function to construct the quintuple change matrix, as shown in the following formula: ; Generate the protocol vector. Wherein, δ SYN Indicates SYN delay parameters, δ ACK Indicates the ACK response time parameter, δ CRC Indicates the CRC check difference parameters, δ MTU Indicates MTU negotiation parameters and δ RTO This indicates that the parameters will be retransmitted after a timeout. In this embodiment, this step can also address the feature drift problem by normalizing the quintuple parameters using Softmax and adding a time decay factor.

[0049] In this embodiment, the supplementary protocol quintuple dynamic analysis model Ψ( t The specific content is as follows: Mathematical expression: ; ; ; ; Where, Δ F i ( t This can quantify the differences in protocol stack implementation between the target device and the reference device (e.g., the Modbus protocol parameter offset between a Siemens PLC and an Omron temperature controller). Data sources could be the historical characteristic averages of similar devices extracted from the meta-knowledge base (e.g., the Profinet parameter benchmark of 50 Siemens S7-1500 PLCs). w i ( t Dynamic normalization is achieved through the Softmax function, thereby automatically assigning the importance of different features in the quintuple (e.g., ...). δ SYN weight > δ RTO (weights)e -λt This represents the time decay factor (which addresses the feature drift problem after a device has been offline for an extended period). j Represents the feature index of the quintuple. j The value ranges from 1 to 5, where each value represents: 1 represents the SYN delay parameter, 2 represents the ACK response time parameter, 3 represents the CRC check difference parameter, 4 represents the MTU negotiation parameter, and 5 represents the timeout retransmission parameter. The target device's first j 3D eigenvalues; The first reference device j 3D eigenvalues; k Indicates the sample index of historical devices. N This represents the total number of historical samples. k Values ​​range from 1 to N , respectively representing the traversal of the first to the last stored items in the meta-knowledge base. N Historical equipment from Taiwan.

[0050] In addition, in this embodiment, a dynamic calculation algorithm for the weights of different features of the quintuple is introduced as follows: First, determine the attenuation coefficient: determine the optimal parameters through grid search. γ =0.9, λ =0.15), and then we need to improve the cosine algorithm to calculate similarity (by adding a time decay factor). e -λt The similarity calculation details are as follows: (1) Target audience: Not used for ISA instruction set similarity (ISA similarity is calculated using Hamming distance); Specifically designed for protocol quintuple features (Φ) t Similarity measurement between vectors.

[0051] (2) Specific algorithm: Improved cosine similarity formula sim ()as follows: ; The numerator is the standard cosine similarity (which measures the consistency of vector directions), and the denominator is the vector magnitude normalization (which eliminates dimensional differences).

[0052] (3) Calculation example: Scenario: Compatibility test of Android applications with GPU drivers on Snapdragon 8 Gen3 and Dimensity 9300: enter: ; Output: Original cosine similarity = 0.89 → After adding attenuation (t = 2 hours, λ =0.15) → sim =0.89× e 0.3 =0.66.

[0053] (4) Application scenarios of dynamic weights Dynamic weights w i ( t It is used in the following two core processes: 1. Protocol Feature Fusion: In Ψ( t In the calculation formula, the weighted aggregate quintuple characteristic difference ; Example: In the Industrial Internet of Things (IIoT), if δ MTU The significantly increased weight of the MTU negotiation parameters indicates that anomalies are the main risk.

[0054] 2. Risk score calculation: Combining the decision matrix formula: Score = 0.4 (device layer) + 0.35 (protocol layer Ψ) t ))+0.25 (application layer), dynamically adjusting the contribution ratio of the protocol layer in the total score.

[0055] S23. In the time-series feature channel, the Long Short-Term Memory (LSTM) network is used to extract time-series features from the memory access delay sequences of different target devices and then perform dimensionality reduction to generate a time-series vector. In this embodiment, the LSTM network can be used to extract the NUMA node access pattern, and the output is a 256-dimensional hidden state.

[0056] The hardware vectors are calculated using the instruction set Hamming distance, which allows for a quantifiable comparison of the differences between DISC-V and ARM architectures; the protocol vectors are normalized to dynamically reflect the importance of parameters; and the time-series vectors are extracted and reduced in dimensionality by the Long Short-Term Memory (LSTM) network, effectively reducing memory usage.

[0057] In step S2, the collected features are fused across modalities, specifically as follows: S24. A cross-modal attention mechanism is used to align and concatenate the hardware vector, protocol vector, and timing vector, and then compress them into a fused feature vector of a preset dimension through a fully connected layer. The fused feature vector can be 128-dimensional and in JSON format.

[0058] This involves introducing a cross-modal attention mechanism to effectively solve the semantic alignment problem of hardware, protocol, and temporal features. At the same time, the fully connected layer compresses the concatenated hardware, protocol, and temporal vectors into a preset dimension, reducing the amount of data transmission while maintaining the matching degree, and facilitating efficient subsequent queries of the meta-knowledge base.

[0059] Please refer to Figure 3 Embodiment 3 of the present invention is as follows: A cross-device compatibility testing method based on meta-learning, building upon the above-described Embodiment 1 or Embodiment 2, in this embodiment, step S3 involves matching the fused feature vector with historical feature vectors. If the match is successful, the historical compatibility score corresponding to the historical feature vector is returned. Specifically: S31. Store the fused feature vector in a preset meta-knowledge base. For example, send the 128-dimensional fused feature vector to the meta-knowledge base via gRPC and perform a similarity query with the historical feature vector in the meta-knowledge base. For example, execute an SQL query (query statement: SELECT * FROM device_features WHERE cosine_similarity>0.85). If the similarity reaches the first threshold (e.g., 0.85), directly return the historical compatibility score of the corresponding historical feature vector stored in the meta-knowledge base.

[0060] In this embodiment, similarity matching is used to balance recall and precision, thereby reducing the false matching rate of historical feature vectors. At the same time, the historical compatibility score corresponding to the matched historical feature vectors is directly output, saving testing time.

[0061] In this embodiment, the meta-learning model in step S3 can be an improved MAML algorithm, and the pre-training steps of the meta-learning model are as follows: (1) First, perform multimodal feature alignment: align historical hardware features (historical instruction set Hamming distance, such as RISC-V vs ARMv8, and historical memory topology maps, such as NUMA node distribution) and historical protocol features (historical quintuple change matrix ΔΦ). t As input, historical time-series features (or historical application features: edit distance of API call sequences, such as differences between OpenGL and Vulkan interfaces) are used, and after feature fusion through cross-modal Transformer to generate a 256-dimensional unified representation, a hierarchical meta-task is constructed as follows: (2) Then, hierarchical meta-task construction is performed: the training task set T={T1,T2,...,TN} is extracted from the meta-knowledge base, and each training task contains: Support Set: 10 sets of data for similar devices (e.g., 5 Siemens PLCs + 5 Omron temperature controllers). Query Set: Two sets of new equipment data (such as United Imaging PET-CT).

[0062] (3) Then, based on the extracted training tasks, the training tasks are divided into hardware layer, protocol layer and application layer, and then the layer parameters are updated: 1. Hardware Layer Training: In the offline phase, the hardware layer is trained using historical hardware features from various devices (e.g., 50 types of devices) as input to obtain hardware compatibility parameters for the model, such as calculating the instruction set similarity (ISA). (64-bit architecture); The hardware layer loss function is calculated as follows: ; Wherein, Hamming Distance represents the instruction set Hamming distance, which is calculated using a 64-bit architecture in this embodiment; y compat The compatibility label indicates the number of compatible items (1 indicates compatibility, 0 indicates incompatibility).

[0063] 2. Protocol layer training: In the offline stage, the protocol layer is trained by taking the historical protocol features of various devices as input, combining historical time-series features, and extracting time-series features through the GRU network to train the model to capture protocol interaction difference parameters.

[0064] The protocol layer loss function is calculated as follows: .

[0065] in θ gru Indicates GRU network parameters, y prototal Protocol conflict type labels (e.g., 0 indicates no conflict, 1 indicates MTU negotiation parameter conflict, 2 indicates ACK response timeout parameter conflict), the meaning of the above formula is as follows: Protocol loss function ( L protocol ) is equivalent to passing through the GRU network (with Ψ( t ) is the input. θ gru The output obtained from the network parameters, and the protocol conflict type label ( y protocol Cross-entropy between ).

[0066] 3. Application layer training: In the offline phase, the interface compatibility parameters of the model are trained by taking the historical time-series features of the API calls of the application layer as input (such as the differences between CUDA and Metal driver interfaces).

[0067] The application layer loss function is calculated as follows: ; Where CrossEntropy() represents the cross-entropy loss function. f θ () indicates the output of the application layer model. xThis represents a sequence of interface calls (such as an OpenGL API call stream). y This indicates the actual interface compatibility label (0 for compatible, 1 for incompatible).

[0068] 4. Global parameter aggregation: Integrating three layers of loss: ; Update global parameters: θ ← θ - β ▽ θ L total ,in β Represents the dynamic learning rate, ▽ θ Represents the loss function L total For parameters θ The gradient.

[0069] (4) During the online phase, the learning rate of hardware compatibility parameters, protocol interaction difference parameters and interface compatibility parameters is dynamically adjusted based on the hardware characteristics, protocol characteristics and timing characteristics acquired in real time. That is, the improved model is obtained through online fine-tuning.

[0070] In this embodiment, the dynamic learning rate is calculated based on the real-time features of the target device. β The calculation formula is as follows: ; in, α This represents the base learning rate (the default value can be set to 0.01, and can be verified and determined within the range of 0.001 to 0.1 based on network search methods), which is used to control the maximum step size for parameter updates; γ This represents the device difference sensitivity coefficient (the default value can be set to 0.15, which can be determined experimentally). γ =0.15 (training stability is optimal, loss fluctuation is reduced by 42%), which can be used to amplify or reduce the impact of device similarity; S dev Indicates the similarity of device features; The target device's first k Each feature vector (such as instruction set fingerprint); Indicates the corresponding features of the reference device; sim () indicates improved cosine similarity (including time decay factor); for S dev Normalize: S dev =[0,1] (1 indicates full compatibility), resulting in the following dynamic characteristics: When the equipment is highly similar ( Sdev →1): β ≈ α + γβ ≈1+ γα → A larger learning rate leads to faster convergence; when device differences are significant ( S dev →0): β ≈ αβ ≈ α → Conservative updates avoid overfitting.

[0071] like Figure 3 As shown, a sliding window is used, and the GRU hidden state is updated every 10 seconds (window overlap rate 83.3%).

[0072] In the offline phase, hierarchical training is performed based on a large amount of historical data. In the online phase, the learning rate of the training model is adjusted as soon as real-time data is acquired, making the hierarchical scoring of the meta-learning model more accurate and efficient.

[0073] In this embodiment, step S3 uses a meta-learning model to perform hierarchical scoring on the fused feature vector, specifically as follows: S32. Input the hardware vector into the meta-learning model at the hardware layer, output the instruction set similarity and memory topology matching degree, and calculate the weighted similarity of the instruction set and memory topology matching degree as the hardware layer score.

[0074] For example, the weighting coefficient for instruction set similarity is set to 0.7, and the weighting coefficient for memory topology matching is set to 0.3. The two are then weighted and calculated.

[0075] S33. Input the protocol vector into the meta-learning model at the protocol layer and output the similarity of communication protocol parameter features as the protocol layer score. S34. In the application layer, the time series vector is input into the meta-learning model, and the output interface calls the sequence edit distance as the application layer score (i.e., normalized value).

[0076] Specifically, the hardware layer score is calculated by weighting instruction set similarity and memory topology matching to accurately reflect the underlying compatibility of different target devices; the protocol layer score is based on the similarity of communication protocol parameter features to effectively identify the deviation of protocol stacks between different target devices, thereby reflecting the protocol compatibility of different target devices; and the application layer score is based on the edit distance of interface call timing to detect interface adaptation problems between different target devices, thereby reflecting the interface compatibility of different target devices.

[0077] In step S3, a meta-learning model is used to weight the fused feature vectors after hierarchical scoring and output the current compatibility score, specifically as follows: S35. Assign a first weighting coefficient, a second weighting coefficient, and a third weighting coefficient to the hardware layer, protocol layer, and application layer. Calculate the current compatibility score by weighting the hardware layer score with the first weighting coefficient, the protocol layer score with the second weighting coefficient, and the application layer score with the third weighting coefficient. In this embodiment, the first weighting coefficient can be set to 0.4, the second weighting coefficient can be set to 0.35, and the third weighting coefficient can be set to 0.25.

[0078] This means that by assigning different weight coefficients to different layers, the different contributions of each layer to the compatibility between different target devices are reflected. At the same time, the scores of different layers are calculated by weighting to output the final compatibility score, ensuring the scientific and reasonable nature of the score.

[0079] In addition, a performance comparison of the cross-device compatibility testing method based on meta-learning in this embodiment before and after implementation is provided in two specific scenarios: 1. Interconnection of smart medical devices Test subjects: GE Discovery MI DR PET-CT (DICOM 3.0 protocol) vs. United Imaging uMI 550 digital PET-CT; Problem location: JPEG-LS quantization table parameter conflict in the DCM_Compress() function (GE uses 8-bit, United Imaging uses 12-bit). Performance data: The traditional method had 142 test cases and took 9.5 hours; this embodiment had 12 test cases and took 0.78 hours (test environment: Intel Xeon Gold 6248R, 128GB memory).

[0080] 2. Industrial IoT Protocol Verification Test objects: Siemens S7-1500 PLC (Profinet protocol) vs Omron E5CC temperature controller (Modbus RTU protocol); Problem identification: Register address mapping conflict in Modbus function code 03 (Siemens uses Float32, Omron uses IEEE754); Performance data: False alarm rate: Federated learning method 18.3% → this example 4.2% (test sample size N=5000).

[0081] Please refer to Figure 4 Embodiment four of the present invention is as follows: A cross-device compatibility testing system 1 based on meta-learning includes a memory 2, a processor 3, and a computer program stored on the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, it implements the steps of a cross-device compatibility testing method based on meta-learning in any of the embodiments 1 to 3 described above.

[0082] In summary, the cross-device compatibility testing method and system based on meta-learning provided by this invention has the following beneficial effects: By dynamically collecting hardware features, protocol features, and timing features across devices, multi-dimensional device compatibility detection is achieved. At the same time, feature encoding and cross-modal fusion technology are used to generate a unified-dimensional fusion feature vector, solving the problem of unified representation of heterogeneous features. Furthermore, historical test results are reused through a meta-knowledge base, which effectively reduces redundant test cases compared to the traditional full-scale testing method. Finally, for fusion feature vectors that cannot be reused using historical test results, a hierarchical scoring calculation is performed using an improved MAML algorithm, which significantly improves the efficiency and accuracy of cross-device compatibility testing.

[0083] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A cross-device compatibility testing method based on meta-learning, characterized in that, Including the following steps: The system collects hardware features, protocol features, and timing features of different target devices; it performs feature encoding and cross-modal fusion on the collected features to obtain a fused feature vector; it matches the fused feature vector with historical feature vectors. If the match is successful, it returns the historical compatibility score corresponding to the historical feature vector. Otherwise, it uses a meta-learning model to perform hierarchical scoring and weighted calculation on the fused feature vector to obtain the current compatibility score.

2. The cross-device compatibility testing method based on meta-learning according to claim 1, characterized in that, The collection of hardware characteristics, protocol characteristics, and timing characteristics of different target devices specifically includes: By parsing the system files of different target devices, the instruction set fingerprints and memory topology of different target devices can be obtained to obtain hardware characteristics; Capture the communication protocol parameters of different target devices to obtain protocol characteristics; Collect memory access latency sequences of different target devices within a preset time window to obtain timing characteristics.

3. The cross-device compatibility testing method based on meta-learning according to claim 2, characterized in that, The feature encoding of the collected features is specifically as follows: Based on the instruction set fingerprints and memory topology of different target devices, calculate the instruction set Hamming distance and memory topology matching degree of different target devices to generate hardware vectors; The communication protocol parameters of different target devices are normalized to generate protocol vectors; Access patterns are extracted from memory access latency sequences of different target devices to generate time-series vectors.

4. The cross-device compatibility testing method based on meta-learning according to claim 3, characterized in that, The cross-modal fusion of the collected features specifically involves: The hardware vector, protocol vector, and timing vector are aligned and concatenated using a cross-modal attention mechanism, and then compressed into a fusion feature vector of a preset dimension through a fully connected layer.

5. The cross-device compatibility testing method based on meta-learning according to claim 1, characterized in that, The process involves matching the fused feature vector with historical feature vectors. If a match is successful, a historical compatibility score corresponding to the historical feature vector is returned. Specifically: The fused feature vector is stored in a preset meta-knowledge base. The fused feature vector is then compared with the historical feature vectors in the meta-knowledge base for similarity. If the similarity reaches a first threshold, the historical compatibility score of the corresponding historical feature vector stored in the meta-knowledge base is returned directly.

6. The cross-device compatibility testing method based on meta-learning according to claim 3, characterized in that, The specific training steps for the meta-learning model are as follows: The training task is divided into hardware layer, protocol layer, and application layer, and offline pre-training is performed: The learning rate of each layer parameter is dynamically adjusted during the online phase to obtain the meta-learning model.

7. The cross-device compatibility testing method based on meta-learning according to claim 6, characterized in that, The method of using a meta-learning model to perform hierarchical scoring on the fused feature vector is as follows: In the hardware layer, the hardware vector is input into the meta-learning model, and the instruction set similarity and memory topology matching degree are output and weighted to serve as the hardware layer score. The protocol vector is input into the meta-learning model at the protocol layer, and the similarity of communication protocol parameter features is output as the protocol layer score. In the application layer, the time-series vector is input into the meta-learning model, and the output interface calls the sequence edit distance as the application layer score.

8. The cross-device compatibility testing method based on meta-learning according to claim 7, characterized in that, The method of using a meta-learning model to weight the fused feature vector to obtain the current compatibility score is as follows: Different weight coefficients are assigned to each layer, and the current compatibility score is calculated by weighting the hardware layer score, the protocol layer score, and the application layer score with their corresponding weight coefficients.

9. The cross-device compatibility testing method based on meta-learning according to claim 1, characterized in that, After obtaining the compatibility score, the process also includes: The corresponding response operation is triggered based on the historical compatibility score or the current compatibility score.

10. A cross-device compatibility testing system based on meta-learning, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of a meta-learning-based cross-device compatibility testing method as described in any one of claims 1 to 9.