CN112734349A - Interface generation method, data calling method, device and electronic equipment - Google Patents
Interface generation method, data calling method, device and electronic equipment Download PDFInfo
- Publication number
- CN112734349A CN112734349A CN201910975327.3A CN201910975327A CN112734349A CN 112734349 A CN112734349 A CN 112734349A CN 201910975327 A CN201910975327 A CN 201910975327A CN 112734349 A CN112734349 A CN 112734349A
- Authority
- CN
- China
- Prior art keywords
- data
- interface
- calling
- return
- sql statement
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 76
- 230000015654 memory Effects 0.000 claims description 25
- 238000012360 testing method Methods 0.000 claims description 11
- 230000009467 reduction Effects 0.000 claims description 5
- 230000008569 process Effects 0.000 description 14
- 230000006870 function Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 230000002688 persistence Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 230000008676 import Effects 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 241000239290 Araneae Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 210000001503 joint Anatomy 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001172 regenerating effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/10—Office automation; Time management
- G06Q10/103—Workflow collaboration or project management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating 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)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Human Resources & Organizations (AREA)
- Entrepreneurship & Innovation (AREA)
- General Engineering & Computer Science (AREA)
- Economics (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application discloses an interface generation method, a data calling device and electronic equipment, wherein the interface generation method comprises the following steps: transmitting the user-defined SQL statement into a data source; executing the self-defined SQL statement and analyzing a return parameter; and issuing a corresponding interface according to the return parameters. By the method, the interface can be generated by self-defining the SQL statement, and aiming at a plurality of systems with complex business logic association, the complex logic relation can be realized by the self-defining SQL, so that the complex logic configuration can be avoided, the interface can be released by one-key configuration, and the efficiency of data acquisition among different systems can be improved; and the interface issued by the invention is more convenient to maintain.
Description
Technical Field
The application relates to the technical field of computers, in particular to an interface generation method, an interface generation device, a data calling method, a data calling device and electronic equipment.
Background
At present, because of a plurality of business subsystems of a company, data interaction is required among the business subsystems, various interfaces and data views are opened, and the condition that a plurality of business subsystems need to acquire data in one business subsystem exists, so that business logic is complex. At present, all subsystems are mutually opened and are in interface butt joint to form a similar spider net shape, so that not only is the interface set complicated, but also the maintenance cost is higher.
Disclosure of Invention
The embodiment of the application aims to provide an interface generation method, an interface generation device, a data calling method, a data calling device and electronic equipment, so that a complex logical relation can be realized in a user-defined SQL mode, complicated logical configuration can be omitted, interface release can be realized through one-key configuration, and further the efficiency of data acquisition between different systems can be improved.
In order to solve the above technical problem, the embodiment of the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides an interface generation method, including:
transmitting the user-defined SQL statement into a data source;
executing the self-defined SQL statement and analyzing a return parameter;
and issuing a corresponding interface according to the return parameters.
In one possible implementation, before the step of transmitting the custom SQL statement to the data source, the method further includes:
determining a data source corresponding to a database to be called;
testing whether the data source is available;
the transmitting the custom SQL statement into a data source comprises the following steps:
and transmitting the self-defined SQL statement into a data source with successful test.
In one possible implementation, the passing the custom SQL statement into a data source includes:
and connecting the data source in an encryption mode, and transmitting the custom SQL statement into the data source.
In a possible implementation manner, before the step of issuing the corresponding interface according to the return parameter, the method further includes:
acquiring a pre-configured authority parameter;
the issuing of the corresponding interface according to the return parameter includes:
and issuing a corresponding interface according to the return parameter and the permission parameter.
In a second aspect, an embodiment of the present application provides a data calling method, including:
receiving a data calling request;
calling a corresponding interface according to the data calling request;
acquiring SQL sentences to be executed according to the interface;
and executing the SQL sentence to be executed, and obtaining and feeding back return data.
In a possible implementation manner, before the step of invoking the corresponding interface according to the data call request, the method further includes:
authenticating a user account corresponding to the data calling request;
the calling of the corresponding interface according to the data call request includes:
and after the authentication is passed, calling a corresponding interface according to the data calling request.
In a possible implementation manner, the authenticating the user account corresponding to the data call request includes:
acquiring an intermediate call account;
obtaining a key string according to the intermediate call account;
and authenticating the user account corresponding to the data calling request according to the data calling request and the key string.
In a possible implementation manner, the obtaining, according to the interface, an SQL statement to be executed includes:
acquiring custom SQL data according to the interface;
performing parameter reduction on the user-defined SQL data to obtain a return parameter;
acquiring authority parameters of a user account corresponding to the data calling request;
and acquiring the SQL sentences to be executed in the interface according to the return parameters and the permission parameters.
In a third aspect, an embodiment of the present application provides an interface generating apparatus, including:
the statement transmitting module is used for transmitting the user-defined SQL statement into a data source;
the statement execution module is used for executing the custom SQL statement and analyzing a return parameter;
and the interface issuing module is used for issuing a corresponding interface according to the return parameter.
In a fourth aspect, an embodiment of the present application provides a data invoking device, including:
the request receiving module is used for receiving a data calling request;
the interface calling module is used for calling a corresponding interface according to the data calling request;
the statement acquisition module is used for acquiring SQL statements to be executed according to the interface;
and the data return module is used for executing the SQL statement to be executed, and obtaining and feeding back return data.
In a fifth aspect, embodiments of the present application provide an electronic device, which includes one or more processors and one or more memories, where at least one instruction is stored in the one or more memories, and the instruction is loaded and executed by the one or more processors to implement the operations performed by the method according to the first and second aspects.
In a sixth aspect, embodiments of the present application provide a computer-readable storage medium, where at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operations performed by the method according to the first and second aspects.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
by introducing the user-defined SQL statement into a data source, executing the user-defined SQL statement to obtain a return parameter, issuing a corresponding interface according to the return parameter, generating an interface by the user-defined SQL statement can be realized, and aiming at a plurality of systems with complex business logic association, by adopting the method provided by the invention, a complex logic relationship can be realized by a user-defined SQL mode, so that complicated logic configuration can be avoided, interface issuing can be realized by one-key configuration, and further, the efficiency of data acquisition among different systems can be improved; and the interface issued by the invention is more convenient to maintain.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is an implementation environment of an interface generation and data call method according to an embodiment of the present invention;
fig. 2 is a flowchart of an interface generation method according to an embodiment of the present invention;
FIG. 3 is a flowchart of a data calling method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an interface generation apparatus according to an embodiment of the present invention;
FIG. 5 is a diagram of a data call apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. 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.
For ease of understanding, the system architecture of the present invention will be described: the invention is applied to a server, as shown in fig. 1, the server may include a user layer, a presentation layer, a logic layer and a persistence layer, the user layer may include a service manager and a service caller, the service manager may set the authority of the service caller, and the function of the service manager is equivalent to the function of calling an account in the middle of the following; the service invoker invokes an account for the following user. The display layer may include: service design, data source management, service state and service authority; service design for storing different design requirements of a service; the data source management is used for managing operation aiming at the data source; the service state is used for displaying the working state of each current service; the service authority is used for displaying different use authorities of various services. The logic layer may include: customizing SQL analysis, service monitoring and service gateway; the user-defined SQL analysis is used for analyzing a user-defined SQL statement; the service monitoring is used for monitoring the working state of the service; the service gateway is used for authenticating the data calling request. The persistent layer may include: the business system database, the platform database and the data are restored; the service system database is used for storing data resources of each service system; the platform database is used for storing authority relations among all the service systems; the data cache is used for caching the called data.
The invention can simply and conveniently realize the control of the calling authority by setting the service manager and the service caller and controlling the authority of the service caller by the service manager; by setting the custom SQL analysis in the logic layer, the API is generated in a custom SQL mode, and the data acquisition efficiency is improved. Through setting up the persistence layer, can carry out persistence to data and authority, the management of being convenient for.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example one
Fig. 2 is a flowchart of an interface generation method provided by the present invention, where the method is used for a server, and the method of this embodiment includes:
step S101: and transmitting the custom SQL statement into a data source.
The data source refers to execution code for calling data from a database.
The user-defined SQL statement comprises the following steps: a frame SQL statement and a pre-execution SQL statement.
Before the custom SQL statement is transmitted to the data source, the method may further include: and determining a data source corresponding to the database to be called, and testing whether the data source is available.
The custom SQL statement comprises identification information corresponding to the database to be called, which data source can be determined according to the identification information, and after the data source is determined, whether the data source can be tested or not is tested, wherein the test mode can adopt a simple calling example for testing. If the test result is that the data source is available, transmitting the user-defined SQL statement into the data source; if the test result is that the data source is not available, the data source can be corrected until the data source is available, then the user-defined SQL statement is transmitted into the data source, and information that the data source is not available and the interface fails to issue can be returned to the user.
When the custom SQL statement is transmitted to the data source, the frame SQL statement of the custom SQL statement may be transmitted first, and then the pre-execution SQL statement may be transmitted.
When the user-defined SQL statement is transmitted into the data source, the data source can be connected in an encryption mode, and the user-defined SQL statement is transmitted into the data source.
Step S102: executing the self-defined SQL statement and analyzing a return parameter;
step S103: and issuing a corresponding interface according to the return parameters.
The custom SLQ statement is an SQL statement without data return. The pre-executed SQL statement executes the data source in the environment of the frame SQL statement, and does not return data, but resolves a return field, where the return field is an input parameter and an output parameter of the interface to be generated, and the input parameter and the output parameter are collectively referred to as a return parameter, and according to the return parameter, a corresponding api (application Programming interface) interface may be issued.
The pre-executed SQL statement is the SQL statement established according to the business logic relationship. Under the condition that the configuration mode is difficult to realize, the API is generated in a self-defined SQL mode, and the data acquisition efficiency can be improved.
In another embodiment provided by the present invention, before issuing the corresponding interface according to the return parameter, the method may further include: acquiring a pre-configured authority parameter; and then, issuing a corresponding interface according to the return parameters and the authority parameters.
In the invention, the pre-configured authority parameters can be obtained from the platform database in the persistent layer, the output parameters of the data interface service are matched according to the authority parameters through standard data acquisition, and then the interface service is issued according to the input parameters and the output parameters. And after the authority is matched, writing the matched authority into the platform database, and keeping the information for subsequent checking. The permission parameter may be a data call permission among each subsystem, the service system, the user account, and the like. The invention can be used in the company and also can be used among different companies.
According to the invention, the API interface is automatically generated in a self-defined SQL statement mode, so that complicated logic configuration is avoided, and the data acquisition efficiency can be improved.
Example two
In the first embodiment, an interface generation method is described, after an interface is generated, a user can call the interface to call data, and fig. 3 shows a data call method, which is used in cooperation with the first embodiment. The data calling method provided by the embodiment is suitable for a server, and after a user sends a data calling request to the server, the server calls data by using an interface, and the specific process is as follows:
step S201: a data call request is received.
The data call request may be in the form of a link, for example, a link request for a user to access certain data.
The link request carries a user account of the caller, input parameters to be accessed, an interface identifier and the like.
Step S202: and calling a corresponding interface according to the data calling request.
The server is often provided with a plurality of interfaces, and after a caller sends a data call request, the server determines the interfaces according to the interface identifiers in the data call request and calls the corresponding interfaces.
Step S203: and acquiring the SQL sentence to be executed according to the interface.
The interface is obtained according to the first embodiment, and the interface is generated by a custom SQL statement, so that the data call request is analyzed to obtain an operation instruction, the custom SQL data is obtained by data search according to the operation instruction, the parameter of the custom SQL data is restored to obtain a return parameter, and the SQL statement to be executed is obtained according to the return parameter.
Step S204: and executing the SQL sentence to be executed, and obtaining and feeding back return data.
And executing the SQL statement to be executed to obtain return data, and feeding the return data back to the caller.
The return data provided for the caller in the step is the data of all parameters which can be viewed in the interface, wherein the authority of the user account is the data of all parameters which can be viewed in the interface.
When the user account is provided with a permission and only data of partial parameters in the interface can be viewed, the acquiring the SQL statement to be executed in the interface comprises: acquiring custom SQL data according to the interface; performing parameter reduction on the user-defined SQL data to obtain a return parameter; acquiring authority parameters of a user account corresponding to the data calling request; and acquiring the SQL sentences to be executed in the interface according to the return parameters and the permission parameters.
And obtaining the user-defined SQL data according to the interface, and performing parameter reduction on the user-defined SQL data to obtain a return parameter, wherein the process is the same as the process in the step S203. When the user account is set with the right, after the return parameter is obtained, the right parameter of the user account corresponding to the data calling request is also required to be obtained, and then the return parameter and the right parameter are processed to obtain the SQL sentence to be executed. And executing the SQL sentence to be executed on the data source to obtain the data of the authority corresponding to the user account.
In another embodiment provided by the present invention, before the step of invoking the corresponding interface according to the data call request, the method may further include: authenticating a user account corresponding to the data calling request; the calling of the corresponding interface according to the data call request includes: and after the authentication is passed, calling a corresponding interface according to the data calling request.
The data calling request corresponds to a user account, user permissions corresponding to different user accounts are stored in a platform database, before an interface is called, the user account can be authenticated, whether the user account has the permission to call the interface or not is judged, if yes, the authentication is passed, and then the corresponding interface is called according to the data calling request; if not, the authentication is not passed, the corresponding interface is not taken, and no authority is returned to the caller to call the failed information. By authenticating the user account, the data can be kept secret, and the security of the data is improved.
The service manager and the service caller are arranged on the user layer, the service manager can manage the calling authority of the service caller, and the service manager can control the authority of the service caller by using the intermediate calling account, so that the user account corresponding to the service caller can be managed by the intermediate calling account, different return data can be acquired when different user accounts are called, and the purpose of authority control is achieved, and the specific management process is as follows:
when authenticating a user account, an intermediate call account may be obtained first, where the intermediate call account includes: processing the account, the password, the encryption string and the current timestamp in the intermediate account to generate a key string; and acquiring a file header from the link address of the data calling request, and finally performing data authentication according to the file header and the key string.
And returning the authorized key string after the data authentication is passed, automatically renewing the lease of the system if the key string is not overdue, requesting service again through the key string and the data calling request, and calling the interface, wherein the specific interface calling process is the same as the calling process. And if the key string is overdue, regenerating a new key string, requesting service again according to the new key string and the data calling request, and calling the interface, wherein the specific interface calling process is the same as the calling process. For example, if the service re-request operation is not performed after 30 minutes, the key string expires, and the 30 minutes can be adjusted by the user.
By using the method to call data, the call authority of the user can be controlled, and the data calling efficiency is improved.
EXAMPLE III
Fig. 4 is a schematic diagram of an interface generating apparatus according to an embodiment of the present invention, referring to fig. 4, the apparatus includes: a statement import module 101, a statement execution module 102 and an interface issue module 103.
A statement transmitting module 101, configured to transmit the custom SQL statement to a data source;
the statement execution module 102 is configured to execute the custom SQL statement and parse a return parameter;
and the interface issuing module 103 is used for issuing a corresponding interface according to the return parameter.
In one possible implementation, the apparatus is further configured to:
determining a data source corresponding to a database to be called;
testing whether the data source is available;
the statement importing module 101 is specifically configured to:
and transmitting the self-defined SQL statement into a data source with successful test.
In one possible implementation, the statement import module 101 is further configured to:
and connecting the data source in an encryption mode, and transmitting the custom SQL statement into the data source.
In one possible implementation, the apparatus is further configured to: acquiring a pre-configured authority parameter;
the interface issuing module 103 is specifically configured to:
and issuing a corresponding interface according to the return parameter and the permission parameter.
It should be noted that: in the interface generating apparatus provided in the foregoing embodiment, when generating an interface, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the interface generation apparatus and the interface generation method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Example four
Fig. 5 is a schematic diagram of a data call apparatus according to an embodiment of the present invention, and referring to fig. 5, the apparatus includes: a request receiving module 201, an interface calling module 202, a statement acquiring module 203 and a data returning module 204.
A request receiving module 201, configured to receive a data call request;
the interface calling module 202 is configured to call a corresponding interface according to the data calling request;
the statement acquisition module 203 is configured to acquire an SQL statement to be executed according to the interface;
and the data return module 204 is configured to execute the SQL statement to be executed, and obtain and feed back return data.
In one possible implementation, the apparatus is further configured to:
authenticating a user account corresponding to the data calling request;
the interface retrieving module 202 includes:
and after the authentication is passed, calling a corresponding interface according to the data calling request.
In a possible implementation manner, the authenticating the user account corresponding to the data call request includes:
acquiring an intermediate call account;
obtaining a key string according to the intermediate call account;
and authenticating the user account corresponding to the data calling request according to the data calling request and the key string.
In one possible implementation, the statement obtaining module 203 is further configured to:
acquiring custom SQL data according to the interface;
performing parameter reduction on the user-defined SQL data to obtain a return parameter;
acquiring authority parameters of a user account corresponding to the data calling request;
and acquiring the SQL sentences to be executed in the interface according to the return parameters and the permission parameters.
It should be noted that: the data calling device provided in the above embodiment is only illustrated by the division of the functional modules when calling data, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data calling device and the data calling method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
It should be noted that the execution subjects of the steps of the method provided in embodiment 1 may be the same device, or different devices may be used as the execution subjects of the method. For example, the execution subject of step S101 and step S102 may be device 1, and the execution subject of step S103 may be device 2; for another example, the execution subject of step S101 may be device 1, and the execution subjects of step S102 and step S103 may be device 2; and so on. Example 2 and example 3 are the same as above.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 6, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program, and forms an interface generating device and a data calling device on a logic level. The processor executes the program stored in the memory and is specifically used for executing the following interface generation operation and data calling operation:
transmitting the user-defined SQL statement into a data source;
executing the self-defined SQL statement and analyzing a return parameter;
and issuing a corresponding interface according to the return parameters.
Receiving a data calling request;
calling a corresponding interface according to the data calling request;
acquiring SQL sentences to be executed according to the interface;
and executing the SQL sentence to be executed, and obtaining and feeding back return data.
The method performed by the interface generation apparatus disclosed in the embodiment of fig. 4 and the method performed by the data call apparatus disclosed in the embodiment of fig. 5 may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method in fig. 2 and implement the function of the interface generating apparatus in the embodiment shown in fig. 2, and the electronic device may further execute the method in fig. 3 and implement the function of the data calling apparatus in the embodiment shown in fig. 3, which is not described herein again in this embodiment of the present application.
Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
An embodiment of the present application further provides a computer-readable storage medium, where at least one instruction is stored in the computer-readable storage medium, and the instruction is loaded and executed by a processor to implement the following operations:
transmitting the user-defined SQL statement into a data source;
executing the self-defined SQL statement and analyzing a return parameter;
and issuing a corresponding interface according to the return parameters.
Receiving a data calling request;
calling a corresponding interface according to the data calling request;
acquiring SQL sentences to be executed according to the interface;
and executing the SQL sentence to be executed, and obtaining and feeding back return data.
In short, the above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Claims (12)
1. An interface generation method, comprising:
transmitting the user-defined SQL statement into a data source;
executing the self-defined SQL statement and analyzing a return parameter;
and issuing a corresponding interface according to the return parameters.
2. The method of claim 1, further comprising, prior to the step of passing the custom SQL statement into a data source:
determining a data source corresponding to a database to be called;
testing whether the data source is available;
the transmitting the custom SQL statement into a data source comprises the following steps:
and transmitting the self-defined SQL statement into a data source with successful test.
3. The method of claim 1, wherein the passing custom SQL statements into a data source comprises:
and connecting the data source in an encryption mode, and transmitting the custom SQL statement into the data source.
4. The method according to claim 1, further comprising, before the step of issuing the corresponding interface according to the return parameter:
acquiring a pre-configured authority parameter;
the issuing of the corresponding interface according to the return parameter includes:
and issuing a corresponding interface according to the return parameter and the permission parameter.
5. A data calling method, comprising:
receiving a data calling request;
calling a corresponding interface according to the data calling request;
acquiring SQL sentences to be executed according to the interface;
and executing the SQL sentence to be executed, and obtaining and feeding back return data.
6. The method according to claim 5, further comprising, before the step of invoking the corresponding interface according to the data call request:
authenticating a user account corresponding to the data calling request;
the calling of the corresponding interface according to the data call request includes:
and after the authentication is passed, calling a corresponding interface according to the data calling request.
7. The method of claim 6, wherein authenticating the user account corresponding to the data call request comprises:
acquiring an intermediate call account;
obtaining a key string according to the intermediate call account;
and authenticating the user account corresponding to the data calling request according to the data calling request and the key string.
8. The method according to claim 5, wherein the obtaining the SQL statement to be executed according to the interface comprises:
acquiring custom SQL data according to the interface;
performing parameter reduction on the user-defined SQL data to obtain a return parameter;
acquiring authority parameters of a user account corresponding to the data calling request;
and acquiring the SQL sentences to be executed in the interface according to the return parameters and the permission parameters.
9. An interface generation apparatus, comprising:
the statement transmitting module is used for transmitting the user-defined SQL statement into a data source;
the statement execution module is used for executing the custom SQL statement and analyzing a return parameter;
and the interface issuing module is used for issuing a corresponding interface according to the return parameter.
10. A data call apparatus, comprising:
the request receiving module is used for receiving a data calling request;
the interface calling module is used for calling a corresponding interface according to the data calling request;
the statement acquisition module is used for acquiring SQL statements to be executed according to the interface;
and the data return module is used for executing the SQL statement to be executed, and obtaining and feeding back return data.
11. An electronic device, comprising one or more processors and one or more memories having stored therein at least one instruction that is loaded and executed by the one or more processors to perform an operation performed by the method of any one of claims 1 to 8.
12. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor to perform operations performed by the method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910975327.3A CN112734349A (en) | 2019-10-14 | 2019-10-14 | Interface generation method, data calling method, device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910975327.3A CN112734349A (en) | 2019-10-14 | 2019-10-14 | Interface generation method, data calling method, device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112734349A true CN112734349A (en) | 2021-04-30 |
Family
ID=75588675
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910975327.3A Pending CN112734349A (en) | 2019-10-14 | 2019-10-14 | Interface generation method, data calling method, device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112734349A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113592575A (en) * | 2021-06-18 | 2021-11-02 | 青岛海尔科技有限公司 | Order determining method and device, storage medium and electronic device |
CN113742364A (en) * | 2021-09-10 | 2021-12-03 | 拉卡拉支付股份有限公司 | Data access method, data access device, electronic equipment, storage medium and program product |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102567517A (en) * | 2011-12-28 | 2012-07-11 | 用友软件股份有限公司 | Device and method for issuing data of database |
CN105677681A (en) * | 2014-11-21 | 2016-06-15 | 北京神州泰岳软件股份有限公司 | Data search method and device based on multiple databases |
CN109144512A (en) * | 2018-08-22 | 2019-01-04 | 杭州数澜科技有限公司 | A kind of method and system generating API |
CN110083650A (en) * | 2019-04-25 | 2019-08-02 | 中电科嘉兴新型智慧城市科技发展有限公司 | A kind of data-query interfaces automatic generation method and system based on metadata self-discovery |
-
2019
- 2019-10-14 CN CN201910975327.3A patent/CN112734349A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102567517A (en) * | 2011-12-28 | 2012-07-11 | 用友软件股份有限公司 | Device and method for issuing data of database |
CN105677681A (en) * | 2014-11-21 | 2016-06-15 | 北京神州泰岳软件股份有限公司 | Data search method and device based on multiple databases |
CN109144512A (en) * | 2018-08-22 | 2019-01-04 | 杭州数澜科技有限公司 | A kind of method and system generating API |
CN110083650A (en) * | 2019-04-25 | 2019-08-02 | 中电科嘉兴新型智慧城市科技发展有限公司 | A kind of data-query interfaces automatic generation method and system based on metadata self-discovery |
Non-Patent Citations (1)
Title |
---|
中央电化教育馆: "基础教育教学资源元数据标准培训指导用书", vol. 2017, 中央广播电视大学出版社, pages: 211 - 213 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113592575A (en) * | 2021-06-18 | 2021-11-02 | 青岛海尔科技有限公司 | Order determining method and device, storage medium and electronic device |
CN113592575B (en) * | 2021-06-18 | 2024-01-26 | 青岛海尔科技有限公司 | Order determining method and device, storage medium and electronic device |
CN113742364A (en) * | 2021-09-10 | 2021-12-03 | 拉卡拉支付股份有限公司 | Data access method, data access device, electronic equipment, storage medium and program product |
CN113742364B (en) * | 2021-09-10 | 2023-12-26 | 拉卡拉支付股份有限公司 | Data access method, device, electronic equipment, storage medium and program product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109033774B (en) | Method and device for acquiring and feeding back user resources and electronic equipment | |
CN109697204B (en) | Data auditing method and device | |
CN108810006B (en) | Resource access method, device, equipment and storage medium | |
CN110032880B (en) | Screen recording evidence obtaining method and system based on block chain and electronic equipment | |
CN112564916A (en) | Access client authentication system applied to micro-service architecture | |
CN108173706B (en) | Service marking method, device and equipment under multi-service system | |
CN113014475B (en) | Message pushing integration method and device | |
CN109299015B (en) | Software testing method, device and system | |
CN113079200A (en) | Data processing method, device and system | |
US20130305335A1 (en) | Electronic transaction notification system and method | |
CN110086872B (en) | Data processing method and system of SCADA system | |
CN111815454B (en) | Data uplink method and device, electronic equipment and storage medium | |
WO2020108152A1 (en) | Method, device and electronic equipment for preventing misuse of identity data | |
CN111310137B (en) | Block chain associated data evidence storing method and device and electronic equipment | |
TW202032466A (en) | User age prediction method, apparatus, and device | |
CN112734349A (en) | Interface generation method, data calling method, device and electronic equipment | |
CN113296740A (en) | Service object processing method, device, equipment and machine readable medium | |
CN110445768B (en) | Login method and device and electronic equipment | |
CN115374481A (en) | Data desensitization processing method and device, storage medium and electronic equipment | |
CN112464176B (en) | Authority management method and device, electronic equipment and storage medium | |
CN108228248A (en) | A kind of determining method and apparatus of dependence | |
CN111062057B (en) | Neutral data application method, device and system | |
CN113190812A (en) | Login method, system, electronic equipment and storage medium | |
CN111600882A (en) | Block chain-based account password management method and device and electronic equipment | |
CN113761503B (en) | Interface call processing method and device |
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 |