Development method, device and equipment of client interface and storage medium

CN115757145BActive Publication Date: 2026-09-15BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211463481.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2026-09-15
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

[0002]通常需要为客户端开发一个新接口时,需要开发人员制定接口数据格式,继而按照制定的接口数据格式进行代码开发,然后需要等待对服务端接口进行开发完毕后才能对服务端和客户端进行接口联调,使得客户端接口对服务端接口的开发较为依赖

Benefits of technology

[0017] The client interface development method, apparatus, device, and storage medium disclosed herein automatically generate client interface code according to the interface documentation, and match candidate data in a set dictionary with the target data structure in the client interface code used to store server-side returned data, and/or match candidate data in the set dictionary with comments on the target data structure in the interface documentation, to obtain simulated server-side returned data. Since the simulated server-side returned data can be automatically constructed based on the target data structure, there is no need for joint debugging with the server-side interface; the constructed simulated returned data can be directly used to verify the functionality of the client interface, decoupling the client's dependency on server-side interface development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757145B_ABST
    Figure CN115757145B_ABST
Patent Text Reader

Abstract

The development method, device and equipment of the client interface and the storage medium of the present disclosure relate to the technical field of computers, in particular to the technical field of cloud storage, cloud computing, deep learning and the like. The specific implementation scheme is: the client interface code is automatically generated according to the interface document, and the candidate data in the setting dictionary is matched with the target data structure for storing the server return data in the client interface code and / or the candidate data in the setting dictionary is matched with the annotation of the target data structure in the interface document, to obtain the simulated return data of the server. Since the simulated return data of the server can be automatically constructed according to the target data structure, it is not necessary to carry out joint debugging with the server interface, and the constructed simulated return data can be directly used to verify the function of the client interface, thereby decoupling the dependence of the client on the development of the server interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, specifically to cloud storage, cloud computing, deep learning and other technical fields, and can be applied to scenarios such as interface development, especially to methods, devices, equipment and storage media for developing client interfaces. Background Technology

[0002] Typically, when developing a new interface for a client, developers need to define the interface data format, then develop the code according to the defined interface data format, and then wait for the server-side interface to be developed before they can perform interface integration testing between the server and the client. This makes the client interface highly dependent on the development of the server-side interface. Summary of the Invention

[0003] This disclosure provides a method, apparatus, device, and storage medium for developing a client interface.

[0004] According to one aspect of this disclosure, a method for developing a client interface is provided, comprising:

[0005] Obtain the API documentation;

[0006] Generate client interface code based on the interface documentation;

[0007] The candidate data in the set dictionary is matched with the target data structure in the client interface code used to store the data returned by the storage client, and / or the candidate data in the set dictionary is matched with the comments on the target data structure in the interface document to obtain the matching candidate data;

[0008] The matched candidate data is used as the simulated return data of the server, and the simulated return data is used to test the client interface.

[0009] According to another aspect of this disclosure, a development apparatus for a client interface is provided, comprising:

[0010] The retrieval module is used to retrieve the API documentation;

[0011] The generation module is used to generate client interface code based on the interface document;

[0012] The matching module is used to match candidate data in the set dictionary with the target data structure in the client interface code used to store data returned by the storage client, and / or match candidate data in the set dictionary with comments on the target data structure in the interface document to obtain matching candidate data;

[0013] The debugging module is used to use the matched candidate data as simulated return data from the server, and to test the client interface using the simulated return data.

[0014] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect of this disclosure.

[0015] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the method described in the first aspect of this disclosure.

[0016] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in the first aspect of this disclosure.

[0017] The client interface development method, apparatus, device, and storage medium disclosed herein automatically generate client interface code according to the interface documentation, and match candidate data in a set dictionary with the target data structure in the client interface code used to store server-side returned data, and / or match candidate data in the set dictionary with comments on the target data structure in the interface documentation, to obtain simulated server-side returned data. Since the simulated server-side returned data can be automatically constructed based on the target data structure, there is no need for joint debugging with the server-side interface; the constructed simulated returned data can be directly used to verify the functionality of the client interface, decoupling the client's dependency on server-side interface development.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0019] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0020] Figure 1 This is a flowchart of the interface function development process in related technologies;

