Software development kit generation method, system and equipment and readable storage medium
By acquiring and encapsulating business and technical metadata, a software development kit (SDK) is built, which solves the problem of insufficient SDK compatibility and achieves efficient coupling with the target application interface and improves development efficiency.
Patent Information
- Application Number
- CN202511097329.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-11-07
AI Technical Summary
In existing technologies, the coupling between general SDKs and APIs for specific business scenarios is insufficient, resulting in low development efficiency and requiring secondary development and adaptation by professional technicians.
By acquiring the service metadata of the target application interface, combined with business description information and technical metadata, the interface description object structure and parameter object structure of the software development kit are determined, encapsulated, and an SDK is built. Business metadata is added to improve coupling.
The generated SDK is tightly coupled with the target application interface, reducing the need for secondary development and improving development efficiency and SDK adaptability.
Smart Images

Figure CN120909680A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software development, in particular to a software development kit generation method, system, device and readable storage medium. BACKGROUND
[0002] With the development of computer technology and artificial intelligence technology, open platforms have emerged to open various application program interfaces (APIs) for user calls. API is a set of rules and protocols that define the interaction between different software components or systems. It allows different applications or systems to share functions and data without understanding their internal working principles. Business parties can call APIs provided by open platforms to achieve specific functions or obtain specific services.
[0003] In related technologies, APIs are called through software development kits (SDKs). SDK refers to a collection of development tools for software packages, software frameworks, hardware platforms, operating systems, and other development tools for building applications. It provides a complete environment for developers to build, test and deploy applications.
[0004] However, in related technologies, a general SDK is often generated only according to the interface path and basic parameters of the API interface, but the general SDK has insufficient coupling with the API of the interface in specific business scenarios and poor generalization ability, requiring professional technical personnel to develop SDKs for different business scenarios, resulting in low overall development efficiency. SUMMARY
[0005] Therefore, it is necessary to provide a software development kit generation method, system, computer device, computer readable storage medium and computer program product that can solve the problem of insufficient SDK adaptation and improve development efficiency.
[0006] In a first aspect, the present application provides a software development kit generation method, which comprises:
[0007] Obtaining service metadata of a target application program interface, wherein the service metadata is determined according to technical metadata and business description information related business metadata;
[0008] According to the business metadata and the technical metadata, determining the interface description object structure and the parameter object structure of the software development kit interface definition; the software development kit is used to call the target application program interface;
[0009] Based on the interface description object structure and the parameter object structure, the service metadata is encapsulated to obtain interface description object information and parameter object information.
[0010] The software development kit is constructed through the interface description object information and the parameter object information.
[0011] In one of the embodiments, the service metadata at least includes one of field order, generic attribute and check rule of the field; and / or,
[0012] The interface description object structure at least includes at least one of application program interface name, application program interface description, application program interface version, parameter list, method, protocol type and request header; and / or,
[0013] The parameter object structure at least includes at least one of parameter name, parameter type, parameter order, interface identifier of the associated application program interface, parameter level, parameter description, parent class identifier, parameter default value and whether the parameter is required.
[0014] In one of the embodiments, the encapsulation of the service metadata based on the interface description object structure and the parameter object structure to obtain the interface description object information and the parameter object information comprises:
[0015] The service metadata is parsed to obtain interface information and method information set of the target application program interface;
[0016] The interface information and the method information set are encapsulated in the interface description object structure to obtain the interface description object information;
[0017] Parameter attribute information of each traversal parameter in the method information set is determined from the service metadata, and the determined parameter attribute information is encapsulated in the parameter object structure to obtain the parameter object information.
[0018] In one of the embodiments, the determination of the parameter attribute information of each traversal parameter in the method information set from the service metadata and the encapsulation of the determined parameter attribute information in the parameter object structure to obtain the parameter object information comprises:
[0019] The parameter table in the method information set is sorted according to the parameter order indicated by the parameter object structure to obtain a sorted parameter list;
[0020] traverse the sorted parameter list, for each traversal parameter in the parameter list, determine parameter attribute information of each traversal parameter from the service metadata according to a processing manner corresponding to a parameter type of each traversal parameter;
[0021] encapsulate the parameter attribute information in the parameter object structure form to obtain parameter object information.
[0022] In one embodiment, the determination of the parameter attribute information of each traversal parameter from the service metadata according to the processing manner corresponding to the parameter type of each traversal parameter includes:
[0023] In the case where the parameter type is a generic type, recursively parse the traversal parameter to obtain the parameter attribute information of the traversal parameter from the service metadata; and / or,
[0024] In the case where the parameter type is a custom type, recursively process an inner class of the traversal parameter to obtain the parameter attribute information in the traversal parameter from the service metadata.
[0025] In one embodiment, the construction of the software development kit through the interface description object information and the parameter object information includes:
[0026] code construction of the interface description object information according to a class template in a preset template to obtain corresponding class code;
[0027] code construction of the parameter object information according to a parameter template in the preset template to obtain parameter code;
[0028] compilation of the basic tool class code, the class code, and the parameter code through construction of basic tool class code to generate the software development kit.
[0029] In one embodiment, the code construction of the parameter object information according to the parameter template in the preset template to obtain the parameter code includes:
[0030] traverse a parameter list corresponding to the parameter object information, determine a target parameter from the parameter list according to parent class identification information of a traversal parameter in the parameter list, and determine the target parameter as a root field;
[0031] for each target parameter corresponding to each root field, if a first child parameter exists in the target parameter, determine first child parameter object information of the first child parameter from the parameter object information;
[0032] determining corresponding first parameter information from the first sub-parameter object information, encapsulating the first parameter information into a first field of a parameter template in the preset template, and completing code construction to obtain parameter code;
[0033] The first field corresponds to the root field, the first parameter information includes a first parameter type and a first parameter name of the first sub-parameter, the first parameter type is used to determine a data format of a passing parameter for calling the target application program interface, and the first parameter name is used to determine semantic information of the passing parameter.
[0034] In one of the embodiments, the method further includes:
[0035] For a target parameter corresponding to the root field, if there are at least two custom types of the first sub-parameter of the target parameter, a first sub-parameter corresponding to each custom type is defined in the form of an inner class.
[0036] For a first sub-parameter corresponding to each inner class, the first sub-parameter is determined as a root field, the first sub-parameter is determined as the target parameter, the step of executing the first sub-parameter of the first parameter type is performed, and second parameter information corresponding to a second sub-parameter in the first sub-parameter is obtained; the second parameter information includes a second parameter type and a second parameter name of the second sub-parameter.
[0037] The first parameter information is encapsulated into the first field, and the second parameter information is encapsulated into a second field corresponding to the inner class in the parameter template, and code construction is completed to obtain parameter code.
[0038] In one of the embodiments, the method further includes:
[0039] in response to a calling request of the target application program interface;
[0040] passing an interface name and parameters indicated by the calling request to the software development kit, and calling the target application program interface.
[0041] In a second aspect, the application further provides a software development kit generation system, which includes an open platform, a metadata center, and a service platform, wherein:
[0042] The service platform is configured to report service metadata of a target application program interface obtained by a preset software development kit to the metadata center.
[0043] The open platform reads the service metadata from the metadata center and executes the steps of the method in any one of the above embodiments.
[0044] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of the preceding aspects when executing the computer program.
[0045] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method according to any one of the preceding aspects when executed by a processor.
[0046] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program implements the steps of the method according to any one of the preceding aspects when executed by a processor.
[0047] The above SDK generation method, system, computer device, computer readable storage medium and computer program product acquire service metadata of a target application program interface, wherein the service metadata is determined by business metadata related to business description information and technical metadata; then, interface description object structures and parameter object structures of SDK interface definitions are determined according to the business metadata and the technical metadata; then, the service metadata is encapsulated based on the interface description object structures and the parameter object structures to obtain interface description object information and parameter object information; finally, the SDK is constructed through the interface description object information and the parameter object information. This way increases the acquisition of business metadata compared with the traditional technology that only supports technical metadata, and the business metadata can be used as business semantic restrictions, so that the generated SDK can be coupled with the corresponding target application program interface, improves the coupling degree of the SDK and the interface, and additionally, the API calling can be realized without additional secondary development, thereby improving the overall development efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0049] Figure 1 An application environment diagram of the SDK generation method in an embodiment;
[0050] Figure 2 A flowchart of the SDK generation method in an embodiment;
[0051] Figure 3 A flowchart of encapsulating the service metadata in an embodiment;
[0052] Figure 4 Structure block diagram of a software development kit generation system in one embodiment;
[0053] Figure 5 Structure block diagram of a software development kit generation system in one embodiment; Figure 6 Internal structure diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0055] Open Platform: Open platform refers to a software platform or hardware platform that allows third-party developers to create and integrate applications. It provides a set of APIs and tools that enable developers to build platform-based applications that interact with services and data on the platform. Open platforms usually provide developers with development documents, SDKs, and development environments so that they can create applications, extend the functionality of the platform, or integrate with other applications on the platform.
[0056] API (Application Programming Interface): API is a set of rules and protocols that define the interaction between different software components or systems. It allows different applications or systems to share functions and data without needing to understand their internal workings. API can include functions, methods, classes, protocols, etc., which provide a standardized way to access and manipulate the functionality of software components, thereby facilitating the development and integration of applications.
[0057] As the degree of openness of enterprise systems increases, open platforms become the core hub for the connection of internal and external systems, and bear a large number of API interface call requirements. When business parties call open platform interfaces, one is to call without using SDK, and the other is to call using a general SDK.
[0058] In the technical process of calling without using the SDK, cross-language support, HTTP (Hypertext Transfer Protocol) connection pool management, signature verification, serialization and other basic capabilities need to be implemented by oneself, the development cycle is long and repeated development. In addition, the input and output parameter structures of different business interfaces are quite different, and the request / response model needs to be defined one by one, which is easy to introduce compatibility problems. In addition, the quality of the generated code cannot be guaranteed, manual writing is prone to errors, and the implementation methods of different developers are not unified.
[0059] In the technical process of calling the existing general SDK, there are problems such as insufficient adaptation of the general SDK, insufficient depth of metadata, and the need for manual intervention in compiling and publishing to the warehouse after the SDK is generated, which cannot realize full-link automation.
[0060] In view of the insufficient SDK adaptation in the above problems, the application provides a software development kit generation method, which collects business semantic metadata related to business logic through the middle, extends the metadata collection mechanism, reports the extended metadata, uses the extended metadata as the business semantic restriction of generating API, and generates SDK according to the preset template and the reported metadata.
[0061] The software development kit generation method provided by the embodiments of the application can be applied in an application environment as shown in Figure 1 The service provider 102, the service consumer 104 and the metadata center 106 communicate through the network.
[0062] The service provider 102 can be a service end responsible for implementing and providing specific services / functions, and the service consumer 104 is a device responsible for using the services / functions provided by the service provider 102. The metadata center 106 is used for managing and storing metadata, and can be a data storage area or system for describing a specific data storage area or system.
[0063] The service provider 102 can be a server system, a cluster or an independent server, or other electronic devices capable of providing services; the service provider 102 can be a terminal or a server. The metadata center 106 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The metadata center 106 can be independently set, or can be deployed in the service provider 102.
[0064] In the embodiments of the application, the service provider 102 can report the service metadata of the authorized API interface to the metadata center 106; and then the service consumer 104 can execute the following content:
[0065] The service metadata of the target application interface is acquired from the metadata center 106, and the interface description object structure and the parameter object structure of the software development kit interface definition are determined according to the business metadata and the technical metadata in the service metadata; the service metadata is encapsulated based on the interface description object structure and the parameter object structure, and the interface description object information and the parameter object information are obtained; and the software development kit is constructed through the interface description object information and the parameter object information.
[0066] It should be noted that the authorized API interface can refer to an application programming interface (API) that is allowed to be accessed and called by a specific user, application or system after authentication and permission review. As an embodiment, the service provider 102 and the service consumer 104 can be two different roles in a service development framework / system, and the specific architecture of the service development framework is not limited, and a person skilled in the art can set it according to actual needs, such as but not limited to RPC (Remote Procedure Call Protocol) as a service development framework. Further, the service development framework can be but not limited to any one or any combination of Dubbo, Thrift, GRPC, Hetty, etc. service development framework, and only Dubbo is taken as an example for description hereinafter. Dubbo is an open source distributed service framework, which is used to build high-performance, scalable and extensible distributed applications. Dubbo provides core functions of distributed systems such as service registration, discovery, load balancing and remote invocation. Dubbo interface refers to an interface defined in a distributed system using Apache Dubbo (or Dubbo) framework, which is used for communication and interaction between services. In Dubbo, interface refers to a contract or protocol defined between service providers and service consumers. Service providers implement specific functions of the interface, and service consumers call remote services through the interface. The interface defines information such as methods, parameters and return values of the service.
[0067] As an embodiment, the service provider 102 can be a role in Dubbo, responsible for implementing and providing specific service functions. The service provider 102 can implement the service as an interface and register it in the service registry center of Dubbo, so that other applications can discover and call the service provided by it. The service consumer 104 can be another role in Dubbo different from the service provider 102, responsible for using remote services. The service consumer 104 obtains the address of the service provider 102 from the service registry center through the Dubbo framework, and calls the service / function provided by the service provider 102 through the method defined in the interface.
[0068] In an exemplary embodiment, as shown in FIG. 1, the service development framework / system includes a service metadata center 106, a service provider 102 and a service consumer 104. The service metadata center 106 is responsible for collecting and storing metadata of services in the service development framework / system, and the service provider 102 and the service consumer 104 are responsible for providing and consuming services in the service development framework / system. Figure 2As shown, a software development kit generation method is provided, and the method is applied to Figure 1 The application environment in the method is described by taking the following steps 202 to 208. Among them:
[0069] In step 202, service metadata of a target application program interface is obtained, and the service metadata is determined according to technical metadata and business metadata related to business description information.
[0070] Among them, the target service application program can be a service side program providing an API interface. The target application program interface can be but not limited to an authorized API interface, which means an API interface allowed to be called after permission verification. These interfaces usually contain specific function definitions and service capabilities, for example, the authorized API interface can be an order query interface or a user authentication interface, etc. The service metadata can be obtained from the target service application corresponding to the target application program interface reported to the metadata center, and the reporting mode can be static reporting, dynamic reporting or periodic reporting, etc. Considering that the service metadata is increased with the business metadata, in order to support the reporting of business metadata of different business types, the original protocol of the service metadata is extended, and the business identifier is added in the original protocol. Therefore, in the case of adding new business, the protocol structure does not need to be changed, and the reporting of service metadata can be completed.
[0071] Metadata can be information describing data, which can include attributes, structure, relationship and content of data, etc. For example, metadata can be used to describe data sets, database tables, files, documents, etc. to help users understand and manage these data. Metadata can be but not limited to used in data management, search, classification, security control, etc. In this embodiment, the service metadata refers to the relevant information describing the API interface, which is determined according to the business metadata related to the business description information and the technical metadata for describing the technical attributes and processing process of data.
[0072] The business metadata is determined by semantic analysis of the business description information and / or preset rule mapping. For example, the business description information can be processed based on rule engine mapping or NLP (Natural Language Processing) semantic analysis to obtain corresponding business metadata. The business description information can be information reflecting the requirements of the business scenario, such as functional requirements, user interaction modes, etc. The business metadata at least includes one of parameter order, generic attribute and field verification rule. The parameter order refers to the arrangement of various parameters in a specific order in the API definition. For example, if the order of the parameters in the API definition is specified as userId, name, email, then when the API is called, these parameters should also be passed in according to this order. The service metadata is determined according to the business metadata related to the business description information and the technical metadata for describing the technical attributes and processing procedures of the data.
[0073] Further, the parameter order can be used to describe the steps or stages of the business process. For example, when processing an order, customer information may need to be specified first, then product details, and finally payment information. Then, based on the generated SDK, when the API is called, the order processing is also performed in the order of the corresponding customer information, product information and payment information according to the parameter order. According to the determined parameter order, the corresponding business can be coupled to improve the coupling with the business.
[0074] Generic is a programming concept used to increase code reusability, type safety, and readability. One or more type parameters are used instead of specific data types when writing classes, interfaces, and methods. Generic class (GenericClass): A generic class is a class that has one or more type parameters. These type parameters are used to define the data types in the properties, methods, or constructors of the class. For example, ArrayList <t>A generic class is a class in which T is a type parameter that can represent any data type. For example, for different types of goods, each type of goods has some common attributes such as name, price and inventory quantity, but may also have some type-specific attributes such as books may have author and ISBN, electronic products may have specifications and manufacturers, etc. A generic goods class can be defined to handle different types of goods. Generic attributes include in-parameter generic attributes and out-parameter generic attributes. Generic attributes include generic attributes of parameters such as parameter type, whether required, default value, value range, etc. The field verification rule can be a verification rule that can include but is not limited to data type verification, length verification and format verification, etc.
[0075] Technical metadata can be information describing technical attributes of data and processing processes. Technical attributes describe technical details such as structure, format, storage method and access method of data. Technical metadata includes but is not limited to data type, format, algorithm and protocol, etc. For example, technical metadata can include information such as interface protocol type (such as gRPC), data format (such as JSON, XML), etc. such as API dubbo interface path, version number version, group identifier group, method name, request parameter, return parameter, field name and field description, etc.
[0076] For example, the service metadata in the application is an example of service metadata that can include the foregoing technical metadata and business metadata.
[0077] For example, in response to a software development kit generation request, the target application program interface in the target application program is determined according to the application program identifier carried by the generation request from the service application list, and the service metadata of the target application program interface is obtained from the metadata center.
[0078] Step 204, according to the service metadata, determine the interface description object structure and the parameter object structure of the software development kit interface definition; the software development kit is used to call the target application program interface.
[0079] The metadata object in the service metadata can be further divided into different types of metadata, and the interface metadata, method metadata and type metadata can be obtained by analyzing and classifying the service metadata. Through the three-layer relationship of interface metadata, method metadata and type metadata, the interface definition is uniformly described.
[0080] Method metadata can be used to describe the relevant information of a method function. Interface metadata can describe the relevant information of the interface service where the method function is located. Type metadata can be used to explain the environment, parameters and other contents in the method metadata. For example, the type metadata can include the output parameter of the method function corresponding to the method metadata.
[0081] Further, the interface metadata, the method metadata and the type metadata can be respectively stored in the method metadata table, the interface metadata table and the interface metadata table in the metadata center. The fields of the method information table include ID-primary key, interface_id-interface ID, method_name-method name, return_type-return parameter type, return_class-return parameter class, parameter_definitions-method request parameter, gmt_create-creation time and gmt_modified-change time. The fields of the interface information table include ID-primary key, interface_id-interface ID, interface_name-interface name, service_group-service group, service_version-version, gmt_create-creation time, gmt_modified-change time and application_name-attribute application. The fields of the type information table include ID-primary key, application_name-attribute application, env_type-environment type, type_name-class name, base_type-whether basic type, neums-enumeration value, properties-property, gmt_create-creation time and gmt_modified-modification time.
[0082] For example, the interface metadata includes: ID: XXX, interface_id: interface ID, service_name: service name, service_group: service group, service_version: service version number, gmt_create: creation time, gmt_modified: change time, and application_name: home application. The method metadata includes: ID: XXX, interface_id: interface ID, method_name: method name, return_type: method return value type, with generics, which can be represented by <>. return_class: method return only type, and parameter_definitions: method request parameter list. The type metadata includes: ID: XXX, application_name: home application, env_type: environment, test represents a test environment, base_type: whether it is a Java basic type, according to this field, the packaging parameter logic of different types of parameters is also different, Neums: null, and propertiese: return parameter, which saves the definition of a composite object. According to the type name and the service name, the current type can be uniquely defined, and order defines the attribute field serial number under the type description, so that the information of the automatically generated interface can be kept completely consistent with the reported service parameter information.
[0083] The interface description object structure can be a set of information defining the basic framework of the interface, including but not limited to interface name, function description, calling mode and the like, and its role is to provide a clear interface usage guide for developers. Optionally, the fields in the interface description object structure include API name, API description, API version, service path url, protocol, method, parameter list and request header. The parameter list can include an input parameter list and an output parameter list, and the parameter attribute information of each parameter in the input parameter list and the output parameter list is encapsulated in the form of a parameter object structure. The request header (RequestHeader) can be a standard HTTP request header, and the role of the request header is to provide the server with additional information about the request so that the server can correctly process the request.
[0084] The parameter object structure can be a set of contents describing the detailed information of the parameters required by the interface, including but not limited to parameter name, type, default value and verification rule and the like, which helps to ensure the validity of the parameters when the interface is called. Optionally, the parameter object structure includes parameter name, parameter type, parameter order, associated API identifier, parameter level, parameter description, parent class identifier, parameter default value, and whether the parameter is required.
[0085] The association API identifier can be a unique identifier indicating the application interface to which the parameter belongs. The parent class identifier can be a feature that explicitly indicates the inheritance relationship of the parameter through the parent class identifier if the parameter inherits from a certain parent class, and can be obtained through the definition of the parameter inheritance relationship. The parent class identifier can include but is not limited to "ParentField". The parameter default value can be a default value used when the parameter is not explicitly assigned, and can be obtained through the definition of common values in the business scenario. The existence of the default value simplifies the interface calling process and reduces unnecessary assignment operations.
[0086] The parameter whether required can be a feature indicating whether the parameter is required, and can be obtained through the necessity analysis of the business requirement. For example, the parameter whether required can include but is not limited to "true" or "false". This attribute ensures the integrity and standardization of the interface call, thereby reducing problems caused by missing parameters.
[0087] The parameter level includes the request level parameter request, the response level parameter response, and the header parameter header. The request level parameter is data contained by the client when sending a request to the server, for example, query parameters, path parameters, etc. The response level parameter is data returned by the server to the client after processing the client request, for example, status code, response body, etc. The header parameter is a special field used to pass metadata in HTTP requests and responses, for example, request headers, response headers, etc.
[0088] Parameter description generally refers to the purpose, expected value, data type, etc. of a parameter in a function, method or class, for example, private java.lang.String desc is a private member variable declaration in a Java class, which declares a string type variable named desc. The private keyword indicates that this variable can only be accessed within the class in which it is declared.
[0089] In step 206, based on the interface description object structure and the parameter object structure, the service metadata is encapsulated to obtain interface description object information and parameter object information.
[0090] The encapsulated interface description object information can include the complete definition information of the interface, for example, the interface description object information includes the information corresponding to each field in the interface description object structure described above. The encapsulated parameter object information can include the complete definition information of the parameter, and the parameter object information includes the information corresponding to each field in the parameter object structure. The parameter object information includes the information of all input parameters and output parameters in the target application interface, and the parameter attribute information of each parameter exists in the form of parameter object structure encapsulation.
[0091] Exemplarily, the service metadata is parsed to obtain a data object, an interface identifier of a target application program interface is identified from the data object, interface information and a method name are determined from the data object according to the interface identifier, a method information set is queried from the data object according to the interface identifier and the method name, method information is obtained, a parameter list is obtained from the method information, all interface information is obtained, the obtained all interface information is encapsulated in an interface description object structure to obtain interface description object information. Parameter attribute information of each parameter in the parameter list is obtained from the data object, the parameter attribute information is encapsulated in a parameter object structure to obtain parameter object information. It should be noted that the processing manners of the out-parameter and the in-parameter in the parameter are the same, and the parameter is used instead of the out-parameter and the in-parameter.
[0092] In step 208, a software development kit is constructed through the interface description object information and the parameter object information.
[0093] The software development kit (SDK) is a part of an integrated development environment provided for developers, and includes implementation code of API interfaces and related tools. By obtaining basic tool class code, the class code and parameter code generated based on the interface description object information and the parameter object information are merged, and then a final SDK is generated through a compiler. This process ensures the compatibility of all components in the SDK, and generates binary files or library files that can be directly used by developers.
[0094] Exemplarily, information corresponding to each placeholder in a preset template is determined from the interface description object information and the parameter object information. In the code generation process, the template engine fills the information into the respective corresponding placeholders to obtain class code and parameter code related to the target application program interface, and then integrates the class code and the parameter code with the basic tool code to obtain a corresponding java source file. The java source file is then compiled by using a maven tool to obtain a software development kit and a source code jar package. Further, the software development kit and the source code jar package are pushed to a Maven repository, and a download URL of the jar package is generated. The software development kit corresponding to the authorized API interface is downloaded based on the download URL, the whole process automation from metadata change to SDK release is realized, and the generation efficiency of the SDK is improved.
[0095] The preset template is a pre-designed code framework for guiding generation of the API class and API parameter code, and dynamic code generation can be implemented through a template engine (such as Freemarker or Velocity). The preset template includes a static code framework and placeholders for generating specific code. The placeholders in the preset template mark positions that need to be replaced according to the interface object information and the parameter object information. During the code generation process, the placeholders are replaced by the specific interface object information and the parameter object information, and then the corresponding code is generated. The preset template can include a class template, an input parameter template, and an output parameter template. The class template includes placeholders corresponding to the interface description object information. The input parameter template and the output parameter template have the same structure and include placeholders corresponding to the parameter object information and placeholders of the interface name associated with the parameter object information.
[0096] Optionally, the class template includes a Java class, the class name of the Java class is a placeholder, different interface names can be substituted into the placeholder, the Java class contains a doRequestNew method for calling an API and processing a response. The doRequestNew method includes a placeholder ${apiRequestParam} corresponding to an input parameter list, a placeholder ${apiResponseParam} corresponding to an output parameter list, and a placeholder ${apiRequestBody} corresponding to data of an API request body. The data of the API request body can include a request header, a request method, and a path in the interface description object information.
[0097] The input parameter template and the output parameter template have the same structure. Taking the input parameter template as an example, the input parameter template includes a public class, the class name of which is dynamically specified by ${apiName}, and the class name can be different interface names. The class inherits from the BaseRequest class, and the input parameter template includes placeholders corresponding to parameter names and parameter types in the parameter object information.
[0098] The class code represents a code unit encapsulating API interface functions, implements API calling logic, and depends on the parameter code. The parameter code refers to the definition of input parameters or return results required by the API interface.
[0099] Basic utility code refers to the common functional modules in the SDK, such as logging and exception handling. This can be obtained from existing code repositories or through custom development. For example, pulling basic utility code from a GitLab repository provides various functionalities, including cross-language support, rapid build capabilities, modular composition, native input / output parameter handling, and a series of functionalities related to fundamental capabilities such as signing, HTTP connection pooling, and object serialization. This code provides the underlying technical support for building the SDK. The code can be cloned using the `git` command at a specified Git address.
[0100] Compilation refers to the process of converting source code into object code, which is usually done by a compiler. Various implementations can be chosen for different programming languages, such as a Java compiler. For example, the compilation process can convert Java source code into bytecode files.
[0101] In the aforementioned method for generating a software development kit (SDK), service metadata of the target application interface is obtained. This service metadata is jointly determined by business metadata and technical metadata related to business description information. Then, based on the business and technical metadata, the interface description object structure and parameter object structure of the SSDK interface definition are determined. Next, based on the interface description object structure and parameter object structure, the service metadata is encapsulated to obtain interface description object information and parameter object information. Finally, the SSDK is constructed using the interface description object information and parameter object information. This approach, compared to traditional technologies that only support technical metadata, adds business metadata at the metadata level. The newly added business metadata features are integrated into the interface description object information and parameter object information, enhancing the robustness of the SDK. This allows the generated SSDK to be coupled with the corresponding target application interface, improving the coupling between the SDK and the interface. Furthermore, API calls can be implemented without additional secondary development, improving overall development efficiency.
[0102] In one exemplary embodiment, such as Figure 3 As shown, step 206 includes steps 302 to 306. Wherein:
[0103] Step 302: Parse the service metadata to obtain a set of interface information and method information for the target application interface.
[0104] The interface information can be data describing basic attributes of the target application program interface, and the interface information includes information corresponding to each field in the interface description object structure, for example, the interface information can include interface name, path, protocol type, etc. The method information set can be data containing detailed definitions of all methods related to the target application program interface, for example, the method information set can include method name, return value type, parameter list, etc. It can be understood that the way of obtaining the interface information and the method information set by parsing the service metadata can be realized by existing methods, and details are not repeated here.
[0105] In step 304, the interface information and the method information set are encapsulated by the interface description object structure to obtain interface description object information.
[0106] Exemplarily, the API name, API description, API version, path url of the service, protocol, method and request header in the interface information, and the parameter list of the method information set are mapped to the corresponding fields in the interface description object structure to obtain the interface description object information.
[0107] In step 306, the parameter attribute information of each traversal parameter in the method information set is determined from the service metadata, and the determined parameter attribute information is encapsulated in the form of a parameter object structure to obtain parameter object information.
[0108] The traversal parameter generally refers to a parameter that accesses the parameter list in the method information set one by one. The parameter attribute information can be specific description data for each traversal parameter, for example, the parameter attribute information includes parameter name, parameter type, parameter order, associated API identifier, parameter level, parameter description, and parent class identifier, parameter default value, whether the parameter is required, etc.
[0109] Exemplarily, for each traversal parameter in the parameter list of the method information set, the parameter name, parameter type, parameter order, associated API identifier, parameter level, parameter description, and parent class identifier, parameter default value, whether the parameter is required, etc. parameter attribute information of each traversal parameter in the method information set is determined from the service metadata, and the parameter attribute information is mapped to the corresponding fields in the parameter object structure to obtain the parameter object information in the form of the parameter object structure. In the above method, the interface information and the method information set of the target application program interface are extracted by parsing the service metadata, the interface information and the method information set are encapsulated by the interface description object structure to generate the interface description object information, and the parameter attribute information of each traversal parameter in the method information set is determined from the service metadata and encapsulated in the form of the parameter object structure to generate the parameter object information, which can improve the technical effect of the accuracy and efficiency of service metadata processing.
[0110] The encapsulation of the parameter attribute information can be implemented in the following manner:
[0111] In an exemplary embodiment, the parameter attribute information of each traversal parameter in the method information set is determined from the service metadata, the determined parameter attribute information is encapsulated in the form of a parameter object structure to obtain parameter object information, including:
[0112] The parameter list in the method information set is sorted according to the parameter order indicated by the parameter object structure to obtain a sorted parameter list; the sorted parameter list is traversed, and for each traversal parameter in the parameter list, the parameter attribute information of each traversal parameter is determined from the service metadata according to the processing manner corresponding to the parameter type of each traversal parameter; and the parameter attribute information is encapsulated in the form of a parameter object structure to obtain parameter object information.
[0113] The parameter order can be an arrangement rule of the parameters in the interface call or definition, and can be determined by business logic and interface specifications. For example, the parameter order can include, but is not limited to, priority, dependency relationship, etc. For example, the parameter order can be a rule that "username" must be arranged before "password". The parameter type can be a specific classification of the parameter, such as a string, an integer, a Boolean value, a generic type, and a custom type, etc. Each parameter in the parameter list will obtain its corresponding parameter object information, i.e., its field definition. If the parameter type is a basic type, the field definition can be directly generated according to the parameter attribute information. If the parameter type is an array type, a collection type, and / or a Map type, it can be implemented by existing methods, which will not be described here.
[0114] Then, for the parameter type being a generic type or a custom type, the following processing manners are provided. Optionally, for each traversal parameter in the parameter list, in the case of the parameter type being a generic type, the traversal parameter is recursively parsed to obtain the parameter attribute information of the traversal parameter from the service metadata; and / or in the case of the parameter type being a custom type, the traversal parameter is recursively processed to obtain the parameter attribute information in the traversal parameter from the service metadata.
[0115] The recursive parsing process can be implemented by identifying whether the current traversal parameter is a generic type and further extracting the generic placeholder and its constraint conditions (such as the extends or super keywords). If the generic type is nested with other generic types, the recursive parsing is continued until all levels of generic description information are extracted. This manner can ensure that the parameter attribute information can be accurately extracted even under a complex generic structure.
[0116] The process of recursively processing the inner class can be achieved by identifying whether the current traversal parameter is a custom type, and further analyzing its definition structure to extract basic information such as class name, field list, and field type. If the custom type contains an inner class, the definition of the inner class is recursively expanded, and the relevant description information of the inner class is extracted. The extracted field and inner class information is integrated into the parameter attribute information to form a complete custom type description.
[0117] In an exemplary embodiment, as shown in Figure 4 A flowchart of encapsulating parameter object information is provided, including:
[0118] Obtain the parameter list, sort the parameter list to obtain a sorted parameter list, traverse the sorted parameter list, and for each traversal parameter in the parameter list, determine the type of the traversal parameter. If the parameter type is a basic type, directly obtain the parameter attribute information corresponding to the parameter type. If it is an array type, determine the parameter attribute information in the manner of processing array element types. If the parameter type is a collection type and Map type, recursively parse the traversal parameter to obtain the parameter attribute information of the traversal parameter from the service metadata. In the case of a custom type, recursively process the inner class of the traversal parameter to obtain the parameter attribute information in the traversal parameter from the service metadata. The obtained parameter attribute information is encapsulated in the form of a parameter object structure to obtain parameter object information, that is, the field definition of each parameter. After traversal, the obtained field definition is saved. The processing methods of basic types and array types can be achieved by existing methods, which are not described here.
[0119] In the above manner, the parameter list is sorted according to the order indicated by the parameter object structure, ensuring the correct transmission order of the parameters when calling the API. By traversing the sorted parameter list and selecting the corresponding processing method according to the parameter type, accurate parameter attribute information is extracted from the service metadata. By encapsulating the parameter attribute information in the form of a parameter object structure, a parameter object information set that is easy to use is generated. This method can accurately control the parameter order, enhance the adaptation ability to complex business scenarios, improve the comprehensiveness of parameter attribute information, and improve the efficiency and quality of the overall development process, thereby achieving the technical effect of generating a high-quality software development kit.
[0120] The above method determines the interface description object information and parameter object information required to generate a software development kit. Based on the obtained information, a software development kit can be constructed. The following provides a way to construct a software development kit.
[0121] In an exemplary embodiment, a software development kit is constructed based on the interface description object information and the parameter object information, including:
[0122] According to the class template in the preset template, the interface description object information is code constructed to obtain corresponding class code; according to the parameter template in the preset template, the parameter object information is code constructed to obtain parameter code; and by constructing the basic tool class code, the basic tool class code, the class code and the parameter code are compiled to generate a software development kit. It can be understood that according to the class template in the preset template, the interface description object information is code constructed, the information corresponding to the placeholder in the class template is determined from the interface description object information, and the information corresponding to the placeholder is encapsulated into the class template to generate corresponding class code. For example, the interface name in the interface description object information is mapped to the field corresponding to the interface name in the class template.
[0123] The specific implementation of generating the class code can be realized by the existing manner, which is not described here.
[0124] The generation mode of the parameter code includes: in an exemplary embodiment, according to the parameter template in the preset template, the parameter object information is code constructed to obtain the parameter code, including:
[0125] The parameter list corresponding to the parameter object information is traversed, the parent class identification information of the traversed parameter in the parameter list is determined, the target parameter is determined from the parameter list, and the target parameter is determined as a root field; for each target parameter corresponding to the root field, if the target parameter has a first child parameter, the first child parameter object information of the first child parameter is determined from the parameter object information; the corresponding first parameter information is determined from the first child parameter object information, the first parameter information is encapsulated into the first field of the parameter template in the preset template, and the code construction is completed to obtain the parameter code.
[0126] The first field corresponds to the root field, the first parameter information includes a first parameter type and a first parameter name of the first child parameter, the first parameter type is used to determine the data format of the transmission parameter of the called target application programming interface, and the first parameter name is used to determine the semantic information of the transmission parameter.
[0127] The parent class identification information can be information used to identify the parent class to which the parameter belongs, and is usually in the form of a string or a unique identifier. For example, the parent class identification information can include but is not limited to "parent_id", if the parent_id is a preset value, it means that the current traversed parameter itself is a parent class parameter, that is, the target parameter, and the target parameter can be used as a root field, and there can be at least one child parameter. The parameter types of the child parameters of the root field can be the same or different.
[0128] The first sub-parameter can be a direct sub-parameter of the target parameter, which functions to expand the function and description details of the root field. The first sub-parameter object information contains a data set of first sub-parameter detailed information, and the first sub-parameter object information is of the same type of information included in the parameter object information. The first parameter information can be key information extracted from the first sub-parameter object information, including a first parameter type and a first parameter name. The first parameter type can be information defining the data format of the transmitted parameter, such as an integer, a string, or a Boolean value, and exemplary first parameter types can include but are not limited to "integer", "string", "boolean", and the like. The first parameter name can be content defining the semantic information of the transmitted parameter, such as the meaning or functional description of the field, and exemplary first parameter names can include but are not limited to "age", "name", "is_active", and the like. The first field can be a specific field position in the parameter template corresponding to the root field, used to map the first parameter information. In a specific embodiment, the first parameter information is formed by extracting the first parameter type and the first parameter name from the first sub-parameter object information, and is mapped to the first field position in the parameter template, and the parameter code can be obtained through this processing mode.
[0129] It can be understood that the first parameter type is used to determine the data format of the transmitted parameter for calling the target application interface, and the first parameter name is used to determine the semantic information of the transmitted parameter, that is, the parameter type (such as int, string, User object, etc.) stipulates that the caller must pass in data conforming to the type, and the semantic information is to understand the intention of each parameter according to the parameter name, for example, the parameter name indicates that it is a username, and the caller understands that this parameter is used to update the username of the user by seeing the name username.
[0130] In the above manner, by traversing the parameter list in the parameter object information, the root field is filtered out, and the sub-parameters of the root field are parsed and encapsulated in detail, and finally the parsing result is mapped to the parameter template position in the preset template to generate a complete parameter code, thereby improving the quality and usability of the parameter code.
[0131] On this basis, if the first sub-parameter further has a corresponding sub-parameter and the sub-parameter has a custom type parameter, the following manner can be used to implement:
[0132] Optionally, for the target parameter corresponding to the root field, if there are at least two custom types for the sub-parameter type of the first sub-parameter of the target parameter, the first sub-parameter corresponding to each custom type is defined in the form of an inner class; for the first sub-parameter corresponding to each inner class, the first sub-parameter is determined as the root field, the first sub-parameter is determined as the target parameter, the step of determining the first sub-parameter of the first parameter type if the target parameter exists is executed, and the second parameter information corresponding to the second sub-parameter in the first sub-parameter is obtained; wherein the second parameter information includes the second parameter type and the second parameter name of the second sub-parameter; the first parameter information is encapsulated into the first field, and the second parameter information is encapsulated into the second field corresponding to the inner class in the parameter template, and the code construction is completed to obtain the parameter code.
[0133] The custom type can be a complex data structure defined according to actual needs, and can include multiple fields or attributes. This type of complex data structure can be implemented through class definition in a programming language, which is used to describe the data model in a specific business scenario. For example, the custom type can include but is not limited to "Address", "User", etc., and these types can include multiple sub-fields. If the sub-parameter type of the first sub-parameter includes at least two custom types, for example, the "address" parameter includes two custom types "city" and "zipCode", the two types need to be processed respectively.
[0134] The inner class can be a feature of a programming language, which allows another class to be defined inside a class, thereby achieving closer coupling and higher encapsulation. For example, "city" can be defined as an inner class "City" of the "Address" class.
[0135] If there are at least two custom types for the sub-parameter type of the first sub-parameter of the target parameter, the first sub-parameter can be regarded as a new root field, and the recursive parsing logic is re-executed. Illustratively, the first sub-parameter corresponding to the inner class is regarded as a new root field, and is determined as a target parameter. Then, it is checked whether the target parameter exists the first sub-parameter. If it exists, the information of these sub-parameters needs to be extracted, i.e. the second parameter information of these sub-parameters is extracted from the parameter object information. Based on this recursive parsing mechanism, the structure of the complex custom type parameter can be parsed layer by layer, and it is ensured that the generated code can accurately reflect the parameter definition of the API.
[0136] The first field can be a placeholder position in the parameter template corresponding to the root field, and the second field can be a placeholder position in the parameter template corresponding to the inner class. Further, the first parameter information is encapsulated into the first field position in the parameter template, and the second parameter information is encapsulated into the second field position in the parameter template corresponding to the inner class. After the above mapping is completed, the corresponding parameter code segment is generated, and is integrated into a complete parameter code.
[0137] In this way, by targeting the target parameter corresponding to the root field, when the sub-parameter type of the first sub-parameter of the target parameter contains multiple custom types, the custom types are defined in the form of an inner class; the first sub-parameter corresponding to the inner class is regarded as a new root field, and the recursive analysis logic is re-executed to extract the type and name information of the second sub-parameter; finally, the first parameter information and the second parameter information are respectively encapsulated into the corresponding field positions in the parameter template, and the code construction is completed to obtain the parameter code, which can achieve the support capability of enhancing the complex custom type parameter.
[0138] In an exemplary embodiment, a calling manner of the software development kit is provided, including:
[0139] In response to a calling request of the target application program interface; the interface name and the parameters indicated by the calling request are passed to the software development kit to call the target application program interface.
[0140] The calling request can be a function calling instruction initiated by the developer through the software development kit, and the calling request can be generated by the developer calling a specific method or function in the code. The generation manner of the calling request is not limited herein. The parameters include out parameters and in parameters.
[0141] Specifically, the manner of passing the interface name and the parameters indicated by the calling request to the software development kit to call the target application program interface can be realized by the existing manner, which is not described herein. Compared with the SDK calling application program interface in the related art, this manner only needs to be bound and coupled with the interface identifier of the application program to realize the calling of the target application program interface, without additional development and interface definition ambiguity.
[0142] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other sequences. Moreover, at least some of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of the steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least some of the other steps or the steps or stages in the other steps.
[0143] Based on the same inventive concept, the embodiments of the present application also provide a software development kit generation system for implementing the above-mentioned software development kit generation method. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme described in the above method, so the specific limitations in one or more software development kit generation system embodiments provided below can refer to the limitations of the software development kit generation method described above, and will not be repeated here.
[0144] In one exemplary embodiment, as shown in Figure 5 a software development kit generation system is provided, the system comprising an open platform, a metadata center and a service platform, wherein:
[0145] the service platform is configured to report service metadata of a target application program interface obtained by a preset software development kit to the metadata center;
[0146] the open platform is configured to read the service metadata from the metadata center and execute the steps of the method described in any one of the above embodiments.
[0147] The software development kit generation system obtains service metadata of a target application program interface, the service metadata being determined by business metadata and technical metadata related to business description information; determines interface description object structure and parameter object structure of software development kit interface definition according to the business metadata and the technical metadata; encapsulates the service metadata based on the interface description object structure and the parameter object structure to obtain interface description object information and parameter object information; and constructs the software development kit through the interface description object information and the parameter object information. This method increases metadata acquisition of business metadata compared with traditional technology which only supports technical metadata, and the business metadata can be used as business semantic restriction, so that the generated software development kit can be coupled with the corresponding target application program interface, the coupling degree of the SDK and the interface is improved, and the overall development efficiency is improved because the API call can be realized without additional secondary development.
[0148] The modules in the software development kit generation system can be realized by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be called and executed by the processor to perform operations corresponding to the modules.
[0149] In an exemplary embodiment, a computer device, which can be a terminal, is provided, and an internal structure diagram of the computer device can be as shown in Figure 6 As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input system. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface, the display unit and the input system are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control ability. 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 and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be realized through WIFI, mobile cellular network, near field communication (NFC) or other technologies. The computer program is executed by the processor to realize a software development kit generation method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection system or a virtual reality imaging system. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input system of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0150] Those skilled in the art can understand that, Figure 6 The skilled in the art can understand that,
[0151] In one embodiment, a computer device is also provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the steps in the above method embodiments.
[0152] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to realize the steps in the above method embodiments.
[0153] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by a processor to realize the steps in the above method embodiments.
[0154] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0155] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related 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 above-mentioned embodiments of each method. In the embodiments provided in the present application, any reference to memory, database or other medium can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0156] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, any combination of these technical features is deemed to be within the scope of the present application.
[0157] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.< / t>
Claims
1. A software development kit generation method, characterized by, The method comprises: acquiring service metadata of a target application program interface, the service metadata being determined according to technical metadata and business metadata related to business description information; determining an interface description object structure and a parameter object structure of a software development kit interface definition according to the service metadata, the software development kit being used to call the target application program interface; based on the interface description object structure and the parameter object structure, encapsulating the service metadata to obtain interface description object information and parameter object information; constructing the software development kit through the interface description object information and the parameter object information.
2. The method of claim 1, wherein, The business metadata at least includes one of parameter order, generic attribute and field verification rule; and / or, The interface description object structure at least includes at least one of application program interface name, application program interface description, application program interface version, parameter list, method, protocol type and request header; and / or, The parameter object structure at least includes at least one of parameter name, parameter type, parameter order, interface identifier of associated application program interface, parameter level, parameter description, parent class identifier, parameter default value and whether the parameter is required; and / or, 3. The method of claim 1, wherein, The encapsulation of the service metadata based on the interface description object structure and the parameter object structure to obtain the interface description object information and the parameter object information comprises: parsing the service metadata to obtain interface information and a method information set of the target application program interface; encapsulating the interface information and the method information set in the interface description object structure to obtain the interface description object information; determining parameter attribute information of each traversal parameter in the method information set from the service metadata, and encapsulating the determined parameter attribute information in the parameter object structure to obtain the parameter object information.
4. The method of claim 3, wherein, The determination of the parameter attribute information of each traversal parameter in the method information set from the service metadata, and the encapsulation of the determined parameter attribute information in the parameter object structure to obtain the parameter object information comprises: sorting a parameter list in the method information set according to a parameter order indicated by the parameter object structure to obtain a sorted parameter list; traversing the sorted parameter list, and for each traversal parameter in the parameter list, determining parameter attribute information of each traversal parameter from the service metadata according to a processing manner corresponding to a parameter type of each traversal parameter; encapsulating the parameter attribute information in the parameter object structure to obtain parameter object information.
5. The method of claim 4, wherein, The determination of the parameter attribute information of each traversal parameter from the service metadata according to a processing manner corresponding to a parameter type of each traversal parameter comprises: for each traversal parameter in the parameter list, in a case where the parameter type is generic, recursively parsing the traversal parameter to obtain parameter attribute information of the traversal parameter from the service metadata; and / or, In the case that the parameter type is a custom type, a recursive processing internal class is performed on the traversal parameter, and parameter attribute information in the traversal parameter is obtained from service metadata.
6. The method of claim 1, wherein, The construction of the software development kit includes: According to a class template in the preset template, code construction is performed on the interface description object information to obtain corresponding class code; According to a parameter template in the preset template, code construction is performed on the parameter object information to obtain parameter code; The software development kit is generated by compiling the basic tool class code, the class code and the parameter code through the construction of the basic tool class code.
7. The method of claim 6, wherein, The code construction of the parameter object information according to the parameter template in the preset template to obtain parameter code includes: The parameter list corresponding to the parameter object information is traversed, a parent class identifier of a traversal parameter in the parameter list is obtained, a target parameter is determined from the parameter list, and the target parameter is determined as a root field; For each target parameter corresponding to the root field, if a first child parameter exists in the target parameter, first child parameter object information of the first child parameter is determined from the parameter object information; First parameter information corresponding to the first child parameter object information is determined, the first parameter information is encapsulated into a first field of the parameter template in the preset template, and code construction is completed to obtain parameter code; The first field corresponds to the root field, the first parameter information includes a first parameter type and a first parameter name of the first child parameter, the first parameter type is used to determine a data format of a transmission parameter of the target application programming interface, and the first parameter name is used to determine semantic information of the transmission parameter.
8. The method of claim 7, wherein, The method further includes: For the target parameter corresponding to the root field, if a child parameter type of the first child parameter of the target parameter has at least two custom types, each first child parameter corresponding to each custom type is defined in the form of an internal class; For each first child parameter corresponding to each internal class, the first child parameter is determined as a root field, the first child parameter is determined as the target parameter, the step of determining the first child parameter of the target parameter is executed, and second parameter information corresponding to a second child parameter in the first child parameter is obtained; wherein the second parameter information includes a second parameter type and a second parameter name of the second child parameter; The first parameter information is encapsulated into the first field, and the second parameter information is encapsulated into a second field corresponding to the internal class in the parameter template, and code construction is completed to obtain parameter code.
9. The method according to any one of claims 1 to 8, characterized in that, The method further includes: In response to a call request of the target application programming interface; An interface name and parameters indicated by the call request are transmitted to the software development kit, and the target application programming interface is called.
10. A software development kit generation system, characterized by, The system includes an open platform, a metadata center and a service platform, wherein: The service platform is configured to report service metadata of a target application programming interface obtained by a preset software development kit to the metadata center. The open platform reads the service metadata from the metadata center and performs the steps of the method according to any one of claims 1 to 9. 11.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-10. The processor implements the steps of the method according to any one of claims 1 to 9 when executing the computer program.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9. The computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.