CN116795351A - Method and device for generating software tool package and readable storage medium - Google Patents

Method and device for generating software tool package and readable storage medium Download PDF

Info

Publication number
CN116795351A
CN116795351A CN202210920707.9A CN202210920707A CN116795351A CN 116795351 A CN116795351 A CN 116795351A CN 202210920707 A CN202210920707 A CN 202210920707A CN 116795351 A CN116795351 A CN 116795351A
Authority
CN
China
Prior art keywords
interface
model
data
data type
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210920707.9A
Other languages
Chinese (zh)
Inventor
杨培军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202210920707.9A priority Critical patent/CN116795351A/en
Publication of CN116795351A publication Critical patent/CN116795351A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention discloses a method and a device for generating a software tool kit and a computer readable storage medium, wherein the method comprises the following steps: analyzing an interface description file of the service to be called to obtain an interface metadata model of a preset data type; the interface metadata model comprises interface calling information and interface path information; binding the interface path information and an external calling path, and determining a bound interface metadata model; the external calling path is used for the second device to access the software interface of the service to be called; receiving input parameters from a preset application interface, and generating a software tool package based on the bound interface metadata model, the input parameters and a preset code template; the software tool package is used for being configured on the second device, so that the second device can call the service to be called through the software tool package. By the method and the device, the flexibility and the efficiency of generating the software tool kit are improved.

Description

Method and device for generating software tool package and readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for generating a software tool kit, and a computer readable storage medium.
Background
With the development of cloud computing technology, more and more applications are released on public clouds. With the popularization of public clouds, products on the clouds are increasingly more and more, users are greatly increased, scenes are deepened continuously, and a public cloud platform is required to provide unified software development kit (Software Development Kit, SDK) generating capability for the products on each cloud, so that the cloud platform can rapidly open cloud capability, and users can integrate and dock according to the same standard conveniently.
In the related technology, a method for self-developing a software tool package through a product side depends on the design development capability of a developer, so that the generated software tool package is inconsistent in standard and access mode, and the access and maintenance difficulty of a user is increased; and another method for generating the software tool package through the open source tool still needs to develop the interface calling function by itself, and has poor compatibility for different public cloud platform distributed gateways on the calling path of the software tool package.
Disclosure of Invention
The embodiment of the invention provides a method and a device for generating a software tool kit and a computer readable storage medium, which can improve the flexibility and the efficiency of generating the software tool kit.
The technical scheme of the invention is realized as follows:
the embodiment of the invention provides a method for generating a software tool kit, which is applied to first equipment, wherein the first equipment is connected with second equipment in a routing way, and the method comprises the following steps:
analyzing an interface description file of the service to be called to obtain an interface metadata model of a preset data type; the interface metadata model comprises interface calling information and interface path information;
binding the interface path information and an external calling path, and determining a bound interface metadata model; the external calling path is used for the second equipment to access the software interface of the service to be called;
receiving recording parameters from a preset application interface, and generating a software tool package based on the bound interface metadata model, the recording parameters and a preset code template; the software tool package is used for being configured on the second device, so that the second device can call the service to be called through the software tool package.
The embodiment of the invention provides a generating device of a software tool package, which is applied to first equipment, wherein the first equipment is connected with second equipment in a routing way, and the device comprises: an acquisition unit, a determination unit and a generation unit; wherein, the liquid crystal display device comprises a liquid crystal display device,
The acquisition unit is used for analyzing the interface description file of the service to be called and acquiring an interface metadata model of a preset data type; the interface metadata model comprises interface calling information and interface path information;
the determining unit is used for binding the interface path information and the external calling path and determining a bound interface metadata model; the external calling path is used for the second equipment to access the software interface of the service to be called;
the generation unit is used for receiving input parameters from a preset application interface and generating a software tool kit based on the bound interface metadata model, the input parameters and a preset code template; the software tool package is used for being configured on the second device, so that the second device can call the service to be called through the software tool package.
The embodiment of the invention provides first equipment, which comprises:
a memory for storing executable instructions;
and a processor for executing the executable instructions stored in the memory, wherein the processor executes the software tool package generation method when the executable instructions are executed.
Embodiments of the present invention provide a computer readable storage medium storing executable instructions that, when executed, are configured to cause a processor to perform a method of generating a software toolkit according to embodiments of the present invention.
The embodiment of the invention provides a method, a device and a readable storage medium for generating a software tool package, wherein in the method, an imported interface description file of a service to be invoked is analyzed, an interface metadata model with a preset data type is obtained to manage an application programming interface, the limiting condition and difficulty of product side access are reduced, and the flexibility of generating the software tool package is improved; and meanwhile, the interface path information and the external calling path are bound, and a software tool package is generated by using the bound interface metadata model and a preset code template, so that integration and compatibility of different public cloud platform gateway routes are realized, and the application on the cloud is faster to access and higher in usability. Further, according to the entered parameters, the software tool kit is generated by combining the preset code templates, so that the standardized software tool kit is generated, and the software tool kit generation efficiency is improved. By the method provided by the embodiment of the invention, the cloud application can automatically generate the unified software package tool only by filling a small amount of parameters, so that the flexibility and the efficiency of the software package are improved.
Drawings
Fig. 1 is a schematic flow chart of a method for generating a software tool kit according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a module structure of a software tool package generating system according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a method for generating a software tool package according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for generating a software tool package according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for generating a software tool package according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating the effect of a code generator multi-language adapter according to an embodiment of the present invention;
fig. 7 is a flowchart of a method for generating a software tool package according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a generating device of a software tool kit according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a first device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without making any inventive effort are within the scope of the present invention.
In order to better understand the aspects of the present invention, the present invention will be described in further detail with reference to the accompanying drawings and detailed description.
At present, the software tool kit providing modes of the application on each cloud mainly comprise the following three modes:
1. the application developer develops the application software tool package by itself; 2. automatically generating a product software tool package based on the open source framework; 3. a method for generating a software toolkit based on acquired product source code.
The method that the application program interface (Application Programming Interface, API) capability provider develops the SDK by oneself depends on the design development capability of the API capability provider itself, and the inconsistent SDK standards, inconsistent access modes and inconsistent SDK support programming languages provided by the product on the cloud can occur, so that the access difficulty of users is increased.
Based on the way that the Swagger open source framework automatically generates the product SDK, the generated SDK is strictly based on the OAS standard and has rich supporting programming languages, but depends on more third party tool kits, has complex functions, has weaker packaging of an API interface set provided for the product, needs self-development of a cloud API call signature method and does not support an integrated public cloud platform distributed gateway.
The method for generating the software tool package based on the acquired product source code has the advantages that the source code is required to be acquired for generating the pre-condition of the SDK, and the source code of an API provider is realized in Java language, so that the limit condition of generating the SDK by the product is increased, most cloud products (external products and internal products) cannot provide the source code for a platform, and secondly, the method for acquiring the source code and compiling the source code into the byte code is only suitable for an API interface developed in Java language and cannot meet the requirement of generating the SDK by multi-language products.
The method for generating the software tool package provided by the embodiment of the invention can be executed by the first device, and concretely can be executed by a generating device of the software tool package on the first device. In some embodiments, the first device may be a server.
Fig. 1 is a flowchart of a method for generating a software tool package according to an embodiment of the present invention, which will be specifically described with reference to the following steps.
S101, analyzing an interface description file of a service to be called to obtain an interface metadata model of a preset data type; the interface metadata model includes interface call information and interface path information.
In the embodiment of the invention, the interface description file of the service to be called is exported through the open source framework and analyzed, the interface metadata model of the preset data type is obtained and stored in the database, and the interface metadata model comprises interface calling information and interface path information.
In the embodiment of the invention, the interface call information comprises an interface name, an interface call method, an http call method, an interface request parameter, an interface response parameter and the like.
In the embodiment of the invention, after the interface description file is collected, the data converter analyzes the interface name, the interface path, the interface calling method, the http calling mode, the interface request parameter, the interface response parameter and the like in the interface description file. The request parameters and the response parameters have multi-layer nested relation respectively, so that the converter needs to recursively retrieve and analyze according to the dimension of the interface when processing the request parameters and the response parameters of the interface, and finally acquires the hierarchical structure of the request parameters and the response parameters and stores the hierarchical structure into the database.
In an embodiment of the present invention, an open source framework supporting importing an interface description file based on a preset standard may include: swagger, knife4j, etc., the preset standard may be an OAS standard, and the format of the interface metadata model may be as follows:
in the embodiment of the present invention, title represents a title for describing the file, ip of host providing interface, base path is "/", represents the prefix of interface address in json file, path represents the path set of all interfaces in the file, operationId is the interface access method, the local method for generating health check interface in software tool package is named healthUsingGET, get is the interface access method, and the other character meanings can refer to tables 1 and 2 specifically. In some embodiments of the present invention, the interface information in the interface metadata model is shown by table 1, and the interface request response parameters in the interface metadata model are shown by table 2.
TABLE 1
Sequence number Field name Field description Field type
1 Name api name varchar
2 Title api title varchar
3 summary api overview varchar
4 http_method http api request type (full uppercase) varchar
5 protocol http protocol [ http/https ]] varchar
6 Path api base path varchar
7 gateway_path api gateway path varchar
8 consumers Specifying request types varchar
9 produces Specifying a response type varchar
10 timeout Time-out time of calling interface int
TABLE 2
S102, binding interface path information and an external call path, and determining a bound interface metadata model; the external call path is for the second device to access the software interface of the service to be invoked.
In the embodiment of the invention, after the interface path information is acquired, the interface path information and an external calling path are bound, the external calling path information is used for enabling the second equipment to access a software interface of a service to be called through paths such as gateway routing defined in the external calling path information, and finally, a bound interface metadata model is acquired and can access a bottom layer interface through a public network gateway.
In the embodiment of the invention, the bottom layer interface is an interface of the access system, and when the software tool package is called, the request is forwarded to the gateway, and the gateway distributes the request.
S103, receiving input parameters from a preset application interface, and generating a software tool package based on the bound interface metadata model, the input parameters and a preset code template; the software tool package is used for being configured on the second device, so that the second device can call the service to be called through the software tool package.
In the embodiment of the invention, the generating device of the software tool kit generates a final software tool kit according to the input parameters received from the preset application interface, the bound interface metadata model and the preset code model, and the second equipment invokes the service to be invoked through the software tool kit.
In some embodiments of the present invention, fig. 2 is a schematic diagram of a module structure of a generating system of a software tool package provided by the embodiments of the present invention, in fig. 2, an application presentation layer collects metadata of an application programming interface, a background logic layer converts and binds the collected metadata, obtains the bound metadata and stores the bound metadata in a data storage layer, and a user inputs relevant parameters generated by the software tool package in the application presentation layer; the code generator generates source codes according to the template acquired by the code template, the related parameters generated by the input software tool package and the application programming interface metadata stored in the data storage layer, and stores the source code data in the data storage layer.
It can be understood that in the embodiment of the invention, the imported interface description file of the service to be invoked is parsed, and the interface metadata model of the preset data type is obtained to manage the application programming interface, so that the limiting condition and difficulty of product side access are reduced, and the flexibility of generating the software tool kit is improved; and meanwhile, the interface path information and the external calling path are bound, and a software tool package is generated by using the bound interface metadata model and a preset code template, so that integration and compatibility of different public cloud platform gateway routes are realized, and the application on the cloud is faster to access and higher in usability. Further, according to the entered parameters, the software tool kit is generated by combining the preset code templates, so that the standardized software tool kit is generated, and the software tool kit generation efficiency is improved. By the method provided by the embodiment of the invention, the cloud application can automatically generate the unified software package tool only by filling a small amount of parameters, so that the flexibility and the efficiency of the software package are improved.
In some embodiments of the present invention, fig. 3 is a second flowchart of a method for generating a tool pack according to an embodiment of the present invention, S101 may be implemented through S1011 to S1013, and the following steps will be specifically described.
S1011, responding to the importing operation on the preset application interface, and acquiring the interface description file imported by the importing operation.
In some embodiments of the present invention, a technician performs importing an interface description file from a preset application interface, and the generating device of the software tool kit responds to an importing operation on the preset application interface to obtain the interface description file imported by the importing operation.
S1012, determining a target analysis tool from at least one analysis tool; and analyzing the interface description file by utilizing a target analysis tool to obtain at least one metadata.
In some embodiments of the present invention, the parsing of the imported interface description file is dependent on a third party parsing tool, the generating device of the software tool package determines a target parsing tool from a plurality of third party parsing tools, and then parses the interface description file by using the target parsing tool to obtain at least one metadata.
In some embodiments of the invention, info, tags, path, etc. are all metadata.
S1013, organizing at least one metadata by using a preset data type to obtain a metadata model.
In some embodiments of the present invention, the generating device of the software tool kit organizes at least one metadata by using a preset data type to obtain a metadata model.
It may be appreciated that in some embodiments of the present invention, an interface description file imported by an import operation is obtained; determining a target resolution tool from the at least one resolution tool; analyzing the interface description file by utilizing a target analysis tool to obtain at least one metadata; and organizing at least one metadata by using the preset data type to obtain a metadata model. The method enables the universal interface description file based on the preset standard provided by the access product to input and manage the application programming interface information, does not depend on the source code of the access product and the programming language of the product side, and reduces the limiting condition and difficulty of the access of the product side.
In some embodiments of the present invention, fig. 4 is a flowchart of a method for generating a tool pack according to an embodiment of the present invention, S102 may be implemented through S1021 to S1022, and the following steps will be specifically described.
S1021, obtaining an external gateway route of the first device as an external call path.
In some embodiments of the present invention, the generating means of the software toolkit obtains configuration information of an external gateway route of the first device as an external call path.
In some embodiments of the present invention, the configuration information of the external gateway route refers to forwarding rules such as a request path for forwarding a request from the gateway to the product side or an interface for accessing the product.
And S1022, performing relation mapping on the external calling path and the interface path information, and determining the bound interface metadata model.
In some embodiments of the present invention, the generating device of the software tool package maps the relationship between the external call path and the interface path information to determine a bound interface metadata model, where the bound interface metadata model has the capability of being exposed outwards through the gateway.
It may be appreciated that in some embodiments of the present invention, the external gateway route of the first device is obtained as an external call path; and mapping the relationship between the external calling path and the interface path information to determine a bound interface metadata model, wherein the bound interface metadata model has the capability of being exposed outwards through a gateway, so that the application on the cloud is faster to access and higher in usability.
In some embodiments of the present invention, fig. 5 is a flowchart of a method for generating a tool pack according to an embodiment of the present invention, S103 may be implemented through S1031 to S1034, and the following steps will be specifically described.
S1031, integrating data content of the bound interface metadata model to obtain at least one first data model; the at least one first data model includes object model data, interface model data, and request response model data.
In some embodiments of the present invention, the generating device of the software tool kit obtains all interface metadata from the database for integration, and encapsulates the interface metadata into at least one first model data, where the at least one first data model includes object model data, interface model data, and request corresponding model data.
S1032, performing data type conversion on the at least one first model data according to the first data type specified by the input parameter to obtain at least one first model of the first data type.
In some embodiments of the present invention, the generating device of the software tool kit obtains a first data type according to the user input parameter, and performs data type conversion on at least one first model data according to the obtained data type to obtain at least one first model corresponding to the first data type.
In some embodiments of the present invention, the first data type may be Java, python, go, etc., and the present invention is not limited thereto.
S1033, generating the tool package source code based on at least one first model and a preset template code.
In some embodiments of the present invention, the generating device of the software tool kit generates the tool kit source code according to the at least one first model and the preset code model after encapsulation.
S1034, generating a software tool package based on the tool package source code.
In some embodiments of the present invention, the generating means of the software toolkit generates the software toolkit according to the generated toolkit source code.
In some embodiments of the present invention, S1032 may be implemented through S201 to S202, which will be specifically described in connection with the following steps.
S201, determining a corresponding first code template in the code templates based on the first data type.
In some embodiments of the invention, the generating means of the software toolkit determines a code template corresponding to the input data type among the code templates according to the first data type input by the user.
In some embodiments of the present invention, the first data type may be Java, python, go, etc., and the code template includes a Java template, a golang template, a Python template, etc., and the present invention is not limited thereto.
S202, performing data type conversion on at least one first model data based on a preset data type mapping relation to obtain at least one first model of the first data type; the data type mapping relation comprises a mapping relation between a preset data type and at least one data type; the at least one data type comprises a first data type; the first model includes at least one of an object model derived from the object model data, an interface model derived from the interface model data, and a request response model derived from the request response model data.
In some embodiments of the present invention, the generating device of the software tool kit converts the first model data into a data type corresponding to a preset data type according to a mapping relationship between the first model data and the preset data type, so as to obtain at least one first model of the first data type, where the first model includes at least one of an object model obtained from the object model data, an interface model obtained from the interface model data, and a request response model obtained from the request response model data.
In some embodiments of the present invention, table 3 is a correspondence between Java data types and OAS data types provided in embodiments of the present invention, as follows:
TABLE 3 Table 3
Java data type OAS data type
Integer int32
Long int64
Float float
Double double
String string
Byte byte
Boolean boolean
Date date
BigDecimal number
In some embodiments of the present invention, table 4 is a correspondence between Python data types and OAS data types provided by embodiments of the present invention, as follows:
TABLE 4 Table 4
Python data type OAS data type
Int int32
Int int64
Float float
Float double
Str string
Bytes byte
Bool boolean
datetime date
Number number
In some embodiments of the present invention, table 5 is a correspondence between Golang data types and OAS data types provided by embodiments of the present invention.
TABLE 5
Golang data type OAS data type
int32 int32
int64 int64
float32 float
float64 double
String string
Byte byte
Bool boolean
datetime date
Number number
In some embodiments of the invention, table 3 is a correspondence of Java data types and OAS data types; table 4 shows the correspondence between Python data types and OAS data types; table 5 shows the correspondence between Golang data types and OAS data types. Taking the corresponding relation between Java data types and OAS standard data types as an example, the mapping relation is defined and realized by a Java generator, and the corresponding relation between Python and golang data types is defined and realized by a Python generator and a Go generator.
In some embodiments of the present invention, S202 may be implemented through S2021 to S2022, which will be specifically described in connection with the following steps.
S2021, according to the first data type, matching in a unified abstract interface to obtain a first abstract method; the unified abstract interface comprises at least one abstract method corresponding to at least one data type.
In some embodiments of the present invention, the generating device of the software tool kit matches, according to the first data type, at least one abstract method corresponding to at least one data type included in the unified abstract interface to obtain the first abstract method.
S2022, performing data type conversion on at least one first model data by using a first abstract method to obtain at least one first model; and defining and realizing a data type mapping relation from the preset data type to the first data type in the first abstract method.
In some embodiments of the present invention, the first abstraction method defines and implements a data type mapping relationship from a preset data type to a first data type, and the generating device of the software tool kit performs data type conversion on at least one first model data by using the first abstraction method to obtain at least one first model.
In some embodiments of the present invention, S2022 may be implemented by S20221 to S20222, which are specifically described in connection with the following steps.
S20221, the general parameters of data type conversion are input through a unified abstract interface.
In some embodiments of the present invention, the generation means of the software toolkit imports the generic parameters of the data type conversion, i.e. the generic information required by all programming languages, through a unified abstract interface.
In some embodiments of the present invention, the general information required for all programming languages includes: automatically generating a code output path, a software package version, a product name, a product version, a model package path, a package path, and the like.
S20222, performing data type conversion on the at least one first model data by using the first abstract method and combining the general parameters to obtain at least one first model.
In some embodiments of the present invention, the generating device of the software tool kit performs data type conversion on at least one first model data by using a first abstract method and combining general information required by a programming language to obtain at least one first model.
In some embodiments of the present invention, fig. 6 is a schematic diagram illustrating the effect of the code generator multi-language adapter according to the embodiment of the present invention. In FIG. 6, the "software toolkit generator interface" provides an add-on attribute abstraction method, and the "generator default implementation" provides a default implementation of the add-on attribute, i.e., generic information needed for all programming languages such as: automatically generating a code output path, a software tool package version, a product name, a product version, a model package path, a package path and the like; each programming language (Java, go, python, nodejs and the like) code generator is taken as a method for realizing the "child rewriting parent class" adding attribute "by taking the default of the generator, and the attribute required by the software tool kit generator of java, go, python and the like is assembled by adding the characteristics of the programming language while acquiring the general information of the interface.
In some embodiments of the present invention, S202 may also be implemented through S301 to S303, which will be specifically described in connection with the following steps.
S301, performing at least one recursion analysis on the nested data under the condition that the first model data contains the nested data, and obtaining initial model layer data of a preset data type through each recursion analysis.
In some embodiments of the present invention, in the case that the first model data includes nested data, i.e. complex data types, the generating device of the software tool package performs at least one recursive parsing on the nested data, and obtains initial model layer data of a preset data type, i.e. a basic data type, through each recursive parsing.
S302, converting the initial model layer data into target model layer data of a first data type according to the data type mapping relation until the analysis of the last layer of nested data is completed, and assembling each target model layer data according to the nested relation to obtain converted nested data.
In some embodiments of the present invention, the composite type, i.e. the nested data, is assembled from object models composed of base types, the upper model is constructed from the lower model, i.e. when there are complex types in the model, the complex types are disassembled, encapsulated into complex types using the base data types, then introduced, drilled layer by layer using a recursive algorithm until the last layer is calculated, encapsulated, then introduced from bottom to top, thus completing the assembly of complex data types and obtaining the converted nested data.
S303, obtaining a first model based on the converted nested data.
In some embodiments of the invention, the generating means of the software toolkit obtains the first model based on the converted nested data.
In some embodiments of the present invention, S2022 may be implemented by S401 to S402, which are specifically described in connection with the following steps.
S401, if the first data type is the composite data type, importing a library file corresponding to the composite data type by using a first abstract method.
In some embodiments of the present invention, the generating device of the software tool kit determines the type of the first data, and if the first data is a composite data type, the library file corresponding to the composite data type, that is, the generic package corresponding to the composite data type is imported by using the first abstraction method.
In some embodiments of the present invention, according to the general package that needs to be introduced by the computing object model files with different dynamic types of class attribute fields, for example, in java, the field types are set, java. Util. List package needs to be introduced, the base type does not need to be imported, and python generally does not need to be imported for the field data types, but when the compatibility problem of python2 and python3 data types is encountered, the six module needs to be imported to process the incompatibility problem of character strings and byte arrays, and whether package importing logic is implemented by the individual language personality implementation modules as a unified entry through the software tool package abstract interface.
S402, data loading and replacing are carried out on the first model data based on the library file, and a first model is obtained.
In some embodiments of the present invention, the generating device of the software tool kit performs data loading and replacing on the first model data according to the library file corresponding to the imported composite data type, that is, the generic package corresponding to the composite data type, to obtain the first model.
In some embodiments of the present invention, S203 may be implemented through S2031 to S2033, which will be specifically described in connection with the following steps.
S2031, writing at least one first model into a first code template to obtain a first code.
In some embodiments of the invention, the generating means of the software toolkit maps the first model with the first code template to generate the specific code file.
And S2032, rendering the first code to obtain a source code file, and generating a source code description file corresponding to the source code file.
In some embodiments of the present invention, the generating device of the software tool kit uses a template compiler rendering template to render the first code, so as to obtain a source code file and a source code description file corresponding to the source code file.
In some embodiments of the invention, the code template rendering engine employs a lightweight template engine mustache.
S2033, combining the source code description information, and packaging the source code file to obtain the tool kit source code.
In some embodiments of the present invention, the generating device of the software tool kit encapsulates the source code file according to the interface name, the request type, the request parameter, the response parameter, and the like in the tool kit, so as to obtain the tool kit source code.
In some embodiments of the present invention, the generating device of the software tool kit may also aggregate and encapsulate the calling client model of all interfaces under the product directory, that is, the client software package, with the product as a dimension, to define each element of the client request, that is, the interface name, the request type, the request location, the request parameter, the response parameter, and the like, and further include a code example of the interface call, so that the developer can integrate the calling client model into its own application, and then uniformly store the model data, that is, the object model data, the request model data, the interface model data, and the interface data into the dictionary, and obtain the programming language from the resource file in the program package. And rendering the template by using a template compiler to generate a specific code file for the template file.
In some embodiments of the present invention, the method for generating a software tool package further includes S501 before S101, which is specifically described in connection with the following steps.
S501, receiving input parameters from a preset application interface.
In some embodiments of the present invention, the generating device of the software tool kit receives input parameters input by a user from a preset application interface.
In some embodiments of the present invention, parameters entered by a user may be a product name, a product version, and a programming language, for example, a software package of a java version of an elastic cloud host product under a cloud host major class needs to be generated, and parameters entered by a user are a language including java, a product type product including cloud host, and a module name module including elastic cloud host.
In some embodiments of the present invention, the process of "parsing the interface description file with the target parsing tool to obtain at least one metadata" in S501, S1012 may be implemented through S1012-1 to S1012-2, and will be specifically described in connection with the following steps.
S1012-1, analyzing the interface description file according to interface information appointed in the input parameters by using a target analysis tool to obtain at least one interface data corresponding to the interface information; the at least one interface data corresponds to at least one interface processing type.
In some embodiments of the present invention, the generating device of the software tool kit uses the target parsing tool to parse the interface description file according to the product type specified in the input parameter, the programming language, and the like, to obtain at least one interface data corresponding to the interface information.
In some embodiments of the invention, the interface processing type may include request information processing and interface response information processing of the interface.
S1012-2, according to at least one interface processing type, carrying out aggregation processing on at least one interface data to obtain at least one metadata.
In some embodiments of the present invention, the software tool package device aggregates at least one interface data according to at least one interface processing request to obtain at least one metadata.
In some embodiments of the present invention, S1033 may be implemented through S10331, which will be specifically described in connection with the following steps.
S10331, compiling and packaging the tool package source codes to obtain the software tool package.
In some embodiments of the present invention, the generating device of the software toolkit compiles and packages the obtained toolkit to obtain the software toolkit.
In some embodiments of the present invention, source code files are compiled and packaged into executable files, e.g., java source code is compiled and packaged into xxx.
In some embodiments of the present invention, the method for generating a software package further includes S601 to S602, which will be specifically described in connection with the following steps.
S601, storing the source code file and the service to be called in the same directory.
In some embodiments of the present invention, the generating device of the software tool kit stores the generated source code file according to the product catalog, that is, one product is corresponding to one folder, and the code of the software package of the product interface is in the folder.
S602, pushing the source code file to a preset code warehouse to manage the source code file through the preset code warehouse.
In some embodiments of the present invention, the generation means of the software toolkit provides the ability to automatically push source code files to a preset code repository, where the automatically generated code is audited by a code library administrator and incorporated into the preset code repository.
In some embodiments of the present invention, fig. 7 is a flowchart of a method for generating a software tool package according to an embodiment of the present invention. As shown in fig. 7, includes: the system comprises a user action module, an external service module, a configuration and metadata module, a generator module, a software tool package interface definition module, a general realization module and a personalized realization module of each language.
In fig. 7, the user action module is mainly triggered by a user to generate an action of the software tool kit, and the external service module is responsive to the action to trigger the generation of the software tool kit. The configuration and metadata module sends the parameters and application programming interface data which are input by the acquired user to the generator module; the generator module generates software toolkit client code from the application programming interface metadata, the software toolkit generator configuration parameters, and the code template. The main process is as follows: the software tool package interface definition module provides the general information needed for the add-on property method, i.e. all programming languages, such as: automatically generating a code output path, an SDK version, a product name, a product version, a model package path, a package path and the like; the method comprises the steps of obtaining general information of an interface, and adding the characteristics of programming language to assemble the required attributes of different language version software tool kit generators; templates of different languages are generated through the individual realization modules of the languages. The following describes the interaction procedure of each module with reference to fig. 7:
And step 0, the user action module receives the operation that a user triggers to generate a software package on a preset interface.
And step 1, inquiring and inputting metadata by an external service module.
The entered data is written into the database, querying which interfaces are in total, including which parameters.
And 2, triggering the software tool kit to generate by the external service module.
And generating source codes of the software package according to the object model, the request response model, the interface model, the metadata and the like.
Step 2 comprises steps 2.1-2.2, wherein;
and 2.1, summarizing interface information and user input parameters by the external service module.
And 2.2, the external service module transmits the configuration parameters and interface data returned by the configuration and metadata module to the generator module. Wherein step 2.2 comprises steps 2.2.1-2.2.6 as follows:
and 2.2.1, adding an attribute interface by the generator module.
The generator module adds an attribute interface for storing general information, for example, if some aggregate data types in Java need to be imported into a third-party software package, a package path required by the package is stored in the general information through the attribute interface.
And 2.2.2, the generator module processes the attribute.
The generator module processes generic information stored through the attribute interface, such as packet paths, etc.
And 2.2.3, the generator module processes the model data. Wherein step 2.2.3 includes steps 2.2.3.1-2.2.3.2, as follows:
step 2.2.3.1, the generator module processes the object model interface.
Step 2.2.3.1 includes step 2.2.3.1.1, wherein;
step 2.2.3.1.1, the software tool package interface definition module processes the general realization of the model.
Step 2.2.3.1.1 includes steps 2.2.3.1.1.1-2.2.3.1.1.2, wherein;
step 2.2.3.1.1.1, the general realization module processes the general realization of the model.
And step 2.2.3.1.1.2, the individual realization module of each language processes individual realization of the model.
And each language personality realization module generates a software tool package of each language version according to the methods in each language generator module which are matched with different language types.
Step 2.2.3.2, the generator module processes the packet logic.
Step 2.2.3.2 includes step 2.2.3.2.1, wherein;
step 2.2.3.2.1, the software tool package interface definition module processes the package guiding logical interface.
And acquiring a packet path and guiding the packet.
Step 2.2.3.2.1 includes 2.2.3.2.1.1-step 2.2.3.2.1.2, wherein;
step 2.2.3.2.1.1, the general realization module processes the general realization of the package guiding logic.
And 2.2.3.2.1.2, processing the package guiding logic individuality realization by each language individuality realization module.
Step 2.2.4, the generator module processes the application programming interface model.
The generated client contains all interface methods under the product, which integrate the object model generated by 2.2.3.
Step 2.2.4 includes step 2.2.4.1, wherein;
step 2.2.4.1, software toolkit interface definition is used to generate the producer interface.
Step 2.2.4.1 includes steps 2.2.4.1.1-2.2.4.1.2, wherein;
and step 2.2.4.1.1, each language personality realization module is used for generating a universal realization of the software tool package interface.
Step 2.2.4.1.2, the universal implementation module is used for generating interface personality implementation.
Step 2.2.5, the generator module is used for mapping the software tool package model data and the templates.
And mapping the data in the generated application programming interface model, the object model and the request response model into a preset template.
And 2.2.6, the generator module starts writing the file.
After the generator module maps the software tool package model data and the template, the generator module starts to write relevant data into the template.
And 3, packaging the external service module.
And the external service module compiles and packages the source code file into an executable file, packages the executable file and places the executable file into a public warehouse so that a user can call and access the executable file.
In fig. 7, the software tool package interface definition module is an interface module, only defines a program method, and does not include a specific implementation, so that abstract commonalities in software tool package generating flows for implementing different products are realized. The specific implementation is realized by a general implementation module and each language personality implementation module; the independent characteristic parts in the software tool package generating process of different products are realized by the universal realization module and the individual realization modules of the languages.
The embodiment of the invention also provides a method for generating the software tool kit, which comprises the following specific steps of.
S1, analyzing the imported interface description file to obtain analyzed interface metadata information.
S2, classifying and aggregating the analyzed interface metadata information, and adapting a software package into a parameter data structure, wherein the parameter data structure comprises aggregated object model data, interface model data and request model data.
S3, generating a software package source code: and calling a software package generator main function, and simultaneously inputting prepared object model data, interface model data and request model data as generator parameters.
In some embodiments of the invention, S3 is implemented by S3.1 to S3.6, with the following specific steps.
S3.1, setting user input parameters as configuration parameters of a code generator. The three parameters of the product name, the product version and the programming language are selected and input by a user, and other parameters such as a model package path, an interface package path, a software package version number and the like are set by program default or are automatically calculated according to rules.
S3.2, allowing the client to call the code generator to set personalized parameters and transmit the personalized parameters into the software package generator, wherein the code generator defines an 'adding attribute interface', the default implementation of the code generator is processed by a 'general implementation' module, the custom parameters are specially processed by each language custom implementation (the actual programming language can be Java, python, go, and the custom implementation of each programming language is collectively called as a programming language personalized code generator) module, and the multi-language flexible expansion of the code generator is realized in a combined mode of general information management by the general module and characteristic information management by each language module.
S3.3, generating an object model aiming at the object-oriented language, wherein different programming language generator strategies are adapted through a unified abstract interface, and the method in each language generator module can be adapted according to different language types, and meanwhile, a built-in general processing module processes general generation logic of different languages.
In some embodiments of the invention, S3.3 is implemented by S3.3.1 to S3.3.2, with the following specific steps.
S3.3.1, processing object model properties, including class names, class properties, property type definitions, class methods, and the like. The process execution generation model method processes the object model, judges attribute types under each object model according to the input metadata, the types are divided into basic types and complex types, and because the definition of the basic types of the data is different in various programming languages, the adaptation is carried out by adopting a mode of mapping each language data type by relying on the OAS standard definition type, and the adaptation logic sinks into each language generator and is responsible for realizing by each language custom generator.
S3.3.2 an object model import packet is set, according to the general packet that needs to be imported according to the calculation object model files with different dynamic types of class attribute fields, if the field types in java are set, java. Util. List packet needs to be imported, the basic types do not need to be imported, and python generally does not need to be imported for the field data types, but when the compatibility problem of python2 and python3 data types is encountered, the six module needs to be imported to process the incompatibility problem of character strings and byte arrays, and whether package importing logic is implemented by the individual language personality implementation modules as a unified entry through the software tool package abstract interface.
S3.4, generating a calling client model of all interfaces in the product catalog, carrying out aggregation packaging by taking the product as a dimension, defining each element of the client request, namely an interface name, a request type, a request position, a request parameter, a response parameter and the like, and further comprising a code example of interface calling, so that a developer can integrate the code example into own application conveniently.
S3.5, mapping the model data and the code template to generate a specific code file.
In some embodiments of the present invention, the generated object model data, request model data, interface model data and interfaces are stored in a dictionary, and the programming language is obtained from the resource file in the program package. And for the template file, a template compiler is used for rendering the template to generate a specific code file, and a lightweight template engine mustache is adopted by a code template rendering engine.
S3.6, writing the code file into the disk.
In some embodiments of the present invention, the generated code files are stored in terms of product catalogues, i.e., one product for one folder, within which is the software package code that opens the interface for the product. Meanwhile, the capability of automatically pushing the source codes to a preset warehouse is provided, and automatically generated codes are checked and integrated into the code warehouse by a code library manager.
S4, compiling and packaging source codes: and generating a source code file, compiling and packaging.
In some embodiments of the present invention, source code files are compiled and packaged into executable files, for example, java source code is compiled and packaged into xxx.
It can be understood that in the embodiment of the invention, the imported interface description file of the service to be invoked is parsed, and the interface metadata model of the preset data type is obtained to manage the application programming interface, so that the method does not depend on the access product source code and the programming language of the product side, and the limiting condition and difficulty of the access of the product side are reduced; the user input parameter setting is used as the configuration parameter of the code generator, so that the cloud application can automatically generate a unified software tool package by filling a small amount of parameters, and meanwhile, the operation management platform is provided, and the usability is higher. And meanwhile, the interface path information and the external calling path are bound, and the software tool package is generated by using the bound interface metadata model and the preset code template, so that the capabilities of self public cloud platform gateway routing and the like are integrated, and the flexibility and convenience of the software tool package generation are improved.
An embodiment of the present invention provides a device for generating a software tool package, as shown in fig. 8, fig. 8 is a schematic structural diagram of the device for generating a software tool package, where the device includes: an acquisition unit 801, a determination unit 802, and a generation unit 803; wherein, the liquid crystal display device comprises a liquid crystal display device,
the obtaining unit 801 is configured to parse an interface description file of a service to be invoked to obtain an interface metadata model of a preset data type; the interface metadata model comprises interface calling information and interface path information;
the determining unit 802 is configured to bind the interface path information and an external call path, and determine a bound interface metadata model; the external calling path is used for the second equipment to access the software interface of the service to be called;
the generating unit 803 is configured to receive an input parameter from a preset application interface, and generate a software tool package based on the bound interface metadata model, the input parameter and a preset code template; the software tool package is used for being configured on the second device, so that the second device can call the service to be called through the software tool package.
In some embodiments of the present invention, the obtaining unit 801 is further configured to obtain, in response to an import operation on a preset application interface, an interface description file imported by the import operation; and determining a target resolution tool from the at least one resolution tool; analyzing the interface description file by utilizing the target analysis tool to obtain at least one metadata; and organizing the at least one metadata by utilizing the preset data type to obtain the metadata model.
In some embodiments of the present invention, the determining unit 802 is further configured to obtain an external gateway route of the first device as the external call path; and mapping the relation between the external calling path and the interface path information to determine a bound interface metadata model.
In some embodiments of the present invention, the generating unit 803 is further configured to integrate data contents of the bound interface metadata model to obtain at least one first model data; the at least one first model data comprises object model data, interface model data, and request response model data; generating a tool package source code based on the at least one first model data and the preset code template; and generating the software tool package based on the tool package source code.
In some embodiments of the present invention, the generating unit 803 is further configured to obtain at least one configuration parameter by receiving an input parameter input by a user operation; and generating tool package source codes according to the at least one configuration parameter, the at least one first model data and the preset code template.
In some embodiments of the present invention, the generating unit 803 is further configured to determine a corresponding first code template among the code templates based on the first data type; based on a preset data type mapping relation, performing data type conversion on the at least one first model data to obtain a first model of at least one first data type; the data type mapping relation comprises a mapping relation between the preset data type and at least one data type; the at least one data type includes the first data type; the first model includes at least one of an object model derived from the object model data, an interface model derived from the interface model data, and a request response model derived from the request response model data.
In some embodiments of the present invention, the generating device of the software tool package further includes a converting unit 804, where the converting unit 804 is configured to match, according to the first data type, a first abstract method in a unified abstract interface; the unified abstract interface comprises at least one abstract method corresponding to at least one data type; and performing data type conversion on the at least one first model data by using the first abstract method to obtain the at least one first model; and defining and realizing a data type mapping relation from the preset data type to the first data type in the first abstract method.
In some embodiments of the present invention, the conversion unit 804 is further configured to enter, through the unified abstract interface, a general parameter for data type conversion; and performing data type conversion on at least one first model data by using the first abstract method and combining the general parameters to obtain the at least one first model.
In some embodiments of the present invention, the conversion unit 804 is further configured to, in a case where the first model data includes nested data, perform at least one recursive parsing on the nested data, and obtain, by each recursive parsing, initial model layer data of the preset data type; according to the data type mapping relation, converting the initial model layer data into target model layer data of the first data type until the analysis of the last layer of nested data is completed, and assembling each target model layer data according to the nested relation to obtain converted nested data; and obtaining a first model based on the converted nested data.
In some embodiments of the present invention, the conversion unit 804 is further configured to import, if the first data type is a composite data type, a library file corresponding to the composite data type using the first abstraction method; and performing data type conversion on the first model data based on the library file to obtain a first model.
In some embodiments of the present invention, the conversion unit 804 is further configured to write the at least one first model into the first code template to obtain the first code; rendering the first code to obtain a source code file, and generating source code description information corresponding to the source code file; and combining the source code description information, and packaging the source code file to obtain the tool package source code.
In some embodiments of the present invention, the conversion unit 804 is further configured to receive the input parameter from the preset application interface; analyzing the interface description file according to the interface information appointed in the input parameter by utilizing the target analysis tool to obtain at least one interface data corresponding to the interface information; the at least one interface data corresponds to at least one interface processing type; and according to the at least one interface processing type, carrying out aggregation processing on the at least one interface data to obtain the at least one metadata.
In some embodiments of the invention, the source code description information includes at least one of: model packet path, interface packet path, and tool packet version number.
In some embodiments of the present invention, the conversion unit 804 is further configured to compile and package the toolkit source code to obtain the software toolkit.
In some embodiments of the present invention, the generating device of the software tool kit further includes a storing unit 805 and a pushing unit 806; the saving unit 805 is configured to save the source code file and the service to be invoked under the same directory; the pushing unit 806 is configured to push the source code file to a preset code repository, so as to manage the source code file through the preset code repository.
It can be understood that in the implementation scheme of the device, the interface description file of the service to be invoked is parsed to obtain an interface metadata model of a preset data type; the interface metadata model comprises interface calling information and interface path information; binding the interface path information and an external calling path, and determining a bound interface metadata model; the external calling path is used for accessing a software interface of the service to be called through the external path; generating a software tool package based on the bound interface metadata model and a preset code template; the software tool package is used for being configured on the second device, so that the second device can call the service to be called through the software tool package. In the embodiment of the invention, the imported interface description file of the service to be invoked is analyzed, the interface metadata model of the preset data type is obtained to manage the application programming interface, the access product source code is not relied on, the programming language of the product side is not limited, and the limiting condition and difficulty of the access of the product side are reduced; and meanwhile, the interface path information and the external calling path are bound, and the software tool package is generated by using the bound interface metadata model and the preset code template, so that the capabilities of self public cloud platform gateway routing and the like are integrated, and the flexibility and convenience of the software tool package generation are improved.
Based on the method of the foregoing embodiment, as shown in fig. 9, fig. 9 is a schematic structural diagram of a first device according to the embodiment of the present invention, where the schematic structural diagram includes: a processor 901 and a memory 902; the memory 902 stores one or more programs executable by the processor 901, and when the one or more programs are executed, the processor 901 executes a software tool package generating apparatus according to the foregoing embodiment.
The embodiment of the invention provides a computer readable storage medium which stores executable instructions for realizing the method for generating the software tool kit when being executed by a processor.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention.