[0021] Figure 2 This is a flowchart illustrating an open method for a client interface provided in this disclosure;

[0022] Figure 3 This is a flowchart illustrating another open method for client interfaces provided in this disclosure;

[0023] Figure 4This is a flowchart illustrating another method for developing a client interface provided in this disclosure;

[0024] Figure 5 This is a schematic diagram of the software system structure;

[0025] Figure 6 This is a schematic diagram of the structure of an open device with a client interface provided in this disclosure;

[0026] Figure 7 This is a block diagram of an electronic device used to implement the open method of the client interface in the embodiments of this disclosure. Detailed Implementation

[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0028] like Figure 1 In the interface function development flowchart shown in the related technologies, based on requirements, developers define the interface data structures for both the server and client sides in the interface documentation. Then, client-side and server-side interface code need to be developed separately according to the interface documentation. Subsequently, the client-side interface code needs to undergo integration testing after the server-side interface code is developed; only after successful integration testing can client-side functions dependent on the interface be developed. It is evident that in these related technologies, the client-side interface is highly dependent on the development of the server-side interface.

[0029] To decouple the client's dependency on server-side interface development and improve client development efficiency and code reliability, this disclosure automatically generates client-side interface code according to the interface documentation. Candidate data from a specified dictionary is matched with the target data structure in the client-side interface code used to store server-side returned data, and / or the candidate data from the specified dictionary is matched with comments on the target data structure in the interface documentation, to obtain simulated server-side returned data. Since the simulated server-side returned data can be automatically constructed based on the target data structure, there is no need for integration testing with the server-side interface. The constructed simulated returned data can be directly used to verify the functionality of the client-side interface, thus decoupling the client's dependency on server-side interface development.

[0030] To provide a clearer explanation of the existing technology, let's first introduce the following terms and concepts.

[0031] Web crawler: A web crawler (also known as a web spider, web robot, web crawler, etc.) is a program or script that automatically retrieves information from the World Wide Web according to certain rules.

[0032] Data structure: A data structure is a way of storing and organizing data in a computer. A data structure is a collection of data elements that have one or more specific relationships with each other.

[0033] Interface request: The server and client agree on a data communication method. The client sends relevant data to the server as required, and the server returns the corresponding data.

[0034] Cookies, sometimes also referred to in the plural form Cookies, are small text files that are stored locally on the client's computer by some websites to identify users and track their sessions. These files are usually encrypted and can be temporarily or permanently stored by the client.

[0035] The following describes the development methods, apparatus, devices, and storage media for the client interface disclosed herein.

[0036] Figure 2 This is a flowchart illustrating an open method for a client interface provided in this disclosure. For example... Figure 2 As shown, it includes:

[0037] Step 201: Obtain the API documentation.

[0038] The API documentation is written by developers based on development requirements. It records the data structures agreed upon by the server and client, and allows for the addition of comments to these data structures.

[0039] Optionally, the data structure can be a multi-level structure, that is, it includes multiple levels of nodes with parent-child relationships, where leaf nodes correspond to basic attributes. For example, basic attributes may include: timestamp, name, title, background image, avatar, etc.

[0040] Step 202: Generate client interface code based on the interface documentation.

[0041] One possible implementation involves obtaining the API documentation, which is generated by the front-end and back-end according to the agreed-upon project requirements. The API documentation is read to obtain at least one attribute; then, an API code template is invoked, and the corresponding attribute name is written into the template to generate at least one piece of API code.

[0042] Step 203: Match the candidate data in the setting dictionary with the target data structure in the client interface code used to store data returned by the storage client, and / or match the candidate data in the setting dictionary with the comments on the target data structure in the interface document to obtain matching candidate data.

[0043] The candidate data in the dictionary can be pre-configured, selected from some or all of the available data within a set range of values, or within an allowed range, based on an agreement between the client and server. The candidate data in the dictionary can be categorized into various types based on their corresponding attributes, such as: timestamps, names, titles, background image addresses, avatar addresses, image content, etc.

[0044] Step 204: Use the matched candidate data as the simulated return data of the server, and use the simulated return data to test the client interface.

