CN115686475A - Standardized service SDK automatic generation method and related equipment thereof - Google Patents

Standardized service SDK automatic generation method and related equipment thereof Download PDF

Info

Publication number
CN115686475A
CN115686475A CN202211429884.3A CN202211429884A CN115686475A CN 115686475 A CN115686475 A CN 115686475A CN 202211429884 A CN202211429884 A CN 202211429884A CN 115686475 A CN115686475 A CN 115686475A
Authority
CN
China
Prior art keywords
preset
annotation
packaging
software development
generating
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
CN202211429884.3A
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202211429884.3A priority Critical patent/CN115686475A/en
Publication of CN115686475A publication Critical patent/CN115686475A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application belongs to the research and development field, is applied to the service SDK collaborative development field, relates to a standardized service SDK automatic generation method and related equipment thereof, and comprises the steps of obtaining annotation information in an API source code; screening out method annotation description, and generating unique marked data from the method annotation description; storing the description object in a preset database; packaging and displaying the description object to a preset development cooperative interface; and generating a corresponding code program according to the target description object, and uploading the code program to a preset position for a secondary developer to download and use. According to the method, development coordination management among multiple developers is realized through one intermediate object, namely the description object, multiple uploading and downloading operations of the program source code are avoided, the API document of the development coordination interface is always in the first version state, a service SDK automatic generation method with a unified standard is provided for different platforms, and the uniformity and the maintainability of the API document version are ensured.

Description

