The content of the invention
For correlation technique when different terminals carries out data processing from different language servers, it is necessary to define not
With interface, take considerable time and the problem of human cost, not yet propose effective solution.For the main of this present invention
Purpose is to provide a kind of data processing method and device to solve the above problems.
To achieve these goals, according to an aspect of the invention, there is provided a kind of data processing method.This method bag
Include:Obtain the first communication request that terminal is sent;Core library is called according to the first communication request, language clothes are obtained in core library
Second communication request of the corresponding identification of business device;Second communication request is sent to language server;Obtain by language server
The first file for according to the second communication request get after operation processing, wherein, the first file is included after operation processing
Obtained result;Reorganization is carried out according to the first file, to obtain the second file recognized corresponding to terminal;To terminal
Send the second file.
Further, before the first communication request that terminal is sent is obtained, method also includes:Defining interface parameter, its
In, interface parameters includes URI addresses, types of variables, variable name and access modifier.
Further, the step of the first communication request for obtaining terminal transmission, includes:Calling interface parameter;Terminal is obtained to press
The parameter of the first communication request inputted according to interface parameters, to obtain the first communication request.
Further, the parameter of the first communication request includes URI addresses, types of variables, variable name and access modifier,
Wherein, core library is called according to the first communication request received, to obtain the recognized corresponding to language server second communication
The step of request, includes:Core library is called to be spliced to the parameter of the first communication request and transformation of ownership processing, to obtain language clothes
Second communication request of the corresponding identification of business device.
Further, conversion process is carried out to the first communication request received, known with obtaining corresponding to language server
The step of other second communication request, includes:Conversion process is carried out to the first communication request, to obtain corresponding to language server
3rd communication request of identification;3rd communication request is encrypted, to obtain the second communication request.
There is provided a kind of data processing equipment according to another aspect of the present invention.The device includes:First acquisition module,
The first communication request for obtaining terminal transmission;First transfers module, for calling core library according to the first communication request,
The second communication request of the corresponding identification of language server is obtained in core library;First sending module, for the second communication to be asked
Ask and be sent to language server;Second acquisition module, is operated for obtaining by language server according to the second communication request
The first file got after processing, wherein, the first file includes the result obtained after operation is handled;Recombination module,
For carrying out reorganization according to the first file, to obtain the second file recognized corresponding to terminal;Second sending module, is used for
The second file is sent to terminal.
Further, device also includes:First processing module, for defining interface parameter, wherein, interface parameters includes
URI addresses, types of variables, variable name and access modifier.
Further, the first acquisition module includes:Second transfers module, for calling interface parameter;3rd acquisition module,
Parameter for obtaining the first communication request that terminal is inputted according to interface parameters, to obtain the first communication request.
Further, first transfer module and include:Second processing module, for calling core library to the first communication request
Parameter carries out splicing and transformation of ownership processing, to obtain the second communication request recognized corresponding to language server.
Further, recombination module also includes:First modular converter, for carrying out conversion process to the first communication request,
The 3rd communication request recognized with obtaining corresponding to language server;Encrypting module, for the 3rd communication request to be encrypted
Processing, to obtain the second communication request.
Data processing method and device that the present invention is provided, by calling core library, the request of different terminals is transformed into
The request of the corresponding identification of different language server, it is right that the file after then language server is handled is converted into different terminals institute
The file that should be recognized, is solved in the prior art when different terminals carries out data processing from different language servers, need to
Different interfaces are defined, the Related Technical Issues with human cost are taken considerable time, realized in multiple terminals different language
When carrying out data processing between multi-platform different language, the time of exploitation and the effect of human cost are saved.
Embodiment
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the application can phase
Mutually combination.Describe the present invention in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is the flow chart of the data processing method according to the present invention.As shown in figure 1, the data processing method is included such as
Lower step:
Step S102, obtains the first communication request that terminal is sent.
Step S104, core library is called according to the first communication request, to obtain recognized corresponding to language server second
Communication request.
Step S106, language server is sent to by the second communication request.
Step S108, is obtained by language server according to first got after the progress operation processing of the second communication request
File, wherein, the first file includes the result obtained after operation is handled.
Step S110, carries out reorganization, to obtain the second file recognized corresponding to terminal according to the first file.
Step S112, the second file is sent to terminal.
The data processing method provided using the application, by obtaining the first communication request that terminal is sent, then basis
The first communication request received calls core library, after the second communication request recognized corresponding to language server is obtained,
Second communication request is sent to language server, after language server is handled according to the second communication request, language is obtained
Say the first file returned after server process and reorganization is carried out to it, by the recognized corresponding to terminal after restructuring second text
Part is sent to terminal, to realize the data processing of terminal and language server.The method for the data processing that the application is provided, passes through
Core library is called, the request of different terminals is transformed into the request recognized corresponding to different language server, then language is taken
File after business device processing is converted into the file of the corresponding identification of different terminals, solve in the prior art different terminals with
, it is necessary to define different interfaces when different language servers carries out data processing, the phase with human cost is taken considerable time
Technical problem is closed, when realizing the progress communication process between multiple terminals different language and multi-platform different language, exploitation is saved
Time and human cost effect.
Wherein, operation processing can include:Download process, read-write processing, renewal processing and interaction process etc..
Fig. 2 is the schematic flow sheet of the data processing method according to Fig. 1.Fig. 3 is the data processing according to Fig. 2
The structural representation of method.Fig. 4 is the structural representation of the core library of the data processing method according to Fig. 2.
As shown in Figure 2, Figure 3 and Figure 4, a set of Middle Ware SDK are present embodiments provided(That is Software
Development Kit)Software development kit, then defines a set of interface parameters and writes Core Libraries storehouses(That is core
Heart storehouse).Using the different terminals of different programming languages, required parameter is inputted according to above-mentioned interface parameters(I.e. in above-described embodiment
The first communication request), the storehouse method in Core Libraries is called by SDK, above-mentioned required parameter is transformed into difference
The request that language server can be recognized, i.e., the second communication request in above-described embodiment then please by second communication
Ask and be sent to language server;After language server handles second communication request, the first file that processing is obtained is sent out
Middleware SDK is given, middleware SDK calls core library the second file of restructuring and the return terminal good with terminal definitions can be recognized
Xml texts or Json character strings the second file, it is possible to binding carries related digital content.Specifically, this method bag
Include following steps:
(1)When terminal need with different language server carry out data processing when, to middleware software kit send into
First communication request of row data processing.Specifically, terminal calls Middle Ware SDK(That is middleware software kit)In
Interface parameters, then according to interface parameters write input the first communication request parameter.Wherein, parameter can include parameter class
Type, number of parameters and parameter name.Such as:Scheme, domain(That is domain), port(That is port numbers), path(That is language server
Item Path), querystring etc..
Specifically, Middle Ware SDK can be embedded in the application and development IDE of terminal(Integrated
Develop Environment, i.e. IDE)In.
(2)Middleware software kit receives the first communication request that different language terminal is sent, wherein, such as Fig. 2, Fig. 3
And shown in Fig. 4, different language terminal including the use of JAVA language Andriod terminals, use Objective-c language
Ios terminals, the Symbian using C/C++ language and the WindowsPhone using C# language.
(3)The request that middleware software kit sends different language terminal turns according to the language server of different language
Change its second communication request that can be recognized into, wherein, the second communication request can be HTTP Requst or other Content-
Type Requst requests, different language server includes PHP language servers, Java language clothes as shown in Figures 2 and 3
Business device and Asp.Net language servers.
Specifically, middleware software kit, can be defeated to terminal by calling the storehouse method in Core Libraries
The various parameters entered and the various interface methods called are changed, to cause ginseng that the IDE of different language terminals is inputted
The language codes that the number transformation of ownership can be supported into language server, so that language server is responded.
(4)The second communication request that different language servers can be recognized is sent to each by middleware software kit
Language server.
(5)After language server has handled the second communication request, xml texts or Json string formats are returned
First file gives middleware software kit.
Wherein, when the language server of different language, receive by the middleware SDK transformations of ownership Lai language server can know
After other terminal request, language server carries out inter-process to the request, then by the xml texts or Json words after processing
Symbol is gone here and there to terminal, if including digital content in the file after processing, can be carried corresponding digital content and be returned to terminal.
(6)Language server return text by middleware SDK by calling core library to handle the first file,
It can be the text for reorganizing xml or Json string formats, reconsolidate xml father and son's number of plies and each node
Value, then returns to terminal by the second file after processing.For example, when being changed to xml, parameter and language server are returned
The description of response may refer to Tables 1 and 2.
Node identification |
Father node is identified |
Quantity |
Type |
Description |
Response |
XHRDBOSS |
1 |
|
Response results |
RspCode |
Response |
1 |
String<10Bytes> |
Response coding |
RspDesc |
Response |
1 |
String<500Bytes> |
Response description |
IsSucuess |
XHRDBOSS |
1 |
String<10Bytes> |
Whether operation succeeds |
The return parameters of table 1
RspCode |
RspDesc |
Description |
200 |
Operate successfully |
|
400 |
Parameter is illegal or not enough |
|
401 |
Search the error of member's bound device |
|
402 |
Terminal does not bind member |
|
403 |
Order is not present |
|
405 |
Order has succeeded |
|
600 |
Other |
|
The serve port of table 2 returns to response coding and response description
Preferably, core library can include interface encapsulation layer.
According to above-described embodiment of the application, before the first communication request that terminal is sent is obtained, this method can be with
Including:Defining interface parameter, wherein, interface parameters includes URI addresses, types of variables, variable name and access modifier.
In above-described embodiment of the application, obtain terminal send the first communication request the step of can include:Call
Interface parameters;The parameter for the first communication request that terminal is inputted according to interface parameters is obtained, to obtain the first communication request.
According to above-described embodiment of the application, the parameter of the first communication request can include URI addresses, types of variables, change
Name and access modifier are measured, wherein, core library is called according to the first communication request received, can to obtain language server
The step of with the second communication request of identification, includes:Call core library the parameter of the first communication request is spliced and the transformation of ownership at
Reason, to obtain the second communication request that language server can be recognized.
Wherein, in above-described embodiment of the application, conversion is carried out to URI requests and comprised the following steps:
(a)When the different language of different terminals is sent out by code asks, it can be inputted according to the interface parameters defined
Parameter, specifically, the call method input parameter in the IDE of client:The GET/POST modes of request, scheme, IP address,
Port numbers, platform project path, the father node of request is represented, the child node asked is represented, the set membership number of plies, required parameter class
Type, required parameter title and required parameter number.(b)Core Libararies are called by middleware software bag(That is core
Storehouse), the splicing and the transformation of ownership of character string are carried out, so as to generate URI addresses in the middle of one.For example:baseURL=http://
219.141.223.61:7001/web request:
Get
baseURL/boss/rechargeCallBack.do?method=callback&ExchangeId=1&Money=
1&TerminalSpec=1&TerminalId=1& Status=1&Remark=1
In above-mentioned request, mono- parameter of baseURL is not only needed, in addition it is also necessary to such as ExchangeId, TerminalId
Etc. other specification.Such as " finalUrl=finalString.put in interface parameters in calling core library(" ExchangeId ", "
170936”);" method these scattered character strings can just be spelled with input parameter, then by calling the method in core library
It is connected into interface that is that language server can be recognized and providing.So, terminal and language server are all compiled according to interface parameters
Write, the time can be saved, improve the efficiency of data processing.
In the above method embodiment of the application, the method changed to variable comprises the following steps:By calling
Core Libararies in SDK, can be by inputting the types of variables newly defined, variable name, and middleware SDK is according to input
The types of variables of new definition, variable name can generate the variable form of multi-platform support, and adaptive language server
Literary style difference.
In above-described embodiment of the application, conversion is carried out to method and class and comprised the following steps:By calling in SDK
Core Libararies, it is only necessary to the access modifier for the method that input is newly defined, return Value Types, method name, method input
Business logic in parameter type, parameter name and method, SDK can generate multiple different language servers according to above-mentioned parameter
The method content format of support, and the demand of adaptive multiple language servers.
For example:Middleware SDK receives following parameter, " access modifier ", " return value ", " method name ", " incoming value ",
" incoming Value Types ", " whether static ".
Objective-C:
-(void)insertObject:(id)anObject atIndex:(NSInteger)index
(1)Method modifier
- to represent the method be instance method, it is necessary to class example is first generated, this method can just be called by example.
+ static method that the method is class is represented, it can directly invoke, and without generating class example.
(2)Parameter type
Id and NSInteger is two parameters anObject and index type respectively.
(3)Method signature
In this example, insertObject and atIndex constitute the signature keyword of this method.
It is exemplified below herein:
Correspond to respectively:<Modifier><Return type><Name>(<Parameter list>)<Method block>
Different terminals are according to middleware SDK interface parameters by the incoming centre of parameter in the identical method of different language
In part SDK, middleware SDK calls core library that above-mentioned parameter is converted into the language form that different language platform can be recognized.
According to the above-mentioned data processing method embodiment of the application, before the first communication request that terminal is sent is obtained,
Method can also include:Judge that current network conditions whether there is WIFI network server according to interface parameters, wherein, if worked as
There is WIFI network server in preceding network environment, then data processing is carried out by WIFI network;If in current network conditions
In the absence of WIFI network server, then carry out there is currently no the pop-up feedback of WIFI network server.
Specifically, by calling the interface parameters in Middle Ware SDK kits, judge that current network environment is
It is no to there is WIFI network server, in the case where there is WIFI network server, carried out data transmission by WIFI network;
In the case of in the absence of WIFI network server, the pop-ups such as Toast or Alert Dialog are carried out to this request and fed back, with
WIFI network server is not present into terminal notifying current network conditions, whether terminal check is asked in the feelings without WIFI network
Proceed data transfer under condition.The current chamber of commerce that runed in mobile Internet application, when carrying out data transmission is according to transmission
3G/4G flows are deducted fees.Sometimes terminal needs the transmission of large capacity digital file content with language server, can so produce
Substantial amounts of 3G/4G flows, thus can bring it is substantial amounts of deduct fees, but operator will not be to WIFI flow chargings.The number of the application
According to processing method embodiment before by Middle Ware SDK conversion functional module, the request of terminal is changed,
Also include judging the step of current network environment whether there is WIFI network server, if so in current network existed
WIFI network and terminal is carried out data transmission by WIFI network, can greatly save 3G/4G flows, and then reduce flow
Deduct fees.
In above-described embodiment of the application, the step of calling interface parameter after, this method can also include:According to
Interface parameters is carried out data transmission by the transmission means of multithreading or hyperthread;Or according to the transmission side of multithreading or hyperthread
Formula is carried out data transmission by way of breakpoint transmission.
Specifically, in data transfer, terminal, can by using the modular approach in Middle Ware SDK kits
To choose whether addition Multi-Thread Download(Multithreading)Mode is downloaded;For configuring higher language service
Device, it is also an option that Hyper Threading Download(Hyperthread)Mode is downloaded.Language server generally simultaneously with it is many
Individual terminal connection, different terminals share bandwidth, if the priority of N number of user terminal is all identical, then each user's connection
Actual bandwidth on to the language server is exactly N/mono- of language server bandwidth.In above-described embodiment of the application,
The multithreading or the downloading mode of hyperthread provided during by carrying out data transmission, improves the download speed of overall digital file
Degree.
Specifically, in another embodiment of the method for the application, user is carrying out data according to multithreading or hyperthread
During transmission, it can be carried out data transmission by the breaker point continuous transmission method provided in Middle Ware SDK.For example, in client
When software FTP is downloaded or uploaded, task will be downloaded or uploaded(Such as:One file or a compressed package)Man-made division is several
Subdata bag, each subdata bag is uploaded or downloaded using a thread, when network failure, can continue on
The subdata bag for having begun to upload or downloading is passed or downloads, without the necessary upload or download for restarting whole task.
The time of data transfer can be so saved, the speed of data transfer is improved.
Preferably, in Middle Ware SDK, also reserve promising language server and CDN is provided(That is Content
Delivery Network, i.e. content distributing network)The interface method of acceleration.By calling the method, language service can be made
Device increases by one layer of new network architecture in existing Internet, and the content of website is published into the network closest to user
" edge ", such user can obtain required content nearby, improve the response speed that user accesses website.In Middle
Ware SDK provide CDN interface method for language server, can technically comprehensively solve because the network bandwidth is small, user
The problems such as websites response speed that visit capacity is big, network point distribution is uneven and brings is slow, improves the response speed that user accesses website
Degree.
According to the embodiment of the above method of the application, conversion process is carried out to the first communication request received, to obtain
The step of the second communication request for taking language server to recognize, can also include:First communication request is carried out at conversion
Reason, to obtain the 3rd communication request that language server can be recognized;3rd communication request is encrypted, to obtain
Two communication requests.
Specifically, when opening terminal the first communication request of transmission, for security reasons, connecing for middleware SDK is passed through
Mouth parameter is right after the 3rd communication request that conversion process acquisition language server can be recognized is carried out to the first communication request
The character string of 3rd communication request carries out MD5 or DRM encryptions to form the second communication request.Preferably, returned in language server
In the case that the first file returned has the limitation of digital publishing rights, the first file can be carried out by Middle Ware SDK
DRM is encrypted, to ensure the confidentiality of copyright.Wherein, the first communication request can be the character string of http request.Preferably, eventually
It can be the communication request after encryption to hold the first communication request being sent on middleware, and middleware communicates first after encryption
Request decryption, is then changed to the communication request after the decryption to obtain the 3rd communication request, afterwards please by the 3rd communication
Ask encryption to obtain the second communication request, finally the second communication request is sent on language server.
Preferably, as shown in Figures 2 and 3, above-described embodiment of the application is also provided under the judgement of WIFI environment, multithreading
Load, breakpoint transmission, CDN accelerate and digital document other enhancing functions such as encryption safely, make the information of communications faster, more
Safety, it is more humane.
It should be noted that can be in such as one group computer executable instructions the step of the flow of accompanying drawing is illustrated
Performed in computer system, and, although logical order is shown in flow charts, but in some cases, can be with not
The order being same as herein performs shown or described step.
Fig. 5 is the structural representation of the data processing equipment according to the application.Fig. 6 is the data processing equipment according to Fig. 4
Structural representation.
As shown in Figure 5 and Figure 6, the device includes:First acquisition module 10, the first communication for obtaining terminal transmission please
Ask;First transfers module 30, for calling core library according to the first communication request, with obtain that language server can be recognized
Two communication requests;First sending module 50, for the second communication request to be sent into language server;Second acquisition module 70,
For obtaining the first file for according to the second communication request get after operation processing by server, wherein, the first text
Part includes the result obtained after operation is handled;Recombination module 90, for carrying out reorganization according to the first file, to obtain
The second file that terminal can be recognized;Second sending module 110, for sending the second file to terminal.
The data processing equipment provided using the application, is transferred module 30, first by the first acquisition module 10, first and sent out
Module 50, the second acquisition module 70, the sending module 110 of recombination module 90 and second are sent, is sent according to the terminal got
First communication request calls core library, and the second communication request that the language server got can be recognized then is sent into language
Server is sayed, after language server is handled according to the second communication request, the returned after language server processing is obtained
One file simultaneously carries out reorganization to it, and the second file after restructuring is sent into terminal, realizes terminal and language server
Data processing, the application provide data processing device, by calling core library, the request of different terminals is transformed into not
The request that can be recognized with language server, the file after then language server is handled, which is converted into different terminals, to be recognized
File, solve in the prior art when different terminals carries out data processing from different language server, it is necessary to define
Different interfaces, takes considerable time the Related Technical Issues with human cost, realizes in multiple terminals different language with putting down more
When carrying out data processing between platform different language, the time of exploitation and the effect of human cost are saved.
As shown in fig. 6, in the above-described embodiments, different language terminal including the use of JAVA language Andriod terminals,
Use the Ios terminals of Objective-c language, the Symbian using C/C++ language and use C# language
WindowsPhone, different language servers include PHP language servers, Java language server and Asp.Net language
Server.
According to above-described embodiment of the application, device can also include:First processing module, for defining interface parameter,
Wherein, interface parameters includes URI addresses, types of variables, variable name and access modifier.
In above-described embodiment of the application, the first acquisition module 10 can include:Second transfers module, is connect for calling
Mouth parameter;3rd acquisition module, the parameter for obtaining the first communication request that terminal is inputted according to interface parameters, to obtain
One communication request.
According to above-described embodiment of the application, first, which transfers module 30, to include:Second processing module, for calling
Core library is spliced and transformation of ownership processing to the parameter of the first communication request, and can be recognized with obtaining language server second is led to
News request.
In the embodiment of the data processing equipment of the present invention, the device can also include:First detection module, for root
Judge that current network conditions whether there is WIFI network server according to interface parameters;First communication module, in current network
In the case of there is WIFI network server in environment, data processing is carried out by WIFI network;3rd processing module, for
In the case of WIFI network server is not present in current network conditions, there is currently no the pop-up of WIFI network server
Feedback.
According to above-described embodiment of the application, the first acquisition module 10 can also include:Second communication module, for basis
Interface parameters is carried out data transmission by the transmission means of multithreading or hyperthread;Or the 3rd communication module, for according to multi-thread
Journey or the transmission means of hyperthread are carried out data transmission by way of breakpoint transmission.
Preferably, recombination module 90 can also include:First modular converter, for being carried out to the first communication request at conversion
Reason, to obtain the 3rd communication request that language server can be recognized;Encrypting module, for the 3rd communication request to be encrypted
Processing, to obtain the second communication request.
As can be seen from the above description, the data processing method and device that the present invention is provided realize following technology
Effect:The embodiment of the method and device for the data processing that the present invention is provided embedded in a set of middleware SDK on Termination ID E,
And when different language and different language servers carry out communication process conversion, by calling core library can be to different languages
Xml the or Json character strings that the request of speech, method, language server are returned are changed, without redefining interface, can be with
It is effective to save development time and human cost.And the enhancing function of being aided in by some so that the language of different editions is whole
It is faster, safer when end carries out data processing with platform, it is more efficient.
Obviously, those skilled in the art should be understood that above-mentioned each module of the invention or each step can be with general
Computing device realize that they can be concentrated on single computing device, or be distributed in multiple computing devices and constituted
Network on, alternatively, the program code that they can be can perform with computing device be realized, it is thus possible to they are stored
Performed in the storage device by computing device, either they are fabricated to respectively each integrated circuit modules or by they
In multiple modules or step single integrated circuit module is fabricated to realize.So, the present invention is not restricted to any specific
Hardware and software is combined.
The preferred embodiments of the present invention are these are only, are not intended to limit the invention, for those skilled in the art
For member, the present invention can have various modifications and variations.Any modification within the spirit and principles of the invention, being made,
Equivalent substitution, improvement etc., should be included in the scope of the protection.