CN113918149A - Interface development method and device, computer equipment and storage medium - Google Patents

Interface development method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113918149A
CN113918149A CN202111112415.4A CN202111112415A CN113918149A CN 113918149 A CN113918149 A CN 113918149A CN 202111112415 A CN202111112415 A CN 202111112415A CN 113918149 A CN113918149 A CN 113918149A
Authority
CN
China
Prior art keywords
interface
data
program
identifier
calling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111112415.4A
Other languages
Chinese (zh)
Inventor
李振楠
汤映东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yunnan Tengyun Information Industry Co ltd
Original Assignee
Yunnan Tengyun Information Industry 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 Yunnan Tengyun Information Industry Co ltd filed Critical Yunnan Tengyun Information Industry Co ltd
Priority to CN202111112415.4A priority Critical patent/CN113918149A/en
Publication of CN113918149A publication Critical patent/CN113918149A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • 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/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Storage Device Security (AREA)

Abstract

The application relates to a program interface development method, a program interface development device, a computer device and a storage medium. The method comprises the following steps: the program interface development method, the device, the computer equipment and the storage medium acquire program information from the displayed interface aggregation platform, wherein the program information comprises a program identifier and a first authority identifier; acquiring an identifier of a database interface and a calling authority of the database interface; responding to the interface aggregation request, detecting and determining that the interface aggregation request corresponds to the first authority identification, establishing a dependency relationship between the program identification and the interface identification, and generating a developed program. By adopting the method, the first authority identification such as the token can be set through the front end, so that the front end is directly connected with the database, the method also has safety, the query and the query of the database are in one-to-one correspondence, the problems of a task manager, serial and parallel, construction of domain space of a management data interface and the like are not required to be considered, and the overall structure is simpler.

Description

Interface development method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of data call technologies, and in particular, to an interface development method and apparatus, a computer device, and a storage medium.
Background
In the development process of the internet, more and more websites appear in daily life, and the websites generally need to be developed by the front end and the back end in a coordinated manner. The back-end works in the background, controls the content of the front-end, and is also responsible for managing the database, interacting with the database to process corresponding business logic, and considering how to implement functions, data access, platform stability and performance, and the like. Inevitably, however, the front-end web page needs to access the back-end interface first and then the database, which depends on the development of the back-end technology.
However, due to the limited problems of the backend technologies, if the front end connects to the database through the backend, the query made by the front end cannot correspond to the query of the database.
Disclosure of Invention
In view of the above, it is desirable to provide a program interface development method, an apparatus, a computer device, and a storage medium that can fully utilize the database interface calling function and ensure data security.
A method of program interface development, the method comprising:
receiving program information sent by a front end, wherein the program information is acquired by the front end from a displayed interface and comprises a program identifier and a first authority identifier;
acquiring an interface calling identifier of a database;
responding to an interface development request sent by the front end, if the interface aggregation request corresponds to the first permission identifier, establishing a dependency relationship between the program identifier and the interface calling identifier, and completing the interface development of the program.
In one embodiment, the establishing a dependency relationship between the program identifier and the interface identifier to complete interface development of the program includes:
acquiring an interface group identifier, wherein the interface group identifier is used for representing a database interface group, and the database interface group comprises at least one database interface;
establishing data association between interface calling identifiers in the interface group, enabling the data association between calling authorities in the interface group, and generating calling authority information of the interface group;
and establishing a data dependency relationship between the program identification and the calling authority information of the interface group, and completing the interface development of the program.
In one embodiment, the method further comprises the step of calling data in the database using the developed program, the step comprising:
acquiring a data query interface identifier corresponding to the developed program, determining a template corresponding to the data query interface identifier, and obtaining a data query template, wherein the data query template is configured with a parameter access type and a parameter access length range;
and acquiring data calling information, substituting the data calling information into the data query template, and calling the data.
In one embodiment, the establishing a dependency relationship between the program identifier and the interface call identifier to complete interface development of the program includes:
establishing a binding relation between a program identifier and an interface calling identifier, connecting the program with a corresponding database interface according to the binding relation, and opening the calling authority of the database interface for the program corresponding to the program identifier.
In one embodiment, the receiving the program information sent by the front end further includes: acquiring a second authority identifier;
after the interface development of the program is completed, the method further comprises the following steps:
recording the binding relationship between the program identifier and the interface calling identifier to generate an interface recording document;
and taking the second authority identification as a reading condition of the interface record document to generate a mapping relation between the second authority identification and the interface record document.
In one embodiment, the method further comprises the step of invoking data in a database, the step comprising:
responding to a first data calling request, and acquiring cache data, wherein the cache data comprises a second data calling request and called data corresponding to the second data calling request;
and calling the called data corresponding to the second data calling request from the cache data after judging that the first data calling request is matched with the second data calling request.
In one embodiment, the method further comprises the step of generating a database interface, the step comprising:
data in a database are cleaned to obtain cleaned data, and the cleaned data are aggregated to generate aggregated data;
and generating a database interface corresponding to the aggregated data according to the data type and the data length range corresponding to the aggregated data.
A program interface development apparatus, the apparatus comprising:
the system comprises a program access module, a first permission module and a second permission module, wherein the program access module is used for receiving program information sent by a front end, the program information is acquired by the front end from displayed data, and the program information comprises a program identifier and a first permission identifier;
the interface acquisition module is used for acquiring the interface identifier of the database and the calling authority of the database interface;
and the dependency relationship establishing module is used for responding to an interface development request sent by the front end, establishing a dependency relationship between the program identifier and the interface identifier if the interface development request corresponds to the first permission identifier, and opening the calling permission of the database interface for the program corresponding to the program identifier to obtain the target program after interface development.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving program information sent by a front end, wherein the program information is acquired by the front end from a displayed interface and comprises a program identifier and a first authority identifier;
acquiring an interface calling identifier of a database;
responding to an interface development request sent by the front end, if the interface aggregation request corresponds to the first permission identifier, establishing a dependency relationship between the program identifier and the interface calling identifier, and completing the interface development of the program.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving program information sent by a front end, wherein the program information is acquired by the front end from a displayed interface and comprises a program identifier and a first authority identifier;
acquiring an interface calling identifier of a database;
responding to an interface development request sent by the front end, if the interface aggregation request corresponds to the first permission identifier, establishing a dependency relationship between the program identifier and the interface calling identifier, and completing the interface development of the program.
The program interface development method, the device, the computer equipment and the storage medium acquire program information from the displayed interface aggregation platform, wherein the program information comprises a program identifier and a first authority identifier; acquiring an identifier of a database interface and a calling authority of the database interface; responding to the interface aggregation request, detecting and determining that the interface aggregation request corresponds to the first authority identification, establishing a dependency relationship between the program identification and the interface identification, and generating a developed program. Therefore, the first authority identification such as the token is set at the front end, so that the safety is ensured when the front end is directly connected with the database, the one-to-one correspondence between the query and the query of the database is realized, the problems of a task manager, serial and parallel construction, domain space construction of a management data interface and the like are not required to be considered, and the overall structure is simpler.
Drawings
FIG. 1 is a diagram of an application environment for a method for programming interface development in one embodiment;
FIG. 2 is a flowchart illustrating a method for interface development in one embodiment;
FIG. 3 is an interface diagram shown in one embodiment;
FIG. 4 is an interface diagram of a program binding interface in one embodiment;
FIG. 5 is an interface diagram of a database interface in one embodiment;
FIG. 6 is an interface diagram illustrating the development of a finished program interface in one embodiment;
FIG. 7 is a flowchart illustrating the process of establishing dependencies between identifiers in one embodiment;
FIG. 8 is a diagram illustrating the establishment of dependencies between identities;
FIG. 9 is a schematic diagram of establishing interface group information;
FIG. 10 is a schematic diagram illustrating a process for invoking data in a database, in one embodiment;
FIG. 11 is a flow diagram illustrating the use of a second rights identifier in one embodiment;
FIG. 12 is a flow diagram illustrating data invocation in one embodiment;
FIG. 13 is a schematic flow chart diagram illustrating the generation of the database interface in one embodiment;
FIG. 14 is a schematic flow chart diagram illustrating the generation of the database interface in one embodiment;
FIG. 15 is a block diagram showing the configuration of a program interface development apparatus according to one embodiment;
FIG. 16 is a block diagram showing the construction of a program interface development apparatus according to one embodiment;
fig. 17 is an internal configuration diagram of a server in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The program interface development method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a data calling method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
step 202, receiving program information sent by a front end, wherein the program information is acquired by the front end from a displayed interface and comprises a program identifier and a first authority identifier;
the front end has an interface display function and a data acquisition function, and can be a terminal in the conventional sense, a server with the front end function, or some other equipment with the functions of the terminal and the server. The user can input some instructions through the front end or output some information to realize the functions of man-machine interaction and the like. It should be understood that most software is conceptually divided into a front end and a back end, but in most cases, the back end of the software is often hidden from the user. However, some software is just the front end of another existing software, just like a Graphical User Interface (GUI) built on top of a character interface. These front ends are very common in Unix GUIs, and many programs are broken into small items that can work independently of each other but in concert.
The program information may be used to represent the program to be edited, and may be an ID value of the program, or an identifier such as a name of the program or a group ID value assigned to the program, and mainly refers to the software program to be developed, and may be any kind of program, which may be divided into a kind of application program, a kind of driver, and the like, and may also be divided into a kind of local program, a kind of remote program, and the like. The program may be a program having a complete function or a program framework to be developed.
The program identifier is used for characterizing the original program, and may be information such as a number or a name of the original program, and is used for identifying the original program. Specifically, the program identifier may be a code of each program in a certain item, or may be a code of a certain component or plug-in a certain program.
The first authority identifier may be token or any other data that identifies the real existence, or may be information hidden in the data through some data dependency relationship. Specifically, the first authority identifier may be a static token or a condition of a function call. The method can be used for representing the interface development authority of the program, representing the interface document calling authority of the program and representing the database interface corresponding to the program. The existence of the first authority identifier can prevent the database interface from being tampered or blocked to a certain extent, so that the safety of data in the database and the safety of the environment to which the original program belongs are ensured. Specifically, the first authority identifier may be set as a first token, and the first token may be used to prove the authority of the database interface call, so as to reduce the data volume. In a further embodiment, the first token is used as a token of the data center to handle and control the calling authority of more interfaces, a data stream is established by setting program identifiers, functions of various databases are fully exerted, and the first authority identifier is set to further guarantee the safety of data.
Specifically, the front end of a certain program development platform is displayed, and program information is directly acquired so as to respond to the operation of a user. The program information acquired by the front end is forwarded to the back end for information transmission. A program can be created through the interface shown in fig. 3 and the synchronization time recorded.
And step 204, acquiring an interface calling identifier of the database.
The interface calling identifier of the database is used for representing the calling authority of the database interface.
The interface of the database mainly refers to an interface of a database program, but not a back-end interface, and the interface of the database is used for data transmission between a front end and the database directly. The services corresponding to different database interfaces are different from the data, and in order to prevent the database interfaces from being misoperated or tampered, the database interfaces cannot be disclosed to all users, so that the authority of the interfaces needs to be set so as to facilitate the calling of the interfaces, for example, the interfaces related to sensitive data such as 'first exhibition' cannot be disclosed to all users, and some related personnel can be designated to disclose the interfaces.
On the other hand, interfaces of different databases may have different operation functions, and interfaces in one program may include interfaces of any different kinds of databases, such as ODBC, DAO, RDO, OLE DB, and the like for short; wherein ODBC characterizes open database interconnections, DAO characterizes database access objects, RDO characterizes remote database objects, and OLE DB characterizes database links and embedded objects.
And the interface calling identifier of the database is used for representing the calling authority of the database interface. The method can directly encode the database interface to generate ID value and other identifiers representing the database interface authority; the identifier of the table database interface can also be directly used as an interface calling identifier so as to realize highly flexible calling of the database interface; the database interfaces can also be grouped, a plurality of database interfaces are divided into a small group, and the ID value of the database interface group is generated by encoding the small group, so that the development difficulty is reduced, and the development efficiency is increased.
Specifically, acquiring an interface call identifier of a database mainly refers to acquiring database interface information mapped by a program identifier, for example: the database interface identifier corresponding to the program information can be acquired from a certain platform, and the database interface information corresponding to the program information is determined according to the rules on the platform.
And step 206, responding to the interface development request sent by the front end, if the interface aggregation request corresponds to the first permission identifier, establishing a dependency relationship between the program identifier and the interface calling identifier, and completing the interface development of the program.
Whether the interface aggregation request corresponds to the first authority identifier or not is judged, the method comprises multiple modes, whether an issuer of the interface aggregation request has the first authority identifier or not can be judged, whether the interface aggregation request represents the first authority identifier or not can be judged, and the interface aggregation request and the first authority identifier can be determined to be corresponding as long as a mapping relation or other corresponding relations exist between the interface aggregation request and the first authority identifier.
And completing interface development of the program, and representing that the original program is authorized. It may be a specific identification, such as the name of the interface populated to a location; it may also be a separate description of a certain type.
Specifically, there are many ways of establishing a data dependency relationship between the program information and the database interface information, including establishing a data binding relationship to establish a usage relationship, or an association relationship, an aggregation relationship, etc., which only needs to implement data transmission. For example, the scheme consists of two parts, namely a front end and a development management platform such as sequenl. The front end faces a user, a new application can be added and an interface calling token and a DOC-token aiming at an interface calling document address can be automatically generated by clicking CREATE APP on a page and filling application information, an existing Group can be bound on the page after the application is created, documents of related interfaces and calling authority of an opening interface can be automatically generated after the binding, the user is supported to extract data, and the rear end is a developer platform and a data warehouse such as a sequential platform and the like and stores mass data which are main data sources. The developer platform does not compulsorily stipulate the interface connection rule between the data warehouse and the front end, so that the data warehouse can be directly connected to the front end without using a back-end interface.
Alternatively, the data in the database is invoked when in accordance with the target program information.
After the program identifier and the database interface information are bound by establishing a data dependency relationship and the like, the original program and the database interface form a certain data relationship, and the corresponding database interface can be selected directly through the target program information, and the data in the database is called according to the corresponding database interface.
Specifically, the interface shown in fig. 4 is used for editing, and the interface or the interface group to which the edited program is bound is determined, so as to determine the dependency relationship. The single interface is shown in fig. 5, and includes the name of the interface, creation time, required data type, description information, cache time, and other factors. Then, when the user determines, an interface as shown in fig. 6 may be displayed, which may include the first authority identifier token, and may also include the calling authority of the interface document — the second authority identifier DOC-token.
In the data calling method, program information is acquired from a displayed interface aggregation platform, and the program information comprises a program identifier and a first authority identifier; acquiring an identifier of a database interface and a calling authority of the database interface; responding to the interface aggregation request, detecting and determining that the interface aggregation request corresponds to the first authority identification, establishing a dependency relationship between the program identification and the interface identification, and generating a developed program. Therefore, the first authority identification such as the token is set at the front end, so that the safety is ensured when the front end is directly connected with the database, the one-to-one correspondence between the query and the query of the database is realized, the problems of a task manager, serial and parallel construction, domain space construction of a management data interface and the like are not required to be considered, and the overall structure is simpler.
The foregoing embodiments focus on the overall process, and in one embodiment, as shown in fig. 7, the establishing a dependency relationship between the program identifier and the interface identifier, and the completing interface development of the program includes:
step 702, an interface group identifier is obtained, where the interface group identifier is used to characterize a database interface group, and the database interface group includes at least one database interface.
The interface group identifier may be a character string such as a group _ id, and may be used as a key field of the index to establish a data relationship with the program identifier; which may include one or more database interfaces. The different database interfaces may be grouped according to matching rules or according to the items to which they belong. For example, "highway-bureau" and "zitao-small-town" may be used as two database interface groups, or "open database interconnection" and "database access object" may be used to establish a data dependency relationship between the two interfaces, so as to form an interface group of a database.
Specifically, interface calling identifiers can be quickly obtained according to a data dependency relationship establishing mode of each interface in historical data, and a data dependency relationship is established; the interface group calling identification can be quickly obtained according to the interface group corresponding to a certain program in the historical data, and grouping is carried out.
Step 704, establishing data association between the interface calling identifiers in the interface group, so as to enable the data association between the calling authorities in the interface group, and generating calling authority information of the interface group.
Specifically, the step of generating the calling authority information of the interface group can be formed by splicing the interface information of each database, a specific function is not needed, and the required calculation amount is low; or after the information of a plurality of database interfaces is aggregated, generating a new ID, wherein the ID is specially used for expressing the calling authority information of the database interface group so as to realize the establishment of the data dependency relationship of the multi-level interfaces; the method can also be used for generating a new ID after establishing the data dependency relationship of the calling authority information of the database interface group, and the ID participates in the ID sequencing of the non-database interface group, so that the data hierarchy is reduced, and the convenience of data calling is enhanced.
Step 706, establishing a data dependency relationship between the program identifier and the calling authority information of the interface group, and completing the interface development of the program.
In the process of establishing the data dependency relationship between the program identifier and the calling authority information of the interface group, the program identifier and the calling authority information of the interface group can be respectively used as main keys to establish data flow between the program and each interface in the interface group, so that data flow is more flexible. Specifically, the application ID may be associated with the ID of the interface group by data. Further, the time for establishing data association between the program ID and the ID of the interface group can be recorded, so that the association relationship can be updated and checked better. As shown in fig. 8, the numerical ID is used as the identifier, and other identifiers may be used.
In this embodiment, the plurality of database interfaces are uniformly scheduled by using the interface group identifier, so that each interface can form an interface calling template, and the interface calling templates can be adjusted, thereby accelerating development efficiency and reducing debugging time.
In one embodiment, focusing on the program application after the development, as shown in fig. 9 and fig. 10, the method further includes a step of calling data in the database by using the program after the development, the step including:
step 1002, acquiring a data query interface identifier corresponding to a developed program, determining a template corresponding to the data query interface identifier, and obtaining a data query template, where the data query template is configured with a parameter access type and a parameter access length range.
The query interface identifier may be an identifier corresponding to one database interface, or may be an identifier corresponding to one database interface group, and is used for selecting the data query interface, so as to facilitate convenience of data acquisition. Which is an ID value set by a platform that can aggregate various types of database interfaces. Alternatively, the Query interface identification may be characterized using a Query identification.
Specifically, when each Query is added, the body of the sql statement is stored in the body of a certain platform, the type of the entry and the maximum and minimum values of the interface entry are stored in the params of the sequence _ queries, and the type of the entry may be a data type such as string, floating point float, boolean, array, and the like. Optionally, the data query template is configured with definitions of interfaces such as interface information names, for example: the interface type can be limited to GET or POST; interface name, field type, length, non-null, etc. properties may be restricted.
And step 1004, acquiring data calling information, substituting the data calling information into the data query template, and calling the data.
After the data calling information is acquired, the data calling information is substituted into the data query template, and a corresponding data query statement is selected to be filled to obtain the required data. Optionally, after format conversion is performed on the data calling information, data of a character string type can be obtained, and then data conversion is performed when user-defined query is used, so that compatibility of the platform to non-standard query and advanced query is embodied, and a query mode can be defined by user. In addition, the background check type and the maximum and minimum values are required each time, so that the problems of data overflow and the like are avoided, but the problems cannot be found in time. When the Query is executed, the SQL body in the body is used as a Query template, the cut strings in the SQL body are replaced by the input references to be spliced into a complete SQL statement, and the complete SQL is used for executing a Query task in the database.
In the embodiment, the query statement is decomposed, the data query template is constructed, and the data query is carried out by using the data query template, so that the data query is more standardized, the data call is smoother, and the problems of data overflow and the like are not easy to occur.
In one embodiment, establishing a dependency relationship between a program identifier and an interface call identifier to complete interface development of a program, includes:
and establishing a binding relation between the program identifier and the interface calling identifier, connecting the program with a corresponding database interface according to the binding relation, and opening the calling authority of the database interface for the program corresponding to the program identifier.
The method comprises the steps of establishing a data dependency relationship between a program identifier and an interface calling identifier to obtain identifier mapping data, wherein the identifier mapping data is used for determining the mapping relationship between the program identifier and the interface calling identifier.
Establishing a data dependency relationship between the program identifier and the interface call identifier can establish a connection relationship between the original program and the database, which essentially is to establish a data flow channel so that the original program can obtain data through a proper data call mode or from a proper database. Specifically, the one-to-one or one-to-many mapping relationship between the program identifier and the database interface identifier is established, which is beneficial to the data connection between the program and the database interface, so that a backend interface is not needed to be used, factors such as domain space are not needed to be considered, and the connection relationship between the program and the database interface is more effectively established, cancelled or changed.
Specifically, after a certain mobile phone application program is bound with the database interface "XX tour XX", the mobile phone application program can be directly used to obtain the template corresponding to the database interface through the database interface "mobile phone tour yunan". For example: related data such as 'local state city ID', 'area', 'outline', 'center point coordinate' and the like with the data type of the character string can be acquired from the 'XX tour XX' database interface through the parameter of 'scenic spot ID', and data calling is directly carried out. Alternatively, using a golang language implementation, the apps added have no number limit, and each time an App is added will be saved in the sequel _ apps table. The sequence _ app _ group table stores the binding relationship between groups and apps, the groups are associated when the groups are configured on the front-end app page, one app can bind a plurality of groups for realizing multiplexing of interfaces, and the application can traverse all the bound groups when requesting the right, so that one-to-many association between apps and groups is realized.
In this embodiment, binding between identifiers is performed, and a value is assigned to a template parameter to generate a new model element, so that functions of each database interface can be more fully exerted to realize flexible invocation of data.
In one embodiment, a manager of the platform is not concerned, a developer for interfacing with the platform is obtained by considering the program, some users are software developers, the software developers can call data through a database interface, and in order to facilitate the data call of the users, the users are set with marks so that the users can have certain authority to perform certain operation behaviors without affecting the safety.
Based on this, as shown in fig. 11, the program information transmitted by the receiving front end further includes: and acquiring a second authority identifier. Optionally, the second permission identifier is set by a program, a process, or a thread having the first permission identifier, and may be identified as DOC-Token, so as to serve as a permission to invoke a certain data.
Specifically, a database may be established for determining the association relationship between the second authority identifier and the data that can be called by the second authority identifier. For example, after data is allocated to the second authority identifier, the second authority identifier may be used as an index of the allocated data, and further, the data to be allocated may be used as a value, and the second authority identifier is used as an index corresponding to the value, so as to form a database for authority invocation.
Correspondingly, after the interface development of the program is completed, the method further comprises the following steps:
step 1102, recording the binding relationship between the program identifier and the interface calling identifier, and generating an interface recording document.
The interface record document of the target program is used for characterizing the database interface connected with the target program so as to clarify the data connection relation between the target program and some database interfaces. Specifically, the interface recording document may be a static document, and is used for recording a connection relationship between the interface and the target program; the interface record document can be an online document and is used for recording the ID value of each database interface which cannot be changed, and the interface record document is synchronously updated after the data corresponding to each database interface is updated through the ID value of each database interface, so that data calling of a user with the identity of a developer is facilitated.
And 1104, taking the first authority identifier and/or the second authority identifier as a reading condition of the interface record document, and generating a mapping relation between the second authority identifier and the interface record document.
The first authority identification is used as the reading condition of the interface record document, so that the data security can be further improved; the first authority identifier and the second authority identifier are used as reading conditions of the interface record document, so that data calling of a user with the identity of a developer can be facilitated; the second authority identifier is used as the reading condition of the interface record document, so that the calling efficiency of the first authority identifier can be reduced.
Specifically, the first authority identifier Token and the second authority identifier DOC-Token can be used as indexes of the address documents to establish an association relationship with the interface record document.
In the embodiment, the permission of at least two layers of data is established by setting the first permission identifier and the second permission identifier, so that the data safety can be guaranteed, the user-induced data calling of developers can be facilitated, and the database safety and the user experience are both considered.
In one embodiment, as shown in FIG. 12, the method of data invocation is further illustrated.
The method further comprises a step of calling data in the database, and the step comprises the following steps:
step 1202, in response to the first data call request, obtaining cache data, where the cache data includes a second data call request and invoked data corresponding to the second data call request.
The first data call request is a request instruction which is not executed yet, and the first data call request can be issued just by any account, or can be issued just by some electronic equipment, and can be issued by the name of an ID corresponding to some equipment. The first data call request, which may be an http request, should comply with the data requirements specified by its corresponding database interface. For example, for a certain interface, it needs to obtain traffic information of a certain area within a certain period of time, the first data call request includes information defining the period of time and information defining the area. The information defining the time period comprises a starting time point and an ending time point of the time period and the data types of the starting time point and the ending time point; the information defining the region may include the ID value of the region and the data type of the ID value, and may also include the coordinates and area of the region, and the corresponding data type requirements.
The second data call request is a request instruction which has already been executed, and has a mapping relation with the first data call request, which may be different. For example, the data type of the first data call request and the data type of the second data call request may not be the same, but the same request instruction is generated after the data type conversion is performed by some platform or some software.
Specifically, data can be cached in a cookie, session, or other manner, so as to facilitate data invocation. For example, when some data needs to be called, a cookie is generated according to the ID of the browser, and the first data call request can be identified through information such as the cookie when the data is accessed next time, so as to call the cache data. For another example, when a session is enabled, a corresponding identifier is generated, when a script corresponding to the session is executed, the session is filled with the invoked data, when the script corresponding to the session is executed, an already enabled session is formed, and all the already enabled sessions are stored in the session database to wait for the next invocation.
Step 1204, after judging that the first data call request matches the second data call request, calling the called data corresponding to the second data call request from the cache data.
Specifically, data such as some identifiers in the first data call request and the second data call request may be compared to determine whether the first data call request and the second data call request are matched, and then whether the data can be directly called from the cache is determined. Optionally, Query may be configured in a cache mode, and if there is another same Query within a set time, the Query result of the last time is directly fetched from the redis database, otherwise, the Query operation is executed in the database, and the Query result is packaged into a json format and returned to the user.
In this embodiment, data is cached and called, so that the data response speed can be increased, the number of instructions for data calling in the database can be reduced, and chaotic conflicts can be avoided.
Each of the above embodiments has a focus, and in this embodiment, development of a database interface is focused. The invention provides data requirements for front-end users, and executes the data query statement customized by the front-end page in the database to perform data aggregation processing to form a database interface. Based on this, as shown in fig. 13 and fig. 14, the method further includes a step of generating a database interface, the step including:
and 1302, performing data cleaning on the data in the database to obtain cleaned data, and aggregating the cleaned data to generate aggregated data.
The data cleaning is used for correcting recognizable errors in the data file, and can process the problems of data loss value, out-of-bounds value, inconsistent code, repeated data and the like from any angle and combination of accuracy, completeness, consistency, uniqueness, timeliness, validity and the like. For example: the method can use the field extraction mode and other modes to analyze the data according to the factors such as the field type, the field length and the like so as to solve the corresponding problems.
Aggregation is a data processing mode, and data meeting certain rules can be combined according to any factors such as data types, data length ranges and the like to form corresponding data sets, and data in respective fields are combined. Which refers to merging data from different data sources. Clustering, also known as cluster analysis, is a technique for statistical data analysis.
Specifically, information collection can be performed through a plurality of information collection modules such as detection devices and apparatuses, data cleaning can be performed on the collected information, and then the cleaned data can be aggregated. For example, data corresponding to fields such as "scene ID", "thermodynamic point location", and thermodynamic update time "are aggregated to form a corresponding data set.
Step 1304, generating a database interface corresponding to the aggregated data according to the data type and the data length range corresponding to the aggregated data.
Data types, including categories of strings, integer fields, long integer fields, etc., may enhance the efficiency of data management. The data length range may include the maximum and minimum values of the data length to define the range of data input and avoid data overflow. For example, for an interface of "thermal sight", it can be set as: fields such as 'scene ID', 'thermodynamic diagram point position', 'thermodynamic diagram update time' are aggregated, and the fields can be of character string types or different types.
Based on the data requirement, the front-end user puts forward a data requirement, executes the data query statement customized by the front-end page in the database to perform data aggregation processing, forms a database interface, outputs and stores an interface document, and the interface document can be updated in real time according to the Group bound by the app without repeatedly writing codes, so that the speed of modification and debugging is increased.
In summary, firstly, the scheme accesses the database instead of the backend interface, so that the expressed query can be more matched with the query of the database, and a domain space for managing a data interface is not required to be constructed; secondly, the data interface is repeatedly utilized in a mode of interface configuration grouping, the labor cost is reduced, one interface is changed, a plurality of programs can be synchronously modified, and the benefit of one-time modification and multiple platforms is realized. Thirdly, development is realized in a low-code mode, so that the workload and the development difficulty are reduced and the access speed is increased on the basis of realizing the personalized customization of a program interface; in addition, the document generation capability is realized on the basis of interface configuration, and documents can be accessed and provided in a web mode. And the real-time synchronization of the document and the interface configuration can be kept, and the skill editing and the migration are facilitated.
It should be understood that although the various steps in the flowcharts of fig. 2, 7, 10-14 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 7, 10-14 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or in alternation with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 15, there is provided a data calling apparatus including: a program access module 1502, an interface acquisition module 1504, and a dependency establishment module 1506, wherein:
a program interface development apparatus, the apparatus comprising:
a program access module 1502, configured to receive program information sent by a front end, where the program information is obtained by the front end from displayed data, and the program information includes a program identifier and a first permission identifier;
an interface obtaining module 1504, configured to obtain an interface identifier of a database and a call permission of a database interface;
the dependency relationship establishing module 1506 is configured to, in response to the interface development request sent by the front end, establish a dependency relationship between the program identifier and the interface identifier if the interface development request corresponds to the first permission identifier, and open a call permission of the database interface for the program corresponding to the program identifier, so as to obtain the target program after the interface development.
In one embodiment, the interface obtaining module 1504 includes: the device comprises an identification construction unit, an interface group generation unit and an interface assembly unit;
the identification construction unit is used for acquiring an interface group identification, the interface group identification is used for representing a database interface group, and the database interface group comprises at least one database interface;
the interface group generation unit is used for establishing data association between interface calling identifiers in the interface group, enabling the data association between calling authorities in the interface group to generate calling authority information of the interface group;
and the interface assembly unit is used for establishing a data dependency relationship between the program identifier and the calling authority information of the interface group to complete the interface development of the program.
In one embodiment, as shown in fig. 16, the data calling apparatus further includes: a program using module 1508, the program using module 1508 including an interface calling unit, a data calling unit;
the interface calling unit is used for acquiring a data query interface identifier corresponding to a developed program, determining a template corresponding to the data query interface identifier, and obtaining a data query template, wherein the data query template is configured with a parameter access type and a parameter access length range;
and the data calling unit is used for acquiring the data calling information, substituting the data calling information into the data query template and calling the data.
The dependency relationship establishing module 1506 is specifically configured to establish a binding relationship between the program identifier and the interface calling identifier, connect the program with the corresponding database interface according to the binding relationship, and open a calling authority of the database interface for the program corresponding to the program identifier.
In an embodiment, the program access module 1502 is further configured to obtain a second permission identifier;
correspondingly, the program using module 1508 further includes an interface document generating unit and a document authority generating unit:
the interface document generating unit is used for recording the binding relationship between the program identifier and the interface calling identifier and generating an interface recording document;
and the document authority generating unit is used for generating the mapping relation between the second authority identification and the interface record document by taking the second authority identification as the reading condition of the interface record document.
In one embodiment, program usage module 1508 further includes: a request response unit and a cache calling unit;
the request response unit is used for responding to the first data calling request and acquiring cache data, wherein the cache data comprises a second data calling request and called data corresponding to the second data calling request;
and the cache calling unit is used for calling the called data corresponding to the second data calling request from the cache data after judging that the first data calling request is matched with the second data calling request.
In one embodiment, program access module 1502 further includes: the data processing unit and the interface generating unit.
The data processing unit is used for cleaning the data in the database to obtain the cleaned data, and aggregating the cleaned data to generate aggregated data;
and the interface generating unit is used for generating a database interface corresponding to the aggregated data according to the data type and the data length range corresponding to the aggregated data.
For specific limitations of the data calling device, reference may be made to the above limitations of the data calling method, which are not described herein again. All or part of each module in the data calling device can be realized by software, hardware and data dependency relationship established by the hardware. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 17. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data call data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data call method.
Those skilled in the art will appreciate that the architecture shown in fig. 17 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects may be applied, and that a particular computing device may include more or fewer components than those shown, or certain components may be used to establish data dependencies, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the foregoing embodiments may be arbitrarily configured to establish a data dependency relationship, and for brevity of description, all possible established data dependency relationships of the technical features in the foregoing embodiments are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the established data dependency relationships of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for program interface development, the method comprising:
receiving program information sent by a front end, wherein the program information is acquired by the front end from a displayed interface and comprises a program identifier and a first authority identifier;
acquiring an interface calling identifier of a database;
responding to an interface development request sent by the front end, if the interface aggregation request corresponds to the first permission identifier, establishing a dependency relationship between the program identifier and the interface calling identifier, and completing the interface development of the program.
2. The method of claim 1, wherein the establishing the dependency relationship between the program identifier and the interface identifier completes interface development of the program, and comprises:
acquiring an interface group identifier, wherein the interface group identifier is used for representing a database interface group, and the database interface group comprises at least one database interface;
establishing data association between interface calling identifiers in the interface group, enabling the data association between calling authorities in the interface group, and generating calling authority information of the interface group;
and establishing a data dependency relationship between the program identification and the calling authority information of the interface group, and completing the interface development of the program.
3. The method of claim 1, further comprising the step of calling data in a database using a developed program, the step comprising:
acquiring a data query interface identifier corresponding to the developed program, determining a template corresponding to the data query interface identifier, and obtaining a data query template, wherein the data query template is configured with a parameter access type and a parameter access length range;
and acquiring data calling information, substituting the data calling information into the data query template, and calling the data.
4. The method according to claim 1, wherein the establishing of the dependency relationship between the program identifier and the interface call identifier completes interface development of the program, and comprises:
establishing a binding relation between a program identifier and an interface calling identifier, connecting the program with a corresponding database interface according to the binding relation, and opening the calling authority of the database interface for the program corresponding to the program identifier.
5. The method of claim 4, wherein receiving the program information sent by the front end further comprises: acquiring a second authority identifier;
after the interface development of the program is completed, the method further comprises the following steps:
recording the binding relationship between the program identifier and the interface calling identifier to generate an interface recording document;
and taking the second authority identification as a reading condition of the interface record document to generate a mapping relation between the second authority identification and the interface record document.
6. The method of claim 1, further comprising the step of invoking data in a database, the step comprising:
responding to a first data calling request, and acquiring cache data, wherein the cache data comprises a second data calling request and called data corresponding to the second data calling request;
and calling the called data corresponding to the second data calling request from the cache data after judging that the first data calling request is matched with the second data calling request.
7. The method according to any one of claims 1 to 6, characterized in that it further comprises a step of generating a database interface, said step comprising:
data in a database are cleaned to obtain cleaned data, and the cleaned data are aggregated to generate aggregated data;
and generating a database interface corresponding to the aggregated data according to the data type and the data length range corresponding to the aggregated data.
8. A program interface development apparatus, the apparatus comprising:
the system comprises a program access module, a first permission module and a second permission module, wherein the program access module is used for receiving program information sent by a front end, the program information is acquired by the front end from displayed data, and the program information comprises a program identifier and a first permission identifier;
the interface acquisition module is used for acquiring the interface identifier of the database and the calling authority of the database interface;
and the dependency relationship establishing module is used for responding to an interface development request sent by the front end, establishing a dependency relationship between the program identifier and the interface identifier if the interface development request corresponds to the first permission identifier, and opening the calling permission of the database interface for the program corresponding to the program identifier to obtain the target program after interface development.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111112415.4A 2021-09-18 2021-09-18 Interface development method and device, computer equipment and storage medium Pending CN113918149A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111112415.4A CN113918149A (en) 2021-09-18 2021-09-18 Interface development method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111112415.4A CN113918149A (en) 2021-09-18 2021-09-18 Interface development method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113918149A true CN113918149A (en) 2022-01-11