[0045] When a client interface requests data from a server, the matched candidate data is provided to the client interface as simulated return data from the server. This tests whether the client interface can perform further processing on the simulated return data. For example, the subsequent data may include parsing the simulated return data, providing the relevant algorithms on the client based on the parsed simulated return data for subsequent functional processing, or sending the corresponding data to the server interface based on the simulated return data.

[0046] By automatically generating client interface code according to the interface documentation, and matching candidate data from the setting dictionary with the target data structure used to store server-side returned data in the client interface code, and / or matching candidate data from the setting dictionary with comments on the target data structure in the interface documentation, simulated server-side returned data is obtained. Since the simulated server-side returned data can be automatically constructed based on the target data structure, there is no need for integration testing with the server-side interface. The constructed simulated returned data can be directly used to verify the functionality of the client interface, decoupling the client's dependency on server-side interface development.

[0047] Figure 3 This is a flowchart illustrating another open method for the client interface provided in this disclosure. For example... Figure 3 As shown, it includes:

[0048] Step 301: Obtain the API documentation.

[0049] The API documentation is written by developers based on development requirements. It records the data structures agreed upon by the server and client, and allows for the addition of comments to these data structures.

[0050] Optionally, the data structure can be a multi-level structure, that is, it includes multiple levels of nodes with parent-child relationships, where leaf nodes correspond to basic attributes. For example, basic attributes may include: timestamp, name, title, background image, avatar, etc. By recursively traversing the multi-level attributes of the target data structure to obtain the attribute names belonging to the leaf nodes, the smallest granularity of basic attributes can be obtained even when the data structure is multi-level.

[0051] Step 302: Based on the naming rules, name the class and the attributes in the class according to the naming and / or comments of the class in the interface document.

[0052] For example, if the annotation for a certain attribute in the API documentation is time-related, then "time" can be included in the attribute name, with at least one prefix or suffix added according to the naming rules.

[0053] For example, if a class name is defined in the interface documentation, the class name in the client interface can be obtained by adding at least one of the prefix and suffix to the class name in the interface documentation according to the naming rules. Of course, in some cases that comply with the naming rules, the class name in the interface documentation can also be named directly.

[0054] Step 303: Fill in the code template according to the class and the naming of the attributes in the class to obtain the client interface code.

[0055] By parsing the API documentation data, recognizable JavaScript characters are returned to the Integrated Development Environment (IDE) plugin. The IDE plugin then models these JavaScript characters into entity code or API code based on code templates. Furthermore, it populates or names the entity and API code according to the class and its properties, thus generating the client-side API code. This automated generation of client-side API code based on the API documentation simplifies the development process and improves efficiency.

[0056] Step 304: Determine the attribute name from the target data structure used to return data from the storage service client, or obtain the annotation of the target data structure from the interface documentation.

[0057] As one possible implementation, the attribute name is determined from the target data structure used to store data returned by the storage service client. Specifically, this can be achieved by recursively traversing the multi-level attributes of the target data structure to obtain the attributes belonging to the leaf nodes in the multi-level attributes.

[0058] Step 305: Set the attributes of each candidate data in the dictionary and match them with the attribute names and / or the annotations to obtain matching candidate data.

[0059] The dictionary contains candidate data for various attributes. Attributes may include timestamps, names, titles, background image URLs, avatar URLs, and so on. Because the dictionary stores candidate data for each attribute, simulated return data can be generated for each attribute based on this candidate data, enhancing the flexibility of simulated return data generation.

[0060] As a first possible implementation, the attributes of each candidate data in the dictionary are set, and the character matching method is used to match the attribute name to obtain the matching candidate data.

[0061] As a second possible implementation, attributes are set for each candidate data in the dictionary, and character matching is used to match the annotations to obtain matching candidate data. Both of the aforementioned possible implementations employ character matching, which can obtain candidate data based on character-based matching. Compared to semantic matching, the computational load is also smaller.

[0062] As a third possible implementation, attributes are defined for each candidate data item in the dictionary, and semantic matching is used to match the attribute names and / or annotations to obtain matching candidate data. The semantics of the attribute names and / or annotations typically need to consider their context to determine their accurate meaning within that context. Since in some cases, character-matched candidate data cannot be obtained, semantic matching is necessary to obtain semantically similar but differently expressed candidate data.

[0063] Step 306: Use the matched candidate data as the simulated return data of the server, and use the simulated return data to test the client interface.

[0064] When a client interface requests data from a server, the matched candidate data is provided to the client interface as simulated return data from the server. This tests whether the client interface can perform further processing on the simulated return data. For example, the subsequent data may include parsing the simulated return data, providing the relevant algorithms on the client based on the parsed simulated return data for subsequent functional processing, or sending the corresponding data to the server interface based on the simulated return data.

[0065] By automatically generating client interface code according to the interface documentation, and matching candidate data from the setting dictionary with the target data structure used to store server-side returned data in the client interface code, and / or matching candidate data from the setting dictionary with comments on the target data structure in the interface documentation, simulated server-side returned data is obtained. Since the simulated server-side returned data can be automatically constructed based on the target data structure, there is no need for integration testing with the server-side interface. The constructed simulated returned data can be directly used to verify the functionality of the client interface, decoupling the client's dependency on server-side interface development.

[0066] Figure 4 This is a flowchart illustrating another client interface development method provided in this disclosure. For example... Figure 4 As shown, it includes:

[0067] Step 401: When the browser receives an update notification from the cloud service, the browser obtains a cookie for identity authentication from the cloud service.

[0068] Step 402: The browser stores the obtained cookie in the service layer.

[0069] Step 403: Update the cookies stored in the service layer.

[0070] Step 404: The client retrieves the latest cookie from the service layer.

[0071] Based on the above steps, updated cookies can be obtained even when cookies are updated. This improves the success rate of retrieving API documentation from cloud services.

[0072] Step 405: The client uses a crawler to access the cloud service based on the unique identifier of the interface, carrying the latest cookie.

[0073] Since web crawlers lack browser features, they cannot perform identity authentication. However, by obtaining the latest cookies from the service layer through the client and using the web crawler to access cloud services with the latest cookies, identity authentication for cloud services can be achieved.

[0074] Step 406: If the cloud service authenticates the user using cookies, it will provide the interface documentation corresponding to the unique identifier of the interface.

[0075] Step 407: The client generates client interface code based on the interface documentation.

[0076] Step 408: When the data simulation function is enabled, the client matches the candidate data in the setting dictionary with the target data structure in the client interface code used to store the data returned by the storage client, and / or matches the candidate data in the setting dictionary with the comments on the target data structure in the interface document to obtain matching candidate data.

[0077] Step 409: The client uses the matched candidate data as the simulated return data of the server to test the client interface.

[0078] As one possible implementation method, the aforementioned Figure 4 The browser, client, and service layers mentioned in this embodiment are all located within the same electronic device. The software system of this electronic device is divided into three layers. Figure 5 This is a schematic diagram of the software system structure.

[0079] like Figure 5 As shown, the system includes a service layer for updating and persisting cookies (i.e., storage). The client layer includes triggers, a web crawler for retrieving cookies and data from the cloud server. The client can also generate code, simulated return data, and perform tests based on the simulated return data. The browser layer is used to monitor cookie changes and access the API documentation page.

[0080] By automatically generating client interface code according to the interface documentation, and matching candidate data from the setting dictionary with the target data structure used to store server-side returned data in the client interface code, and / or matching candidate data from the setting dictionary with comments on the target data structure in the interface documentation, simulated server-side returned data is obtained. Since the simulated server-side returned data can be automatically constructed based on the target data structure, there is no need for integration testing with the server-side interface. The constructed simulated returned data can be directly used to verify the functionality of the client interface, decoupling the client's dependency on server-side interface development.

[0081] Figure 6 This is a schematic diagram of the structure of an open device with a client interface provided in this disclosure.

[0082] like Figure 6 As shown, the open device 600 of the client interface includes: an acquisition module 610, a generation module 620, a matching module 630, and a debugging module 640.

[0083] Among them, the acquisition module 610 is used to acquire interface documents.

[0084] The generation module 620 is used to generate client interface code based on the interface document.

[0085] The matching module 630 is used to match candidate data in the set dictionary with the target data structure in the client interface code used to store data returned by the storage client, and / or match candidate data in the set dictionary with comments on the target data structure in the interface document, so as to obtain matching candidate data.

[0086] The debugging module 640 is used to use the matched candidate data as simulated return data from the server and to test the client interface using the simulated return data.

[0087] As one possible implementation of this disclosure, the dictionary includes candidate data corresponding to multiple attributes; the matching module 630 includes: an acquisition unit, used to determine the attribute name from the target data structure for returning data from the storage service client, or to acquire the annotation of the target data structure from the interface document; and a matching unit, used to match the attributes of each candidate data in the set dictionary with the attribute name and / or the annotation to obtain the matched candidate data.

[0088] As one possible implementation of this disclosure, the acquisition unit is used to recursively traverse the multi-level attributes of the target data structure to obtain the attribute names belonging to the leaf nodes in the multi-level attributes.

[0089] As one possible implementation of this disclosure, the matching unit is used to match the attributes of each candidate data in the set dictionary with the attribute name and / or the annotation by means of character matching, so as to obtain the matched candidate data.

[0090] As one possible implementation of this disclosure, the matching unit is used to match the attributes of each candidate data in the set dictionary with the attribute name and / or the annotation in a semantic matching manner to obtain the matched candidate data.

[0091] As one possible implementation of this disclosure, the acquisition module 610 is configured to access a cloud service based on the unique interface identifier, carrying a text file for identity authentication, so as to provide the interface document corresponding to the unique interface identifier if the cloud service successfully authenticates the interface based on the text file.

[0092] As one possible implementation of this disclosure, the apparatus further includes: a processing module, configured to obtain and store the text file from the cloud service via a browser; and to update the stored text file when the browser receives an update notification from the cloud service.

[0093] As one possible implementation of this disclosure, the generation module 620 is used to: name the class and its attributes according to naming rules and the naming and / or comments of the class in the interface document; and fill the code template according to the naming of the class and its attributes to obtain the client interface code.

[0094] It should be noted that the above explanation of the method for opening the client interface also applies to the device for opening the client interface in this embodiment, and this embodiment will not repeat it here.

[0095] The client interface opening device of this disclosure automatically generates client interface code according to the interface documentation, and matches candidate data in the setting dictionary with the target data structure used to store server-side returned data in the client interface code, and / or matches candidate data in the setting dictionary with comments on the target data structure in the interface documentation, to obtain simulated server-side returned data. Since the simulated server-side returned data can be automatically constructed based on the target data structure, there is no need for joint debugging with the server-side interface; the constructed simulated returned data can be directly used to verify the functionality of the client interface, decoupling the client's dependency on server-side interface development.

[0096] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, and disclosure of users' personal information are all carried out with the consent of the users, and all comply with the provisions of relevant laws and regulations, and do not violate public order and good morals.

[0097] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0098] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0099] like Figure 7As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 702 or a computer program loaded from storage unit 708 into RAM (Random Access Memory) 703. RAM 703 can also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. I / O (Input / Output) interface 705 is also connected to bus 704.

[0100] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0101] The computing unit 701 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the client interface opening method. For example, in some embodiments, the client interface opening method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the client interface opening method described above can be performed. Alternatively, in other embodiments, computing unit 701 may be configured to perform an open method of client interface by any other suitable means (e.g., by means of firmware).

[0102] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0103] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0104] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0105] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0106] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.

[0107] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0108] It's important to note that artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.

[0109] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0110] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for developing a client interface, comprising: Obtain the API documentation; Generate client interface code based on the interface documentation; The candidate data in the set dictionary is matched with the target data structure in the client interface code used to store the data returned by the storage client, and / or the candidate data in the set dictionary is matched with the comments on the target data structure in the interface document to obtain the matching candidate data; The candidate data in the setting dictionary is preset; the setting dictionary includes candidate data corresponding to multiple attributes; the candidate data in the setting dictionary is selected from some or all of the available data within a set value range or within an allowed range, based on the agreement between the client and the server. The matched candidate data is used as the simulated return data of the server, and the simulated return data is used to test the client interface; The step of matching candidate data in the set dictionary with the target data structure in the client interface code used to store data returned by the storage client, and / or matching candidate data in the set dictionary with comments on the target data structure in the interface documentation to obtain matching candidate data includes: Determine the attribute name from the target data structure used to return data from the storage service client, or obtain the annotation of the target data structure from the interface documentation; The attributes of each candidate data in the dictionary are set and matched with the attribute name and / or the annotation to obtain the matching candidate data; Determining attribute names from the target data structure used to return data from the storage service client includes: recursively traversing the multi-level attributes of the target data structure to obtain the attribute names belonging to the leaf nodes in the multi-level attributes.

2. The method of claim 1, wherein, The step of setting attributes for each candidate data in the dictionary and matching them with the attribute names and / or the annotations to obtain matching candidate data includes: The attributes of each candidate data in the dictionary are set, and character matching is used to match the attribute name and / or the annotation to obtain the matching candidate data.

3. The method of claim 1, wherein, The step of setting attributes for each candidate data in the dictionary and matching them with the attribute names and / or the annotations to obtain matching candidate data includes: The attributes of each candidate data in the dictionary are set, and semantic matching is used to match the attribute names and / or the annotations to obtain matching candidate data.

4. The method according to any one of claims 1 to 3, wherein, The process of obtaining the interface documentation includes: Based on the unique identifier of the interface, a text file for identity authentication is carried to access the cloud service, so that if the cloud service successfully authenticates the user based on the text file, the interface document corresponding to the unique identifier of the interface is provided.

5. The method of claim 4, wherein, The method further includes: The text file is retrieved from the cloud service via a browser and stored. Upon receiving an update notification from the cloud service, the browser updates the stored text file.

6. The method according to any one of claims 1-3, wherein, The step of generating client interface code based on the interface document includes: Based on the naming rules, the class and its attributes are named according to the class names and / or comments in the interface document; Based on the class and the names of the attributes in the class, fill in the code template to obtain the client interface code.

7. A development apparatus for a client interface, comprising: The retrieval module is used to retrieve the API documentation; The generation module is used to generate client interface code based on the interface document; The matching module is used to match candidate data in the set dictionary with the target data structure in the client interface code used to store data returned by the storage client, and / or match candidate data in the set dictionary with comments on the target data structure in the interface document to obtain matching candidate data; The candidate data in the setting dictionary is preset; the setting dictionary includes candidate data corresponding to multiple attributes; the candidate data in the setting dictionary is selected from some or all of the available data within a set value range or within an allowed range, based on the agreement between the client and the server. The debugging module is used to use the matched candidate data as simulated return data from the server, and to test the client interface using the simulated return data. The matching module includes: The acquisition unit is used to determine the attribute name from the target data structure for returning data from the storage service client, or to obtain the annotation of the target data structure from the interface document; A matching unit is used to match the attributes of each candidate data in the set dictionary with the attribute name and / or the annotation to obtain the matching candidate data; The acquisition unit is used to: recursively traverse the multi-level attributes of the target data structure to obtain the attribute names belonging to the leaf nodes in the multi-level attributes.

8. The apparatus according to claim 7, wherein, The matching unit is used for: The attributes of each candidate data in the dictionary are set, and character matching is used to match the attribute name and / or the annotation to obtain the matching candidate data.

9. The apparatus according to claim 7, wherein, The matching unit is used for: The attributes of each candidate data in the dictionary are set, and semantic matching is used to match the attribute names and / or the annotations to obtain matching candidate data.

10. The apparatus according to any one of claims 7-9, wherein, The acquisition module is used for: Based on the unique identifier of the interface, a text file for identity authentication is carried to access the cloud service, so that if the cloud service successfully authenticates the user based on the text file, the interface document corresponding to the unique identifier of the interface is provided.

11. The apparatus according to claim 10, wherein, The device further includes: The processing module is configured to retrieve and store the text file from the cloud service via a browser; and update the stored text file when the browser receives an update notification from the cloud service.

12. The apparatus according to any one of claims 7-9, wherein, The generation module is used for: Based on the naming rules, the class and its attributes are named according to the class names and / or comments in the interface document; Based on the class and the names of the attributes in the class, fill in the code template to obtain the client interface code.

13. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.

15. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Request body generation method and device based on interface document, and computer equipment

    CN112506769A

  • Interface testing method and device, electronic equipment and storage medium

    CN113760687A