CN110392068A - A kind of data transmission method, device and its equipment - Google Patents
A kind of data transmission method, device and its equipment Download PDFInfo
- Publication number
- CN110392068A CN110392068A CN201810342332.6A CN201810342332A CN110392068A CN 110392068 A CN110392068 A CN 110392068A CN 201810342332 A CN201810342332 A CN 201810342332A CN 110392068 A CN110392068 A CN 110392068A
- Authority
- CN
- China
- Prior art keywords
- api
- request message
- business datum
- sql
- service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a kind of data transmission method, device and its equipment, this method comprises: receiving the request message for being directed to API, and obtains business datum corresponding with the request message;Wherein, the API is to be generated according to SQL information, and provide service using the API, and the request message is the request message for accessing the service;The response message for being directed to the request message is returned to, the response message carries the business datum.By the technical solution of the application, service platform can generate API after receiving SQL information according to SQL information, and SQL information is quickly converted into API service so that server by utilizing API provides service in server disposition API.
Description
Technical field
This application involves Internet technical field more particularly to a kind of data transmission methods, device and its equipment.
Background technique
At the beginning of the development of cloud computing, there are three types of service mode, respectively SaaS (Software as a Service, it is soft
Part services), PaaS (Platform as a Service, platform i.e. service) and IaaS (Infrastructure as a
Service, infrastructure service).SaaS is a kind of innovative software application model, can quickly develop the clothes for belonging to enterprise
Business, to be used widely.With the development of cloud computing and the expansion of business, the development mode of SaaS also changes, out
BaaS (Backend as a Service, backstage service) mode of front and back end separation is showed, i.e. rear end provides API
(Application Program Interface, application programming interfaces), front end exploitation is called, so that front and back end be made to decouple, is dropped
Low exploitation is relied on and is waited, and improves development efficiency.
In BaaS mode, all API, can not be extending transversely for single API progress in same application, so that rear end
Service pressure is increasing, releases MicroService (micro services) mode thus, and MicroService mode has refined API's
Granularity can carry out extending transversely for single API.But the deployment of MicroService mode, need developer to realize
Service code, and safeguard hardware resource, improve cost of labor.
Summary of the invention
The application provides a kind of data transmission method, is applied to service platform, which comprises
The request message for being directed to application programming interfaces API is received, and obtains business datum corresponding with the request message;
Wherein, the API is to be generated according to structured query language SQL information, and provide service, the request using the API
Message is the request message for accessing the service;
The response message for being directed to the request message is returned to, the response message carries the business datum.
The application provides a kind of data transmission method, is applied to configuration platform, which comprises
Obtain structured query language SQL information;
The SQL information is sent to service platform, is connect so that service platform generates application program according to the SQL information
Mouth API provides service using the API, and sends business datum according to the API.
The application provides a kind of data transmission device, is applied to service platform, and described device includes:
Receiving module, for receiving the request message for being directed to application programming interfaces API;
Wherein, the API is to be generated according to structured query language SQL information, and provide service using the API,
The request message is the request message for accessing the service;
Module is obtained, for obtaining business datum corresponding with the request message;
Sending module, for returning to the response message for being directed to the carrying business datum of the request message.
The application provides a kind of data transmission device, is applied to configuration platform, and described device includes:
Module is obtained, for obtaining structured query language SQL information;
Sending module, for the SQL information to be sent to service platform, so that service platform is generated according to SQL information
Application programming interfaces API provides service using API, and sends business datum according to API.
The application provides a kind of service platform, comprising: processor and machine readable storage medium, the machine readable storage
Several computer instructions are stored on medium, the processor is handled as follows when executing the computer instruction: receiving needle
To the request message of application programming interfaces API, and obtain business datum corresponding with the request message;Wherein, the API is
It is generated according to structured query language SQL information, and provides service using the API, the request message is for accessing
The request message of the service;
The response message for being directed to the request message is returned to, the response message carries the business datum.
The application provides a kind of configuration platform, comprising: processor and machine readable storage medium, the machine readable storage
Several computer instructions are stored on medium, the processor is handled as follows when executing the computer instruction: obtaining knot
Structure query language SQL information;The SQL information is sent to service platform, so that service platform is raw according to the SQL information
At application programming interfaces API, service is provided using the API, and business datum is sent according to the API.
Based on the above-mentioned technical proposal, it in the embodiment of the present application, proposes a kind of SQL and services (SQL As A Service)
Implementation method, allow developer only provide SQL (Structured Query Language, structuralized query language
Speech) information, the presence of aware services device is not needed, maintenance hardware resource is not needed, does not need to be concerned about SQL in the portion of server
Administration, extension and maintenance, only focus on the SQL of oneself business, to greatly reduce development cost.Service platform is receiving
After SQL information, API can be generated according to SQL information, and (Application Programming Interface, application program are compiled
Journey interface), and in server disposition API, so that server by utilizing API provides service, SQL information is quickly converted into API clothes
Business, and dynamic release function is provided, accelerate system development efficiency, there are the advantages such as smaller granularity, more light weight, faster.
Detailed description of the invention
It, below will be to the application in order to clearly illustrate the embodiment of the present application or technical solution in the prior art
Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below
Attached drawing is only some embodiments as described in this application, for those of ordinary skill in the art, can also be according to this Shen
Please these attached drawings of embodiment obtain other attached drawings.
Figure 1A-Fig. 1 D is the schematic diagram of the system structure in a kind of embodiment of the application;
Fig. 2 is the flow chart of the data transmission method in a kind of embodiment of the application;
Fig. 3 is the flow chart of the data transmission method in the application another embodiment;
Fig. 4 is the structure chart of the data transmission device in a kind of embodiment of the application;
Fig. 5 is the structure chart of the data transmission device in a kind of embodiment of the application.
Specific embodiment
In the term that the embodiment of the present application uses merely for the sake of for the purpose of describing particular embodiments, rather than limit this Shen
Please.The "an" of singular used in the application and claims, " described " and "the" are also intended to including most shapes
Formula, unless context clearly shows that other meanings.It is also understood that term "and/or" used herein refers to comprising one
A or multiple associated any or all of project listed may combine.
It will be appreciated that though various letters may be described using term first, second, third, etc. in the embodiment of the present application
Breath, but these information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example,
In the case where not departing from the application range, the first information can also be referred to as the second information, and similarly, the second information can also be with
The referred to as first information.Depending on context, in addition, used word " if " can be construed to " ... when ", or
" when ... ", or " in response to determination ".
A kind of data transmission method is proposed in the embodiment of the present application, this method can be applied to include service platform and configuration
The system of platform.Wherein, the configuration platform is for managing SQL information, and the SQL information is sent to service platform, matches to this
The type of horizontalization platform such as can be PC (Personal Computer, personal computer), laptop, movement with no restrictions
Terminal, server etc..In addition, the service platform is used to generate API according to the SQL information, and the API is deployed to business service
Device, with external offer service, with no restrictions to the type of this service platform, such as can for PC, laptop, mobile terminal,
Server etc..
It may include front-end interface, with horizontalization referring to shown in Figure 1A, being the application scenarios schematic diagram of the embodiment of the present application
Platform, service platform, service server and database pass through front-end interface, configuration platform, service platform, service server sum number
According to the cooperation in library, it can be realized SQL and service (SQL As A Service).
In order to realize that SQL is serviced, referring to shown in Figure 1B, developer inputs SQL information, configuration platform in front-end interface
SQL information is obtained from front-end interface, and SQL information is exported to service platform.Service platform can be generated according to SQL information
API, and API is deployed to service server, in this way, service server can provide service according to the API, and user can lead to
Cross the service that client accesses API offer.
During user accesses the service, user can send request message to service server by client,
The request message can be sent to service platform by service server, and service platform can be obtained from database to disappear with the request
Corresponding business datum is ceased, and the business datum is returned into service server, and service server can be by the business datum
Return to user.So far, SQL can be completed to service.
Obviously, it can be seen from figure 1b during SQL is the realization serviced, developer can only provide SQL letter
Breath, does not need the presence of aware services device, does not need maintenance hardware resource, does not need the deployment being concerned about SQL in server, extension
And maintenance, the SQL of oneself business is only focused on, to greatly reduce development cost.In addition, service platform is receiving SQL
After information, API can be generated according to SQL information, and in server disposition API, so that server by utilizing API provides service, fastly
SQL information is converted into API service by speed, and provides dynamic release function (i.e. service platform can be by API dynamic release to business
Server), accelerate system development efficiency, there are the advantages such as smaller granularity, more light weight, faster.
Wherein, SQL is the realization process serviced, and the function of BaaS mode may be implemented, it can realize front and back end separation,
API is provided by rear end, is developed and is called by front end, so that front and back end be made to decouple, exploitation is reduced and relies on and wait, raising is opened
Send out efficiency.SQL is the realization process serviced, the function of MicroService mode may be implemented, it can refine the grain of API
Degree carries out extending transversely for single API.For example, API can rely on multiple again just for single resource, operation layer
MicroService is combined into the business API of business needs, and bottom MicroService can be according to request amount, quickly laterally
Extension and individually deployment.SQL is the realization process serviced, and the function of Serverless (serverless backup) may be implemented, that is, develop
Personnel only need to be concerned about specific API code, without concern for deployment, extension and the maintenance etc. of API code on the server.
Below in conjunction with specific example, to above-mentioned front-end interface, configuration platform, service platform, service server and database
Function be illustrated, certainly, on the basis of front-end interface, configuration platform, service platform, service server and database,
Can also there are other ancillary equipments or supplementary module, it is without limitation.
1, front-end interface (Editor).Front-end interface is user interactive system, and developer can log on to front-end interface,
And SQL information is inputted in the front-end interface, which is the SQL software code that developer writes, this SQL information is used
In generating API, with no restrictions to the content of this SQL information.
Developer can also be in front-end interface input test information (such as test case, a key test code), the survey
Examination information is the test code that developer writes, and whether different this test information such as tests API for testing API
Often, if there are bug etc., test the content of information with no restrictions to this.
2, configuration platform is referred to as configuration center (Config Center), is said by taking configuration platform as an example herein
It is bright.Configuration platform is interacted with front-end interface, the SQL information inputted for receiving developer by front-end interface, at this
Ground stores SQL information, and SQL information is sent to service platform.
Wherein, configuration platform can also receive the test information that developer is inputted by front-end interface, and utilize the survey
The API that examination information is deployed to service server to service platform is tested;If being successfully tested, configuration platform can receive
SQL information;If test crash, configuration platform can refuse SQL information.
Wherein, after configuration platform obtains SQL information every time, so that it may which operation is recorded in the SQL information of previous version
Log, and store the SQL information of current version.Based on this, tested in the API for being deployed to service server to service platform
Afterwards, if being successfully tested, configuration platform can also delete previous version on the basis of receiving SQL information from operation log
SQL information;If test crash, configuration platform can also roll back on the basis of refusing SQL information according to operation log
The SQL information of previous version.
For example, configuration platform is when receiving SQL information 1 (i.e. the SQL information of version 1) for the first time, in local memory
Store SQL information 1;Configuration platform remembers SQL information 1 when receiving SQL information 2 (i.e. the SQL information of version 2) for the second time
Operation log is recorded, SQL information 1 is deleted from local memory, and stores SQL information 2 in local memory, and by SQL information 2
It is sent to service platform.
Service platform according to SQL information 2 generate API 2 after, configuration platform can also using test information to API2 into
Row test;If being successfully tested, configuration platform receives SQL information 2, and SQL information 1 is deleted from operation log;If test crash,
Then configuration platform refuses SQL information 2, i.e., SQL information 2 is deleted from local memory, and SQL information 1 is read from operation log,
And local memory is arrived into the storage of SQL information 1, and SQL information 1 is sent to service platform again, to realize returning for SQL information
Rolling.
Wherein, configuration platform can recorde developer in all operations of front-end interface, and store the letter of these operations
Breath.For example, SQL information and test information that developer inputs in front-end interface are exactly a kind of operation, configuration platform can be deposited
The SQL information and test information that storage developer inputs in front-end interface.
3, service platform is referred to as service centre (Service Center), carries out by taking service platform as an example herein
Explanation.Service platform is interacted with configuration platform, for receiving the SQL information of configuration platform offer, is generated according to SQL information
The API is deployed to service server by API, so that service server provides service according to API.In addition, service platform has school
Test function, function of white name list and dynamic release function.
Wherein, dynamic release function refers to: API can be deployed to service server after generating API by service platform,
So that service server provides service according to API, to realize dynamic release function.
Wherein, verifying function refers to:, can be with input validation number when developer inputs SQL information by front-end interface
According to, in order to distinguish conveniently, which is stated to be the first verification data (such as token information), service platform generate API
Afterwards, the corresponding first verification data of the API are recorded.Based on this, service platform after receiving the request message for the API,
Verification data are parsed from the request message, and in order to distinguish conveniently, which is stated to be the second verification data (such as
Token information etc.), and inquire the corresponding first verification data of the API.If the second verification data and the first verification data one
It causes, illustrates that the verification of the request message passes through, allow to handle the request message;If the second verification data and first check number
According to inconsistent, illustrate that the verification of the request message does not pass through, refuse the request message, and verification is prompted to mismatch.
Wherein, function of white name list refers to:, can be with input address when developer inputs SQL information by front-end interface
White list, the address white list may include the address range for being able to access that API, such as address field A and address field B, and service is flat
Platform can recorde the corresponding address white list of the API after generating API.Based on this, service platform is being received for the API
Request message after, source address can be parsed from the request message;If source address is located at the address white list, illustrate the source
Address meets the address challenges of the address white list, allows to handle the request message;If the source address is not located at the white name in the address
It is single, illustrate that source address does not meet the address challenges of the address white list, the request message can be refused, and does not prompt verification not
Match.
In one example, referring to shown in Fig. 1 C, service platform can also include a cache layer (Cache), and service is flat
Platform can carry out data storage by cache layer, to improve the response efficiency of API.For example, service platform can be in cache layer
Middle storage service data, in this way, service platform is after receiving request message, if cache layer has the request message corresponding
Business datum then directly obtains business datum from cache layer, and does not have to obtain business datum from database, to improve API
Response efficiency.If the not no corresponding business datum of the request message of cache layer, just obtains the request message pair from database
The business datum answered.
In one example, referring to shown in Fig. 1 D, service platform can also include data source adapter (for example,
DataBase-Adapter), service platform can format SQL statement by data source adapter, to adapt to
The type of database, and database is allowed to support the processing of SQL statement.
For example, there are the database 1 of MySQL type, the database 2 of Oracle type, PostgresQL type data
Library 3, if the corresponding database of API is the database 1 of MySQL type, service platform passes through data source adapter for SQL statement
The SQL statement of MySQL type is converted to, in this way, database 1 can be handled the SQL statement of MySQL type.If API
Corresponding database is the database 2 of Oracle type, then SQL statement is converted to Oracle type by data source adapter
SQL statement, in this way, database 2 can be handled the SQL statement of Oracle type, and so on.
4, service server.Service server is used to provide service for user, and user passes through access service server, so that it may
To obtain the business datum of itself needs, such as commodity sign, commodity price, commodity picture.
5, database.Database is used for storage service data, such as commodity sign, commodity price, commodity picture.Type is
MySQL type, Oracle type, PostgresQL type etc., it is without limitation.
It is shown in Figure 2 under above-mentioned application scenarios, for the process of the data transmission method proposed in the embodiment of the present application
Figure, this method can be applied to service platform, and this method may comprise steps of:
Step 201, service platform obtains SQL information.Wherein, SQL information can be changeable assembling.
Wherein, service platform obtains SQL information, and may include: service platform obtains SQL information, the SQL from configuration platform
Information is that user (such as developer) is input to configuration platform.
Referring to above-described embodiment, developer can log on to front-end interface, and input SQL information in the front-end interface,
The SQL information is the software code for being used to generate API that developer writes;Configuration platform can receive before developer passes through
The SQL information of interface input is held, and the SQL information is exported to service platform.Based on this, service platform can be from horizontalization
Platform gets the SQL information.
Step 202, service platform generates API according to the SQL information.
Wherein, which may include that the mark of database can when service platform generates API according to the SQL information
To generate the API for accessing the database, with no restrictions to this API generating process.For example, SQL information from database 1 for looking into
Ask the merchandise news that commodity price is less than parameter value, the then API generated according to the SQL information, just for inquiring from database 1
Commodity price is less than the merchandise news of parameter value.
Since service platform is to generate the API for accessing the database (such as database 1), service platform can also be with
The database 1 establishes connection, to pass through the connected reference database 1.In conclusion when creating an API, service platform
It first determines the corresponding database of the API, and is connect with the Database.
Wherein, an application can correspond to multiple API, for example, include API 1 and API2 using A, in order to by 1 He of API
API 2 is added to using A, then the SQL information can also include application identities (as applied A).Based on this, service platform is according to this
When SQL information generates API (being assumed to be API 1), it is determined that the API 1 belongs to using A, to being added to API 1 using A.
Similarly, when service platform generates API2 according to another SQL information, determine that API 2 belongs to using A, so that API 2 is added to
Using A.
Certainly, the above process has been merely given as the example that service platform generates API according to the SQL information, generates to this
Journey is with no restrictions, related with the content of SQL information, can generate API according to actual needs.
Step 203, service platform provides service using the API, that is, provides services to the user.
Wherein, service platform provides service using the API, may include: that service platform has the function of dynamic release, because
The API can be deployed to service server after generating API by this, so that service server provides service according to the API, and
User can access the service of API offer by client.
By above-mentioned processing, service platform can generate API according to SQL information, and in server disposition API, so that clothes
Device be engaged in using API offer service, SQL information is quickly converted into API service, and provide dynamic release function, quickening system is opened
Efficiency is sent out, there are the advantages such as smaller granularity, more light weight, faster.In the follow-up process, user can pass through the API Access
The service, is explained below.
Step 204, service platform receives the request message for being directed to the API, which is for accessing the service
Request message.
Wherein, when user accesses the service of API offer, user can be asked by client to service server transmission
Message is sought, which can carry parameter value to be checked, and such as 100 yuan.Service server can send out the request message
Service platform is given, then, service platform can receive the request message.
Step 205, service platform obtains business datum corresponding with the request message.
Wherein, service platform obtains business datum corresponding with the request message, may include: that service platform can be direct
Business datum corresponding with the request message is obtained from database;Alternatively, service platform can be whether there is in query caching
Business datum corresponding with the request message;If it is, business number corresponding with the request message can be obtained from caching
According to;If it is not, then business datum corresponding with the request message can be obtained from database, and the request is recorded in the buffer
The corresponding relationship of message and the business datum.
Service platform can record request message (such as take by request message in local cache (cache layer as shown in Figure 1 C)
The Data Identification of band) with the corresponding relationship of business datum.Based on this, service platform is after receiving the request message, Ke Yixian
Query caching layer whether there is business datum corresponding with the request message.If it exists, then service platform can be directly from caching
Layer obtains business datum corresponding with the request message, and does not have to obtain business number corresponding with the request message from database
According to so as to improve the response efficiency of API.If it does not exist, it is corresponding just to obtain the request message from database for service platform
Business datum.
In one example, service platform obtains business datum corresponding with the request message from database, can wrap
Include: service platform parses query argument from the request message, and generates SQL statement according to the query argument and the API, and
Business datum corresponding with the SQL statement is obtained from database.
For example, due to the merchandise news that API is less than parameter value for inquiring commodity price from database 1, and request to disappear
The parameter value that breath carries is 100 yuan, i.e. query argument is 100 yuan, therefore, can generate SQL according to the query argument and the API
Sentence inquires merchandise news of the commodity price less than 100 yuan such as from database 1.The SQL statement is being sent to database 1
Afterwards, database 1 can execute the SQL statement, and return to merchandise news of the commodity price less than 100 yuan, i.e. industry to service platform
Business data.
In one example, service platform obtains business datum corresponding with SQL statement from database, may include:
Service platform parses Database Identification from API, determines database corresponding with the Database Identification, SQL statement is converted to
The SQL statement that database is supported, and the SQL statement after conversion is sent to database.Service platform receives what database returned
Business datum corresponding with the SQL statement after conversion.
For example, due to including Database Identification in API, service platform can parse Database Identification from API,
And determine database corresponding with the Database Identification, such as database 1.Assuming that database 1 is the database 1 of MySQL type, then
SQL statement can be converted to the SQL statement of MySQL type by service platform, and the SQL statement of MySQL type is sent to number
According to library 1.Database 1 can execute the SQL statement of MySQL type after the SQL statement for receiving MySQL type, and to service
Platform returns to business datum corresponding with the SQL statement of the MySQL type, so that service platform receives the business datum.
After service platform generates API according to SQL information, the corresponding first verification data of the API can also be recorded.It is based on
This can parse the second verification data after service platform receives the request message for the API from the request message;
If the second verification data are consistent with the first verification data, the operation of business datum corresponding with request message is obtained;It is no
Then, refuse the request message, and verification is prompted to mismatch.
After service platform generates API according to SQL information, the corresponding address white list of the API can also be recorded;Wherein,
The address white list may include the address range for being able to access that the API.Based on this, service platform is being received for the API
Request message after, source address can also be parsed from the request message;If the source address is located at the address white list,
Available business datum corresponding with the request message;If the source address is not located at the address white list, can refuse to ask
Message is sought, and verification is prompted to mismatch.
Step 206, service platform returns to the response message for being directed to the request message, which carries the business number
According to.For example, service platform returns to the response message to service server, and service server can return to the response message
User so far completes data transmission procedure so that business datum is returned to user.
In one example, above-mentioned execution sequence is intended merely to facilitate description to provide example, in practical applications,
Sequence is executed between can also changing the step, with no restrictions to this execution sequence.Moreover, in other embodiments, and it is different
The fixed sequence for showing and describing according to this specification is come the step of executing correlation method, step included by method can be than this
It is more or less described in specification.In addition, single step described in this specification, it in other embodiments may quilt
Multiple steps are decomposed into be described;Multiple steps described in this specification may also be merged into other embodiments
Single step is described.
It is shown in Figure 3 under above-mentioned application scenarios, it is the another of the data transmission method proposed in the embodiment of the present application
Flow chart, this method can be applied to configuration platform, and this method may comprise steps of:
Step 301, configuration platform obtains SQL information, which is that user (such as developer) is input to configuration platform
's.Referring to above-described embodiment, developer can log on to front-end interface, and input SQL information, the SQL in the front-end interface
Information is the software code for being used to generate API that developer writes;Based on this, configuration platform can receive developer and pass through
The SQL information of front-end interface input.
Step 302, which is sent to service platform by configuration platform, so that service platform is raw according to the SQL information
At API, service is provided using the API, and business datum is sent according to the API.
Wherein, SQL information can be changeable assembling, and SQL information changeable assembling process stream is sent to by configuration platform
Service platform.
In one example, configuration platform can also obtain test information, as developer is inputed to by front-end interface
The test information of configuration platform, the test information are the codes for being tested API that developer writes.Then, match
Horizontalization platform is tested using the API that the test information is deployed to service server to service platform;If being successfully tested, receive
SQL information;If test crash, refuse SQL information.
Wherein, after configuration platform obtains SQL information every time, so that it may which operation is recorded in the SQL information of previous version
Log, and store the SQL information of current version.Based on this, tested in the API for being deployed to service server to service platform
Afterwards, if being successfully tested, configuration platform can also delete previous version on the basis of receiving SQL information from operation log
SQL information;If test crash, configuration platform can also roll back on the basis of refusing SQL information according to operation log
The SQL information of previous version.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of data transmission device, can be with
It is shown in Figure 4 applied to service platform, it is the structure chart of described device, described device includes:
Receiving module 401, for receiving the request message for being directed to application programming interfaces API;
Wherein, the API is to be generated according to structured query language SQL information, and provide service using the API,
The request message is the request message for accessing the service;
Module 402 is obtained, for obtaining business datum corresponding with the request message;
Sending module 403, for returning to the response message for being directed to the carrying business datum of the request message.
The acquisition module 402 is specifically used for when obtaining business datum corresponding with the request message:
Business datum corresponding with the request message is obtained from database;Alternatively,
It whether there is business datum corresponding with the request message in query caching;If so, from caching obtain with
The corresponding business datum of the request message;If not, business datum corresponding with the request message is obtained from database,
The corresponding relationship of the request message Yu the business datum is recorded in the buffer.
The acquisition module 402 is specifically used when obtaining business datum corresponding with the request message from database
In: from the request message parse query argument;SQL statement is generated according to the query argument and the API;From the number
According to acquisition business datum corresponding with the SQL statement in library;
The acquisition module 402 is specifically used for when obtaining business datum corresponding with the SQL statement from database:
Database Identification is parsed from the API, determines database corresponding with the Database Identification;The SQL statement is converted
The SQL statement supported for the database;SQL statement after conversion is sent to the database;The database is received to return
The business datum corresponding with the SQL statement after conversion returned.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of service platform, comprising: processing
Device and machine readable storage medium are stored with several computer instructions on the machine readable storage medium, and the processor is held
It is handled as follows when the row computer instruction:
The request message for being directed to application programming interfaces API is received, and obtains business datum corresponding with the request message;
Wherein, the API is to be generated according to structured query language SQL information, and provide service, the request using the API
Message is the request message for accessing the service;
The response message for being directed to the request message is returned to, the response message carries the business datum.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of machine readable storage medium,
Several computer instructions are stored on the machine readable storage medium, the computer instruction is performed to be located as follows
Reason: the request message for being directed to application programming interfaces API is received, and obtains business datum corresponding with the request message;Wherein,
The API is to be generated according to structured query language SQL information, and provide service using the API, and the request message is
For accessing the request message of the service;
The response message for being directed to the request message is returned to, the response message carries the business datum.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of data transmission device, can be with
It is shown in Figure 5 applied to configuration platform, it is the structure chart of described device, described device includes:
Module 501 is obtained, for obtaining structured query language SQL information;
Sending module 502, for the SQL information to be sent to service platform, so that service platform is raw according to SQL information
At API, service is provided using the API, and business datum is sent according to the API.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of configuration platform, processor and
Machine readable storage medium, several computer instructions are stored on the machine readable storage medium, and the processor executes institute
It is handled as follows when stating computer instruction: obtaining SQL information;The SQL information is sent to service platform, so that service is flat
Platform generates application programming interfaces API according to the SQL information, provides service using the API, and send industry according to the API
Business data.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of machine readable storage medium,
Several computer instructions are stored on the machine readable storage medium, the computer instruction is performed to be located as follows
Reason: SQL information is obtained;The SQL information is sent to service platform, so that service platform generates API, benefit according to SQL information
Service is provided with API, and business datum is sent according to API.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit can be realized in the same or multiple software and or hardware when application.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes computer usable program code that the embodiment of the present application, which can be used in one or more,
The computer implemented in computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of program product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It is generally understood that being realized by computer program instructions each in flowchart and/or the block diagram
The combination of process and/or box in process and/or box and flowchart and/or the block diagram.It can provide these computer journeys
Sequence instruct to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor with
A machine is generated, so that the instruction generation executed by computer or the processor of other programmable data processing devices is used for
Realize the dress for the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram
It sets.
Moreover, these computer program instructions also can store be able to guide computer or other programmable datas processing set
In standby computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates
Manufacture including command device, the command device are realized in one process of flow chart or multiple processes and/or block diagram one
The function of being specified in a box or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing devices, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer
Or the instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram
The step of function of being specified in one box or multiple boxes.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art
For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal
Replacement, improvement etc., should be included within the scope of the claims of this application.
Claims (17)
1. a kind of data transmission method, which is characterized in that be applied to service platform, which comprises
The request message for being directed to application programming interfaces API is received, and obtains business datum corresponding with the request message;Its
In, the API is to be generated according to structured query language SQL information, and provide service using the API, and the request disappears
Breath is the request message for accessing the service;
The response message for being directed to the request message is returned to, the response message carries the business datum.
2. the method according to claim 1, wherein
It is described to obtain business datum corresponding with the request message, comprising:
Business datum corresponding with the request message is obtained from database;Alternatively,
It whether there is business datum corresponding with the request message in query caching;If so, from caching obtain with it is described
The corresponding business datum of request message;If not, business datum corresponding with the request message is obtained from database, slow
Deposit the middle corresponding relationship for recording the request message Yu the business datum.
3. according to the method described in claim 2, it is characterized in that,
It is described that business datum corresponding with the request message is obtained from database, comprising:
Query argument is parsed from the request message;
SQL statement is generated according to the query argument and the API;
Business datum corresponding with the SQL statement is obtained from database.
4. according to the method described in claim 3, it is characterized in that,
It is described to obtain business datum corresponding with the SQL statement from the database, comprising:
Database Identification is parsed from the API, and determines database corresponding with the Database Identification;
The SQL statement is converted into the SQL statement that the database is supported;
SQL statement after conversion is sent to the database;
Receive the business datum corresponding with the SQL statement after conversion that the database returns.
5. the method according to claim 1, wherein the method also includes:
After generating API according to SQL information, the corresponding first verification data of the API are recorded;
Described receive is directed to after the request message of API, and the second verification data are parsed from the request message;If described
Two verification data are consistent with the first verification data, then execute the behaviour for obtaining business datum corresponding with the request message
Make;Otherwise, refuse the request message, and verification is prompted to mismatch.
6. the method according to claim 1, wherein the method also includes:
After generating API according to SQL information, the corresponding address white list of the API is recorded;Wherein, the address white list
Address range including being able to access that the API;
Described receive is directed to after the request message of API, parses source address from the request message;If the source address position
In the address white list, then the operation for obtaining business datum corresponding with the request message is executed;Otherwise, it is asked described in refusal
Message is sought, and verification is prompted to mismatch.
7. the method according to claim 1, wherein the method also includes:
SQL information is obtained from configuration platform, the SQL information is that user is input to the configuration platform.
8. the method according to claim 1, wherein
It is described to provide service using the API, comprising:
The API is deployed to service server, so that service server provides service according to the API.
9. a kind of data transmission method, which is characterized in that be applied to configuration platform, which comprises
Obtain structured query language SQL information;
The SQL information is sent to service platform, so that service platform generates application programming interfaces according to the SQL information
API provides service using the API, and sends business datum according to the API.
10. according to the method described in claim 9, it is characterized in that,
It is described the SQL information is sent to service platform after, the method also includes:
Obtain test information;
It is tested using the API that the test information is deployed to service server to the service platform;
If being successfully tested, receive the SQL information;
If test crash, refuse the SQL information.
11. according to the method described in claim 10, it is characterized in that, the method also includes:
After the acquisition SQL information, operation log is recorded in the SQL information of previous version;
After the receiving SQL information, the SQL information of previous version is deleted from operation log;
After the refusal SQL information, the SQL information of previous version is rolled back to according to operation log.
12. a kind of data transmission device, which is characterized in that be applied to service platform, described device includes:
Receiving module, for receiving the request message for being directed to application programming interfaces API;
Wherein, the API is to be generated according to structured query language SQL information, and provide service using the API, described
Request message is the request message for accessing the service;
Module is obtained, for obtaining business datum corresponding with the request message;
Sending module, for returning to the response message for being directed to the carrying business datum of the request message.
13. device according to claim 12, which is characterized in that
The acquisition module is specifically used for when obtaining business datum corresponding with the request message:
Business datum corresponding with the request message is obtained from database;Alternatively,
It whether there is business datum corresponding with the request message in query caching;If so, from caching obtain with it is described
The corresponding business datum of request message;If not, business datum corresponding with the request message is obtained from database, slow
Deposit the middle corresponding relationship for recording the request message Yu the business datum.
14. device according to claim 13, which is characterized in that
The acquisition module is specifically used for when obtaining business datum corresponding with the request message from database: from described
Query argument is parsed in request message;SQL statement is generated according to the query argument and the API;It obtains from the database
Take business datum corresponding with the SQL statement;
The acquisition module is specifically used for when obtaining business datum corresponding with the SQL statement from database: from described
Database Identification is parsed in API, and determines database corresponding with the Database Identification;The SQL statement is converted into institute
State the SQL statement of database support;SQL statement after conversion is sent to the database;Receive what the database returned
Business datum corresponding with the SQL statement after conversion.
15. a kind of data transmission device, which is characterized in that be applied to configuration platform, described device includes:
Module is obtained, for obtaining structured query language SQL information;
Sending module is applied for the SQL information to be sent to service platform so that service platform is generated according to SQL information
Routine interface API provides service using API, and sends business datum according to API.
16. a kind of service platform characterized by comprising processor and machine readable storage medium, the machine readable storage
Several computer instructions are stored on medium, the processor is handled as follows when executing the computer instruction: receiving needle
To the request message of application programming interfaces API, and obtain business datum corresponding with the request message;Wherein, the API is
It is generated according to structured query language SQL information, and provides service using the API, the request message is for accessing
The request message of the service;
The response message for being directed to the request message is returned to, the response message carries the business datum.
17. a kind of configuration platform characterized by comprising processor and machine readable storage medium, the machine readable storage
Several computer instructions are stored on medium, the processor is handled as follows when executing the computer instruction: obtaining knot
Structure query language SQL information;The SQL information is sent to service platform, so that service platform is raw according to the SQL information
At application programming interfaces API, service is provided using the API, and business datum is sent according to the API.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810342332.6A CN110392068B (en) | 2018-04-17 | 2018-04-17 | Data transmission method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810342332.6A CN110392068B (en) | 2018-04-17 | 2018-04-17 | Data transmission method, device and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110392068A true CN110392068A (en) | 2019-10-29 |
CN110392068B CN110392068B (en) | 2022-06-21 |
Family
ID=68283066
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810342332.6A Active CN110392068B (en) | 2018-04-17 | 2018-04-17 | Data transmission method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110392068B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110825388A (en) * | 2019-11-15 | 2020-02-21 | 中科院计算技术研究所大数据研究院 | Method for directly converting SQL statement into corresponding REST interface |
CN112256452A (en) * | 2020-10-21 | 2021-01-22 | 上海商汤智能科技有限公司 | Service item determination method, device, equipment and storage medium of cloud service platform |
CN112328917A (en) * | 2020-11-04 | 2021-02-05 | 浪潮云信息技术股份公司 | SQL (structured query language) writing oriented method for generating http interface service and data display page |
CN112650481A (en) * | 2020-12-23 | 2021-04-13 | 航天信息股份有限公司 | Method and system for processing data |
CN112947984A (en) * | 2020-09-29 | 2021-06-11 | 深圳市明源云科技有限公司 | Application program development method and device |
WO2022048676A1 (en) * | 2020-09-07 | 2022-03-10 | 华为云计算技术有限公司 | Api generation method and apparatus |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103475517A (en) * | 2013-09-04 | 2013-12-25 | 青岛海信宽带多媒体技术有限公司 | Optical network terminal equipment and hardware configuration parameter saving method thereof |
CN103593443A (en) * | 2013-11-18 | 2014-02-19 | 南京新模式软件集成有限公司 | Method for electronic file metadata expansion |
CN104168333A (en) * | 2014-09-01 | 2014-11-26 | 广东电网公司信息中心 | Working method of PROXZONE service platform |
CN105677875A (en) * | 2016-01-11 | 2016-06-15 | 清华大学 | Visual modeling platform based on unified constraint of normal data elements |
CN106874371A (en) * | 2016-12-30 | 2017-06-20 | 新华三技术有限公司 | A kind of data processing method and device |
CN107222542A (en) * | 2017-06-08 | 2017-09-29 | 东华大学 | A kind of construction method of cloud service management system |
CN107329900A (en) * | 2017-07-06 | 2017-11-07 | 携程计算机技术(上海)有限公司 | The method for generating test data |
-
2018
- 2018-04-17 CN CN201810342332.6A patent/CN110392068B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103475517A (en) * | 2013-09-04 | 2013-12-25 | 青岛海信宽带多媒体技术有限公司 | Optical network terminal equipment and hardware configuration parameter saving method thereof |
CN103593443A (en) * | 2013-11-18 | 2014-02-19 | 南京新模式软件集成有限公司 | Method for electronic file metadata expansion |
CN104168333A (en) * | 2014-09-01 | 2014-11-26 | 广东电网公司信息中心 | Working method of PROXZONE service platform |
CN105677875A (en) * | 2016-01-11 | 2016-06-15 | 清华大学 | Visual modeling platform based on unified constraint of normal data elements |
CN106874371A (en) * | 2016-12-30 | 2017-06-20 | 新华三技术有限公司 | A kind of data processing method and device |
CN107222542A (en) * | 2017-06-08 | 2017-09-29 | 东华大学 | A kind of construction method of cloud service management system |
CN107329900A (en) * | 2017-07-06 | 2017-11-07 | 携程计算机技术(上海)有限公司 | The method for generating test data |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110825388A (en) * | 2019-11-15 | 2020-02-21 | 中科院计算技术研究所大数据研究院 | Method for directly converting SQL statement into corresponding REST interface |
WO2022048676A1 (en) * | 2020-09-07 | 2022-03-10 | 华为云计算技术有限公司 | Api generation method and apparatus |
CN112947984A (en) * | 2020-09-29 | 2021-06-11 | 深圳市明源云科技有限公司 | Application program development method and device |
CN112947984B (en) * | 2020-09-29 | 2024-05-14 | 深圳市明源云科技有限公司 | Application program development method and device |
CN112256452A (en) * | 2020-10-21 | 2021-01-22 | 上海商汤智能科技有限公司 | Service item determination method, device, equipment and storage medium of cloud service platform |
CN112328917A (en) * | 2020-11-04 | 2021-02-05 | 浪潮云信息技术股份公司 | SQL (structured query language) writing oriented method for generating http interface service and data display page |
CN112650481A (en) * | 2020-12-23 | 2021-04-13 | 航天信息股份有限公司 | Method and system for processing data |
Also Published As
Publication number | Publication date |
---|---|
CN110392068B (en) | 2022-06-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110392068A (en) | A kind of data transmission method, device and its equipment | |
CN110046023B (en) | Data processing method and system based on intelligent contract of block chain | |
CN104683386B (en) | The stake service implementing method and device of customizable response | |
US11537606B2 (en) | Solution for implementing computing service based on structured query language statement | |
US20140215446A1 (en) | Automated Porting of Application to Mobile Infrastructures | |
CN110009321B (en) | Transfer method and system based on block chain intelligent contract | |
US20180253503A1 (en) | Method, Apparatus and System for Preloading of APP Launch Advertising | |
CN109933404B (en) | Encoding and decoding method and system based on block chain intelligent contract | |
CN112463634B (en) | Software testing method and device under micro-service architecture | |
CN115917553A (en) | Entity-level data augmentation to enable robust named entity recognition in chat robots | |
CN110162526A (en) | Querying method, device and the equipment of data record in a kind of piece of chain type account book | |
US20210319360A1 (en) | Fast and scalable multi-tenant serve pool for chatbots | |
CN110046991B (en) | Data processing method and system based on intelligent contract of block chain | |
CN110019444B (en) | Operation request processing method, device, equipment and system | |
CN112395363A (en) | Data synchronization method, device, equipment and readable storage medium | |
US10268779B2 (en) | Sharing server conversational context between multiple cognitive engines | |
CN111881216A (en) | Data acquisition method and device based on shared template | |
US10997963B1 (en) | Voice based interaction based on context-based directives | |
US11289076B2 (en) | Assisting meeting participants via conversation loop detection and resolution using conversation visual representations and time-related topic usage | |
CN111612135A (en) | Method and device for information interaction | |
WO2023216857A1 (en) | Multi-agent chatbot with multi-intent recognition | |
US10657692B2 (en) | Determining image description specificity in presenting digital content | |
CN115328997B (en) | Data synchronization method, system, device and storage medium | |
CN110827037A (en) | Data interaction method and device based on block chain | |
US20190163830A1 (en) | Customer service advocacy on social networking sites using natural language query response from site-level search results |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |