Interface document configuration method and device, equipment and medium

By extending interface annotations and using interface attribute scanning plug-ins, the shortcomings of interface document generation tools in the existing technology in international support are solved, and the function of generating corresponding interface documents based on the current locale environment is realized, and the development efficiency is improved.

CN119473428APending Publication Date: 2025-02-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411505338.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing interface document generation tool is limited to language switching of some page elements in international support, and it is impossible to generate corresponding interface definition documents based on different locales.

Method used

By extending interface annotations, the configuration information of multiple locale environments is added, and the global language variable parameters are read in the interface attribute scanning plug-in to determine the current locale, so that corresponding language adjustments are made when generating interface documents.

Benefits of technology

It realizes efficient and reasonable generation of corresponding interface documents based on the current locale environment, improves the work efficiency of interface development and definition, and reduces the development complexity brought by multilingual interface definition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473428A_ABST
    Figure CN119473428A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an interface document configuration method and device, equipment and a medium, and relates to the field of interface document configuration. The method comprises the steps that interface annotations are expanded, configuration information corresponding to various language environments is added, when an interface attribute scanning plug-in scans interface definition information, global language variable parameters are read in the interface information loading process, the current language environment is determined, and the interface attribute scanning plug-in scans the interface definition information. And reading attribute configuration information corresponding to the current language environment from the interface annotation through the interface attribute scanning plug-in, writing the attribute configuration information into a global document object and caching the global document object. In this way, the functional characteristics of interface definition documents in various language environments can be supported at the same time, the flexibility of platform interface definition is improved, the workload of developing interface definitions of different language types due to multi-language interface definition is greatly reduced, and the interface definition efficiency is improved. And the time consumed for generating the corresponding interface document according to the current language environment is shortened, and the working efficiency of interface development and definition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of interface document configuration, and in particular to an interface document configuration method, device, equipment and medium. Background Art

[0002] Interface development is an important component in the development of artificial intelligence platforms. Interfaces are the bridges for communication between platform modules and between the platform and external systems. They define how components interact with each other. At the same time, interfaces provide a standardized way of communication to ensure seamless integration between different systems and components. In order to better guide relevant interface users to use interfaces more conveniently, during the software development process, interface definitions are usually output as interface documents for relevant personnel to review, thereby improving the efficiency of interface development and integration, reducing its complexity, and the learning cost caused by unfamiliarity with interface use.

[0003] Due to the requirements of platform internationalization, the generation of interface documents needs to support the export of interface definition documents in the corresponding language according to the current language environment. For example, Chinese definition documents can be generated in a Chinese environment, and English definition documents can be generated in an English environment. However, the internationalization function of the interface document generation tool itself only supports the display switching between different languages ​​for some page elements. It is impossible to display the interface definition information in an internationalized manner according to different language environments.

[0004] Therefore, the problem of how to efficiently and reasonably generate corresponding interface documents according to the current language environment needs to be solved urgently. Summary of the invention

[0005] Based on the above technical problems, the embodiments of the present application provide an interface document configuration method, apparatus, device and medium, which aim to efficiently and reasonably generate corresponding interface documents according to the current language environment.

[0006] A first aspect of an embodiment of the present application provides an interface document configuration method, the method comprising:

[0007] Expand the interface annotations and add configuration information corresponding to multiple language environments;

[0008] When the interface attribute scanning plug-in scans each interface definition information, the global language variable parameters are read in the process of loading the interface information to determine the current language environment;

[0009] According to the current locale, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the current locale from the interface annotation and writes it into the global document object;

[0010] The global document object is cached, and the global document object is used to generate an interface document corresponding to the current language environment.

[0011] Obtaining a global language parameter configuration from a platform configuration center, where different configuration values ​​of the global language parameter configuration represent different language environments;

[0012] When the platform configuration center is started, reading the current configuration value of the global language parameter configuration;

[0013] The global language variable parameter is set according to the current configuration value of the global language parameter configuration, so that the interface attribute scanning plug-in can determine the current language environment according to the global language variable parameter.

[0014] Optionally, the method further comprises:

[0015] In the first interface annotation part of the interface annotation, first Chinese summary information, first English summary information, first Chinese detailed description information, and first English detailed description information are respectively added, wherein the first Chinese summary information and the first English summary information are used to express summary information of the interface parameter object and the returned object; the first Chinese detailed description information and the first English detailed description information are used to express detailed description information of the interface parameter object and the returned object;

[0016] Adding first Chinese overall description information and first English overall description information to the second interface annotation part of the interface annotation, respectively, wherein the first Chinese overall description information and the first English overall description information are used to express the overall description information of the interface class;

[0017] Adding second Chinese summary information, second English summary information, second Chinese detailed description information, and second English detailed description information to the third interface annotation part of the interface annotation, respectively, wherein the second Chinese summary information and the second English summary information are used to express the summary information of the interface; the second Chinese detailed description information and the second English detailed description information are used to express the detailed description information of the interface;

[0018] Adding first Chinese attribute description information and first English attribute description information to the fourth interface annotation part of the interface annotation, respectively, wherein the first Chinese attribute description information and the first English attribute description information are used to express attribute description information of the interface parameter object and the return object;

[0019] In the fifth interface annotation part of the interface annotation, first Chinese parameter description information and first English parameter description information are respectively added, and the first Chinese parameter description information and the first English parameter description information are used to express the description information of the interface parameters.

[0020] Optionally, according to the current language environment, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the current language environment from the interface annotation and writes it into the global document object. The method further includes:

[0021] Scanning the first plug-in in the plug-in through the interface attribute, reading the summary information and detailed description information of the interface parameter object and the return object corresponding to the current language environment from the first interface annotation part, and writing them into the global document object;

[0022] Scanning the second plug-in in the plug-in through the interface attribute, reading the overall description information of the interface class corresponding to the current language environment from the annotation part of the second interface, and writing it into the global document object;

[0023] Scanning the third plug-in in the plug-in through the interface attribute, reading the overview information and detailed description information of the interface corresponding to the current language environment from the annotation part of the third interface, and writing them into the global document object;

[0024] Through the fourth plug-in in the interface property scanning plug-in, the attribute description information of the interface parameter object and the return object corresponding to the current language environment is read from the fourth interface annotation part, and the description information of the interface parameters corresponding to the current language environment is read from the fifth interface annotation part and written into the global document object.

[0025] Optionally, when the current language environment is the Chinese language environment, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the Chinese language environment from the interface annotation and writes it into the global document object, and the method further includes:

[0026] Scanning the first plug-in in the interface attribute plug-in, reading the first Chinese summary information and the first Chinese detailed description information corresponding to the Chinese language environment from the first interface annotation part, and writing them into the global document object corresponding to the Chinese language environment, wherein the first Chinese summary information is used to express the summary information of the interface parameter object and the return object, and the first Chinese detailed description information is used to express the detailed description information of the interface parameter object and the return object;

[0027] Scan the second plug-in in the interface attribute plug-in, read the first Chinese overall description information corresponding to the Chinese language environment from the second interface annotation part, and write it into the global document object corresponding to the Chinese language environment, wherein the first Chinese overall description information is used to express the overall description information of the interface class;

[0028] Scan the third plug-in in the interface attribute plug-in, read the second Chinese summary information and the second Chinese detailed description information corresponding to the Chinese language environment from the annotation part of the third interface, and write them into the global document object corresponding to the Chinese language environment, wherein the second Chinese summary information is used to express the summary information of the interface, and the second Chinese detailed description information is used to express the detailed description information of the information interface;

[0029] Through the fourth plug-in in the interface attribute scanning plug-in, the first Chinese attribute description information corresponding to the Chinese language environment is read from the fourth interface annotation part, and the first Chinese parameter description information corresponding to the Chinese language environment is read from the fifth interface annotation part, and written into the global document object corresponding to the Chinese language environment, wherein the first Chinese attribute description information is used to express the attribute description information of the interface parameter object and the return object, and the first Chinese parameter description information is used to express the description information of the interface parameters.

[0030] Optionally, after caching the global document object, the method includes:

[0031] Get online browsing requests;

[0032] According to the user's online browsing request, converting the information in the global document object into interface definition information in a target character string format;

[0033] The interface definition information in the target string format is parsed and rendered, and the interface information in the current language environment is displayed through the display interface.

[0034] Optionally, after caching the global document object, the method further includes:

[0035] According to the information export request, the information in the global document object cache is converted into the interface offline document format;

[0036] According to the offline download request, the offline document including the interface information in the current language environment is sent to the user terminal, so that the user terminal can store the offline document locally.

[0037] A second aspect of an embodiment of the present application provides an interface document configuration device, the device comprising:

[0038] Annotation extension module, used to extend interface annotations and add configuration information corresponding to multiple language environments;

[0039] The language environment determination module is used to read the global language variable parameters in the process of loading interface information when the interface attribute scanning plug-in scans each interface definition information to determine the current language environment;

[0040] The attribute configuration information reading module is used to read the attribute configuration information corresponding to the current language environment from the interface annotation through the interface attribute scanning plug-in according to the current language environment, and write it into the global document object;

[0041] The cache module is used to cache the global document object, and the global document object is used to generate an interface document corresponding to the current language environment.

[0042] Optionally, the interface document configuration device further includes:

[0043] A global language parameter configuration acquisition submodule is used to acquire the global language parameter configuration of the platform configuration center, where different configuration values ​​of the global language parameter configuration represent different language environments;

[0044] A current configuration value reading submodule is used to read the current configuration value of the global language parameter configuration when the platform configuration center is started;

[0045] The global language variable parameter setting submodule is used to set the global language variable parameters according to the current configuration value of the global language parameter configuration, so that the interface attribute scanning plug-in can determine the current language environment according to the global language variable parameters.

[0046] Optionally, the annotation extension module further includes:

[0047] The first interface annotation extension submodule is used to add first Chinese summary information, first English summary information, first Chinese detailed description information, and first English detailed description information to the first interface annotation part of the interface annotation, respectively, wherein the first Chinese summary information and the first English summary information are used to express summary information of an interface parameter object and a return object; the first Chinese detailed description information and the first English detailed description information are used to express detailed description information of an interface parameter object and a return object;

[0048] A second interface annotation extension submodule is used to add first Chinese overall description information and first English overall description information to the second interface annotation part of the interface annotation, respectively, wherein the first Chinese overall description information and the first English overall description information are used to express the overall description information of the interface class;

[0049] The third interface annotation extension submodule is used to add second Chinese summary information, second English summary information, second Chinese detailed description information, and second English detailed description information to the third interface annotation part of the interface annotation, respectively, wherein the second Chinese summary information and the second English summary information are used to express the summary information of the interface; the second Chinese detailed description information and the second English detailed description information are used to express the detailed description information of the interface;

[0050] A fourth interface annotation extension submodule, used to add first Chinese attribute description information and first English attribute description information to the fourth interface annotation part of the interface annotation, respectively, wherein the first Chinese attribute description information and the first English attribute description information are used to express attribute description information of an interface parameter object and a return object;

[0051] The fifth interface annotation extension submodule is used to add the first Chinese parameter description information and the first English parameter description information respectively in the fifth interface annotation part of the interface annotation, wherein the first Chinese parameter description information and the first English parameter description information are used to express the description information of the interface parameters.

[0052] Optionally, the attribute configuration information reading module further includes:

[0053] A first reading submodule is used to scan the first plug-in in the plug-in through the interface attributes, read the summary information and detailed description information of the interface parameter object and the return object corresponding to the current language environment from the first interface annotation part, and write them into the global document object;

[0054] A second reading submodule is used to scan the second plug-in in the plug-in through the interface attribute, read the overall description information of the interface class corresponding to the current language environment from the second interface annotation part, and write it into the global document object;

[0055] A third reading submodule is used to scan the third plug-in in the plug-in through the interface attributes, read the overview information and detailed description information of the interface corresponding to the current language environment from the third interface annotation part, and write them into the global document object;

[0056] The fourth reading submodule is used to scan the fourth plug-in in the interface attribute plug-in through the interface attribute, read the attribute description information of the interface parameter object and the return object corresponding to the current language environment from the fourth interface annotation part, and read the description information of the interface parameters corresponding to the current language environment from the fifth interface annotation part, and write it into the global document object.

[0057] Optionally, the interface document configuration device further includes:

[0058] The browsing request acquisition submodule is used to obtain online browsing requests;

[0059] An interface definition information conversion submodule, used to convert the information in the global document object into interface definition information in a target string format according to a user's online browsing request;

[0060] The display submodule is used to parse the interface definition information in the target string format, render and generate it, and display the various interface information in the current language environment through the display interface.

[0061] Optionally, the interface document configuration device further includes:

[0062] The offline document conversion submodule is used to convert the information in the global document object cache into an interface offline document format according to the information export request;

[0063] The offline document sending submodule is used to send the offline document containing the interface information in the current language environment to the user terminal according to the offline download request, so that the user terminal can store the offline document locally.

[0064] A third aspect of an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, an interface document configuration method as in the first aspect of an embodiment of the present application is implemented.

[0065] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the interface document configuration method of the first aspect of the embodiment of the present application is implemented.

[0066] Through the interface document configuration method of the embodiment of the present application, the current language environment is determined according to the configuration value of the global language parameter configuration configured by the platform configuration center, the global language variable parameters are set, and the interface annotation is expanded to increase the configuration information corresponding to multiple language environments. When the interface attribute scanning plug-in scans each interface definition information, the current language environment can be determined by reading the global language variable parameters, and the global document object is written according to the attribute configuration information corresponding to the current language environment in the interface annotation. Finally, based on the cached global document object, online browsing information or offline documents are generated for users to view and use.

[0067] In this application, unlike the method in the prior art that requires the individual configuration of each interface information, by introducing the current language environment of the platform before generating the global document object, and through the corresponding extension in the interface annotation, after determining the current language environment, each interface information can be directly configured corresponding to the current language environment, so that when the global document object is generated, the content therein has been adjusted corresponding to the current language environment, and when the user needs to check the interface information online or download the interface definition document offline, the interface information obtained is processed and conforms to the current language environment. It is achieved that through a set of interface definitions, the functional characteristics of interface definition documents in various language environments can be supported at the same time, and the flexibility of the platform interface definition is improved. It not only greatly reduces the workload of developing interface definitions of different language types due to multi-language interface definitions, but also shortens the time spent on generating corresponding interface documents according to the current language environment, and improves the work efficiency of interface development and definition. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0069] Figure 1 It is a flow chart of an interface document configuration method proposed in one embodiment of the present application;

[0070] Figure 2 This is a schematic diagram of a global document object generation process proposed in an embodiment of the present application;

[0071] Figure 3 This is a schematic diagram of an interface information request process proposed in an embodiment of the present application;

[0072] Figure 4 This is a schematic diagram of an interface document configuration architecture proposed in an embodiment of the present application;

[0073] Figure 5 is a structural block diagram of an interface document configuration device provided in an embodiment of the present application;

[0074] Figure 6 It is a schematic diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

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

[0076] In the drawings, the size of the constituent elements, the thickness of the layer or the area may be exaggerated for the sake of clarity. Therefore, any implementation of the present disclosure is not necessarily limited to the size shown in the drawings, and the shapes and sizes of the components in the drawings do not reflect the true proportions. In addition, the drawings schematically show ideal examples, and any implementation of the present disclosure is not limited to the shapes or values ​​shown in the drawings.

[0077] Please refer to Figure 1 , Figure 1 This is a flow chart of an interface document configuration method of the present application. Figure 1 As shown, the method may include steps S101 to S104:

[0078] Step S101: Expand the interface annotation and add configuration information corresponding to multiple language environments;

[0079] Step S102: when the interface attribute scanning plug-in scans each interface definition information, the global language variable parameter is read in the process of loading the interface information to determine the current language environment;

[0080] Step S103: according to the current language environment, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the current language environment from the interface annotation and writes it into the global document object;

[0081] Step S104: caching the global document object, where the global document object is used to generate an interface document corresponding to the current language environment.

[0082] In the prior art, interface definition documents corresponding to the current language environment are produced in different language environments. The page element conversion function of the interface definition document generation tool itself is usually used. However, this function only supports display switching between different languages ​​for some page elements, and cannot achieve language switching for all content in the interface definition document. Developers are still required to make adjustments, which not only causes more redundant workload, but also increases the risk of errors.

[0083] Therefore, the present application proposes a method for configuring an interface document, which expands the interface annotation content and adds configuration information corresponding to multiple language environments, so as to support the subsequent generation of interface configuration documents to provide configuration information of different language environments. Therefore, when the interface attribute scanning plug-in scans each interface definition information, it will select the configuration information that matches the current language environment according to the global language variable parameters and write it into the global document object. In this way, while obtaining the global document object, the actual content in the interface definition document is matched with the current language environment. Then, according to the cached global document object, the online interface information or the offline interface definition document can be generated according to the user's usage needs, so as to achieve the purpose of generating the corresponding interface definition document according to the current language environment conveniently and quickly.

[0084] Step S101: Expand the interface annotation and add configuration information corresponding to multiple language environments.

[0085] In the embodiment of the present application, the interface annotation needs to be expanded first. Since the annotations of each interface in the prior art do not have annotations for corresponding configuration according to the current language environment, the function of adjusting the language of the interface definition document according to the language environment cannot be realized. Add configuration information corresponding to each language environment to the interface annotation, including but not limited to Chinese configuration information and English configuration information, and add configuration information in other different languages ​​according to the usage requirements of different users. When the current language environment is obtained, the configuration information of the corresponding language environment can be directly selected according to the interface annotation that has been expanded.

[0086] Step S102: When the interface attribute scanning plug-in scans each interface definition information, the global language variable parameter is read in the process of loading the interface information to determine the current language environment.

[0087] In an embodiment of the present application, each interface definition information is scanned by an interface attribute scanning plug-in, which also includes the configuration information corresponding to the multiple language environments mentioned above. At the same time, the interface attribute scanning plug-in also reads the global language variable parameters and determines the current language environment according to the global language variable parameters as the basis for subsequent selection of corresponding configuration information.

[0088] Step S103: According to the current language environment, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the current language environment from the interface annotation and writes it into the global document object.

[0089] In an embodiment of the present application, after the interface attribute scanning plug-in determines the current language environment, it can read the attribute configuration information of the corresponding language environment according to the interface annotation described above. According to the attribute configuration information, the definitions of the interface can be written into the global document object using the language of the current language environment as input for the subsequent generation of the interface definition document.

[0090] Step S104: caching the global document object, where the global document object is used to generate an interface document corresponding to the current language environment.

[0091] In an embodiment of the present application, after the interface attribute scanning plug-in writes all attribute information of all interfaces into the global document object, the global document object needs to be cached for subsequent acquisition of interface information therefrom and conversion to generate interface definition information in the corresponding language environment or to generate a downloadable interface definition document in the corresponding language environment.

[0092] In a specific embodiment of the present application, the current mainstream interface definition and document generation method is selected, that is, the Swagger specification definition is used, and the interface document is generated and exported with the help of the interface attribute scanning plug-in Springfox and the document generation tool Knife4j. Among them, Swagger is a standardized and complete framework for generating, describing, calling and visualizing resource-oriented style network services, supporting the automatic generation of synchronized online documents by the application programming interface (API), and can directly generate documents through code, and no longer needs to manually write interface documents. Through the use of the above tools, combined with the interface document configuration method proposed in this application, it is possible to quickly and conveniently generate interface definition documents corresponding to the current language environment.

[0093] The specific flow chart of the above process is as follows Figure 2 As shown, Figure 2 This is a schematic diagram of a global document object generation process proposed in an embodiment of the present application, wherein the language environment is the Chinese language environment and the English language environment as examples. After the interface attribute scanning plug-in completes initialization, the global language variable parameters can be read to determine the current language environment. If it is the Chinese language environment, each plug-in scans the Chinese attribute configuration information in the corresponding interface annotation and writes it into the global document object; if the current language environment is the English language environment, each plug-in scans the English attribute configuration information in the corresponding interface annotation and writes it into the global document object. Finally, the global document object is cached for subsequent generation of online or offline interface definition documents.

[0094] In combination with the above embodiments, in one implementation, the present application further provides an interface document configuration method, which specifically includes the following contents:

[0095] First, a global language parameter configuration of a platform configuration center is obtained, where different configuration values ​​of the global language parameter configuration represent different language environments.

[0096] In the embodiment of the present application, since the required interface is a communication bridge between modules in the platform development or between modules and the platform external system, in an optional embodiment, the platform can be an artificial intelligence platform, so the language selection in the interface definition needs to match the platform as a whole, that is, the current language environment is determined according to the current language configuration of the platform. Therefore, before performing the interface document configuration method proposed in this application, it is first necessary to obtain the global language parameter configuration of the platform configuration center, which is configured with different configuration values ​​to indicate that the current platform is in different language environments. The generation of subsequent interface definition documents also needs to be based on this.

[0097] Then, when the platform configuration center is started, the current configuration value of the global language parameter configuration is read; according to the current configuration value of the global language parameter configuration, the global language variable parameter is set, so that the interface attribute scanning plug-in determines the current language environment according to the global language variable parameter.

[0098] In an embodiment of the present application, after the platform configuration center starts working, the current configuration value of the global language parameter configuration can be read therefrom, and then the language environment of the current platform is determined based on its configuration value. Based on this, the global language variable parameters are set as the input of the subsequent interface attribute scanning plug-in, which determines which specific language attribute configuration information the interface attribute scanning plug-in selects to be written into the global document object.

[0099] In combination with the above embodiments, in one implementation, the present application further provides an interface document configuration method, wherein the multiple language environments include at least a Chinese language environment and an English language environment, and the interface annotation is extended to add configuration information corresponding to each of the multiple language environments, specifically including the following contents:

[0100] In the first interface annotation part of the interface annotation, the first Chinese summary information, the first English summary information, the first Chinese detailed description information, and the first English detailed description information are respectively added. The first Chinese summary information and the first English summary information are used to express the summary information of the interface parameter object and the return object; the first Chinese detailed description information and the first English detailed description information are used to express the detailed description information of the interface parameter object and the return object.

[0101] In an embodiment of the present application, as described above, in order to ensure that the corresponding interface definition document can be generated conveniently and quickly according to the current language environment, it is necessary to expand the interface annotation and add configuration information corresponding to various language environments, which should at least include Chinese configuration information and English configuration information. Here, taking Chinese and English as examples, the first Chinese overview information, the first English overview information, the first Chinese detailed description information, and the first English detailed description information are added to the first interface annotation part of the interface annotation at the same time. In this way, after determining the current language environment, the corresponding Chinese or English configuration information can be selected.

[0102] In one embodiment, the first interface annotation may be the @ApiModel annotation in the Swagger API, which includes Chinese and English overview information used to configure the interface parameter object and the return object, and Chinese and English detailed description information used to configure the interface parameter object and the return object.

[0103] Adding first Chinese overall description information and first English overall description information to the second interface annotation part of the interface annotation, respectively, wherein the first Chinese overall description information and the first English overall description information are used to express the overall description information of the interface class;

[0104] Adding second Chinese summary information, second English summary information, second Chinese detailed description information, and second English detailed description information to the third interface annotation part of the interface annotation, respectively, wherein the second Chinese summary information and the second English summary information are used to express the summary information of the interface; the second Chinese detailed description information and the second English detailed description information are used to express the detailed description information of the interface;

[0105] Adding first Chinese attribute description information and first English attribute description information to the fourth interface annotation part of the interface annotation, respectively, wherein the first Chinese attribute description information and the first English attribute description information are used to express attribute description information of the interface parameter object and the return object;

[0106] In the fifth interface annotation part of the interface annotation, first Chinese parameter description information and first English parameter description information are respectively added, and the first Chinese parameter description information and the first English parameter description information are used to express the description information of the interface parameters.

[0107] In the embodiment of the present application, as with the description related to the first interface annotation, based on the same design idea, other configuration parts in the interface configuration are also expanded accordingly, that is, in the second interface annotation part to the fifth interface annotation part, the corresponding attribute description information of each language environment is added, so that when generating an interface definition of an interface, all the information required can be adaptively selected and adjusted according to the current language environment.

[0108] Optionally, in an embodiment, taking the language environment as the Chinese language environment or the English language environment as an example, each interface annotation may have the following meanings:

[0109] The first interface annotation can be the @ApiModel annotation in the Swagger API, which includes Chinese and English overview information used to configure the interface parameter object and the return object, as well as Chinese and English detailed description information used to configure the interface parameter object and the return object;

[0110] The second interface annotation can be the @Api annotation in the Swagger API, which includes Chinese and English description information used to configure the overall description of the interface class;

[0111] The third interface annotation can be the @ApiOperation annotation in the Swagger API, which includes Chinese and English overview information used to configure the interface, as well as Chinese and English detailed description information used to configure the interface;

[0112] The fourth interface annotation can be the @ApiModelProperty annotation in the Swagger API, which includes Chinese and English property description information used to configure the interface parameter object and the return object;

[0113] The fifth interface annotation can be the @ApiImplicitParam annotation in the Swagger API, which includes Chinese and English description information used to configure interface parameters.

[0114] Optionally, in an embodiment, taking the language environment as the Chinese language environment or the English language environment as an example, the code for extending the interface annotation may be as shown in the following code:

[0115] @Target(ElementType.TYPE)

[0116] @Retention(RetentionPolicy.RUNTIME)

[0117] @Inherited

[0118] Public @interface Api {

[0119] / / Default properties

[0120] String tags() default "";

[0121] / / Property configuration in English environment

[0122] String tags_en()default"";

[0123] / / Property configuration in Chinese environment

[0124] String tags_zh()default"";

[0125] }

[0126] In combination with the above embodiments, in one implementation, the present application further provides an interface document configuration method, which reads the attribute configuration information corresponding to the current language environment from the interface annotation through the interface attribute scanning plug-in according to the current language environment, and writes it into the global document object, specifically including the following contents:

[0127] Scanning the first plug-in in the plug-in through the interface attribute, reading the summary information and detailed description information of the interface parameter object and the return object corresponding to the current language environment from the first interface annotation part, and writing them into the global document object;

[0128] Scanning the second plug-in in the plug-in through the interface attribute, reading the overall description information of the interface class corresponding to the current language environment from the annotation part of the second interface, and writing it into the global document object;

[0129] Scanning the third plug-in in the plug-in through the interface attribute, reading the overview information and detailed description information of the interface corresponding to the current language environment from the annotation part of the third interface, and writing them into the global document object;

[0130] Through the fourth plug-in in the interface property scanning plug-in, the attribute description information of the interface parameter object and the return object corresponding to the current language environment is read from the fourth interface annotation part, and the description information of the interface parameters corresponding to the current language environment is read from the fifth interface annotation part and written into the global document object.

[0131] In an embodiment of the present application, after performing interface annotation expansion, obtaining global language variable parameters, and determining the current language environment, it is necessary to scan the interface information through an interface attribute scanning plug-in, and write the scanning results into a global document object. Since each interface contains different types of information, it is necessary to scan through different interface attribute scanning plug-ins. Taking the first plug-in as an example, the first plug-in is used to scan the interface information of the annotation part of the first interface. After determining the current language environment according to the global language variable, in the process of scanning the first interface annotation, the first plug-in will select the overview information and detailed description information of the relevant interface parameter objects and return objects that conform to the current language environment, and write them into the global document object. When each interface attribute scanning plug-in scans a certain interface and writes its corresponding interface attribute information into the global document object, it means that the writing of the interface is completed, and the scanning and writing of the next interface are continued.

[0132] Optionally, in an embodiment, taking the language environment as the Chinese language environment or the English language environment as an example, the specific operations of each interface attribute scanning plug-in are as follows:

[0133] The first plug-in may be a ModelBuilderPlugin plug-in in Springfox, which is used to read the Chinese and English overview information used to configure the interface parameter object and the return object, as well as the Chinese and English detailed description information used to configure the interface parameter object and the return object in the first interface annotation part @ApiModel, and write it into the global document object;

[0134] The second plug-in may be the ApiListingBuilderPlugin plug-in in Springfox, which is used to read the Chinese and English description information in the @Api annotation part of the second interface, including the information used to configure the overall description of the interface class, and write it into the global document object;

[0135] The third plug-in may be the OperationBuilderPlugin plug-in in Springfox, which is used to read the Chinese and English overview information used to configure the interface and the Chinese and English detailed description information used to configure the interface in the annotation part @ApiOperation of the third interface, and write it into the global document object;

[0136] The fourth plug-in can be the ParameterBuilderPlugin plug-in in Springfox, which is used to read the Chinese and English property description information used to configure the interface parameter object and the return object in the fourth interface annotation part @ApiModelProperty annotation, and read the Chinese and English description information used to configure the interface parameters in the fifth interface annotation part @ApiImplicitParam, and write it into the global document object.

[0137] Optionally, in an embodiment, according to the interface document configuration method proposed in the present application, taking the language environment as the Chinese language environment or the English language environment as an example, the code for processing the interface annotation may be as shown in the following code:

[0138] / / Get the annotations in the parameter definition

[0139] Optional <api>apiAnnotation=

[0140] ofNullable(findAnnotation(controller.get(),Api.class));

[0141] / / Get the global language parameter type

[0142] String lang=ApiConfig.getLang();

[0143] / / According to the language type, get the annotation configuration

[0144] String[] tags = null;

[0145] if("zh_CN".equals(lang)){

[0146] tags=apiAnnotation.get().tags_zh();

[0147] }else if("en_US".equals(lang)){

[0148] tags=apiAnnotation.get().tags_en();

[0149] }

[0150] if(null==tags||tags.length==0||tags[0].length()==0){

[0151] tags=annotation.get().tags();

[0152] }

[0153] In combination with the above embodiments, in one implementation, the present application further provides an interface document configuration method. When the current language environment is the Chinese language environment, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the Chinese language environment from the interface annotation and writes it into the global document object, which specifically includes the following contents:

[0154] Scanning the first plug-in in the interface attribute plug-in, reading the first Chinese summary information and the first Chinese detailed description information corresponding to the Chinese language environment from the first interface annotation part, and writing them into the global document object corresponding to the Chinese language environment, wherein the first Chinese summary information is used to express the summary information of the interface parameter object and the return object, and the first Chinese detailed description information is used to express the detailed description information of the interface parameter object and the return object;

[0155] Scan the second plug-in in the interface attribute plug-in, read the first Chinese overall description information corresponding to the Chinese language environment from the second interface annotation part, and write it into the global document object corresponding to the Chinese language environment, wherein the first Chinese overall description information is used to express the overall description information of the interface class;

[0156] Scan the third plug-in in the interface attribute plug-in, read the second Chinese summary information and the second Chinese detailed description information corresponding to the Chinese language environment from the annotation part of the third interface, and write them into the global document object corresponding to the Chinese language environment, wherein the second Chinese summary information is used to express the summary information of the interface, and the second Chinese detailed description information is used to express the detailed description information of the information interface;

[0157] Through the fourth plug-in in the interface attribute scanning plug-in, the first Chinese attribute description information corresponding to the Chinese language environment is read from the fourth interface annotation part, and the first Chinese parameter description information corresponding to the Chinese language environment is read from the fifth interface annotation part, and written into the global document object corresponding to the Chinese language environment, wherein the first Chinese attribute description information is used to express the attribute description information of the interface parameter object and the return object, and the first Chinese parameter description information is used to express the description information of the interface parameters.

[0158] In an embodiment of the present application, according to the content described above, each plug-in in the interface attribute scanning plug-in scans the corresponding interface annotation and writes the corresponding attribute description information in the current language environment into the global document object. When the current language environment is the Chinese language environment, taking the first plug-in as an example, only the first Chinese overview information and the first Chinese detailed description information related to the Chinese language environment in the first interface annotation part are read, and written into the global document object corresponding to the current Chinese environment. In this way, the global document object is selected and written according to the current language environment in the configured interface annotation, which speeds up the generation of the global document object. After the preliminary preparation work is completed, only simple operations are required in the follow-up, which greatly improves the work efficiency of interface definition document generation.

[0159] In combination with the above embodiments, in one implementation, the present application further provides an interface document configuration method, which, after caching the global document object, specifically also includes the following contents:

[0160] First, an online browsing request is obtained, and according to the online browsing request of the user, the information in the global document object is converted into interface definition information in a target character string format.

[0161] In an embodiment of the present application, the global document object cached in the above steps is an object that contains various interface attribute information corresponding to each interface in the current language environment. It exists in the system background and cannot be directly obtained by the user. Therefore, corresponding processing is required according to the user's needs. For example, if the user needs to browse the interface information online, after receiving the request, the information in the global document object needs to be formatted, first converted into the format of the target string, which contains the interface attribute information of each interface in the current language environment for subsequent operations.

[0162] Then, the interface definition information in the target string format is parsed and rendered, and each interface information in the current language environment is displayed through a display interface.

[0163] In an embodiment of the present application, after obtaining the interface definition information in the target string format, rendering is performed according to its content, and the interface attribute information of each interface in the current language environment can be displayed to the user through a display interface to achieve the ultimate goal of generating an interface definition document that conforms to the current language environment.

[0164] Optionally, in a specific embodiment, as Figure 3 As shown, Figure 3 This is a schematic diagram of an interface information request process proposed in an embodiment of the present application. After the controller Swagger2Controller receives the user's online browsing request, the content in the global document object is converted into a json string through a converter, and then returned to the controller. After rendering and generation, the various interface information in the current language environment is displayed to the user through the display interface.

[0165] In combination with the above embodiments, in one implementation, the present application further provides an interface document configuration method, which, after caching the global document object, specifically also includes the following contents:

[0166] According to the information export request, the information in the global document object cache is converted into the interface offline document format;

[0167] According to the offline download request, the offline document including the interface information in the current language environment is sent to the user terminal, so that the user terminal can store the offline document locally.

[0168] In an embodiment of the present application, as described above, after obtaining the global document object containing the corresponding interface attribute information under the current language environment, it is also necessary to perform format conversion according to the user's usage requirements. In addition to the online reading method mentioned above, the interface definition document can also be obtained through offline download. First, the information in the cached global document object needs to be converted into an offline document format. After receiving the user's download request, the offline document containing the interface information under the current language environment is downloaded to the user's terminal.

[0169] Optionally, in one embodiment, the user can obtain offline documents in Markdown format through the offline document export function provided by Knife4j, and facilitate the acquisition of platform interface information by online reading and downloading offline documents.

[0170] In an embodiment proposed in the present application, taking the current language environment as the Chinese language environment or the English language environment as an example, the architecture of the interface document configuration proposed in the present application is as follows: Figure 4 As shown, Figure 4 This is a schematic diagram of an interface document configuration architecture proposed in an embodiment of the present application. According to the interface annotations expanded in the present application and the current language environment, an interface attribute scanning plug-in is used to scan and cache the interface attribute information in the current language environment, and finally converted into the format of online reading or offline document according to user needs to provide users with interface definition documents.

[0171] Based on the same design concept, an embodiment of the present application provides an interface document configuration device. Figure 5 , Figure 5 1 is a structural block diagram of an interface document configuration device provided by an embodiment of the present application. Figure 5 As shown, the device comprises:

[0172] Annotation extension module, used to extend interface annotations and add configuration information corresponding to multiple language environments;

[0173] The language environment determination module is used to read the global language variable parameters in the process of loading interface information when the interface attribute scanning plug-in scans each interface definition information to determine the current language environment;

[0174] The attribute configuration information reading module is used to read the attribute configuration information corresponding to the current language environment from the interface annotation through the interface attribute scanning plug-in according to the current language environment, and write it into the global document object;

[0175] The cache module is used to cache the global document object, and the global document object is used to generate an interface document corresponding to the current language environment.

[0176] Optionally, the interface document configuration device further includes:

[0177] A global language parameter configuration acquisition submodule is used to acquire the global language parameter configuration of the platform configuration center, where different configuration values ​​of the global language parameter configuration represent different language environments;

[0178] A current configuration value reading submodule, used to read the current configuration value of the global language parameter configuration when the platform configuration center is started;

[0179] The global language variable parameter setting submodule is used to set the global language variable parameters according to the current configuration value of the global language parameter configuration, so that the interface attribute scanning plug-in can determine the current language environment according to the global language variable parameters.

[0180] Optionally, the annotation extension module further includes:

[0181] The first interface annotation extension submodule is used to add first Chinese summary information, first English summary information, first Chinese detailed description information, and first English detailed description information to the first interface annotation part of the interface annotation, respectively, wherein the first Chinese summary information and the first English summary information are used to express summary information of an interface parameter object and a return object; the first Chinese detailed description information and the first English detailed description information are used to express detailed description information of an interface parameter object and a return object;

[0182] A second interface annotation extension submodule is used to add first Chinese overall description information and first English overall description information to the second interface annotation part of the interface annotation, respectively, wherein the first Chinese overall description information and the first English overall description information are used to express the overall description information of the interface class;

[0183] The third interface annotation extension submodule is used to add second Chinese summary information, second English summary information, second Chinese detailed description information, and second English detailed description information to the third interface annotation part of the interface annotation, respectively, wherein the second Chinese summary information and the second English summary information are used to express the summary information of the interface; the second Chinese detailed description information and the second English detailed description information are used to express the detailed description information of the interface;

[0184] A fourth interface annotation extension submodule, used to add first Chinese attribute description information and first English attribute description information to the fourth interface annotation part of the interface annotation, respectively, wherein the first Chinese attribute description information and the first English attribute description information are used to express attribute description information of an interface parameter object and a return object;

[0185] The fifth interface annotation extension submodule is used to add the first Chinese parameter description information and the first English parameter description information respectively in the fifth interface annotation part of the interface annotation, wherein the first Chinese parameter description information and the first English parameter description information are used to express the description information of the interface parameters.

[0186] Optionally, the attribute configuration information reading module further includes:

[0187] A first reading submodule is used to scan the first plug-in in the plug-in through the interface attributes, read the summary information and detailed description information of the interface parameter object and the return object corresponding to the current language environment from the first interface annotation part, and write them into the global document object;

[0188] A second reading submodule is used to scan the second plug-in in the plug-in through the interface attribute, read the overall description information of the interface class corresponding to the current language environment from the second interface annotation part, and write it into the global document object;

[0189] A third reading submodule is used to scan the third plug-in in the plug-in through the interface attributes, read the overview information and detailed description information of the interface corresponding to the current language environment from the third interface annotation part, and write them into the global document object;

[0190] The fourth reading submodule is used to scan the fourth plug-in in the interface attribute plug-in through the interface attribute, read the attribute description information of the interface parameter object and the return object corresponding to the current language environment from the fourth interface annotation part, and read the description information of the interface parameters corresponding to the current language environment from the fifth interface annotation part, and write it into the global document object.

[0191] Optionally, the interface document configuration device further includes:

[0192] The browsing request acquisition submodule is used to obtain online browsing requests;

[0193] An interface definition information conversion submodule, used to convert the information in the global document object into interface definition information in a target string format according to a user's online browsing request;

[0194] The display submodule is used to parse the interface definition information in the target string format, render and generate it, and display the various interface information in the current language environment through the display interface.

[0195] Optionally, the interface document configuration device further includes:

[0196] The offline document conversion submodule is used to convert the information in the global document object cache into an interface offline document format according to the information export request;

[0197] The offline document sending submodule is used to send the offline document containing the interface information in the current language environment to the user terminal according to the offline download request, so that the user terminal can store the offline document locally.

[0198] Based on the same design concept, another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the interface document configuration method described in any of the above embodiments of the present application are implemented.

[0199] Based on the same design concept, another embodiment of the present application provides an electronic device, such as Figure 6 shown. Figure 6 This is a schematic diagram of an electronic device shown in an embodiment of the present application. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes, the steps in the interface document configuration method described in any of the above embodiments of the present application are implemented.

[0200] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0201] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0202] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0203] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0204] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0205] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0206] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0207] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0208] The above is a detailed introduction to an interface document configuration method, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.< / api>

Claims

1. An interface document configuration method, comprising: Expand the interface annotations and add configuration information corresponding to multiple language environments; When the interface attribute scanning plug-in scans each interface definition information, the global language variable parameters are read in the process of loading the interface information to determine the current language environment; According to the current locale, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the current locale from the interface annotation and writes it into the global document object; The global document object is cached, and the global document object is used to generate an interface document corresponding to the current language environment.

2. The interface document configuration method according to claim 1, characterized in that: The method further comprises: Obtaining a global language parameter configuration from a platform configuration center, where different configuration values ​​of the global language parameter configuration represent different language environments; When the platform configuration center is started, reading the current configuration value of the global language parameter configuration; The global language variable parameter is set according to the current configuration value of the global language parameter configuration, so that the interface attribute scanning plug-in can determine the current language environment according to the global language variable parameter.

3. The interface document configuration method according to claim 1, characterized in that: The multiple language environments include at least a Chinese language environment and an English language environment. The interface annotation is extended to add configuration information corresponding to the multiple language environments, including: In the first interface annotation part of the interface annotation, first Chinese summary information, first English summary information, first Chinese detailed description information, and first English detailed description information are respectively added, wherein the first Chinese summary information and the first English summary information are used to express summary information of the interface parameter object and the returned object; the first Chinese detailed description information and the first English detailed description information are used to express detailed description information of the interface parameter object and the returned object; Adding first Chinese overall description information and first English overall description information to the second interface annotation part of the interface annotation, respectively, wherein the first Chinese overall description information and the first English overall description information are used to express the overall description information of the interface class; Adding second Chinese summary information, second English summary information, second Chinese detailed description information, and second English detailed description information to the third interface annotation part of the interface annotation, respectively, wherein the second Chinese summary information and the second English summary information are used to express the summary information of the interface; the second Chinese detailed description information and the second English detailed description information are used to express the detailed description information of the interface; Adding first Chinese attribute description information and first English attribute description information to the fourth interface annotation part of the interface annotation, respectively, wherein the first Chinese attribute description information and the first English attribute description information are used to express attribute description information of the interface parameter object and the return object; In the fifth interface annotation part of the interface annotation, first Chinese parameter description information and first English parameter description information are respectively added, and the first Chinese parameter description information and the first English parameter description information are used to express the description information of the interface parameters.

4. The interface document configuration method according to claim 3, characterized in that: According to the current locale, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the current locale from the interface annotation and writes it into the global document object, including: Scanning the first plug-in in the plug-in through the interface attribute, reading the summary information and detailed description information of the interface parameter object and the return object corresponding to the current language environment from the first interface annotation part, and writing them into the global document object; Scanning the second plug-in in the plug-in through the interface attribute, reading the overall description information of the interface class corresponding to the current language environment from the annotation part of the second interface, and writing it into the global document object; Scanning the third plug-in in the plug-in through the interface attribute, reading the overview information and detailed description information of the interface corresponding to the current language environment from the third interface annotation part, and writing them into the global document object; Through the fourth plug-in in the interface property scanning plug-in, the attribute description information of the interface parameter object and the return object corresponding to the current language environment is read from the fourth interface annotation part, and the description information of the interface parameters corresponding to the current language environment is read from the fifth interface annotation part and written into the global document object.

5. The interface document configuration method according to claim 4, characterized in that: When the current locale is Chinese, the interface attribute scanning plug-in reads the attribute configuration information corresponding to the Chinese locale from the interface annotation and writes it into the global document object, including: Scanning the first plug-in in the interface attribute plug-in, reading the first Chinese summary information and the first Chinese detailed description information corresponding to the Chinese language environment from the first interface annotation part, and writing them into the global document object corresponding to the Chinese language environment, wherein the first Chinese summary information is used to express the summary information of the interface parameter object and the return object, and the first Chinese detailed description information is used to express the detailed description information of the interface parameter object and the return object; Scan the second plug-in in the interface attribute plug-in, read the first Chinese overall description information corresponding to the Chinese language environment from the second interface annotation part, and write it into the global document object corresponding to the Chinese language environment, wherein the first Chinese overall description information is used to express the overall description information of the interface class; Scan the third plug-in in the interface attribute plug-in, read the second Chinese summary information and the second Chinese detailed description information corresponding to the Chinese language environment from the annotation part of the third interface, and write them into the global document object corresponding to the Chinese language environment, wherein the second Chinese summary information is used to express the summary information of the interface, and the second Chinese detailed description information is used to express the detailed description information of the information interface; Through the fourth plug-in in the interface attribute scanning plug-in, the first Chinese attribute description information corresponding to the Chinese language environment is read from the fourth interface annotation part, and the first Chinese parameter description information corresponding to the Chinese language environment is read from the fifth interface annotation part, and written into the global document object corresponding to the Chinese language environment, wherein the first Chinese attribute description information is used to express the attribute description information of the interface parameter object and the return object, and the first Chinese parameter description information is used to express the description information of the interface parameters.

6. The interface document configuration method according to claim 1, characterized in that: After caching the global document object, the method further includes: Get online browsing requests; According to the user's online browsing request, converting the information in the global document object into interface definition information in a target character string format; The interface definition information in the target string format is parsed and rendered, and the interface information in the current language environment is displayed through the display interface.

7. The interface document configuration method according to claim 1, characterized in that: After caching the global document object, the method further includes: According to the information export request, the information in the global document object cache is converted into the interface offline document format; According to the offline download request, the offline document including the interface information in the current language environment is sent to the user terminal, so that the user terminal can store the offline document locally.

8. An interface document configuration device, characterized in that: The device comprises: Annotation extension module, used to extend interface annotations and add configuration information corresponding to multiple language environments; The language environment determination module is used to read the global language variable parameters in the process of loading interface information when the interface attribute scanning plug-in scans each interface definition information to determine the current language environment; The attribute configuration information reading module is used to read the attribute configuration information corresponding to the current language environment from the interface annotation through the interface attribute scanning plug-in according to the current language environment, and write it into the global document object; The cache module is used to cache the global document object, and the global document object is used to generate an interface document corresponding to the current language environment.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is executed by the processor, the interface document configuration method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the interface document configuration method as described in any one of claims 1 to 7 is implemented.