CN107517188A - A kind of data processing method and device based on Android system - Google Patents
A kind of data processing method and device based on Android system Download PDFInfo
- Publication number
- CN107517188A CN107517188A CN201610431272.6A CN201610431272A CN107517188A CN 107517188 A CN107517188 A CN 107517188A CN 201610431272 A CN201610431272 A CN 201610431272A CN 107517188 A CN107517188 A CN 107517188A
- Authority
- CN
- China
- Prior art keywords
- returned data
- data
- communication component
- information
- main thread
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
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/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- 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/133—Protocols for remote procedure calls [RPC]
-
- 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/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiments of the invention provide a kind of data processing method and device based on Android system, methods described includes:Communication component is set;The communication component is according to the transmission data acquisition request information from the parameter that page main thread receives to server;The communication component receives returned data from server;When returned data success, the returned data Processing Interface in the communication component invoking page main thread is handled the returned data.So, avoid and repeat to write code hard work in each page, saved the development time.
Description
Technical field
The present invention relates to Internet technical field, more particularly to a kind of data processing method and dress based on Android system
Put.
Background technology
With the continuous development of Android (Android) system, smart mobile phone, tablet personal computer based on Android system, intelligence
The intelligent terminals such as TV are just changing the life style of people in all its bearings.For example, pass through the application program in terminal
(App), user may browse through webpage, viewing video, shopping, chat etc..During using these application programs, using journey
The sequence page is communicated most main as application program to obtain data and display is carried out in the page of application program with server
The communication mode wanted.
When realizing the communication of application program and server, client needs according to business demand to server prior art
Side upload request information, wherein, the information such as hardware environment parameter, service parameter are generally carried in the solicited message, and
After the data of server side return are received, client also needs to carry out the returned data dissection process, such as exception
Reason, display progress bar etc., and returned data is included in the page corresponding to application program.Prior art realizes the process needs
Developer writes the code to be communicated with server in the source file of the application program page in a manner of coding in advance, with
And the processing code to server side returned data, and it is required for developer complete each page in each application program
Into above-mentioned substantial amounts of coding work, not only development process is very time-consuming, and very hard work is also brought to follow-up maintenance
Amount.
The content of the invention
Realized pair in each page of application program by writing a large amount of codes to solve developer in the prior art
The problems such as development process caused by the request of data of server, returned data processing takes, and maintenance work is heavy, the present invention is implemented
Example provides a kind of data processing method and device based on Android system.
In order to solve the above problems, the embodiment of the invention discloses a kind of data processing method based on Android system, bag
Include:
Communication component is set;
The communication component is according to the transmission data acquisition request information from the parameter that page main thread receives to server;
The communication component receives returned data from server;
When returned data success, the returned data Processing Interface pair in the communication component invoking page main thread
The returned data is handled.
According to another aspect of the present invention, the embodiment of the invention discloses a kind of data processing dress based on Android system
Put, including:
Communication component module, for setting communication component;
The communication component module includes:
Request of data submodule, for sending data acquisition request according to from the parameter that page main thread receives to server
Information;
Data receiver submodule, for receiving returned data from server;
Returned data handles submodule, for when returned data success, the return number in invoking page main thread
The returned data is handled according to Processing Interface.
The embodiment of the present invention comprises at least advantages below:
When prior art realizes the data interaction of application program and server in Android system, developer is needed every
Sub-line journey Thread access, and the program code handled returned data, these code content bases are write in the individual page
This is identical, so not only needs to expend developer's substantial amounts of time, and as page quantity increases maintenance cost also drastically
Rise.The embodiment of the present invention, when page main thread needs to interact with server, only needs to call by setting communication component
Data access interface in the communication component can be achieved, and so, avoids and repeats to write code in each page
Hard work, the development time is saved.Further, because the interaction to server has all been encapsulated into communication component, friendship is worked as
When mutual environmental change needs to change interaction code, user need to only change communication component, greatly reduce later maintenance
Cost.
Brief description of the drawings
Fig. 1 shows that a kind of the step of data processing method based on Android system of the one of embodiment of the present invention flows
Cheng Tu;
Fig. 2 shows that a kind of the step of data processing method based on Android system of the one of embodiment of the present invention flows
Cheng Tu;
Fig. 3 shows a kind of structural frames of data processing equipment based on Android system of the one of embodiment of the present invention
Figure.
Embodiment
In order to facilitate the understanding of the purposes, features and advantages of the present invention, it is below in conjunction with the accompanying drawings and specific real
Applying mode, the present invention is further detailed explanation.
Embodiment one
Reference picture 1, the step of showing a kind of data processing method based on Android system of the one of embodiment of the present invention
Flow chart, specifically it may include steps of:
Step 101, communication component is set;
Specifically, the data exchange process between server, returned data processing, progress bar such as are shown at the content in advance
It is encapsulated as communication component.When page main thread needs to interact with server, by initializing communication component and creating logical
Believe that the data access interface in the object reference communication component of component performs the access to server.
Step 102, the communication component please according to the transmission data acquisition from the parameter that page main thread receives to server
Seek information;
Specifically, page main thread can transmit required parameter when initializing communication component to the communication component.For example,
According to the building method tissue and input parameter of communication component.
Wherein, the parameter that the communication component receives from page main thread includes:Object id information, request address letter
Breath.
Specifically, the object id information can be determined according to actual business requirement, such as:User identity information,
Commodity sign information, film/picture identification information etc..
The request address information can specifically include server address, such as:baike.***.com.Preferably, institute
Stating can also include needing the server data interface name accessed in request address information, and server is according to the request address
It is determined that corresponding data-interface.During specific implementation, the request address information can use following form:Server address++
Method=data-interface names.Certainly, also extended formatting can be used to set above-mentioned request address, the present invention for those skilled in the art
Embodiment is not specifically limited to this.
In a preferred embodiment of the invention, the step 102 can specifically include following sub-step:
Sub-step s11, obtain ambient parameter information;
Specifically, the ambient parameter can include device attribute information, such as:Device identification, unit type, operation system
Unite version number etc.;Further, the ambient parameter can also include application attribute information, such as:Application name,
Application version etc.;Further, the ambient parameter can also include:Operator name, the country one belongs to of operator etc..Hold
Readily understood, the ambient parameter can be by those skilled in the art according to determination is actually needed, and the embodiment of the present invention is to ambient parameter
Content be not specifically limited.
It should be noted that the process of above-mentioned acquisition ambient parameter can be automatically performed by communication component, page main thread exists
When calling the data access interface in communication component, do not require consideration for how to obtain and transmit above-mentioned ambient parameter, therefore, greatly
Reduce developer's workload greatly.
Sub-step s12, the ambient parameter information, object id information are packaged to obtain target component information;
Specifically, using the ambient parameter information as information header (Head), object id information is as imformosome
(Body), it is packaged to obtain target component information with JSON (JavaScript Object Notation) form.Preferably,
The ambient parameter, object id information can also be encrypted before above-mentioned encapsulation is carried out, to improve data transmission procedure
In security.
Sub-step s13, start sub-line journey;
Specifically, start sub-line journey Thread.
Sub-step s14, the sub-line journey send data acquisition according to the target component, request address information to server
Request.
Specifically, sub-line journey sends data acquisition request by HttpClient objects, HttpPost objects to server,
Detailed process example is as follows:
HttpClient client=createHttpClient () // establishment client objects
HttpPost post=new HttpPost (serverUrl) //serverUrl is request address information
Client.execute (post) // pass through the http connections in client objects execution post
Step 103, the communication component receive returned data from server;
Specifically, can by HttpResponse object the reception server returning results, such as:
HttpResponse response=client.execute (post)
Step 104, when returned data success, at the returned data in the communication component invoking page main thread
Reason interface is handled the returned data.
Specifically, server sets returned data to identify according to rule set in advance in returned data, communication component
After receiving returned data, determine whether current returned data succeeds according to the Data Identification carried in the returned data.
In summary, when prior art realizes the data interaction of application program and server in Android system, exploit person
Member needs to write sub-line journey Thread access in each page, and the program code handled returned data, these
Code content is essentially identical, so not only needs to expend developer's substantial amounts of time, and is safeguarded as page quantity increases
Cost also steeply rises.The embodiment of the present invention is by setting communication component, when page main thread needs to interact with server
When, it need to only call the data access interface in the communication component to can be achieved, so, avoid the weight in each page
Code hard work is write again, has saved the development time.Further, because the interaction to server has all been encapsulated into communication set
In part, when interactive environment change needs to change interaction code, user need to only change communication component, greatly reduce
Later maintenance cost.
Embodiment two
Reference picture 2, show a kind of data processing method method based on Android system of another embodiment of the present invention
Flow chart of steps, in the present embodiment using Communication as communication component name exemplified by, specifically may include steps of:
Step 201, communication component is set;
Specifically, page main thread is created by the building method of communication component Communication classes
Communication class objects, example are as follows:
Communication communication=new Communication (object id information, request address
Information);
Data access interface in communication.getPostHttpContent () // calling communication component.
Wherein, the ginseng that the object id information, request address information are received by communication component by page main thread
Number;The getPostHttpContent is the data access interface that data interaction is carried out with server in communication component.
After data access interface getPostHttpContent is called, communication component performs following steps 202-207.
Step 202, obtain ambient parameter;
Step 203, the ambient parameter information, object id information are packaged to obtain target component information;
Step 204, start sub-line journey, data acquisition is sent to server according to the target component, request address information
Request;
Step 205, the sub-line journey receive returned data from server;
Step 206, when returned data success, at the returned data in the communication component invoking page main thread
Reason interface is handled the returned data;
Specifically, carrying data processing mark in the data that the server returns, sub-line journey is according to the data processing
Mark determines whether this request of data succeeds;If returned data success, sub-line journey is according to the rule invocation page pre-set
Returned data Processing Interface in main thread is handled the returned data.
In an alternate embodiment of the present invention where, the parameter received in the step 201 from page main thread also includes:
The Processing Interface of returned data first;
The step 206 specifically includes:
When returned data success, the sub-line journey calls the returned data first to handle according to callback mechanism
Interface is handled the returned data.
So-called callback mechanism is for example exactly that some method C in B classes is called in A classes, is then called in turn in B classes
Method D, D this method in A classes is just callback method.In the present embodiment, the Processing Interface of returned data first is back
Tune method.
In another alternative embodiment of the present invention, the parameter received in the step 201 from page main thread also includes:
Returned data second processing interface, page object;
The step 206 specifically includes:
When returned data success, the sub-line journey calls the return number by the page object according to reflex mechanism
The returned data is handled according to second processing interface.
By taking Java language as an example, reflex mechanism is in running status, for any one class, can know this class
All properties and method;For any one object, its any one method can be called;The letter of this dynamic access
The function of the method for breath and dynamic call object is referred to as the reflex mechanism of java language.
Above is two kinds of processing methods to server returned data provided in an embodiment of the present invention, in specific implementation,
Different parameters can be passed to according to the different configuration method of communication component Communication classes to determine to adopt in step 201
With the returned data Processing Interface in which kind of mode invoking page main thread.As described above, the returned data Processing Interface includes
The Processing Interface of returned data first and/or returned data the second processing interface.It is readily appreciated that, those skilled in the art may be used also
Not to be restricted to this using the returned data Processing Interface in other manner invoking page main thread, the embodiment of the present invention.
Step 207, when returned data exception, abnormal information is sent to page master by the sub-line journey by message object
Thread carries out abnormality processing.
Specifically, when returned data exception, abnormal information is sent to main line by sub-line journey by message object Message
Handler in journey carries out abnormality processing.
Further, any abnormal sub-line journey occurs in the processing procedure of above-described embodiment can pass through message object
Abnormal information is sent to Handler in main thread and carries out abnormality processing by Message.It is issuable different in the embodiment of the present invention
Normal information includes:Reported an error when being encrypted to request data, server returns to error message, Network Abnormal etc..Detailed process example is such as
Under:
Handler baseHandler=new Handler ();
Message m=new Message ();
M.what=Constant.DESCRYPTED_OR_DECOMPRESSED_EXCEPTION;
baseHandler.sendMessage(m);
What values in the message that Handler is sent according to sub-line journey, which kind of message judgement is, if to request data
Error messages are encrypted, then are done as follows:
Toast.makeText (MosApp.getInstance () .getApplicationContext (), " required parameter
Reported an error during encryption ", Toast.LENGTH_LONG) .show ();
Page main thread shows the information, prompts user, and required parameter reports an error when encrypting.
Below, the communication component Communication in the embodiment of the present invention is done further with reference to concrete application scene
It is described in detail:
First, building method
The embodiment of the present invention provides following two building methods to communication component Communication:
Method one, according to the returned data Processing Interface in reflection mode invoking page main thread:
public Communication(String url,JSONObject parameter,String
methodName,Object superObject)
Wherein,
Url, the address of request server, such as tm/WoHandleAction.doMethod=query;
The object id information of parameter, json form;
MethodName, after server returned data, to the interface of returned data processing in page main thread Acitivity
Name, i.e., returned data second processing interface described above;
The example (Activity) of superObject reflections, which activity is specified is
Method two, according to the returned data Processing Interface in call-back manner invoking page main thread
public Communication(String url,JSONObject parameter,RequestListener
callbackInterface,Object superObject)
Wherein,
Url, the address of request server, such as tm/WoHandleAction.doMethod=query;
The object id information of parameter, json form;
CallbackInterface, after server returned data, in page main thread Acitivity to returned data at
Callback method (interface) name of reason, i.e., the Processing Interface of returned data first described above;
SuperObject, the example (Activity) of reflection, which activity is specified is.
For ease of skilled artisan understands that the use of above-mentioned building method, below to be used in the wechat circle of friends page
The above method one obtains data instance from server end and above-mentioned parameter is described further:
Assuming that use Communication in the wechat circle of friends page (WechatFriendListActivity.this)
Communication component obtains data from server, then following parameters can be:
Url=" wechat/FriendTrendAction.doMethod=query ";The side to be called of // server end
Religious name
Parameter=" 13888888888 ";// wechat user id
MethodName=" handleResult ";// wechat circle of friends the page
(WechatFriendListActivity.this) method name of returned data is handled
SuperObject=WechatFriendListActivity.this;// indicate it is the wechat circle of friends page
(WechatFriendListActivity.this) want request server end data and data are processed, tell simultaneously
This method name of Communication components methodName is to arrive WechatFriendListActivity.this texts
Performed in part.
Secondly, interface (method)
Access interface getPostHttpContent is provided with the embodiment of the present invention in communication component Communication
(), encapsulate in this method request data sub-line journey (using httpclient and server end interaction data in sub-line journey),
The progress bar shown during request data, and interact with server end terminate after send messages to page main thread it is unified at
Reason.After this method is called, following steps are specifically performed:
Sub-step s21, start sub-line journey;
Sub-step s22, however, it is determined that display progress bar, then show progress bar in page main thread;
Sub-step s23, sub-line journey start HttpClient object client, HttpPost objects post;
HttpClient client=createHttpClient () //
HttpPost post=new HttpPost (serverUrl) //serverUrl is request address
The object id information received is encrypted for sub-step s24, sub-line journey;
Object id information after encryption, ambient parameter are encapsulated to obtain mesh by sub-step s25, subprocess according to JSON forms
Mark parameter;And the target component is added in post objects;
Wherein, carried in the header (Head) of target component in ambient parameter, body information (Body) and carry object
Identification information;
So that client is mobile phone as an example, the ambient parameter can specifically include:Device attribute information, application program letter
Breath, user profile, other information etc.;Wherein,
The device attribute information includes:Cell phone apparatus identifies
(InternationalMobileEquipmentIdentity, IMEI), phone number, mobile phone model, mobile phone version number, mobile phone
Android system version number, OS name;
The application information includes:Installation kit title, network type, application version number
The user profile includes:User name, password (after encryption)
The other information includes:National, used language where time zone, current operator.
Analysis of the server based on above-mentioned ambient parameter can obtain user's custom, the reason for exception etc. has occurred.
Sub-step s26, subprocess send data acquisition request to server;
HttpResponse response=client.execute (post)
Sub-step s27, whether Data Identification of the subprocess in server returned data determines to return succeeds;If return
Data success, performs sub-step s28;If returned data fails, sub-step s29 is performed;
Sub-step s28, the returned data Processing Interface in invoking page main thread are handled returned data;
The step specifically includes:
When communication component Communication by with call-back manner in use, according to call-back manner invoking page main thread
In the Processing Interface of returned data first returned data is handled;When communication component Communication is by with reflection side
Formula in use, according to the returned data second processing interface in reflection mode invoking page main thread to returned data at
Reason;
Sub-step s29, if returned data fails, abnormal information is sent to page main line by sub-line journey by message object
Cheng Jinhang abnormality processings.
Reference picture 3, show a kind of data processing equipment based on Android system of the one of embodiment of the present invention
Structured flowchart.In embodiments of the present invention, described device can specifically include:
Communication component module 310, for setting communication component;
The communication component module 310 includes:
Request of data submodule 3101, for sending data acquisition according to from the parameter that page main thread receives to server
Solicited message;
Data receiver submodule 3102, for receiving returned data from server;
Returned data handles submodule 3103, for when returned data success, returning in invoking page main thread
Data-processing interface is returned to handle the returned data.
In summary, when prior art realizes the data interaction of application program and server in Android system, exploit person
Member needs to write sub-line journey Thread access in each page, and the program code handled returned data, these
Code content is essentially identical, so not only needs to expend developer's substantial amounts of time, and is safeguarded as page quantity increases
Cost also steeply rises.The embodiment of the present invention according to communication component module 310 set communication component, when page main thread need with
When server interacts, the data access interface request of data submodule in the communication component module 310 need to be only called
3101 can be achieved, and so, avoid and repeat to write code hard work in each page, saved the development time.
Further, because the interaction to server has all been encapsulated into communication component, when interactive environment change needs change to interact
During range code, user need to only change communication component, greatly reduce later maintenance cost.
Further, in another alternative embodiment of the present invention,
The parameter received from page main thread includes:Object id information, request address information;
The request of data submodule includes:
Ambient parameter acquiring unit, for obtaining ambient parameter information;
Parameter encapsulation unit, for being packaged to obtain target component to the ambient parameter information, object id information
Information;
Sub-line journey start unit, for starting sub-line journey;
Execution unit is asked, for sending data acquisition according to the target component, request address information to server and asking
Ask.
Further, in another alternative embodiment of the present invention, the parameter received from page main thread also includes:
The Processing Interface of returned data first;
The returned data processing submodule includes:
Returned data first processing units, for when returned data success, the communication component to be according to readjustment machine
System calls the Processing Interface of returned data first to handle the returned data.
Further, in another alternative embodiment of the present invention, the parameter received from page main thread also includes:
Returned data second processing interface, page object;
The returned data processing submodule includes:
Returned data second processing unit, for when returned data success, the communication component to pass through the page pair
As calling the returned data second processing interface to handle the returned data according to reflex mechanism.
Further, in another alternative embodiment of the present invention, the communication component module also includes:
Abnormality processing submodule, for when returned data exception, the sub-line journey is by message object by abnormal information
It is sent to page main thread and carries out abnormality processing.
Each embodiment in this specification is described by the way of progressive, what each embodiment stressed be with
The difference of other embodiment, between each embodiment identical similar part mutually referring to.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present invention can be provided as method, apparatus or calculate
Machine program product.Therefore, the embodiment of the present invention can use complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.Moreover, the embodiment of the present invention can use one or more wherein include computer can
With in the computer-usable storage medium (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code
The form of the computer program product of implementation.
The embodiment of the present invention is with reference to method according to embodiments of the present invention, terminal device (system) and computer program
The flow chart and/or block diagram of product describes.It should be understood that can be by computer program instructions implementation process figure and/or block diagram
In each flow and/or square frame and the flow in flow chart and/or block diagram and/or the combination of square frame.These can be provided
Computer program instructions are set to all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing terminals
Standby processor is to produce a machine so that is held by the processor of computer or other programmable data processing terminal equipments
Capable instruction is produced for realizing in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames
The device for the function of specifying.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing terminal equipments
In the computer-readable memory to work in a specific way so that the instruction being stored in the computer-readable memory produces bag
The manufacture of command device is included, the command device is realized in one flow of flow chart or multiple flows and/or one side of block diagram
The function of being specified in frame or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing terminal equipments so that
Series of operation steps is performed on computer or other programmable terminal equipments to produce computer implemented processing, so that
The instruction performed on computer or other programmable terminal equipments is provided for realizing in one flow of flow chart or multiple flows
And/or specified in one square frame of block diagram or multiple square frames function the step of.
Although having been described for the preferred embodiment of the embodiment of the present invention, those skilled in the art once know
Basic creative concept, then other change and modification can be made to these embodiments.So appended claims are intended to explain
To include preferred embodiment and fall into being had altered and changing for range of embodiment of the invention.
Finally, it is to be noted that, herein, such as first and second or the like relational terms be used merely to by
One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between any this actual relation or order be present.Moreover, term " comprising ", "comprising" or its any other variant meaning
Covering including for nonexcludability, so that process, method, article or terminal device including a series of elements are not only wrapped
Those key elements, but also the other element including being not expressly set out are included, or is also included for this process, method, article
Or the key element that terminal device is intrinsic.In the absence of more restrictions, wanted by what sentence "including a ..." limited
Element, it is not excluded that other identical element in the process including the key element, method, article or terminal device also be present.
Above to a kind of data processing method and device based on Android system provided by the present invention, detailed Jie has been carried out
Continue, specific case used herein is set forth to the principle and embodiment of the present invention, and the explanation of above example is only
It is the method and its core concept for being used to help understand the present invention;Meanwhile for those of ordinary skill in the art, according to this hair
Bright thought, there will be changes in specific embodiments and applications, in summary, this specification content should not manage
Solve as limitation of the present invention.
Claims (10)
1. a kind of data processing method based on Android system, it is characterised in that methods described includes:
Communication component is set;
The communication component is according to the transmission data acquisition request information from the parameter that page main thread receives to server;
The communication component receives returned data from server;
When returned data success, the returned data Processing Interface in the communication component invoking page main thread is to described
Returned data is handled.
2. according to the method for claim 1, it is characterised in that
The parameter received from page main thread includes:Object id information, request address information;
The step of communication component from the parameter that page host process receives to service side according to data acquisition request information is sent
Including:
Obtain ambient parameter information;
The ambient parameter information, object id information are packaged to obtain target component information;
Start sub-line journey;
The sub-line journey sends data acquisition request according to the target component, request address information to server.
3. according to the method for claim 2, it is characterised in that the parameter received from page main thread also includes:Return
Return the Processing Interface of data first;
It is described when returned data success, the data-processing interface in the communication component invoking page main thread is to described
The step of returned data is handled includes:
When returned data success, the communication component calls the Processing Interface of returned data first according to callback mechanism
The returned data is handled.
4. according to the method for claim 2, it is characterised in that the parameter received from page main thread also includes:Return
Return data second processing interface, page object;
It is described when returned data success, the returned data Processing Interface pair in the communication component invoking page main thread
The step of returned data is handled includes:
When returned data success, the communication component calls the returned data by the page object according to reflex mechanism
Second processing interface is handled the returned data.
5. the method according to claim 3 or 4, it is characterised in that methods described also includes:
When returned data exception, abnormal information is sent to page main thread by message object and carries out exception by the sub-line journey
Processing.
6. a kind of data processing equipment based on Android system, it is characterised in that described device includes:
Communication component module, for setting communication component;
The communication component module includes:
Request of data submodule, for according to from the parameter that page main thread receives to server transmission data acquisition request letter
Breath;
Data receiver submodule, for receiving returned data from server;
Returned data handles submodule, for when returned data success, at the returned data in invoking page main thread
Reason interface is handled the returned data.
7. device according to claim 6, it is characterised in that
The parameter received from page main thread includes:Object id information, request address information;
The request of data submodule includes:
Ambient parameter acquiring unit, for obtaining ambient parameter information;
Parameter encapsulation unit, for being packaged to obtain target component information to the ambient parameter information, object id information;
Sub-line journey start unit, for starting sub-line journey;
Execution unit is asked, for sending data acquisition request to server according to the target component, request address information.
8. device according to claim 7, it is characterised in that the parameter received from page main thread also includes:Return
Return the Processing Interface of data first;
The returned data processing submodule includes:
Returned data first processing units, for when returned data success, the communication component to be adjusted according to callback mechanism
The returned data is handled with the Processing Interface of returned data first.
9. device according to claim 7, it is characterised in that the parameter received from page main thread also includes:Return
Return data second processing interface, page object;
The returned data processing submodule includes:
Returned data second processing unit, for when returned data success, the communication component to be pressed by the page object
The returned data second processing interface is called to handle the returned data according to reflex mechanism.
10. device according to claim 8 or claim 9, it is characterised in that the communication component module also includes:
Abnormality processing submodule, for when returned data exception, the sub-line journey to be sent abnormal information by message object
Abnormality processing is carried out to page main thread.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610431272.6A CN107517188A (en) | 2016-06-16 | 2016-06-16 | A kind of data processing method and device based on Android system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610431272.6A CN107517188A (en) | 2016-06-16 | 2016-06-16 | A kind of data processing method and device based on Android system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107517188A true CN107517188A (en) | 2017-12-26 |
Family
ID=60720716
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610431272.6A Pending CN107517188A (en) | 2016-06-16 | 2016-06-16 | A kind of data processing method and device based on Android system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107517188A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108628689A (en) * | 2018-04-28 | 2018-10-09 | 武汉斗鱼网络科技有限公司 | A kind of dialog box data transmission method, device, computer and storage medium |
CN109032815A (en) * | 2018-07-18 | 2018-12-18 | 武汉斗鱼网络科技有限公司 | Information interacting method, device, equipment and storage medium between functional module |
CN109120473A (en) * | 2018-07-27 | 2019-01-01 | 广州市百果园信息技术有限公司 | Interface requests framework implementation method, interface test method and its corresponding device |
CN109343982A (en) * | 2018-09-30 | 2019-02-15 | 武汉斗鱼网络科技有限公司 | Information interacting method, device, equipment and storage medium between functional module |
CN110018813A (en) * | 2018-01-10 | 2019-07-16 | 武汉斗鱼网络科技有限公司 | A kind of Toast design method, storage medium, electronic equipment and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102364920A (en) * | 2011-10-17 | 2012-02-29 | Tcl集团股份有限公司 | Android-system-based remote operating method and system |
CN102520936A (en) * | 2011-11-30 | 2012-06-27 | 厦门雅迅网络股份有限公司 | Method for realizing sharing of Socket communication service on Android platform |
CN103064690A (en) * | 2012-12-16 | 2013-04-24 | 互动在线(北京)科技有限公司 | Development framework based on Android operating system and execution method thereof |
US20130198266A1 (en) * | 2012-01-30 | 2013-08-01 | 5O9, Inc. | Facilitating communication between web-enabled devices |
CN105204951A (en) * | 2015-10-10 | 2015-12-30 | 上海斐讯数据通信技术有限公司 | Method and device for communication between Activities in Android system |
-
2016
- 2016-06-16 CN CN201610431272.6A patent/CN107517188A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102364920A (en) * | 2011-10-17 | 2012-02-29 | Tcl集团股份有限公司 | Android-system-based remote operating method and system |
CN102520936A (en) * | 2011-11-30 | 2012-06-27 | 厦门雅迅网络股份有限公司 | Method for realizing sharing of Socket communication service on Android platform |
US20130198266A1 (en) * | 2012-01-30 | 2013-08-01 | 5O9, Inc. | Facilitating communication between web-enabled devices |
CN103064690A (en) * | 2012-12-16 | 2013-04-24 | 互动在线(北京)科技有限公司 | Development framework based on Android operating system and execution method thereof |
CN105204951A (en) * | 2015-10-10 | 2015-12-30 | 上海斐讯数据通信技术有限公司 | Method and device for communication between Activities in Android system |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110018813A (en) * | 2018-01-10 | 2019-07-16 | 武汉斗鱼网络科技有限公司 | A kind of Toast design method, storage medium, electronic equipment and system |
CN108628689A (en) * | 2018-04-28 | 2018-10-09 | 武汉斗鱼网络科技有限公司 | A kind of dialog box data transmission method, device, computer and storage medium |
CN108628689B (en) * | 2018-04-28 | 2021-09-07 | 武汉斗鱼网络科技有限公司 | Dialog box data transmission method and device, computer and storage medium |
CN109032815A (en) * | 2018-07-18 | 2018-12-18 | 武汉斗鱼网络科技有限公司 | Information interacting method, device, equipment and storage medium between functional module |
CN109120473A (en) * | 2018-07-27 | 2019-01-01 | 广州市百果园信息技术有限公司 | Interface requests framework implementation method, interface test method and its corresponding device |
CN109120473B (en) * | 2018-07-27 | 2020-11-03 | 广州市百果园信息技术有限公司 | Interface request frame implementation method, interface test method and corresponding device |
CN109343982A (en) * | 2018-09-30 | 2019-02-15 | 武汉斗鱼网络科技有限公司 | Information interacting method, device, equipment and storage medium between functional module |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3484125A1 (en) | Method and device for scheduling interface of hybrid cloud | |
CN110321273B (en) | Service statistics method and device | |
CN107517188A (en) | A kind of data processing method and device based on Android system | |
CN111176858A (en) | Data request processing method and device | |
US10735281B1 (en) | Application focused provisioning system | |
US7984170B1 (en) | Cross-domain communication in domain-restricted communication environments | |
US20170242737A1 (en) | Managing external feeds in an event-based computing system | |
CN110990228A (en) | Data interface monitoring method and device | |
US9811390B1 (en) | Consolidating tasks into a composite request | |
CN109254854A (en) | Asynchronous invoking method, computer installation and storage medium | |
CN108132991A (en) | A kind of H5 pages loading method and system | |
US11882154B2 (en) | Template representation of security resources | |
CN113076294A (en) | Information sharing method and device | |
CN112991064B (en) | Service processing method, device, computer equipment and storage medium | |
CN112015383A (en) | Login method and device | |
CN105556918A (en) | Resource downloading method, electronic device, and apparatus | |
CN112818270A (en) | Data cross-domain transfer method and device and computer equipment | |
CN116112457A (en) | Method, device, computer equipment and storage medium for notifying message | |
CN112688980B (en) | Resource distribution method and device, and computer equipment | |
CN110768855B (en) | Method and device for testing linkmzation performance | |
CN111506644B (en) | Application data processing method and device and electronic equipment | |
US9071571B2 (en) | Interaction via short message service messages with wireless markup language based websites | |
CN111343172A (en) | Network access authority dynamic processing method and device | |
CN111338642A (en) | Method, device, terminal and storage medium for determining application downloading path | |
CN115242925A (en) | Customer service quality inspection method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171226 |