WO2022002030A1 - Data processing method, apparatus, and device, and computer readable storage medium - Google Patents

Data processing method, apparatus, and device, and computer readable storage medium Download PDF

Info

Publication number
WO2022002030A1
WO2022002030A1 PCT/CN2021/103024 CN2021103024W WO2022002030A1 WO 2022002030 A1 WO2022002030 A1 WO 2022002030A1 CN 2021103024 W CN2021103024 W CN 2021103024W WO 2022002030 A1 WO2022002030 A1 WO 2022002030A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
information
annotation
class
attribute
Prior art date
Application number
PCT/CN2021/103024
Other languages
French (fr)
Chinese (zh)
Inventor
李东卫
杨洋
朱孝瑾
都业广
冯硕
Original Assignee
北京沃东天骏信息技术有限公司
北京京东世纪贸易有限公司
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 北京沃东天骏信息技术有限公司, 北京京东世纪贸易有限公司 filed Critical 北京沃东天骏信息技术有限公司
Publication of WO2022002030A1 publication Critical patent/WO2022002030A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Definitions

  • the present application relates to the field of computer technology, and in particular, to a data processing method, apparatus, device, and computer-readable storage medium
  • front-end developers need to obtain back-end data through interface programs written by back-end developers, and the front-end and back-end connections have been completed.
  • back-end developers usually manually record the interface information into the interface document to describe the back-end interface to a certain extent.
  • Front-end developers can view the json format of the data returned by the interface in the interface document, and customize the data model to parse the returned data and put it into use. In the process of use, the interface document needs to be referred to.
  • the back-end developers need to manually modify the interface documents, and notify all front-end involved personnel to modify the corresponding data model. Due to the heavy tasks of the back-end developers, the update of the interface documents is often not timely, and it is easy to be missed. In this case, the front-end cannot accurately obtain the back-end data, which leads to exceptions such as inaccessibility of the front-end page and incorrect data returned.
  • the embodiments of the present application provide a data processing method, apparatus, device, and computer-readable storage medium, which are used to solve the problem that in the prior art, the front-end cannot accurately obtain background data due to the untimely update of interface documents and easy omissions. , resulting in abnormal problems such as inaccessibility of the front-end page and return of data errors.
  • an embodiment of the present application provides a data processing method, including:
  • the interface annotation information in the program code is parsed to obtain the interface information
  • a data model file is automatically generated according to the interface information.
  • the method further includes:
  • the data model file is automatically submitted to the preset code repository.
  • the data model file is automatically generated according to the interface information, including:
  • a data model file of the target interface is automatically generated, and the data model file corresponds to the designated operating system type.
  • the method before the data model file of the target interface is automatically generated according to the interface information, the target interface identifier and the specified operating system type, the method further includes:
  • the target interface identifier and the specified operating system type sent by the front-end are received, and the specified operating system type is input by the user through the front-end page.
  • the method further includes:
  • the method before submitting the data model file of the target interface to the specified code repository, the method further includes:
  • the address information of the designated code warehouse sent by the front-end is received, where the address information of the designated code warehouse is input by the user through the front-end page.
  • the interface annotation information in the program code is parsed, and after the interface information is obtained, the method further includes:
  • An interface document is generated according to the interface information.
  • the interface annotation information in the program code is parsed, and after the interface information is obtained, it also includes:
  • the interface information is sent to the front end to display the interface information through the front end page.
  • the interface annotation information includes an entry parameter annotation and an exit parameter annotation of the interface;
  • the interface annotation information in the parsing program code is obtained to obtain the interface information, including:
  • the class is a Controller class, scan whether each method in the class contains an entry parameter annotation, and if at least one method of the class contains an entry parameter annotation, annotate the entry parameter of the at least one method
  • the information is saved into the first MAP set.
  • the entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is the interface name, and the value of the second attribute is description information of each entry parameter of the interface;
  • the exit parameter The annotation includes a third attribute and a fourth attribute, the value of the third attribute is the interface name, and the value of the fourth attribute is the description information of each exit parameter, wherein the number of the fourth attribute in the annotation of the exit parameter of the interface is related to the exit of the interface The number of parameters is the same.
  • the information of the entry parameter annotation of the at least one method is stored in the first MAP set, including:
  • At least one method in the class contains an entry parameter annotation
  • the value of the first attribute of the entry parameter annotation of each method is used as the key
  • the value of the second attribute of the entry parameter annotation of the method is used as value.
  • the information of the exit parameter annotation on all member variables in the class is stored in the first MAP set, including:
  • the field name of any member variable in the class is used as the key, and the value of the fourth attribute of the exit parameter annotation corresponding to the member variable is used as the value to form the member variable
  • the key-value pairs, the key-value pairs corresponding to all member variables in the class constitute a second MAP set; the value of the third attribute of the exit parameter annotation is used as the key, and the second MAP set is used as the value, Save to the first MAP set.
  • the method further includes:
  • the information of the exit parameter annotation of the defined class corresponding to the member variable of the preset data type is stored in the first MAP set in a recursive manner, and the The first MAP set contains nested model information.
  • the method further includes:
  • the interface information includes nested model information
  • a recursive manner is used to generate a data model file including the nested model according to the interface information.
  • an embodiment of the present application provides a data processing apparatus, including:
  • the annotation parsing module is used to parse the interface annotation information in the program code during the compilation process to obtain the interface information
  • An information processing module configured to automatically generate a data model file according to the interface information.
  • the device further includes:
  • the sending module is used for automatically submitting the data model file to the preset code warehouse.
  • the information processing module is also used for:
  • a data model file of the target interface is automatically generated, and the data model file corresponds to the designated operating system type.
  • the device further includes:
  • the receiving module is configured to receive the target interface identifier and the specified operating system type sent by the front-end, where the specified operating system type is input by the user through the front-end page.
  • the sending module is also used for:
  • the receiving module is also used for:
  • the address information of the designated code warehouse sent by the front-end is received, where the address information of the designated code warehouse is input by the user through the front-end page.
  • the information processing module is also used for:
  • An interface document is generated according to the interface information.
  • the sending module is also used for:
  • the interface information is sent to the front end to display the interface information through the front end page.
  • the interface annotation information includes an entry parameter annotation and an exit parameter annotation of the interface; the annotation parsing module is further used to:
  • each class in the program code if any class contains an exit parameter annotation, save the information of the exit parameter annotation on all member variables in the class into the first MAP set; if the class is a control Controller class, scan whether each method in the class contains entry parameter annotations, if at least one method of the class contains entry parameter annotations, save the entry parameter annotation information of the at least one method to the first MAP in the collection.
  • the entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is the interface name, and the value of the second attribute is description information of each entry parameter of the interface;
  • the exit parameter The annotation includes a third attribute and a fourth attribute, the value of the third attribute is the interface name, and the value of the fourth attribute is the description information of each exit parameter, wherein the number of the fourth attribute in the annotation of the exit parameter of the interface is related to the exit of the interface The number of parameters is the same.
  • annotation parsing module is also used to:
  • At least one method in the class contains an entry parameter annotation
  • the value of the first attribute of the entry parameter annotation of each method is used as the key
  • the value of the second attribute of the entry parameter annotation of the method is used as value.
  • annotation parsing module is also used to:
  • the class contains an exit parameter annotation
  • the field name of any member variable in the class is used as the key
  • the value of the fourth attribute of the exit parameter annotation corresponding to the member variable is used as the value to form the member variable
  • the key-value pairs corresponding to all member variables in the class form a second MAP set; the value of the third attribute of the exit parameter annotation is used as the key, and the second MAP set is used as the value, Save to the first MAP set.
  • annotation parsing module is also used to:
  • the information of the exit parameter annotation of the defined class corresponding to the member variable of the preset data type is stored in the first MAP set in a recursive manner, and the The first MAP set contains nested model information.
  • the information processing module is also used for:
  • the interface information includes nested model information
  • a recursive manner is used to generate a data model file including the nested model according to the interface information.
  • an embodiment of the present application provides a data processing device, including:
  • processor a memory
  • computer program stored on the memory and executable on the processor
  • an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data transmission method described above is implemented.
  • the data processing method, device, device, and computer-readable storage medium provided by the embodiments of the present application have the following advantages or beneficial effects: by parsing the interface annotation information in the program code during the compilation process, the interface information is obtained; according to the interface The information automatically generates data model files, which realizes the automatic generation of interface information and data model files. When the interface changes, recompilation can complete the automatic update of interface information and data model files in time, which improves the efficiency and overcomes the
  • the interface documents are not updated in a timely manner and are prone to omissions, resulting in the inability of the front-end to obtain the back-end data accurately, resulting in abnormal technical problems such as inaccessibility of the front-end pages and errors in the returned data.
  • FIG. 1 is a schematic diagram of a software development platform system architecture provided by an embodiment of the present application.
  • Embodiment 3 is a flowchart of a data processing method provided in Embodiment 2 of the present application.
  • FIG. 4 is a schematic diagram of an entry parameter annotation provided in Embodiment 2 of the present application.
  • FIG. 5 is a schematic diagram of an annotation of an exit parameter provided in Embodiment 2 of the present application.
  • FIG. 6 is a schematic diagram of the overall flow of parsing annotations provided by Embodiment 2 of the present application.
  • FIG. 7 is a schematic diagram of an interface information display interface provided by Embodiment 2 of the present application.
  • FIG. 8 is a schematic structural diagram of a data processing apparatus provided in Embodiment 3 of the present application.
  • FIG. 9 is a schematic structural diagram of a data processing apparatus provided in Embodiment 4 of the present application.
  • FIG. 10 is a schematic structural diagram of a data processing device according to Embodiment 5 of the present application.
  • JSON format JSON is a lightweight data exchange format.
  • vo(value object) It is a business object in java and lives in the business layer.
  • git is an open source distributed version control system for agile and efficient handling of large or small projects.
  • java annotation also known as java annotation, is an annotation mechanism introduced by jdk5.0.
  • Bootstrap It is a front-end framework launched by Twitter. It is flexible and makes web development faster.
  • Shell script is a program written in C language, it is a bridge for users to use Linux, it accepts user commands, and then invokes the corresponding application.
  • the system architecture includes a data acquisition module, a client model module, an interface document display module, and a client code repository.
  • the data acquisition module is located on the server side of the system.
  • the back-end developers add custom interface annotations to the request method and the returned data VO class.
  • the back-end automatically parses the interface annotations to obtain the interface. information, and save the interface information to realize the collection function of the data information required by the interface document.
  • the interface document display module means that the interface information obtained by the back-end is displayed through the front-end display interface, and also provides an interactive interface with the front-end user, so that the user can submit information to the back-end through the front-end interface.
  • the client model module is located on the server side of the system, and is used to automatically generate the data model file required by the client user according to the interface information, which can be the model file required by iOS and Android.
  • the user may select an interface to generate the data model file through the front-end interface, input the name of the data model file to be generated, input the address information of the code repository to which the generated data model file is submitted, and so on.
  • the client code base provides the function of automatically submitting the generated data model files to the git code repository, which is convenient for front-end clerks to use directly.
  • the data processing method provided by the embodiment of the present application can automatically parse the interface annotation information in the code to obtain the interface information during the compilation process, automatically generate the data model file, and automatically submit the data model file to the code warehouse.
  • the end developer only needs to modify the annotation of the interface, and the interface information will be automatically updated, the data model file will be regenerated, and automatically updated to the code warehouse during compilation, which reduces the communication cost of front-end and back-end personnel, improves efficiency, and overcomes the
  • the interface documents are not updated in a timely manner, and are prone to omissions, resulting in the inability of the front-end to obtain the back-end data accurately, resulting in abnormal technical problems such as inaccessibility of the front-end pages and errors in the returned data.
  • FIG. 2 is a flowchart of the data processing method provided in Embodiment 1 of the present application.
  • the method in this embodiment is applied to the server device in the background of the software development platform. As shown in Figure 2, the specific steps of the method are as follows:
  • Step S101 in the compiling process, parse the interface annotation information in the program code to obtain interface information.
  • the interface annotation information includes an entry parameter annotation and an exit parameter annotation.
  • the back-end developer adds custom annotations to the request method and the returned data VO in the coding phase to complete the writing of the interface annotation information.
  • the server device can automatically parse the interface annotation information in the program code to obtain the interface information required in the interface document.
  • the interface information includes at least ingress parameter information and egress parameter information
  • the ingress parameter information includes at least an interface name and description information of the ingress parameter
  • the egress parameter information at least includes interface name and description information of egress parameters.
  • Step S102 a data model file is automatically generated according to the interface information.
  • a data model file is generated by calling a shell script according to the interface information.
  • the operating system types usually include IOS and Android.
  • the server device can call different shell scripts to generate data model files applied to different operating system types.
  • a shell script suitable for IOS is invoked to generate a data model file suitable for IOS.
  • a shell script suitable for Android is invoked to generate a data model file suitable for Android.
  • the shell script suitable for IOS and the shell script suitable for Android can be respectively called to generate data model files suitable for IOS and Android respectively.
  • the embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file.
  • Recompilation can complete the automatic update of interface information and data model files in a timely manner, which improves efficiency, and overcomes the fact that the interface documents are not updated in time and are prone to omissions, resulting in the front-end unable to accurately obtain background data, thus Causes abnormal technical problems such as inaccessibility of front-end pages and returned data errors.
  • FIG. 3 is a flowchart of the data processing method provided in Embodiment 2 of the present application.
  • the data model file is automatically generated according to the interface information, including: according to the interface information, the target interface identifier and the specified operating system type, the data model file of the target interface is automatically generated, the data model file Corresponds to the specified operating system type.
  • the method further includes: automatically submitting the data model file to the preset code warehouse. As shown in Figure 3, the specific steps of the method are as follows:
  • Step S201 in the compiling process, parse the interface annotation information in the program code to obtain interface information.
  • the interface annotation information includes an entry parameter annotation and an exit parameter annotation of the interface.
  • the entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is the interface name, and the value of the second attribute is description information of each entry parameter of the interface.
  • the entry parameter annotation can be represented by "DocReqValue"
  • the first attribute of the entry parameter annotation can be represented by name
  • the value of the first property can be represented by the interface name
  • the second property can be represented by value
  • the value of the second property includes each
  • the description information of the entry parameters the description information of different parameters is separated by a semicolon, and the order of the description information is the same as that of the entry parameters.
  • this embodiment does not specifically limit the identifiers used for the entry parameter annotation and the first attribute and the second attribute.
  • the entry parameter annotation "@DocReqValue” is added to the request function getShopList
  • the value of the first attribute name is The interface name is "obtaining the watch list interface”
  • the value of the second attribute value includes the description information of the pin and uuid separated by semicolons
  • the description information of the entry parameter pin is "automatically obtained by the gateway after login”
  • the description information of the entry parameter uuid It is "must be passed (Note: the unique code of the machine - android is uuid, ios is openudid)".
  • the egress parameter annotation includes a third attribute and a fourth attribute
  • the value of the third attribute is the interface name
  • the value of the fourth attribute is the description information of each egress parameter
  • the value of the fourth attribute in the egress parameter annotation of the interface is The number is the same as the number of egress parameters for this interface.
  • DocValue can be used to indicate the exit parameter annotation
  • the third attribute of the exit parameter annotation can be expressed as name
  • the value of the third attribute can be expressed as the interface name
  • the fourth attribute can be expressed as key
  • the value of the fourth attribute includes the exit Description of the parameter.
  • each exit parameter can correspond to a key.
  • this embodiment does not specifically limit the identifiers used for the exit parameter annotation and the third attribute and the fourth attribute.
  • the export parameter annotation "@DocValue” is added to the data VO class ShopResponseVO
  • the value of the third attribute name is the interface name "obtaining the watch list interface”
  • the fourth attribute is annotated on “haveFollowed” and "shopNum” respectively, and the values of the corresponding fourth attribute key are "false: not all followed true: all followed", "the number of followed shops” and "the total number of shops in the pot” eye”.
  • the interface name in the exit parameter annotation of a data VO class should be the same as the interface name in the entry parameter annotation of the request method corresponding to the data VO class, that is, the first attribute name of the exit parameter annotation of the data VO class is the same as the name of the interface.
  • the third attribute name of the entry parameter annotation of the request method corresponding to the data VO class is the same.
  • Step S1 scan the custom annotation.
  • the custom scanning class is used to scan which positions in the code are added with custom annotations.
  • Step S2 adding custom annotations to the sping container.
  • the annotation class is added to the spring container to prepare for the subsequent parsing of the annotation.
  • Step S3 the bean post-processing method parses the annotation.
  • the annotations are resolved in the bean post-processing method.
  • Step S4 save the interface information.
  • the interface information required by the interface document can be obtained by parsing the annotation through the bean post-processing method, and the interface information can be saved.
  • the process of parsing annotations by the bean post-processing method in the above step 3 can be specifically implemented through the processing of the following steps S2011-S2013:
  • Step S2011 scan each class in the program code, and perform the following processing on the currently scanned class:
  • Step S2012 judging whether the class contains the export parameter annotation.
  • step S2013 is executed to parse the exit parameter annotation in the class to obtain corresponding exit parameter information.
  • step S2014 is executed to continue parsing the entry parameter annotation in the class to obtain entry parameter information in the class.
  • the exit parameter annotation "@DocValue" is added to the data VO class ShopResponseVO, and it can be determined that the data VO class ShopResponseVO contains the exit parameter annotation.
  • Step S2013 If the class contains the exit parameter annotation, save the information of the exit parameter annotation on all member variables in the class into the first MAP set.
  • the class contains an exit parameter annotation
  • the field name of each member variable in the class and the value of the fourth attribute of the corresponding exit parameter annotation can be used as the key and
  • the value constitutes a key-value pair
  • the key-value pairs corresponding to all member variables in the class constitute a second MAP set
  • the value of the third attribute of the exit parameter annotation is used as the key
  • the second MAP set is used as the value, which is stored in the first MAP in the collection.
  • annotation information is added to the three member variables in the data VO class ShopResponseVO.
  • the value of the third attribute of the exit parameter annotation "obtaining the interest list interface" is used as the key, and the second MAP set is used as the value, which is stored in the first MAP set.
  • the field name of the member variable and the value of the fourth attribute of the corresponding exit parameter annotation can be used as key and value respectively to form a key.
  • Value pair if there is no annotation added to the member variable, the field name and field type of the member variable can be used as key and value respectively to form a key-value pair; the key-value pairs corresponding to all member variables in the class form a second MAP set.
  • the information of the exit parameter annotation of the defined class corresponding to the member variable of the preset data type is stored in the first MAP set in a recursive manner. contains nested model information.
  • the preset data type includes at least a generic type, an array and a mapping MAP.
  • the above steps S2012-2013 are recursively performed on the generic class used to define the generic member variable, so as to save the export parameter information of the generic class to the in the first MAP set.
  • the generic class also includes a preset data type, then recursively perform the processing of the above steps S2012-2013 on the definition class used to define the preset data type, so that the export parameter information of the definition class is also Save to the first MAP set.
  • Step S2014 judging whether the class contains Controller annotations.
  • Controller annotation is the annotation that comes with the spring framework.
  • Step S2015 is continued to parse the entry parameter annotation in the class.
  • Step S2015 judging whether the method in the class contains the entry parameter annotation.
  • the entry parameter annotation is parsed by executing step S2016.
  • the entry parameter annotation For example, based on the example of the entry parameter annotation shown in Figure 4, it can be judged whether the method contains the entry parameter annotation by judging whether the method in the class has added the entry parameter annotation identifier "@DocReqValue". "@DocReqValue”, it can be determined that the method contains the entry parameter annotation; if "@DocReqValue” is not added to the method, it can be determined that the method does not contain the exit parameter annotation. For the example in Fig. 4, the entry parameter annotation "@DocValue" is added to the request function getShopList, and it can be determined that the request function getShopList contains the exit parameter annotation.
  • Step S2016 If at least one method in the class includes an entry parameter annotation, save the entry parameter annotation information of the at least one method into the first MAP set.
  • the value of the first attribute of the entry parameter annotation of the method is used as the key, and the value of the first attribute of the entry parameter annotation of the method is used as the key.
  • the value of the second attribute of the entry parameter annotation is value, which is stored in the first MAP set.
  • the entry parameter annotation "@DocValue” is added to the request function getShopList, and the value of the first attribute of the entry parameter annotation of the method "Get Watchlist Interface” is used as the key, and the The value of the second attribute of the entry parameter annotation of this method is "automatically obtained by the gateway after logging in; must be passed (Note: the unique code of the machine - android is uuid, ios is openudid)" is value, which is stored in the first MAP set.
  • the egress parameter annotation and the entry parameter annotation can be parsed through one scan.
  • the egress parameter annotations can be parsed to obtain egress parameter information;
  • steps S2014-S2016 entry parameter annotations can be parsed to obtain ingress parameter information.
  • parsing process of the entry parameter annotation and the parsing process of the exit parameter annotation can be two independent processes, and one of the processes can be implemented by one scan, and the other process can be implemented by the second scan. There is no specific limitation.
  • a unique interface name is uniformly defined by the interface entry parameters and exit parameters. After the parsing is completed, the information of the interface is completely recorded through the unique interface name, so as to obtain all the information required by the interface document.
  • Step S202 Receive the target interface identifier and the designated operating system type sent by the front end, and the designated operating system type is input by the user through the front end page.
  • the target interface refers to at least one interface designated by the user to generate the data model file
  • the designated operation type refers to the operating system type specified by the user to generate the data model file.
  • the specified operating system type can be IOS or Android.
  • the user can input the name of the data model file to be generated and the operating system type to be applied on the interactive interface displayed on the front end, and submit it to the back-end server, where the user names the data model file and specifies The operating system type of the data model file.
  • the user selects the interface for which the corresponding data model file is to be generated as the target interface through the front-end page, and specifies the operating system type applicable to the data model file to be generated,
  • Step S203 Automatically generate a data model file of the target interface according to the interface information, the target interface identifier and the designated operating system type, where the data model file corresponds to the designated operating system type.
  • this step can automatically generate a data model file of the operating system type specified by the user and named by the user, which is more flexible and has a better user experience.
  • the data model file interface for generating the client provided by the background server, it is judged that the data model file to be generated is iOS or Android, and different shell scripts are called according to different operating system types.
  • the information of the export parameter annotation of the defined class corresponding to the member variables of the preset data type is saved to the first MAP set in a recursive manner. middle. Then, the first MAP set includes nested model information, that is, the parsed interface information includes nested model information.
  • a recursive manner is used to generate a data model file including the nested model according to the interface information.
  • multiple nested data models can be parsed in a recursive manner, and a recursive method is used to generate scripting languages suitable for different operating system platforms when the data model files are generated, and the data model files are associated with the code repository to simplify the front end purpose of human development.
  • Step S204 Receive the address information of the designated code warehouse sent by the front end, where the address information of the designated code warehouse is input by the user through the front end page.
  • the user can input the address information of the code warehouse where the generated data model file is stored on the interactive interface displayed on the front end.
  • the specified code repository can be a git repository.
  • Step S205 submit the data model file of the target interface to the designated code repository.
  • the server receives the address information of the specified code warehouse sent by the front end, and submits the generated data model file to the specified code warehouse according to the address information of the specified code warehouse, so that the user can easily obtain the data model file.
  • Step S206 generating an interface document according to the interface information.
  • the interface document after the interface information is obtained, the interface document can also be generated according to the interface information and according to the preset format of the interface document, so that the automatic generation of the interface document can be completed and the time-consuming of writing the interface document can be reduced.
  • the generated interface document can also be displayed through the front-end interface.
  • Step S207 Send the interface information to the front end, so as to display the interface information through the front end page.
  • the interface information may also be displayed through the front-end interface, so as to facilitate the user to view the interface information.
  • the interface information may be displayed through the front-end interface information display interface.
  • different interface information can be displayed through the user's selection, and at the same time, the interface information display interface provides an operation area for the user to switch and select different interfaces, and the user specifies the operating system type of the data model file to be generated. operating area.
  • the front-end interface information display interface may be written in javaScript, and the front-end style is implemented by bootstrap.
  • the code of the interface can also be displayed on the interface information display interface, and the conversion of different languages is supported.
  • conversion of Objective-C and Java code can be supported.
  • the embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file.
  • the interface changes, Only need to change the value in the annotation, recompile to complete the automatic update of interface information and data model file in time, and associate the data model file with the code warehouse.
  • Front-end personnel only need to pull the code, and do not need to care about the generation of the data model file. , which greatly simplifies the man-hours for back-end developers to write interface documents and the workflow for front-end developers to generate data model files, while reducing the communication costs between front-end and back-end developers, and greatly improving efficiency.
  • FIG. 8 is a schematic structural diagram of a data processing apparatus according to Embodiment 3 of the present application.
  • the data processing apparatus provided by the embodiments of the present application may execute the processing procedures provided by the data processing method embodiments.
  • the data processing apparatus 30 includes: an annotation parsing module 301 and an information processing module 302 .
  • annotation parsing module 301 is used for parsing the interface annotation information in the program code during the compilation process to obtain the interface information.
  • the information processing module 302 is configured to automatically generate a data model file according to the interface information.
  • the apparatus provided in this embodiment of the present application may be specifically used to execute the method embodiment provided in the foregoing embodiment 1, and the specific functions will not be repeated here.
  • the embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file.
  • Recompilation can complete the automatic update of interface information and data model files in a timely manner, which improves efficiency, and overcomes the fact that the interface documents are not updated in time and are prone to omissions, resulting in the front-end unable to accurately obtain background data, thus Causes abnormal technical problems such as inaccessibility of front-end pages and returned data errors.
  • FIG. 9 is a schematic structural diagram of a data processing apparatus according to Embodiment 4 of the present application.
  • the data processing apparatus 30 further includes: a sending module 303 .
  • the sending module 303 is used for automatically submitting the data model file to the preset code repository.
  • the information processing module 302 is also used to:
  • the data model file of the target interface is automatically generated, and the data model file corresponds to the specified operating system type.
  • the data processing apparatus 30 further includes: a receiving module 304 .
  • the receiving module 304 is used for:
  • the sending module 303 is also used for:
  • the receiving module 304 is also used to:
  • the information processing module 302 is also used to:
  • the sending module 303 is also used for:
  • the interface annotation information includes the entry parameter annotation and exit parameter annotation of the interface; the annotation parsing module 301 is further used for:
  • each class in the program code if the class contains exit parameter annotations, save the information of the exit parameter annotations on all member variables in the class to the first MAP set; if the class is a controller class, scan Whether each method in the class contains an entry parameter annotation, if at least one method of the class contains an entry parameter annotation, the information of the entry parameter annotation of the at least one method is stored in the first MAP set.
  • the entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is the interface name, and the value of the second attribute is description information of each entry parameter of the interface;
  • the exit parameter annotation includes a third attribute and fourth attribute, the value of the third attribute is the interface name, and the value of the fourth attribute is the description information of each egress parameter, wherein the number of the fourth attribute in the egress parameter annotation of the interface is the same as the number of egress parameters of the interface.
  • annotation parsing module 301 is also used to:
  • At least one method in the class contains an entry parameter annotation
  • the value of the first attribute of the entry parameter annotation of each method is used as the key
  • the value of the second attribute of the entry parameter annotation of the method is stored in the first attribute. in the MAP set.
  • annotation parsing module 301 is also used to:
  • the field name of each member variable in the class and the value of the fourth attribute of the corresponding exit parameter annotation are used as key and value respectively to form a key-value pair, and the keys corresponding to all member variables in the class
  • the value pair constitutes a second MAP set; the value of the third attribute of the exit parameter annotation is used as the key, and the second MAP set is used as the value, and is stored in the first MAP set.
  • annotation parsing module 301 is also used to:
  • the information of the exit parameter annotation corresponding to the member variable of the preset data type corresponding to the defined class is saved in the first MAP set, and the first MAP set contains embedded Set of model information.
  • the information processing module 302 is also used to:
  • the interface information includes nested model information
  • a data model file including the nested model is generated in a recursive manner according to the interface information.
  • the preset data types include at least generics, arrays, and map MAPs.
  • the apparatus provided in this embodiment of the present application may be specifically used to execute the method embodiment provided in the foregoing embodiment 2, and the specific functions will not be repeated here.
  • the embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file.
  • the interface changes, Only need to change the value in the annotation, recompile to complete the automatic update of interface information and data model file in time, and associate the data model file with the code warehouse.
  • Front-end personnel only need to pull the code, and do not need to care about the generation of the data model file. , which greatly simplifies the man-hours for back-end developers to write interface documents and the workflow for front-end developers to generate data model files, while reducing the communication costs between front-end and back-end developers, and greatly improving efficiency.
  • FIG. 10 is a schematic structural diagram of a data processing device according to Embodiment 5 of the present application.
  • the data processing apparatus 100 includes: a processor 1001 , a memory 1002 , and a computer program stored on the memory 1002 and executable on the processor 1001 .
  • the data processing method provided by any of the above method embodiments is implemented when the processor 1001 runs the computer program.
  • the embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file.
  • Recompilation can complete the automatic update of interface information and data model files in a timely manner, which improves efficiency and overcomes the fact that the interface documents are not updated in time and are prone to omissions, resulting in the front-end being unable to accurately obtain background data.
  • causes abnormal technical problems such as inaccessibility of front-end pages and returned data errors.
  • an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data processing method provided by any of the foregoing method embodiments is implemented.
  • the disclosed apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units.
  • the above-mentioned integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium.
  • the above-mentioned software function unit is stored in a storage medium, and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute some steps of the methods in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • Stored Programmes (AREA)