Standardized service SDK automatic generation method and related equipment thereof
Technical Field
The application relates to the technical field of service SDK collaborative development, in particular to an automatic standardized service SDK generation method and related equipment.
Background
Most of the existing client applications developed in a hybrid manner have a plurality of external service interfaces, for example, development of insurance-related services in a financial scenario, and due to the complexity of insurance risk types and business projects, a plurality of external service interfaces need to be developed, and the current development situation is that the client provides a large number of external methods, but the external service methods are not unified, and no comment indicates the role of the method, and in many cases, each time the client registers repeatedly, the client needs to issue the external service repeatedly, but many external methods are only known by several people, are transmitted by mouth, or maintain a common API document to perform external method maintenance.
If the API document is independent of the running code, no matter a mode of separating from the code such as Word, excel, direct webpage input and the like is adopted, the problems of numerous versions of the API document, difficulty in maintenance and release, inconsistency of document description and code function after code change and the like easily occur, and the problems of difficulty in maintenance and release easily occur to a butt party, a secondary developer and unfriendliness due to manual writing errors and low reliability easily occur.
Disclosure of Invention
The embodiment of the application aims to provide a standardized service SDK automatic generation method and related equipment thereof, so as to provide a service SDK automatic generation method with a unified standard for different platforms and ensure the uniformity and easy maintenance of API document versions.
In order to solve the above technical problem, an embodiment of the present application provides an automatic generation method for a standardized service SDK, which adopts the following technical solutions:
an automatic generation method of a standardized service SDK comprises the following steps:
acquiring annotation information in the API source code according to a preset annotation processor, wherein the annotation information refers to annotation texts written in advance for realizing automatic deployment of the API source code and generation of a software development toolkit;
screening out method annotation description in the API source code from the annotation information, and generating unique marked data from the method annotation description according to a preset transcoding rule;
storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database;
receiving a packaging instruction sent for generating a software development kit corresponding to a target service, and analyzing the packaging instruction to obtain an analysis result;
packaging the software development kit according to different preset packaging conditions and the analysis result, and displaying the software development kit to a preset development cooperative interface;
and based on a preset monitoring component, after monitoring an extraction instruction sent out for acquiring a software development kit corresponding to the target service in the development cooperative interface, generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use.
Further, the step of screening out the method annotation description in the API source code from the annotation information, and generating the method annotation description into uniquely marked data according to a preset transcoding rule specifically includes:
obtaining all the method annotation descriptions in the screened API source codes;
taking all the method annotation descriptions as an integral object, and carrying out serialization processing to obtain a serialization processing result;
and performing MD5 value processing on the serialization processing result as an input stream to obtain an MD5 value, taking the MD5 value as the data of the unique mark, and setting a unique identifier for the MD5 value as the description object.
Further, the step of storing the uniquely marked data and the description object corresponding to the uniquely marked data in a preset database specifically includes:
and taking the MD5 value as a hash value, taking the description object as a hash object matched with the hash value, and caching the description object in the preset database in pairs, wherein the description object can be spliced and named step by step according to a package name, a class name, a method name and a return value during development.
Further, after the step of caching the MD5 value as a hash value and the description object as a hash object matching the hash value into the preset database in pairs, the method further includes:
generating self-increment version number information corresponding to the MD5 value in the preset database;
and establishing an incidence relation for the MD5 value, the description object and the version number information, and respectively setting corresponding warehousing time stamps for the MD5 value, the description object and the version number information.
Further, the step of receiving the packaging instruction sent for generating the software development kit corresponding to the target service, analyzing the packaging instruction, and obtaining an analysis result specifically includes:
after the packaging instruction is received, analyzing the packaging instruction to acquire the packaging path.
Further, the step of packaging and displaying the software development kit to a preset development collaboration interface according to preset different packaging conditions and the analysis result specifically includes:
and displaying the self-increment version number information corresponding to the MD5 value to the development cooperative interface according to the packaging path and the different packaging conditions, wherein the different packaging conditions refer to different compression tools used in packaging.
Further, the step of generating the code program corresponding to the software development kit according to a preset code generator specifically includes:
predefining a general method protocol of the code generator;
acquiring a method call array corresponding to a target description object, wherein the method call array comprises the following steps: method name, call parameters, and return values;
analyzing the method calling array to obtain a method name, calling parameters and return values;
and taking the method name, the calling parameter and the return value as the parameters of the general method protocol, calling the code generator and generating a code program corresponding to the software development kit.
In order to solve the above technical problem, an embodiment of the present application further provides an automatic generation apparatus for a standardized service SDK, which adopts the following technical solutions:
an apparatus for automated generation of a standardized Service (SDK), comprising:
the system comprises an annotation information acquisition module, a data processing module and a data processing module, wherein the annotation information acquisition module is used for acquiring annotation information in an API source code according to a preset annotation processor, and the annotation information refers to an annotation text which is written in advance for realizing automatic deployment and generation of a software development toolkit of the API source code;
the method annotation transcoding module is used for screening out method annotation description in the API source code from the annotation information and generating the method annotation description into uniquely marked data according to a preset transcoding rule;
the intermediate object storage module is used for storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database;
the packaging instruction analysis module is used for receiving a packaging instruction sent for generating a software development kit corresponding to the target service, and analyzing the packaging instruction to obtain an analysis result;
the packaging processing module is used for packaging and displaying the software development toolkit to a preset development cooperative interface according to preset different packaging conditions and the analysis result;
and the service SDK generation module is used for monitoring an extraction instruction sent out for acquiring the software development kit corresponding to the target service in the development cooperative interface based on a preset monitoring component, then generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
a computer device comprising a memory and a processor, wherein the memory stores computer readable instructions, and the processor implements the steps of the standardized service SDK automatic generation method when executing the computer readable instructions.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
a computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the standardized service SDK automated generation method as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
according to the method for automatically generating the SDK of the standardized service, annotation information in an API source code is obtained according to a preset annotation processor, wherein the annotation information refers to annotation texts which are written in advance for realizing automatic deployment and generation of a software development kit of the API source code; screening out method annotation description in the API source code from the annotation information, and generating unique marked data from the method annotation description according to a preset transcoding rule; storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database; receiving a packaging instruction sent for generating a software development kit corresponding to a target service, and analyzing the packaging instruction to obtain an analysis result; packaging the software development kit according to different preset packaging conditions and the analysis result, and displaying the software development kit to a preset development cooperative interface; and based on a preset monitoring component, after monitoring an extraction instruction sent out for acquiring a software development kit corresponding to the target service in the development cooperative interface, generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use. According to the method and the device, development coordination management among multiple developers is realized through one intermediate object, namely the description object, multiple uploading and downloading operations of the program source code are avoided, so that secondary developers cannot operate the API document during development, and the uniformity and the maintainability of the API document version of the whole development platform are ensured.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a standardized service SDK automated generation method according to the present application;
FIG. 3 is a flow diagram of one embodiment of step 202 of FIG. 2;
FIG. 4 is a flowchart of one embodiment of step 206 shown in FIG. 2;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for automated generation of a standardized service SDK according to the present application;
FIG. 6 is a block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is the medium used to provide communication links between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that the method for automatically generating the SDK for the standardized service provided in the embodiment of the present application is generally executed by a server/terminal device, and accordingly, the apparatus for automatically generating the SDK for the standardized service is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
With continued reference to FIG. 2, a flow diagram of one embodiment of a standardized service SDK automated generation method according to the present application is shown. The standardized service SDK automatic generation method comprises the following steps:
step 201, obtaining the annotation information in the API source code according to the preset annotation processor.
In this embodiment, the annotation information refers to annotation text written in advance for implementing the API source code automated deployment and generating the software development kit.
In this embodiment, the software development kit may be understood as a source code program of a service, a developer may update a service program and update a patch by developing the source code program of the service twice, and a client may install and use the service program by downloading the source code program of the service.
In this embodiment, in the step of obtaining annotation information in the API source code according to the preset annotation processor, the preset annotation processor includes: a Tool for Processing the injection content in the JAVA source code, or/and a Grandle-supported translation Processing Tool (APT) source code processor.
In this embodiment, the Annotation processor uses a Tool for injecting contents in JAVA source code, or/and an Annotation Processing Tool (APT) source code processor supported by Gradle, which has the advantages of fully playing the characteristics of JAVA compiling language, and supporting Annotation compiling and Processing on the current main operating systems such as Windows, linux, android and IOS; the Gradle tool only needs to install versions above Java JDK 8.0, supports annotation compiling and processing on the current main operating systems such as Windows, linux, android and IOS, and ensures multi-operating system compatibility of the annotation processor.
Step 202, screening out the method annotation description in the API source code from the annotation information, and generating the method annotation description into uniquely marked data according to a preset transcoding rule.
In this embodiment, the step of screening out the method annotation description in the API source code from the annotation information, and generating the method annotation description into uniquely marked data according to a preset transcoding rule specifically includes: obtaining all the method annotation descriptions in the screened API source code; taking all the method annotation descriptions as an integral object, and carrying out serialization processing to obtain a serialization processing result; and performing MD5 value processing on the serialization processing result as an input stream to obtain an MD5 value, taking the MD5 value as the data of the unique mark, and setting a unique identifier for the MD5 value as the description object.
The method comprises the steps of transcoding all method annotation descriptions into an integral object, performing serialization processing on the integral object, and performing MD5 processing, so that the method annotation descriptions are integrated into the object, and method annotation acquisition is directly facilitated through the object.
With continued reference to FIG. 3, FIG. 3 is a flowchart of one embodiment of step 202 of FIG. 2, including:
step 301, obtaining all method annotation descriptions in the screened API source code;
in this embodiment, the specific implementation manner of obtaining all the method annotation descriptions in the screened API source code is as follows: and acquiring all method annotation descriptions in the API source code according to preset annotation explanatory symbols, wherein the annotation explanatory symbols are used in the API source code. For example, if the API source code uses the annotation specifier/. Star.. Then the annotation specifier/. Star.. Is used as one of the preset annotation specifiers.
Step 302, taking all the method annotation descriptions as an integral object, and performing serialization processing to obtain a serialization processing result;
in this embodiment, the specific implementation manner of performing serialization processing by using all the method annotation descriptions as an integral object and obtaining the serialization processing result is as follows: outputting all the acquired method annotation descriptions to a target file in a byte stream mode; setting a distinguishing spacer in the byte stream according to the difference of the corresponding method of each method annotation description, namely finishing serialization processing; and acquiring a one-dimensional sequence corresponding to the byte stream in the target file, namely acquiring a serialization processing result.
During serialization processing, according to different methods corresponding to the method annotation description, the distinguishing spacers are arranged in the byte stream, and the relative independence of each method annotation description in the whole object is guaranteed.
Step 303, performing MD5 value processing on the serialization processing result as an input stream to obtain an MD5 value, taking the MD5 value as the data of the unique mark, and setting a unique identifier for the MD5 value as the description object.
In this embodiment, the specific implementation manner of performing MD5 value processing on the serialization processing result as an input stream to obtain an MD5 value is as follows: and inputting the serialization processing result into an MD5 value generator in the form of an input stream, and generating an MD5 value corresponding to the serialization processing result by taking the serialization processing result as data to be processed, namely, the method annotation describes the corresponding unique mark data.
By means of the mode of MD5 value generation, uniqueness of the corresponding marking data described by the method annotation is guaranteed.
Step 203, storing the uniquely marked data and the description object corresponding to the uniquely marked data in a preset database.
In this embodiment, the step of storing the uniquely marked data and the description object corresponding to the uniquely marked data in a preset database specifically includes: and taking the MD5 value as a hash value, taking the description object as a hash object matched with the hash value, and caching the description object in the preset database in pairs, wherein the description object can be spliced and named step by step according to a package name, a class name, a method name and a return value during development.
In this embodiment, the description objects corresponding to the MD5 values are spliced and named step by step according to the package name, the class name, the method name, and the return value during development, and substantially, the development path and the corresponding return value of the source program are directly used as the description objects, and the method annotation description is not exposed, but only the program call path and the corresponding return value are exposed, so that a service program is directly obtained through the call path and the corresponding return value when a developer performs update and a client performs download installation at a later stage, and the method description annotation does not need to be paid attention to.
In this embodiment, after the step of caching the MD5 value as a hash value and the description object as a hash object matching the hash value in the preset database in pair, the method further includes: generating self-increment version number information corresponding to the MD5 value in the preset database; and establishing an incidence relation for the MD5 value, the description object and the version number information, and respectively setting corresponding warehousing timestamps for the MD5 value, the description object and the version number information.
In this embodiment, the generation manner of the self-increment version number information specifically includes: by adopting an accumulation mode, after every time a second developer updates the version and uploads the API source code again, the steps 201 to 203 are repeatedly executed to perform version number accumulation updating, for example, if the version number corresponding to the API source code before the second development is 2.0.0, the version number corresponding to the API source code after the second development may be updated in a form of last digital accumulation 1, and the version number 2.0.0 is updated to 2.0.1.
By setting the warehousing timestamp and the self-increment version number information, a secondary developer can directly obtain the latest API source code conveniently during program updating and development, and each latest developer can obtain the latest API source code when multiple developers develop the same API source code simultaneously, so that online development management is facilitated.
And 204, receiving a packaging instruction sent for generating a software development kit corresponding to the target service, and analyzing the packaging instruction to obtain an analysis result.
In this embodiment, the step of receiving the packaging instruction issued for generating the software development kit corresponding to the target service, analyzing the packaging instruction, and obtaining an analysis result specifically includes: and after receiving the packing instruction, analyzing the packing instruction to acquire the packing path.
And 205, packaging the software development kit according to different preset packaging conditions and the analysis result, and displaying the packaged software development kit to a preset development cooperative interface.
In this embodiment, the step of packaging and displaying the software development kit to a preset development collaboration interface according to preset different packaging conditions and the analysis result specifically includes: and displaying the self-increment version number information corresponding to the MD5 value to the development cooperative interface according to the packaging path and the different packaging conditions, wherein the different packaging conditions refer to different compression tools used in packaging.
And the service SDK corresponding to the latest API source code is released to a preset development cooperative interface in a self-increment version number information mode through the packaging path, so that when multiple developers develop the same API source code at the same time, each latest developer can obtain the latest service program version, and online development management is facilitated.
In this embodiment, the different compression tools used in the packing are actually packing compression tools used for different compiling languages, such as a jar packing tool used for packing Java language, a webpack packing tool used for packing JS and RN languages, and the like, and the purpose is to generate a program development kit adapted to multiple development languages in a development collaboration interface, so that secondary development of a program is facilitated by coordinating multiple compiling languages, and compiling limitation caused by development of a single compiling language is avoided.
And step 206, after monitoring an extraction instruction sent out for acquiring the software development kit corresponding to the target service in the development cooperative interface based on a preset monitoring component, generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download.
In this embodiment, the step of generating the code program corresponding to the software development kit according to the preset code generator specifically includes: predefining a general method protocol of the code generator; obtaining a method call array corresponding to a target description object, wherein the method call array comprises: method name, call parameters, and return values; analyzing the method calling array to obtain a method name, calling parameters and return values; and taking the method name, the calling parameter and the return value as the parameters of the universal method protocol, calling the code generator and generating a code program corresponding to the software development kit.
And generating a code program corresponding to the software development kit through a general method protocol of the code generator and a method calling array corresponding to the target description object, so that a secondary developer does not need to blindly integrally download all source program codes when developing, and only needs to acquire the description object corresponding to the method of the part to be updated according to development updating requirements, and the latest source code program of the part to be updated can be generated, and the source code downloading amount of the developer is reduced to a certain extent.
With continued reference to FIG. 4, FIG. 4 is a flowchart of one embodiment of step 206 of FIG. 2, including:
step 401, predefining a general method protocol of the code generator;
step 402, obtaining a method call array corresponding to a target description object, wherein the method call array comprises: method name, call parameters, and return values;
step 403, analyzing the method calling array to obtain a method name, calling parameters and return values;
and step 404, taking the method name, the calling parameter and the return value as the parameters of the universal method protocol, calling the code generator, and generating a code program corresponding to the software development kit.
According to the method, annotation information in the API source code is obtained according to a preset annotation processor, wherein the annotation information refers to annotation texts which are written in advance for realizing automatic deployment of the API source code and generation of a software development kit; screening out method annotation description in the API source code from the annotation information, and generating unique marked data from the method annotation description according to a preset transcoding rule; storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database; receiving a packaging instruction sent for generating a software development kit corresponding to a target service, and analyzing the packaging instruction to obtain an analysis result; packaging and displaying the software development kit to a preset development cooperative interface, and packaging and displaying the description object to the preset development cooperative interface; and based on a preset monitoring component, after monitoring an extraction instruction sent out for acquiring a software development kit corresponding to the target service in the development cooperative interface, generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use. According to the method and the device, development coordination management among multiple developers is realized through one intermediate object, namely the description object, multiple uploading and downloading operations of the program source code are avoided, so that secondary developers cannot operate the API document during development, and the uniformity and the maintainability of the API document version of the whole development platform are ensured.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
In the embodiment of the application, the standardized service SDK automatic generation method in the implementation can be managed by using an intelligent managed model, and when the service SDK program is updated, the intelligent managed model is automatically used for describing object updating and service SDK version number updating, so that the workload during manual updating is reduced, and the method is more intelligent and automatic.
With further reference to fig. 5, as an implementation of the method shown in fig. 2, the present application provides an embodiment of an apparatus for automatically generating a standardized service SDK, where the apparatus embodiment corresponds to the method embodiment shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the automatic generation apparatus 500 for standardized service SDK according to the present embodiment includes: the system comprises an annotation information acquisition module 501, a method annotation transcoding module 502, an intermediate object storage module 503, a packaging instruction parsing module 504, a packaging processing module 505 and a service SDK generation module 506.
Wherein:
an annotation information obtaining module 501, configured to obtain annotation information in an API source code according to a preset annotation processor, where the annotation information refers to an annotation text written in advance for implementing automatic deployment of the API source code and generating a software development kit;
the method annotation transcoding module 502 is configured to screen out the method annotation description in the API source code from the annotation information, and generate the method annotation description into uniquely marked data according to a preset transcoding rule;
an intermediate object storage module 503, configured to store the uniquely marked data and the description object corresponding to the uniquely marked data in a preset database;
a packaging instruction parsing module 504, configured to receive a packaging instruction sent to generate a software development kit corresponding to a target service, parse the packaging instruction, and obtain a parsing result;
a packaging processing module 505, configured to package and display the software development kit to a preset development collaboration interface according to preset different packaging conditions and the analysis result;
and the service SDK generation module 506 is configured to, based on a preset monitoring component, after monitoring that an extraction instruction is sent out in the development collaboration interface to obtain the software development kit corresponding to the target service, generate a code program corresponding to the software development kit according to a preset code generator, and upload the code program to a preset position for a secondary developer to download and use.
According to the method, annotation information in the API source code is obtained according to a preset annotation processor, wherein the annotation information refers to annotation texts which are written in advance for realizing automatic deployment of the API source code and generation of a software development kit; screening out method annotation description in the API source code from the annotation information, and generating unique marked data from the method annotation description according to a preset transcoding rule; storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database; receiving a packaging instruction sent for generating a software development kit corresponding to a target service, and analyzing the packaging instruction to obtain an analysis result; packaging the software development kit according to different preset packaging conditions and the analysis result, and displaying the software development kit to a preset development cooperative interface; and based on a preset monitoring component, after monitoring an extraction instruction sent out for acquiring a software development kit corresponding to the target service in the development cooperative interface, generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use. According to the method and the device, development coordination management among multiple developers is realized through one intermediate object, namely the description object, multiple uploading and downloading operations of the program source code are avoided, so that a secondary developer cannot operate the API document during development, and the uniformity and the maintainability of the API document version of the whole development platform are ensured.
Those skilled in the art will appreciate that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the programs can include the processes of the embodiments of the methods described above. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 6 in detail, fig. 6 is a block diagram of a basic structure of a computer device according to the embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only the computer device 6 having the components 61-63 is shown in the figure, but it is understood that not all of the shown components are required to be implemented, and that more or less components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user in a keyboard mode, a mouse mode, a remote controller mode, a touch panel mode or a voice control equipment mode.
The memory 61 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system and various application software installed on the computer device 6, such as computer readable instructions of the standardized service SDK automatic generation method. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute computer readable instructions stored in the memory 61 or process data, for example, execute computer readable instructions of the standardized service SDK automatic generation method.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The embodiment provides computer equipment, and belongs to the technical field of service SDK collaborative development. According to the method, annotation information in the API source code is obtained according to a preset annotation processor, wherein the annotation information refers to annotation texts which are written in advance for realizing automatic deployment of the API source code and generation of a software development kit; screening out the method annotation description in the API source code from the annotation information, and generating the method annotation description into uniquely marked data according to a preset transcoding rule; storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database; receiving a packaging instruction sent for generating a software development kit corresponding to a target service, and analyzing the packaging instruction to obtain an analysis result; packaging the software development kit according to different preset packaging conditions and the analysis result, and displaying the software development kit to a preset development cooperative interface; and based on a preset monitoring component, after monitoring an extraction instruction sent out for acquiring a software development kit corresponding to the target service in the development cooperative interface, generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use. The development coordination management among multiple developers is realized through one intermediate object, namely the description object, multiple uploading and downloading operations of the program source code are avoided, so that secondary developers cannot operate the API document during development, and the uniformity and the maintainability of the API document version of the whole development platform are ensured
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by a processor to cause the processor to perform the steps of the standardized service SDK automated generation method as described above.
The embodiment provides a computer-readable storage medium, and belongs to the technical field of service SDK collaborative development. According to the method, annotation information in the API source code is obtained according to a preset annotation processor, wherein the annotation information refers to annotation texts which are written in advance for realizing automatic deployment of the API source code and generation of a software development kit; screening out the method annotation description in the API source code from the annotation information, and generating the method annotation description into uniquely marked data according to a preset transcoding rule; storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database; receiving a packaging instruction sent for generating a software development kit corresponding to a target service, and analyzing the packaging instruction to obtain an analysis result; packaging the software development kit according to different preset packaging conditions and the analysis result, and displaying the software development kit to a preset development cooperative interface; and based on a preset monitoring component, after monitoring an extraction instruction sent out for acquiring a software development kit corresponding to the target service in the development cooperative interface, generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use. According to the method and the device, development coordination management among multiple developers is realized through one intermediate object, namely the description object, multiple uploading and downloading operations of the program source code are avoided, so that a secondary developer cannot operate the API document during development, and the uniformity and the maintainability of the API document version of the whole development platform are ensured.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It should be understood that the above-described embodiments are merely exemplary of some, and not all, embodiments of the present application, and that the drawings illustrate preferred embodiments of the present application without limiting the scope of the claims appended hereto. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that modifications can be made to the embodiments described in the foregoing detailed description, or equivalents can be substituted for some of the features described therein. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. An automatic generation method of a standardized service SDK is characterized by comprising the following steps:
acquiring annotation information in an AP I source code according to a preset annotation processor, wherein the annotation information refers to an annotation text which is written in advance for realizing automatic deployment and generation of a software development kit of the AP I source code;
screening out the method annotation description in the AP I source code from the annotation information, and generating the method annotation description into uniquely marked data according to a preset transcoding rule;
storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database;
receiving a packaging instruction sent for generating a software development kit corresponding to a target service, and analyzing the packaging instruction to obtain an analysis result;
packaging the software development kit according to different preset packaging conditions and the analysis result, and displaying the software development kit to a preset development cooperative interface;
and based on a preset monitoring component, after monitoring an extraction instruction sent out for acquiring a software development kit corresponding to the target service in the development cooperative interface, generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use.
2. The method for automatically generating a standardized service SDK according to claim 1, wherein the step of screening out a method annotation description in the AP I source code from the annotation information, and generating a uniquely tagged data from the method annotation description according to a preset transcoding rule specifically includes:
obtaining all the method annotation descriptions in the screened AP I source code;
taking all the method annotation descriptions as an integral object, and carrying out serialization processing to obtain a serialization processing result;
and performing MD5 value processing on the serialization processing result as an input stream to obtain an MD5 value, taking the MD5 value as the data of the unique mark, and setting a unique identifier for the MD5 value as the description object.
3. The method for automatically generating a standardized service SDK according to claim 2, wherein the step of storing the uniquely marked data and the description object corresponding to the uniquely marked data in a preset database specifically includes:
and taking the MD5 value as a hash value, taking the description object as a hash object matched with the hash value, and caching the description object in the preset database in pairs, wherein the description object can be spliced and named step by step according to a package name, a class name, a method name and a return value during development.
4. The method for automatically generating a standardized service SDK according to claim 3, wherein after the step of pairwise caching the MD5 value as a hash value and the description object as a hash object matching the hash value into the preset database, the method further comprises:
generating self-increment version number information corresponding to the MD5 value in the preset database;
and establishing an incidence relation for the MD5 value, the description object and the version number information, and respectively setting corresponding warehousing timestamps for the MD5 value, the description object and the version number information.
5. The method according to claim 4, wherein the step of receiving the packaging instruction issued for generating the software development kit corresponding to the target service, analyzing the packaging instruction, and obtaining the analysis result includes:
after the packaging instruction is received, analyzing the packaging instruction to acquire the packaging path.
6. The method for automatically generating a standardized service SDK according to claim 5, wherein the step of packaging and displaying the software development kit to a preset development collaboration interface according to preset different packaging conditions and the analysis result specifically includes:
and displaying the self-increment version number information corresponding to the MD5 value to the development cooperative interface according to the packaging path and the different packaging conditions, wherein the different packaging conditions refer to different compression tools used in packaging.
7. The method for automatically generating a standardized service SDK according to any one of claims 1 to 6, wherein the step of generating a code program corresponding to the software development kit according to a preset code generator specifically includes:
predefining a general method protocol of the code generator;
obtaining a method call array corresponding to a target description object, wherein the method call array comprises: method name, call parameters, and return values;
analyzing the method calling array to obtain a method name, calling parameters and return values;
and taking the method name, the calling parameter and the return value as the parameters of the universal method protocol, calling the code generator and generating a code program corresponding to the software development kit.
8. An apparatus for automated generation of standardized service SDK, comprising:
the system comprises an annotation information acquisition module, a data processing module and a data processing module, wherein the annotation information acquisition module is used for acquiring annotation information in the AP I source code according to a preset annotation processor, and the annotation information refers to an annotation text which is written in advance for realizing automatic deployment and generation of a software development kit of the AP I source code;
the method annotation transcoding module is used for screening out method annotation description in the AP I source code from the annotation information and generating the method annotation description into uniquely marked data according to a preset transcoding rule;
the intermediate object storage module is used for storing the uniquely marked data and the description object corresponding to the uniquely marked data into a preset database;
the packaging instruction analysis module is used for receiving a packaging instruction sent for generating a software development kit corresponding to the target service, analyzing the packaging instruction and obtaining an analysis result;
the packaging processing module is used for packaging and displaying the software development kit to a preset development cooperative interface according to preset different packaging conditions and the analysis result;
and the service SDK generation module is used for monitoring an extraction instruction sent out for acquiring the software development kit corresponding to the target service in the development cooperative interface based on a preset monitoring component, then generating a code program corresponding to the software development kit according to a preset code generator, and uploading the code program to a preset position for a secondary developer to download and use.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the standardized service SDK automated generation method of any one of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon computer-readable instructions which, when executed by a processor, carry out the steps of the method for the automated generation of standardized services SDK as defined in any one of claims 1 to 7.
CN202211429884.3A 2022-11-15 2022-11-15 Standardized service SDK automatic generation method and related equipment thereof Pending CN115686475A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211429884.3A CN115686475A (en) 2022-11-15 2022-11-15 Standardized service SDK automatic generation method and related equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211429884.3A CN115686475A (en) 2022-11-15 2022-11-15 Standardized service SDK automatic generation method and related equipment thereof

Publications (1)

Publication Number Publication Date
CN115686475A true CN115686475A (en) 2023-02-03

Family

ID=85051896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211429884.3A Pending CN115686475A (en) 2022-11-15 2022-11-15 Standardized service SDK automatic generation method and related equipment thereof

Country Status (1)

Country Link
CN (1) CN115686475A (en)

Similar Documents

Publication Publication Date Title
EP3399721B1 (en) Interface data displaying method and device
CN112015430A (en) JavaScript code translation method and device, computer equipment and storage medium
CN111176629A (en) Application development method and device
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN115098186A (en) Project processing method and device, computer equipment and storage medium
CN112346976A (en) Interface document generation method, device and system based on webpage and computer equipment
US9361086B1 (en) Collating and intelligently sequencing installation documentation
CN113434175A (en) Data processing method, device, storage medium and equipment
CN111552463A (en) Page jump method and device, computer equipment and storage medium
CN113157523B (en) Service monitoring method and device, computer equipment and storage medium
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN112835568A (en) Project construction method and device
CN116432624A (en) Micro-service API document generation method, device, equipment and storage medium
CN114626352B (en) Report automatic generation method, device, computer equipment and storage medium
CN115712422A (en) Form page generation method and device, computer equipment and storage medium
CN110765610B (en) PDM integration method, PDM integration device, computer equipment and storage medium
CN115686475A (en) Standardized service SDK automatic generation method and related equipment thereof
CN114090066A (en) User interface card view generation method and device, computer equipment and medium
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN113239670A (en) Method and device for uploading service template, computer equipment and storage medium
CN114115855A (en) Code multiplexing method and device, computer readable storage medium and electronic equipment
CN110196803B (en) Software defect training method and system
CN116108814B (en) Gantt chart processing method and device, computer equipment and storage medium
CN115756640A (en) Method for automatically generating job scheduling configuration and related equipment thereof
CN117290019A (en) Interface calling method and device, computer equipment and storage medium

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