Claims (12)

1. A method for generating a software tool package, which is characterized by being applied to a first device; the first device is connected with a second device in a routing way, and the method comprises the following steps:
analyzing an interface description file of the service to be called to obtain an interface metadata model of a preset data type; the interface metadata model comprises interface calling information and interface path information;
binding the interface path information and an external calling path, and determining a bound interface metadata model; the external calling path is used for the second equipment to access the software interface of the service to be called;
receiving input parameters from a preset application interface, and generating a software tool package based on the bound interface metadata model, the input parameters and a preset code template; the software tool package is used for being configured on the second device, so that the second device can call the service to be called through the software tool package.
2. The method according to claim 1, wherein the parsing the interface description file of the service to be invoked to obtain an interface metadata model of a preset data type includes:
responding to an importing operation on a preset application interface, and acquiring an interface description file imported by the importing operation;
determining a target resolution tool from the at least one resolution tool; analyzing the interface description file by utilizing the target analysis tool to obtain at least one metadata;
and organizing the at least one metadata by utilizing the preset data type to obtain the metadata model.
3. The method of claim 1, wherein binding the interface path information and the external call path, and determining the bound interface metadata model comprises:
acquiring an external gateway route of the first device as the external calling path;
and carrying out relation mapping on the external calling path and the interface path information to determine a bound interface metadata model.
4. The method of claim 1, wherein the receiving the input parameters from the preset application interface and generating the software toolkit based on the bound interface metadata model, the input parameters, and the preset code template comprises:
Integrating data content of the bound interface metadata model to obtain at least one first model data; the at least one first model data comprises object model data, interface model data, and request response model data;
according to the first data type specified by the input parameter, carrying out data type conversion on the at least one first model data to obtain at least one first model of the first data type;
generating a tool package source code based on the at least one first model and the preset code template;
and generating the software tool package based on the tool package source code.
5. The method of claim 4, wherein the performing data type conversion on the at least one first model data according to the first data type specified by the input parameter to obtain at least one first model of the first data type comprises:
determining a corresponding first code template in the code templates based on the first data type;
based on a preset data type mapping relation, performing data type conversion on the at least one first model data to obtain the at least one first model of the first data type; the data type mapping relation comprises a mapping relation between the preset data type and at least one data type; the at least one data type includes the first data type; the first model includes at least one of an object model derived from the object model data, an interface model derived from the interface model data, and a request response model derived from the request response model data.
6. The method of claim 5, wherein the performing data type conversion on the at least one first model data based on a preset data type mapping relationship to obtain the at least one first model of the first data type includes:
according to the first data type, a first abstract method is obtained by matching in a unified abstract interface; the unified abstract interface comprises at least one abstract method corresponding to at least one data type;
performing data type conversion on the at least one first model data by using the first abstract method to obtain the at least one first model; defining and realizing a data type mapping relation from the preset data type to the first data type in the first abstract method;
the data type conversion is performed on the at least one first model data by using the first abstract method to obtain the at least one first model, which comprises the following steps:
through the unified abstract interface, universal parameters of data type conversion are input;
performing data type conversion on at least one first model data by using the first abstract method and combining the general parameters to obtain at least one first model;
The method further includes:
if the first data type is a composite data type, importing a library file corresponding to the composite data type by using the first abstract method;
and performing data type conversion on the first model data based on the library file to obtain a first model.
7. The method according to claim 5 or 6, wherein the performing data type conversion on the at least one first model data based on a preset data type mapping relationship to obtain the at least one first model of the first data type includes:
performing at least one recursion analysis on the nested data under the condition that the first model data contains the nested data, and obtaining initial model layer data of the preset data type through each recursion analysis;
converting the initial model layer data into target model layer data of the first data type according to the data type mapping relation until the analysis of the last layer of nested data is completed, and assembling each target model layer data according to the nested relation to obtain converted nested data;
And obtaining a first model based on the converted nested data.
8. The method of claim 4, wherein generating toolkit source code based on the at least one first model and the preset code template comprises:
writing the at least one first model into the first code template to obtain the first code;
rendering the first code to obtain a source code file, and generating source code description information corresponding to the source code file; the source code description information comprises at least one of the following: model package path, interface package path, and tool package version number;
and combining the source code description information, and packaging the source code file to obtain the tool package source code.
9. The method according to claim 2, wherein before parsing the interface description file of the service to be invoked to obtain the interface metadata model of the preset data type, the method further comprises:
receiving input parameters from the preset application interface;
the parsing the interface description file by using the target parsing tool to obtain at least one metadata includes:
analyzing the interface description file according to the interface information appointed in the input parameter by using the target analysis tool to obtain at least one interface data corresponding to the interface information; the at least one interface data corresponds to at least one interface processing type;
And according to the at least one interface processing type, carrying out aggregation processing on the at least one interface data to obtain the at least one metadata.
10. A software tool package generating apparatus applied to a first device, the first device being connected to a second device by a route, the apparatus comprising: an acquisition unit, a determination unit and a generation unit; wherein, the liquid crystal display device comprises a liquid crystal display device,
the acquisition unit is used for analyzing the interface description file of the service to be called and acquiring an interface metadata model of a preset data type; the interface metadata model comprises interface calling information and interface path information;
the determining unit is used for binding the interface path information and the external calling path and determining a bound interface metadata model; the external calling path is used for the second equipment to access the software interface of the service to be called;
the generation unit is used for receiving input parameters from a preset application interface and generating a software tool kit based on the bound interface metadata model, the input parameters and a preset code template; the software tool package is used for being configured on the second device, so that the second device can call the service to be called through the software tool package.
11. A first device, comprising:
a memory for storing executable instructions;
a processor for implementing the method of generating a software toolkit according to any one of claims 1-9 when executing executable instructions stored in the memory.
12. A computer readable storage medium storing executable instructions which, when executed, are adapted to cause a processor to perform the method of generating a software toolkit according to any one of claims 1-9.
CN202210920707.9A 2022-08-02 2022-08-02 Method and device for generating software tool package and readable storage medium Pending CN116795351A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210920707.9A CN116795351A (en) 2022-08-02 2022-08-02 Method and device for generating software tool package and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210920707.9A CN116795351A (en) 2022-08-02 2022-08-02 Method and device for generating software tool package and readable storage medium

Publications (1)

Publication Number Publication Date
CN116795351A true CN116795351A (en) 2023-09-22

Family

ID=88048604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210920707.9A Pending CN116795351A (en) 2022-08-02 2022-08-02 Method and device for generating software tool package and readable storage medium

Country Status (1)

Country Link
CN (1) CN116795351A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435177A (en) * 2023-12-20 2024-01-23 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435177A (en) * 2023-12-20 2024-01-23 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium
CN117435177B (en) * 2023-12-20 2024-03-26 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
US9804837B2 (en) System and method for creating, managing, and reusing schema type definitions in services oriented architecture services, grouped in the form of libraries
US10379710B2 (en) Modeling system for graphic user interface
US7743391B2 (en) Flexible architecture component (FAC) for efficient data integration and information interchange using web services
US7174533B2 (en) Method, system, and program for translating a class schema in a source language to a target language
US11269694B2 (en) Automated API code generation
CN100520718C (en) Script order registration method, method and device for calling source program code
US9038017B2 (en) Method and system for facilitating rapid development of end-to-end software applications
EP1818813A1 (en) System and method and apparatus for using UML tools for defining web service bound component applications
US10666744B2 (en) Managing discovery and selection of service interface specifications
CN114254606A (en) Microservice framework model
CN102289774A (en) Graphical message processing and test system and method in financial transaction processing system
CN112667242A (en) Method and device for packaging C code into FMU
CN116795351A (en) Method and device for generating software tool package and readable storage medium
Irwin et al. Object oriented metrics: Precision tools and configurable visualisations
Liu et al. Engineering information service infrastructure for ubiquitous computing
Frey et al. MAMBA: A measurement architecture for model-based analysis
Kelly et al. A simplified approach to web service development
Sgouros OPeNDAP user guide, version 1.14
CN114115828A (en) Embedded component entity generation method and device
Noterman Discovering and Using Functions via Semantic Querying
Li Concern-Oriented and Model-Driven Migration of Legacy Java Applications to RESTful Web Services
Williams et al. Applications with treq and Klein
CN112799661A (en) API (application programming interface) arranging method and system based on map, electronic equipment and storage medium
US8578349B1 (en) System, method, and computer readable medium for integrating an original language application with a target language application
CN113791775A (en) Metadata flow arrangement method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination