CN115757145A - Method, device, equipment and storage medium for developing client interface - Google Patents

Method, device, equipment and storage medium for developing client interface Download PDF

Info

Publication number
CN115757145A
CN115757145A CN202211463481.0A CN202211463481A CN115757145A CN 115757145 A CN115757145 A CN 115757145A CN 202211463481 A CN202211463481 A CN 202211463481A CN 115757145 A CN115757145 A CN 115757145A
Authority
CN
China
Prior art keywords
interface
candidate data
matching
data
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211463481.0A
Other languages
Chinese (zh)
Inventor
张勇
李彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202211463481.0A priority Critical patent/CN115757145A/en
Publication of CN115757145A publication Critical patent/CN115757145A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a development method, a development device, development equipment and a development storage medium of a client interface, and relates to the technical field of computers, in particular to the technical fields of cloud storage, cloud computing, deep learning and the like. The specific implementation scheme is as follows: and automatically generating client interface codes according to the interface document, and matching the candidate data in the set dictionary with a target data structure for storing the server return data in the client interface codes and/or matching the candidate data in the set dictionary with the comments on the target data structure in the interface document to obtain the simulated return data of the server. Because the simulation return data of the server can be automatically constructed according to the target data structure, joint debugging with the server interface is not needed, the constructed simulation return data can be directly used for verifying the function of the client interface, and the dependence of the client on the development of the server interface is decoupled.

Description

Method, device, equipment and storage medium for developing client interface
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the field of cloud storage, cloud computing, deep learning, and the like, which can be applied to a scenario such as interface development, and in particular, to a method, an apparatus, a device, and a storage medium for developing a client interface.
Background
When a new interface needs to be developed for a client, a developer needs to formulate an interface data format, then code development is carried out according to the formulated interface data format, and then interface joint debugging can be carried out on a server and the client only after the development of the server interface is completed, so that the client interface is relatively dependent on the development of the server interface.
Disclosure of Invention
The disclosure provides a method, a device, equipment and a storage medium for developing a client interface.
According to an aspect of the present disclosure, there is provided a method for developing a client interface, including:
acquiring an interface document;
generating a client interface code according to the interface document;
matching the candidate data in the set dictionary with a target data structure used for storing server-side returned data in the client-side interface code, and/or matching the candidate data in the set dictionary with comments on the target data structure in the interface document to obtain matched candidate data;
and taking the matched candidate data as the simulated return data of the server, and testing the client interface by adopting the simulated return data.
According to another aspect of the present disclosure, there is provided a development apparatus of a client interface, including:
the acquisition module is used for acquiring the interface document;
the generating module is used for generating a client interface code according to the interface document;
the matching module is used for matching the candidate data in the set dictionary with a target data structure used for storing server-side returned data in the client-side interface code and/or matching the candidate data in the set dictionary with the annotation of the target data structure in the interface document to obtain matched candidate data;
and the debugging module is used for taking the matched candidate data as the simulation return data of the server and adopting the simulation return data to test the client interface.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as described in the embodiments of the first aspect of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method as described in the embodiments of the first aspect of the present disclosure.
According to the development method, the development device, the development equipment and the development medium of the client interface, client interface codes are automatically generated according to an interface document, candidate data in a set dictionary and a target data structure used for storing server return data in the client interface codes are matched, and/or the candidate data in the set dictionary and comments on the target data structure in the interface document are matched, so that simulated return data of a server are obtained. Because the simulation return data of the server can be automatically constructed according to the target data structure, joint debugging with the server interface is not needed, the constructed simulation return data can be directly used for verifying the function of the client interface, and the dependence of the client on the development of the server interface is decoupled.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of interface function development in the related art;
FIG. 2 is a flow chart diagram illustrating an open method of a client interface provided by the present disclosure;
FIG. 3 is a schematic flow chart diagram of another method for opening a client interface provided by the present disclosure;
FIG. 4 is a flow chart diagram of another method of developing a client interface provided by the present disclosure;
FIG. 5 is a schematic diagram of a software system architecture;
fig. 6 is a schematic structural diagram of an opening apparatus of a client interface provided in the present disclosure;
FIG. 7 is a block diagram of an electronic device for implementing the open method of client interface of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in the flowchart of interface function development in the related art shown in fig. 1, a developer makes an agreement on interface data structures of both a server and a client in an interface document based on requirements in the related art. And then, respectively developing client interface codes and server interface codes according to the interface documents. And subsequently, the client interface codes are required to be subjected to joint debugging after the server interface codes are developed, and interface-dependent function development can be performed on the client through the joint debugging. Therefore, in the related art, the client interface is relatively dependent on the development of the server interface.
In order to decouple the dependence of a client on the development of a server interface and improve the development efficiency of the client and the reliability of codes, client interface codes are automatically generated according to an interface document, candidate data in a set dictionary and a target data structure for storing server return data in the client interface codes are matched, and/or the candidate data in the set dictionary and comments on the target data structure in the interface document are matched, so that simulated return data of the server are obtained. Because the simulation return data of the server can be automatically constructed according to the target data structure, joint debugging with the server interface is not needed, the constructed simulation return data can be directly used for verifying the function of the client interface, and the dependence of the client on the development of the server interface is decoupled.
To make the description of the prior art clearer, the following terms are introduced.
Crawler: a web crawler (also called a web spider, a web robot, a web chaser, etc.) is a program or script that automatically captures web information according to a certain rule.
Data structure: data structures are the way computers store, organize, etc. data. A data structure refers to a collection of data elements that have one or more specific relationships to each other.
Interface request: and the server side and the client side are in an appointed data communication mode, the client side carries related data to the server side according to requirements, and the server side returns corresponding data.
Cookies, and sometimes their complex forms. The type is a "small text file," which is data (usually encrypted) that some websites store locally on the client for Session (Session) tracking to identify the user, and information that is stored temporarily or permanently by the client.
The following describes a method, an apparatus, a device, and a storage medium for developing a client interface according to the present disclosure.
Fig. 2 is a schematic flow chart of an opening method of a client interface provided by the present disclosure. As shown in fig. 2, includes:
step 201, obtaining an interface document.
Wherein the interface document is written by a developer based on development requirements. The data structure agreed by the server and the client is recorded in the interface document, and some comments can be added to the data structure.
Alternatively, the data structure may be a multi-level structure, i.e. comprising multi-level nodes having a parent-child relationship, wherein leaf nodes correspond to base attributes. For example, basic attributes may include: time stamp, name, title, background picture, avatar, and the like.
In step 202, a client interface code is generated from the interface document.
As a possible implementation mode, an interface document is obtained, and the interface document is generated by the front end and the back end according to corresponding project requirement conventions. Reading the interface document to obtain at least one attribute, calling an interface code template, and writing the corresponding attribute name into the interface code template to generate at least one section of interface code.
Step 203, matching the candidate data in the set dictionary with a target data structure used for storing server-side return data in the client-side interface code, and/or matching the candidate data in the set dictionary with the annotation of the target data structure in the interface document to obtain matched candidate data.
The candidate data in the dictionary may be pre-configured, and based on the convention of the client and the server, may be in a set value range, or may be part or all of the available data selected in an allowed range. The candidate data in the dictionary may be divided into multiple types according to different corresponding attributes, for example: time stamp, name, title, address of background picture, address of avatar, image content, etc.
And step 204, taking the matched candidate data as simulated return data of the server, and testing the client interface by adopting the simulated return data.
Under the condition that the client interface requests to acquire data from the server, the matched candidate data is provided to the client interface as simulated return data of the server, so that whether the client interface can perform subsequent processing on the simulated return data is tested, for example, the subsequent data may include analyzing the simulated return data, performing subsequent functional processing based on a related algorithm provided by the analyzed simulated return data for the client, or sending corresponding data to the server interface based on the simulated return data.
And automatically generating client interface codes according to the interface document, and matching the candidate data in the set dictionary with a target data structure for storing the server return data in the client interface codes and/or matching the candidate data in the set dictionary with the comments on the target data structure in the interface document to obtain the simulated return data of the server. Because the simulation return data of the server can be automatically constructed according to the target data structure, joint debugging with the server interface is not needed, the constructed simulation return data can be directly used for verifying the function of the client interface, and the dependence of the client on the development of the server interface is decoupled.
Fig. 3 is a flow chart illustrating another method for opening a client interface provided by the present disclosure. As shown in fig. 3, includes:
step 301, an interface document is obtained.
Wherein the interface document is written by a developer based on development requirements. The interface document records a data structure agreed by the server and the client, and some comments can be added to the data structure.
Alternatively, the data structure may be a multi-level structure, i.e. comprising multi-level nodes having a parent-child relationship, wherein leaf nodes correspond to base attributes. For example, basic attributes may include: timestamp, name, title, background picture, avatar, and the like. And performing recursive traversal on the multilayer attributes of the target data structure to obtain the attribute names belonging to the leaf nodes in the multilayer attributes, so that the basic attribute with the minimum granularity can be obtained under the condition that the data structure is multilayer.
Step 302, naming the class and the attributes in the class according to the naming and/or annotation of the class in the interface document based on the naming rule.
For example: in the interface document, if the annotation for a certain attribute is time-dependent, at least one of a prefix and a suffix can be added to the attribute name according to a naming rule by representing "time".
Another example is: if the class name of a certain class is defined in the interface document, the class name in the interface document may be obtained by adding at least one of a prefix and a suffix to the class name in the interface document according to a naming rule, or the class name may be named directly based on the class name in the interface document in some cases that the naming rule is met.
Step 303, filling a code template according to the class and the name of the attribute in the class to obtain the client interface code.
And analyzing the interface document data to obtain recognizable js characters, and returning the js characters to an Integrated Development Environment (IDE) plug-in. Modeling js characters as entity codes or interface codes through an IDE plug-in based on a code template, and filling or naming the entity codes and the interface codes according to the class and the naming of the attributes in the class so as to obtain client interface codes. By automatically generating the client interface codes based on the interface documents, the development process is simplified, and the development efficiency is improved.
Step 304, determining an attribute name from a target data structure for storing the server-side return data, or acquiring a note of the target data structure from the interface document.
As a possible implementation manner, determining the attribute name from the target data structure for storing the server-side returned data may specifically adopt: and performing recursive traversal on the multilayer attributes of the target data structure to obtain attributes belonging to leaf nodes in the multilayer attributes.
Step 305, matching the attribute of each candidate data in the set dictionary with the attribute name and/or the annotation to obtain matched candidate data.
The dictionary comprises candidate data corresponding to various attributes. For example, the attributes may include: timestamp, name, title, background map address, avatar address, and the like. Because the candidate data corresponding to the attributes are stored in the dictionary, the corresponding simulation return data can be generated for the attributes based on the candidate data in the dictionary, and the flexibility of generating the simulation return data is enhanced.
As a first possible implementation manner, the attribute of each candidate data in the dictionary is set, and the attribute is matched with the attribute name in a character matching manner, so as to obtain matched candidate data.
As a second possible implementation manner, the attribute of each candidate data in the dictionary is set, and the attribute is matched with the annotation in a character matching manner, so as to obtain the matched candidate data. In the two possible implementation manners, a character matching manner is adopted, and candidate data of character angle matching can be obtained. Compared with semantic matching, the computation amount is smaller.
As a third possible implementation manner, the attribute of each candidate data in the dictionary is set, and the attribute name and/or the annotation are matched in a semantic matching manner, so as to obtain matched candidate data. Wherein the attribute name and/or the semantics of the annotation generally require consideration of the context of the attribute name and/or the annotation in order to determine its exact semantics in the context. In some cases, candidate data of character matching cannot be obtained, and in this case, semantic matching needs to be performed to obtain candidate data that are semantically similar but have different expression modes.
And step 306, taking the matched candidate data as simulated return data of the server, and testing the client interface by using the simulated return data.
Under the condition that the client interface requests to acquire data from the server, the matched candidate data is provided to the client interface as simulated return data of the server, so that whether the client interface can perform subsequent processing on the simulated return data is tested, for example, the subsequent data may include analyzing the simulated return data, performing subsequent functional processing based on a related algorithm provided by the analyzed simulated return data for the client, or sending corresponding data to the server interface based on the simulated return data.
And automatically generating client interface codes according to the interface document, and matching the candidate data in the set dictionary with a target data structure for storing the server return data in the client interface codes and/or matching the candidate data in the set dictionary with the comments on the target data structure in the interface document to obtain the simulated return data of the server. Because the simulation return data of the server can be automatically constructed according to the target data structure, joint debugging with the server interface is not needed, the constructed simulation return data can be directly used for verifying the function of the client interface, and the dependence of the client on the development of the server interface is decoupled.
Fig. 4 is a flow chart of another method for developing a client interface provided by the present disclosure. As shown in fig. 4, includes:
step 401, when the browser receives an update notification from the cloud service, the browser acquires a cookie for identity authentication from the cloud service.
In step 402, the browser stores the obtained cookie in the service layer.
At step 403, the cookie stored by the service layer is updated.
The client obtains the latest cookie from the service layer, step 404.
Based on the above steps, the updated cookie can be acquired in the case of cookie update. Therefore, the success rate of acquiring the interface document from the cloud service subsequently is improved.
And 405, the client accesses the cloud service by adopting the crawler to carry the latest cookie according to the unique interface identifier.
The identity authentication can not be realized because the crawler does not have the browser characteristic, the latest cookie is acquired from the service layer through the client, and the identity authentication of the cloud service can be realized by adopting the crawler to carry the latest cookie and accessing the cloud service.
In step 406, the cloud service provides an interface document corresponding to the unique interface identifier when the authentication is passed based on the cookie.
In step 407, the client generates a client interface code from the interface document.
And step 408, when the data simulation function is enabled, the client matches the candidate data in the set dictionary with a target data structure used for storing the data returned by the server in the client interface code, and/or matches the candidate data in the set dictionary with the annotation of the target data structure in the interface document to obtain matched candidate data.
And step 409, the client takes the matched candidate data as simulation return data of the server and tests the client interface by adopting the simulation return data.
As a possible implementation manner, the browser, the client and the service layer mentioned in the foregoing embodiment of fig. 4 are all disposed in the same electronic device. The software system of the electronic device is divided into three layers as a whole, and fig. 5 is a schematic structural diagram of the software system.
As shown in fig. 5, a service layer is included for cookie update, persistence, i.e., storage functionality. The client comprises a trigger and a crawler for acquiring the cookie and the data from the cloud server. The client may also be used to generate code, generate simulated return data, and perform testing functions based on the simulated return data. And the browser is used for monitoring cookie change and accessing the function of the interface document page.
And automatically generating client interface codes according to the interface document, and matching the candidate data in the set dictionary with a target data structure for storing the server return data in the client interface codes and/or matching the candidate data in the set dictionary with the comments on the target data structure in the interface document to obtain the simulated return data of the server. Because the simulation return data of the server can be automatically constructed according to the target data structure, joint debugging with the server interface is not needed, the constructed simulation return data can be directly used for verifying the function of the client interface, and the dependence of the client on the development of the server interface is decoupled.
Fig. 6 is a schematic structural diagram of an open device of a client interface provided in the present disclosure.
As shown in fig. 6, the client interface opening apparatus 600 includes: an obtaining module 610, a generating module 620, a matching module 630 and a debugging module 640.
The obtaining module 610 is configured to obtain the interface document.
And a generating module 620, configured to generate a client interface code according to the interface document.
A matching module 630, configured to match the candidate data in the set dictionary with a target data structure in the client interface code, where the target data structure is used for storing server return data, and/or match the candidate data in the set dictionary with a comment to the target data structure in the interface document, so as to obtain matched candidate data.
And the debugging module 640 is configured to use the matched candidate data as the simulation return data of the server, and test the client interface by using the simulation return data.
As a possible implementation manner of the embodiment of the present disclosure, the dictionary includes candidate data corresponding to multiple attributes; the matching module 630 includes: the acquisition unit is used for determining an attribute name from a target data structure for storing return data of a server side, or acquiring an annotation of the target data structure from the interface document; and the matching unit is used for matching the attribute of each candidate data in the set dictionary with the attribute name and/or the annotation to obtain matched candidate data.
As a possible implementation manner of the embodiment of the present disclosure, the obtaining unit is configured to perform recursive traversal on the multilayer attribute of the target data structure to obtain an attribute name belonging to a leaf node in the multilayer attribute.
As a possible implementation manner of the embodiment of the present disclosure, the matching unit is configured to match an attribute of each candidate data in the set dictionary with the attribute name and/or the annotation in a character matching manner, so as to obtain matched candidate data.
As a possible implementation manner of the embodiment of the present disclosure, the matching unit is configured to match an attribute of each candidate data in the set dictionary with the attribute name and/or the annotation in a semantic matching manner, so as to obtain matched candidate data.
As a possible implementation manner of the embodiment of the present disclosure, the obtaining module 610 is configured to carry a text file for identity authentication according to an interface unique identifier, access a cloud service, and provide the interface document corresponding to the interface unique identifier when the cloud service passes authentication based on the text file.
As a possible implementation manner of the embodiment of the present disclosure, the apparatus further includes: the processing module is used for acquiring and storing the text file from the cloud service through a browser; and updating the stored text file under the condition that the browser receives an update notification from the cloud service.
As a possible implementation manner of the embodiment of the present disclosure, the generating module 620 is configured to: naming the class and the attributes in the class according to naming and/or annotation of the class in the interface document based on a naming rule; and filling a code template according to the class and the name of the attribute in the class to obtain the client interface code.
It should be noted that the explanation of the above opening method for the client interface is also applicable to the opening apparatus for the client interface in this embodiment, and details of this embodiment are not described again.
According to the opening device of the client interface, the client interface codes are automatically generated according to the interface document, the candidate data in the set dictionary and the target data structure used for storing the server return data in the client interface codes are matched, and/or the candidate data in the set dictionary and the comments on the target data structure in the interface document are matched, so that the simulated return data of the server are obtained. Because the simulation return data of the server can be automatically constructed according to the target data structure, joint debugging with the server interface is not needed, the constructed simulation return data can be directly used for verifying the function of the client interface, and the dependence of the client on the development of the server interface is decoupled.
In the technical scheme of the disclosure, the processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the related user are all carried out on the premise of obtaining the consent of the user, and all accord with the regulations of related laws and regulations without violating the customs of public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes in accordance with a computer program stored in a ROM (Read-Only Memory) 702 or a computer program loaded from a storage unit 708 into a RAM (Random Access Memory) 703. In the RAM 703, various programs and data required for the operation of the device 700 can be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An I/O (Input/Output) interface 705 is also connected to the bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 701 may be a variety of 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, a CPU (Central Processing Unit), a GPU (graphics Processing Unit), various dedicated AI (Artificial Intelligence) computing chips, various computing Units running machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable Processor, controller, microcontroller, and the like. The computing unit 701 performs the various methods and processes described above, such as the open method of a client interface. For example, in some embodiments, the open method of client interfacing may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the above-described method for opening a client interface may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured by any other suitable means (e.g., by means of firmware) to perform an open method of client interfacing.
Various implementations of the systems and techniques described here above may be realized in digital electronic circuitry, integrated circuitry, FPGAs (Field Programmable Gate arrays), ASICs (Application-Specific Integrated circuits), ASSPs (Application Specific Standard products), SOCs (System On Chip, system On a Chip), CPLDs (Complex Programmable Logic devices), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an EPROM (erasable Programmable Read-Only-Memory) or flash Memory, an optical fiber, a CD-ROM (Compact Disc Read-Only-Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a Display device (e.g., a CRT (Cathode Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a 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 acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), internet, and blockchain Network.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in a traditional physical host and VPS service ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be noted that artificial intelligence is a subject for studying a computer to simulate some human thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware and software technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning/deep learning technology, a big data processing technology, a knowledge map technology and the like.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.

Claims (19)

1. A development method of a client interface comprises the following steps:
acquiring an interface document;
generating a client interface code according to the interface document;
matching the candidate data in the set dictionary with a target data structure used for storing server-side returned data in the client-side interface code, and/or matching the candidate data in the set dictionary with comments on the target data structure in the interface document to obtain matched candidate data;
and taking the matched candidate data as the simulated return data of the server, and testing the client interface by adopting the simulated return data.
2. The method according to claim 1, wherein the set dictionary comprises candidate data corresponding to a plurality of attributes;
the matching of the candidate data in the set dictionary with the target data structure used for storing the server-side returned data in the client-side interface code and/or the matching of the candidate data in the set dictionary with the annotation of the target data structure in the interface document to obtain the matched candidate data includes:
determining an attribute name from a target data structure for storing data returned by a server, or acquiring an annotation of the target data structure from the interface document;
and matching the attribute of each candidate data in the set dictionary with the attribute name and/or the annotation to obtain matched candidate data.
3. The method of claim 2, wherein said determining an attribute name from a target data structure for storing server-side return data comprises:
and performing recursive traversal on the multilayer attributes of the target data structure to obtain the attribute names belonging to the leaf nodes in the multilayer attributes.
4. The method according to claim 2, wherein the matching the attribute of each candidate data in the set dictionary with the attribute name and/or the annotation to obtain the matched candidate data comprises:
and matching the attribute of each candidate data in the set dictionary with the attribute name and/or the annotation in a character matching mode to obtain matched candidate data.
5. The method according to claim 2, wherein the matching the attribute of each candidate data in the set dictionary with the attribute name and/or the annotation to obtain the matched candidate data comprises:
and matching the attributes of each candidate data in the set dictionary with the attribute names and/or the annotations in a semantic matching mode to obtain matched candidate data.
6. The method of any of claims 1-5, wherein the obtaining an interface document comprises:
and accessing a cloud service according to the unique interface identifier and the text file for identity authentication, so as to provide the interface document corresponding to the unique interface identifier under the condition that the cloud service passes authentication based on the text file.
7. The method of claim 6, wherein the method further comprises:
acquiring and storing the text file from the cloud service through a browser;
and updating the stored text file under the condition that the browser receives an update notification from the cloud service.
8. The method of any of claims 1-5, wherein the generating a client interface code from the interface document comprises:
naming the class and the attributes in the class according to naming and/or annotation of the class in the interface document based on a naming rule;
and filling a code template according to the class and the name of the attribute in the class to obtain the client interface code.
9. An apparatus for developing a client interface, comprising:
the acquisition module is used for acquiring the interface document;
the generating module is used for generating a client interface code according to the interface document;
the matching module is used for matching the candidate data in the set dictionary with a target data structure used for storing server-side returned data in the client-side interface code and/or matching the candidate data in the set dictionary with comments on the target data structure in the interface document to obtain matched candidate data;
and the debugging module is used for taking the matched candidate data as the simulation return data of the server and adopting the simulation return data to test the client interface.
10. The device of claim 9, wherein the dictionary comprises candidate data corresponding to a plurality of attributes;
the matching module comprises:
the acquisition unit is used for determining an attribute name from a target data structure for storing return data of a server side, or acquiring an annotation of the target data structure from the interface document;
and the matching unit is used for matching the attribute of each candidate data in the set dictionary with the attribute name and/or the annotation to obtain matched candidate data.
11. The apparatus of claim 10, wherein the obtaining unit is configured to:
and performing recursive traversal on the multilayer attributes of the target data structure to obtain the attribute names belonging to the leaf nodes in the multilayer attributes.
12. The apparatus of claim 10, wherein the matching unit is configured to:
and matching the attribute of each candidate data in the set dictionary with the attribute name and/or the annotation in a character matching mode to obtain matched candidate data.
13. The apparatus of claim 10, wherein the matching unit is configured to:
and matching the attributes of each candidate data in the set dictionary with the attribute names and/or the annotations in a semantic matching mode to obtain matched candidate data.
14. The apparatus of any one of claims 9-13, wherein the obtaining means is configured to:
and accessing a cloud service according to the unique interface identifier and the text file for identity authentication, so as to provide the interface document corresponding to the unique interface identifier under the condition that the cloud service passes authentication based on the text file.
15. The apparatus of claim 14, wherein the apparatus further comprises:
the processing module is used for acquiring and storing the text file from the cloud service through a browser; and updating the stored text file under the condition that the browser receives an updating notice from the cloud service.
16. The apparatus of any of claims 9-13, wherein the means for generating is configured to:
naming the class and the attributes in the class according to naming and/or annotation of the class in the interface document based on a naming rule;
and filling a code template according to the class and the name of the attribute in the class to obtain the client interface code.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8.
CN202211463481.0A 2022-11-21 2022-11-21 Method, device, equipment and storage medium for developing client interface Pending CN115757145A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211463481.0A CN115757145A (en) 2022-11-21 2022-11-21 Method, device, equipment and storage medium for developing client interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211463481.0A CN115757145A (en) 2022-11-21 2022-11-21 Method, device, equipment and storage medium for developing client interface

Publications (1)

Publication Number Publication Date
CN115757145A true CN115757145A (en) 2023-03-07

Family

ID=85334630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211463481.0A Pending CN115757145A (en) 2022-11-21 2022-11-21 Method, device, equipment and storage medium for developing client interface

Country Status (1)

Country Link
CN (1) CN115757145A (en)

Similar Documents

Publication Publication Date Title
US20210342549A1 (en) Method for training semantic analysis model, electronic device and storage medium
US11250204B2 (en) Context-aware knowledge base system
CN113076104A (en) Page generation method, device, equipment and storage medium
CN112509690A (en) Method, apparatus, device and storage medium for controlling quality
CN114116065B (en) Method and device for acquiring topological graph data object and electronic equipment
CN112527281B (en) Operator upgrading method and device based on artificial intelligence, electronic equipment and medium
US20220237376A1 (en) Method, apparatus, electronic device and storage medium for text classification
US10216719B2 (en) Relation extraction using QandA
CN109840072B (en) Information processing method and device
WO2023142451A1 (en) Workflow generation methods and apparatuses, and electronic device
CN115186738B (en) Model training method, device and storage medium
CN114743586B (en) Mirror image storage implementation method and device of storage model and storage medium
CN113127357B (en) Unit test method, apparatus, device, storage medium, and program product
CN113590217B (en) Function management method and device based on engine, electronic equipment and storage medium
CN111859985B (en) AI customer service model test method and device, electronic equipment and storage medium
CN112231336B (en) Method and device for identifying user, storage medium and electronic equipment
CN115757145A (en) Method, device, equipment and storage medium for developing client interface
US10620946B1 (en) Dynamic modeling for opaque code during static analysis
US20210157881A1 (en) Object oriented self-discovered cognitive chatbot
CN110990528A (en) Question answering method and device and electronic equipment
CN110909191A (en) Graph data processing method and device, storage medium and electronic equipment
CN117033318B (en) Method and device for generating data to be tested, storage medium and electronic equipment
CN112560462B (en) Event extraction service generation method, device, server and medium
CN113239296B (en) Method, device, equipment and medium for displaying small program
CN109977221B (en) User verification method and device based on big data, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination