Intersystem multi-type and multi-structure interface test data generation system
By designing a multi-type and multi-structure interface test data generation system between systems, the complexity of interface data simulation testing in aerospace business systems is solved, and stability and scalability are improved, reducing testing costs.
Patent Information
- Application Number
- CN202510630135.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-22
AI Technical Summary
During the system joint test process in aerospace business systems, the simulation and testing of interface data of multiple types and structures is complex, and the customized development and testing program is not scalable, resulting in increased development risks and costs.
Design a multi-type and multi-structure interface test data generation system between systems, including data layer, application service layer and presentation layer. Interface and data items are defined through interface information model, data item information model and data item hierarchy model, and use xml, json and binary type data generation service to generate test data, supporting configurable and extensible data generation.
It improves the stability and scalability of the system, reduces the testing cost, can adapt to different business scenarios, and realizes efficient generation of test data for aerospace business system interfaces.
Smart Images

Figure CN120523740A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a multi-type and multi-structure interface test data generation system in the field of aerospace business systems, and is particularly suitable for dynamically configuring and generating interface test data of different types and structures between systems. Background Art
[0002] In the field of aerospace business systems, simulation tests of interface data of various types and structures are often required during system joint testing. Developers and testers need to build dedicated test data based on different interface types, interface structures, and interface information to complete the test. This type of test interface has many types and complex interface content. The customized development test program is not highly scalable. Interface changes will bring many unforeseen risks and duplication of work to system development, increasing development risks and costs. Summary of the Invention
[0003] The object of the present invention is to avoid the deficiencies in the above-mentioned background technology and provide a system for generating multi-type and multi-structure interface test data between systems.
[0004] The technical solution adopted in the present invention is as follows:
[0005] A system for generating test data for multi-type and multi-structure interfaces between systems, including a data layer, an application service layer, and a presentation layer;
[0006] The data layer includes the interface information model, data item information model and data item hierarchical model;
[0007] The interface information model is used to define the interface name, interface identifier, and interface type; interface types include XML, binary, and JSON types;
[0008] The data item information model is used to define the node form, data item value type, data item default value and data item length; the node form includes XML field, data frame byte array, JSON object and JSON array, and the data item value type includes numeric type, character type, Boolean type, floating point type, byte type and null type;
[0009] The data item hierarchical model is used to define the unique identifier of the interface information, the unique identifier of the data item information, the position offset of the data item, and the unique identifier of the parent node of the current data item. When the unique identifier of the parent node of the current data item is empty, it means that the corresponding node is the root node;
[0010] The application service layer includes basic data configuration service, XML type data generation service, binary type data generation service and JSON type data generation service;
[0011] The basic data configuration service is used to configure common data items and structural information based on XML, binary, and JSON interface data, and to build interface information models, data item information models, and data item hierarchical models, which are stored in the data layer and can be read from the data layer.
[0012] The XML type data generation service and the JSON type data generation service are based on different interface information models and, according to the data item hierarchy model, combine the data item information in the data item information model to form a data structure entity, completing the generation of XML and JSON type interface test data based on the configuration. For XML type data, the data generation algorithm is used to generate XML structure data through the dom4j package; for JSON type data, the data generation algorithm is used to generate JSON structure data through the JSONUtil package.
[0013] The binary type data generation service completes configuration-based binary data generation based on the interface information model, the data item hierarchy model, and the information in the data item information model. It also uses the data generation algorithm to concatenate data items into byte arrays to generate binary structured data.
[0014] The presentation layer includes interface information configuration services and data generation and display services;
[0015] The interface information configuration service is used to configure the interface information model, data item information model and data item hierarchical model in the data layer through the basic data configuration service;
[0016] The data generation and display service is used to display the data entities generated by the XML type data generation service, the JSON type data generation service, and the binary type data generation service.
[0017] Compared with the background technology, the present invention has the following advantages:
[0018] 1. This invention adopts the design concept of business decoupling and sustainable development, supports interface-oriented configurability and scalability, reduces testing costs by extracting the common characteristics of interfaces between systems, and can cope with different business scenarios based on configuration. This invention has good system robustness, stability and scalability;
[0019] 2. This invention analyzes the versatility of the underlying data model and designs a data model that is compatible with storing different types of XML, binary, and JSON. This versatility enables the generation of test data for aerospace business system interfaces.
[0020] 3. The data generation algorithm of the present invention is mainly completed through the strategy pattern algorithm in the form of overall replacement and update algorithm, which greatly improves the scalability and stability of the software code level. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the system architecture of the present invention. DETAILED DESCRIPTION
[0022] The present invention will be further described below with reference to the accompanying drawings.
[0023] The system architecture of the system for generating test data of multi-type and multi-structure interfaces between systems of the present invention is as follows: Figure 1 As shown, it is divided into three layers, including data layer, application service layer and presentation layer.
[0024] (1) Data layer
[0025] The data layer consists of the interface information model, the data item information model and the data item hierarchical relationship model, and is the basic data for the operation of upper-level software and components.
[0026] The interface information model is responsible for distinguishing interface types and defining interface names; the data item information model is responsible for the overall management of different types of data items; and the data item hierarchy model is responsible for defining the hierarchy of data items through a tree structure. The specific structure is as follows:
[0027] 1) Interface information model: unique identifier, interface name, interface identifier, interface type (including XML, binary, and JSON types);
[0028] 2) Data item information model: unique identifier, node form (including XML field, data frame byte array, JSON object and JSON array), data item value type (including numeric type, character type, Boolean type, floating point type, byte type and null type), data item default value, data item length;
[0029] 3) Data item hierarchical model: unique identifier, interface information unique identifier, data item information unique identifier, data item position offset, and unique identifier of the parent node of the current data item (when this item is empty, it means that the node is the root node).
[0030] (2) Application Service Layer
[0031] The application service layer consists of basic data configuration services, XML data generation services, binary data generation services, and JSON data generation services. These data generation services are based on the data layer's data model and utilize basic data configuration services to configure XML, binary, and JSON data models and generate various test data.
[0032] The basic data configuration service configures common data items and structural information based on XML, binary, and JSON interface data, and constructs an interface information model, a data item information model, and a data item hierarchy model, which are stored in the data layer. It also provides the ability to read data items and structural information, and can read specified interface information models, data item information models, and data item hierarchy models from the data layer. The XML-type data generation service and the JSON-type data generation service, based on different interface information models and the data item hierarchy model, combine the data item information in the data item information model to form a data structure entity, completing the generation of configuration-based XML and JSON-type interface test data. The binary-type data generation service, based on the interface information model, and information such as the data item length in the data item hierarchy model and the data item information model, completes configuration-based binary data generation, and uses a data generation algorithm to concatenate data items into byte arrays to generate binary structured data.
[0033] Specific process of XML type data generation service:
[0034] 1) Get all node information of an xml type interface. The data item node form is an xml field, and its collection is X field , and get the root node r of the xml interface, where r∈X field ;
[0035] 2) Define the method f(p,X field ) can get the child node set of the current node p where p∈X field ,
[0036] 3) Define the method To generate the XML structure based on the current node and node set, the following recursive relationship is included:
[0037]
[0038] 4) Get the root node and call g(r,f(r,X field )) method, in the recursive relationship, assigns values to leaf nodes according to the data item value type and the default value of the data item to complete the XML data generation.
[0039] Specific process of binary data generation service:
[0040] 1) Get all node information of a binary interface. The data item node form is a data frame byte array. Let it be the set F frame ;
[0041] 2) In the data frame structure, the root node has no practical meaning, so traverse the set F frame, get the set F of all nodes that are leaf nodes (no child nodes) byte ;
[0042] 3) By traversing the set F byte , assign values to leaf nodes according to the data item value type, the default value of the data item, and the length of the data item, and define node n as the data item in the data item hierarchical model, n∈F byte ;
[0043] 4) During the traversal process, the p(n,len) method is defined to pack binary data according to the position offset of the data item. len represents the traversal set F byte The total length of the data frame accumulated by the middle node completes the generation of binary data frame data.
[0044] Specific process of json type data generation service:
[0045] 1) Get all node information of a json type interface, the data item node form is json object or json array, set its collection to J field , and get the root node r of the json interface, where r∈J field ;
[0046] 2) Define the method f(p,J field ) can get the child node set of the current node p where p∈J field ,
[0047] 3) Define a node set The set J object Contains all data items whose node type is json object (JsonObject);
[0048] 4) Define node collection The set J array Contains all data items whose node type is json array (JsonArray);
[0049] 5) Define method g(r,J,function(r,r)) to generate a json structure based on the current node and node set, where r is a node. Function(r,r) is defined as follows: method h(r,k) adds a JsonObject type data item to the tree structure of the current root node r; method y(r,k) adds a JsonArray type data item to the tree structure of the current root node r, which contains the following recursive relationship:
[0050]
[0051] Represents the set of child nodes of the r node;
[0052] 6) Get the root node and call g(r,f(r,J field ),function(r,r)) method, in the recursive relationship, assigns values to leaf nodes according to the data item value type and the default value of the data item to complete the json data generation.
[0053] (3) Presentation layer
[0054] The presentation layer consists of the interface information configuration service and the data generation and display service. The interface information configuration service dynamically completes the information configuration of a certain interface through the basic data configuration service. The steps are as follows:
[0055] 1) Read the data layer model based on the basic data configuration service, and complete the creation of the interface information model, data item information model, and data item hierarchical model in sequence;
[0056] 2) Configure interface details, including business data nodes and dynamically changeable type nodes, and configure corresponding default values, data item lengths, and other information based on the business;
[0057] 3) Complete the interface hierarchy tree configuration and clarify the tree structure relationship between nodes through dynamic dragging.
[0058] Through the above configuration, the interface content can be visually presented on the interface, showing the hierarchical relationship and specific content information of the interface content in a tree structure.
[0059] The data generation and display service is used to display the data entities generated by the XML type data generation service, the JSON type data generation service, and the binary type data generation service. It can display the specific interface content information, data item information, and the correctness of the generated interface test data through the interface.
Claims
1. A system for generating test data for multi-type and multi-structure interfaces between systems, characterized in that: Includes data layer, application service layer and presentation layer; The data layer includes the interface information model, data item information model and data item hierarchical model; The interface information model is used to define the interface name, interface identifier, and interface type; interface types include XML, binary, and JSON types; The data item information model is used to define the node form, data item value type, data item default value and data item length; the node form includes XML field, data frame byte array, JSON object and JSON array, and the data item value type includes numeric type, character type, Boolean type, floating point type, byte type and null type; The data item hierarchical model is used to define the unique identifier of the interface information, the unique identifier of the data item information, the position offset of the data item, and the unique identifier of the parent node of the current data item. When the unique identifier of the parent node of the current data item is empty, it means that the corresponding node is the root node; The application service layer includes basic data configuration service, XML type data generation service, binary type data generation service and JSON type data generation service; The basic data configuration service is used to configure common data items and structural information based on XML, binary, and JSON interface data, and to build interface information models, data item information models, and data item hierarchical models, which are stored in the data layer and can be read from the data layer. The XML type data generation service and the JSON type data generation service are based on different interface information models and, according to the data item hierarchy model, combine the data item information in the data item information model to form a data structure entity, completing the generation of XML and JSON type interface test data based on the configuration. For XML type data, the data generation algorithm is used to generate XML structure data through the dom4j package; for JSON type data, the data generation algorithm is used to generate JSON structure data through the JSONUtil package. The binary type data generation service completes configuration-based binary data generation based on the interface information model, the data item hierarchy model, and the information in the data item information model. It also uses the data generation algorithm to concatenate data items into byte arrays to generate binary structured data. The presentation layer includes interface information configuration services and data generation and display services; The interface information configuration service is used to configure the interface information model, data item information model and data item hierarchical model in the data layer through the basic data configuration service; The data generation and display service is used to display the data entities generated by the XML type data generation service, the JSON type data generation service, and the binary type data generation service.