Abstract

Provided in the embodiments of the present application are a data processing method, apparatus, and device, and a computer readable storage medium. The method comprises: during a compilation process, parsing interface annotation information in program code to obtain interface information; and, on the basis of the interface information, automatically generating a data model file. The method of the present invention implements automatic generation of interface information and data model files by means of parsing interface annotation information in program code during a compilation process to obtain interface information and automatically generating a data model file on the basis of the interface information; when the interface changes, interface information and data model files can be automatically updated in a timely manner for recompiling, increasing efficiency and overcoming the technical problems of abnormalities such as front end pages being inaccessible and data errors being returned as a result of the front end being unable to accurately acquire backend data due to omissions easily occurring and the updating of interface documents not being timely.

Description

数据处理方法、装置、设备及计算机可读存储介质Data processing method, apparatus, device, and computer-readable storage medium
本申请要求于2020年06月29日提交中国专利局、申请号为202010605484.8、申请名称为“数据处理方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202010605484.8 and the application name "Data Processing Method, Apparatus, Equipment and Computer-readable Storage Medium" filed with the China Patent Office on June 29, 2020, the entire content of which is approved by Reference is incorporated in this application.
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种数据处理方法、装置、设备及计算机可读存储介质The present application relates to the field of computer technology, and in particular, to a data processing method, apparatus, device, and computer-readable storage medium
背景技术Background technique
现有的软件开发流程中,前端开发人员需要通过后端开发人员编写的接口程序获取后台数据,已完成前后端对接。In the existing software development process, front-end developers need to obtain back-end data through interface programs written by back-end developers, and the front-end and back-end connections have been completed.
目前,后端开发人员通常要手动地将接口的信息记录到接口文档中,对后台接口进行一定的描述。前端开发人员通过查看接口文档中接口返回数据的json格式,自定义数据模型对返回数据进行解析后投入使用,使用过程中需要参考接口文档。At present, back-end developers usually manually record the interface information into the interface document to describe the back-end interface to a certain extent. Front-end developers can view the json format of the data returned by the interface in the interface document, and customize the data model to parse the returned data and put it into use. In the process of use, the interface document needs to be referred to.
如果接口发生变动,就需要后端开发人员手动修改接口文档,并通知所有前端涉及人员修改对应的数据模型,由于后端开发人员任务繁重,往往对接口文档的更新不及时,且容易出现遗漏的情况,导致前端无法准确地获取到后台数据,从而导致前端页面出现无法访问、返回数据错误等异常。If the interface changes, the back-end developers need to manually modify the interface documents, and notify all front-end involved personnel to modify the corresponding data model. Due to the heavy tasks of the back-end developers, the update of the interface documents is often not timely, and it is easy to be missed. In this case, the front-end cannot accurately obtain the back-end data, which leads to exceptions such as inaccessibility of the front-end page and incorrect data returned.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种数据处理方法、装置、设备及计算机可读存储介质,用以解决现有技术中由于接口文档的更新不及时,且容易出现遗漏,导致前端无法准确地获取到后台数据,从而导致前端页面出现无法访问、返回数据错误等异常的问题。The embodiments of the present application provide a data processing method, apparatus, device, and computer-readable storage medium, which are used to solve the problem that in the prior art, the front-end cannot accurately obtain background data due to the untimely update of interface documents and easy omissions. , resulting in abnormal problems such as inaccessibility of the front-end page and return of data errors.
一方面,本申请实施例提供一种数据处理方法,包括:On the one hand, an embodiment of the present application provides a data processing method, including:
在编译过程中,解析程序代码中的接口注解信息,得到接口信息;During the compilation process, the interface annotation information in the program code is parsed to obtain the interface information;
根据所述接口信息自动生成数据模型文件。A data model file is automatically generated according to the interface information.
在一种可能的设计中,所述根据所述接口信息自动生成数据模型文件之后,还包括:In a possible design, after the data model file is automatically generated according to the interface information, the method further includes:
将所述数据模型文件自动提交到预设代码仓库。The data model file is automatically submitted to the preset code repository.
在一种可能的设计中,所述根据所述接口信息自动生成数据模型文件,包括:In a possible design, the data model file is automatically generated according to the interface information, including:
根据所述接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件,所述数据模型文件与所述指定操作系统类型对应。According to the interface information, the target interface identifier and the designated operating system type, a data model file of the target interface is automatically generated, and the data model file corresponds to the designated operating system type.
在一种可能的设计中,所述根据所述接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件之前,还包括:In a possible design, before the data model file of the target interface is automatically generated according to the interface information, the target interface identifier and the specified operating system type, the method further includes:
接收前端发送的所述目标接口标识和指定操作系统类型,所述指定操作系统类型为用户通过前端页面输入的。The target interface identifier and the specified operating system type sent by the front-end are received, and the specified operating system type is input by the user through the front-end page.
在一种可能的设计中,所述根据所述接口信息、目标接口标识和指定操作系统类型, 自动生成目标接口的数据模型文件之后,还包括:In a possible design, after the data model file of the target interface is automatically generated according to the interface information, the target interface identifier and the specified operating system type, the method further includes:
将所述目标接口的数据模型文件提交到指定代码仓库。Submit the data model file of the target interface to the specified code repository.
在一种可能的设计中,所述将所述目标接口的数据模型文件提交到指定代码仓库之前,还包括:In a possible design, before submitting the data model file of the target interface to the specified code repository, the method further includes:
接收前端发送的所述指定代码仓库的地址信息,所述指定代码仓库的地址信息为用户通过前端页面输入的。The address information of the designated code warehouse sent by the front-end is received, where the address information of the designated code warehouse is input by the user through the front-end page.
在一种可能的设计中,所述在编译过程中,解析程序代码中的接口注解信息,得到接口信息之后,还包括:In a possible design, in the compilation process, the interface annotation information in the program code is parsed, and after the interface information is obtained, the method further includes:
根据所述接口信息生成接口文档。An interface document is generated according to the interface information.
在一种可能的设计中,在编译过程中,解析程序代码中的接口注解信息,得到接口信息之后,还包括:In a possible design, during the compilation process, the interface annotation information in the program code is parsed, and after the interface information is obtained, it also includes:
将所述接口信息发送到前端,以通过前端页面显示所述接口信息。The interface information is sent to the front end to display the interface information through the front end page.
在一种可能的设计中,所述接口注解信息包括接口的入口参数注解和出口参数注解;所述解析程序代码中的接口注解信息,得到接口信息,包括:In a possible design, the interface annotation information includes an entry parameter annotation and an exit parameter annotation of the interface; the interface annotation information in the parsing program code is obtained to obtain the interface information, including:
扫描所述程序代码中的每个类,若任一类包含出口参数注解,则将所述类中所有成员变量上的出口参数注解的信息保存到第一MAP集合中;Scan each class in the program code, if any class contains the exit parameter annotation, then save the information of the exit parameter annotation on all member variables in the class into the first MAP set;
若所述类是控制器Controller类,扫描所述类中的每个方法是否包含入口参数注解,若所述类的至少一个方法包含入口参数注解,则将所述至少一个方法的入口参数注解的信息保存到第一MAP集合中。If the class is a Controller class, scan whether each method in the class contains an entry parameter annotation, and if at least one method of the class contains an entry parameter annotation, annotate the entry parameter of the at least one method The information is saved into the first MAP set.
在一种可能的设计中,所述入口参数注解包括第一属性和第二属性,第一属性的值为接口名称,第二属性的值为接口的各入口参数的描述信息;所述出口参数注解包括第三属性和第四属性,第三属性的值为接口名称,第四属性的值为各出口参数的描述信息,其中接口的出口参数注解中第四属性的数量与所述接口的出口参数的数量相同。In a possible design, the entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is the interface name, and the value of the second attribute is description information of each entry parameter of the interface; the exit parameter The annotation includes a third attribute and a fourth attribute, the value of the third attribute is the interface name, and the value of the fourth attribute is the description information of each exit parameter, wherein the number of the fourth attribute in the annotation of the exit parameter of the interface is related to the exit of the interface The number of parameters is the same.
在一种可能的设计中,所述若所述类的至少一个方法包含入口参数注解,则将所述至少一个方法的入口参数注解的信息保存到第一MAP集合中,包括:In a possible design, if the at least one method of the class contains an entry parameter annotation, the information of the entry parameter annotation of the at least one method is stored in the first MAP set, including:
若所述类中的至少一个方法包含入口参数注解,则将每个所述方法的入口参数注解的第一属性的值作为key,将所述方法的入口参数注解的第二属性的值为value,保存到所述第一MAP集合中。If at least one method in the class contains an entry parameter annotation, the value of the first attribute of the entry parameter annotation of each method is used as the key, and the value of the second attribute of the entry parameter annotation of the method is used as value. , and stored in the first MAP set.
在一种可能的设计中,所述若所述类包含出口参数注解,则将所述类中所有成员变量上的出口参数注解的信息保存到第一MAP集合中,包括:In a possible design, if the class contains an exit parameter annotation, the information of the exit parameter annotation on all member variables in the class is stored in the first MAP set, including:
若所述类包含出口参数注解,则将所述类中的任一成员变量的字段名称作为key,将所述成员变量对应的出口参数注解的第四属性的值作为value,构成所述成员变量的键值对,所述类中的所有成员变量对应的键值对构成一个第二MAP集合;将所述出口参数注解的第三属性的值作为key,将所述第二MAP集合作为value,保存到所述第一MAP集合中。If the class contains an exit parameter annotation, the field name of any member variable in the class is used as the key, and the value of the fourth attribute of the exit parameter annotation corresponding to the member variable is used as the value to form the member variable The key-value pairs, the key-value pairs corresponding to all member variables in the class constitute a second MAP set; the value of the third attribute of the exit parameter annotation is used as the key, and the second MAP set is used as the value, Save to the first MAP set.
在一种可能的设计中,所述方法还包括:In a possible design, the method further includes:
若所述类包含预设数据类型的成员变量,则采用递归的方式,将所述预设数据类型的成员变量对应的定义类的出口参数注解的信息保存到所述第一MAP集合中,所述第一MAP集合中包含嵌套模型信息。If the class includes a member variable of a preset data type, the information of the exit parameter annotation of the defined class corresponding to the member variable of the preset data type is stored in the first MAP set in a recursive manner, and the The first MAP set contains nested model information.
在一种可能的设计中,所述方法还包括:In a possible design, the method further includes:
若所述接口信息包含嵌套模型信息,则根据所述接口信息采用递归的方式,生成包含嵌套模型的数据模型文件。If the interface information includes nested model information, a recursive manner is used to generate a data model file including the nested model according to the interface information.
另一方面,本申请实施例提供一种数据处理装置,包括:On the other hand, an embodiment of the present application provides a data processing apparatus, including:
注解解析模块,用于在编译过程中,解析程序代码中的接口注解信息,得到接口信息;The annotation parsing module is used to parse the interface annotation information in the program code during the compilation process to obtain the interface information;
信息处理模块,用于根据所述接口信息自动生成数据模型文件。An information processing module, configured to automatically generate a data model file according to the interface information.
在一种可能的设计中,所述装置还包括:In a possible design, the device further includes:
发送模块,用于将所述数据模型文件自动提交到预设代码仓库。The sending module is used for automatically submitting the data model file to the preset code warehouse.
在一种可能的设计中,所述信息处理模块还用于:In a possible design, the information processing module is also used for:
根据所述接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件,所述数据模型文件与所述指定操作系统类型对应。According to the interface information, the target interface identifier and the designated operating system type, a data model file of the target interface is automatically generated, and the data model file corresponds to the designated operating system type.
在一种可能的设计中,所述装置还包括:In a possible design, the device further includes:
接收模块,用于接收前端发送的所述目标接口标识和指定操作系统类型,所述指定操作系统类型为用户通过前端页面输入的。The receiving module is configured to receive the target interface identifier and the specified operating system type sent by the front-end, where the specified operating system type is input by the user through the front-end page.
在一种可能的设计中,所述发送模块还用于:In a possible design, the sending module is also used for:
将所述目标接口的数据模型文件提交到指定代码仓库。Submit the data model file of the target interface to the specified code repository.
在一种可能的设计中,所述接收模块还用于:In a possible design, the receiving module is also used for:
接收前端发送的所述指定代码仓库的地址信息,所述指定代码仓库的地址信息为用户通过前端页面输入的。The address information of the designated code warehouse sent by the front-end is received, where the address information of the designated code warehouse is input by the user through the front-end page.
在一种可能的设计中,所述信息处理模块还用于:In a possible design, the information processing module is also used for:
根据所述接口信息生成接口文档。An interface document is generated according to the interface information.
在一种可能的设计中,所述发送模块还用于:In a possible design, the sending module is also used for:
将所述接口信息发送到前端,以通过前端页面显示所述接口信息。The interface information is sent to the front end to display the interface information through the front end page.
在一种可能的设计中,所述接口注解信息包括接口的入口参数注解和出口参数注解;所述注解解析模块还用于:In a possible design, the interface annotation information includes an entry parameter annotation and an exit parameter annotation of the interface; the annotation parsing module is further used to:
扫描所述程序代码中的每个类,若任一类包含出口参数注解,则将所述类中所有成员变量上的出口参数注解的信息保存到第一MAP集合中;若所述类是控制器Controller类,扫描所述类中的每个方法是否包含入口参数注解,若所述类的至少一个方法包含入口参数注解,则将所述至少一个方法的入口参数注解的信息保存到第一MAP集合中。Scan each class in the program code, if any class contains an exit parameter annotation, save the information of the exit parameter annotation on all member variables in the class into the first MAP set; if the class is a control Controller class, scan whether each method in the class contains entry parameter annotations, if at least one method of the class contains entry parameter annotations, save the entry parameter annotation information of the at least one method to the first MAP in the collection.
在一种可能的设计中,所述入口参数注解包括第一属性和第二属性,第一属性的值为接口名称,第二属性的值为接口的各入口参数的描述信息;所述出口参数注解包括第三属性和第四属性,第三属性的值为接口名称,第四属性的值为各出口参数的描述信息,其中接口的出口参数注解中第四属性的数量与所述接口的出口参数的数量相同。In a possible design, the entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is the interface name, and the value of the second attribute is description information of each entry parameter of the interface; the exit parameter The annotation includes a third attribute and a fourth attribute, the value of the third attribute is the interface name, and the value of the fourth attribute is the description information of each exit parameter, wherein the number of the fourth attribute in the annotation of the exit parameter of the interface is related to the exit of the interface The number of parameters is the same.
在一种可能的设计中,所述注解解析模块还用于:In a possible design, the annotation parsing module is also used to:
若所述类中的至少一个方法包含入口参数注解,则将每个所述方法的入口参数注解的第一属性的值作为key,将所述方法的入口参数注解的第二属性的值为value,保存到所述第一MAP集合中。If at least one method in the class contains an entry parameter annotation, the value of the first attribute of the entry parameter annotation of each method is used as the key, and the value of the second attribute of the entry parameter annotation of the method is used as value. , and stored in the first MAP set.
在一种可能的设计中,所述注解解析模块还用于:In a possible design, the annotation parsing module is also used to:
若所述类包含出口参数注解,则将所述类中的任一成员变量的字段名称作为key,将所述成员变量对应的出口参数注解的第四属性的值作为value,构成所述成员变量的键值对, 所述类中的所有成员变量对应的键值对构成一个第二MAP集合;将所述出口参数注解的第三属性的值作为key,将所述第二MAP集合作为value,保存到所述第一MAP集合中。If the class contains an exit parameter annotation, the field name of any member variable in the class is used as the key, and the value of the fourth attribute of the exit parameter annotation corresponding to the member variable is used as the value to form the member variable The key-value pairs corresponding to all member variables in the class form a second MAP set; the value of the third attribute of the exit parameter annotation is used as the key, and the second MAP set is used as the value, Save to the first MAP set.
在一种可能的设计中,所述注解解析模块还用于:In a possible design, the annotation parsing module is also used to:
若所述类包含预设数据类型的成员变量,则采用递归的方式,将所述预设数据类型的成员变量对应的定义类的出口参数注解的信息保存到所述第一MAP集合中,所述第一MAP集合中包含嵌套模型信息。If the class includes a member variable of a preset data type, the information of the exit parameter annotation of the defined class corresponding to the member variable of the preset data type is stored in the first MAP set in a recursive manner, and the The first MAP set contains nested model information.
在一种可能的设计中,所述信息处理模块还用于:In a possible design, the information processing module is also used for:
若所述接口信息包含嵌套模型信息,则根据所述接口信息采用递归的方式,生成包含嵌套模型的数据模型文件。If the interface information includes nested model information, a recursive manner is used to generate a data model file including the nested model according to the interface information.
另一方面,本申请实施例提供一种数据处理设备,包括:On the other hand, an embodiment of the present application provides a data processing device, including:
处理器,存储器,以及存储在所述存储器上并可在所述处理器上运行的计算机程序;a processor, a memory, and a computer program stored on the memory and executable on the processor;
其中,所述处理器运行所述计算机程序时实现上述所述的数据处理方法。Wherein, the above-mentioned data processing method is implemented when the processor runs the computer program.
另一方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现上述所述的数据传输方法。On the other hand, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data transmission method described above is implemented.
本申请实施例提供的数据处理方法、装置、设备及计算机可读存储介质,具有如下优点或有益效果:通过在编译过程中,解析程序代码中的接口注解信息,得到接口信息;根据所述接口信息自动生成数据模型文件,实现了接口信息及数据模型文件的自动生成,在接口发生变动时,重新编译即可及时地完成接口信息及数据模型文件的自动更新,提高了效率,并且克服了由于接口文档的更新不及时,且容易出现遗漏的情况,导致前端无法准确地获取到后台数据,从而导致前端页面出现无法访问、返回数据错误等异常的技术问题。The data processing method, device, device, and computer-readable storage medium provided by the embodiments of the present application have the following advantages or beneficial effects: by parsing the interface annotation information in the program code during the compilation process, the interface information is obtained; according to the interface The information automatically generates data model files, which realizes the automatic generation of interface information and data model files. When the interface changes, recompilation can complete the automatic update of interface information and data model files in time, which improves the efficiency and overcomes the The interface documents are not updated in a timely manner and are prone to omissions, resulting in the inability of the front-end to obtain the back-end data accurately, resulting in abnormal technical problems such as inaccessibility of the front-end pages and errors in the returned data.
附图说明Description of drawings
图1为本申请实施例提供的软件开发平台系统架构示意图;1 is a schematic diagram of a software development platform system architecture provided by an embodiment of the present application;
图2为本申请实施例一提供的数据处理方法流程图;2 is a flowchart of a data processing method provided in Embodiment 1 of the present application;
图3为本申请实施例二提供的数据处理方法流程图;3 is a flowchart of a data processing method provided in Embodiment 2 of the present application;
图4为本申请实施例二提供的入口参数注解的示意图;4 is a schematic diagram of an entry parameter annotation provided in Embodiment 2 of the present application;
图5为本申请实施例二提供的出口参数注解的示意图;FIG. 5 is a schematic diagram of an annotation of an exit parameter provided in Embodiment 2 of the present application;
图6为本申请实施例二提供的解析注解的整体流程示意图;FIG. 6 is a schematic diagram of the overall flow of parsing annotations provided by Embodiment 2 of the present application;
图7为本申请实施例二提供的接口信息展示界面的示意图;7 is a schematic diagram of an interface information display interface provided by Embodiment 2 of the present application;
图8为本申请实施例三提供的数据处理装置的结构示意图;FIG. 8 is a schematic structural diagram of a data processing apparatus provided in Embodiment 3 of the present application;
图9为本申请实施例四提供的数据处理装置的结构示意图;9 is a schematic structural diagram of a data processing apparatus provided in Embodiment 4 of the present application;
图10为本申请实施例五提供的数据处理设备的结构示意图。FIG. 10 is a schematic structural diagram of a data processing device according to Embodiment 5 of the present application.
通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本申请构思的范围,而是通过参考特定实施例为本领域技术人员说明本申请的概念。Specific embodiments of the present application have been shown by the above-mentioned drawings, and will be described in more detail hereinafter. These drawings and written descriptions are not intended to limit the scope of the concepts of the present application in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中 所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as recited in the appended claims.
首先对本申请所涉及的名词进行解释:First, the terms involved in this application are explained:
json格式:json是一种轻量级的数据交换格式。JSON format: JSON is a lightweight data exchange format.
vo(value object):是java中的业务对象,是存活在业务层。vo(value object): It is a business object in java and lives in the business layer.
git:是一个开源的分布式版本控制系统,用于敏捷高效的处理或大或小的项目。git: is an open source distributed version control system for agile and efficient handling of large or small projects.
注解:java注解又称java标注,是jdk5.0引入的一种注释机制。Annotation: java annotation, also known as java annotation, is an annotation mechanism introduced by jdk5.0.
bootstrap:是Twitter推出的前端框架,它简介灵活,使web开发更加快捷。Bootstrap: It is a front-end framework launched by Twitter. It is flexible and makes web development faster.
shell脚本:shell是一个用c语言编写的程序,它是用户使用Linux的桥梁,它接受用户命令,然后调用相应的应用程序。Shell script: Shell is a program written in C language, it is a bridge for users to use Linux, it accepts user commands, and then invokes the corresponding application.
此外,术语“第一”、“第二”、“第三”等仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。在以下各实施例的描述中,“多个”的含义是两个以上,除非另有明确具体的限定。In addition, the terms "first", "second", "third", etc. are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. In the description of the following embodiments, the meaning of "plurality" is two or more, unless otherwise expressly and specifically defined.
本申请实施例提供的数据处理方法,可以适用于图1所示的软件开发平台系统架构示意图。如图1所示,该系统架构包括数据采集模块,客户端模型模块,接口文档展示模块,客户端代码仓库。The data processing method provided by the embodiment of the present application can be applied to the schematic diagram of the system architecture of the software development platform shown in FIG. 1 . As shown in Figure 1, the system architecture includes a data acquisition module, a client model module, an interface document display module, and a client code repository.
其中,数据采集模块位于系统中的服务端,后端开发人员在编码阶段通过在请求方法和返回的数据VO类上添加自定义的接口注解,在编译阶段,后端自动解析接口注解可以得到接口信息,并将接口信息保存,实现接口文档所需数据信息的采集功能。Among them, the data acquisition module is located on the server side of the system. During the coding phase, the back-end developers add custom interface annotations to the request method and the returned data VO class. During the compilation phase, the back-end automatically parses the interface annotations to obtain the interface. information, and save the interface information to realize the collection function of the data information required by the interface document.
接口文档展示模块是指后端获取到的接口信息通过前端展示界面进行展示,同时还提供与前端用户的交互界面,以使用户通过前端界面向后端提交信息。The interface document display module means that the interface information obtained by the back-end is displayed through the front-end display interface, and also provides an interactive interface with the front-end user, so that the user can submit information to the back-end through the front-end interface.
客户端模型模块位于系统中的服务端,用于自动地根据接口信息生成客户端用户所需的数据模型文件,可以是iOS和安卓端所需的模型文件。示例性地,用户可以通过前端界面选择要生成数据模型文件的接口,输入将要生成的数据模型文件的名称,输入将生成的数据模型文件提交到的代码仓库的地址信息,等等。The client model module is located on the server side of the system, and is used to automatically generate the data model file required by the client user according to the interface information, which can be the model file required by iOS and Android. Exemplarily, the user may select an interface to generate the data model file through the front-end interface, input the name of the data model file to be generated, input the address information of the code repository to which the generated data model file is submitted, and so on.
客户端代码库提供了将生成的数据模型文件自动提交到git代码仓库的功能,方便前端文员直接使用。The client code base provides the function of automatically submitting the generated data model files to the git code repository, which is convenient for front-end clerks to use directly.
本申请实施例提供的数据处理方法,能够在编译过程中自动解析代码中的接口注解信息得到接口信息,自动生成数据模型文件,并将数据模型文件自动提交到代码仓库,一旦接口发生变化,后端开发人员只需修改该接口的注解,在编译时会自动更新接口信息、重新生成数据模型文件、并自动更新到代码仓库,减少了前后端人员的沟通成本,提高了效率,并且克服了由于接口文档的更新不及时,且容易出现遗漏,导致前端无法准确地获取到后台数据,从而导致前端页面出现无法访问、返回数据错误等异常的技术问题。The data processing method provided by the embodiment of the present application can automatically parse the interface annotation information in the code to obtain the interface information during the compilation process, automatically generate the data model file, and automatically submit the data model file to the code warehouse. The end developer only needs to modify the annotation of the interface, and the interface information will be automatically updated, the data model file will be regenerated, and automatically updated to the code warehouse during compilation, which reduces the communication cost of front-end and back-end personnel, improves efficiency, and overcomes the The interface documents are not updated in a timely manner, and are prone to omissions, resulting in the inability of the front-end to obtain the back-end data accurately, resulting in abnormal technical problems such as inaccessibility of the front-end pages and errors in the returned data.
下面以具体地实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本申请的实施例进行描述。The technical solutions of the present application and how the technical solutions of the present application solve the above-mentioned technical problems will be described in detail below with specific examples. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
图2为本申请实施例一提供的数据处理方法流程图。本实施例中的方法应用于软件开发平台后台的服务端设备。如图2所示,该方法具体步骤如下:FIG. 2 is a flowchart of the data processing method provided in Embodiment 1 of the present application. The method in this embodiment is applied to the server device in the background of the software development platform. As shown in Figure 2, the specific steps of the method are as follows:
步骤S101、在编译过程中,解析程序代码中的接口注解信息,得到接口信息。Step S101 , in the compiling process, parse the interface annotation information in the program code to obtain interface information.
其中,接口注解信息包括入口参数注解和出口参数注解。The interface annotation information includes an entry parameter annotation and an exit parameter annotation.
本实施例中,由后端开发人员在编码阶段,在请求方法和返回的数据VO上添加自定义的注解,完成接口注解信息的编写。In this embodiment, the back-end developer adds custom annotations to the request method and the returned data VO in the coding phase to complete the writing of the interface annotation information.
在编译阶段,服务端设备能够自动地解析程序代码中的接口注解信息,得到接口文档中所需的接口信息。In the compilation stage, the server device can automatically parse the interface annotation information in the program code to obtain the interface information required in the interface document.
其中,接口信息至少包括入口参数信息和出口参数信息,入口参数信息至少包括接口名称和入口参数的描述信息。出口参数信息至少包括接口名称和出口参数的描述信息。The interface information includes at least ingress parameter information and egress parameter information, and the ingress parameter information includes at least an interface name and description information of the ingress parameter. The egress parameter information at least includes interface name and description information of egress parameters.
步骤S102、根据接口信息自动生成数据模型文件。Step S102, a data model file is automatically generated according to the interface information.
本实施例中,在解析出接口信息之后,根据接口信息通过调用shell脚本生成数据模型文件。In this embodiment, after parsing out the interface information, a data model file is generated by calling a shell script according to the interface information.
示例性地,通常操作系统类型包括IOS和Android,针对不同的操作系统类型,服务端设备可以调用不同的shell脚本,生成应用于不同操作系统类型的数据模型文件。Exemplarily, the operating system types usually include IOS and Android. For different operating system types, the server device can call different shell scripts to generate data model files applied to different operating system types.
可选地,若用户指定操作系统类型为IOS,则调用适用于IOS的shell脚本来生成能够适用于IOS的数据模型文件。Optionally, if the user specifies that the operating system type is IOS, a shell script suitable for IOS is invoked to generate a data model file suitable for IOS.
可选地,若用户指定操作系统类型为Android,则调用适用于Android的shell脚本来生成能够适用于Android的数据模型文件。Optionally, if the user specifies that the operating system type is Android, a shell script suitable for Android is invoked to generate a data model file suitable for Android.
可选地,若用户未指定操作系统类型,则可以分别调用适用于IOS的shell脚本和适用于Android的shell脚本,分别生成能够适用于IOS和Android的数据模型文件。Optionally, if the user does not specify the operating system type, the shell script suitable for IOS and the shell script suitable for Android can be respectively called to generate data model files suitable for IOS and Android respectively.
本申请实施例通过在编译过程中,解析程序代码中的接口注解信息,得到接口信息;根据接口信息自动生成数据模型文件,实现了接口信息及数据模型文件的自动生成,在接口发生变动时,重新编译即可及时地完成接口信息及数据模型文件的自动更新,提高了效率,并且克服了由于接口文档的更新不及时,且容易出现遗漏的情况,导致前端无法准确地获取到后台数据,从而导致前端页面出现无法访问、返回数据错误等异常的技术问题。The embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file. When the interface changes, Recompilation can complete the automatic update of interface information and data model files in a timely manner, which improves efficiency, and overcomes the fact that the interface documents are not updated in time and are prone to omissions, resulting in the front-end unable to accurately obtain background data, thus Causes abnormal technical problems such as inaccessibility of front-end pages and returned data errors.
图3为本申请实施例二提供的数据处理方法流程图。在上述实施例一的基础上,本实施例中,根据接口信息自动生成数据模型文件,包括:根据接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件,数据模型文件与指定操作系统类型对应。进一步地,根据接口信息自动生成数据模型文件之后,还包括:将数据模型文件自动提交到预设代码仓库。如图3所示,该方法具体步骤如下:FIG. 3 is a flowchart of the data processing method provided in Embodiment 2 of the present application. On the basis of the above-mentioned first embodiment, in this embodiment, the data model file is automatically generated according to the interface information, including: according to the interface information, the target interface identifier and the specified operating system type, the data model file of the target interface is automatically generated, the data model file Corresponds to the specified operating system type. Further, after the data model file is automatically generated according to the interface information, the method further includes: automatically submitting the data model file to the preset code warehouse. As shown in Figure 3, the specific steps of the method are as follows:
步骤S201、在编译过程中,解析程序代码中的接口注解信息,得到接口信息。Step S201 , in the compiling process, parse the interface annotation information in the program code to obtain interface information.
其中,接口注解信息包括接口的入口参数注解和出口参数注解。The interface annotation information includes an entry parameter annotation and an exit parameter annotation of the interface.
入口参数注解包括第一属性和第二属性,第一属性的值为接口名称,第二属性的值为接口的各入口参数的描述信息。The entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is the interface name, and the value of the second attribute is description information of each entry parameter of the interface.
示例性地,可以用“DocReqValue”表示入口参数注解,入口参数注解的第一属性可以用name表示,第一属性的值为接口名称,第二属性可以用value表示,第二属性的值包括各个入口参数的描述信息,不同的参数的描述信息之间用分号分割开,描述信息的顺序与入口参数的顺序相同。另外,本实施例中对于入口参数注解及其第一属性和第二属性使用的标识不做具体限定。Exemplarily, the entry parameter annotation can be represented by "DocReqValue", the first attribute of the entry parameter annotation can be represented by name, the value of the first property can be represented by the interface name, the second property can be represented by value, and the value of the second property includes each The description information of the entry parameters, the description information of different parameters is separated by a semicolon, and the order of the description information is the same as that of the entry parameters. In addition, this embodiment does not specifically limit the identifiers used for the entry parameter annotation and the first attribute and the second attribute.
例如,如图4中所示的程序代码中,请求函数getShopList中有两个入口参数,分别是pin和uuid,请求函数getShopList上增加了入口参数注解“@DocReqValue”,第一属性name 的值为接口名称“获取关注列表接口”,第二属性value的值包括用分号分割开的pin和uuid的描述信息,入口参数pin的描述信息为“登录后网关自动获取”,入口参数uuid的描述信息为“必传(备注:机器唯一编码-android为uuid,ios为openudid)”。For example, in the program code shown in Figure 4, there are two entry parameters in the request function getShopList, namely pin and uuid, the entry parameter annotation "@DocReqValue" is added to the request function getShopList, and the value of the first attribute name is The interface name is "obtaining the watch list interface", the value of the second attribute value includes the description information of the pin and uuid separated by semicolons, the description information of the entry parameter pin is "automatically obtained by the gateway after login", and the description information of the entry parameter uuid It is "must be passed (Note: the unique code of the machine - android is uuid, ios is openudid)".
本实施例中,出口参数注解包括第三属性和第四属性,第三属性的值为接口名称,第四属性的值为各出口参数的描述信息,其中接口的出口参数注解中第四属性的数量与该接口的出口参数的数量相同。In this embodiment, the egress parameter annotation includes a third attribute and a fourth attribute, the value of the third attribute is the interface name, and the value of the fourth attribute is the description information of each egress parameter, wherein the value of the fourth attribute in the egress parameter annotation of the interface is The number is the same as the number of egress parameters for this interface.
示例性地,可以用“DocValue”表示出口参数注解,出口参数注解的第三属性可以用name表示,第三属性的值为接口名称,第四属性可以用key表示,第四属性的值包括出口参数的描述信息。对于有多个出口参数的接口,每个出口参数可以对应一个key。另外,本实施例中对于出口参数注解及其第三属性和第四属性使用的标识不做具体限定。Exemplarily, "DocValue" can be used to indicate the exit parameter annotation, the third attribute of the exit parameter annotation can be expressed as name, the value of the third attribute can be expressed as the interface name, the fourth attribute can be expressed as key, and the value of the fourth attribute includes the exit Description of the parameter. For an interface with multiple exit parameters, each exit parameter can correspond to a key. In addition, this embodiment does not specifically limit the identifiers used for the exit parameter annotation and the third attribute and the fourth attribute.
例如,如图5中所示的程序代码中,数据VO类ShopResponseVO上增加了出口参数注解“@DocValue”,第三属性name的值为接口名称“获取关注列表接口”,成员变量“allFollowed”、“haveFollowed”和“shopNum”上分别注解了第四属性,对应的第四属性key的值依次为“false:未全部关注true:已全部关注”、“已关注店铺数目”和“底池店铺总数目”。For example, in the program code shown in Figure 5, the export parameter annotation "@DocValue" is added to the data VO class ShopResponseVO, the value of the third attribute name is the interface name "obtaining the watch list interface", the member variables "allFollowed", The fourth attribute is annotated on "haveFollowed" and "shopNum" respectively, and the values of the corresponding fourth attribute key are "false: not all followed true: all followed", "the number of followed shops" and "the total number of shops in the pot" eye".
需要说明的是,某一数据VO类的出口参数注解与该数据VO类对应的请求方法的入口参数注解中的接口名称应该相同,也就是数据VO类的出口参数注解的第一属性name与该数据VO类对应的请求方法的入口参数注解的第三属性name相同。It should be noted that the interface name in the exit parameter annotation of a data VO class should be the same as the interface name in the entry parameter annotation of the request method corresponding to the data VO class, that is, the first attribute name of the exit parameter annotation of the data VO class is the same as the name of the interface. The third attribute name of the entry parameter annotation of the request method corresponding to the data VO class is the same.
作为一种可能的实施方式,为了实现注解的自动解析,解析注解的整体流程如图6所示,可以包括如下步骤:As a possible implementation manner, in order to realize the automatic parsing of annotations, the overall process of parsing annotations is shown in Figure 6, which may include the following steps:
步骤S1、扫描自定义注解。Step S1, scan the custom annotation.
通过注册注解类自定义注解的规则,自定义扫描类用于扫描代码中的哪些位置上加了自定义注解。By registering the rules for custom annotations in the annotation class, the custom scanning class is used to scan which positions in the code are added with custom annotations.
步骤S2、自定义注解加入sping容器。Step S2, adding custom annotations to the sping container.
通过扩展ImportBeanDefinitionRegistrar接口,将注解类加入spring容器中,为后续解析注解做准备。By extending the ImportBeanDefinitionRegistrar interface, the annotation class is added to the spring container to prepare for the subsequent parsing of the annotation.
步骤S3、bean后置处理方法解析注解。Step S3, the bean post-processing method parses the annotation.
通过扩展BeanPostProcessor接口,在bean后置处理方法中解析注解。By extending the BeanPostProcessor interface, the annotations are resolved in the bean post-processing method.
步骤S4、保存接口信息。Step S4, save the interface information.
通过bean后置处理方法解析注解能够得到接口文档所需的接口信息,保存接口信息。The interface information required by the interface document can be obtained by parsing the annotation through the bean post-processing method, and the interface information can be saved.
作为一种可能的实施方式,上述步骤3中bean后置处理方法解析注解的过程,具体可以通过如下步骤S2011-S2013的处理来实现:As a possible implementation manner, the process of parsing annotations by the bean post-processing method in the above step 3 can be specifically implemented through the processing of the following steps S2011-S2013:
步骤S2011、扫描程序代码中的每个类,对当前扫描到的类进行如下处理:Step S2011, scan each class in the program code, and perform the following processing on the currently scanned class:
步骤S2012、判断该类是否包含出口参数注解。Step S2012, judging whether the class contains the export parameter annotation.
如果该类包含出口参数注解,则通过执行步骤S2013,解析该类中的出口参数注解,得到对应的出口参数信息。If the class contains an exit parameter annotation, step S2013 is executed to parse the exit parameter annotation in the class to obtain corresponding exit parameter information.
如果该类不包含出口参数注解,则执行步骤S2014,继续解析该类中的入口参数注解,以获取该类中的入口参数信息。If the class does not contain the exit parameter annotation, step S2014 is executed to continue parsing the entry parameter annotation in the class to obtain entry parameter information in the class.
例如,基于图5所示出口参数注解的示例,可以通过判断该类上是否增加了出口参数 注解的标识“@DocValue”来判断该类是否包含出口参数注解,如果该类上增加了“@DocValue”,则可以确定该类包含出口参数注解;如果该类上,没有增加“@DocValue”,则可以确定该类不包含出口参数注解。对于图5中的示例,数据VO类ShopResponseVO上增加了出口参数注解“@DocValue”,可以确定数据VO类ShopResponseVO包含出口参数注解。For example, based on the example of the exit parameter annotation shown in Figure 5, it can be judged whether the class contains the exit parameter annotation by judging whether the identifier "@DocValue" of the exit parameter annotation is added to the class, if the "@DocValue" is added to the class ", it can be determined that the class contains exit parameter annotations; if "@DocValue" is not added to the class, it can be determined that the class does not contain exit parameter annotations. For the example in FIG. 5 , the exit parameter annotation "@DocValue" is added to the data VO class ShopResponseVO, and it can be determined that the data VO class ShopResponseVO contains the exit parameter annotation.
步骤S2013、若该类包含出口参数注解,则将该类中所有成员变量上的出口参数注解的信息保存到第一MAP集合中。Step S2013: If the class contains the exit parameter annotation, save the information of the exit parameter annotation on all member variables in the class into the first MAP set.
具体地,若类包含出口参数注解,则可以通过遍历该类中的每一个成员变量,将类中的每个成员变量的字段名称和对应的出口参数注解的第四属性的值分别作为key和value构成键值对,类中的所有成员变量对应的键值对构成一个第二MAP集合;将出口参数注解的第三属性的值作为key,将第二MAP集合作为value,保存到第一MAP集合中。Specifically, if the class contains an exit parameter annotation, then by traversing each member variable in the class, the field name of each member variable in the class and the value of the fourth attribute of the corresponding exit parameter annotation can be used as the key and The value constitutes a key-value pair, and the key-value pairs corresponding to all member variables in the class constitute a second MAP set; the value of the third attribute of the exit parameter annotation is used as the key, and the second MAP set is used as the value, which is stored in the first MAP in the collection.
例如,基于图5所示出口参数注解的示例,数据VO类ShopResponseVO中的3个成员变量上增加了注解信息,通过遍历每一个成员变量,将ShopResponseVO类中的每个成员变量的字段名称和对应的出口参数注解的第四属性的值分别作为key和value构成键值对,得到第二MAP集合包含以下3个键值对:key=“allFollowed”,value=“false:未全部关注true:已全部关注”;key=“haveFollowed”,value=“已关注店铺数目”;key=“shopNum”,value=“底池店铺总数目”。将出口参数注解的第三属性的值“获取关注列表接口”作为key,将第二MAP集合作为value,保存到第一MAP集合中。For example, based on the example of the exit parameter annotation shown in Figure 5, annotation information is added to the three member variables in the data VO class ShopResponseVO. By traversing each member variable, the field name of each member variable in the ShopResponseVO class and the corresponding The value of the fourth attribute of the exit parameter annotation is used as key and value to form a key-value pair, and the second MAP set contains the following 3 key-value pairs: key="allFollowed", value="false: not all concerned true: already Follow all"; key="haveFollowed", value="Number of followed shops"; key="shopNum", value="Total number of shops in the pot". The value of the third attribute of the exit parameter annotation "obtaining the interest list interface" is used as the key, and the second MAP set is used as the value, which is stored in the first MAP set.
示例性地,遍历该类中的每一个成员变量时,如果成员变量上增加了注解,则可以将成员变量的字段名称和对应的出口参数注解的第四属性的值分别作为key和value构成键值对;如果成员变量上没有增加注解,则可以将成员变量的字段名和字段类型分别作为key和value构成键值对;类中的所有成员变量对应的键值对构成一个第二MAP集合。Exemplarily, when traversing each member variable in the class, if an annotation is added to the member variable, the field name of the member variable and the value of the fourth attribute of the corresponding exit parameter annotation can be used as key and value respectively to form a key. Value pair; if there is no annotation added to the member variable, the field name and field type of the member variable can be used as key and value respectively to form a key-value pair; the key-value pairs corresponding to all member variables in the class form a second MAP set.
例如,基于图5所示出口参数注解的示例,数据VO类ShopResponseVO中一共4个成员变量,其中3个成员变量上增加了注解信息,通过遍历每一个成员变量,得到第二MAP集合包含以下4个键值对:key=“shopList”,value=“List<ShopInfo>”;key=“allFollowed”,value=“false:未全部关注true:已全部关注”;key=“haveFollowed”,value=“已关注店铺数目”;key=“shopNum”,value=“底池店铺总数目”。For example, based on the example of the exit parameter annotation shown in Figure 5, there are a total of 4 member variables in the data VO class ShopResponseVO, of which 3 member variables are added with annotation information, and by traversing each member variable, the second MAP set contains the following 4 key-value pairs: key="shopList", value="List<ShopInfo>"; key="allFollowed", value="false: not all followed true: all followed"; key="haveFollowed", value=" The number of shops that have been followed"; key = "shopNum", value = "the total number of shops in the pot".
进一步地,若类包含预设数据类型的成员变量,则采用递归的方式,将预设数据类型的成员变量对应的定义类的出口参数注解的信息保存到第一MAP集合中,第一MAP集合中包含嵌套模型信息。Further, if the class contains a member variable of a preset data type, the information of the exit parameter annotation of the defined class corresponding to the member variable of the preset data type is stored in the first MAP set in a recursive manner. contains nested model information.
其中,预设数据类型至少包括范型、数组和映射MAP。Wherein, the preset data type includes at least a generic type, an array and a mapping MAP.
例如,以类中包含范型成员变量为例,递归地对用于定义该范型成员变量的范型类进行上述步骤S2012-2013的处理,以将该范型类的出口参数信息也保存到第一MAP集合中。进一步地,如果该范型类中还包括预设数据类型,那么,递归地对用于定义该预设数据类型的定义类进行上步骤S2012-2013的处理,以将定义类的出口参数信息也保存到第一MAP集合中。For example, taking a class containing a generic member variable as an example, the above steps S2012-2013 are recursively performed on the generic class used to define the generic member variable, so as to save the export parameter information of the generic class to the in the first MAP set. Further, if the generic class also includes a preset data type, then recursively perform the processing of the above steps S2012-2013 on the definition class used to define the preset data type, so that the export parameter information of the definition class is also Save to the first MAP set.
步骤S2014、判断该类是否包含Controller注解。Step S2014, judging whether the class contains Controller annotations.
其中,Controller注解是spring框架中自带的注解。Among them, the Controller annotation is the annotation that comes with the spring framework.
如果该类包含Controller注解,则说明该类为控制器Controller类,该类中可能包含有 入口参数注解,继续执行步骤S2015,进行该类中入口参数注解的解析。If the class contains a Controller annotation, it means that the class is a Controller class, and this class may contain an entry parameter annotation. Step S2015 is continued to parse the entry parameter annotation in the class.
如果该类不包含Controller注解,则说明该类中不可能包含入口参数注解,则继续扫描下一个类。If the class does not contain the Controller annotation, it means that it is impossible to contain the entry parameter annotation in the class, then continue to scan the next class.
步骤S2015、判断该类中的方法是否包含入口参数注解。Step S2015, judging whether the method in the class contains the entry parameter annotation.
如果该类中的至少一个方法包含入口参数注解,则通过执行步骤S2016解析入口参数注解。If at least one method in the class contains an entry parameter annotation, the entry parameter annotation is parsed by executing step S2016.
如果该类中的所有方法均不包含入口参数注解,则继续扫描下一个类。If none of the methods in this class contain entry parameter annotations, continue to scan the next class.
例如,基于图4所示入口参数注解的示例,可以通过判断该类中的方法上是否增加了入口参数注解的标识“@DocReqValue”来判断该方法是否包含入口参数注解,如果该方法上增加了“@DocReqValue”,则可以确定该方法包含入口参数注解;如果该方法上没有增加“@DocReqValue”,则可以确定该方法不包含出口参数注解。对于图4中的示例,请求函数getShopList上增加了入口参数注解“@DocValue”,可以确定请求函数getShopList包含出口参数注解。For example, based on the example of the entry parameter annotation shown in Figure 4, it can be judged whether the method contains the entry parameter annotation by judging whether the method in the class has added the entry parameter annotation identifier "@DocReqValue". "@DocReqValue", it can be determined that the method contains the entry parameter annotation; if "@DocReqValue" is not added to the method, it can be determined that the method does not contain the exit parameter annotation. For the example in Fig. 4, the entry parameter annotation "@DocValue" is added to the request function getShopList, and it can be determined that the request function getShopList contains the exit parameter annotation.
步骤S2016、若该类中的至少一个方法包含入口参数注解,则将至少一个方法的入口参数注解的信息保存到第一MAP集合中。Step S2016: If at least one method in the class includes an entry parameter annotation, save the entry parameter annotation information of the at least one method into the first MAP set.
具体地,如果该类中多个方法包含入口参数注解,则对于该类中的包含入口参数注解的每一个方法,将该方法的入口参数注解的第一属性的值作为key,将该方法的入口参数注解的第二属性的值为value,保存到第一MAP集合中。Specifically, if multiple methods in the class contain entry parameter annotations, for each method in the class that contains entry parameter annotations, the value of the first attribute of the entry parameter annotation of the method is used as the key, and the value of the first attribute of the entry parameter annotation of the method is used as the key. The value of the second attribute of the entry parameter annotation is value, which is stored in the first MAP set.
例如,基于图4所示入口参数注解的示例,请求函数getShopList上增加了入口参数注解“@DocValue”,将该方法的入口参数注解的第一属性的值“获取关注列表接口”作为key,将该方法的入口参数注解的第二属性的值“登录后网关自动获取;必传(备注:机器唯一编码-android为uuid,ios为openudid)”为value,保存到第一MAP集合中。For example, based on the example of the entry parameter annotation shown in Figure 4, the entry parameter annotation "@DocValue" is added to the request function getShopList, and the value of the first attribute of the entry parameter annotation of the method "Get Watchlist Interface" is used as the key, and the The value of the second attribute of the entry parameter annotation of this method is "automatically obtained by the gateway after logging in; must be passed (Note: the unique code of the machine - android is uuid, ios is openudid)" is value, which is stored in the first MAP set.
本实施例中,通过一遍扫描可以实现对出口参数注解和入口参数注解的解析。通过步骤S2012-S2013实现对出口参数注解的解析,得到出口参数信息;通过步骤S2014-S2016可以实现入口参数注解的解析,得到入口参数信息。In this embodiment, the egress parameter annotation and the entry parameter annotation can be parsed through one scan. Through steps S2012-S2013, the egress parameter annotations can be parsed to obtain egress parameter information; through steps S2014-S2016, entry parameter annotations can be parsed to obtain ingress parameter information.
需要说明的是,在扫描每一个类时,以先解析类中的出口参数注解,后解析类中的入口参数注解为例进行示例性地说明;本实施例的其他实施方式中,还可以先解析类中的入口参数注解,后解析出口参数注解;或者可以并行地进行入口参数注解和出口参数注解的解析,本实施例此处不做具体限定。It should be noted that when scanning each class, it is exemplified by parsing the exit parameter annotations in the class first, and then parsing the entry parameter annotations in the class. The entry parameter annotation in the class is parsed, and then the exit parameter annotation is parsed; or the parsing of the entry parameter annotation and the exit parameter annotation can be performed in parallel, which is not specifically limited in this embodiment.
另外,对入口参数注解的解析过程和对出口参数注解的解析过程可以是两个独立的过程,还可以通过一遍扫描实现其中的一个过程,通过第二遍扫描实现另一个过程,本实施例此处不做具体限定。In addition, the parsing process of the entry parameter annotation and the parsing process of the exit parameter annotation can be two independent processes, and one of the processes can be implemented by one scan, and the other process can be implemented by the second scan. There is no specific limitation.
本实施例中,接口入口参数和出口参数会统一定义的一个唯一的接口名,解析完成后通过唯一的接口名将接口的信息完整记录下来,从而得到接口文档所需的全部信息。In this embodiment, a unique interface name is uniformly defined by the interface entry parameters and exit parameters. After the parsing is completed, the information of the interface is completely recorded through the unique interface name, so as to obtain all the information required by the interface document.
步骤S202、接收前端发送的目标接口标识和指定操作系统类型,指定操作系统类型为用户通过前端页面输入的。Step S202: Receive the target interface identifier and the designated operating system type sent by the front end, and the designated operating system type is input by the user through the front end page.
其中,目标接口是指用户指定的想要生成数据模型文件的至少一个接口,指定操作类型是指用户指定的想要生成数据模型文件所适用的操作系统类型。指定操作系统类型可以是IOS或者Android。The target interface refers to at least one interface designated by the user to generate the data model file, and the designated operation type refers to the operating system type specified by the user to generate the data model file. The specified operating system type can be IOS or Android.
本实施例中,用户可以在前端展示的交互界面上输入想要生成的数据模型文件的名称以及所应用的操作系统类型,并提交到后台服务端,由用户对数据模型文件进行命名,并指定数据模型文件的操作系统类型。In this embodiment, the user can input the name of the data model file to be generated and the operating system type to be applied on the interactive interface displayed on the front end, and submit it to the back-end server, where the user names the data model file and specifies The operating system type of the data model file.
示例性地,用户通过前端页面选择想要生成对应数据模型文件的接口作为目标接口,指定要生成的数据模型文件所适用的操作系统类型,Exemplarily, the user selects the interface for which the corresponding data model file is to be generated as the target interface through the front-end page, and specifies the operating system type applicable to the data model file to be generated,
步骤S203、根据接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件,该数据模型文件与指定操作系统类型对应。Step S203: Automatically generate a data model file of the target interface according to the interface information, the target interface identifier and the designated operating system type, where the data model file corresponds to the designated operating system type.
服务端接收到前端发送的目标接口标识和指定操作系统类型之后,通过该步骤可以自动生成用户指定操作系统类型、且由用户自己命名的数据模型文件,更加灵活,用户体验更好。After the server receives the target interface identifier and the specified operating system type sent by the front end, this step can automatically generate a data model file of the operating system type specified by the user and named by the user, which is more flexible and has a better user experience.
具体地,通过调用后台服务端提供的生成客户端的数据模型文件接口,判断要生成的数据模型文件是iOS或者Android,根据不同操作系统类型调用不同的shell脚本。Specifically, by invoking the data model file interface for generating the client provided by the background server, it is judged that the data model file to be generated is iOS or Android, and different shell scripts are called according to different operating system types.
另外,本实施例中,如果某些类包含预设数据类型的成员变量,则采用递归的方式,将预设数据类型的成员变量对应的定义类的出口参数注解的信息保存到第一MAP集合中。那么,第一MAP集合中包含嵌套模型信息,也就是解析出的接口信息中包含嵌套模型信息。In addition, in this embodiment, if some classes contain member variables of the preset data type, the information of the export parameter annotation of the defined class corresponding to the member variables of the preset data type is saved to the first MAP set in a recursive manner. middle. Then, the first MAP set includes nested model information, that is, the parsed interface information includes nested model information.
该步骤中,若接口信息包含嵌套模型信息,则根据接口信息采用递归的方式,生成包含嵌套模型的数据模型文件。In this step, if the interface information includes nested model information, a recursive manner is used to generate a data model file including the nested model according to the interface information.
示例性地,为了生成包含嵌套模型的数据模型文件,iOS和Android两端要生成多个模型类,通过采用递归解析的方法生成对应的shell脚本。同时对于iOS平台,在生成shell脚本时默认加入了处理解析嵌套模型所需的代码。Exemplarily, in order to generate a data model file containing nested models, multiple model classes need to be generated at both ends of iOS and Android, and corresponding shell scripts are generated by using a recursive parsing method. At the same time, for the iOS platform, the code required to process and parse the nested model is added by default when the shell script is generated.
本实施例能够使用递归方式解析出多嵌套的数据模型,在生成数据模型文件的时使用递归方法生成适用于不同操作系统平台的脚本语言,并将数据模型文件和代码仓库关联,达到简化前端人员开发的目的。In this embodiment, multiple nested data models can be parsed in a recursive manner, and a recursive method is used to generate scripting languages suitable for different operating system platforms when the data model files are generated, and the data model files are associated with the code repository to simplify the front end purpose of human development.
步骤S204、接收前端发送的指定代码仓库的地址信息,指定代码仓库的地址信息为用户通过前端页面输入的。Step S204: Receive the address information of the designated code warehouse sent by the front end, where the address information of the designated code warehouse is input by the user through the front end page.
本实施例中,用户可以在前端展示的交互界面上输入生成的数据模型文件存放的代码仓库的地址信息。例如,指定代码仓库可以是git仓库。In this embodiment, the user can input the address information of the code warehouse where the generated data model file is stored on the interactive interface displayed on the front end. For example, the specified code repository can be a git repository.
步骤S205、将目标接口的数据模型文件提交到指定代码仓库。Step S205, submit the data model file of the target interface to the designated code repository.
服务端接收前端发送的指定代码仓库的地址信息,并根据指定代码仓库的地址信息,将生成的数据模型文件提交到指定代码仓库,以便于用户可以方便地获取到数据模型文件。The server receives the address information of the specified code warehouse sent by the front end, and submits the generated data model file to the specified code warehouse according to the address information of the specified code warehouse, so that the user can easily obtain the data model file.
步骤S206、根据接口信息生成接口文档。Step S206, generating an interface document according to the interface information.
本实施例中,在得到接口信息之后,还可以根据接口信息,按照预设设定的接口文档的格式,生成接口文档,从而可以完成接口文档的自动生成,减少接口文档撰写耗时。In this embodiment, after the interface information is obtained, the interface document can also be generated according to the interface information and according to the preset format of the interface document, so that the automatic generation of the interface document can be completed and the time-consuming of writing the interface document can be reduced.
可选地,还可以将生成的接口文档通过前端界面进行展示。Optionally, the generated interface document can also be displayed through the front-end interface.
步骤S207、将接口信息发送到前端,以通过前端页面显示接口信息。Step S207: Send the interface information to the front end, so as to display the interface information through the front end page.
本实施例中,在得到接口信息之后,还可以通过前端界面展示接口信息,以便于用户查看接口信息。In this embodiment, after the interface information is obtained, the interface information may also be displayed through the front-end interface, so as to facilitate the user to view the interface information.
示例性地,可以将接口信息通过前端的接口信息展示界面进行展示。如图7所示,可 以通过用户的选择将不同的接口信息进行展示,同时在该接口信息展示界面中提供用户切换选择不同接口的操作区域,以及用户指定要生成的数据模型文件的操作系统类型的操作区域。Exemplarily, the interface information may be displayed through the front-end interface information display interface. As shown in Figure 7, different interface information can be displayed through the user's selection, and at the same time, the interface information display interface provides an operation area for the user to switch and select different interfaces, and the user specifies the operating system type of the data model file to be generated. operating area.
可选地,前端的接口信息展示界面可以采用javaScript编写,前端样式采用bootstrap来实现。Optionally, the front-end interface information display interface may be written in javaScript, and the front-end style is implemented by bootstrap.
可选地,如图7所示,本实施例还可以在接口信息展示界面展示接口的代码,并且支持不同语言的转换。例如,可以支持Objective-C和java代码的转换。Optionally, as shown in FIG. 7 , in this embodiment, the code of the interface can also be displayed on the interface information display interface, and the conversion of different languages is supported. For example, conversion of Objective-C and Java code can be supported.
本申请实施例通过在编译过程中,解析程序代码中的接口注解信息,得到接口信息;根据接口信息自动生成数据模型文件,实现了接口信息及数据模型文件的自动生成,在接口发生变动时,只需要改变注解中的值,重新编译即可及时地完成接口信息及数据模型文件的自动更新,并将数据模型文件和代码仓库关联,前端人员只需要拉取代码,不必关心数据模型文件的生成,极大简化了后端开发人员编写接口文档的工时和前端开发人员生成数据模型文件的工作流程,同时降低了前、后端开发人员的沟通成本,极大提高了效率。The embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file. When the interface changes, Only need to change the value in the annotation, recompile to complete the automatic update of interface information and data model file in time, and associate the data model file with the code warehouse. Front-end personnel only need to pull the code, and do not need to care about the generation of the data model file. , which greatly simplifies the man-hours for back-end developers to write interface documents and the workflow for front-end developers to generate data model files, while reducing the communication costs between front-end and back-end developers, and greatly improving efficiency.
图8为本申请实施例三提供的数据处理装置的结构示意图。本申请实施例提供的数据处理装置可以执行数据处理方法实施例提供的处理流程。如图8所示,该数据处理装置30包括:注解解析模块301和信息处理模块302。FIG. 8 is a schematic structural diagram of a data processing apparatus according to Embodiment 3 of the present application. The data processing apparatus provided by the embodiments of the present application may execute the processing procedures provided by the data processing method embodiments. As shown in FIG. 8 , the data processing apparatus 30 includes: an annotation parsing module 301 and an information processing module 302 .
具体地,注解解析模块301用于在编译过程中,解析程序代码中的接口注解信息,得到接口信息。Specifically, the annotation parsing module 301 is used for parsing the interface annotation information in the program code during the compilation process to obtain the interface information.
信息处理模块302用于根据接口信息自动生成数据模型文件。The information processing module 302 is configured to automatically generate a data model file according to the interface information.
本申请实施例提供的装置可以具体用于执行上述实施例一所提供的方法实施例,具体功能此处不再赘述。The apparatus provided in this embodiment of the present application may be specifically used to execute the method embodiment provided in the foregoing embodiment 1, and the specific functions will not be repeated here.
本申请实施例通过在编译过程中,解析程序代码中的接口注解信息,得到接口信息;根据接口信息自动生成数据模型文件,实现了接口信息及数据模型文件的自动生成,在接口发生变动时,重新编译即可及时地完成接口信息及数据模型文件的自动更新,提高了效率,并且克服了由于接口文档的更新不及时,且容易出现遗漏的情况,导致前端无法准确地获取到后台数据,从而导致前端页面出现无法访问、返回数据错误等异常的技术问题。The embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file. When the interface changes, Recompilation can complete the automatic update of interface information and data model files in a timely manner, which improves efficiency, and overcomes the fact that the interface documents are not updated in time and are prone to omissions, resulting in the front-end unable to accurately obtain background data, thus Causes abnormal technical problems such as inaccessibility of front-end pages and returned data errors.
图9为本申请实施例四提供的数据处理装置的结构示意图。在上述实施例三的基础上,本实施例中,如图9所示,数据处理装置30还包括:发送模块303。发送模块303用于将数据模型文件自动提交到预设代码仓库。FIG. 9 is a schematic structural diagram of a data processing apparatus according to Embodiment 4 of the present application. On the basis of the third embodiment above, in this embodiment, as shown in FIG. 9 , the data processing apparatus 30 further includes: a sending module 303 . The sending module 303 is used for automatically submitting the data model file to the preset code repository.
在一种可能的设计中,信息处理模块302还用于:In a possible design, the information processing module 302 is also used to:
根据接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件,数据模型文件与指定操作系统类型对应。According to the interface information, the target interface identifier and the specified operating system type, the data model file of the target interface is automatically generated, and the data model file corresponds to the specified operating system type.
在一种可能的设计中,如图9所示,数据处理装置30还包括:接收模块304。接收模块304用于:In a possible design, as shown in FIG. 9 , the data processing apparatus 30 further includes: a receiving module 304 . The receiving module 304 is used for:
接收前端发送的目标接口标识和指定操作系统类型,指定操作系统类型为用户通过前端页面输入的。Receive the target interface identifier and the specified operating system type sent by the front-end, and the specified operating system type is input by the user through the front-end page.
在一种可能的设计中,发送模块303还用于:In a possible design, the sending module 303 is also used for:
将目标接口的数据模型文件提交到指定代码仓库。Submit the data model file of the target interface to the specified code repository.
在一种可能的设计中,接收模块304还用于:In a possible design, the receiving module 304 is also used to:
接收前端发送的指定代码仓库的地址信息,指定代码仓库的地址信息为用户通过前端页面输入的。Receive the address information of the specified code warehouse sent by the front-end, and the address information of the specified code warehouse is input by the user through the front-end page.
在一种可能的设计中,信息处理模块302还用于:In a possible design, the information processing module 302 is also used to:
根据接口信息生成接口文档。Generate interface documentation based on interface information.
在一种可能的设计中,发送模块303还用于:In a possible design, the sending module 303 is also used for:
将接口信息发送到前端,以通过前端页面显示接口信息。Send the interface information to the frontend to display the interface information through the frontend page.
在一种可能的设计中,接口注解信息包括接口的入口参数注解和出口参数注解;注解解析模块301还用于:In a possible design, the interface annotation information includes the entry parameter annotation and exit parameter annotation of the interface; the annotation parsing module 301 is further used for:
扫描程序代码中的每个类,若该类包含出口参数注解,则将该类中所有成员变量上的出口参数注解的信息保存到第一MAP集合中;若该类是控制器Controller类,扫描该类中的每个方法是否包含入口参数注解,若该类的至少一个方法包含入口参数注解,则将至少一个方法的入口参数注解的信息保存到第一MAP集合中。Scan each class in the program code, if the class contains exit parameter annotations, save the information of the exit parameter annotations on all member variables in the class to the first MAP set; if the class is a controller class, scan Whether each method in the class contains an entry parameter annotation, if at least one method of the class contains an entry parameter annotation, the information of the entry parameter annotation of the at least one method is stored in the first MAP set.
在一种可能的设计中,入口参数注解包括第一属性和第二属性,第一属性的值为接口名称,第二属性的值为接口的各入口参数的描述信息;出口参数注解包括第三属性和第四属性,第三属性的值为接口名称,第四属性的值为各出口参数的描述信息,其中接口的出口参数注解中第四属性的数量与该接口的出口参数的数量相同。In a possible design, the entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is the interface name, and the value of the second attribute is description information of each entry parameter of the interface; the exit parameter annotation includes a third attribute and fourth attribute, the value of the third attribute is the interface name, and the value of the fourth attribute is the description information of each egress parameter, wherein the number of the fourth attribute in the egress parameter annotation of the interface is the same as the number of egress parameters of the interface.
在一种可能的设计中,注解解析模块301还用于:In a possible design, the annotation parsing module 301 is also used to:
若该类中的至少一个方法包含入口参数注解,则将每个方法的入口参数注解的第一属性的值作为key,将方法的入口参数注解的第二属性的值为value,保存到第一MAP集合中。If at least one method in the class contains an entry parameter annotation, the value of the first attribute of the entry parameter annotation of each method is used as the key, and the value of the second attribute of the entry parameter annotation of the method is stored in the first attribute. in the MAP set.
在一种可能的设计中,注解解析模块301还用于:In a possible design, the annotation parsing module 301 is also used to:
若类包含出口参数注解,则将类中的每个成员变量的字段名称和对应的出口参数注解的第四属性的值分别作为key和value构成键值对,类中的所有成员变量对应的键值对构成一个第二MAP集合;将出口参数注解的第三属性的值作为key,将第二MAP集合作为value,保存到第一MAP集合中。If the class contains an exit parameter annotation, the field name of each member variable in the class and the value of the fourth attribute of the corresponding exit parameter annotation are used as key and value respectively to form a key-value pair, and the keys corresponding to all member variables in the class The value pair constitutes a second MAP set; the value of the third attribute of the exit parameter annotation is used as the key, and the second MAP set is used as the value, and is stored in the first MAP set.
在一种可能的设计中,注解解析模块301还用于:In a possible design, the annotation parsing module 301 is also used to:
若类包含预设数据类型的成员变量,则采用递归的方式,将预设数据类型的成员变量对应的定义类的出口参数注解的信息保存到第一MAP集合中,第一MAP集合中包含嵌套模型信息。If the class contains a member variable of a preset data type, the information of the exit parameter annotation corresponding to the member variable of the preset data type corresponding to the defined class is saved in the first MAP set, and the first MAP set contains embedded Set of model information.
在一种可能的设计中,信息处理模块302还用于:In a possible design, the information processing module 302 is also used to:
若接口信息包含嵌套模型信息,则根据接口信息采用递归的方式,生成包含嵌套模型的数据模型文件。If the interface information includes nested model information, a data model file including the nested model is generated in a recursive manner according to the interface information.
在一种可能的设计中,预设数据类型至少包括范型、数组和映射MAP。In one possible design, the preset data types include at least generics, arrays, and map MAPs.
本申请实施例提供的装置可以具体用于执行上述实施例二所提供的方法实施例,具体功能此处不再赘述。The apparatus provided in this embodiment of the present application may be specifically used to execute the method embodiment provided in the foregoing embodiment 2, and the specific functions will not be repeated here.
本申请实施例通过在编译过程中,解析程序代码中的接口注解信息,得到接口信息;根据接口信息自动生成数据模型文件,实现了接口信息及数据模型文件的自动生成,在接口发生变动时,只需要改变注解中的值,重新编译即可及时地完成接口信息及数据模型文件的自动更新,并将数据模型文件和代码仓库关联,前端人员只需要拉取代码,不必关心 数据模型文件的生成,极大简化了后端开发人员编写接口文档的工时和前端开发人员生成数据模型文件的工作流程,同时降低了前、后端开发人员的沟通成本,极大提高了效率。The embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file. When the interface changes, Only need to change the value in the annotation, recompile to complete the automatic update of interface information and data model file in time, and associate the data model file with the code warehouse. Front-end personnel only need to pull the code, and do not need to care about the generation of the data model file. , which greatly simplifies the man-hours for back-end developers to write interface documents and the workflow for front-end developers to generate data model files, while reducing the communication costs between front-end and back-end developers, and greatly improving efficiency.
图10为本申请实施例五提供的数据处理设备的结构示意图。如图10所示,该数据处理设备100包括:处理器1001,存储器1002,以及存储在存储器1002上并可在处理器1001上运行的计算机程序。FIG. 10 is a schematic structural diagram of a data processing device according to Embodiment 5 of the present application. As shown in FIG. 10 , the data processing apparatus 100 includes: a processor 1001 , a memory 1002 , and a computer program stored on the memory 1002 and executable on the processor 1001 .
其中,处理器1001运行计算机程序时实现上述任一方法实施例提供的数据处理方法。The data processing method provided by any of the above method embodiments is implemented when the processor 1001 runs the computer program.
本申请实施例通过在编译过程中,解析程序代码中的接口注解信息,得到接口信息;根据接口信息自动生成数据模型文件,实现了接口信息及数据模型文件的自动生成,在接口发生变动时,重新编译即可及时地完成接口信息及数据模型文件的自动更新,提高了效率,并且克服了由于接口文档的更新不及时,且容易出现遗漏的情况,导致前端无法准确地获取到后台数据,从而导致前端页面出现无法访问、返回数据错误等异常的技术问题。The embodiment of the present application obtains the interface information by parsing the interface annotation information in the program code during the compilation process; automatically generates the data model file according to the interface information, and realizes the automatic generation of the interface information and the data model file. When the interface changes, Recompilation can complete the automatic update of interface information and data model files in a timely manner, which improves efficiency and overcomes the fact that the interface documents are not updated in time and are prone to omissions, resulting in the front-end being unable to accurately obtain background data. Causes abnormal technical problems such as inaccessibility of front-end pages and returned data errors.
另外,本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现上述任一方法实施例提供的数据处理方法。In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data processing method provided by any of the foregoing method embodiments is implemented.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software function unit is stored in a storage medium, and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute some steps of the methods in the various embodiments of the present application. . The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
本领域技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, only the division of the above functional modules is used for illustration. The internal structure is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the apparatus described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权 利要求书指出。Other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of this application that follow the general principles of this application and include common knowledge or conventional techniques in the technical field not disclosed in this application . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the application being indicated by the following claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求书来限制。It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (17)

  1. 一种数据处理方法,包括:A data processing method comprising:
    在编译过程中,解析程序代码中的接口注解信息,得到接口信息;During the compilation process, the interface annotation information in the program code is parsed to obtain the interface information;
    根据所述接口信息自动生成数据模型文件。A data model file is automatically generated according to the interface information.
  2. 根据权利要求1所述的方法,所述根据所述接口信息自动生成数据模型文件之后,还包括:The method according to claim 1, after the data model file is automatically generated according to the interface information, further comprising:
    将所述数据模型文件自动提交到预设代码仓库。The data model file is automatically submitted to the preset code repository.
  3. 根据权利要求1或2所述的方法,所述根据所述接口信息自动生成数据模型文件,包括:The method according to claim 1 or 2, wherein the automatically generating a data model file according to the interface information comprises:
    根据所述接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件,所述数据模型文件与所述指定操作系统类型对应。According to the interface information, the target interface identifier and the designated operating system type, a data model file of the target interface is automatically generated, and the data model file corresponds to the designated operating system type.
  4. 根据权利要求3所述的方法,所述根据所述接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件之前,还包括:The method according to claim 3, before automatically generating the data model file of the target interface according to the interface information, the target interface identifier and the specified operating system type, further comprising:
    接收前端发送的所述目标接口标识和指定操作系统类型,所述指定操作系统类型为用户通过前端页面输入的。The target interface identifier and the specified operating system type sent by the front-end are received, and the specified operating system type is input by the user through the front-end page.
  5. 根据权利要求4所述的方法,所述根据所述接口信息、目标接口标识和指定操作系统类型,自动生成目标接口的数据模型文件之后,还包括:The method according to claim 4, after the data model file of the target interface is automatically generated according to the interface information, the target interface identifier and the specified operating system type, the method further comprises:
    将所述目标接口的数据模型文件提交到指定代码仓库。Submit the data model file of the target interface to the specified code repository.
  6. 根据权利要求5所述的方法,所述将所述目标接口的数据模型文件提交到指定代码仓库之前,还包括:The method according to claim 5, before submitting the data model file of the target interface to a designated code repository, further comprising:
    接收前端发送的所述指定代码仓库的地址信息,所述指定代码仓库的地址信息为用户通过前端页面输入的。The address information of the designated code warehouse sent by the front-end is received, where the address information of the designated code warehouse is input by the user through the front-end page.
  7. 根据权利要求1所述的方法,所述在编译过程中,解析程序代码中的接口注解信息,得到接口信息之后,还包括:The method according to claim 1, wherein in the compiling process, parsing the interface annotation information in the program code to obtain the interface information, further comprising:
    根据所述接口信息生成接口文档。An interface document is generated according to the interface information.
  8. 根据权利要求1或7所述的方法,在编译过程中,解析程序代码中的接口注解信息,得到接口信息之后,还包括:The method according to claim 1 or 7, in the compiling process, parsing the interface annotation information in the program code, and after obtaining the interface information, further comprising:
    将所述接口信息发送到前端,以通过前端页面显示所述接口信息。The interface information is sent to the front end to display the interface information through the front end page.
  9. 根据权利要求1所述的方法,所述接口注解信息包括接口的入口参数注解和出口参数注解;The method according to claim 1, wherein the interface annotation information includes an entry parameter annotation and an exit parameter annotation of the interface;
    所述解析程序代码中的接口注解信息,得到接口信息,包括:The interface annotation information in the parsing program code is obtained to obtain interface information, including:
    扫描所述程序代码中的每个类,若任一所述类包含出口参数注解,则将所述类中所有成员变量上的出口参数注解的信息保存到第一MAP集合中;Scan each class in the program code, if any one of the classes contains an exit parameter annotation, then save the information of the exit parameter annotation on all member variables in the class into the first MAP set;
    若所述类是控制器Controller类,扫描所述类中的每个方法是否包含入口参数注解,若所述类的至少一个方法包含入口参数注解,则将所述至少一个方法的入口参数注解的信息保存到第一MAP集合中。If the class is a Controller class, scan whether each method in the class contains an entry parameter annotation, and if at least one method of the class contains an entry parameter annotation, annotate the entry parameter of the at least one method The information is saved into the first MAP set.
  10. 根据权利要求9所述的方法,所述入口参数注解包括第一属性和第二属性,第一属性的值为接口名称,第二属性的值为接口的各入口参数的描述信息;The method according to claim 9, wherein the entry parameter annotation includes a first attribute and a second attribute, the value of the first attribute is an interface name, and the value of the second attribute is description information of each entry parameter of the interface;
    所述出口参数注解包括第三属性和第四属性,第三属性的值为接口名称,第四属性的值为各出口参数的描述信息,其中接口的出口参数注解中第四属性的数量与所述接口的出口参数的数量相同。The egress parameter annotation includes a third attribute and a fourth attribute, the value of the third attribute is the interface name, and the value of the fourth attribute is the description information of each egress parameter, wherein the number of the fourth attribute in the egress parameter annotation of the interface is the same as all the parameters. The number of egress parameters of the interface described above is the same.
  11. 根据权利要求10所述的方法,所述若所述类的至少一个方法包含入口参数注解,则将所述至少一个方法的入口参数注解的信息保存到第一MAP集合中,包括:The method according to claim 10, wherein if at least one method of the class includes an entry parameter annotation, saving the entry parameter annotation information of the at least one method into the first MAP set, comprising:
    若所述类中的至少一个方法包含入口参数注解,则将每个所述方法的入口参数注解的第一属性的值作为key,将所述方法的入口参数注解的第二属性的值为value,保存到所述第一MAP集合中。If at least one method in the class contains an entry parameter annotation, the value of the first attribute of the entry parameter annotation of each method is used as the key, and the value of the second attribute of the entry parameter annotation of the method is used as value. , and stored in the first MAP set.
  12. 根据权利要求10所述的方法,所述若所述类包含出口参数注解,则将所述类中所有成员变量上的出口参数注解的信息保存到第一MAP集合中,包括:The method according to claim 10, wherein if the class contains an exit parameter annotation, the information of the exit parameter annotation on all member variables in the class is stored in the first MAP set, including:
    若所述类包含出口参数注解,则将所述类中的任一成员变量的字段名称作为key,将所述成员变量对应的出口参数注解的第四属性的值作为value,构成所述成员变量对应的键值对,所述类中的所有成员变量对应的键值对构成一个第二MAP集合;If the class contains an exit parameter annotation, the field name of any member variable in the class is used as the key, and the value of the fourth attribute of the exit parameter annotation corresponding to the member variable is used as the value to form the member variable Corresponding key-value pairs, the key-value pairs corresponding to all member variables in the class form a second MAP set;
    将所述出口参数注解的第三属性的值作为key,将所述第二MAP集合作为value,保存到所述第一MAP集合中。The value of the third attribute of the exit parameter annotation is used as the key, and the second MAP set is used as the value, and saved in the first MAP set.
  13. 根据权利要求12所述的方法,所述方法还包括:The method of claim 12, further comprising:
    若所述类包含预设数据类型的成员变量,则采用递归的方式,将所述预设数据类型的成员变量对应的定义类的出口参数注解的信息保存到所述第一MAP集合中,所述第一MAP集合中包含嵌套模型信息。If the class includes a member variable of a preset data type, the information of the exit parameter annotation of the defined class corresponding to the member variable of the preset data type is stored in the first MAP set in a recursive manner, and the The first MAP set contains nested model information.
  14. 根据权利要求13所述的方法,所述方法还包括:The method of claim 13, further comprising:
    若所述接口信息包含嵌套模型信息,则根据所述接口信息采用递归的方式,生成包含嵌套模型的数据模型文件。If the interface information includes nested model information, a recursive manner is used to generate a data model file including the nested model according to the interface information.
  15. 一种数据处理装置,包括:A data processing device, comprising:
    注解解析模块,用于在编译过程中,解析程序代码中的接口注解信息,得到接口信息;The annotation parsing module is used to parse the interface annotation information in the program code during the compilation process to obtain the interface information;
    信息处理模块,用于根据所述接口信息自动生成数据模型文件。An information processing module, configured to automatically generate a data model file according to the interface information.
  16. 一种数据处理设备,包括:A data processing device comprising:
    处理器,存储器,以及存储在所述存储器上并可在所述处理器上运行的计算机程序;a processor, a memory, and a computer program stored on the memory and executable on the processor;
    其中,所述处理器运行所述计算机程序时实现如权利要求1至14中任一项所述的方法。Wherein, when the processor runs the computer program, the method according to any one of claims 1 to 14 is implemented.
  17. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至14中任一项所述的方法。A computer-readable storage medium having a computer program stored in the computer-readable storage medium, the computer program implementing the method according to any one of claims 1 to 14 when executed by a processor.
PCT/CN2021/103024 2020-06-29 2021-06-29 Data processing method, apparatus, and device, and computer readable storage medium WO2022002030A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010605484.8 2020-06-29
CN202010605484.8A CN113760359A (en) 2020-06-29 2020-06-29 Data processing method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2022002030A1 true WO2022002030A1 (en) 2022-01-06

Family

ID=78785432

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/103024 WO2022002030A1 (en) 2020-06-29 2021-06-29 Data processing method, apparatus, and device, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN113760359A (en)
WO (1) WO2022002030A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086393A (en) * 2022-06-13 2022-09-20 卫宁健康科技集团股份有限公司 Interface calling method, device, equipment and storage medium
CN115455239A (en) * 2022-11-10 2022-12-09 北京易诚互动网络技术股份有限公司 Conversion method and device for JAVA class instance and target format data
CN115470152A (en) * 2022-11-02 2022-12-13 平安银行股份有限公司 Test code generation method, test code generation device, and storage medium
CN115617353B (en) * 2022-12-15 2023-03-21 杭州比智科技有限公司 Method for generating description file based on ksp and rapid instrumentation gradle compiling system
CN116822451A (en) * 2023-06-29 2023-09-29 成都融见软件科技有限公司 Method, equipment and medium for reusing and displaying annotation area of variable chip design code
CN116974581A (en) * 2023-09-25 2023-10-31 中化现代农业有限公司 Code generation method, device, electronic equipment and storage medium
CN117236270A (en) * 2023-06-29 2023-12-15 成都融见软件科技有限公司 Self-adaptive display method, electronic equipment and medium for chip design code annotation
CN117234628A (en) * 2023-11-16 2023-12-15 企家有道网络技术(北京)有限公司 Interface calling system, method and server

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115484178A (en) * 2022-08-04 2022-12-16 中银金融科技有限公司 Service consistency change method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9483260B1 (en) * 2012-07-31 2016-11-01 Pivotal Software, Inc. Documentation generation for web APIs based on byte code analysis
CN108932122A (en) * 2018-06-19 2018-12-04 上海陆家嘴国际金融资产交易市场股份有限公司 Interface document generation method, device, computer equipment and storage medium
CN109032663A (en) * 2018-07-09 2018-12-18 深圳市小牛在线互联网信息咨询有限公司 Generation method, device, computer equipment and the storage medium of interface document
CN109086326A (en) * 2018-07-03 2018-12-25 贵阳朗玛信息技术股份有限公司 A kind of method and device that interface document is converted to data pattern file
CN109542412A (en) * 2018-10-16 2019-03-29 平安普惠企业管理有限公司 Interface message generation method, device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160004729A1 (en) * 2014-09-13 2016-01-07 Jumbo, Inc. System and Method for Managing and Using Data Model
CN107357942A (en) * 2017-09-04 2017-11-17 山东达创网络科技股份有限公司 A kind of source code auxiliary Core Generator and its generation method
CN109375901A (en) * 2018-09-03 2019-02-22 平安普惠企业管理有限公司 Interface message management method, device, computer equipment and storage medium
CN110806863A (en) * 2019-11-05 2020-02-18 泰康保险集团股份有限公司 Interface document generation method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9483260B1 (en) * 2012-07-31 2016-11-01 Pivotal Software, Inc. Documentation generation for web APIs based on byte code analysis
CN108932122A (en) * 2018-06-19 2018-12-04 上海陆家嘴国际金融资产交易市场股份有限公司 Interface document generation method, device, computer equipment and storage medium
CN109086326A (en) * 2018-07-03 2018-12-25 贵阳朗玛信息技术股份有限公司 A kind of method and device that interface document is converted to data pattern file
CN109032663A (en) * 2018-07-09 2018-12-18 深圳市小牛在线互联网信息咨询有限公司 Generation method, device, computer equipment and the storage medium of interface document
CN109542412A (en) * 2018-10-16 2019-03-29 平安普惠企业管理有限公司 Interface message generation method, device, computer equipment and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086393A (en) * 2022-06-13 2022-09-20 卫宁健康科技集团股份有限公司 Interface calling method, device, equipment and storage medium
CN115470152A (en) * 2022-11-02 2022-12-13 平安银行股份有限公司 Test code generation method, test code generation device, and storage medium
CN115455239A (en) * 2022-11-10 2022-12-09 北京易诚互动网络技术股份有限公司 Conversion method and device for JAVA class instance and target format data
CN115455239B (en) * 2022-11-10 2023-01-06 北京易诚互动网络技术股份有限公司 Conversion method and device for JAVA class instance and target format data
CN115617353B (en) * 2022-12-15 2023-03-21 杭州比智科技有限公司 Method for generating description file based on ksp and rapid instrumentation gradle compiling system
CN116822451A (en) * 2023-06-29 2023-09-29 成都融见软件科技有限公司 Method, equipment and medium for reusing and displaying annotation area of variable chip design code
CN117236270A (en) * 2023-06-29 2023-12-15 成都融见软件科技有限公司 Self-adaptive display method, electronic equipment and medium for chip design code annotation
CN116822451B (en) * 2023-06-29 2024-03-08 成都融见软件科技有限公司 Method, equipment and medium for reusing and displaying annotation area of variable chip design code
CN117236270B (en) * 2023-06-29 2024-06-07 成都融见软件科技有限公司 Self-adaptive display method, electronic equipment and medium for chip design code annotation
CN116974581A (en) * 2023-09-25 2023-10-31 中化现代农业有限公司 Code generation method, device, electronic equipment and storage medium
CN116974581B (en) * 2023-09-25 2024-01-23 中化现代农业有限公司 Code generation method, device, electronic equipment and storage medium
CN117234628A (en) * 2023-11-16 2023-12-15 企家有道网络技术(北京)有限公司 Interface calling system, method and server

Also Published As

Publication number Publication date
CN113760359A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
WO2022002030A1 (en) Data processing method, apparatus, and device, and computer readable storage medium
US7620959B2 (en) Reflection-based processing of input parameters for commands
CN108108162B (en) Application programming interface generation method and device
US9928050B2 (en) Automatic recognition of web application
US9218269B2 (en) Testing multiple target platforms
US9465608B2 (en) Code separation with semantic guarantees
KR101120853B1 (en) Administrative tool environment
Clifford et al. Tracking provenance in a virtual data grid
Sharp Microsoft Visual C# step by step
US20190188049A1 (en) Apparatus and method to select services for executing a user program based on a code pattern included therein
US9898259B2 (en) Data binding for model-based code generation
JP2005521947A5 (en)
CN112148356A (en) Document generation method, interface development method, device, server and storage medium
KR20090000199A (en) Web server application framework, web application processing method using the framework and computer readable medium processing the method
US11977473B2 (en) Providing a pseudo language for manipulating complex variables of an orchestration flow
JP5377522B2 (en) Efficiently correlate nominally incompatible types
US20220075796A1 (en) Architecture for data map converters
US11782747B2 (en) System and method for notebook processing to handle job execution in cross-cloud environment
TWI414995B (en) Development and execution platform
Gammelgaard Microservices in. NET
Yadav et al. Comparative Analysis of API Integration using Code Vs No-code, low-code Platforms
CN117407430B (en) Data query method, device, computer equipment and storage medium
WO2024041446A1 (en) Method and apparatus for parameter adaptation between application programming interfaces (apis)
Singh Creating Adaptive GraphQL Client for Github Repo Analysis Using Scala Macros
Sänger et al. A qualitative assessment of using ChatGPT as large language model for scientific workflow development

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21834663

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21834663

Country of ref document: EP

Kind code of ref document: A1