Family

ID=79235743

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111112415.4A Pending CN113918149A (en) 2021-09-18 2021-09-18 Interface development method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113918149A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114417323A (en) * 2022-01-21 2022-04-29 北京飞书科技有限公司 Data reference method, device, equipment and medium
CN115481386A (en) * 2022-09-15 2022-12-16 中航信移动科技有限公司 Batch configuration system for target application use permission

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114417323A (en) * 2022-01-21 2022-04-29 北京飞书科技有限公司 Data reference method, device, equipment and medium
CN115481386A (en) * 2022-09-15 2022-12-16 中航信移动科技有限公司 Batch configuration system for target application use permission
CN115481386B (en) * 2022-09-15 2023-05-30 中航信移动科技有限公司 Batch configuration system for target application use permission

Similar Documents

Publication Publication Date Title
Maesa et al. Blockchain based access control services
AU2021212135B2 (en) Building and managing data-processing attributes for modelled data sources
CN113377805B (en) Data query method and device, electronic equipment and computer readable storage medium
CN102708203A (en) Database dynamic management method based on XML metadata
CN113918149A (en) Interface development method and device, computer equipment and storage medium
CN115292353B (en) Data query method and device, computer equipment and storage medium
CN108255967B (en) Method and device for calling storage process, storage medium and terminal
US10877984B1 (en) Systems and methods for filtering and visualizing large scale datasets
CN115238247A (en) Data processing method based on zero trust data access control system
CN109670011B (en) Multi-map-source map service engine
Kim et al. Comprehensive Knowledge Archive Network harvester improvement for efficient open‐data collection and management
CN110334103A (en) The update method of recommendation service provides device, access mechanism and recommender system
CN117851375A (en) Metadata model optimization method and computing device
CN115543428A (en) Simulated data generation method and device based on strategy template
CN113591162B (en) Block chain evidence storing method and device and computer equipment
US20220245176A1 (en) Data processing system with manipulation of logical dataset groups
CN113076086B (en) Metadata management system and method for modeling model object using the same
CN115017185A (en) Data processing method, device and storage medium
CN111881220A (en) Data operation method and device under list storage, electronic equipment and storage medium
CN112434018B (en) Report generation method, report generation device, computer equipment and storage medium
US20240296350A1 (en) Computed values for knowledge graph
CN116257221A (en) Code generation method, device, equipment and storage medium
CN116028956A (en) Data access authority control method, device, computer equipment and storage medium
CN113918595A (en) Data query method and device
CN116186134A (en) Cross-data-source query service generation method and system

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