CN115062084A - Method and device for constructing API (application program interface) based on database metadata - Google Patents

Method and device for constructing API (application program interface) based on database metadata Download PDF

Info

Publication number
CN115062084A
CN115062084A CN202210995539.XA CN202210995539A CN115062084A CN 115062084 A CN115062084 A CN 115062084A CN 202210995539 A CN202210995539 A CN 202210995539A CN 115062084 A CN115062084 A CN 115062084A
Authority
CN
China
Prior art keywords
metadata
interface
api
database
api interface
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
CN202210995539.XA
Other languages
Chinese (zh)
Other versions
CN115062084B (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.)
Zhongguancun Smart City Co Ltd
Original Assignee
Zhongguancun Smart City 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 Zhongguancun Smart City Co Ltd filed Critical Zhongguancun Smart City Co Ltd
Priority to CN202210995539.XA priority Critical patent/CN115062084B/en
Publication of CN115062084A publication Critical patent/CN115062084A/en
Application granted granted Critical
Publication of CN115062084B publication Critical patent/CN115062084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a method and a device for constructing an API (application programming interface) based on database metadata, which belong to the technical field of computers, wherein the method for constructing the API based on the database metadata comprises the following steps: acquiring metadata names, metadata types, metadata lengths and metadata addition and deletion; verifying whether the metadata is changed or not according to the metadata name, the metadata type, the metadata length and the metadata addition and deletion, and if yes, outputting a metadata change event; and constructing or updating an API interface according to the metadata change event. Because the method directly constructs the API according to the metadata, the intermediate process is omitted, the time consumption is shorter, the interface issuing process does not need manual intervention, the compiling of the API document is not needed, and the labor cost is saved.

Description

Method and device for constructing API (application programming interface) based on database metadata
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method and a device for constructing an API (application programming interface) based on database metadata.
Background
An Application Programming Interface (API), also called API, is a convention for linking different components of a software system, and is hereinafter referred to as API Interface. The design of API interfaces is important because of the ever-increasing size of software in recent years, often requiring the partitioning of complex systems into small components. In the programming practice, the API interface is designed to reasonably divide the software system duties. The good API interface design can reduce the mutual dependence of all parts of the system, improve the cohesion of the composition units and reduce the coupling degree among the composition units, thereby improving the maintainability and the expansibility of the system.
At present, an API interface is developed in a coding mode, so that the requirements on personnel are high, and the efficiency is low; when the metadata changes, related API interfaces cannot be quickly positioned, omission easily occurs, an API interface program needs to be manually recoded and modified, the release period is long, and a large number of personnel are involved in the release period, and errors are easily caused; in the encoding process, the technical levels of the personnel are different, the condition that the interface forms are not uniform is easy to occur, the readability is poor, and the operation and maintenance management is not easy to realize.
Disclosure of Invention
The application aims to provide a method and a device for constructing an API (application programming interface) based on database metadata so as to solve the problem of difficulty in updating the API.
According to a first aspect of embodiments of the present application, there is provided a method for constructing an API interface based on database metadata, where the method may include:
acquiring metadata names, metadata types, metadata lengths and metadata addition and deletion;
verifying whether the metadata is changed or not according to the metadata name, the metadata type, the metadata length and the metadata addition and deletion, and if so, outputting a metadata change event;
and constructing or updating the API interface according to the metadata change event.
In some optional embodiments of the present application, obtaining a metadata name, a metadata type, a metadata length, and metadata addition/deletion includes:
analyzing the log and scanning metadata information in the database;
and recording and comparing changes generated by metadata generated by the historical analysis and scanning results to obtain change information.
In some optional embodiments of the present application, after verifying whether the metadata has changed according to a metadata name, a metadata type, a metadata length, and metadata addition/deletion, the method for constructing an API interface based on the database metadata further includes:
if not, discarding the metadata name, the metadata type, the metadata length and the metadata addition and deletion.
In some optional embodiments of the present application, building or updating the API interface according to the metadata change event includes:
judging whether a corresponding interface exists in a local storage library or not according to the metadata change event;
if the metadata change event does not exist, a new interface is constructed according to the metadata change event and a preset interface construction strategy;
if yes, extracting a change item in the metadata change event, and updating a corresponding interface in the interface repository according to the change item.
In some optional embodiments of the present application, after building or updating the API interface according to the metadata change event, the method of building the API interface based on the database metadata further comprises:
verifying whether the API interface changes;
if so, performing standard processing, updating to generate an API interface event, and sending the API interface update event to the gateway service;
if not, the information is discarded.
In some optional embodiments of the present application, after building or updating the API interface according to the metadata change event, the method of building the API interface based on the database metadata further comprises:
and changing the registration information of the interface according to the interface description information, and finally reflecting the change of the interface through the gateway service so that the client calls a new interface according to the interface description information in the gateway and automatically generates a unified technical document comprising a design document, a deployment document and an API document.
In some optional embodiments of the present application, automatically generating a unified technical document includes: creation and updating of technical documents.
According to a second aspect of embodiments of the present application, there is provided an apparatus for building an API interface based on database metadata, the apparatus may include:
the acquisition module is used for acquiring metadata names, metadata types, metadata lengths and metadata addition and deletion;
the first verification module is used for verifying whether the metadata change or not according to the metadata name, the metadata type, the metadata length and the metadata addition and deletion, and if yes, outputting a metadata change event;
and the interface updating module is used for constructing or updating the API interface according to the metadata change event.
In some optional embodiments of the present application, the obtaining module includes:
the analysis unit is used for analyzing the log and scanning metadata information in the database;
and the recording unit is used for recording and comparing the change generated by the metadata generated by the previous analysis and scanning results to obtain the change information.
In some optional embodiments of the present application, the verification module is further configured to verify whether the metadata has changed according to the change information, and if not, discard the change information.
In some optional embodiments of the present application, the interface update module includes:
the local repository searching unit is used for judging whether a corresponding interface exists in the local repository according to the metadata change event;
if the metadata change event does not exist, a new interface is constructed according to the metadata change event and a preset interface construction strategy;
if yes, extracting a change item in the metadata change event, and updating a corresponding interface in the interface repository according to the change item.
In some optional embodiments of the present application, further comprising:
the second verification module is used for verifying whether the API interface changes or not;
if so, performing standard processing, updating to generate an API interface event, and sending the API interface update event to the gateway service;
if not, the information is discarded.
In some optional embodiments of the present application, further comprising:
and the gateway service module is used for changing the registration information of the interface according to the interface description information and finally reflecting the change of the interface through gateway service so as to enable the client to call a new interface according to the interface description information in the gateway.
According to a third aspect of embodiments of the present application, there is provided an electronic apparatus, which may include:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the build API interface method based on database metadata as shown in any embodiment of the first aspect.
According to a fourth aspect of embodiments of the present application, there is provided a storage medium, wherein instructions in the storage medium, when executed by a processor of an information processing apparatus or a server, cause the information processing apparatus or the server to implement the method of building an API interface based on database metadata as shown in any one of the embodiments of the first aspect.
The technical scheme of the application has the following beneficial technical effects:
according to the method, the API interface is constructed through the metadata change information of the database, change monitoring of metadata change is involved, metadata change events, interface registration and change events are generated, and the interface is constructed through the events.
Drawings
FIG. 1 is a flow diagram of a method for building an API interface based on database metadata in an exemplary embodiment of the present application;
FIG. 2 is a schematic diagram illustrating an API interface apparatus based on database metadata according to an exemplary embodiment of the present application;
FIG. 3 is a block diagram illustrating an API interface apparatus constructed based on database metadata according to an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of an electronic device according to an exemplary embodiment of the present application;
fig. 5 is a schematic diagram of a hardware structure of an electronic device in an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings in combination with the detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present application. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present application.
In the drawings, a schematic diagram of a layer structure according to an embodiment of the application is shown. The figures are not drawn to scale, wherein certain details are exaggerated and possibly omitted for clarity. The shapes of various regions, layers, and relative sizes and positional relationships therebetween shown in the drawings are merely exemplary, and deviations may occur in practice due to manufacturing tolerances or technical limitations, and a person skilled in the art may additionally design regions/layers having different shapes, sizes, relative positions, as actually required.
It should be apparent that the embodiments described are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is noted that the terms "first", "second", and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In addition, the technical features mentioned in the different embodiments of the present application described below may be combined with each other as long as they do not conflict with each other.
The API interface construction method based on database metadata provided in the embodiments of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
As shown in fig. 1, in a first aspect of embodiments of the present application, there is provided a method for constructing an API interface based on database metadata, where the method may include:
s110: acquiring metadata names, metadata types, metadata lengths and metadata addition and deletion;
s120: verifying whether the metadata changes according to the metadata name, the metadata type, the metadata length and the metadata addition and deletion; if yes, outputting a metadata change event;
s130: and constructing or updating the API interface according to the metadata change event.
According to the method, the API interface is constructed through the metadata change information of the database, wherein the change monitoring of metadata change is involved, metadata change events, interface registration and change events are generated, and the interface is constructed through the events.
In order to more clearly illustrate the method, the following steps are described:
first, step S110: and acquiring the name, the type, the length and the addition and deletion of the metadata.
In the step, the metadata name, the metadata type, the metadata length and the metadata addition and deletion can be obtained by analyzing various logs and scanning metadata information of the database according to a preset strategy and generating the metadata name, the metadata type, the metadata length and the metadata addition and deletion by recording and comparing historical analysis and scanning results.
The information about metadata change may mainly include metadata name, type, length, addition/deletion, and the like.
In addition, the preset strategy can be a log format definition description related to metadata and a metadata scanning plan. Where the scan plan may be a real-time or non-time scan, its settings are based on the frequency of change of the metadata and stored in a configuration file. This service can be automatically executed by the system according to a preset policy.
Next is step S120: verifying whether the metadata changes according to the metadata name, the metadata type, the metadata length and the metadata addition and deletion; if yes, outputting the metadata change event.
This step may be performed by receiving metadata change information and performing verification according to the received information. The main verification operation standard in the verification process is whether the metadata and the interface have changes in information or not, if so, the information is subjected to standard processing, a metadata change event is generated, and if not, the information is discarded and is not processed. Finally, outputting the metadata change event, sending the generated event, and making a response action. In the step, the metadata change driver executes the metadata backwards, and whether to construct the API is determined according to the subsequent judgment process. "export" refers to exporting to a subsequent "API interface build/update service," step 2 in FIG. 3.
Finally, step S130: and constructing or updating the API interface according to the metadata change event.
After metadata change event information is received, judging whether a corresponding interface exists in a local repository or not according to the event information;
if the event information does not exist, a new interface is constructed according to the event information and a preset interface construction strategy;
if the event information exists, extracting the change item in the event information, and updating the corresponding interface in the interface repository.
The API interface change information mainly includes an interface name, a change item type, a changed length, and the like.
In an embodiment, after building or updating the API interface according to the metadata change event, the method may further include:
and automatically generating a unified technical document.
The automatic generation of the unified technical document in this step includes creation and update of the technical document. The technical documents comprise design documents, deployment documents and API documents, and the document structure comprises document covers, catalogues, texts, dynamic attribute tags, versions, page numbers and the like; the updating of the technical document is to automatically verify and compare the dynamic attribute tags in the design document, the deployment document and the API document according to the metadata change information, the interface program change information and the technical document updating strategy, to update the matched corresponding content, and to record the change condition in the version description of the technical document.
In one embodiment, obtaining metadata name, metadata type, metadata length, and metadata addition/deletion includes:
analyzing the log and scanning metadata information in the database;
and recording and comparing changes generated by metadata generated by the historical analysis and scanning results to obtain change information.
In this embodiment, "log analysis and database scanning" is the first step of the method, and whether to construct an API depends on the processing result of subsequent services; the change information of the metadata is generated by comparison, the change information can be verified with the metadata truth of the database through the metadata change information processing service, if the verification is passed, the metadata is considered to be changed actually, and if the verification is not passed, the metadata is not processed.
In an embodiment, after verifying whether the metadata changes according to the metadata name, the metadata type, the metadata length, and the metadata addition/deletion, the method for constructing the API interface based on the database metadata further includes:
if not, discarding the metadata name, the metadata type, the metadata length and the metadata addition and deletion.
In one embodiment, building or updating an API interface based on metadata change events includes:
judging whether a corresponding interface exists in a local storage library or not according to the metadata change event;
if the metadata change event does not exist, a new interface is constructed according to the metadata change event and a preset interface construction strategy;
if yes, extracting a change item in the metadata change event, and updating a corresponding interface in the interface repository according to the change item.
The embodiment provides a metadata change event according to the last step, and inquires corresponding interface information from a local interface database.
In one embodiment, after building or updating the API interface according to the metadata change event, the method of building the API interface based on the database metadata further comprises:
verifying whether the API interface changes;
if so, performing standard processing, updating to generate an API interface event, and sending the API interface update event to the gateway service;
if not, the information is discarded.
The embodiment may be to receive API interface change information, perform verification according to the received information, where the main verification operation standard is whether the interface has changed in the information, if so, perform standard processing on the information, update an event according to the generated API interface, and if not, discard the information and do not perform processing. And sending the API interface updating event to the gateway. Because the module services are independent, the 'specification processing' mainly processes the received 'API interface change information' into data which can be identified by 'gateway service' and outputs the data to the gateway service. The step is to verify whether the API interface change information is consistent with the interface information stored in the database, and trigger the subsequent processing under the consistent condition to prevent the API interface change information processing service from receiving the forged information.
The API interface updating event comprises an interface name, a calling address, a change type, a change item name, a change item type, a change item length and the like.
In one embodiment, after building or updating the API interface according to the metadata change event, the method of building the API interface based on the database metadata further comprises:
and changing the registration information of the interface according to the interface description information, and finally reflecting the change of the interface through the gateway service so that the client calls a new interface according to the interface description information in the gateway and automatically generates a unified technical document comprising a design document, a deployment document and an API document.
In this embodiment, the interface registration information is changed through the event description information, the interface description information mainly includes interface input and output detailed index project descriptions, the change of the interface is finally reflected through the gateway service, and the client calls a new interface according to the interface description information in the gateway. The expression means that an interface caller can see the change information of the interface through the gateway service, and the interface is displayed.
Specifically, automatically generating the technical document may include:
the first step is as follows: creation of a technical document. Technical documents include design documents, deployment documents, API documents, and document structures include document covers, catalogs, texts, dynamic attribute tags, versions, page numbers, and the like.
And (4) creation of a design document. Based on the data structure, data flow, measurement logic relation, ETL process, data access log and other contents of the metadata, the attributes of classes, methods, comments and the like of the interface program are automatically extracted, and according to the design document strategy, a design document capable of being delivered is automatically created and generated, wherein the design document comprises interface names, function descriptions, IPO diagrams, input descriptions, output descriptions, limiting conditions, self-test step descriptions and the like.
And creating a deployment document. The method comprises the steps of automatically extracting attributes such as packages, classes, methods and comments in an interface program, automatically creating and generating a deployment document based on contents such as interface description, IPO (internet protocol input) diagram and self-test step description of a design document according to deployment document strategies, wherein the deployment document comprises interface names, function description, deployment position description, data source description, resource package description, configuration file description, deployment time, self-test records and the like.
And (4) creating an API document. Based on the contents of interface description, IPO diagram, input description, output description, limitation condition and the like of the design document, automatically extracting the attributes of package, class, method, identifier, keyword, annotation and the like in the interface program, and automatically creating and producing an API document according to the API document strategy, wherein the API document comprises an interface name, interface description, an interface address, a request method, a request parameter, a feedback parameter, an error code and the like.
The second step is that: and (5) updating the technical document.
According to the metadata change information, the interface program change information and the technical document updating strategy, the dynamic attribute tags in the design document, the deployment document and the API document are automatically verified and compared, the corresponding contents are matched for updating, and the change condition is recorded in the version description of the technical document.
It should be noted that, in the method for constructing an API interface based on database metadata provided in the embodiment of the present application, the execution main body may be an API interface apparatus constructed based on database metadata, or a control module in the API interface apparatus constructed based on database metadata, which is used for executing the method for constructing the API interface based on database metadata. In the embodiment of the present application, a method for constructing an API interface based on database metadata by using an API interface construction device based on database metadata is taken as an example, and a device for constructing an API interface based on database metadata provided in the embodiment of the present application is described.
As shown in fig. 2, in a second aspect of the embodiments of the present application, there is provided an apparatus for building an API interface based on database metadata, the apparatus may include:
an obtaining module 210, configured to obtain a metadata name, a metadata type, a metadata length, and metadata addition/deletion;
the first verification module 220 is configured to verify whether the metadata changes according to the metadata name, the metadata type, the metadata length, and metadata addition/deletion, and if so, output a metadata change event;
and an interface updating module 230, configured to build or update an API interface according to the metadata change event.
In one embodiment, the obtaining module includes:
the analysis unit is used for analyzing the log and scanning metadata information in the database;
and the recording unit is used for recording and comparing the change generated by the metadata generated by the past analysis and scanning results to obtain change information.
In an embodiment, the verification module is further configured to verify whether the metadata changes according to the change information, and if not, discard the change information.
In one embodiment, an interface update module includes:
the local repository searching unit is used for judging whether a corresponding interface exists in the local repository according to the metadata change event;
if the metadata change event does not exist, a new interface is constructed according to the metadata change event and a preset interface construction strategy;
if yes, extracting a change item in the metadata change event, and updating a corresponding interface in the interface repository according to the change item.
In one embodiment, the method further comprises:
the second verification module is used for verifying whether the API interface changes;
if so, performing standard processing, updating to generate an API interface event, and sending the API interface update event to the gateway service;
if not, the information is discarded.
In one embodiment, the method further comprises:
and the gateway service module is used for changing the registration information of the interface according to the interface description information and finally reflecting the change of the interface through gateway service so as to enable the client to call a new interface according to the interface description information in the gateway.
The API interface device constructed based on database metadata provided in the embodiment of the present application can implement each process implemented by the method embodiment of fig. 1, and is not described here again to avoid repetition.
As shown in fig. 3, in an embodiment of the present application, a technical complete solution for constructing an API interface based on database metadata is provided, which mainly includes 4 component parts, which are a metadata change monitoring service, an event forwarding processing service, an API interface construction/update service, and a gateway service:
1. metadata monitoring service: the method comprises the steps of analyzing various logs and scanning metadata information of a database according to a preset strategy, generating metadata names, metadata types, metadata lengths and metadata addition and deletion by recording and comparing historical analysis and scanning results, wherein the information of metadata changes mainly comprises the metadata names, types, lengths, addition and deletion and the like, and the method is a basic service of the whole scheme. The related preset strategies are mainly metadata-related journal format definition descriptions and metadata scanning plans, wherein the scanning plans can be real-time scanning or non-time scanning, and the setting of the scanning plans is based on the change frequency of the metadata and is stored in a configuration file. The service is mainly executed automatically by the system according to a preset strategy.
2. Metadata change information processing service: receiving metadata change information, verifying according to the received information, wherein the operation standard is mainly to verify whether the metadata has changed in the information, if so, performing standard processing on the information, and if not, discarding the information and not processing. Finally, the metadata change event is output, and the generated event is sent to the API interface/build update service, which responds to the action.
The metadata change event mainly comprises a metadata name, a metadata type, a metadata length, a change type and the like;
3. API interface build/update service: and the system is responsible for receiving the metadata change event generated in the step 2, constructing a new API (application program interface) interface or updating the target interface according to the event information, and outputting the API interface change information.
After metadata change event information is received, judging whether a corresponding interface exists in a local repository according to the event information, and if not, constructing a new interface according to the event information and a preset interface construction strategy; if the event information exists, extracting the change item in the event information, and updating the corresponding interface in the interface repository.
The API interface change information mainly includes an interface name, a change item type, a length after change, and the like.
4. API interface change information processing service: receiving the API interface change information generated in step 3, verifying according to the received information, wherein the main verification operation standard is whether the interface has changed in the information, if so, carrying out standard processing on the information, updating an event according to the generated API interface, and if not, discarding the information and not processing. An API interface update event is sent to the gateway service.
The API interface updating event comprises an interface name, a calling address, a change type, a change item name, a change item type, a change item length and the like.
5. Gateway service: and receiving an API (application programming interface) updating event generated by the step 4, changing interface registration information through event description information, wherein the interface description information mainly comprises interface input and output detailed index project descriptions, finally embodying the change of an interface through gateway service, and calling a new interface by a client according to the interface description information in the gateway.
The device of the embodiment constructs the API interface based on the metadata change information of the database, wherein the change monitoring of metadata change is involved, and metadata change events, interface registration and change events are generated accordingly, and the interface is constructed through the events. The problems that the requirement of a coding mode development interface on personnel is high, the efficiency is low and the cost is high can be solved; the interface issuing cycle is long in time consumption, and has more related personnel so as to make mistakes; the interface form is not uniform, the readability is poor, and the operation and maintenance management is not easy to realize.
Because the interface is constructed based on the metadata, the API interface is constructed directly according to the metadata, an intermediate process is omitted, the time consumption is shorter, manual intervention is not needed in the interface issuing process, the compiling of API documents is not needed, and the labor cost is saved.
The API interface device constructed based on the database metadata in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The API interface device constructed based on the database metadata in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
Optionally, as shown in fig. 4, an electronic device 400 is further provided in this embodiment of the present application, and includes a processor 401, a memory 402, and a program or an instruction that is stored in the memory 402 and is executable on the processor 401, and when the program or the instruction is executed by the processor 401, the process of the embodiment of the API interface construction method based on database metadata is implemented, and the same technical effect can be achieved, and is not described herein again to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 5 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 500 includes, but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and the like.
Those skilled in the art will appreciate that the electronic device 500 may further comprise a power supply (e.g., a battery) for supplying power to various components, and the power supply may be logically connected to the processor 510 via a power management system, so as to implement functions of managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 5 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
It should be understood that in the embodiment of the present application, the input Unit 504 may include a Graphics Processing Unit (GPU) 5041 and a microphone 5042, and the Graphics processor 5041 processes image data of still pictures or videos obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 507 includes a touch panel 5071 and other input devices 5072. A touch panel 5071, also referred to as a touch screen. The touch panel 5071 may include two parts of a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in further detail herein. The memory 509 may be used to store software programs as well as various data including, but not limited to, application programs and operating systems. Processor 510 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 510.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the API interface method embodiment based on the database metadata, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction, so as to implement each process of the above API interface construction method embodiment based on database metadata, and achieve the same technical effect, and in order to avoid repetition, the details are not repeated here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for constructing an API interface based on database metadata is characterized by comprising the following steps:
acquiring metadata names, metadata types, metadata lengths and metadata addition and deletion;
verifying whether the metadata is changed or not according to the metadata name, the metadata type, the metadata length and the metadata addition and deletion, and if yes, outputting a metadata change event;
and constructing or updating an API interface according to the metadata change event.
2. The method of claim 1, wherein the obtaining metadata names, metadata types, metadata lengths, and metadata additions and deletions comprises:
analyzing the log and scanning metadata information in the database;
and comparing changes generated by metadata generated by the historical analysis and scanning results to obtain the change information.
3. The method of claim 1 or 2, wherein after verifying whether metadata has changed according to the metadata name, the metadata type, the metadata length, and the metadata addition and deletion, the method further comprises:
if not, discarding the metadata name, the metadata type, the metadata length and the metadata addition and deletion.
4. The method for building the API interface based on the database metadata according to claim 1, wherein the building or updating the API interface according to the metadata change event comprises:
judging whether a local interface database has a corresponding interface of the metadata according to the metadata change event;
if the metadata change event does not exist, a new interface is constructed according to the metadata change event and a preset interface construction strategy;
if yes, extracting a change item in the metadata change event, and updating a corresponding interface in an interface repository according to the change item.
5. The database metadata-based API interface method of claim 1, wherein after the building or updating of the API interface according to the metadata change event, the database metadata-based API interface method further comprises:
verifying whether the API interface is changed;
if so, performing standard processing, updating to generate an API interface event, and sending the API interface update event to the gateway service;
if not, the information is discarded.
6. The database metadata-based API interface method of claim 5, wherein after the building or updating of the API interface according to the metadata change event, the database metadata-based API interface method further comprises:
and changing the registration information of the interface according to the interface description information, and reflecting the change of the interface through the gateway service so that the client calls a new interface according to the interface description information in the gateway.
7. The database metadata-based API interface method of claim 1, wherein after the building or updating of the API interface according to the metadata change event, the database metadata-based API interface method further comprises:
creation and updating of technical documents.
8. An API interface apparatus constructed based on database metadata, comprising:
the acquisition module is used for acquiring metadata names, metadata types, metadata lengths and metadata addition and deletion;
the verification module is used for verifying whether the metadata is changed or not according to the metadata name, the metadata type, the metadata length and the metadata addition and deletion, and if yes, outputting a metadata change event;
and the interface updating module is used for constructing or updating the API interface according to the metadata change event.
9. An electronic device, comprising: a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the database metadata-based build API interface method of any of claims 1-7.
10. A readable storage medium, storing thereon a program or instructions which, when executed by a processor, implement the steps of the database metadata-based build API interface method of any of claims 1-7.
CN202210995539.XA 2022-08-19 2022-08-19 Method and device for constructing API (application programming interface) based on database metadata Active CN115062084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210995539.XA CN115062084B (en) 2022-08-19 2022-08-19 Method and device for constructing API (application programming interface) based on database metadata

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210995539.XA CN115062084B (en) 2022-08-19 2022-08-19 Method and device for constructing API (application programming interface) based on database metadata

Publications (2)

Publication Number Publication Date
CN115062084A true CN115062084A (en) 2022-09-16
CN115062084B CN115062084B (en) 2022-11-04

Family

ID=83208442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210995539.XA Active CN115062084B (en) 2022-08-19 2022-08-19 Method and device for constructing API (application programming interface) based on database metadata

Country Status (1)

Country Link
CN (1) CN115062084B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435177A (en) * 2023-12-20 2024-01-23 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101690123A (en) * 2007-05-18 2010-03-31 国际商业机器公司 Apparatus, system, and method for a data server-managed web services runtime
CN106843835A (en) * 2016-12-21 2017-06-13 中国电子科技网络信息安全有限公司 A kind of application systems software constructing system of meta data customizing, system constituting method
CN108241724A (en) * 2017-05-11 2018-07-03 新华三大数据技术有限公司 A kind of metadata management method and device
US10769130B1 (en) * 2018-05-23 2020-09-08 Databricks Inc. Update and query of a large collection of files that represent a single dataset stored on a blob store
CN113821254A (en) * 2021-09-29 2021-12-21 平安普惠企业管理有限公司 Interface data processing method, device, storage medium and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101690123A (en) * 2007-05-18 2010-03-31 国际商业机器公司 Apparatus, system, and method for a data server-managed web services runtime
CN106843835A (en) * 2016-12-21 2017-06-13 中国电子科技网络信息安全有限公司 A kind of application systems software constructing system of meta data customizing, system constituting method
CN108241724A (en) * 2017-05-11 2018-07-03 新华三大数据技术有限公司 A kind of metadata management method and device
US10769130B1 (en) * 2018-05-23 2020-09-08 Databricks Inc. Update and query of a large collection of files that represent a single dataset stored on a blob store
CN113821254A (en) * 2021-09-29 2021-12-21 平安普惠企业管理有限公司 Interface data processing method, device, storage medium and equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435177A (en) * 2023-12-20 2024-01-23 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium
CN117435177B (en) * 2023-12-20 2024-03-26 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium

Also Published As

Publication number Publication date
CN115062084B (en) 2022-11-04

Similar Documents

Publication Publication Date Title
US9971754B2 (en) Method for associating third party content with online document signing
CA2684822C (en) Data transformation based on a technical design document
CN112162965B (en) Log data processing method, device, computer equipment and storage medium
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
US11620444B2 (en) Providing action associated with event detected within communication
US10657324B2 (en) Systems and methods for generating electronic document templates and electronic documents
CN113254445B (en) Real-time data storage method, device, computer equipment and storage medium
CN102880683A (en) Automatic network generation system for feasibility study report and generation method thereof
CN112394908A (en) Method and device for automatically generating embedded point page, computer equipment and storage medium
CN115062084B (en) Method and device for constructing API (application programming interface) based on database metadata
CN110889013B (en) Data association method, device, server and storage medium based on XML
CN112131300A (en) Cross-platform data making method and device based on Flutter
CN113962597A (en) Data analysis method and device, electronic equipment and storage medium
CN117171108A (en) Virtual model mapping method and system
CN113010542A (en) Service data processing method and device, computer equipment and storage medium
US20220270122A1 (en) Information delivery method, apparatus, and device, and computer-readable storage medium
CN115237425A (en) Code viewing method and device, computer equipment and storage medium
US20130163028A1 (en) Accessing current data by using code images
CN112445811A (en) Data service method, device, storage medium and component based on SQL configuration
CN118070881A (en) Page processing method, device, computer equipment and storage medium
CN115526731A (en) Task batch processing method and device, computer equipment and storage medium
CN117492752A (en) Page dynamic configuration method and device, computer equipment and storage medium
CN116166270A (en) XAML file correction method, XAML file correction device, computer equipment and storage medium
CN116149665A (en) XAML file modification method, XAML file modification device, computer equipment and storage medium
CN117033452A (en) Database processing method, device, computer equipment 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
GR01 Patent grant
GR01 Patent grant