Application system interface automatic identification and conversion method and device, equipment and medium

By extracting API data structure information, generating field mapping relationships and using a visual Jolt rule editor, the problem of difficulty in supporting dynamic changes in the existing technology of API data parsing and conversion is solved, and efficient data format standardization and system integration are achieved.

CN120371904AActive Publication Date: 2025-07-25PENGHUA FUND MANAGEMENT CO LTD

Patent Information

Application Number
CN202510425358.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-07-25
Estimated Expiration
2045-04-07

AI Technical Summary

Technical Problem

The existing API data analysis and conversion schemes are based on fixed mapping relationships, making it difficult to support dynamic API changes, resulting in low interface adaptation efficiency and high maintenance costs.

Method used

By obtaining the request and response data of the API interface, extracting data structure information, deducing JSON Schema and generating field mapping relationships, using the visual Jolt rule editor to generate data conversion rules, and establishing a rule hierarchy system, analyzing the response data and standardizing the structure, verifying the conversion data structure through the JSON Schema rules.

Benefits of technology

It improves the degree of automation of API adaptation, ensures standardization of data formats, reduces maintenance costs, enhances the interoperability and stability of data between different systems, and improves system integration efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371904A_ABST
    Figure CN120371904A_ABST
Patent Text Reader

Abstract

The invention relates to an application system interface automatic identification and conversion method and device, equipment and a medium, the method comprises the following steps: obtaining request data and response data of an API interface, extracting API data structure information based on the request data and the response data, further deducing JSON Schema, and generating a field mapping relation; according to the field mapping relation, a visual Jolt rule editor is adopted to generate a data conversion rule, and a rule layering system is established; analyzing response data of the API interface, extracting and standardizing a data structure, and generating a structured data object; and performing data conversion on the structured data object according to the rule hierarchical system, verifying the converted data structure through a JSON Schema rule, generating a converted data structure, and releasing the converted data structure. The method has the effect of improving the interface adaptation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of interface data processing, and in particular, to a method, device, equipment and medium for automatically identifying and converting application system interfaces. Background Art

[0002] Currently, with the rapid development of information systems, the demand for data interaction between different application systems is increasing day by day. APIs (Application Programming Interfaces) have become the main means of system integration and data sharing. Especially in microservice architectures, cloud computing, and enterprise-level information systems, the automatic adaptation and data conversion capabilities of API interfaces play a key role in system compatibility and data circulation efficiency.

[0003] Currently, API data parsing and conversion mainly rely on a conversion engine based on fixed mapping relationships. When faced with different API versions, complex JSON structures, and multi-level nested data, it is easy to cause inaccurate parsing, complex data conversion, and difficult rule management. In addition, some API adaptation solutions adopt static mapping methods, which are difficult to support dynamic API structure changes, resulting in frequent adjustment of conversion logic when the system is upgraded, increasing the maintenance cost.

[0004] The above-mentioned existing technical solutions have the following defects: API data parsing and conversion are based on fixed mapping relationships, which are difficult to support dynamic API changes, resulting in low interface adaptation efficiency and high maintenance cost. Therefore, there is room for improvement. Summary of the Invention

[0005] In order to improve the adaptation efficiency of interfaces, the present application provides a method, device, equipment and medium for automatically identifying and converting application system interfaces.

[0006] The first object of the above-mentioned invention of the present application is achieved through the following technical solutions: A method for automatically identifying and converting application system interfaces, the method comprising: Obtaining request data and response data of an API interface, and extracting API data structure information based on the request data and the response data, and then deriving a JSON Schema and generating a field mapping relationship; According to the field mapping relationship, using a visual Jolt rule editor to generate data conversion rules and establish a rule hierarchical system; Parsing the response data of the API interface, and then extracting and standardizing the data structure to generate a structured data object; Performing data conversion on the structured data object according to the rule hierarchical system, and verifying the converted data structure through JSONSchema rules to generate a converted data structure, and then publishing the converted data structure.

[0007] By adopting the above technical solutions, by extracting API data structure information based on request data and response data, and then deriving JSON Schema and generating field mapping relationships, it is possible to automatically parse the API data structure, reduce the workload of manual analysis and configuration of data formats, thereby improving the automation level of API adaptation, ensuring the standardization of data formats, and enhancing the data compatibility between different systems; by using a visual Jolt rule editor to generate data conversion rules and establishing a rule hierarchy system, it is possible to provide an intuitive and efficient way to manage conversion rules, make the data mapping and conversion logic clearer, thereby reducing the maintenance cost and improving the scalability of data conversion rules; by parsing API response data, extracting and standardizing the data structure, and generating a structured data object, it is possible to ensure the unity of the data structure, eliminate format differences caused by inconsistent API designs, thereby enhancing the processability of data and improving the interoperability of data between different systems; by performing data conversion on the structured data object according to the rule hierarchy system and validating the converted data structure through JSON Schema rules, generating a converted data structure and publishing it, it is possible to ensure that the data conversion conforms to the target data format, reduce data loss or format exceptions caused by conversion errors, thereby improving the stability of data conversion, and supporting the automatic publishing of converted data, enabling the data to quickly adapt to the target system and improving the system integration efficiency.

[0008] In one example, the present application can be further configured as follows: the extracting of API data structure information based on the request data and the response data, and then deriving JSON Schema and generating field mapping relationships specifically includes: Adopting a structured parsing method, analyzing the hierarchical relationships of the request data and the response data, and identifying the nested levels of the data structure based on JSON format parsing rules; Combining with a pattern matching algorithm, detecting the field names, data types, and hierarchical structures of the response data, constructing an API data structure information table, and then generating the field mapping relationships.

[0009] By adopting the above technical solution, by analyzing the hierarchical relationship between the request data and the response data using a structured parsing method and identifying the nested levels of the data structure based on the JSON format parsing rules, it is possible to accurately extract the data levels and organization methods of the API, avoid parsing errors caused by complex JSON structures, thereby ensuring the integrity of the extracted data, and improving the readability and consistency of the data format; by combining a pattern matching algorithm to detect the field names, data types, and hierarchical structures of the response data and constructing an API data structure information table, and then generating a field mapping relationship, it is possible to improve the accuracy of field matching, reduce the need for manual configuration of field mapping, thereby enhancing the efficiency of API adaptation and strengthening API version compatibility.

[0010] In one example, the present application can be further configured as: according to the field mapping relationship, using a visual Jolt rule editor to generate data conversion rules and establish a rule hierarchical system, specifically including: According to the Jolt rule editor, perform an interactive mapping on the API data structure information; According to the field mapping relationship and based on a preset conversion rule library, determine the conversion rules for the corresponding fields through a matching algorithm; Establish the rule hierarchical system according to the complexity of the conversion rules.

[0011] By adopting the above technical solution, through an interactive mapping of the API data structure information, it is possible to achieve an intuitive mapping between the API structure and the target data structure, reduce the workload of manually analyzing the API structure, thereby enhancing the operability and accuracy of data mapping; by determining the conversion rules for the corresponding fields through a matching algorithm based on a preset conversion rule library, it is possible to automatically identify and adapt the data conversion method, reduce the need for manual writing of conversion rules, thereby improving the execution efficiency of the conversion rules and enhancing the adaptability of data conversion; by establishing a rule hierarchical system according to the complexity of the conversion rules, it is possible to hierarchically manage conversion rules of different complexities, make the data conversion logic clearer and more orderly, thereby improving the execution efficiency of data conversion and reducing the maintenance cost.

[0012] In one example, the present application can be further configured as: establishing the rule hierarchical system according to the complexity of the conversion rules, specifically including: According to the complexity of the conversion rules, perform hierarchical division according to a preset complexity threshold, where the levels include a basic conversion layer, an advanced conversion layer, and an extended conversion layer; For the basic conversion layer, adopt an index-driven parsing strategy to directly search for stable basic fields; For the advanced transformation layer, in combination with JSON structure analysis, hierarchical parsing of nested data is performed and complex JSON structures are adapted. For the extended transformation layer, based on the dynamic API structure and combined with custom parsing logic, preprocessing is performed on data with calculation and / or transformation requirements.

[0013] By adopting the above technical solutions, by performing hierarchical division according to the preset complexity threshold based on the complexity of the transformation rules, reasonable classification can be carried out for different types of transformation requirements, making the data transformation logic clearer, thereby improving the execution efficiency of the transformation process and reducing the performance overhead caused by complex transformation logic; by adopting an index-driven parsing strategy for the basic transformation layer and directly searching for stable basic fields, the parsing speed of basic data can be improved, traversal calculation can be reduced, and data processing performance can be enhanced; by combining JSON structure analysis for the advanced transformation layer, hierarchical parsing of nested data is performed and complex JSON structures are adapted, which can ensure that the transformation of nested JSON structures complies with the target API specification, thereby improving the transformation accuracy of complex data structures and avoiding data corruption or loss caused by incorrect hierarchical parsing; by performing preprocessing on data with calculation and / or transformation requirements for the extended transformation layer based on the dynamic API structure and combined with custom parsing logic, the dynamic changes of the API structure can be adapted, making the data transformation process more adaptable, thereby enhancing the compatibility during API version upgrades and reducing data transformation failures caused by API changes.

[0014] In one example, the present application can be further configured as: parsing the response data of the parsing API interface, and then extracting and standardizing the data structure to generate a structured data object, specifically including: Based on the field mapping relationship, filtering the necessary fields in the response data; Combined with the rule hierarchical system, determining the corresponding parsing fields for transformation rules of different complexities; Generating a parsing request according to the necessary fields and the parsing fields, and generating the structured data object according to the parsing request.

[0015] By adopting the above technical solutions, by screening necessary fields in the response data based on the field mapping relationship, it is possible to reduce the processing of irrelevant fields during data parsing, improve the efficiency of data parsing, thereby reducing computing resource consumption and optimizing system performance; by combining the rule hierarchical system and determining corresponding parsing fields for conversion rules of different complexities, it is possible to automatically adjust the data parsing scope according to the complexity of the rules, thereby reducing the parsing calculation burden and improving the execution efficiency of the parsing logic; by generating a parsing request based on the necessary fields and parsing fields and generating a structured data object according to the parsing request, it is possible to ensure that the parsed data meets the requirements of the target data format, thereby improving the standardization degree of the data and providing a stable input for subsequent data conversion.

[0016] In one example, the present application can be further configured as: performing data conversion on the structured data object according to the rule hierarchical system, and verifying the converted data structure through JSON Schema rules to generate a converted data structure, specifically including: Performing corresponding data conversion according to the rule hierarchical system according to the conversion complexity of the structured data object; Combining the JSON Schema rules, performing data integrity verification, and optimizing the format of the converted data structure according to the target API specification to generate the converted data structure.

[0017] By adopting the above technical solutions, by performing corresponding data conversion according to the rule hierarchical system according to the conversion complexity of the structured data object, it is possible to select the optimal conversion method for data conversion requirements of different complexities, thereby improving the flexibility of data conversion and ensuring that the data conversion meets business requirements; by combining JSON Schema rules, performing data integrity verification, and optimizing the converted data structure according to the target API specification, it is possible to ensure that the converted data meets the expected data format standard, thereby improving the correctness of data conversion, avoiding data transmission failures or system exceptions caused by format errors, and improving the stability of data interaction between systems.

[0018] The above second inventive object of the present application is achieved through the following technical solutions: An application system interface automatic recognition and conversion device, the device includes: A data extraction module, configured to obtain request data and response data of an API interface, extract API data structure information based on the request data and the response data, and then deduce a JSON Schema and generate a field mapping relationship; A rule generation module, configured to generate a data conversion rule by using a visual Jolt rule editor according to the field mapping relationship and establish a rule hierarchical system; A data parsing module, configured to parse the response data of the API interface, and then extract and standardize the data structure to generate a structured data object; A data conversion and publishing module, configured to perform data conversion on the structured data object according to the rule hierarchy, and verify the converted data structure through JSON Schema rules to generate a converted data structure, and then publish the converted data structure.

[0019] By adopting the above technical solutions, by extracting API data structure information based on request data and response data, and then deriving JSON Schema and generating field mapping relationships, it is possible to automatically parse the API data structure, reduce the workload of manual analysis and configuration of data formats, thereby improving the automation degree of API adaptation, ensuring the standardization of data formats, and enhancing the data compatibility between different systems; by using a visual Jolt rule editor to generate data conversion rules and establishing a rule hierarchy, it is possible to provide an intuitive and efficient way to manage conversion rules, make the data mapping and conversion logic clearer, thereby reducing the maintenance cost and improving the scalability of data conversion rules; by parsing API response data, extracting and standardizing the data structure, and generating a structured data object, it is possible to ensure the unity of the data structure, eliminate format differences caused by inconsistent API designs, thereby enhancing the processability of data and improving the interoperability of data between different systems; by performing data conversion on the structured data object according to the rule hierarchy, and verifying the converted data structure through JSON Schema rules, generating a converted data structure and publishing it, it is possible to ensure that the data conversion conforms to the target data format, reduce data loss or format exceptions caused by conversion errors, thereby improving the stability of data conversion, and supporting the automatic publishing of converted data, enabling the data to quickly adapt to the target system and improving the system integration efficiency.

[0020] The above object three of the present application is achieved by the following technical solutions: A computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the above application system interface automatic recognition and conversion method are implemented.

[0021] The above object four of the present application is achieved by the following technical solutions: A computer-readable storage medium, storing a computer program, wherein when the computer program is executed by a processor, the steps of the above application system interface automatic recognition and conversion method are implemented.

[0022] In summary, the present application includes the following beneficial technical effects: 1. By extracting API data structure information based on request data and response data, and then deriving JSONSchema and generating field mapping relationships, it is possible to automatically parse the API data structure, reduce the workload of manual analysis and configuration of data formats, thereby improving the automation level of API adaptation, ensuring the standardization of data formats, and enhancing data compatibility between different systems. By using a visual Jolt rule editor to generate data conversion rules and establishing a rule hierarchy system, it is possible to provide an intuitive and efficient way to manage conversion rules, making the data mapping and conversion logic clearer, thereby reducing maintenance costs and improving the scalability of data conversion rules. By parsing API response data, extracting and standardizing the data structure, and generating structured data objects, it is possible to ensure the unity of the data structure, eliminate format differences caused by inconsistent API designs, thereby enhancing the processability of data and improving the interoperability of data between different systems. By performing data conversion on structured data objects according to the rule hierarchy system and validating the converted data structure through JSON Schema rules, generating and publishing the converted data structure, it is possible to ensure that the data conversion conforms to the target data format, reduce data loss or format anomalies caused by conversion errors, thereby improving the stability of data conversion and supporting the automatic publishing of converted data, enabling the data to quickly adapt to the target system and improving system integration efficiency. 2. By using a structured parsing method to analyze the hierarchical relationship between request data and response data and identifying the nested levels of the data structure based on JSON format parsing rules, it is possible to accurately extract the data levels and organization methods of the API, avoid parsing errors caused by complex JSON structures, thereby ensuring the integrity of the extracted data and improving the readability and consistency of the data format. By combining pattern matching algorithms to detect the field names, data types, and hierarchical structures of response data and constructing an API data structure information table, and then generating field mapping relationships, it is possible to improve the accuracy of field matching, reduce the need for manual configuration of field mappings, thereby enhancing the efficiency of API adaptation and improving API version compatibility. 3. By performing interactive mapping on API data structure information, it is possible to achieve an intuitive mapping between the API structure and the target data structure, reduce the workload of manual analysis of the API structure, thereby enhancing the operability and accuracy of data mapping. By determining the conversion rules for corresponding fields through a matching algorithm based on a preset conversion rule library, it is possible to automatically identify and adapt data conversion methods, reduce the need for manual writing of conversion rules, thereby improving the execution efficiency of conversion rules and enhancing the adaptability of data conversion. By establishing a rule hierarchy system based on the complexity of conversion rules, it is possible to hierarchically manage conversion rules of different complexities, making the data conversion logic clearer and more orderly, thereby improving the execution efficiency of data conversion and reducing maintenance costs. Description of the Drawings

[0023] Figure 1 is a flowchart of a method for automatically identifying and converting application system interfaces in an embodiment of the present application; Figure 2 is a flowchart for implementing step S10 in the method for automatically identifying and converting application system interfaces in an embodiment of the present application; Figure 3 is a flowchart for implementing step S20 in the method for automatically identifying and converting application system interfaces in an embodiment of the present application; Figure 4 is a flowchart for implementing step S23 in the method for automatically identifying and converting application system interfaces in an embodiment of the present application; Figure 5 is a flowchart for implementing step S30 in the method for automatically identifying and converting application system interfaces in an embodiment of the present application; Figure 6 is a flowchart for implementing step S40 in the method for automatically identifying and converting application system interfaces in an embodiment of the present application; Figure 7 is a schematic block diagram of an apparatus for automatically identifying and converting application system interfaces in an embodiment of the present application; Figure 8 is a schematic diagram of a device in an embodiment of the present application. Detailed Description of the Embodiment

[0024] The present application will be further described in detail below with reference to the accompanying drawings.

[0025] In one embodiment, as Figure 1 shown, the present application discloses a method for automatically identifying and converting application system interfaces, which specifically includes the following steps: S10: Obtain the request data and response data of the API interface, extract the API data structure information based on the request data and response data, and then deduce the JSON Schema and generate the field mapping relationship.

[0026] Specifically, send a test request to the API interface, capture the returned response data, record the parameter structure and content in the request data at the same time, parse the JSON structure of the API response data, identify the hierarchical relationship, field type and nested structure of the data fields, combine the association relationship between the request data and the response data, deduce the data organization method of the API, generate the JSON Schema structure definition according to the parsing result, ensure that the names, data types and hierarchical structures of all fields conform to the actual data format of the API, and extract the corresponding relationship between the fields to establish the field mapping relationship to support the generation of subsequent data conversion rules.

[0027] S20: According to the field mapping relationship, use the visual Jolt rule editor to generate data conversion rules and establish a rule hierarchical system.

[0028] Specifically, based on the generated field mapping relationship, visually display the API data structure information and the target data structure information. Provide interactive operations through the Jolt rule editor, allowing users to intuitively define data conversion rules. The system automatically parses the field hierarchy and recommends conversion mapping solutions. Users can drag and drop fields for adjustment. At the same time, provide an automatic matching function to reduce the complexity of manual configuration. The conversion rules are classified into different hierarchical structures according to the conversion complexity of the fields, forming a rule hierarchical system to ensure efficient processing according to the applicable scope and complexity of the rules during data conversion.

[0029] S30: Parse the response data of the API interface, and then extract and standardize the data structure to generate a structured data object.

[0030] Specifically, receive the JSON response data returned by the API, screen out relevant fields according to the established field mapping relationship, and standardize the fields with inconsistent data formats. For example, unify the date format to ISO 8601, convert numerical data to a unified unit, standardize boolean values to true / false. For data with nested JSON structures, reorganize the data by expanding or merging according to the hierarchy to make it meet the requirements of the target data structure. Finally, construct a structured data object to ensure its data format, hierarchical relationship, and content integrity for subsequent data conversion.

[0031] S40: Perform data conversion on the structured data object according to the rule hierarchical system, and verify the converted data structure through JSON Schema rules to generate a converted data structure, and then publish the converted data structure.

[0032] Specifically, according to the rule hierarchical system, perform data conversion in sequence according to the conversion rules at different levels. First, directly map the fields in the basic conversion layer, and then perform structural adjustments on the fields in the advanced conversion layer, such as field hierarchy transformation, field splitting and merging. Finally, apply API compatibility adaptation and calculation logic processing to the fields in the extended conversion layer. After the conversion is completed, perform JSON Schema verification on the generated data structure to check data integrity, field type matching, and hierarchical consistency to ensure that the converted data meets the requirements of the target API. Finally, publish the converted data structure, which can be used for actual API calls or storage to support the data interaction requirements of the business system.

[0033] In one embodiment, as Figure 2As shown, in step S10, that is, extracting API data structure information based on request data and response data, and then deriving JSON Schema and generating field mapping relationships, specifically including: S11: Adopt a structured parsing method to analyze the hierarchical relationships of request data and response data, and identify the nested levels of the data structure based on JSON format parsing rules.

[0034] Specifically, when parsing the structures of request data and response data, first traverse the main level of the JSON data to identify all top-level key names, and then perform type judgments on the values of each key name. If the value is of object type, further recursively parse its internal structure, extract field names and data type information, and record the nesting relationship. At the same time, perform special processing on array structures to detect the type consistency of elements within the array to ensure that the subsequent Schema generation can accurately represent the data structure.

[0035] S12: Combine a pattern matching algorithm to detect the field names, data types, and hierarchical structures of response data, and construct an API data structure information table, and then generate field mapping relationships.

[0036] Specifically, when parsing field names, use a pattern matching algorithm to compare the existing API structure information with the currently parsed data fields, identify possible field correspondence relationships through a field name similarity matching algorithm, and at the same time, through a data type inference method, analyze whether the values of the fields conform to JSON Schema specifications, such as standard types like integers, floating-point numbers, and booleans. If the field name similarity is high but the data type does not match, mark it as a suspicious mapping and store it in the API data structure information table. Finally, combine the field mapping relationships, compare the current API structure information with the existing API structures, and generate an optimal field mapping scheme.

[0037] In one embodiment, as Figure 3 shown, in step S20, that is, according to the field mapping relationships, use a visual Jolt rule editor to generate data conversion rules and establish a rule hierarchical system, specifically including: S21: Perform interactive mapping on the API data structure information according to the Jolt rule editor.

[0038] Specifically, after loading the API data structure information, it is visually displayed on the left panel of the editor, and the target data structure is displayed on the right panel. The user is allowed to map fields from the API data structure to the target data structure through drag-and-drop operations. At the same time, an automatic mapping recommendation function is provided. Based on historical data conversion experience, the best field mapping scheme is recommended. The user can manually adjust the mapping relationship, interactively modify the JSON structure hierarchy, and preview the converted JSON structure in real time to ensure mapping accuracy.

[0039] S22: According to the field mapping relationship and based on a preset conversion rule library, determine the conversion rules for the corresponding fields through a matching algorithm.

[0040] Specifically, during the field mapping process, first search the preset conversion rule library to match whether there is a corresponding conversion rule for the current API field. If a matching rule exists, it is directly applied. Otherwise, the conversion rule is automatically deduced through a pattern matching algorithm. For example, for fields with high similarity in field names but different hierarchies, it is recommended to merge or adjust the hierarchy conversion. For fields with different data types but convertible (such as string to numeric), a type conversion rule is recommended. Finally, the conversion rule is automatically generated and stored in the Jolt rule library.

[0041] S23: Establish a rule hierarchical system according to the complexity of the conversion rules.

[0042] Specifically, analyze all the generated conversion rules and calculate their complexity. Simple field mapping rules are classified into the basic conversion layer, rules involving hierarchy adjustment and structure merging are classified into the advanced conversion layer, and rules involving API version compatibility and dynamic adjustment logic are classified into the extended conversion layer. Rules at different levels are applied in the execution order during the conversion process to ensure the correctness and efficiency of data conversion.

[0043] In one embodiment, as Figure 4 shown, in step S23, that is, establish a rule hierarchical system according to the complexity of the conversion rules, which specifically includes: S231: According to the complexity of the conversion rules, perform hierarchical division according to a preset complexity threshold, where the levels include the basic conversion layer, the advanced conversion layer, and the extended conversion layer.

[0044] Specifically, when calculating the complexity of the conversion rules, first analyze the field mapping relationship of the rules, including factors such as the number of fields, field hierarchy, and data type conversion, and perform hierarchical classification based on a preset complexity threshold. If the conversion rule only involves simple field mapping or data type conversion without nested structure adjustment, it is classified as the basic conversion layer. If the conversion rule involves operations such as JSON hierarchical structure adjustment, field merging and splitting, it is classified as the advanced conversion layer. If the conversion rule involves complex processing methods such as API version change adaptation, dynamic field processing, and calculation logic, it is classified as the extended conversion layer. After hierarchical classification, each conversion rule is stored in the corresponding conversion rule library and parsed and processed in hierarchical order during data conversion execution.

