CN112612451A - Interface generation method, device, equipment and computer readable storage medium - Google Patents

Interface generation method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN112612451A
CN112612451A CN202011505392.9A CN202011505392A CN112612451A CN 112612451 A CN112612451 A CN 112612451A CN 202011505392 A CN202011505392 A CN 202011505392A CN 112612451 A CN112612451 A CN 112612451A
Authority
CN
China
Prior art keywords
target
interface
code
data
group data
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.)
Granted
Application number
CN202011505392.9A
Other languages
Chinese (zh)
Other versions
CN112612451B (en
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 Jinhai Pindu Technology Co ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011505392.9A priority Critical patent/CN112612451B/en
Publication of CN112612451A publication Critical patent/CN112612451A/en
Application granted granted Critical
Publication of CN112612451B publication Critical patent/CN112612451B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Bioethics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to big data processing, and discloses an interface generation method, which comprises the following steps: according to the interface generation instruction, logging in a project management platform through a configuration file; acquiring a code of a project space which is the same as the affiliated project space from the project space code list as a target project space code; acquiring a group data code list from the target project space according to the target project space code, and using the group data code list as a target group data code list; determining a target group data code corresponding to the information of the data to be acquired from the target group data code list as a target code; requesting an interface corresponding to the target group data, and acquiring interface definition information from the interface; and generating an interface for acquiring the data to be acquired according to the interface definition information. The invention also relates to a blockchain technique, the configuration file being stored in a blockchain. The invention does not need to manually maintain the definition of the key words of each interface operation, saves time and labor and is not easy to make mistakes.

Description

Interface generation method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to big data processing, and in particular, to a method and an apparatus for generating an interface, an electronic device, and a computer-readable storage medium.
Background
In object-oriented programming, an interface is a specification definition that defines the specification of behaviors and actions, and within a programming, an interface plays a role as a constraint and specification. The interface defines the specifications to be observed by a certain group of classes, the interface does not care about the internal state data of the classes and the implementation details of the methods in the classes, and only specifies that some methods must be provided in the group of classes, and the classes providing the methods can meet the actual requirements. The interface in Typescript (open source, cross-platform programming language) is similar to java (computer programming language), while adding more flexible interface types including attributes, functions, indexable and class, etc.
At present, in the development of projects with separated front and back ends, the front and back ends define interface definitions (including entry and return references); the front end is developed based on an interface provided by the back end; the method comprises the steps that an interface is used for developing a front-end project, and definition of keywords of various interface operations is manually maintained on the basis of interface definition; the method is time-consuming, labor-consuming and error-prone.
Disclosure of Invention
The invention provides an interface generation method, an interface generation device, electronic equipment and a computer readable storage medium, and mainly aims to solve the problems that time and labor are consumed, errors are easy to occur and the like because a front-end project which is developed by using an interface in the prior art needs to manually maintain the definition of keywords of each interface operation when the interface is defined.
In a first aspect, to achieve the above object, an interface generating method provided by the present invention includes: according to the interface generation instruction, logging in a project management platform through a configuration file; wherein the content of the first and second substances,
the configuration file comprises login information of the project management platform, information of data to be acquired and a project space to which the data to be acquired belong; the project management platform comprises project spaces, project space coding lists corresponding to the project spaces, and group data coding lists of each project space;
acquiring a code of an item space which is the same as the affiliated item space of the data to be acquired from the item space code list, and taking the code as a target item space code;
acquiring a group data code list from a target project space corresponding to the target project space code according to the target project space code, and using the group data code list as a target group data code list;
determining a target group data code corresponding to the information of the data to be acquired from the target group data code list as a target code; wherein the target group data encoding list includes information of target group data and an encoding of target group data corresponding to the information of the target group data;
according to the target code, requesting an interface corresponding to the target group data, and acquiring interface definition information from the interface;
and generating an interface for acquiring the data to be acquired according to the interface definition information.
In a second aspect, to solve the above problem, the present invention further provides an interface generating apparatus, including:
the platform login module is used for generating an instruction according to the interface and logging in the project management platform through the configuration file; wherein the content of the first and second substances,
the configuration file comprises login information of the project management platform, information of data to be acquired and a project space to which the data to be acquired belong; the project management platform comprises project spaces, project space coding lists corresponding to the project spaces, and group data coding lists of each project space;
the target project space code acquisition module is used for acquiring a code of a project space which is the same as the project space of the data to be acquired from the project space code list and taking the code as a target project space code;
a target group data code list acquiring module, configured to acquire a group data code list from a target item space corresponding to the target item space code according to the target item space code, as a target group data code list;
the target code acquisition module is used for determining a target group data code corresponding to the information of the data to be acquired from the target group data code list as a target code; wherein the target group data encoding list includes information of target group data and an encoding of target group data corresponding to the information of the target group data;
the interface definition information acquisition module is used for requesting an interface corresponding to the target group data according to the target code and acquiring interface definition information from the interface;
and the interface generating module is used for generating an interface for acquiring the data to be acquired according to the interface definition information.
In a third aspect, to solve the above problem, the present invention further provides an electronic apparatus, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the steps of the interface generation method.
In a fourth aspect, to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the steps of the interface generation method described above.
The interface generation method, the interface generation device, the electronic equipment and the computer readable storage medium provided by the invention log in a project management platform through a configuration file; acquiring a code of a project space which is the same as the affiliated project space of the data to be acquired from a project space code list of a project management platform, and taking the code as a target project space code; acquiring a group data coding list from a target project space corresponding to the target project space code according to the target project space code, and using the group data coding list as a target group data coding list; then determining a target group data code corresponding to the information of the data to be acquired from the target group data code list as a target code; then according to the target code, requesting the corresponding interface of the target group data, and acquiring interface definition information from the interface of the target group data; and finally, generating an interface for acquiring the data to be acquired according to the interface definition information. Through the process, the interface definition information of the data to be acquired can be generated in batch, and the corresponding interface is generated based on the interface definition information at the rear end, so that errors are not easy to occur; the data to be acquired can be batch data or single data; need not artifical interface information and maintain labour saving and time saving.
Drawings
Fig. 1 is a schematic flowchart of an interface generation method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a Chinese interface generation apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device implementing a chinese interface generation method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides an interface generation method. Fig. 1 is a schematic flow chart of an interface generation method according to an embodiment of the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the interface generation method includes:
s110, generating an instruction according to an interface, and logging in a project management platform through a configuration file; wherein the content of the first and second substances,
the configuration file comprises login information of the project management platform, information of the data to be acquired and a project space to which the data to be acquired belongs; the project management platform comprises project spaces, project space coding lists corresponding to the project spaces, and each project space comprises a group data coding list.
Specifically, front-end (e.g., front-end interface such as Web page or app) items need to be implemented through an interface provided by a back-end (e.g., some data storage platform). Wherein, the project management platform is a back-end project. A plurality of project spaces are stored in the project management platform, and each project space is divided into a plurality of groups of data; each group of data has different types of interfaces for transmitting data, so that the project space is sorted in a project space coding list mode for facilitating the front end to acquire data, and similarly, the group of data in each project space is also sorted in a group data coding list mode.
When a front-end project needs to acquire certain data from a back-end project, a data interface needs to be established with specific group data in a project management platform, and corresponding data is acquired through the data interface. The front end generates an interface generation instruction through page operation, simultaneously writes information of data to be acquired and login information of the project management platform into a configuration file, and the processor acquires the interface generation instruction and logs in the project management platform through the login information of the management platform in the configuration file.
As an optional embodiment of the present invention, the storing the configuration file in the blockchain, and according to the interface generation instruction, logging in the project management platform through the configuration file includes:
according to the interface generation instruction, acquiring a configuration file and starting a preset login platform script;
a preset login platform script logs in the project management platform by reading login information of the project management platform in the configuration file; the login information comprises a user name and a login password corresponding to the user name.
Specifically, in order to enable an automatic login project management platform, a login platform script is preset. And when the processor receives the interface generation instruction, starting the preset login platform script, and reading the login information of the project management platform in the configuration file by the started preset login platform script so as to realize automatic login of the project management platform.
And S120, acquiring a code of the same item space as the affiliated item space of the data to be acquired from the item space code list, and taking the code as a target item space code.
Specifically, each item space and the code of the item space corresponding to each item space are recorded in the item space code list, the item space to which the data to be acquired belongs is compared with each item space in the item space code list to obtain the item space identical to the item space to which the data belongs, wherein the comparison can be completed by comparing the name of the item space or a preset item space code, for example, if the item space to which the data to be acquired belongs is an item space a, the item space a is found from the item space code list according to the item space a, the code of the item space a is acquired, and the code is taken as a target item space code, that is, the code represents the data to be acquired in the target item space.
As an alternative embodiment of the present invention, acquiring a code of a project space identical to a belonging project space of data to be acquired from a project space code list, and taking the code as a target project space code includes:
determining an item space coding list with authority from the item space coding list according to a preset authority;
and acquiring the code of the item space which is the same as the affiliated item space of the data to be acquired from the authorized item space code list, and taking the code as the target item space code.
Specifically, the front end uses the back end data, some of which are authorized and some of which are not authorized, so as to ensure the safety of the back end data, the authorization needs to be preset, for example, when a certain front end acquires data to be acquired, if the project space to which the data to be acquired belongs is not authorized, the data acquisition can be performed only after the authorization is acquired; the preset authority comprises an authority item space, and the authority item space and a corresponding item space code are determined from the item space code list, so that an authority item space code list is formed. The method comprises the steps of comparing the item space to which the data to be acquired belongs with the item space with the authority in the item space code list with the authority, selecting the item space which is the same as the item space to which the data to be acquired belongs through comparing the item space name or the code and the like, acquiring the corresponding code, and taking the code as the target item space code.
And S130, acquiring a group data code list from the target item space corresponding to the target item space code according to the target item space code, and using the group data code list as a target group data code list.
Specifically, the processor acquires a target group data code list from the target project space according to the target project space code, wherein each project space is provided with a data interface for acquiring the group data code list, and the group data code list is acquired from the target project space through the interface.
As an alternative embodiment of the present invention, according to the target item space code, acquiring the group data code list from the target item space corresponding to the target item space code, as the target group data code list, includes:
taking the target project space code as the input parameter of the data interface of the target project space, and calling the data interface of the target project space;
acquiring target project space data from a target project space through a data interface of the target project space; wherein the target project space data comprises a group data encoding list;
analyzing the target project space data to obtain analyzed target project space data;
and acquiring a group data code list from the analyzed target project space data as a target group data code list.
Specifically, a target project space code is used as a reference of a data interface of a target project space, so that the data interface of the target project space is called, data is acquired from the target project space through the data interface, the acquired data at least comprises a target group data code list, the acquired data needs to be analyzed in order to facilitate the storage of the data by a project management platform, the analyzed target project space data is obtained after the data is analyzed, and then a group data code list is acquired from the analyzed target project space data and is used as the target group data code list.
S140, determining a target group data code corresponding to the information of the data to be acquired from the target group data code list as a target code; wherein the target group data encoding list includes information of the target group data and an encoding of the target group data corresponding to the information of the target group data.
Specifically, the information of the data to be acquired is compared with the information of the target group data in the target group data code list, the information of the target group data which is the same as the information of the data to be acquired is acquired, and the code corresponding to the information of the target group data is acquired, so that the target code is obtained, that is, the target group data is indicated as the data to be acquired.
As an optional embodiment of the present invention, determining a target group data code corresponding to information of data to be acquired from a target group data code list, as the target code, includes:
acquiring information of target group data which is the same as the information of the data to be acquired from the target group data coding list as information for determining the target group data;
according to the information of the determination target group data, the code of the target group data corresponding to the information of the determination target group data is acquired as the target code.
Specifically, the name or the preset code of the data to be acquired is compared with the information of the target group data, and then the information of the target group data includes the name or the preset code and can be set according to the actual situation. And after comparison, acquiring the information of the target group data which is the same as the information of the data to be acquired as the information for determining the target group data, and acquiring the code of the target group data corresponding to the information for determining the target group data as the target code.
S150, according to the target code, requesting an interface corresponding to the target group data, and acquiring interface definition information from the interface.
Specifically, the target code is used as an entry parameter in an HTTP request mode, a request is made for an interface of target group data corresponding to the target code, and when the request is successful, interface definition information is acquired from the interface of the target group data.
As an alternative embodiment of the present invention, requesting an interface corresponding to the target group data according to the target code, and acquiring the interface definition information from the interface includes:
requesting all interfaces of corresponding target group data according to the target code;
and calling all interfaces of the target group data by taking the interface codes of all interfaces of the target group data as the access parameters, and acquiring interface definition information in each called interface.
Specifically, in order to facilitate the front end to obtain data by using different interfaces, each group of data may have a plurality of different types of interfaces, for example, an api interface, a gourp interface, a list interface, and the like. Requesting all types of interfaces of target group data by taking the target code as an entry parameter; and each interface is provided with an interface code, all interfaces of the target group data are called by taking the interface code of each interface as an input parameter, and interface definition information in each called interface is obtained.
And S160, generating an interface for acquiring the data to be acquired according to the interface definition information.
Specifically, the processor returns the acquired interface definition information to the front end, loads the interface definition information into a local interface file of the front end, and establishes an interface for acquiring the data to be acquired with the back end through the local interface file.
As an optional embodiment of the present invention, generating an interface for acquiring data to be acquired according to the interface definition information includes:
extracting a main field from the interface definition information;
analyzing the main field to obtain analysis interface information; the interface analysis information comprises an interface parameter input field, an interface parameter output field, types of various fields and whether the various fields need attributes or not;
and generating an interface for acquiring the data to be acquired according to the analysis interface information.
Specifically, the interface definition information is used for generating data of a front-end and a back-end new interface, and for the convenience of data information storage, the interface definition information needs to be subjected to data analysis processing to obtain analyzed interface information after the data analysis processing, and the analyzed interface information at least includes basic information for generating the new interface, such as an interface parameter field, types of various fields, whether various fields need attributes, and the like. And returning the analyzed interface information to the front end, loading the analyzed interface information into a local file, and generating an interface for acquiring the data to be acquired.
Fig. 2 is a functional block diagram of an interface generation apparatus according to an embodiment of the present invention.
The interface generating apparatus 200 of the present invention may be installed in an electronic device. According to the implemented functions, the interface generating device may include a platform login module 210, a target project space code obtaining module 220, a target group data code list obtaining module 230, a target code obtaining module 240, an interface definition information obtaining module 250, and an interface generating module 260. A module according to the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the platform login module 210 is used for generating an instruction according to the interface and logging in the project management platform through the configuration file; the configuration file comprises login information of a project management platform, information of data to be acquired and a project space to which the data to be acquired belongs; the project management platform comprises project spaces, project space coding lists corresponding to the project spaces, and each project space comprises a group data coding list.
Specifically, front-end (e.g., front-end interface such as Web page or app) items need to be implemented through an interface provided by a back-end (e.g., some data storage platform). Wherein, the project management platform is a back-end project. A plurality of project spaces are stored in the project management platform, and each project space is divided into a plurality of groups of data; each group of data has different types of interfaces for transmitting data, so that the project space is sorted in a project space coding list mode for facilitating the front end to acquire data, and similarly, the group of data in each project space is also sorted in a group data coding list mode.
When a front-end project needs to acquire certain data from a back-end project, a data interface needs to be established with specific group data in a project management platform, and corresponding data is acquired through the data interface. The front end generates an interface generation instruction through page operation, simultaneously writes information of data to be acquired and login information of the project management platform into a configuration file, and the processor acquires the interface generation instruction and logs in the project management platform through the login information of the management platform in the configuration file.
As an optional embodiment of the present invention, the storing the configuration file in the blockchain, and according to the interface generation instruction, logging in the project management platform through the configuration file includes:
according to the interface generation instruction, acquiring a configuration file and starting a preset login platform script;
a preset login platform script logs in the project management platform by reading login information of the project management platform in the configuration file; the login information comprises a user name and a login password corresponding to the user name.
Specifically, in order to enable an automatic login project management platform, a login platform script is preset. And when the processor receives the interface generation instruction, starting the preset login platform script, and reading the login information of the project management platform in the configuration file by the started preset login platform script so as to realize automatic login of the project management platform.
And a target item space code obtaining module 220, configured to obtain, from the item space code list, a code of an item space that is the same as the item space to which the data to be obtained belongs, and use the code as a target item space code.
Specifically, each item space and the code of the item space corresponding to each item space are recorded in the item space code list, the item space to which the data to be acquired belongs is compared with each item space in the item space code list to obtain the item space identical to the item space to which the data belongs, wherein the comparison can be completed by comparing the name of the item space or a preset item space code, for example, if the item space to which the data to be acquired belongs is an item space a, the item space a is found from the item space code list according to the item space a, the code of the item space a is acquired, and the code is taken as a target item space code, that is, the code represents the data to be acquired in the target item space.
As an alternative embodiment of the present invention, acquiring a code of a project space identical to a belonging project space of data to be acquired from a project space code list, and taking the code as a target project space code includes:
determining an item space coding list with authority from the item space coding list according to a preset authority;
and acquiring the code of the item space which is the same as the affiliated item space of the data to be acquired from the authorized item space code list, and taking the code as the target item space code.
Specifically, the front end uses the back end data, some of which are authorized and some of which are not authorized, so as to ensure the safety of the back end data, the authorization needs to be preset, for example, when a certain front end acquires data to be acquired, if the project space to which the data to be acquired belongs is not authorized, the data acquisition can be performed only after the authorization is acquired; the preset authority comprises an authority item space, and the authority item space and a corresponding item space code are determined from the item space code list, so that an authority item space code list is formed. The method comprises the steps of comparing the item space to which the data to be acquired belongs with the item space with the authority in the item space code list with the authority, selecting the item space which is the same as the item space to which the data to be acquired belongs through comparing the item space name or the code and the like, acquiring the corresponding code, and taking the code as the target item space code.
And a target group data code list obtaining module 230, configured to obtain the group data code list from the target item space corresponding to the target item space code as the target group data code list.
Specifically, the processor acquires a target group data code list from the target project space according to the target project space code, wherein each project space is provided with a data interface for acquiring the group data code list, and the group data code list is acquired from the target project space through the interface.
As an alternative embodiment of the present invention, according to the target item space code, acquiring the group data code list from the target item space corresponding to the target item space code, as the target group data code list, includes:
taking the target project space code as the input parameter of the data interface of the target project space, and calling the data interface of the target project space;
acquiring target project space data from a target project space through a data interface of the target project space; wherein the target project space data comprises a group data encoding list;
analyzing the target project space data to obtain analyzed target project space data;
and acquiring a group data code list from the analyzed target project space data as a target group data code list.
Specifically, a target project space code is used as a reference of a data interface of a target project space, so that the data interface of the target project space is called, data is acquired from the target project space through the data interface, the acquired data at least comprises a target group data code list, the acquired data needs to be analyzed in order to facilitate the storage of the data by a project management platform, the analyzed target project space data is obtained after the data is analyzed, and then a group data code list is acquired from the analyzed target project space data and is used as the target group data code list.
A target code obtaining module 240, configured to determine, from the target group data code list, a target group data code corresponding to information of the data to be obtained as a target code; wherein the target group data encoding list includes information of the target group data and an encoding of the target group data corresponding to the information of the target group data.
Specifically, the information of the data to be acquired is compared with the information of the target group data in the target group data code list, the information of the target group data which is the same as the information of the data to be acquired is acquired, and the code corresponding to the information of the target group data is acquired, so that the target code is obtained, that is, the target group data is indicated as the data to be acquired.
As an optional embodiment of the present invention, determining a target group data code corresponding to information of data to be acquired from a target group data code list, as the target code, includes:
acquiring information of target group data which is the same as the information of the data to be acquired from the target group data coding list as information for determining the target group data;
according to the information of the determination target group data, the code of the target group data corresponding to the information of the determination target group data is acquired as the target code.
Specifically, the name or the preset code of the data to be acquired is compared with the information of the target group data, and then the information of the target group data includes the name or the preset code and can be set according to the actual situation. And after comparison, acquiring the information of the target group data which is the same as the information of the data to be acquired as the information for determining the target group data, and acquiring the code of the target group data corresponding to the information for determining the target group data as the target code.
An interface definition information obtaining module 250, configured to request an interface corresponding to the target group data according to the target code, and obtain interface definition information from the interface.
Specifically, the target code is used as an entry parameter in an HTTP request mode, a request is made for an interface of target group data corresponding to the target code, and when the request is successful, interface definition information is acquired from the interface of the target group data.
As an alternative embodiment of the present invention, requesting an interface corresponding to the target group data according to the target code, and acquiring the interface definition information from the interface includes:
requesting all interfaces of corresponding target group data according to the target code;
and calling all interfaces of the target group data by taking the interface codes of all interfaces of the target group data as the access parameters, and acquiring interface definition information in each called interface.
Specifically, in order to facilitate the front end to obtain data by using different interfaces, each group of data may have a plurality of different types of interfaces, for example, an api interface, a gourp interface, a list interface, and the like. Requesting all types of interfaces of target group data by taking the target code as an entry parameter; and each interface is provided with an interface code, all interfaces of the target group data are called by taking the interface code of each interface as an input parameter, and interface definition information in each called interface is obtained.
And the interface generating module 260 is configured to generate an interface for acquiring the data to be acquired according to the interface definition information.
Specifically, the processor returns the acquired interface definition information to the front end, loads the interface definition information into a local interface file of the front end, and establishes an interface for acquiring the data to be acquired with the back end through the local interface file.
As an optional embodiment of the present invention, generating an interface for acquiring data to be acquired according to the interface definition information includes:
extracting a main field from the interface definition information;
analyzing the main field to obtain analysis interface information; the interface analysis information comprises an interface parameter input field, an interface parameter output field, types of various fields and whether the various fields need attributes or not;
and generating an interface for acquiring the data to be acquired according to the analysis interface information.
Specifically, the interface definition information is used for generating data of a front-end and a back-end new interface, and for the convenience of data information storage, the interface definition information needs to be subjected to data analysis processing to obtain analyzed interface information after the data analysis processing, and the analyzed interface information at least includes basic information for generating the new interface, such as an interface parameter field, types of various fields, whether various fields need attributes, and the like. And returning the analyzed interface information to the front end, loading the analyzed interface information into a local file, and generating an interface for acquiring the data to be acquired.
Fig. 3 is a schematic structural diagram of an electronic device implementing an interface generation method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as an interface generation program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of an interface generation program, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., interface generation programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The interface generation program 12 stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, which when executed in the processor 10, can implement:
according to the interface generation instruction, logging in a project management platform through a configuration file; wherein the content of the first and second substances,
the configuration file comprises login information of the project management platform, information of the data to be acquired and a project space to which the data to be acquired belongs; the project management platform comprises project spaces and project space coding lists corresponding to the project spaces, wherein each project space comprises a group data coding list;
acquiring a code of a project space which is the same as the affiliated project space of the data to be acquired from the project space code list, and taking the code as a target project space code;
acquiring a group data code list from a target project space corresponding to the target project space code according to the target project space code, and using the group data code list as a target group data code list;
determining a target group data code corresponding to the information of the data to be acquired from the target group data code list as a target code; the target group data coding list comprises information of the target group data and codes of the target group data corresponding to the information of the target group data;
according to the target code, requesting an interface corresponding to the target group data, and acquiring interface definition information from the interface;
and generating an interface for acquiring the data to be acquired according to the interface definition information.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not described herein again. It is emphasized that the configuration file may also be stored in a node of a blockchain in order to further ensure privacy and security of the configuration file.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for generating an interface, the method comprising:
according to the interface generation instruction, logging in a project management platform through a configuration file; wherein the content of the first and second substances,
the configuration file comprises login information of the project management platform, information of data to be acquired and a project space to which the data to be acquired belong; the project management platform comprises project spaces, project space coding lists corresponding to the project spaces, and group data coding lists of each project space;
acquiring a code of an item space which is the same as the affiliated item space of the data to be acquired from the item space code list, and taking the code as a target item space code;
acquiring a group data code list from a target project space corresponding to the target project space code according to the target project space code, and using the group data code list as a target group data code list;
determining a target group data code corresponding to the information of the data to be acquired from the target group data code list as a target code; wherein the target group data encoding list includes information of target group data and an encoding of target group data corresponding to the information of the target group data;
according to the target code, requesting an interface corresponding to the target group data, and acquiring interface definition information from the interface;
and generating an interface for acquiring the data to be acquired according to the interface definition information.
2. The interface generation method according to claim 1, wherein the configuration file is stored in a blockchain, and the logging in the project management platform through the configuration file according to the interface generation instruction comprises:
according to the interface generation instruction, acquiring a configuration file and starting a preset login platform script;
the preset login platform script logs in the project management platform by reading login information of the project management platform in the configuration file; the login information comprises a user name and a login password corresponding to the user name.
3. The interface generation method according to claim 1, wherein the acquiring a code of an item space that is the same as the item space to which the data to be acquired belongs from the item space code list and taking the code as a target item space code comprises:
determining an item space coding list with authority from the item space coding list according to a preset authority;
and acquiring the code of the item space which is the same as the affiliated item space of the data to be acquired from the authorized item space code list, and taking the code as a target item space code.
4. The interface generating method according to claim 1, wherein the obtaining, according to the target item space code, a group data code list from a target item space corresponding to the target item space code as a target group data code list comprises:
taking the target project space code as the input parameter of a data interface of a target project space, and calling the data interface of the target project space;
acquiring target project space data from the target project space through a data interface of the target project space; wherein the target item space data comprises a group data encoding list;
analyzing the target project space data to obtain analyzed target project space data;
and acquiring the group data code list from the analyzed target project space data to serve as a target group data code list.
5. The interface generation method according to claim 1, wherein the determining, from the target group data code list, a target group data code corresponding to the information of the data to be acquired as a target code includes:
acquiring information of target group data which is the same as the information of the data to be acquired from the target group data coding list as information for determining the target group data;
and acquiring the code of the target group data corresponding to the information of the determined target group data as a target code according to the information of the determined target group data.
6. The interface generation method according to claim 1, wherein the requesting an interface corresponding to the target group data according to the target code and acquiring interface definition information from the interface includes:
requesting all interfaces of the corresponding target group data according to the target code;
and calling all interfaces of the target group data by taking the interface codes of all interfaces of the target group data as the access parameters, and acquiring interface definition information in each called interface.
7. The interface generation method according to claim 1, wherein the generating an interface for acquiring the data to be acquired according to the interface definition information includes:
extracting a main field from the interface definition information;
analyzing the main field to obtain analysis interface information; the analysis interface information comprises an interface parameter input field, an interface parameter output field, types of various fields and whether the various fields need attributes or not;
and generating an interface for acquiring the data to be acquired according to the analysis interface information.
8. An interface generation apparatus, the apparatus comprising:
the platform login module is used for generating an instruction according to the interface and logging in the project management platform through the configuration file; wherein the content of the first and second substances,
the configuration file comprises login information of the project management platform, information of data to be acquired and a project space to which the data to be acquired belong; the project management platform comprises project spaces, project space coding lists corresponding to the project spaces, and group data coding lists of each project space;
the target project space code acquisition module is used for acquiring a code of a project space which is the same as the project space of the data to be acquired from the project space code list and taking the code as a target project space code;
a target group data code list acquiring module, configured to acquire a group data code list from a target item space corresponding to the target item space code according to the target item space code, as a target group data code list;
the target code acquisition module is used for determining a target group data code corresponding to the information of the data to be acquired from the target group data code list as a target code; wherein the target group data encoding list includes information of target group data and an encoding of target group data corresponding to the information of the target group data;
the interface definition information acquisition module is used for requesting an interface corresponding to the target group data according to the target code and acquiring interface definition information from the interface;
and the interface generating module is used for generating an interface for acquiring the data to be acquired according to the interface definition information.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
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 steps of the interface generation method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the interface generation method according to any one of claims 1 to 7.
CN202011505392.9A 2020-12-18 2020-12-18 Interface generation method, device, equipment and computer readable storage medium Active CN112612451B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011505392.9A CN112612451B (en) 2020-12-18 2020-12-18 Interface generation method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011505392.9A CN112612451B (en) 2020-12-18 2020-12-18 Interface generation method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112612451A true CN112612451A (en) 2021-04-06
CN112612451B CN112612451B (en) 2024-04-12

Family

ID=75241162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011505392.9A Active CN112612451B (en) 2020-12-18 2020-12-18 Interface generation method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112612451B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060235868A1 (en) * 2004-01-13 2006-10-19 Achilles Heather D Methods and apparatus for representing markup language data
US20090183067A1 (en) * 2008-01-14 2009-07-16 Canon Kabushiki Kaisha Processing method and device for the coding of a document of hierarchized data
US20160342937A1 (en) * 2015-05-22 2016-11-24 Autodesk, Inc. Product inventory system
US10331422B1 (en) * 2019-02-10 2019-06-25 Julie Russell System and method for generating API devlopment code for integrating platforms
US10339332B1 (en) * 2016-09-19 2019-07-02 Google Llc Containerized build steps
CN111190596A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Joint debugging method and device, computer equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060235868A1 (en) * 2004-01-13 2006-10-19 Achilles Heather D Methods and apparatus for representing markup language data
US20090183067A1 (en) * 2008-01-14 2009-07-16 Canon Kabushiki Kaisha Processing method and device for the coding of a document of hierarchized data
US20160342937A1 (en) * 2015-05-22 2016-11-24 Autodesk, Inc. Product inventory system
US10339332B1 (en) * 2016-09-19 2019-07-02 Google Llc Containerized build steps
US10331422B1 (en) * 2019-02-10 2019-06-25 Julie Russell System and method for generating API devlopment code for integrating platforms
CN111190596A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Joint debugging method and device, computer equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谢业欣;: "一个基于数据共享的接口开发平台", 软件, no. 08, pages 160 - 165 *

Also Published As

Publication number Publication date
CN112612451B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
CN112134739B (en) Link state tracking method and device, electronic equipment and computer storage medium
CN112506779A (en) Software interface testing method and device, electronic equipment and storage medium
CN111652279A (en) Behavior evaluation method and device based on time sequence data and readable storage medium
CN111694844A (en) Enterprise operation data analysis method and device based on configuration algorithm and electronic equipment
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN111429121B (en) Block chain-based electronic ticket processing method, device, equipment and storage medium
CN112527664A (en) Method and device for generating test case, electronic equipment and storage medium
CN115129753A (en) Data blood relationship analysis method and device, electronic equipment and storage medium
CN112104662B (en) Far-end data read-write method, device, equipment and computer readable storage medium
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
CN112685384A (en) Data migration method and device, electronic equipment and storage medium
CN114911479A (en) Interface generation method, device, equipment and storage medium based on configuration
CN114896164A (en) Interface optimization method and device, electronic equipment and storage medium
CN115102770A (en) Resource access method, device and equipment based on user permission and storage medium
CN112612451A (en) Interface generation method, device, equipment and computer readable storage medium
CN114626103A (en) Data consistency comparison method, device, equipment and medium
CN114461531A (en) Platform adaptability test method, device, equipment and storage medium of test case
CN114036068A (en) Update detection method, device, equipment and storage medium based on privacy security
CN112667244A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN113723813A (en) Performance ranking method and device, electronic equipment and readable storage medium
CN113051171A (en) Interface test method, device, equipment and storage medium
CN112446781A (en) Wind control data generation method, device, equipment and computer readable storage medium
CN113608779B (en) Service interface configuration method, device, equipment and storage medium
CN113626533B (en) Ultraviolet power detection method and device and electronic equipment
CN114416575A (en) Method, device and equipment for generating Mock data and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20240315

Address after: No. 111-2037, Hanzhuang South Street, Jinhaihu Town, Pinggu District, Beijing, 101201 (cluster registration)

Applicant after: Beijing Jinhai Pindu Technology Co.,Ltd.

Country or region after: China

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

Country or region before: China

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant