Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present invention are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
In the description that follows, embodiments of the invention are described with reference to steps and symbols of operations performed by one or more computers, unless otherwise indicated. It will thus be appreciated that those steps and operations, which are referred to herein several times as being computer-executed, include being manipulated by a computer processing unit in the form of electronic signals representing data in a structured form. This manipulation transforms the data or maintains it at locations in the computer's memory system, which may reconfigure or otherwise alter the computer's operation in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the invention have been described in language specific to above, it is not intended to be limited to the specific details shown, since one skilled in the art will recognize that various steps and operations described below may be implemented in hardware.
The interface generation method and the interface generation device can be arranged in any electronic equipment and are used for generating corresponding data interfaces so as to carry out various types of data aggregation. The electronic devices include, but are not limited to, wearable devices, head-worn devices, medical health platforms, personal computers, server computers, hand-held or laptop devices, mobile devices (such as mobile phones, Personal Digital Assistants (PDAs), media players, and the like), multiprocessor systems, consumer electronics, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The interface generating means is preferably a data interface server for providing data aggregation services to aggregate data of different traffic types. The interface generation method and the interface generation device can improve the compatibility of the data interface to different service type data.
Referring to fig. 1, fig. 1 is a flowchart illustrating an interface generating method according to a first embodiment of the present invention. The interface generation method of this embodiment may be implemented by using the electronic device, and the interface generation method of this embodiment includes:
step S101, acquiring a service database storing service data;
step S102, extracting the data type of the service data and the data query logic of the service data in a service database;
step S103, splicing operation is carried out on the service data based on a preset interface template, the data type of the service data and the data query logic of the service data so as to generate a corresponding interface code file;
and step S104, loading the interface code file into a resolver of the interface database service to generate a data interface corresponding to the interface database.
The following describes in detail a specific flow of each step of the interface generation method according to the present embodiment.
In step S101, the interface generation device (the electronic device described above) acquires a service database in which service data is stored. The interface generation device of this embodiment is used to create a calling relationship between the data interface and the related service data in the service database.
In step S102, the interface generation device extracts the data type of the service data in the service database and the corresponding data query logic. The data type of the service data herein refers to a user-defined data type of the corresponding service data, such as defining a string data type string, a boolean data type coolean, a data type age for indicating an age, and a data type user for indicating a user name, etc.
The data query logic of the service data here refers to an analytic function for acquiring the field of service data. The analysis function of the service data such as the user name can be a return function for returning the user data type in the relevant service data of the user; or using the authentication function of getUserName as the resolution function of the username.
Therefore, the interface generation device can subsequently query the service data through the GraphQL language. GraphQL is a query language for data interfaces, a run-time method that uses queries based on custom data types. A GraphQL service is created by defining data types and corresponding data fields, and then each field on each type is provided with a corresponding parsing function (i.e., data query logic). If a GraphQL service tells us that the current login user is me, different types of information under the name of the user can be queried in the following ways:
Type me{
Name
Height
mass
}
results may be returned by GraphQL queries:
the name, height and mass are data types (name, height and weight) of the login user me, and the business data returned by the corresponding data query logic are jacky, 1.72 and 77.
In step S103, the interface generating device obtains a preset interface template, where the preset interface template is used to splice the service data obtained in step S102, the data type of the service data, and the corresponding data query logic, so as to form corresponding interface data.
Since the interface data may be composed of a plurality of service data in the service database or composed of service data in different service databases. Therefore, a plurality of service data need to be spliced by using a preset interface template, so that the finally generated data interface can return preset service data at one time.
And then the interface generation device continues splicing operation on the service data based on the interface data configured in the interface template to generate a corresponding interface code file. The interface code file comprises service data corresponding to the interface data and corresponding data query logic.
And if the preset interface template is adopted, all the business data related to the login user me in the business data can be spliced, such as the name, age, height, weight, academic calendar and other information of the login user me. The interface code file stores all relevant service data of the login user me and corresponding data query logic, so that the user can obtain all relevant service data of the login user me at one time through the corresponding data interface.
In step S104, the interface generation device loads the interface code file generated in step S104 into a parser of an interface database service (e.g., GraphQL service), and since the generated data interface needs to be associated with a corresponding interface database, the interface code file needs to be loaded in the interface database service, so that the interface database can call service data in different service databases.
Therefore, the interface database can generate a corresponding data interface, and a user can acquire corresponding service data by using the GraphQL query language. The interface template can define the minimum return data of the data interface, so that the data redundancy of the data interface can be effectively eliminated; and the definition modes of the interface templates corresponding to all the data interfaces are the same, and different interface templates can be called mutually, so that the data interfaces can be multiplexed mutually.
This completes the flow of data interface generation of the interface generation method of the present embodiment.
The interface generation method of the embodiment splices the service data based on the preset interface template to generate the corresponding interface code file, and can realize the rapid generation and modification of the data interface; the generated data interface can be reused by other interface templates, and minimum data definition can be carried out on interface data through the interface templates, so that interface data redundancy is eliminated, and testing of the data interface by testers is facilitated.
Referring to fig. 2, fig. 2 is a flowchart illustrating an interface generating method according to a second embodiment of the present invention. The interface generation method of this embodiment may be implemented by using the electronic device, and the interface generation method of this embodiment includes:
step S201, acquiring a service database storing service data;
step S202, based on a user extraction instruction on a visual interface, extracting the data type of the business data and the data query logic of the business data in a business database;
step S203, acquiring a preset interface template, and acquiring the corresponding relation between the data type of the service data corresponding to the interface data and the data query logic from the interface template so that the interface data support GraphQL query;
step S204, generating a type code file based on the data type of the service data; generating a processor code file based on the data query logic of the service data;
step S205, generating a database code file according to the corresponding relation between the data type of the service data corresponding to the interface data and the data query logic, the type code file and the processor code file;
step S206, loading the interface code file into a parser of the GraphQL service;
step S207, initializing the interface database by using the loaded GraphQL service;
step S208, the GraphQL service is operated in the interface database to generate a data interface corresponding to the interface database;
and step S209, debugging the data interface by using a GraphQL debugging tool.
The following describes in detail a specific flow of each step of the interface generation method according to the present embodiment.
In step S201, the interface generation device (the electronic device as described above) acquires a service database storing service data. The interface generation device of this embodiment is used to create a calling relationship between the data interface and the related service data in the service database.
In step S202, the interface generating device receives an extracting instruction of a user on the visual interface, that is, an instruction for the user to select the service database, the service data in the service database, the data type of the service data, and the corresponding data query logic.
The data type of the service data herein refers to a user-defined data type of the corresponding service data, such as defining a string data type string, a boolean data type coolean, a data type age for indicating an age, and a data type user for indicating a user name, etc. The data query logic of the service data here refers to an analytic function for acquiring the field of service data.
The analysis function of the service data such as the user name can be a return function for returning the user data type in the relevant service data of the user; or using the authentication function of getUserName as the resolution function of the username.
The user sends an extraction instruction through the visual interface, the user can clearly designate different service databases and distinguish service data in the service databases, and meanwhile, when the service data are designated, the data type and the data query logic of the service data can be checked, so that errors of the service data in the service databases are prevented. Of course, the user can also extract all the service data related to the login user me through the code extraction instruction.
In step S203, the interface generating device obtains a preset interface template, where the preset interface template is used to splice the service data obtained in step S202, the data type of the service data, and the corresponding data query logic, so as to form corresponding interface data. Therefore, the interface template needs to include the corresponding relationship between the data type of the service data corresponding to the interface data and the data query logic.
If the interface data includes all relevant information of the user, such as a user name, a user age, a user gender and the like, the interface template records the corresponding relation between the data types of the user name, the user age and the user gender and the data query logic so as to carry out splicing operation on the user relevant service information such as the user name, the user age, the user gender and the like, and further output the interface data of the relevant information of the user from the data interface.
The interface generation device firstly acquires the data type of the service data corresponding to the interface data and the corresponding relation of the data query logic from the interface template so that the interface data support GraphQL query.
In step S204, the interface generation means acquires the data type of the service data acquired in step S202, and generates a corresponding type code file. The type code file is used for storing the data types of all the service data in the interface data. Subsequently, the interface generation means acquires the data query logic of the service data acquired in step S202, and generates a processor code file. The processor code file is used for storing data query logic of all service data in the interface data.
In step S205, the interface generation means generates a database code file based on the correspondence relationship between the data type of the service data corresponding to the interface data acquired in step S203 and the data query logic, the type code file acquired in step S204, and the processor code file acquired in step S204, and further generates a corresponding interface code file. The interface code file includes a type code file, a processor code file, and a database code file.
Specifically, the interface generation device may determine, based on a correspondence between a data type of the service data corresponding to the interface data and the data query logic, a call relationship between the interface data and the type code file and a call relationship between the interface data and the processor code file, respectively; and then the interface generation device saves the calling relations between the interface data and the type code file and the calling relations between the interface data and the processor code file as a database code file.
Specifically, the database code file may include a database initialization file for initializing the interface database, a database registration file for registering in the interface database, and a database data table file for feeding back a call relationship between the interface data and the type code file and the processor code file, respectively.
In step S206, the interface generation device loads the interface code file generated in step S205 into the parser of the GraphQL service, i.e., registers the interface code file in the GraphQL service through the database registration file in the interface code file. Since the generated data interface is called by the GraphQL service, an interface code file needs to be loaded in the GraphQL service, so that the GraphQL service can call the service data in different service databases.
In step S207, the interface generation apparatus performs an initialization operation on the interface database using the loaded GraphQL service, so as to prevent the previous data in the interface database from affecting the interface data, and ensure the effectiveness of running the GraphQL service using the interface code file.
In step S208, the interface generation apparatus runs the GraphQL service in the interface database to generate a data interface corresponding to the interface database; the user can obtain corresponding service data by using a GraphQL query language.
In step S209, the reception generation apparatus may debug the data interface generated in step S208 using a GraphQL debug tool, so that a tester may test the data interface in advance.
This completes the flow of data interface generation of the interface generation method of the present embodiment.
On the basis of the first embodiment, the file structure setting of the interface code file in the interface generation method of the embodiment can conveniently call the data type and the data query logic of the service data, so as to perform more effective and faster query operation through the GrapgQL service; the setting of a database initialization file, a database registration file and a database data table file in the interface code file can improve the operation effectiveness of the GraphQL service; the debugging of the data interface can effectively test the data interface before the data interface runs.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an interface generating device according to a first embodiment of the present invention. The interface generating apparatus of this embodiment may be implemented by using the first embodiment of the interface generating method described above, and theinterface generating apparatus 30 includes a servicedatabase obtaining module 31, a service dataparameter extracting module 32, an interface codefile generating module 33, and a datainterface generating module 34.
The servicedatabase acquisition module 31 is configured to acquire a service database storing service data; the service dataparameter extraction module 32 is configured to extract a data type of the service data and a data query logic of the service data in the service database; the interface codefile generating module 33 is configured to perform a splicing operation on the service data based on a preset interface template, a data type of the service data, and a data query logic of the service data, so as to generate a corresponding interface code file; the data interface generatingmodule 34 is configured to load the interface code file into a parser of the interface database service to generate a data interface corresponding to the interface database.
When theinterface generation apparatus 30 of the present embodiment is used, first, the servicedatabase acquisition module 31 acquires a service database in which service data is stored. The interface generation device of this embodiment is used to create a calling relationship between the data interface and the related service data in the service database.
The service dataparameter extraction module 32 then extracts the data type of the service data in the service database and the corresponding data query logic. The data type of the service data herein refers to a user-defined data type of the corresponding service data, such as defining a string data type string, a boolean data type coolean, a data type age for indicating an age, and a data type user for indicating a user name, etc.
The data query logic of the service data here refers to an analytic function for acquiring the field of service data.
Then, the interface codefile generating module 33 obtains a preset interface template, where the preset interface template is used to splice the obtained service data, the data type of the service data, and the corresponding data query logic to form corresponding interface data.
Since the interface data may be composed of a plurality of service data in the service database or composed of service data in different service databases. Therefore, a plurality of service data need to be spliced by using a preset interface template, so that the finally generated data interface can return preset service data at one time.
The interface codefile generating module 33 will continue to perform the splicing operation on the service data based on the interface data configured in the interface template to generate a corresponding interface code file. The interface code file comprises service data corresponding to the interface data and corresponding data query logic.
Finally, the data interface generatingmodule 34 loads the generated interface code file into the parser of the interface database service, and since the generated data interface is associated with the corresponding interface database, the interface code file needs to be loaded in the interface database service, so that the interface database can call the service data in different service databases.
Therefore, the interface database can generate a corresponding data interface, and a user can acquire corresponding service data by using the GraphQL query language. The interface template can define the minimum return data of the data interface, so that the data redundancy of the data interface can be effectively eliminated; and the definition modes of the interface templates corresponding to all the data interfaces are the same, and different interface templates can be called mutually, so that the data interfaces can be multiplexed mutually.
This completes the flow of data interface generation by theinterface generation device 30 of the present embodiment.
The interface generation device of the embodiment splices the service data based on the preset interface template to generate a corresponding interface code file, so that the rapid generation and modification of a data interface can be realized; the generated data interface can be reused by other interface templates, and minimum data definition can be carried out on interface data through the interface templates, so that interface data redundancy is eliminated, and testing of the data interface by testers is facilitated.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an interface generating device according to a second embodiment of the present invention. The interface generating apparatus of this embodiment may be implemented by using the second embodiment of the interface generating method, and theinterface generating apparatus 40 includes a servicedatabase obtaining module 41, a service dataparameter extracting module 42, an interface codefile generating module 43, a datainterface generating module 44, and aninterface debugging module 45.
The servicedatabase obtaining module 41 is configured to obtain a service database storing service data; the service dataparameter extraction module 42 is configured to extract a data type of the service data and a data query logic of the service data in the service database; the interface codefile generating module 43 is configured to perform a splicing operation on the service data based on a preset interface template, a data type of the service data, and a data query logic of the service data, so as to generate a corresponding interface code file; the data interface generatingmodule 44 is configured to load the interface code file into a parser of the interface database service to generate a data interface corresponding to the interface database; theinterface debugging module 45 is configured to debug the data interface using a GraphQL debugging tool.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an interface code file generating module of a second embodiment of the interface generating device according to the present invention. The interface codefile generating module 43 includes an interface dataparameter acquiring unit 51, a call data codefile generating unit 52, and an interface data codefile generating unit 53.
The interface dataparameter obtaining unit 51 is configured to obtain a corresponding relationship between a data type of service data corresponding to the interface data and a data query logic from the interface template, so that the interface data supports GraphQL query; the calling data codefile generating unit 52 is configured to generate a type code file based on the data type of the service data; generating a processor code file based on the data query logic of the service data; the interface data codefile generating unit 53 is configured to generate a database code file according to a correspondence between a data type of service data corresponding to the interface data and the data query logic, a type code file, and a processor code file.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an interface data code file generating unit of an interface code file generating module according to a second embodiment of the interface generating device of the present invention. The interface data codefile generating unit 53 includes a callrelation determining subunit 61 and an interface data codefile generating subunit 62.
The callingrelation determining subunit 61 is configured to determine, based on a corresponding relation between a data type of service data corresponding to the interface data and the data query logic, a calling relation between the interface data and the type code file and a calling relation between the interface data and the processor code file, respectively; the interface data codefile generation subunit 62 is configured to save the call relationships between the interface data and the type code file and the processor code file as database code files.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a data interface generating module of a second embodiment of the interface generating device of the present invention. The datainterface generation module 44 includes aloading unit 71, aninitialization unit 72, and a datainterface generation unit 73.
Theloading unit 71 is configured to load the interface code file into a parser of the interface database service; theinitialization unit 72 is configured to perform initialization operations on the interface database using GraphQL services; the data interface generatingunit 73 is configured to run the GraphQL service in the interface database to generate a data interface corresponding to the interface database.
When theinterface generation apparatus 40 of the present embodiment is used, first, the servicedatabase acquisition module 41 acquires a service database in which service data is stored. The interface generation device of this embodiment is used to create a calling relationship between the data interface and the related service data in the service database.
Then, the service dataparameter extraction module 42 receives an extraction instruction of the user on the visual interface, that is, an instruction for the user to select the service database, the service data in the service database, the data type of the service data, and the corresponding data query logic.
The data type of the service data herein refers to a user-defined data type of the corresponding service data, such as defining a string data type string, a boolean data type coolean, a data type age for indicating an age, and a data type user for indicating a user name, etc. The data query logic of the service data here refers to an analytic function for acquiring the field of service data.
The user sends an extraction instruction through the visual interface, the user can clearly designate different service databases and distinguish service data in the service databases, and meanwhile, when the service data are designated, the data type and the data query logic of the service data can be checked, so that errors of the service data in the service databases are prevented. Of course, the user can also extract all the service data related to the login user me through the code extraction instruction.
Then, the interface codefile generating module 43 obtains a preset interface template, where the preset interface template is used to splice the service data, the data type of the service data, and the corresponding data query logic to form corresponding interface data. Therefore, the interface template needs to include the corresponding relationship between the data type of the service data corresponding to the interface data and the data query logic.
The module interface dataparameter obtaining unit 51 of the interface codefile generating module 43 obtains the data type of the service data corresponding to the interface data and the corresponding relationship of the data query logic from the interface template, so that the interface data support GraphQL query.
The call data codefile generating unit 52 of the interface codefile generating module 43 obtains the data type of the service data, and generates a corresponding type code file. The type code file is used for storing the data types of all the service data in the interface data. And then calling a data code file generation unit to acquire data query logic of the service data to generate a processor code file. The processor code file is used for storing data query logic of all service data in the interface data.
The interface data codefile generating unit 53 of the interface codefile generating module 43 generates a database code file based on the correspondence between the data type of the service data corresponding to the acquired interface data and the data query logic, the acquired type code file, and the acquired processor code file, and further generates a corresponding interface code file. The interface code file includes a type code file, a processor code file, and a database code file.
Specifically, the callrelation determining subunit 61 of the interface data codefile generating unit 53 may determine, based on the correspondence between the data type of the service data corresponding to the interface data and the data query logic, the call relations between the interface data and the type code file and between the interface data and the processor code file, respectively; then the interface data codefile generating subunit 62 of the interface data codefile generating unit 53 saves the call relationships of the interface data with the type code file and the processor code file, respectively, as a database code file.
Specifically, the database code file may include a database initialization file for initializing the interface database, a database registration file for registering in the interface database, and a database data table file for feeding back a call relationship between the interface data and the type code file and the processor code file, respectively.
Then, theloading unit 71 of the data interface generatingmodule 44 loads the interface code file into a parser of the interface database service (i.e., the GraphQL service), i.e., the interface code file can be registered in the GraphQL service through the database registration file in the interface code file. Since the generated data interface is called by the GraphQL service, an interface code file needs to be loaded in the GraphQL service, so that the GraphQL service can call the service data in different service databases.
Theinitialization unit 72 of the datainterface generation module 44 performs initialization operation on the interface database by using the loaded GraphQL service, so as to prevent the previous data in the interface database from affecting the interface data, and ensure the effectiveness of running the GraphQL service by using the interface code file.
The data interface generatingunit 73 of the data interface generatingmodule 44 runs the GraphQL service in the interface database to generate a data interface corresponding to the interface database; the user can obtain corresponding service data by using a GraphQL query language.
Finally, theinterface debugging module 45 may debug the generated data interface using a GraphQL debugging tool, so that a tester may test the data interface in advance.
This completes the flow of data interface generation by the interface generation apparatus of the present embodiment.
On the basis of the first embodiment, the file structure setting of the interface code file in the interface generating device of the embodiment can conveniently call the data type and the data query logic of the service data, so as to perform more effective and faster query operation through the GrapgQL service; the setting of a database initialization file, a database registration file and a database data table file in the interface code file can improve the operation effectiveness of the GraphQL service; the debugging of the data interface can effectively test the data interface before the data interface runs.
The following describes a specific operation principle of the interface generation method and the interface generation apparatus according to the present invention by using a specific embodiment. Referring to fig. 8a and 8b, fig. 8a is a schematic diagram of a hardware structure corresponding to an embodiment of an interface generation method and an interface generation apparatus of the present invention, and fig. 8b is a flowchart of a data interface generation corresponding to an embodiment of an interface generation method and an interface generation apparatus of the present invention. The interface generating device of this embodiment may be disposed in the interface database, and is configured to form a data interface corresponding to the interface database. As shown in fig. 8a, theinterface database 801 may call a plurality ofservice databases 802, and may be connected to a plurality of terminals (e.g., amobile phone terminal 803, acomputer terminal 804, and an intelligent charm terminal 805) through data interfaces, so that the terminals may obtain service data of the plurality ofservice databases 802 through the data interfaces.
Referring to fig. 8b, the process of generating the data interface of the present embodiment includes:
step S801, acquiring a plurality ofservice databases 802 with service data as a newly added database of the existinginterface database 801;
in step S802, the user may select theservice database 802, the service data in thecorresponding service database 802, the data type of the service data, and the corresponding data query logic through the visual interface of theinterface database 801, so as to send an extraction instruction to theinterface database 801.
Referring to fig. 9a to 9d, through the visual interface of fig. 9a, the user may select the service database asn _ private _ test; the user can then select business data of different data types through the visual interface of fig. 9b, such as business data with string data type field name e1 in fig. 9 b; then, the user may select data query logic, i.e., an analysis function, such as the authentication function getUserName in fig. 9c, corresponding to different service data through the visual interface in fig. 9 c; finally, the user can bind the service data of different data types with the corresponding data query logic through fig. 9d, for example, the service data corresponding to the field name e1 is bound with the authentication function getUserName in fig. 9d, so that the user can query the service data with the field name e1 through the authentication function getUserName.
The user may thus define the data types and corresponding data query logics for all service data needed in theservice database 802.
Specifically, the data type in theservice database 802 may be pulled by using a statement of async generateType (e _ ids: string, proj _ name: string), the data query logic in theservice database 802 may be pulled by using a statement of async generateResolver (e _ ids: string, proj _ name: string), a preset interface module may be pulled by using a statement of async generateDB (e _ ids: string, proj _ name: string), and a configuration file of an interface code file may be generated by using an async generateTSContf (proj _ name: string) statement, so as to perform configuration operation on the interface code file.
In step S803, theinterface database 801 obtains a preset interface module, and performs a splicing operation on the service data based on the interface data configured in the interface module to generate a corresponding interface code file.
The interface code file comprises a type code file for storing data types, a processor code file for storing data query logic and a database code file for storing calling relations between the interface data and the type code file and between the interface data and the processor code file.
The database code files comprise a database initialization file for initializing the interface database, a database registration file for registering in the interface database, and a database data table file for feeding back the calling relations between the interface data and the type code file and the processor code file respectively.
Specifically, an export async function renderTypeToFile (data: TType, proj _ name: string) may be used: rendering a type code file by a statement of Promise < any >;
an export async function renderResolToFile (data: RESOLType, proj _ name: string) may be used: rendering a processor code file by a statement of Promise < any >;
an export async function renderrdbtofile (data: DBType, proj _ name: string) may be used: rendering a statement of Promise < any > to obtain a database initialization file;
an export async function renderRDBresistToFile (data: DBType [ ], proj _ name: string) may be used: rendering a database registration file by a statement of Promise < any >;
an export async function rendertableToFile (data: TBType, dbPath: string) may be used: rendering the statement of the project < any > to form a database data table file;
also export async function rendertsconfile (proj _ name: string, data: the statement of Promise < any > renders the configuration compilation file.
Step S804, after theinterface database 801 completes the splicing of the interface code file, the interface code file is compiled, compressed, and loaded into the parser of the interface database service, and the interface code file can be loaded into the parser through a function createpolyoserver (typeDefs) statement.
In step S805, theinterface database 801 performs an initialization operation, which may be performed by a function initDB (proj _ name: string) statement.
Step S806, the GraphQL service is run in theinterface database 801 to generate a data interface corresponding to theinterface database 801, and the GraphQL service can be run through an export function load gqlserver (app, proj _ name: string) statement, so that themobile phone terminal 803, thecomputer terminal 804, and thesmart ornament terminal 805 can obtain the service data of theservice database 802 through the data interface.
And step S807, debugging the generated data interface by a GraphQL debugging tool.
This completes the generation flow of the data interface of the present embodiment.
The interface generation method, the device, the storage medium and the electronic equipment splice the service data based on the interface template to generate the corresponding interface code file, so that the rapid generation and modification of the data interface can be realized; the generated data interface can be reused by other interface templates, and minimum data definition can be carried out on interface data through the interface templates, so that interface data redundancy is eliminated, and testing of the data interface by testers is facilitated. The technical problem that the compatibility of a data interface generated by the existing interface generation method for different service type data is poor is effectively solved.
As used herein, the terms "component," "module," "system," "interface," "process," and the like are generally intended to refer to a computer-related entity: hardware, a combination of hardware and software, or software in execution. For example, a component may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a controller and the controller can be a component. One or more components can reside within a process and/or thread of execution and a component may be localized on one computer and/or distributed between two or more computers.
FIG. 10 and the following discussion provide a brief, general description of an operating environment of an electronic device in which the interface generation apparatus described herein may be implemented. The operating environment of FIG. 10 is only one example of a suitable operating environment and is not intended to suggest any limitation as to the scope of use or functionality of the operating environment. Exampleelectronic devices 1012 include, but are not limited to, wearable devices, head-mounted devices, medical health platforms, personal computers, server computers, hand-held or laptop devices, mobile devices (such as mobile phones, Personal Digital Assistants (PDAs), media players, and the like), multiprocessor systems, consumer electronics, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
Although not required, embodiments are described in the general context of "computer readable instructions" being executed by one or more electronic devices. Computer readable instructions may be distributed via computer readable media (discussed below). Computer readable instructions may be implemented as program modules, such as functions, objects, Application Programming Interfaces (APIs), data structures, etc. that perform particular tasks or implement particular abstract data types. Typically, the functionality of the computer readable instructions may be combined or distributed as desired in various environments.
FIG. 10 illustrates an example of anelectronic device 1012 that includes one or more embodiments of the interface generation apparatus of the present invention. In one configuration,electronic device 1012 includes at least oneprocessing unit 1016 andmemory 1018. Depending on the exact configuration and type of electronic device,memory 1018 may be volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.) or some combination of the two. This configuration is illustrated in fig. 10 by dashedline 1014.
In other embodiments,electronic device 1012 may include additional features and/or functionality. For example,device 1012 may also include additional storage (e.g., removable and/or non-removable) including, but not limited to, magnetic storage, optical storage, and the like. Such additional storage is illustrated in FIG. 10 bystorage 1020. In one embodiment, computer readable instructions to implement one or more embodiments provided herein may be instorage 1020.Storage 1020 may also store other computer readable instructions to implement an operating system, an application program, and the like. Computer readable instructions may be loaded inmemory 1018 for execution byprocessing unit 1016, for example.
The term "computer readable media" as used herein includes computer storage media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions or other data.Memory 1018 andstorage 1020 are examples of computer storage media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed byelectronic device 1012. Any such computer storage media may be part ofelectronic device 1012.
Electronic device 1012 may also include communication connection(s) 1026 that allowelectronic device 1012 to communicate with other devices. Communication connection(s) 1026 may include, but is not limited to, a modem, a Network Interface Card (NIC), an integrated network interface, a radio frequency transmitter/receiver, an infrared port, a USB connection, or other interfaces for connectingelectronic device 1012 to other electronic devices. Thecommunication connection 1026 may comprise a wired connection or a wireless connection. Communication connection(s) 1026 may transmit and/or receive communication media.
The term "computer readable media" may include communication media. Communication media typically embodies computer readable instructions or other data in a "modulated data signal" such as a carrier wave or other transport mechanism and includes any information delivery media. The term "modulated data signal" may include signals that: one or more of the signal characteristics may be set or changed in such a manner as to encode information in the signal.
Electronic device 1012 may include input device(s) 1024 such as keyboard, mouse, pen, voice input device, touch input device, infrared camera, video input device, and/or any other input device. Output device(s) 1022 such as one or more displays, speakers, printers, and/or any other output device may also be included indevice 1012.Input device 1024 andoutput device 1022 may be connected toelectronic device 1012 via a wired connection, wireless connection, or any combination thereof. In one embodiment, an input device or an output device from another electronic device may be used asinput device 1024 oroutput device 1022 forelectronic device 1012.
The components ofelectronic device 1012 may be connected by various interconnects, such as a bus. Such interconnects may include Peripheral Component Interconnect (PCI), such as PCI express, Universal Serial Bus (USB), firewire (IEEE1394), optical bus structures, and the like. In another embodiment, components ofelectronic device 1012 may be interconnected by a network. For example,memory 1018 may be comprised of multiple physical memory units located in different physical locations interconnected by a network.
Those skilled in the art will realize that storage devices utilized to store computer readable instructions may be distributed across a network. For example,electronic device 1030 accessible vianetwork 1028 may store computer readable instructions to implement one or more embodiments of the present invention.Electronic device 1012 may accesselectronic device 1030 and download a part or all of the computer readable instructions for execution. Alternatively,electronic device 1012 may download pieces of the computer readable instructions, as needed, or some instructions may be executed atelectronic device 1012 and some atelectronic device 1030.
Various operations of embodiments are provided herein. In one embodiment, the one or more operations may constitute computer readable instructions stored on one or more computer readable media, which when executed by an electronic device, will cause the computing device to perform the operations. The order in which some or all of the operations are described should not be construed as to imply that these operations are necessarily order dependent. Those skilled in the art will appreciate alternative orderings having the benefit of this description. Moreover, it should be understood that not all operations are necessarily present in each embodiment provided herein.
Also, although the disclosure has been shown and described with respect to one or more implementations, equivalent alterations and modifications will occur to others skilled in the art based upon a reading and understanding of this specification and the annexed drawings. The present disclosure includes all such modifications and alterations, and is limited only by the scope of the appended claims. In particular regard to the various functions performed by the above described components (e.g., elements, resources, etc.), the terms used to describe such components are intended to correspond, unless otherwise indicated, to any component which performs the specified function of the described component (e.g., that is functionally equivalent), even though not structurally equivalent to the disclosed structure which performs the function in the herein illustrated exemplary implementations of the disclosure. In addition, while a particular feature of the disclosure may have been disclosed with respect to only one of several implementations, such feature may be combined with one or more other features of the other implementations as may be desired and advantageous for a given or particular application. Furthermore, to the extent that the terms "includes," has, "" contains, "or variants thereof are used in either the detailed description or the claims, such terms are intended to be inclusive in a manner similar to the term" comprising.
Each functional unit in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium. The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Each apparatus or system described above may perform the method in the corresponding method embodiment.
In summary, although the present invention has been disclosed in the foregoing embodiments, the serial numbers before the embodiments are used for convenience of description only, and the sequence of the embodiments of the present invention is not limited. Furthermore, the above embodiments are not intended to limit the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, therefore, the scope of the present invention shall be limited by the appended claims.