Method, device, electronic device and medium for generating interface document

By detecting data interaction events and generating timely interface documentation during interface development, the problem of interface documentation becoming invalid due to configuration changes is solved, thereby improving data interaction efficiency and reducing memory resource waste.

CN116302085BActive Publication Date: 2026-03-27PINGAN YIQIANBAO E COMMERCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In API development, if the configuration information of both parties changes, the pre-configured API documentation may become invalid, making data interaction impossible and affecting business progress.

Method used

It detects data interaction events within a preset time period, selects matching target interfaces and configures preset lifespan limits, adds document parameters to the interface parameter fields, generates target interface documents and transmits them to the interaction object, and supports timeliness management of interface information.

Benefits of technology

This avoids the problem of interface documents becoming invalid due to changes in configuration information, reduces the waste of memory resources for expired interface documents in business systems, and improves the efficiency and accuracy of data interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302085B_ABST
    Figure CN116302085B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for generating interface documents, electronic equipment and medium. Through the technical solution of the application, a technical solution of generating corresponding interface documents for the interface information serving this time according to the data interaction object and the data interaction type after determining that a data interaction event will occur in the future can be realized. Thus, on the one hand, the problem that the pre-configured interface document cannot realize data interaction caused by the change of any configuration information of the data interaction parties in the related art is avoided. On the other hand, the problem of wasting memory resources caused by the accumulation of a large number of expired interface documents in the business system can also be reduced by configuring the timeliness of the interface information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to data processing technology, and in particular, to a method and device for generating interface documents, an electronic device, and a medium. BACKGROUND

[0002] With the rapid development of computer processing technology, various system business platforms based on the Internet have been increasingly applied in business processing for user services.

[0003] In related technologies, not only should an interface be written well, but also a perfect interface document should be provided in interface development. Therefore, in the original interface management, a business personnel needs to pre-write an interface document for each interface according to a specification, so that subsequent interaction parties can realize data interaction according to the interface document.

[0004] However, the above-mentioned method has a problem that once the configuration information of any one of the interaction parties changes, the pre-configured interface document may become invalid. Thus, data interaction between the two parties can only be realized after the business personnel manually updates the interface document again, which affects the business progress. SUMMARY

[0005] Embodiments of the present application provide a method and device for generating an interface document, an electronic device, and a medium, to solve the problem that a pre-configured interface document cannot realize data interaction once the configuration information changes in related technologies.

[0006] According to an aspect of the embodiments of the present application, a method for generating an interface document is provided, which includes the following steps.

[0007] Detecting that there is an interaction event in a future preset time period, the interaction event being a preset type of data interaction required by at least two to-be-interacted objects, wherein each to-be-interacted object belongs to a different business platform;

[0008] Selecting a target interface matched with the preset type from an interface list, and configuring a preset survival time limit matched with the interaction event for the target interface;

[0009] Adding a document parameter for realizing data interaction of the to-be-interacted objects on a parameter field of the target interface, obtaining a target interface document, and transmitting the target interface document to the at least two to-be-interacted objects through the target interface.

[0010] Optionally, in another embodiment based on the above-mentioned method of the present application, the step of adding a document parameter for realizing data interaction of the to-be-interacted objects on a parameter field of the target interface includes the following steps.

[0011] adding an access address and an access time period of each object to be interacted on an access control parameter field of the target interface; and

[0012] adding a service interaction type of each object to be interacted on a service control parameter field of the target interface; and

[0013] adding a version number of each object to be interacted on a service control parameter field of the target interface.

[0014] Optionally, in another embodiment based on the above method of the present application, the adding of the document parameters for implementing the data interaction of the objects to be interacted on the parameter field of the target interface comprises:

[0015] configuring interface information, input parameter information, output parameter information and return code information corresponding to the target interface;

[0016] The interface information comprises an interface name and an interface program description.

[0017] The input parameter information comprises an input parameter description, an input parameter format template string and an input parameter format definition string.

[0018] The output parameter information comprises an output parameter description and an output parameter string.

[0019] The return code information comprises a return code description and a return code string.

[0020] Optionally, in another embodiment based on the above method of the present application, the transmitting of the target interface document to the at least two objects to be interacted through the target interface comprises:

[0021] configuring a test case code corresponding to the target interface, and adding the test case code in the target interface document, wherein the test case code is used for testing the target interface.

[0022] Optionally, in another embodiment based on the above method of the present application, after the adding of the document parameters for implementing the data interaction of the objects to be interacted on the parameter field of the target interface and obtaining of the target interface document, the method further comprises:

[0023] generating a parameter mapping script corresponding to the target interface, establishing a mapping relationship between the target interface and the parameter mapping script, and storing the mapping relationship into the interface list;

[0024] when receiving an interaction starting instruction, transmitting the target interface document to the at least two objects to be interacted through the target interface based on the parameter mapping script in the interface list.

[0025] Optionally, in another embodiment based on the above method of the present application, the configuring the target interface with a preset survival time limit matching the interaction event comprises:

[0026] detecting a first interaction permission corresponding to each to-be-interacted object, and detecting a second interaction permission of a business platform to which each to-be-interacted object belongs;

[0027] when it is determined that the first interaction permission and the second interaction permission are short-time interaction permissions, configuring the target interface with a preset survival time limit matching the interaction event.

[0028] Optionally, in another embodiment based on the above method of the present application, the transmitting the target interface document to the at least two to-be-interacted objects through the target interface comprises:

[0029] encrypting the target interface document based on a preset private key parameter to obtain an encrypted interface document;

[0030] transmitting the encrypted interface document and a public key parameter to the at least two to-be-interacted objects through the target interface.

[0031] According to yet another aspect of embodiments of the present application, a device for generating an interface document is provided, and the device is characterized in that it comprises:

[0032] an obtaining module configured to detect that an interaction event exists in a preset time period in the future, the interaction event being a preset type of data interaction required by at least two to-be-interacted objects, wherein each to-be-interacted object belongs to a different business platform;

[0033] a selecting module configured to select a target interface matching the preset type from an interface list, and configure the target interface with a preset survival time limit matching the interaction event;

[0034] a transmitting module configured to add a document parameter for implementing data interaction of the to-be-interacted objects on a parameter field of the target interface to obtain a target interface document, and transmit the target interface document to the at least two to-be-interacted objects through the target interface.

[0035] According to yet another aspect of embodiments of the present application, an electronic device is provided, and the electronic device is characterized in that it comprises:

[0036] a memory configured to store executable instructions; and

[0037] a display configured to execute the executable instructions with the memory to complete the operations of any of the above-mentioned methods for generating an interface document.

[0038] According to still another aspect of the embodiments of the present application, a computer readable storage medium is provided for storing computer readable instructions which, when executed, perform the operations of any of the above described methods of generating an interface document.

[0039] In the present application, it can be detected that there is an interaction event in a future preset time period, the interaction event is that at least two to-be-interacted objects need to perform a preset type of data interaction, wherein each to-be-interacted object belongs to a different business platform; a target interface matched with the preset type of data is selected from an interface list, and the target interface is configured with a preset survival time limit which is the same as the preset time period; a document parameter for realizing data interaction of the to-be-interacted objects is added to a parameter field of the target interface, a target interface document is obtained, and the target interface document is transmitted to the at least two to-be-interacted objects through the target interface. By applying the technical solution of the present application, a technical solution of generating a corresponding interface document for the interface information serving this time according to the data interaction object and the data interaction type after determining that a data interaction event will occur in the future can be realized. Thus, on the one hand, the problem that the pre-configured interface document cannot realize data interaction caused by the change of any configuration information of the data interaction parties in the related art is avoided. On the other hand, by configuring the interface information with timeliness, the problem of wasting memory resources caused by the accumulation of a large number of expired interface documents in the business system can be reduced.

[0040] The technical solutions of the present application will be described in further detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0041] The accompanying drawings, which form a part of the specification, illustrate embodiments of the present application and, together with the description, serve to explain the principles of the present application.

[0042] The present application can be more clearly understood with reference to the following detailed description in conjunction with the accompanying drawings, in which:

[0043] Figure 1 A method for generating an interface document is shown in the accompanying drawings;

[0044] Figure 2 A method for generating an interface document is shown in the accompanying drawings;

[0045] Figure 3 A method for generating an interface document is shown in the accompanying drawings;

[0046] Figure 4 A structure diagram of an electronic device is shown in the accompanying drawings;

[0047] Figure 5 Fig. 1 shows a structural schematic diagram of an electronic device according to an embodiment of the present application;

[0048] Figure 6 Fig. 2 shows a schematic diagram of a storage medium according to an embodiment of the present application. DETAILED DESCRIPTION

[0049] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of the components and steps set forth in the embodiments, as well as the numerical expressions and numerical values, are not limiting to the scope of the present application unless otherwise specifically stated.

[0050] It should be understood that the sizes of the various portions shown in the drawings are not necessarily drawn to scale.

[0051] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the scope of the application or its application or uses.

[0052] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail herein. However, where appropriate, such techniques, methods, and devices can be viewed as part of the specification and may

[0053] It should be noted that like reference numerals and letters in the various figures indicate similar items, and thus, once an item is defined in one figure, it is not necessarily discussed further in subsequent figures.

[0054] In addition, the technical solutions among the various embodiments of the present application can be combined with each other, but it must be based on the fact that a person of ordinary skill in the art can realize the combination, and when the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist and is not within the scope of protection required by the present application.

[0055] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present application are only used to explain the relative positional relationship, movement condition, etc. between the components, and if the specific posture changes, the directional indications will also change accordingly.

[0056] The method for generating an interface document according to the exemplary embodiments of the present application will be described below with reference to Figures 1-3 It should be noted that the following application scenarios are only shown to facilitate the understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. On the contrary, the embodiments of the present application can be applied to any applicable scenario.

[0057] The application further provides a method and device for generating an interface document, an electronic device, and a medium.

[0058] Figure 1 A flowchart of a method for generating an interface document according to an embodiment of the application is schematically shown. As shown in the figure, the method comprises the following steps. Figure 1

[0059] S101, detecting that there is an interaction event in a future preset time period, the interaction event being that at least two to-be-interacted objects need to perform a preset type of data interaction, wherein each to-be-interacted object belongs to a different business platform.

[0060] S102, selecting a target interface matching the preset type of data from an interface list, and configuring the target interface with a preset survival time limit identical to the preset time period.

[0061] S103, adding a document parameter for implementing data interaction of the to-be-interacted objects on a parameter field of the target interface, obtaining a target interface document, and transmitting the target interface document to the at least two to-be-interacted objects through the target interface.

[0062] In this way, the interface document platformization is a powerful guarantee for reducing the docking cost of the business platform and strengthening the communication and coordination with other business platforms.

[0063] Further, the interface document is a specification for interaction between business platforms. It can be understood that, in today's high-speed technological development, the business transactions between various business platforms are also increasing day by day, and the corresponding business transaction interface documents have also increased accordingly. Most of the traditional document interactions are transmitted by Word, PTF, Excel, etc. Although it is relatively convenient, with the expansion of product demand and the increase of business scenarios, the iteration between interfaces is also relatively frequent, and the corresponding interface documents are also constantly updated.

[0064] In one way, the interface document is used to describe the content of the interface program, such as the format of the input parameter and the format of the output parameter. It can be understood that if only the program is written without writing the interface document, the program written by business platform A is difficult to use for business platform B. Therefore, in addition to writing the interface program, the business personnel of the business platform also need to write the interface document.

[0065] In one way, when the interface program changes or the related configuration information changes, the pre-configured interface document may also be invalid. Therefore, in this way, the business personnel need to re-modify the interface document according to the changes of the input parameter and the output parameter to ensure the accuracy of the interface document, thereby providing data services for both parties of data interaction.

[0066] ​However, when the business system faces a large number of business transactions, the above complex operation mode may cause the business personnel to be unable to modify each interface document in time, thereby affecting the business processing progress.

[0067] Further, in view of the above problems, the application provides a method for generating an interface document, which is a technical solution for generating a corresponding interface document for the interface information provided by the service this time according to the data interaction object and the data interaction type after determining that a future data interaction event will occur.

[0068] Further, the application combines Figure 2 The specific steps of the scheme are described as follows:

[0069] Step 1: detecting that there is an interaction event in a future preset time period.

[0070] The interaction event is a preset type of data interaction required by at least two to-be-interacted objects, wherein each to-be-interacted object belongs to a different business platform.

[0071] In one way, the application can not preconfigure a corresponding interface document for each interface. Instead, when it is known that a data interaction event will occur at a certain time point, the step of creating an interface document for a certain interface is started.

[0072] In one way, the detection of the data interaction event can be notified by a unified business platform. Alternatively, at least one to-be-interacted object in the at least two to-be-interacted objects can be notified.

[0073] In another way, the application does not limit the future preset time period, for example, it can be 10 minutes, 30 minutes, etc.

[0074] Step 2: selecting a target interface matching the preset type from an interface list.

[0075] Further, the interface list of the application embodiment can include a plurality of to-be-selected interfaces for different types of data interaction. It can be understood that, in order to ensure the success of subsequent data interaction, the application embodiment needs to select a target interface matching the preset type from a plurality of to-be-selected interfaces.

[0076] In one way, the preset type can be used to represent the data type of this data interaction, or can be used to represent the business interaction type of this data interaction. As an example, the data type can be image, video, text, letter, etc. As another example, the business interaction type can be a payment business type, a user profile business type, a development business type, a test business type, etc.

[0077] Step 3, detecting the first interaction permission corresponding to each to-be-interacted object, and detecting the second interaction permission of the business platform to which each to-be-interacted object belongs.

[0078] Step 4, when it is determined that the first interaction permission and the second interaction permission are short-time interaction permissions, configuring a preset survival time limit matched with the interaction event for the target interface.

[0079] In one way, if the to-be-interacted object and the business platform to which the to-be-interacted object belongs are determined by the embodiment of the present application to be short-time interaction permissions, it is determined that the data interaction between the business objects is also limited data interaction. Therefore, in order to avoid the problem of excessive redundant data caused by the accumulation of a large number of expired interface documents in the business platform, the present application can configure a preset survival time limit for the interface.

[0080] In other words, the target interface and the corresponding interface document for the present interaction event are only for the present data interaction event. That is, once the present data interaction event stops, the interface can be invalidated. In this way, the long-term existence of useless interfaces and useless interface documents is avoided.

[0081] It can be understood that when the embodiment of the present application detects again that a data interaction event will occur next time, the corresponding interface and interface document can be generated for the subsequent data interaction event.

[0082] In one way, the length of the preset survival time limit of the target interface should be determined based on the present interaction event. As an example, if the interaction objects of the present interaction event are more, or the interaction data is more, or the interaction business type is more complex, the preset survival time limit is also longer. Conversely, it is shorter.

[0083] Step 5, adding the access address and the access time period of each to-be-interacted object on the access control parameter field of the target interface, and adding the business interaction type of each to-be-interacted object on the business control parameter field of the target interface, and adding the version number of each to-be-interacted object on the business control parameter field of the target interface.

[0084] Step 6, configuring the interface information, input parameter information, output parameter information, and return code information corresponding to the target interface.

[0085] The interface information includes: interface name, interface program description;

[0086] The input parameter information includes: input parameter description, input parameter format template string, and input parameter format definition string;

[0087] The output parameter information includes: output parameter description and output parameter string.

[0088] The return code information includes a return code description and a return code string.

[0089] In one approach, the embodiment of the application can add a definition string (optionalStr) of a corresponding format in each field bit of the input, output, and return code parameters corresponding to the target interface. In addition, the type (string or integer, etc.) of the response format is added.

[0090] As an example, the embodiment of the application can also add whether it is necessary to fill in, whether it is displayed externally, whether it is non-empty, whether it is non-negative, etc. on the parameter field of the target interface. In addition, according to the shape of the input parameter, it can be selected whether to encrypt, and the access address of each interactive object, etc.

[0091] Step 7, after obtaining the target interface document, the test case code corresponding to the target interface is configured, and the test case code is added in the target interface document.

[0092] The test case code is used for testing the target interface.

[0093] In one approach, the embodiment of the application can apply at least one test environment machine for the target interface, and deploy the test case code corresponding to the target interface to realize the testing use of the target interface.

[0094] Step 8, after generating the parameter mapping script corresponding to the target interface and establishing the mapping relationship between the target interface and the parameter mapping script, the mapping relationship is stored in the interface list.

[0095] In one approach, the embodiment of the application can also generate the parameter mapping script used for executing data interaction after generating the interface document. In another approach, the embodiment of the application needs to establish the mapping relationship between the target interface and the parameter mapping script, and store the mapping relationship in the interface list. In order to realize the transmission of the interface document by querying the interface list to obtain the corresponding script.

[0096] In one approach, the embodiment of the application can also be adjusted online for special processing requirements, and a specified test environment database is configured for convenient interface calling. The interface script will be synchronized to the SVN address of the corresponding script management project, and the manually modified script in the SVN can also be actively synchronized to the management system for script replacement.

[0097] Step 9, when receiving the interaction start instruction, the target interface document is transmitted to at least two interactive objects through the target interface based on the parameter mapping script in the interface list.

[0098] In the present application, it can be detected that there is an interaction event in a future preset time period, the interaction event is that at least two to-be-interacted objects need to perform a preset type of data interaction, wherein each to-be-interacted object belongs to a different business platform; a target interface matching the preset type of data is selected from an interface list, and the target interface is configured with a preset survival time limit which is the same as the preset time period; a document parameter for realizing data interaction of the to-be-interacted object is added to a parameter field of the target interface, a target interface document is obtained, and the target interface document is transmitted to the at least two to-be-interacted objects through the target interface.

[0099] By applying the technical solution of the present application, an interface document corresponding to interface information provided by the present service according to the data interaction object and the data interaction type can be generated after determining that a data interaction event will occur in the future. Thus, on the one hand, the problem that the pre-configured interface document cannot realize data interaction caused by the change of any configuration information of the data interaction parties in the related art is avoided. On the other hand, by configuring the timeliness of the interface information, the problem of wasting memory resources caused by the accumulation of a large number of expired interface documents in the business system can be reduced.

[0100] Optionally, in another embodiment based on the above method of the present application, adding a document parameter for realizing data interaction of the to-be-interacted object on the parameter field of the target interface comprises:

[0101] adding an access address and an access time period of each to-be-interacted object on an access control parameter field of the target interface; and,

[0102] adding a business interaction type of each to-be-interacted object on a business control parameter field of the target interface; and,

[0103] adding a version number of each to-be-interacted object on the business control parameter field of the target interface.

[0104] Optionally, in another embodiment based on the above method of the present application, adding a document parameter for realizing data interaction of the to-be-interacted object on the parameter field of the target interface comprises:

[0105] configuring interface information, input parameter information, output parameter information and return code information corresponding to the target interface;

[0106] The interface information includes: interface name, interface program description;

[0107] The input parameter information includes: input parameter description, input parameter format template string, and format definition string of the input parameter;

[0108] The output parameter information comprises: an output parameter description and an output parameter string.

[0109] The return code information comprises: a return code description and a return code string.

[0110] Optionally, in another embodiment based on the above method of the application, after adding the document parameter for realizing the data interaction of the to-be-interacted object on the parameter field of the target interface to obtain the target interface document, the method further comprises:

[0111] configuring a test case code corresponding to the target interface, and adding the test case code in the target interface document, wherein the test case code is used for testing the target interface.

[0112] Optionally, in another embodiment based on the above method of the application, after adding the document parameter for realizing the data interaction of the to-be-interacted object on the parameter field of the target interface to obtain the target interface document, the method further comprises:

[0113] generating a parameter mapping script corresponding to the target interface, establishing a mapping relationship between the target interface and the parameter mapping script, and storing the mapping relationship into the interface list;

[0114] when receiving an interaction starting instruction, transmitting the target interface document to the at least two to-be-interacted objects through the target interface based on the parameter mapping script in the interface list.

[0115] Optionally, in another embodiment based on the above method of the application, the step of configuring a preset survival time limit matched with the interaction event for the target interface comprises:

[0116] detecting a first interaction permission corresponding to each to-be-interacted object, and detecting a second interaction permission of a business platform to which each to-be-interacted object belongs;

[0117] when it is determined that the first interaction permission and the second interaction permission are short-time interaction permissions, configuring a preset survival time limit matched with the interaction event for the target interface.

[0118] Optionally, in another embodiment based on the above method of the application, the step of transmitting the target interface document to the at least two to-be-interacted objects through the target interface comprises:

[0119] encrypting the target interface document based on a preset private key parameter to obtain an encrypted interface document;

[0120] transmitting the encrypted interface document and a public key parameter to the at least two to-be-interacted objects through the target interface.

[0121] In one way, in combination Figure 3 , continue to make specific description of the method of generating interface document proposed in this application:

[0122] Step a, the business personnel log in the interface document configuration management platform, query the interface in the interface list to determine whether to check each interface has been normally published.

[0123] Step b, when detecting that there is an interaction event in the future preset time period, request the return of the interface list to the interface document configuration management platform.

[0124] Step c, according to the returned interface list, select the corresponding interface to perform external standardization operation, display the interface parameter field, at this time, you can set the example value, default value, whether to display externally, size, category, note, etc., at the same time, you can set the exclusive explanation appendix of a certain specific field, and the appendix format supports rich text editing.

[0125] Step d, after the interface field adjustment, add the document parameter for realizing the data interaction of the to-be-interacted object on the parameter field of the target interface, and obtain the interface document.

[0126] It can include the task number corresponding to the current interface, the release version, the existing product code can be used for document division, a new product code can be created, the document is hung under this product directory, the specified access address is generated, and the corresponding document version history control record document field adjustment record is generated.

[0127] Step e, after the interface document is generated, the parameter mapping script is generated, which can be adjusted online for special processing requirements, and configured in the specified test environment database, which is convenient for interface calling and use, the interface script will be synchronized to the corresponding script management engineering SVN address, and the manually modified script in SVN can also be synchronized to the management system to replace the script.

[0128] Step f, the interface can apply for a test environment machine for code deployment; at the same time, according to the address of the business platform side, the opening process can be initiated to facilitate the business platform to connect.

[0129] Step g, during the process of business platform connection, the test business platform key information of the corresponding test environment can be generated according to the existing business system requirements, and sent to the email of the related demand task initiator, the business can synchronize the business platform and the test personnel, and support synchronous configuration of the key information of the business platform side.

[0130] Step h, the target interface document is transmitted to at least two to-be-interacted objects through the target interface.

[0131] In one mode, the interface document generation method of the embodiment of the application can shorten the docking distance between various business platforms, facilitate more rapid implementation of business scenarios, and also reduce the communication cost between users and development architecture.

[0132] In addition, from the architecture level, the interface document generation method of the embodiment of the application can reduce the applications and departments that need to interact and be involved, facilitate process control; from the personnel configuration, the interface can be presented by the development, and discussions can be initiated for relevant business parameters to facilitate process promotion and shorten the development time.

[0133] By applying the technical solution of the application, an interface document corresponding to interface information provided for this service according to the data interaction object and the data interaction type can be generated after determining that a future data interaction event will occur. Thus, on the one hand, the problem that the pre-configured interface document cannot realize data interaction due to a change in any configuration information of the data interaction parties in the related art is avoided. On the other hand, by configuring the timeliness of the interface information, the problem of wasting memory resources caused by the accumulation of a large number of expired interface documents in the business system is reduced.

[0134] Optionally, in another embodiment of the application, as shown in Figure 4 The application further provides an apparatus for generating an interface document. The apparatus comprises:

[0135] The acquisition module 201 is configured to detect that an interaction event exists in a future preset time period, the interaction event being a data interaction of a preset type required by at least two to-be-interacted objects, wherein each to-be-interacted object belongs to a different business platform;

[0136] The selection module 202 is configured to select a target interface matching the preset type from an interface list, and configure a preset survival time limit matching the interaction event for the target interface;

[0137] The transmission module 203 is configured to add a document parameter for realizing data interaction of the to-be-interacted object on a parameter field of the target interface, obtain a target interface document, and transmit the target interface document to the at least two to-be-interacted objects through the target interface.

[0138] By applying the technical solution of the present application, a technical solution of generating a corresponding interface document for the interface information provided by the service for this time according to the data interaction object and the data interaction type after determining that a future data interaction event will occur can be realized. Thus, on the one hand, the problem that the pre-configured interface document cannot realize data interaction due to the change of any configuration information of the data interaction parties in the related art is avoided. On the other hand, by configuring the timeliness of the interface information, the problem of wasting memory resources caused by the accumulation of a large number of expired interface documents in the business system can be reduced.

[0139] In another embodiment of the present application, the selection module 202 is configured to perform the following steps:

[0140] On the access control parameter field of the target interface, the access address and the access time period of each to-be-interacted object are added; and,

[0141] On the service control parameter field of the target interface, the service interaction type of each to-be-interacted object is added; and,

[0142] On the service control parameter field of the target interface, the version number of each to-be-interacted object is added.

[0143] In another embodiment of the present application, the selection module 202 is configured to perform the following steps:

[0144] The interface information, the input parameter information, the output parameter information, and the return code information corresponding to the target interface are configured;

[0145] The interface information includes: interface name, interface program description;

[0146] The input parameter information includes: input parameter description, input parameter format template string, and input parameter format definition string;

[0147] The output parameter information includes: output parameter description and output parameter string;

[0148] The return code information includes: return code description and return code string.

[0149] In another embodiment of the present application, the selection module 202 is configured to perform the following steps:

[0150] The test case code corresponding to the target interface is configured, and the test case code is added in the target interface document, wherein the test case code is used for testing the target interface.

[0151] In another embodiment of the present application, the selecting module 202 is configured to perform the following steps:

[0152] After generating the parameter mapping script corresponding to the target interface and establishing the mapping relationship between the target interface and the parameter mapping script, the mapping relationship is stored in the interface list;

[0153] When receiving the interaction starting instruction, the target interface document is transmitted to the at least two objects to be interacted through the target interface based on the parameter mapping script in the interface list.

[0154] In another embodiment of the present application, the selecting module 202 is configured to perform the following steps:

[0155] Detecting the first interaction permission corresponding to each object to be interacted, and detecting the second interaction permission of the business platform to which each object to be interacted belongs;

[0156] When it is determined that the first interaction permission and the second interaction permission are short-time interaction permissions, a preset survival time limit matching the interaction event is configured for the target interface.

[0157] In another embodiment of the present application, the selecting module 202 is configured to perform the following steps:

[0158] Based on the preset private key parameter, the target interface document is encrypted to obtain an encrypted interface document;

[0159] The encrypted interface document and the public key parameter are transmitted to the at least two objects to be interacted through the target interface.

[0160] The present application also provides an electronic device for executing the above-mentioned method for generating an interface document. Please refer to Figure 5 which shows a schematic diagram of an electronic device provided by some embodiments of the present application. As shown in Figure 5 The electronic device 3 includes a processor 300, a memory 301, a bus 302 and a communication interface 303, wherein the processor 300, the communication interface 303 and the memory 301 are connected through the bus 302; the memory 301 stores a computer program executable on the processor 300, and the processor 300 executes the computer program to perform the method for generating an interface document provided by any of the preceding embodiments of the present application.

[0161] The memory 301 can include a high-speed random access memory (RAM) and can also include a non-volatile memory such as at least one disk memory. The communication connection between the apparatus network element and at least one other network element is realized through at least one communication interface 303 (which can be wired or wireless), and the Internet, a wide area network, a local network, a metropolitan area network, etc. can be used.

[0162] The bus 302 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 301 is used to store programs, and the processor 300 executes the programs after receiving execution instructions. The data recognition method disclosed in any of the embodiments of the present application can be applied to the processor 300 or implemented by the processor 300.

[0163] The processor 300 can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by integrated logic circuits or instructions in the form of software in the processor 300. The processor 300 described above can be a general-purpose processor, including a processor (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-to-program gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. Each method, step and logic block disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium in the art. The storage medium is located in the memory 301, and the processor 300 reads the information in the memory 301 and combines the hardware to complete the steps of the above method.

[0164] The electronic device provided by the embodiments of the present application and the data recognition method provided by the embodiments of the present application have the same beneficial effects as the methods used, run or implemented.

[0165] The embodiments of the present application also provide a computer-readable storage medium corresponding to the method of generating an interface document provided by the preceding embodiments. Please refer toFigure 6 The computer readable storage medium shown in the figure is an optical disc 40, on which a computer program (i.e. a program product) is stored, which, when run by a processor, will execute the method for generating an interface document provided by any of the preceding embodiments.

[0166] It should be noted that examples of the computer readable storage medium can also include, but are not limited to, a phase change memory (PRAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), other types of random access memory (RAM), a read only memory (ROM), an electrically erasable programmable read only memory (EEPROM), a flash memory, or other optical, magnetic storage medium, which will not be listed one by one here.

[0167] The computer readable storage medium provided by the above embodiments of the present application and the method for data recognition provided by the embodiments of the present application are based on the same inventive concept, and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.

[0168] It should be noted that:

[0169] In the specification provided herein, a large number of specific details are described. However, it can be understood that the embodiments of the present application can be practiced without these specific details. In some examples, well-known structures and techniques are not shown in detail in order not to obscure the understanding of the present specification.

[0170] Similarly, it should be understood that, in order to simplify the present application and help understand one or more of the various inventive aspects, various features of the present application are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the present application.

[0171] In addition, those skilled in the art can understand that although some embodiments described herein include certain features included in other embodiments but not others, the combination of features of different embodiments means within the scope of the present application and forms different embodiments.

[0172] The above is only the preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any changes or replacements easily thought of by those skilled in the art within the technical scope disclosed by the present application should be covered within the protection scope of the present application.

Claims

1. A method of generating an interface document, characterized by, The method comprises the following steps: detecting that there is an interaction event in a preset time period in the future, the interaction event being a preset type of data interaction required by at least two to-be-interacted objects, wherein each to-be-interacted object belongs to a different business platform; selecting a target interface matched with the preset type from an interface list, and configuring a preset survival time limit matched with the interaction event for the target interface; the interface list comprises a plurality of to-be-selected interfaces for different types of data interaction, and the preset type is used to represent the data type of the data interaction or the business interaction type of the data interaction; adding a document parameter for realizing the data interaction of the to-be-interacted objects on a parameter field of the target interface to obtain a target interface document, and transmitting the target interface document to the at least two to-be-interacted objects through the target interface; The method comprises the following steps: detecting a first interaction permission corresponding to each to-be-interacted object, and detecting a second interaction permission of a business platform to which each to-be-interacted object belongs; when it is determined that the first interaction permission and the second interaction permission are short-time interaction permissions, configuring a preset survival time limit matched with the interaction event for the target interface.

2. The method of claim 1, wherein, The method comprises the following steps: adding an access address and an access time period of each to-be-interacted object on an access control parameter field of the target interface; and adding a business interaction type of each to-be-interacted object on a business control parameter field of the target interface; and adding a version number of each to-be-interacted object on the business control parameter field of the target interface.

3. The method of claim 1 or 2, wherein, The method comprises the following steps: configuring interface information, input parameter information, output parameter information, and return code information corresponding to the target interface; The interface information comprises an interface name and an interface program description. The input parameter information comprises input parameter description, input parameter format template string, and format definition string of the input parameter. The output parameter information comprises output parameter description and output parameter string. The return code information comprises return code description and return code string.

4. The method of claim 1, wherein, After adding the document parameter for realizing the data interaction of the to-be-interacted objects on the parameter field of the target interface to obtain the target interface document, the method further comprises the following steps: configuring a test case code corresponding to the target interface, and adding the test case code in the target interface document, wherein the test case code is used for testing the target interface.

5. The method of claim 1 or 4, wherein, The method comprises the following steps: generating a parameter mapping script corresponding to the target interface, establishing a mapping relationship between the target interface and the parameter mapping script, and storing the mapping relationship in the interface list. When receiving the interaction starting instruction, the target interface document is transmitted to the at least two objects to be interacted through the target interface based on a parameter mapping script in the interface list.

6. The method of claim 1, wherein, The transmitting the target interface document to the at least two objects to be interacted through the target interface comprises: The target interface document is encrypted based on a preset private key parameter to obtain an encrypted interface document; The encrypted interface document and a public key parameter are transmitted to the at least two objects to be interacted through the target interface.

7. An apparatus for generating interface documentation, the apparatus comprising: Comprise: The acquisition module is configured to detect that there is an interaction event in a future preset time period, the interaction event being a preset type of data interaction required by at least two objects to be interacted, wherein each object to be interacted belongs to a different business platform; The selection module is configured to select a target interface matched with the preset type from an interface list, and configure a preset survival time limit matched with the interaction event for the target interface; the interface list comprises a plurality of to-be-selected interfaces for different types of data interaction, and the preset type is used to represent a data type of the data interaction or a business interaction type of the data interaction; The transmission module is configured to add a document parameter for realizing data interaction of the objects to be interacted on a parameter field of the target interface to obtain a target interface document, and transmit the target interface document to the at least two objects to be interacted through the target interface; The selection module is further configured to: detect a first interaction permission corresponding to each object to be interacted, and detect a second interaction permission of a business platform to which each object to be interacted belongs; when it is determined that the first interaction permission and the second interaction permission are short-time interaction permissions, configure a preset survival time limit matched with the interaction event for the target interface.

8. An electronic device, comprising: Comprise: a memory for storing executable instructions; and a processor for executing the executable instructions to complete the operations of the method for generating an interface document in any one of claims 1-6.

9. A computer readable storage medium for storing computer readable instructions, characterized in that, The instructions are executed by the processor to perform the operations of the method for generating an interface document in any one of claims 1-6.

Citation Information

Patent Citations

  • Interface document generation method and device

    CN111258627A

  • Service data access method and system

    CN114915435A