A method for visualizing entity conversion in API interface

Through the API interface visualization of entity conversion method, the problems of poor code reusability and cumbersome maintenance in interface development are solved, and more efficient development process and more optimized code quality are achieved.

CN113485690BActive Publication Date: 2025-03-11GUANGZHOU CANDAO INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110855968.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-28
Publication Date
2025-03-11
Estimated Expiration
2041-07-28

AI Technical Summary

Technical Problem

In the prior art, the interface development model leads to cumbersome interface definition and maintenance, bloated code, poor reusability, resulting in low development efficiency and error-prone problems.

Method used

The API interface visual entity conversion method is adopted, and the binding, conversion and verification of interface objects is realized through the tree structure model, template designer module, template mapping group module, object verification group module and tool SDK group module, and the binding, conversion of interface objects is realized, supporting diversified type checksum data conversion.

Benefits of technology

The processing flow of interface object binding and conversion is optimized, redundant code is reduced, development efficiency is improved, code readability and reusability is enhanced, and interface maintenance and real-time processing is simplified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113485690B_ABST
    Figure CN113485690B_ABST
Patent Text Reader

Abstract

The invention discloses a method for converting an API interface into a visualized entity, comprising the following steps: step 1: establishing a tree structure model; step 2: importing and establishing a design template online in a visualized interface through a template designer module; step 3: arranging object attributes by dragging and dropping through a template mapping group module, binding and associating double-end attributes through node connections, and finally exporting a binding template file; step 4: performing attribute verification processing according to a binding template rule through an object verification group module, supporting verification of diversified types; supporting importing and establishing a design template online in a visualized interface, arranging object attributes by dragging and dropping, binding and associating double-end attributes through node connections, and finally exporting a binding template file, interpreting the binding template file based on SDK-JAR, realizing complete data conversion work, optimizing the entire object binding and object conversion process, reducing redundant codes, and improving overall development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of API interfaces, and in particular relates to a method for converting API interface visualization entities. Background Art

[0002] API is a set of predefined interfaces (such as functions, HTTP interfaces), or refers to the agreement of connecting different components of the software system; it is used to provide a set of routines that applications and developers can access based on a certain software or hardware, without accessing the source code or understanding the details of the internal working mechanism; the operating system provides programmers with an "interface between the program and the operating system", referred to as the program interface, also known as the application program interface; this interface is used by programmers when programming, and the system and application can access the resources in the system and obtain the services of the OS during execution through this interface. It is also the only way for the program to obtain the services of the operating system; the program interface of most operating systems consists of a set of system calls (systemcall), each of which is a subroutine that can perform a specific function; the application program interface, also known as the application programming interface, is a set of definitions, programs and protocols, which realizes mutual communication between computer software through the API interface; one of the main functions of API is to provide a common function set; API is also a middleware that provides data sharing for various platforms; Internet-based applications are becoming more and more popular, and in this process, more sites are opening their own resources to developers to call. The API calls provided to the outside world make the content between sites more relevant, and at the same time, these open platforms also bring greater value to users, developers and small and medium-sized websites. In order to provide a unified API interface to the outside world, it is necessary to provide an open and unified API interface environment for sites that open resources to developers to call APIs, to help users access the functions and resources of the site.

[0003] In the current interface development model, especially for interface developers and designers, a lot of working time is spent on interface definition and maintenance. Different interfaces need to develop corresponding entity objects, parameter verification logic, object binding logic, object conversion logic, etc., and the processing logic between different interfaces is difficult to reuse and unify, resulting in bloated, large, and poorly readable code. It is also extremely cumbersome in daily maintenance, making it difficult to improve daily development efficiency, frequent changes in interface definitions, and easy to cause failure problems.

[0004] In summary, the existing technical solutions have the following disadvantages:

[0005] 1. Interface verification logic and binding logic are difficult to reuse and have high repetitiveness;

[0006] 2. The interface logic standard cannot be unified;

[0007] 3. Daily maintenance of the interface is complex and cumbersome;

[0008] 4. Low development efficiency and prone to errors;

[0009] Therefore, a method for API interface visualization entity conversion is proposed. Summary of the invention

[0010] The technical problem to be solved by the present invention is to overcome the existing defects and provide an API interface visualization entity conversion method to solve the problems proposed in the above background technology that different interfaces need to develop corresponding entity objects, parameter verification logic, object binding logic, object conversion logic, etc., and the processing logic between different interfaces is difficult to reuse and unify, resulting in bloated, large, and poorly readable code, and it is also extremely cumbersome in daily maintenance, resulting in difficulty in improving daily development efficiency, frequent changes in interface definitions, and easy failures.

[0011] To achieve the above object, the present invention provides the following technical solution: a method for converting an API interface visualization entity, comprising the following steps:

[0012] Step 1: Establish the tree structure model;

[0013] Step 2: Import and create design templates online in the visual interface through the template designer module;

[0014] Step 3: Use the template mapping group module to drag and drop to arrange the object properties, connect the nodes to bind the double-end properties, and finally export the binding template file;

[0015] Step 4: Perform attribute verification according to the binding template rules through the object verification group module, and support diversified type verification;

[0016] Step 5: Use the tool SDK group module to interpret the binding template file to complete the data conversion work.

[0017] Preferably, the template designer module in step 2 includes an object designer, a JSON validator and a JSON converter, and step 2 includes the following steps:

[0018] Step 2.1: Use the object designer to establish and associate a two-end object relationship to implement the object binding function;

[0019] Step 2.2: Use the JSON validator to check the correctness of the imported template;

[0020] Step 2.3: Render the node data and node information through the JSON converter.

[0021] Preferably, step 3 comprises the following steps:

[0022] Step 3.1: Template engine rendering, coordinating with JSON converter to render, merge, and fill template files, assisting developers to conveniently drag attribute nodes, edit node types, process node relationships, etc.

[0023] Step 3.2: Template mapping, binding conversion of object properties and type conversion on both ends.

[0024] Preferably, step 4 comprises the following steps:

[0025] Step 4.1: Value verification, verify the value of the bound attribute node;

[0026] Step 4.2: Time type verification, which verifies the time format of the bound attribute node;

[0027] Step 4.3: Interval check: perform time interval check, value interval check, etc. according to the enumeration type;

[0028] Step 4.4: Character replacement, pass in specific characters for the specified attribute to perform forced replacement operation;

[0029] Step 4.5: Precision verification. For special fields that require precision retention, perform operations such as precision retention, precision truncation, and precision verification.

[0030] Preferably, the tool SDK group module in step 5 includes a toolkit-JAR, a designer-JAR and a verifier-JAR, and step 5 includes the following steps:

[0031] Step 5.1: Provide the toolkit-JAR to the business side and perform object conversion and merging processing based on the object conversion template;

[0032] Step 5.2: Provide visual object dragging and binding functions through designer-JAR;

[0033] Step 5.3: Use the Verifier-JAR to provide object conversion and merging, and perform attribute verification, type verification, value verification and other functions.

[0034] Preferably, the step 3.2 includes operations such as time type formatting, retaining valid digits for numeric types, and attribute structure conversion and change.

[0035] Preferably, the tool SDK group module is an abstract verification interface, which uses the decorator pattern to expand the verification method and verification type, and queues multiple verification modes to form a serial responsibility chain.

[0036] Preferably, the template mapping in step 3.2 includes object mapping and object conversion.

[0037] Preferably, the numerical verification in step 4.1 includes integer verification and floating point verification.

[0038] Preferably, in step 1, swing service is implemented based on WebSwing, visual client rendering is provided, and a designer model is established.

[0039] Compared with the prior art, the present invention provides an API interface visualization entity conversion method, which has the following beneficial effects:

[0040] 1. The present invention supports importing and online creation of design templates in a visual interface, uses dragging to arrange object properties, binds and associates double-end properties through node connections, and finally exports binding template files. Based on SDK-JAR, the binding template files are interpreted to achieve complete data conversion work, optimize the entire object binding and object conversion process, reduce redundant code, and improve overall development efficiency;

[0041] 2. The present invention sets a template mapping group module, first performs template engine rendering, and cooperates with the JSON converter to render, merge, and fill template files, assisting developers to conveniently drag attribute nodes, edit node types, process node relationships, and then perform template mapping. Template mapping includes object mapping and object conversion, binding conversion of object attributes and type conversion at both ends, and includes operations such as time type formatting, retaining valid digits for numeric types, and attribute structure conversion changes, so that interface API object conversion can be managed in a unified manner, improve code reusability, and enhance code readability;

[0042] 3. The present invention is based on a visual API object binding platform to help developers reduce interface verification, conversion, and binding logic. Through object binding templates and SDK docking, developers can quickly convert interface objects into desired entity objects, allowing developers to focus on interface business development and improve development efficiency.

[0043] 4. The present invention sets a template designer module, a template mapping group module, an object verification group module and a tool SDK group module, imports and establishes a design template online in a visual interface through the template designer module, arranges object properties by dragging and dropping through the template mapping group module, performs binding association of double-end properties through node connections, and finally exports a binding template file, performs property verification processing according to binding template rules through the object verification group module, supports diversified type verification, interprets the binding template file through the tool SDK group module, realizes complete data conversion work, can support visual object conversion and object verification, and facilitates interface API object maintenance and real-time processing;

[0044] 5. The present invention can verify the numerical value of the bound attribute node and the time format of the bound attribute node by setting the object verification group module. According to the enumeration type, it can perform time interval verification, numerical interval verification, etc., and perform forced replacement operations on specific characters passed in for the specified attribute. For special fields that require precision retention, it performs operations such as precision retention, precision truncation, and precision verification. It supports diversified type verification, is conducive to abstract verification interface, adopts decorator mode to expand verification methods and verification types, and queues multiple verification modes to form a string-type responsibility chain, which is convenient for rapid processing of verification logic. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0046] Figure 1 A flowchart of an API interface visualization entity conversion method proposed by the present invention;

[0047] Figure 2 A schematic diagram of program connections of a template designer module, a template mapping group module, an object verification group module and a tool SDK group module in an API interface visualization entity conversion method proposed by the present invention;

[0048] Figure 3 This is a functional schematic diagram of a template mapping group module and an object verification group module in an API interface visualization entity conversion method proposed by the present invention;

[0049] Figure 4 A flowchart of a template designer module in an API interface visualization entity conversion method proposed by the present invention;

[0050] Figure 5 A flowchart of a tool SDK group module in an API interface visualization entity conversion method proposed by the present invention;

[0051] In the figure: template designer module 1, template mapping group module 2, object validation group module 3, tool SDK group module 4, object designer 5, JSON validator 6, JSON converter 7, toolkit-JAR 8, designer-JAR 9, validator-JAR 10. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] Example 1

[0054] See also Figure 1-5 The present invention provides a technical solution: a method for converting an API interface visualization entity, comprising the following steps:

[0055] Step 1: Establish the tree structure model;

[0056] Step 2: Import and create a design template online in the visual interface through the template designer module 1;

[0057] Step 3: Use the template mapping group module 2 to drag and drop to arrange the object attributes, bind and associate the double-end attributes through node connections, and finally export the binding template file;

[0058] Step 4: Use the tool SDK group module 4 to interpret the binding template file and complete the data conversion work.

[0059] In the present invention, preferably, the template designer module 1 in step 2 includes an object designer 5, a JSON validator 6 and a JSON converter 7, and step 2 includes the following steps:

[0060] Step 2.1: Establish and associate a two-end object relationship through the object designer 5 to implement the object binding function;

[0061] Step 2.2: Check the correctness of the imported template using JSON validator 6;

[0062] Step 2.3: Render the node data and node information through JSON converter 7.

[0063] In the present invention, preferably, step 3 comprises the following steps:

[0064] Step 3.1: Template engine rendering, cooperating with JSON converter 7 to render, merge, and fill template files, assisting developers to conveniently drag attribute nodes, edit node types, process node relationships, etc.

[0065] Step 3.2: Template mapping, binding conversion of object properties and type conversion on both ends.

[0066] In the present invention, preferably, the tool SDK group module 4 in step 4 includes a toolkit-JAR8, a designer-JAR9 and a verifier-JAR10, and step 4 includes the following steps:

[0067] Step 4.1: Provide the toolkit-JAR8 to the business side and perform object conversion and merging processing based on the object conversion template;

[0068] Step 4.2: Provide visual object dragging and binding functions through designer-JAR9;

[0069] Step 4.3: Use the verifier-JAR10 to provide attribute verification, type verification, value verification and other functions when converting and merging objects.

[0070] In the present invention, preferably, step 3.2 includes operations such as time type formatting, retaining valid digits for numeric types, and attribute structure conversion and change.

[0071] In the present invention, preferably, the template mapping in step 3.2 includes object mapping and object conversion.

[0072] In the present invention, preferably, in step 1, swing service is implemented based on WebSwing, visual client rendering is provided, and a designer model is established.

[0073] The working principle and use process of the present invention are as follows: when in use, swing service is realized based on WebSwing, visual client rendering is provided, a designer model is established, a design template is imported and established online in a visual interface, a double-end object relationship is established and associated through an object designer 5, an object binding function is realized, and then the correctness of the imported template is detected through a JSON validator 6, and finally, node data and node information are rendered through a JSON converter 7, and then object attributes are arranged by dragging and dropping through a template mapping group module 2, and double-end attribute binding association is performed through node connections, and finally a binding template file is exported, and the template mapping group module 2 first performs template engine rendering, and cooperates with a JSON converter 7 to render, merge, and fill in template files, and assists developers in conveniently dragging attribute nodes, editing node types, processing node relationships, and other operations, Then perform template mapping, which includes object mapping and object conversion, binding conversion of object attributes and type conversion on both ends, and includes operations such as time type formatting, retaining valid digits for numeric types, and attribute structure conversion changes. Finally, interpret the binding template file through tool SDK group module 4. Tool SDK group module 4 is first provided to the business party through toolkit-JAR8, and object conversion merging is performed for the object conversion template. Then, the designer-JAR9 provides visual object dragging and binding functions. Finally, the verifier-JAR10 provides object conversion merging, and performs attribute verification, type verification, and value verification functions, thereby optimizing the entire object binding and object conversion process, realizing complete data conversion work, optimizing the entire object binding and object conversion process, reducing redundant code, and improving overall development efficiency.

[0074] Example 2

[0075] See also Figure 1-5 The present invention provides a technical solution: a method for converting an API interface visualization entity, comprising the following steps:

[0076] Step 1: Establish the tree structure model;

[0077] Step 2: Import and create a design template online in the visual interface through the template designer module 1;

[0078] Step 3: Use the template mapping group module 2 to drag and drop to arrange the object attributes, bind and associate the double-end attributes through node connections, and finally export the binding template file;

[0079] Step 4: Perform attribute verification processing according to the binding template rules through the object verification group module 3, supporting diversified type verification;

[0080] Step 5: Use the tool SDK group module 4 to interpret the binding template file and complete the data conversion work.

[0081] In the present invention, preferably, the template designer module 1 in step 2 includes an object designer 5, a JSON validator 6 and a JSON converter 7, and step 2 includes the following steps:

[0082] Step 2.1: Establish and associate a two-end object relationship through the object designer 5 to implement the object binding function;

[0083] Step 2.2: Check the correctness of the imported template using JSON validator 6;

[0084] Step 2.3: Render the node data and node information through JSON converter 7.

[0085] In the present invention, preferably, step 3 comprises the following steps:

[0086] Step 3.1: Template engine rendering, cooperating with JSON converter 7 to render, merge, and fill template files, assisting developers to conveniently drag attribute nodes, edit node types, process node relationships, etc.

[0087] Step 3.2: Template mapping, binding conversion of object properties and type conversion on both ends.

[0088] In the present invention, preferably, step 4 comprises the following steps:

[0089] Step 4.1: Value verification, verify the value of the bound attribute node;

[0090] Step 4.2: Time type verification, which verifies the time format of the bound attribute node;

[0091] Step 4.3: Interval check: perform time interval check, value interval check, etc. according to the enumeration type;

[0092] Step 4.4: Character replacement, pass in specific characters for the specified attribute to perform forced replacement operation;

[0093] Step 4.5: Precision verification. For special fields that require precision retention, perform operations such as precision retention, precision truncation, and precision verification.

[0094] In the present invention, preferably, the tool SDK group module 4 in step 5 includes a toolkit-JAR8, a designer-JAR9 and a verifier-JAR10, and step 5 includes the following steps:

[0095] Step 5.1: Provide the toolkit-JAR8 to the business side and perform object conversion and merging processing based on the object conversion template;

[0096] Step 5.2: Provide visual object dragging and binding functions through designer-JAR9;

[0097] Step 5.3: Use the verifier-JAR10 to provide attribute verification, type verification, value verification and other functions when converting and merging objects.

[0098] In the present invention, preferably, step 3.2 includes operations such as time type formatting, retaining valid digits for numeric types, and attribute structure conversion and change.

[0099] In the present invention, preferably, the tool SDK group module 4 is an abstract verification interface, which uses the decorator pattern to expand the verification method and verification type, and queues multiple verification modes to form a serial responsibility chain.

[0100] In the present invention, preferably, the template mapping in step 3.2 includes object mapping and object conversion.

[0101] In the present invention, preferably, the numerical verification in step 4.1 includes integer verification and floating point verification.

[0102] In the present invention, preferably, in step 1, swing service is implemented based on WebSwing, visual client rendering is provided, and a designer model is established.

[0103] The working principle and use process of the present invention are as follows: when in use, swing service is realized based on WebSwing, visual client rendering is provided, a designer model is established, a design template is imported and established online in a visual interface, a double-end object relationship is established and associated through an object designer 5, an object binding function is realized, and then the correctness of the imported template is detected through a JSON validator 6, and finally, node data and node information are rendered through a JSON converter 7, and then object attributes are arranged by dragging and dropping through a template mapping group module 2, and double-end attributes are bound and associated through node connections, and finally a binding template file is exported. The template mapping group module 2 first performs template Engine rendering, collaborative JSON converter 7 rendering, merging, filling template files, assisting developers to conveniently drag attribute nodes, edit node types, process node relationships, and then perform template mapping. Template mapping includes object mapping and object conversion, binding conversion of object attributes and type conversion on both ends, and includes time type formatting, value type retention of valid digits, attribute structure conversion changes, and other operations. After that, the object verification group module 3 performs attribute verification processing according to the binding template rules, supports diversified type verification, and the object verification group module 3 can verify the value of the bound attribute node and the time format of the bound attribute node. Verify, according to the enumeration type, perform time interval verification, value interval verification, etc., and pass in specific characters for the specified attribute to perform forced replacement operations. For special fields that need to retain precision, perform precision retention, precision truncation, precision verification and other operations. Support diversified type verification, which is conducive to abstract verification interface, and use decorator mode to expand verification methods and verification types. Multiple verification modes are queued to form a string responsibility chain, which is convenient for rapid processing of verification logic. Finally, the binding template file is interpreted through the tool SDK group module 4 to achieve complete data conversion. The tool SDK group module 4 is first provided to the business party through the tool kit-JAR8, and the object The conversion template performs object conversion and merging processing, and then the designer-JAR9 provides visual object dragging and binding functions. Finally, the verifier-JAR10 provides object conversion and merging, and performs attribute verification, type verification, value verification and other functions to optimize the entire object binding and object conversion processing flow, reduce redundant code, and improve overall development efficiency. It maximizes the development efficiency of developers, focuses on the business development level, supports visual object conversion and object verification, and facilitates interface API object maintenance and real-time processing. Interface API object conversion can be managed in a unified manner, improve code reusability, and enhance code readability.

[0104] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for converting API interface visualization entities, characterized by: The following steps are involved: Step 1: Establish the tree structure model; Step 2: Import and create a design template online in the visual interface through the template designer module (1); Step 3: Use the template mapping group module (2) to drag and drop to arrange the object attributes, connect the nodes to bind the double-end attributes, and finally export the binding template file; Step 4: Perform attribute verification processing according to the binding template rules through the object verification group module (3), supporting diversified type verification; Step 5: Use the tool SDK group module (4) to interpret the binding template file and complete the data conversion work; The template designer module (1) in step 2 includes an object designer (5), a JSON validator (6) and a JSON converter (7), and step 2 includes the following steps: Step 2.1: Establish and associate a two-end object relationship through the object designer (5) to implement the object binding function; Step 2.2: Use the JSON validator (6) to check the correctness of the imported template. Step 2.3: Render node data and node information through JSON converter (7); The step 3 comprises the following steps: Step 3.1: Template engine rendering, cooperating with JSON converter (7) to render, merge, and fill template files, assisting developers to conveniently drag and drop attribute nodes, edit node types, and process node relationship operations; Step 3.2: Template mapping, binding conversion of object attributes and type conversion on both ends; The tool SDK group module (4) in step 5 includes a toolkit-JAR (8), a designer-JAR (9) and a verifier-JAR (10), and step 5 includes the following steps: Step 5.1: Provide the toolkit-JAR (8) to the business party, and perform object conversion and merging processing on the object conversion template; Step 5.2: Provide visual object dragging and binding functions through designer-JAR (9); Step 5.3: When object conversion and merging are provided by the verifier-JAR (10), attribute verification, type verification, and value verification functions are performed; First, the template engine renders, and then collaborates with the JSON converter to render, merge, and fill in the template file, assisting developers to conveniently drag and drop attribute nodes, edit node types, and process node relationship operations. Then, template mapping is performed. Template mapping includes object mapping and object conversion, binding conversion of object attributes and type conversion on both ends, and includes time type formatting, numeric type retention of valid digits, and attribute structure conversion and change operations, so that interface API object conversion can be uniformly managed, improve code reusability, and enhance code readability.

2. The method for converting an API interface visualization entity according to claim 1, characterized in that: The step 4 comprises the following steps: Step 4.1: Value verification, verify the value of the bound attribute node; Step 4.2: Time type verification, which verifies the time format of the bound attribute node; Step 4.3: Interval check: perform time interval check and value interval check according to the enumeration type; Step 4.4: Character replacement, pass in specific characters for the specified attribute to perform forced replacement operation; Step 4.5: Precision verification: For special fields that require precision retention, perform precision retention, precision truncation, and precision verification operations.

3. The method for converting an API interface visualization entity according to claim 1, characterized in that: The step 3.2 includes the operations of formatting the time type, retaining the valid digits of the numeric type, and converting and changing the attribute structure.

4. The method for converting an API interface visualization entity according to claim 1, characterized in that: The tool SDK group module (4) is an abstract verification interface, which uses the decorator pattern to expand the verification method and verification type, and queues multiple verification modes to form a serial responsibility chain.

5. The method for converting an API interface visualization entity according to claim 1, characterized in that: The template mapping in step 3.2 includes object mapping and object conversion.

6. The method for converting an API interface visualization entity according to claim 2, characterized in that: The numerical verification in step 4.1 includes integer verification and floating point verification.

7. The method for converting an API interface visualization entity according to claim 1, characterized in that: In the step 1, swing service is implemented based on WebSwing, visual client rendering is provided, and a designer model is established.

Citation Information

Patent Citations

  • RESTful API visualization method

    CN105278946A

  • Interface rendering method and device for business system and server

    CN110007916A