[0045] S232: For the basic conversion layer, adopt an index-driven parsing strategy to directly search for stable basic fields.

[0046] Specifically, when parsing the fields of the basic conversion layer, first create a field index table, index the basic fields in the API data structure information, and perform searches in the key-value mapping manner. When parsing the API response data, directly locate the fields based on the index table without traversing the entire JSON structure, thereby improving the parsing efficiency. Perform simple data type conversions on the values of the basic fields, such as string to integer, boolean value conversion, etc., to ensure the stability of the data structure. After parsing, store the conversion results in a structured data object and mark the conversion status to ensure that the conversion results of the basic fields can be used for subsequent conversion layer processing.

[0047] S233: For the advanced conversion layer, combine JSON structure analysis to perform hierarchical parsing of nested data and adapt to complex JSON structures.

[0048] Specifically, when parsing the fields of the advanced conversion layer, first detect the nested fields in the API response data, identify the hierarchical relationship in the JSON structure, expand each nested field hierarchically, and determine whether merging, splitting, or hierarchical adjustment is required according to the data conversion rules. For fields that require hierarchical adjustment, recalculate their path mapping and reconstruct the JSON hierarchy according to the target API structure. If there is an array structure, analyze the element type of the array to ensure that the converted array structure is consistent with the target API specification. After parsing, store the processed data in a structured data object to ensure that the field mapping of the advanced conversion layer meets the API adaptation requirements.

[0049] S234: For the extended conversion layer, based on the dynamic API structure, combine custom parsing logic to preprocess data with calculation and / or conversion requirements.

[0050] Specifically, when parsing the fields in the extended conversion layer, first detect whether there are dynamic changes in the API structure, such as field name changes, field deletions, new fields, etc., and adjust the conversion logic according to the API version adaptation rules. If the API version changes, automatically match the historical API structure and apply the optimal compatibility strategy to ensure data adaptability. For fields with calculation requirements, execute calculation rules according to the custom parsing logic, such as unit conversion of field values, time format conversion, string concatenation, etc., and store the calculation results in the target data structure. If there are incompatibilities during the conversion process, trigger error logging and provide manual adjustment options to ensure the flexibility and traceability of data conversion.

[0051] In one embodiment, as Figure 5 shown, in step S30, that is, parsing the response data of the API interface, and then extracting and standardizing the data structure to generate a structured data object, specifically including: S31: Based on the field mapping relationship, filter the necessary fields in the response data.

[0052] Specifically, first load the field mapping relationship table, traverse the API response data, and match whether the fields in it are in the mapping relationship. If the field exists in the mapping relationship, mark it as a necessary field, otherwise skip the parsing to reduce the processing of irrelevant fields. At the same time, expand the nested JSON structure and only retain the fields involved in the mapping relationship to ensure the minimization of the extracted data fields and improve the subsequent conversion efficiency.

[0053] S32: Combine the rule hierarchical system to determine the corresponding parsing fields for different complexity conversion rules.

[0054] Specifically, when parsing the fields, judge the processing method of the fields according to the rule hierarchical system. The fields in the basic conversion layer are directly parsed and stored in the structured data object. The fields in the advanced conversion layer need to further parse the hierarchical information, such as the nested relationship of the JSON structure. The fields in the extended conversion layer need to additionally adapt the API change information, such as field name changes or structural adjustments. Finally, determine the parsing method through rule matching and perform corresponding parsing processing on the fields.

[0055] S33: Generate a parsing request based on the necessary fields and parsing fields, and generate a structured data object according to the parsing request.

[0056] Specifically, the parsing request is dynamically generated according to the API structure and field mapping relationship, specifying the field path to be parsed, and parsing the data layer by layer according to the JSON parsing rules. After the parsing is completed, a structured data object is generated to ensure that the field hierarchy is consistent with the mapping relationship and the data format meets the requirements of the JSON Schema to support subsequent conversion.

[0057] In one embodiment, as Figure 6 shown, in step S40, the structured data object is subjected to data conversion according to the rule hierarchical system, and the converted data structure is verified by JSON Schema rules to generate a converted data structure, specifically including: S41: Perform corresponding data conversion according to the rule hierarchical system based on the conversion complexity of the structured data object.

[0058] Specifically, the conversion process is executed according to the rule hierarchical system. The fields in the basic conversion layer are directly mapped to the target data structure. The fields in the advanced conversion layer are converted after hierarchical adjustment or structural transformation. The fields in the extended conversion layer are adaptively converted according to the API version compatibility rules, such as filling in newly added fields or adapting to deleted fields, to ensure that the format after data conversion is compatible with the target API.

[0059] S42: Combine JSON Schema rules to perform data integrity verification, and optimize the format of the converted data structure according to the target API specification to generate a converted data structure.

[0060] Specifically, after the conversion is completed, JSON Schema verification is performed on the generated data structure, including field integrity check, data type consistency check, and hierarchical structure consistency check, to ensure that the data conforms to the target API specification. For example, when the field value is empty but it is a required field, a default value is filled. When the data type is incorrect, type conversion is performed. Finally, the data format is optimized so that the converted data structure meets the API interaction requirements and is stored in the data publishing queue.

[0061] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0062] In one embodiment, an application system interface automatic recognition and conversion device is provided. The application system interface automatic recognition and conversion device corresponds one-to-one with the application system interface automatic recognition and conversion method in the above embodiment. As Figure 7 shown, the application system interface automatic recognition and conversion device includes a data extraction module, a rule generation module, a data parsing module, and a data conversion and publishing module. The detailed description of each functional module is as follows: The data extraction module is used to obtain the request data and response data of the API interface, extract the API data structure information based on the request data and response data, and then deduce the JSON Schema and generate a field mapping relationship; A rule generation module, which is used to generate data conversion rules according to the field mapping relationship by using a visual Jolt rule editor and establish a rule hierarchical system; A data parsing module, which is used to parse the response data of the API interface, and then extract and standardize the data structure to generate a structured data object; A data conversion and publishing module, which is used to perform data conversion on the structured data object according to the rule hierarchical system, and verify the converted data structure through JSON Schema rules to generate a converted data structure, and then publish the converted data structure.

[0063] Optionally, the data extraction module specifically includes: A hierarchical analysis sub-module, which is used to analyze the hierarchical relationship between the request data and the response data by using a structured parsing method and identify the nested hierarchy of the data structure based on the JSON format parsing rules; A pattern matching sub-module, which is used to combine the pattern matching algorithm to detect the field name, data type and hierarchical structure of the response data, construct an API data structure information table, and then generate a field mapping relationship.

[0064] Optionally, the rule generation module specifically includes: An interactive mapping sub-module, which is used to perform interactive mapping on the API data structure information according to the Jolt rule editor; A rule matching sub-module, which is used to determine the conversion rule of the corresponding field through a matching algorithm according to the field mapping relationship and based on a preset conversion rule library; A rule hierarchical sub-module, which is used to establish a rule hierarchical system according to the complexity of the conversion rule.

[0065] Optionally, the rule hierarchical sub-module specifically includes: A hierarchical division unit, which is used to perform hierarchical division according to the complexity of the conversion rule and a preset complexity threshold, where the levels include a basic conversion layer, an advanced conversion layer and an extended conversion layer; A basic parsing unit, which is used to directly search for stable basic fields in the basic conversion layer by using an index-driven parsing strategy; An advanced parsing unit, which is used to perform hierarchical parsing on nested data in the advanced conversion layer by combining JSON structure analysis and adapt to complex JSON structures; An extended parsing unit, which is used to preprocess data with calculation and / or conversion requirements in the extended conversion layer based on the dynamic API structure and combined with custom parsing logic.

[0066] Optionally, the data parsing module specifically includes: A field screening sub-module, which is used to screen necessary fields in the response data based on the field mapping relationship; A rule adaptation sub-module, which is used to combine with the rule hierarchical system to determine corresponding parsing fields for conversion rules of different complexities. A data construction sub-module, which is used to generate a parsing request based on necessary fields and parsing fields, and generate a structured data object according to the parsing request.

[0067] Optionally, the data conversion and publishing module specifically includes: A conversion execution sub-module, which is used to perform corresponding data conversion according to the conversion complexity of the structured data object based on the rule hierarchical system. An integrity verification sub-module, which is used to perform data integrity verification in combination with JSON Schema rules, optimize the format of the converted data structure according to the target API specification, and generate a converted data structure.

[0068] For the specific limitations of the application system interface automatic recognition and conversion device, reference can be made to the limitations of the application system interface automatic recognition and conversion method in the above text, which will not be elaborated here. Each module in the above application system interface automatic recognition and conversion device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned modules.

[0069] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 8 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an application system interface automatic recognition and conversion method.

[0070] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: Obtain the request data and response data of the API interface, extract the API data structure information based on the request data and response data, and then deduce the JSON Schema and generate a field mapping relationship. Generate data conversion rules using a visual Jolt rule editor according to the field mapping relationship and establish a rule hierarchical system; Parse the response data of the API interface, then extract and standardize the data structure to generate a structured data object; Perform data conversion on the structured data object according to the rule hierarchical system, and verify the converted data structure through JSON Schema rules to generate a converted data structure, and then publish the converted data structure.

[0071] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: Obtain the request data and response data of the API interface, extract the API data structure information based on the request data and response data, then deduce the JSON Schema and generate the field mapping relationship; Generate data conversion rules using a visual Jolt rule editor according to the field mapping relationship and establish a rule hierarchical system; Parse the response data of the API interface, then extract and standardize the data structure to generate a structured data object; Perform data conversion on the structured data object according to the rule hierarchical system, and verify the converted data structure through JSON Schema rules to generate a converted data structure, and then publish the converted data structure.

[0072] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0073] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0074] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An automatic identification and conversion method for application system interfaces, characterized in that The method includes: Obtain the request data and response data of the API interface, extract the API data structure information based on the request data and the response data, and then deduce the JSON Schema and generate a field mapping relationship; According to the field mapping relationship, use a visual Jolt rule editor to generate data conversion rules and establish a rule hierarchy system; Parse the response data of the API interface, and then extract and standardize the data structure to generate a structured data object; Perform data conversion on the structured data object according to the rule hierarchy system, and verify the converted data structure through the JSON Schema rule to generate a converted data structure, and then publish the converted data structure.

2. The automatic recognition and conversion method of an application system interface according to claim 1, wherein The extracting the API data structure information based on the request data and the response data, and then deducing the JSON Schema and generating a field mapping relationship specifically includes: Adopt a structured parsing method to analyze the hierarchical relationship between the request data and the response data, and identify the nested levels of the data structure based on the JSON format parsing rules; Combine the pattern matching algorithm, detect the field names, data types and hierarchical structures of the response data, construct an API data structure information table, and then generate the field mapping relationship.

3. A method for automatically identifying and converting an application system interface according to claim 1, characterized in that, The using a visual Jolt rule editor to generate data conversion rules and establish a rule hierarchy system according to the field mapping relationship specifically includes: Perform an interactive mapping on the API data structure information according to the Jolt rule editor; According to the field mapping relationship and based on a preset conversion rule library, determine the conversion rules for the corresponding fields through a matching algorithm; Establish the rule hierarchy system according to the complexity of the conversion rules.

4. A method for automatically identifying and converting an application system interface according to claim 3, characterized in that The establishing the rule hierarchy system according to the complexity of the conversion rules specifically includes: According to the complexity of the conversion rules, perform hierarchical division according to a preset complexity threshold, where the levels include a basic conversion layer, an advanced conversion layer, and an extended conversion layer; For the basic conversion layer, adopt an index-driven parsing strategy to directly search for stable basic fields; For the advanced conversion layer, combine JSON structure analysis to perform hierarchical parsing on nested data and adapt to complex JSON structures; For the extended conversion layer, based on the dynamic API structure, combine custom parsing logic to preprocess data with calculation and / or conversion requirements.

5. A method for automatically identifying and converting application system interfaces according to claim 1, characterized in that The parsing the response data of the API interface, and then extracting and standardizing the data structure to generate a structured data object specifically includes: Based on the field mapping relationship, filter out the necessary fields in the response data; Combine the rule hierarchy system to determine the corresponding parsing fields for conversion rules of different complexities; Generate a parsing request according to the necessary fields and the parsing fields, and generate the structured data object according to the parsing request.

6. The automatic recognition and conversion method for an application system interface according to claim 1, wherein Perform data conversion on the structured data object according to the rule hierarchical system, and verify the data structure after conversion through JSON Schema rules to generate a converted data structure, specifically including: Perform corresponding data conversion according to the rule hierarchical system based on the conversion complexity of the structured data object; Combine the JSON Schema rules, perform data integrity verification, and optimize the format of the converted data structure according to the target API specification to generate the converted data structure.

7. An application system interface automatic recognition and conversion device, characterized in that, The device includes: A data extraction module, configured to obtain request data and response data of an API interface, extract API data structure information based on the request data and the response data, and then deduce a JSON Schema and generate a field mapping relationship; A rule generation module, configured to generate data conversion rules using a visual Jolt rule editor according to the field mapping relationship and establish a rule hierarchical system; A data parsing module, configured to parse the response data of the API interface, and then extract and standardize the data structure to generate a structured data object; A data conversion and publishing module, configured to perform data conversion on the structured data object according to the rule hierarchical system, verify the data structure after conversion through JSON Schema rules to generate a converted data structure, and then publish the converted data structure.

8. The application system interface automatic recognition and conversion device according to claim 7, wherein The data extraction module specifically includes: A hierarchical analysis sub-module, configured to analyze the hierarchical relationship between the request data and the response data using a structured parsing method, and identify the nested hierarchy of the data structure based on JSON format parsing rules; A pattern matching sub-module, configured to combine a pattern matching algorithm, detect the field names, data types, and hierarchical structures of the response data, construct an API data structure information table, and then generate the field mapping relationship.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the application system interface automatic recognition and conversion method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the application system interface automatic recognition and conversion method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • JSON (JavaScript Object Notation) data conversion method and device, computer equipment and storage medium

    CN112882974A

  • Data conversion method and device

    CN113742407A

  • Interface data format conversion method and device

    CN113918635A

  • JSON data dynamic conversion method and device, storage medium and electronic device

    CN114138881A

  • API request data conversion method and device, electronic equipment and storage medium

    CN117615010A

Cited By

  • Development general data conversion middleware adaptable to various CAD tools and conversion method

    CN121029185A