Multi-protocol self-adaptive intelligent assertion engine system and cross-platform verification method
The intelligent assertion engine system with multi-protocol self-adaptation solves the problems of high protocol coupling, high maintenance cost, single verification dimension and limited scalability in multi-protocol mixed testing. It realizes efficient and accurate cross-protocol verification and difference analysis, and improves testing efficiency and scalability.
Patent Information
- Application Number
- CN202511254439.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-09-04
AI Technical Summary
Existing interface testing tools suffer from problems such as high protocol coupling, high maintenance costs, single verification dimensions, weak difference analysis, and limited scalability when handling multi-protocol mixed testing, making it difficult to achieve efficient, unified, and visualized verification across protocols.
It provides a multi-protocol self-adaptive intelligent assertion engine system, including a protocol awareness layer, a unified description layer, an adaptation execution layer, and an intelligent analysis layer. Through multi-dimensional feature extraction, weighted scoring mechanism, abstract syntax tree transformation, and visualization rendering, it achieves unified verification and difference analysis across protocols.
It achieves high-accuracy protocol identification and type adaptation, reduces test script maintenance costs, improves code reusability, supports multi-dimensional verification and rapid difference location, and shortens the adaptation cycle for new protocols.
Smart Images

Figure CN120806882B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of software testing technology, specifically, it relates to a multi-protocol self-adaptive intelligent assertion engine system and a cross-platform verification method. Background Technology
[0002] As software systems evolve towards distributed and microservice architectures, inter-system interface communication protocols are becoming increasingly diversified, with protocols such as HTTP, gRPC, and WebSocket coexisting within the same system. Current mainstream interface testing tools (such as Postman, JMeter, and SoapUI) have significant limitations when handling multi-protocol mixed testing, as follows:
[0003] (1) High protocol coupling: Traditional assertion tools need to write independent verification logic for different protocols. For example, verifying HTTP response requires calling a specific status code checking method, while gRPC verification requires parsing the protobuf structure, resulting in strong binding between test scripts and protocol types and low code reuse rate in cross-protocol testing scenarios.
[0004] (2) High maintenance cost: Protocol version upgrades will lead to synchronous modification of assertion scripts. For example, changes in the HTTP / 2 protocol header format and the addition or removal of the protobuf field in the gRPC protocol both require reconstruction of the verification logic. The workload of test script maintenance caused by protocol version iteration accounts for a high proportion of the total test cost, and the system has poor scalability.
[0005] (3) Single verification dimension: It lacks the ability to jointly verify binary protocols, nested data structures and performance indicators. Traditional tools can only verify the surface data of text protocols (such as HTTP status codes and JSON fields), and cannot process WebSocket binary message frames, complex JSON structures with more than ten nested layers, and cannot comprehensively verify performance indicators such as response time and throughput.
[0006] (4) Weak difference analysis: Traditional tools only provide simple Boolean judgment (verification passed or failed), lacking the ability to locate and visualize differences. When a deep field in a nested structure does not match, manual investigation is required layer by layer, resulting in a long average fault location time and an inability to intuitively display the differences in data flow in multi-protocol interaction links.
[0007] (5) Limited scalability: Adding new protocol types (such as MQTT and Kafka) requires modifying the core framework code, which does not comply with the open / closed principle, resulting in high risk of system upgrades. In addition, the development cycle for adding a new protocol verification capability under the traditional architecture is long. Summary of the Invention
[0008] To address the aforementioned technical problems, this invention provides a multi-protocol self-adaptive intelligent assertion engine system and a cross-platform verification method.
[0009] In a first aspect, the present invention provides a multi-protocol self-adaptive intelligent assertion engine system, including a protocol awareness layer, a unified description layer, an adaptation execution layer and an intelligent analysis layer;
[0010] The protocol awareness layer includes a protocol feature library, a multi-dimensional feature extractor, a confidence decision engine, and a protocol version identification subunit. After receiving the data to be verified, the protocol awareness layer uses the multi-dimensional feature extractor to extract protocol features. The confidence decision engine dynamically adjusts the weights of the protocol features through a weighted scoring mechanism, establishes a scoring mechanism, matches the protocol features with the protocol feature library, comprehensively evaluates the matching scores of the protocol features, and determines the protocol type. The protocol version identification subunit extracts version information.
[0011] The unified description layer includes a DAL parser, an abstract syntax tree generator, and a protocol-independent validation rule converter. The DAL parser parses user-written declarative assertion rules; the abstract syntax tree generator generates an abstract syntax tree based on the parsing results; and the protocol-independent validation rule converter converts the abstract syntax tree into validation instructions based on the protocol type.
[0012] The adaptation execution layer includes a validator factory, a class loader isolation container, a protocol-validator mapping table, and an execution result aggregator. The validator factory loads the validator corresponding to the protocol from the class loader isolation container using the factory pattern based on the recognition result of the protocol awareness layer and the protocol-validator mapping table. The validator executes the verification instructions transformed by the unified description layer. The execution result aggregator collects the verification results.
[0013] The intelligent analysis layer includes a nested data comparison engine, a binary difference calculation unit, a multi-dimensional result correlation analyzer, and a visualization renderer. The nested data comparison engine compares the verification results using nested data structures. The binary difference calculation unit calculates the binary data edit distance. The multi-dimensional result correlation analyzer generates a comprehensive report based on correlation performance indicators. The visualization renderer visualizes the comprehensive report and displays the difference details through a visual interface.
[0014] Secondly, this invention provides a cross-platform verification method for intelligent assertions with multi-protocol self-adaptation, including protocol identification, rule parsing, verification execution, and result analysis;
[0015] Protocol identification includes: after the protocol awareness layer receives the data to be verified, the multi-dimensional feature extractor extracts the protocol features, matches the protocol features with the protocol feature library, establishes a scoring mechanism to determine the protocol type, and extracts the version information;
[0016] Rule parsing includes: the DAL parser parsing user-written declarative assertion rules; the abstract syntax tree generator generating an abstract syntax tree based on the parsing results; and the protocol-independent validation rule converter converting the abstract syntax tree into validation instructions based on the protocol type.
[0017] Verification execution includes: the verifier factory loads the corresponding protocol verifier from the class loader isolation container using the factory pattern based on the protocol awareness layer's identification result and the protocol-verifier mapping table; the verifier executes the verification instructions transformed by the unified description layer; and the execution result aggregator collects the verification results.
[0018] The results analysis includes: a nested data comparison engine comparing the verification results using nested data structures; a binary difference calculation unit calculating the binary data edit distance; a multi-dimensional result correlation analyzer generating a comprehensive report based on correlation performance indicators; and a visualization renderer visualizing the comprehensive report and displaying the difference details through a visual interface.
[0019] Based on the above technical solution, the present invention can be further improved as follows.
[0020] Furthermore, a scoring mechanism is established to determine the protocol type, including establishing a weighted scoring mechanism to identify the protocol type; setting dynamic weights for each protocol feature; determining the protocol type when the total score is greater than or equal to a set score threshold, and initiating a downgrade verification mechanism when the total score is lower than the set score threshold, and determining the protocol type through general rules.
[0021] Furthermore, a unified validator interface is defined; the validator factory uses the factory pattern to dynamically load protocol adapter components.
[0022] Furthermore, at runtime, the new protocol validator's JAR file is loaded into the isolated container via the class loader during system runtime, adding a new protocol validator.
[0023] Furthermore, class loaders are used to isolate the container and run each validator, with each validator running in an independent class loader space.
[0024] Furthermore, the nested data comparison engine uses a depth-first search strategy to traverse nested objects, compares hash values to pre-judge the verification results, and compares nested data structures for verification results when hash values are different.
[0025] Furthermore, the binary difference calculation unit performs binary data edit distance calculation, and optimizes the Levenshtein distance algorithm to calculate the minimum modification steps required for binary data conversion.
[0026] Furthermore, by associating the verification results of different protocols in the same business link, cross-protocol data flow anomalies can be identified.
[0027] Furthermore, the visualization renderer generates a visualization report that includes a JSON tree view, hexadecimal comparisons, and performance metric curves.
[0028] The beneficial effects of this invention are:
[0029] (1) High protocol identification accuracy and high code reuse rate in cross-protocol testing scenarios;
[0030] (2) The workload of maintaining test scripts caused by protocol version iteration accounts for a low proportion of the total testing cost, and the maintenance cost is low;
[0031] (3) It can realize multi-dimensional verification, handle WebSocket binary message frames and complex JSON structures with more than ten nested layers, and can perform comprehensive verification by associating performance indicators such as response time and throughput;
[0032] (4) The new protocol has a short adaptation period, a short time to locate differences in nested data, and can intuitively display the differences in data flow in the multi-protocol interaction link;
[0033] (5) It has strong scalability and a short development cycle for the verification capability of adding a new protocol. Attached Figure Description
[0034] Figure 1 This is a block diagram of the multi-protocol self-adaptive intelligent assertion engine system provided in Embodiment 1 of the present invention.
[0035] Figure 2 A flowchart illustrating the specific workflow of a multi-protocol self-adaptive intelligent assertion engine system;
[0036] Figure 3 Here is a flowchart of the system testing process;
[0037] Figure 4 This is a schematic diagram of the visual interface;
[0038] Figure 5 This is a schematic diagram of the cross-platform verification method for a multi-protocol self-adaptive intelligent assertion engine provided in Embodiment 2 of the present invention. Detailed Implementation
[0039] 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 embodiments of the present invention, and not all embodiments. 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.
[0040] Example 1
[0041] As an example, see the attached document. Figure 1 As shown, in order to solve the above technical problems, this embodiment provides a multi-protocol self-adaptive intelligent assertion engine system, including a protocol awareness layer, a unified description layer, an adaptation execution layer and an intelligent analysis layer;
[0042] The protocol awareness layer includes a protocol feature library, a multi-dimensional feature extractor, a confidence decision engine, and a protocol version identification subunit. After receiving the data to be verified, the protocol awareness layer uses the multi-dimensional feature extractor to extract protocol features. The confidence decision engine dynamically adjusts the weights of the protocol features through a weighted scoring mechanism, establishes a scoring mechanism, matches the protocol features with the protocol feature library, comprehensively evaluates the matching scores of the protocol features, and determines the protocol type. The protocol version identification subunit extracts version information.
[0043] The unified description layer includes a DAL parser, an abstract syntax tree generator, and a protocol-independent validation rule converter. The DAL parser parses user-written declarative assertion rules; the abstract syntax tree generator generates an abstract syntax tree based on the parsing results; and the protocol-independent validation rule converter converts the abstract syntax tree into validation instructions based on the protocol type.
[0044] The adaptation execution layer includes a validator factory, a class loader isolation container, a protocol-validator mapping table, and an execution result aggregator. The validator factory loads the validator corresponding to the protocol from the class loader isolation container using the factory pattern based on the recognition result of the protocol awareness layer and the protocol-validator mapping table. The validator executes the verification instructions transformed by the unified description layer. The execution result aggregator collects the verification results.
[0045] The intelligent analysis layer includes a nested data comparison engine, a binary difference calculation unit, a multi-dimensional result correlation analyzer, and a visualization renderer. The nested data comparison engine compares the verification results using nested data structures. The binary difference calculation unit calculates the binary data edit distance. The multi-dimensional result correlation analyzer generates a comprehensive report based on correlation performance indicators. The visualization renderer visualizes the comprehensive report and displays the difference details through a visual interface.
[0046] By employing a depth-first search strategy to traverse nested data structures (such as 16-level nested JSON), field-level differences are quickly located, reducing manual investigation time. Data consistency is first quickly determined using hash values; if inconsistencies are found, a deep comparison is then performed. Comparison of 16-level nested structures is supported, with difference location accuracy down to the field level. Correlated performance metrics such as response time and throughput are obtained by collecting performance data from the validator execution process through an execution result aggregator. A multi-dimensional result correlation analyzer correlates and analyzes the verification results of different protocols within the same business chain (such as HTTP response time 120ms, gRPC 85ms, and WebSocket 30ms), generating a comprehensive report. Cross-protocol performance differences are visually displayed through performance metric curves (such as response time trend charts).
[0047] For details, see attached. Figure 2 As shown, the specific workflow of this multi-protocol self-adaptive intelligent assertion engine system is as follows:
[0048] After the system starts detection, the system being detected sends a request to the multi-protocol adapter. The multi-protocol adapter detects HTTP characteristics, gRPC characteristics, WebSocket characteristics, binary characteristics, and TCP characteristics respectively through the HTTP response processor, gRPC response decoder, and WS message parser.
[0049] The DAL syntax parser employs a multi-protocol fingerprinting method. The protocol awareness layer dynamically acquires HTTP / gRPC / WebSocket protocol features through a multi-dimensional protocol feature extractor, automatically identifying protocol type and version information. After receiving the data to be verified, it extracts protocol features (such as HTTP's status_code, gRPC's content-type header, and WebSocket's Sec-WebSocket-Key), and determines the protocol type through feature matching and scoring mechanisms, achieving an accuracy rate of over 98.7%.
[0050] The unified description layer provides a declarative assertion description language (DAL) and a parsing engine, which can realize the unified definition of verification rules across protocols. The unified rule parser parses the user-written declarative assertion rules (such as YAML / JSON assertion descriptions) into an abstract syntax tree, and then converts them into specific verification instructions according to the protocol type, so as to achieve writing once and applying to multiple protocols.
[0051] The adaptation execution layer dynamically loads protocol-specific verifiers to execute specific verification logic, such as HTTP assertion executors, gRPC assertion executors, and WebSocket assertion executors. Based on the recognition results of the protocol awareness layer, the adaptation execution layer loads the corresponding protocol verifiers from the class loading isolation container through the factory pattern. The verifiers execute the verification instructions converted by the unified description layer and collect the verification results.
[0052] The intelligent analysis layer enables cross-protocol difference comparison and visualization report generation. Through in-depth analysis of verification results, the intelligent analysis layer supports comparison of 16-layer nested data structures and binary data edit distance calculation. It generates comprehensive reports by correlating performance metrics and displays detailed differences through a visual interface.
[0053] In practical applications, a declarative assertion description language is adopted. Through a unified assertion syntax across protocols, it supports common verification scenarios such as status code verification, metadata validation, and message frame analysis. Protocol-independent rule definitions are achieved through an abstract syntax tree. Rule reusability is increased to over 85%. Cross-protocol unification refers to unifying communication rules from different protocols (such as HTTP, gRPC, WebSocket, and MQTT) into a common format through middleware, converters, and standardized interfaces. A unified cross-protocol assertion syntax refers to an assertion rule definition method applicable to multiple protocols. Assertion logic (such as status code verification and field validation) only needs to be written once and can be reused across protocols (such as HTTP, gRPC, and WebSocket), eliminating the need to define separate assertion syntax for each protocol. Protocol-independent rule conversion is achieved through a declarative language and an abstract syntax tree.
[0054] Optionally, a scoring mechanism is established to determine the protocol type, including establishing a weighted scoring mechanism to identify the protocol type; setting dynamic weights for each protocol feature; determining the protocol type when the total score is greater than or equal to a set score threshold, and initiating a downgrade verification mechanism when the total score is lower than the set score threshold, and determining the protocol type through general rules.
[0055] A multi-dimensional protocol determination algorithm based on response header and payload features: A feature library containing multiple protocol features is constructed (such as HTTP status codes, gRPC content-type (in the HTTP protocol, Content-Type is a header field used to indicate the media type of entity data in a request or response), application / grpc (application / grpc is a MIME type (header field) used in gRPC protocol communication to identify that the transmitted data conforms to the gRPC protocol specification), etc., and the protocol type is identified through a weighted scoring mechanism.
[0056] Dynamic weights are set for different protocol features, such as 30 points for matching HTTP status codes and 25 points for matching gRPC content-type. When the total score is greater than or equal to 50 points, the protocol type is determined, and when it is less than 50 points, a downgrade verification mechanism is activated.
[0057] Experiments showed that the recognition accuracy of gRPC remote procedure call protocol was 98.7%, the recognition accuracy of WebSocket protocol was 97.3%, and the overall recognition accuracy in mixed protocol scenarios was 96.5%.
[0058] A validator hot-loading mechanism is employed, using the factory pattern to dynamically load protocol adapter components. A unified validator interface is defined, and each protocol validator implements this interface. Instances are dynamically created through the factory class, and adding new protocols requires no modification to the core code. It supports adding protocol validators (such as MQTT / Kafka) at runtime. A class loader isolation container loads the JAR file of the new protocol validator at system runtime, achieving plug-and-play functionality. The class loading isolation container design ensures system stability; each validator runs in an independent class loader space, avoiding class conflicts and achieving 100% fault isolation. Adding the MQTT protocol validator took only one day, resulting in a 14x efficiency improvement compared to traditional architectures.
[0059] Employing an intelligent difference analysis engine, this system utilizes a nested data structure comparison algorithm (supporting 16 levels of object recursion): a depth-first search strategy traverses nested objects, and hash value pre-judgment reduces the amount of comparison, achieving field-level difference location accuracy. It employs a binary difference-based edit distance calculation model, optimized based on the Levenshtein distance algorithm, to calculate the minimum modification steps for binary data, supporting byte-level difference location. A hybrid protocol verification result correlation analysis method identifies cross-protocol data flow anomalies by correlating verification results from different protocols within the same business chain. In practical applications, the 16-level nested structure improves comparison speed by 40% compared to traditional recursive algorithms, reduces binary difference location time to 0.3 seconds / MB, and improves fault location efficiency by 80%.
[0060] For example: as attached Figure 3 As shown, after the system starts detection, the system being detected sends a request to the multi-protocol adapter. The multi-protocol adapter detects HTTP features (+30 points if status_code exists), gRPC features (+25 points if content-type contains gRPC), WebSocket features (+20 points if Sec-WebSocket header exists), binary features (+15 points if magic number matches), and TCP features (+10 points) through the HTTP response processor, gRPC response decoder, and WS message parser, respectively. After accumulating the scores, if the highest score is greater than or equal to 50, the protocol type is determined; otherwise, a downgraded general verification is performed.
[0061] When the protocol feature matching score is lower than the set threshold (e.g., 40 points), a downgrade verification mechanism is activated. If the protocol type cannot be determined, basic verification is performed using general rules (e.g., checking the existence of HTTP response headers or matching binary data magic numbers) or protocol determination is performed using only high-weight features (e.g., data format identification mechanisms) to reduce the risk of misjudgment.
[0062] Optionally, a unified validator interface can be defined; the validator factory uses the factory pattern to dynamically load protocol adapter components.
[0063] Optionally, at runtime, the new protocol validator's JAR file can be added by the class loader-isolated container during system runtime.
[0064] Optionally, class loaders can be used to isolate the container and run individual validators, with each validator running in an independent class loader space.
[0065] Optionally, the nested data comparison engine uses a depth-first search strategy to traverse nested objects, compares hash values to pre-judge the verification results, and compares nested data structures for verification results when hash values are different.
[0066] Optionally, the binary difference calculation unit performs binary data edit distance calculation, based on the Levenshtein distance algorithm optimization, to calculate the minimum modification steps required for binary data transformation.
[0067] Optionally, cross-protocol data flow anomalies can be identified by associating the verification results of different protocols in the same business link.
[0068] Optionally, the visualization renderer generates a visualization report that includes a JSON tree view, hexadecimal comparisons, and performance metric curves.
[0069] As attached Figure 4 As shown, the visualization interface consists of: a navigation bar (including protocol selection tabs and view mode switching), a main display area (including actual values on the left and expected values on the right, with differences highlighted), a performance metrics area (including response time curves and throughput heatmaps), and an operation toolbar (including a difference export button, a comment addition tool, and a history comparison slider). It supports multiple display modes, including JSON tree view, hexadecimal comparison, binary analysis, and offset positioning.
[0070] Taking multi-protocol verification of e-commerce order process as an example, the verification of the entire order creation process of e-commerce platform includes creating an order through HTTP interface (RESTful API), querying logistics information through gRPC interface (protobuf format), and receiving inventory change notifications (text and binary message frames) through WebSocket.
[0071] The specific implementation steps include: configuring declarative assertion files; executing automated test scripts; and analyzing verification results. The intelligent analysis layer generates a joint verification report containing HTTP / gRPC / WebSocket data; the visual interface highlights discrepancies (such as an error in calculating the available inventory for an order); and automatically correlates the response times of the three calls (HTTP: 120ms, gRPC: 85ms, WebSocket: 30ms) to generate performance comparison curves.
[0072] Taking MQTT protocol extension adaptation as an example, adding MQTT protocol verification capability to the existing system for IoT device message testing involves the following steps: developing an MQTT protocol verifier; registering the verifier to the system using hot loading; configuring MQTT assertion rules; executing verification and viewing the results: MQTT message verification response time ≤ 50ms; supporting precise location of errors such as QoS level mismatch and missing payload fields; and displaying the relationship between MQTT messages and other protocol messages through a visual interface.
[0073] This invention offers the following advantages: protocol identification accuracy ≥ 96.5%, a 35% improvement over traditional methods; test script reuse rate increased from 30% to over 85%; new protocol adaptation cycle shortened from 2 weeks to 1-2 days; nested data difference location time shortened from 30 minutes to less than 1 minute; test script maintenance costs reduced by over 60%; no need to provide dedicated tools for each protocol, reducing the procurement cost of new protocol testing tools; and shortened testing cycles, accelerating product launch time (an average reduction of 15%-20%).
[0074] This invention is applicable to automated testing of multi-protocol mixed call scenarios under microservice architecture, and can provide efficient testing solutions for multi-protocol interaction-intensive fields such as IoT and fintech. It also supports testing teams to quickly respond to protocol upgrades and new requirements, thereby improving the productivity of testing teams.
[0075] Example 2
[0076] Based on the same principle as the method shown in Embodiment 1 of the present invention, as illustrated in the appendix. Figure 5 As shown, the embodiments of the present invention also provide a cross-platform verification method for intelligent assertions with multi-protocol self-adaptation, including protocol identification, rule parsing, verification execution and result analysis;
[0077] Protocol identification includes: after the protocol awareness layer receives the data to be verified, the multi-dimensional feature extractor extracts the protocol features, matches the protocol features with the protocol feature library, establishes a scoring mechanism to determine the protocol type, and extracts the version information;
[0078] Rule parsing includes: the DAL parser parsing user-written declarative assertion rules; the abstract syntax tree generator generating an abstract syntax tree based on the parsing results; and the protocol-independent validation rule converter converting the abstract syntax tree into validation instructions based on the protocol type.
[0079] Verification execution includes: the verifier factory loads the corresponding protocol verifier from the class loader isolation container using the factory pattern based on the protocol awareness layer's identification result and the protocol-verifier mapping table; the verifier executes the verification instructions transformed by the unified description layer; and the execution result aggregator collects the verification results.
[0080] The results analysis includes: a nested data comparison engine comparing the verification results using nested data structures; a binary difference calculation unit calculating the binary data edit distance; a multi-dimensional result correlation analyzer generating a comprehensive report based on correlation performance indicators; and a visualization renderer visualizing the comprehensive report and displaying the difference details through a visual interface.
[0081] Optionally, a scoring mechanism is established to determine the protocol type, including establishing a weighted scoring mechanism to identify the protocol type; setting dynamic weights for each protocol feature; determining the protocol type when the total score is greater than or equal to a set score threshold, and initiating a downgrade verification mechanism when the total score is lower than the set score threshold, and determining the protocol type through general rules.
[0082] Optionally, a unified validator interface can be defined; the validator factory uses the factory pattern to dynamically load protocol adapter components.
[0083] Optionally, at runtime, the new protocol validator's JAR file can be added by the class loader-isolated container during system runtime.
[0084] Optionally, class loaders can be used to isolate the container and run individual validators, with each validator running in an independent class loader space.
[0085] Optionally, the nested data comparison engine uses a depth-first search strategy to traverse nested objects, compares hash values to pre-judge the verification results, and compares nested data structures for verification results when hash values are different.
[0086] Optionally, the binary difference calculation unit performs binary data edit distance calculation, based on the Levenshtein distance algorithm optimization, to calculate the minimum modification steps required for binary data transformation.
[0087] Optionally, cross-protocol data flow anomalies can be identified by associating the verification results of different protocols in the same business link.
[0088] Optionally, the visualization renderer generates a visualization report that includes a JSON tree view, hexadecimal comparisons, and performance metric curves.
[0089] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A multi-protocol self-adaptive intelligent assertion engine system, characterized in that, It includes a protocol awareness layer, a unified description layer, an adaptation and execution layer, and an intelligent analysis layer; The protocol awareness layer includes a protocol feature library, a multi-dimensional feature extractor, a confidence decision engine, and a protocol version identification subunit. After receiving the data to be verified, the multi-dimensional feature extractor extracts protocol features, matches the protocol features with the protocol feature library, establishes a scoring mechanism to determine the protocol type, and extracts version information. The unified description layer includes a DAL parser, an abstract syntax tree generator, and a protocol-independent validation rule converter. The DAL parser parses user-written declarative assertion rules; The abstract syntax tree generator generates an abstract syntax tree based on the parsing results; the protocol-independent verification rule converter converts the abstract syntax tree into verification instructions based on the protocol type. The execution layer is adapted, including a validator factory, a class loader isolation container, a protocol-validator mapping table, and an execution result aggregator; The validator factory loads the corresponding protocol validator from the class loader isolation container using the factory pattern, based on the recognition result of the protocol awareness layer and the protocol-validator mapping table; the validator executes the verification instructions transformed by the unified description layer. The execution result aggregator collects the verification results; The intelligent analysis layer includes a nested data comparison engine, a binary difference calculation unit, a multi-dimensional result correlation analyzer, and a visualization renderer. The nested data comparison engine performs nested data structure comparisons on the verification results. The binary difference calculation unit performs binary data edit distance calculation; The multi-dimensional results correlation analyzer generates a comprehensive report based on correlation performance indicators; The visualization renderer visualizes the comprehensive report and displays the differences through a visual interface.
2. The multi-protocol self-adaptive intelligent assertion engine system according to claim 1, characterized in that, Establish a scoring mechanism to determine the protocol type, including establishing a weighted scoring mechanism to identify the protocol type; and setting dynamic weights for each protocol feature; The protocol type is determined when the total score is greater than or equal to the set score threshold, and the degradation verification mechanism is activated when the total score is lower than the set score threshold. The protocol type is determined by general rules.
3. The multi-protocol self-adaptive intelligent assertion engine system according to claim 1, characterized in that, Define a unified validator interface; the validator factory uses the factory pattern to dynamically load protocol adapter components.
4. The multi-protocol self-adaptive intelligent assertion engine system according to claim 1, characterized in that, At runtime, the class loader isolates the container and loads the JAR file of the new protocol validator during system runtime, adding a new protocol validator.
5. The multi-protocol self-adaptive intelligent assertion engine system according to claim 1, characterized in that, The container is isolated by class loaders to run individual validators, with each validator running in an independent class loader space.
6. The multi-protocol self-adaptive intelligent assertion engine system according to claim 1, characterized in that, The nested data comparison engine uses a depth-first search strategy to traverse nested objects, compares hash values to pre-judge the verification results, and compares nested data structures for verification results when hash values are different.
7. The multi-protocol self-adaptive intelligent assertion engine system according to claim 1, characterized in that, The binary difference calculation unit performs binary data edit distance calculation, based on the Levenshtein distance algorithm optimization, to calculate the minimum modification steps required for binary data transformation.
8. The multi-protocol self-adaptive intelligent assertion engine system according to claim 1, characterized in that, By correlating the verification results of different protocols within the same business process, cross-protocol data flow anomalies can be identified.
9. The multi-protocol self-adaptive intelligent assertion engine system according to claim 1, characterized in that, The visualization renderer generates a visual report that includes a JSON tree view, hexadecimal comparisons, and performance metric curves.
10. A cross-platform verification method for intelligent assertions with multi-protocol self-adaptation, characterized in that, This includes protocol identification, rule parsing, verification execution, and result analysis; Protocol identification includes: after the protocol awareness layer receives the data to be verified, the multi-dimensional feature extractor extracts the protocol features, matches the protocol features with the protocol feature library, establishes a scoring mechanism to determine the protocol type, and extracts the version information; Rule parsing includes: the DAL parser parsing user-written declarative assertion rules; the abstract syntax tree generator generating an abstract syntax tree based on the parsing results; and the protocol-independent validation rule converter converting the abstract syntax tree into validation instructions based on the protocol type. Verification execution includes: the verifier factory loads the corresponding protocol verifier from the class loader isolation container using the factory pattern based on the protocol awareness layer's identification result and the protocol-verifier mapping table; the verifier executes the verification instructions transformed by the unified description layer; and the execution result aggregator collects the verification results. The results analysis includes: a nested data comparison engine comparing the verification results using nested data structures; a binary difference calculation unit calculating the binary data edit distance; a multi-dimensional result correlation analyzer generating a comprehensive report based on correlation performance indicators; and a visualization renderer visualizing the comprehensive report and displaying the difference details through a visual interface.
Citation Information
Patent Citations
Cross-database SQL automatic adaptation detection method and system
CN120371683A
Identification and verification of factual assertions in natural language
US20160078149A1