CN104965780A - Data processing method and system - Google Patents

Data processing method and system Download PDF

Info

Publication number
CN104965780A
CN104965780A CN201510303439.6A CN201510303439A CN104965780A CN 104965780 A CN104965780 A CN 104965780A CN 201510303439 A CN201510303439 A CN 201510303439A CN 104965780 A CN104965780 A CN 104965780A
Authority
CN
China
Prior art keywords
execution result
test
test instruction
variable
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510303439.6A
Other languages
Chinese (zh)
Inventor
孙健
高强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510303439.6A priority Critical patent/CN104965780A/en
Publication of CN104965780A publication Critical patent/CN104965780A/en
Pending legal-status Critical Current

Links

Abstract

The present invention provides a data processing method and system. The method comprises: acquiring a test instruction operation execution result of a test performed by using a test application to test a terminal; assigning the test instruction operation execution result to a preset first variable of the test application; invoking an execution result processing class that is preset in the test application and that is for processing the test instruction operation execution result; obtaining the first variable by using the execution result processing class; and performing abnormality processing on a test instruction operation according to the first variable, wherein the test instruction operation execution result indicates that execution of the test instruction operation is abnormal. The technical scheme of the present invention solves the problems in the existing data processing scheme that operation execution results of some operations cannot be obtained and abnormality occurring in an operation process cannot be handled, thereby improving the reliability of data processing.

Description

Data processing method and system
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of data processing method and system.
Background technology
The application and development of mobile platform is just risen in this world, and more and more comes into one's own to the test automation data processing of mobile platform system application.But the official's test frame under mobile platform system also exists great deficiency: the stagnation that official's application programming interfaces (Application Programming Interface, API) upgrade, cannot obtain script command perform whether successfully state, the unusual condition disconnected cannot be connected with mobile device by processing scripts implementation computing machine; Many equipment is performed in the process of robotization simultaneously, the situation of frequent generating portion equipment socket (two programs on network realize the exchange of data by a two-way communication connection, this one end connected is called a socket) disconnecting.And above-mentioned exception can't be fed back to tester, the effect of automatic test is caused to be had a greatly reduced quality.
For official test frame Monkey Runner, Monkey Runner is compared with other test frames, the most significant advantage is that its test instruction can use Python to be write as, by personal computer (Personal Computer, PC) end is issued equipment and is gone execution, amendment, there is feature easy to adjust, but there is the deficiency that third-party testing framework exists too, comprise, third-party testing framework encapsulates the interface provided in official's test frame by using script again, stability and ease for use is improved by repeatedly performing unsuccessful action.If but socket occurs script in the process of implementation, and the abnormal situation disconnected is just helpless; Whether successfully official's test frame also cannot obtain operation rreturn value at present simultaneously, and what make third-party testing framework loses meaning to the encapsulation of part operation.
Summary of the invention
In view of above-mentioned existing data processing method and system, existence cannot process the abnormal problem disconnecting and cannot obtain operation rreturn value of socket, proposes the present invention to provide a kind of overcoming the problems referred to above or the data processing method solved the problem at least in part and system.
According to one aspect of the present invention, provide a kind of data processing method, comprising:
Obtain test instruction operation execution result when using Test Application to test terminal, and give described test instruction operation execution result assignment the first variable preset in described Test Application;
Call the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
According to a further aspect in the invention, provide a kind of data handling system, comprising:
Operation execution result assignment module, for obtaining test instruction operation execution result when using Test Application to test terminal, and gives described test instruction operation execution result assignment the first variable preset in described Test Application;
First abnormality processing module, for calling the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
In existing data processing scheme, in automatic test processing procedure, because of the abnormal unreliability of interrupting and can not obtain that operation execution result result in data processing.Technical solution of the present invention is modified to test frame, add the first variable and execution result process class, the test instruction got is operated execution result assignment to the first variable, obtain the first variable by execution result process class again and carry out abnormality processing according to the test instruction operation of the first variable to execute exception, solve part operation in available data processing scheme and can not obtain operation execution result, the abnormal conditions occurred in operating process cannot be processed, improve the reliability of data processing.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 is the flow chart of steps of a kind of data processing method according to the embodiment of the present invention one;
Fig. 2 is the flow chart of steps of a kind of data processing method according to the embodiment of the present invention two;
Fig. 3 is the flow chart of steps of a kind of data processing method according to the embodiment of the present invention three;
Fig. 4 is the structured flowchart of a kind of data handling system according to the embodiment of the present invention four;
Fig. 5 is the structured flowchart of a kind of data handling system according to the embodiment of the present invention five.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Embodiment one
Introduce a kind of data processing method provided by the invention in detail.
With reference to Fig. 1, show the flow chart of steps of a kind of data processing method in the embodiment of the present invention one.
Step 100, obtains test instruction operation execution result when using Test Application to test terminal, and gives described test instruction operation execution result assignment the first variable preset in described Test Application.
Described Test Application a part can be positioned at described terminal, and another part is positioned at test lead, the Test Application of the Test Application of described terminal and described test lead is combined, and is the Test Application in the embodiment of the present invention.Test lead is the one end independent of described terminal.Can be preset with the first variable in described Test Application, described first variable is used for On-board test command operating execution result.
Test Application sends test instruction to described terminal, and described terminal performs test instruction operation according to the test instruction received and generates test instruction operation execution result.
Step 102, call the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
Can also be preset with execution result process class in described Test Application, described execution result process class may be used for processing the test instruction operation execution result got in above-mentioned steps 100.
Particularly, described execution result process class by getting described first variable, can process the test instruction execution result stored in the first variable.Obtain the state of operation execution according to the value of the first variable, if operation failure, generation exception, just dispose.
In the embodiment of the present invention, described execution result process class can for test instruction operate execution result instruction execute exception test instruction operation carry out abnormality processing.
Described abnormality processing can be understood as carries out correction operation to the test instruction operation of execute exception, obtains instruction and performs normal test instruction operation execution result.
Test Application in the embodiment of the present invention can be the wherein one in the official's test frame under mobile platform system, for Monkey Runner, Monkey Runner mono-is divided into two parts, a part is at PC end, and another part is on Android (a kind of intelligent operating system) equipment.The most significant advantage of test frame that MonkeyRunner compares other is that its test instruction can use Python to be write as, issues Android device and goes to perform, revise, adjust more convenient by PC end.Test Application in the embodiment of the present invention can be gained of modifying to the Monkey Runner on PC end.
In sum, the embodiment of the present invention is modified to Test Application by the first variable default in Test Application and execution result process class, add the first variable and execution result process class, the test instruction got is operated execution result assignment to the first variable, obtain the first variable by execution result process class again and carry out abnormality processing according to the test instruction operation of the first variable to execute exception, solve part operation in available data processing scheme and can not obtain operation execution result, the abnormal conditions occurred in operating process cannot be processed, improve the reliability of data processing.
Embodiment two
Introduce a kind of data processing method provided by the invention in detail.
With reference to Fig. 2, show the flow chart of steps of a kind of data processing method in the embodiment of the present invention two.
Step 200, obtains the SOT state of termination of terminal by Test Application, and described SOT state of termination assignment is given the second variable preset in described Test Application.
Described Test Application a part can be positioned at described terminal, and another part is positioned at test lead, the Test Application of the Test Application of described terminal and described test lead is combined, and is the Test Application in the embodiment of the present invention.Test lead is the one end independent of described terminal.
Preferably, described SOT state of termination, can comprise: bootload state, dummy status, off-line state, presence, return to form and unauthorized state etc.
Preferably, the process obtaining the SOT state of termination of described terminal in described step 200 can be:
Revise the second function in described Test Application, and obtain the SOT state of termination of described terminal by amended second function.
Preferably, described Test Application can comprise MonkeyRunner etc., and the embodiment of the present invention does not do concrete restriction to Test Application.
Described MonkeyRunner is a kind of test frame in android system, for carrying out automatic test process to Android terminal.
Described second function can be the WaitForConnection function in MonkeyRunner.
Described WaitForConnection function can determine all Android terminal be connected with MonkeyRunner, and obtains the object of target Android terminal.
Preferably, the second function in the described Test Application of described amendment, is specifically as follows:
The first static variable and the second static variable is increased in described second function; Wherein, described first static variable may be used for the identification information of storage terminal; Described second static variable may be used for the connection time-out information of storage terminal.
It should be noted that, except increasing except static variable in described second function, the global variable of global variable or simulation can also be adopted, or be a common variables etc. back transmitted.
Can be preset with the second variable in described Test Application, described second variable may be used for storing the SOT state of termination got.
Preferably, described second variable can comprise the global variable of enumeration type, also can comprise the local variable of other types, and the embodiment of the present invention does not do concrete restriction to the second type of variables.
Step 202, call the SOT state of termination process class of the described SOT state of termination of process preset in described Test Application, obtain described second variable by described SOT state of termination process class, and according to described second variable, abnormality processing is carried out to the abnormality that described SOT state of termination indicates.
Can also be preset with SOT state of termination process class in described Test Application, described SOT state of termination process class may be used for processing the SOT state of termination got in above-mentioned steps 200.
Particularly, described SOT state of termination process class by getting described second variable, can process the SOT state of termination stored in the second variable.
In the embodiment of the present invention, described SOT state of termination process class can carry out abnormality processing for the abnormality of SOT state of termination process instruction.
Described abnormality processing can be understood as carries out correction operation to the SOT state of termination of exception, obtains the normal SOT state of termination of indicating status.
Preferably, according to described second variable, the abnormality that described SOT state of termination indicates is carried out to the process of abnormality processing in described step 202, is specifically as follows:
When described SOT state of termination is off-line state, re-establish the connection between described Test Application and described terminal, until described SOT state of termination is presence.
Step 204, obtains test instruction operation execution result when using Test Application to test terminal, and gives described test instruction operation execution result assignment the first variable preset in described Test Application.
Preferably, described test instruction operation execution result, can comprise: test instruction operation runs succeeded, test instruction operation performs failure, Scoket successful connection and Socket connection failure etc. between described Test Application and described terminal between described Test Application and described terminal.
Can also be preset with the first variable in described Test Application, described first variable is used for On-board test command operating execution result.
Preferably, described first variable can comprise the global variable of enumeration type, also can comprise the local variable of other types, and the embodiment of the present invention does not do concrete restriction to the first type of variables.
Test Application sends test instruction to described terminal, and described terminal performs test instruction operation according to the test instruction received and generates test instruction operation execution result.
Preferably, obtain the process of test instruction operation execution result when using Test Application to test terminal in described step 204, can comprise:
Step 2041, use the first function preset in described Test Application, test command when described Test Application being tested terminal is converted into the test instruction that described terminal is supported, and is sent to described terminal.
Preferably, described first function can be SendMonkeyEventAndGetResponse function.
Set up after socket is connected between described Test Application with described terminal, by above-mentioned SendMonkeyEventAndGetResponse function the MonkeyRunner test command in Test Application can be converted into and Android terminal is passed to the test instruction of Android terminal support.
Step 2042, obtains the test instruction operation execution result returned after described terminal performs described test instruction.
Step 206, call the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
Can also be preset with execution result process class in described Test Application, described execution result process class may be used for processing the test instruction operation execution result got in above-mentioned steps 204.
Preferably, described execution result process class can comprise: dynamic proxy class.Wherein, described dynamic proxy class, towards tangent plane programming, can be MonkeyDeviceProxy class.
Particularly, described execution result process class by getting described first variable, can process the test instruction execution result stored in the first variable.
In the embodiment of the present invention, described execution result process class can for test instruction operate execution result instruction execute exception test instruction operation carry out abnormality processing.
Described abnormality processing can be understood as carries out correction operation to the test instruction operation of execute exception, obtains instruction and performs normal test instruction operation execution result.
Preferably, carry out the process of abnormality processing in described step 206 according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction, two kinds of situations can be comprised:
1), when described test instruction execution result is for performing unsuccessfully.
Using described Test Application to resend test instruction to described terminal, making described terminal re-execute described test instruction, until test instruction execution result is for running succeeded.
Or,
2), when described test instruction execution result is Socket connection failure.
The Socket re-established between described Test Application with described terminal is connected, until test instruction operation execution result is Socket successful connection.
In sum, the embodiment of the present invention is modified to Test Application by the first variable default in Test Application and execution result process class, add the first variable and execution result process class, the test instruction got is operated execution result assignment to the first variable, obtain the first variable by execution result process class again and carry out abnormality processing according to the test instruction operation of the first variable to execute exception, solve part operation in available data processing scheme and can not obtain operation execution result, the abnormal conditions occurred in operating process cannot be processed, improve the reliability of data processing.
Embodiment three
Introduce a kind of data processing method provided by the invention in detail.
The source code of data processing method in the embodiment of the present invention to MonkeyRunner is revised.Amendment is main in following 2:
What 1, Socket interrupted extremely reconnects process.
2, the rreturn value that script operation fails to pass to terminal execution is passed back.
Directly transmitting in the class ChimpManager of operational order, capture the exception of socket disconnecting, and obtain operation whether successfully rreturn value; But in the process that exception and rreturn value are back transmitted, in class AdbChimpDevice, be extremely just printed, do not obtain enough process; The rreturn value of major part operation simultaneously is also dropped.Wherein, the execution of analog subscriber operational motion sends to PC in the SendMonkeyEventAndGetResponse () of ChimpManager, also has a fraction of operational order to send to PC to perform in the functions such as the Shell () of AdbChimpDevice in addition.
The amendment that the embodiment of the present invention is made is exactly toward returning and dealing with by this part abandoned information.
With reference to Fig. 3, show the flow chart of steps of a kind of data processing method in the embodiment of the present invention three.
Step 300, increases enumeration type ExecuteState and enumeration type DeviceState in MonkeyRunner.
Described enumeration type ExecuteState, ExecuteState:ExecuteFail (" execute_fail ") can be defined as, ExecuteSuccess (" execute_success "), SocketDisConnectError (" socket_disconnect "), for the result that deposit operation performs.
Described enumeration type DeviceState, DeviceState:BootLoader (" bootloader ") can be defined as, DeviceNull (" null "), OffLine (" offline "), OnLine (" online "), Recovery (" recovery "), Unauthorized (" unauthorized "), for the equipment state of storage equipment.
Step 302, states enumeration type DeviceState in com.android.chimpchat.adb.AdbBackend.java, and obtains equipment state in WaitForConnection () function.
Com.android.chimpchat.adb.AdbBackend.java is the java file AdbBackend deposited under the relative path com/android/chimpchat/adb/ under the root directory of MonkeyRunner source code.WaitForConnection () function is comprised in AdbBackend.java, all Android device of current connection computing machine can be found in WaitForConnection () function, and return the object of the target Android device that wherein will connect.
State in described step 302 that the detailed process of enumeration type DeviceState is:
Step 304, states enumeration type ExecuteState in com.android.chimpchat.ChimpManager.java, and in SendMonkeyEventAndGetResponse () function, obtain the result performed equipment operating.
Com.android.chimpchat.ChimpManager.java is the java file ChimpManager deposited under the relative path com/android/chimpchat/ under the root directory of MonkeyRunner source code.The Main Function of ChimpManager.java between computing machine with Android device, sets up socket be connected, then by SendMonkeyEventAndGetResponse () function the MonkeyRunner operational order on computing machine is converted into and Android device is passed to the test command of Android device, perform to Android device, and obtain returning results after Android device execution test command.
State in described step 304 that the detailed process of enumeration type ExecuteState is:
Step 306, WaitForConnection () function is revised in com.android.monkeyrunner.MonkeyRunner.java, amended WaitForConnection () function is utilized to obtain the state of equipment connection, if equipment state is abnormal, then rewritten a limited number of times reconnect equipment.
Com.android.monkeyrunner.MonkeyRunner.java is the java file MonkeyRunner deposited under the relative path com/android/monkeyrunner/ under the root directory of MonkeyRunner source code.
The main effect of MonkeyRunner.java there are provided static function WaitForConnection (PyObject [] args, String [] kws), it is converted into jython (a kind of programming language) statement in MonkeyRunner script by calling jythonUtils the statement of java, then call WaitForConnection () function under ChimpChat catalogue to call the WaitForConnection () function in Adbbackend.java, get the object of target device.
Preferably, described step 306 can be state two static variables in WaitForConnection () function, deposit identification information and the time-out time of the equipment that will obtain respectively, and will specifically obtain the Code transformations of IchimpDevice in new function WaitForConnectionImpl (), the state of equipment connection is obtained by WaitForConnectionImpl () function.
Wherein, IchimpDevice is an interface in chimpchat.jar, is realized by AdbChimpDevice.
WaitForConnection () function after amendment has been separated the function parameter that python script transmits being converted into the parameter of java and the function obtaining IchimpDevice example, and the latter is encapsulated in WaitForConnectionImpl () function, called by WaitForConnection ().The reason done like this is to disconnect the connection of Android device and intercomputer, may need the consideration again obtaining an IchimpDevice example.
The implementation of described step 306, is specifically as follows:
Step 308, for MonkeyDevice.class increases dynamic proxy class MonkeyDeviceProxy under com.android.monkeyrunner.jar bag, in MonkeyDeviceProxy class, the result of acquisition equipment executable operations, and when equipment executable operations is incorrect, rewritten a limited number of times re-executes operation or attempt reconnecting equipment.
MonkeyDevice.class file is housed under the com/android/monkeyrunner/ structure of com.android.monkeyrunner.jar bag.MonkeyDevice.class is the statement of process from python script, is converted into java statement and goes to perform the various operation to equipment, and obtain facility information etc. from equipment by JythonUtils.
Described step 308 is specifically as follows:
For MonkeyDevice.class increases dynamic proxy MonkeyDeviceProxy class under com.android.monkeyrunner.jar bag, set up the methodical realization of interface IMonkeyDevice process originally MonkeyDevice.class, and set up class MonkeyDeviceImpl and realize these methods.In MonkeyDeviceProxy class, obtain the result of equipment executable operations, and when equipment executable operations is incorrect, rewritten a limited number of times re-executes operation or attempt reconnecting equipment.
Dynamic proxy class towards tangent plane programming, mainly for the consideration of two aspects:
1, in dynamic proxy class, obtain rreturn value to all operations in MonkeyDevice.class, and process according to the difference of rreturn value, successful operation then directly returns, and operation failure then performs repeatedly, disconnects, reconnect if connect.
2, when equipment and computing machine disconnect, dynamic proxy class is used can be separated the IChimpDevice.class object of MonkeyDevice.class object and bottom.When equipment and computing machine reconnect, obtain a new IChimpDevice.class object, in code originally, do not use dynamic proxy class, now MonkeyDevice.class object also will go to obtain again.After using dynamic proxy class to be separated, the change of IChimpDevice.class object would not have influence on MonkeyDevice.class object.
The process using dynamic proxy class in described step 308 is:
public Object getImpl();
public Object getHierarchyViewer(PyObject[]args,String[]kws);
public MonkeyImage takeSnapshot();
public String getProperty(PyObject[]args,String[]kws);
public String getSystemProperty(PyObject[]args,String[]kws);
public void touch(PyObject[]args,String[]kws);
public void drag(PyObject[]args,String[]kws);
public void press(PyObject[]args,String[]kws);
public void type(PyObject[]args,String[]kws);
public String shell(PyObject[]args,String[]kws);
public void reboot(PyObject[]args,String[]kws);
public boolean installPackage(PyObject[]args,String[]kws);
public boolean removePackage(PyObject[]args,String[]kws);
public void startActivity(PyObject[]args,String[]kws);
public void broadcastIntent(PyObject[]args,String[]kws);
public Map<String,Object>instrument(PyObject[]args,String[]kws);
public void wake(PyObject[]args,String[]kws);
public PyList getPropertyList(PyObject[]args,String[]kws);
public PyList getViewIdList(PyObject[]args,String[]kws);
public Object getViewById(PyObject[]args,String[]kws);
public Object getViewByAccessibilityIds(PyObject[]args,String[]kws);
public Object getRootView(PyObject[]args,String[]kws);
public PyList getViewsByText(PyObject[]args,String[]kws);
The implementation of described step 308 can be:
In sum, the embodiment of the present invention, by increasing by two enumeration types in MonkeyRunner, is respectively used to storage equipment state and execution result, the equipment state in enumeration type is socket disconnecting, carries out reconnecting equipment; Execution result in enumeration type is that operation is when performing unsuccessfully, carry out re-executing operation or reconnecting equipment, solving in available data processing scheme cannot the problem for the treatment of facility and computing machine socket disconnecting, and can not processing terminal executable operations failure time problem, improve the reliability of data processing, decrease the time cost of automatic test course.
Embodiment four
Introduce a kind of data handling system provided by the invention in detail.
With reference to Fig. 4, show the structured flowchart of a kind of data handling system in the embodiment of the present invention four.
Described system can comprise: operation execution result assignment module 400, first abnormality processing module 402.
Introduce the relation between the function of each module and each module below respectively in detail.
Operation execution result assignment module 400, for obtaining test instruction operation execution result when using Test Application to test terminal, and gives described test instruction operation execution result assignment the first variable preset in described Test Application.
First abnormality processing module 402, for calling the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
In sum, the embodiment of the present invention is modified to Test Application by the first variable default in Test Application and execution result process class, add the first variable and execution result process class, the test instruction got is operated execution result assignment to the first variable, obtain the first variable by execution result process class again and carry out abnormality processing according to the test instruction operation of the first variable to execute exception, solve part operation in available data processing scheme and can not obtain operation execution result, the abnormal conditions occurred in operating process cannot be processed, improve the reliability of data processing.
Embodiment five
Introduce a kind of data handling system provided by the invention in detail.
With reference to Fig. 5, show the structured flowchart of a kind of data handling system in the embodiment of the present invention five.
Described system can comprise: SOT state of termination assignment module 500, second abnormality processing module 502, operation execution result assignment module 504, first abnormality processing module 506.
Wherein, described SOT state of termination assignment module 500 can comprise SOT state of termination acquisition module 5001.
Described operation execution result assignment module 504 can comprise: test instruction conversion module 5041, operation execution result acquisition module 5042.
Introduce the relation between the function of each module and each module below respectively in detail.
SOT state of termination assignment module 500, for obtain test instruction operation execution result when using Test Application to test terminal in described operation execution result assignment module 504 before, obtained the SOT state of termination of described terminal by described Test Application, and described SOT state of termination assignment is given the second variable preset in described Test Application.
Preferably, described Test Application can comprise MonkeyRunner etc.
Preferably, described SOT state of termination, can comprise: bootload state, dummy status, off-line state, presence, return to form and unauthorized state etc.
Preferably, described second variable can comprise the global variable of enumeration type.
Preferably, described SOT state of termination assignment module 500: can comprise:
SOT state of termination acquisition module 5001, for revising the second function in described Test Application, and obtains the SOT state of termination of described terminal by amended second function.
Preferably, described second function can be the WaitForConnection function in MonkeyRunner.
Preferably, described SOT state of termination acquisition module 5001 can increase the first static variable and the second static variable in described second function.
Wherein, described first static variable is used for the identification information of storage terminal; Described second static variable is used for the connection time-out information of storage terminal.
Second abnormality processing module 502, for calling the SOT state of termination process class of the described SOT state of termination of process preset in described Test Application, obtain described second variable by described SOT state of termination process class, and according to described second variable, abnormality processing is carried out to the abnormality that described SOT state of termination indicates.
Preferably, described second abnormality processing module 502 can work as described SOT state of termination when being off-line state, re-establishes the connection between described Test Application and described terminal, until described SOT state of termination is presence.
Operation execution result assignment module 504, for obtaining test instruction operation execution result when using Test Application to test terminal, and gives described test instruction operation execution result assignment the first variable preset in described Test Application.
Preferably, described test instruction operation execution result, can comprise: test instruction operation runs succeeded, test instruction operation performs failure, Scoket successful connection and Socket connection failure etc. between described Test Application and described terminal between described Test Application and described terminal.
Preferably, described first variable can comprise the global variable of enumeration type.
Preferably, described operation execution result assignment module 504, can comprise:
Test instruction conversion module 5041, for using the first function preset in described Test Application, test command when described Test Application being tested terminal is converted into the test instruction that described terminal is supported, and is sent to described terminal.
Operation execution result acquisition module 5042, for obtaining the test instruction operation execution result returned after described terminal performs described test instruction.
First abnormality processing module 506, for calling the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
Preferably, described execution result process class, can comprise dynamic proxy class.Wherein, described dynamic proxy class can be MonkeyDeviceProxy class.
Preferably, when described first abnormality processing module 506 can work as described test instruction execution result for performing unsuccessfully, using described Test Application to resend test instruction to described terminal, making described terminal re-execute described test instruction, until test instruction execution result is for running succeeded; Or when described test instruction execution result is Socket connection failure, the Socket re-established between described Test Application with described terminal is connected, until test instruction operation execution result is Socket successful connection.
In sum, the embodiment of the present invention is modified to Test Application by the first variable default in Test Application and execution result process class, add the first variable and execution result process class, the test instruction got is operated execution result assignment to the first variable, obtain the first variable by execution result process class again and carry out abnormality processing according to the test instruction operation of the first variable to execute exception, solve part operation in available data processing scheme and can not obtain operation execution result, the abnormal conditions occurred in operating process cannot be processed, improve the reliability of data processing.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment in this data processing scheme provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure required by system that there is the present invention program is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as the following claims reflect, all features of inventive aspect disclosed single embodiment before being to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in detail in the claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the data processing scheme of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
The invention discloses A1, a kind of data processing method, comprising:
Obtain test instruction operation execution result when using Test Application to test terminal, and give described test instruction operation execution result assignment the first variable preset in described Test Application;
Call the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
A2, method according to A1, wherein, the described test instruction operation execution result obtained when using Test Application to test terminal, comprising:
Use the first function preset in described Test Application, test command when described Test Application being tested terminal is converted into the test instruction that described terminal is supported, and is sent to described terminal;
Obtain the test instruction operation execution result returned after described terminal performs described test instruction.
A3, method according to A1 or A2, wherein, described test instruction operation execution result, comprising:
Test instruction operation runs succeeded, test instruction operation performs failure, Scoket successful connection and Socket connection failure between described Test Application and described terminal between described Test Application and described terminal.
A4, method according to A3, wherein, describedly carries out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction, comprising:
When described test instruction execution result is for performing unsuccessfully, uses described Test Application to resend test instruction to described terminal, making described terminal re-execute described test instruction, until test instruction execution result is for running succeeded; Or
When described test instruction execution result is Socket connection failure, the Socket re-established between described Test Application with described terminal is connected, until test instruction operation execution result is Socket successful connection.
A5, method according to A1, wherein, before the described test instruction operation execution result obtained when using Test Application to test terminal, described method also comprises:
Obtained the SOT state of termination of described terminal by described Test Application, and described SOT state of termination assignment is given the second variable preset in described Test Application;
Call the SOT state of termination process class of the described SOT state of termination of process preset in described Test Application, obtain described second variable by described SOT state of termination process class, and according to described second variable, abnormality processing is carried out to the abnormality that described SOT state of termination indicates.
A6, method according to A5, wherein, the SOT state of termination of the described terminal of described acquisition, comprising:
Revise the second function in described Test Application, and obtain the SOT state of termination of described terminal by amended second function.
A7, method according to A6, wherein, described second function is the WaitForConnection function in MonkeyRunner.
A8, method according to A6, wherein, the second function in the described Test Application of described amendment, comprising:
The first static variable and the second static variable is increased in described second function;
Wherein, described first static variable is used for the identification information of storage terminal; Described second static variable is used for the connection time-out information of storage terminal.
A9, method according to A5 or A6, wherein, described SOT state of termination, comprising:
Bootload state, dummy status, off-line state, presence, to return to form and unauthorized state.
A10, method according to A9, wherein, describedly according to described second variable, abnormality processing is carried out to the abnormality that described SOT state of termination indicates, comprising:
When described SOT state of termination is off-line state, re-establish the connection between described Test Application and described terminal, until described SOT state of termination is presence.
A11, according to the arbitrary described method of A1-A6, wherein, described Test Application comprises MonkeyRunner.
A12, method according to A5, wherein, described first variable comprises the global variable of enumeration type, and described second variable comprises the global variable of enumeration type.
A13, method according to A1, wherein, described execution result process class, comprising: dynamic proxy class.
A14, method according to A12, wherein, described dynamic proxy class is MonkeyDeviceProxy class.
Correspondingly, the invention also discloses B15, a kind of data handling system, comprising:
Operation execution result assignment module, for obtaining test instruction operation execution result when using Test Application to test terminal, and gives described test instruction operation execution result assignment the first variable preset in described Test Application;
First abnormality processing module, for calling the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
B16, system according to B15, wherein, described operation execution result assignment module, comprising:
Test instruction conversion module, for using the first function preset in described Test Application, test command when described Test Application being tested terminal is converted into the test instruction that described terminal is supported, and is sent to described terminal;
Operation execution result acquisition module, for obtaining the test instruction operation execution result returned after described terminal performs described test instruction.
B17, system according to B15 or B16, wherein, described test instruction operation execution result, comprising:
Test instruction operation runs succeeded, test instruction operation performs failure, Scoket successful connection and Socket connection failure between described Test Application and described terminal between described Test Application and described terminal.
B18, system according to B17, wherein, described first abnormality processing module is when described test instruction execution result is for performing unsuccessfully, described Test Application is used to resend test instruction to described terminal, described terminal is made to re-execute described test instruction, until test instruction execution result is for running succeeded; Or when described test instruction execution result is Socket connection failure, the Socket re-established between described Test Application with described terminal is connected, until test instruction operation execution result is Socket successful connection.
B19, system according to B15, wherein, described system also comprises:
SOT state of termination assignment module, for obtain test instruction operation execution result when using Test Application to test terminal in described operation execution result assignment module before, obtained the SOT state of termination of described terminal by described Test Application, and described SOT state of termination assignment is given the second variable preset in described Test Application;
Second abnormality processing module, for calling the SOT state of termination process class of the described SOT state of termination of process preset in described Test Application, obtain described second variable by described SOT state of termination process class, and according to described second variable, abnormality processing is carried out to the abnormality that described SOT state of termination indicates.
B20, system according to B19, wherein, described SOT state of termination assignment module: comprising:
SOT state of termination acquisition module, for revising the second function in described Test Application, and obtains the SOT state of termination of described terminal by amended second function.
B21, system according to B20, wherein, described second function is the WaitForConnection function in MonkeyRunner.
B22, system according to B20, wherein, described SOT state of termination acquisition module increases the first static variable and the second static variable in described second function;
Wherein, described first static variable is used for the identification information of storage terminal; Described second static variable is used for the connection time-out information of storage terminal.
B23, system according to B19 or B20, wherein, described SOT state of termination, comprising:
Bootload state, dummy status, off-line state, presence, to return to form and unauthorized state.
B24, system according to B23, wherein, described second abnormality processing module, when described SOT state of termination is off-line state, re-establishes the connection between described Test Application and described terminal, until described SOT state of termination is presence.
B25, according to the arbitrary described system of B15-B20, wherein, described Test Application comprises MonkeyRunner.
B26, system according to B19, wherein, described first variable comprises the global variable of enumeration type, and described second variable comprises the global variable of enumeration type.
B27, system according to B15, wherein, described execution result process class, comprising: dynamic proxy class.
B28, system according to B26, wherein, described dynamic proxy class is MonkeyDeviceProxy class.

Claims (10)

1. a data processing method, comprising:
Obtain test instruction operation execution result when using Test Application to test terminal, and give described test instruction operation execution result assignment the first variable preset in described Test Application;
Call the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
2. method according to claim 1, wherein, the described test instruction operation execution result obtained when using Test Application to test terminal, comprising:
Use the first function preset in described Test Application, test command when described Test Application being tested terminal is converted into the test instruction that described terminal is supported, and is sent to described terminal;
Obtain the test instruction operation execution result returned after described terminal performs described test instruction.
3. method according to claim 1 and 2, wherein, described test instruction operation execution result, comprising:
Test instruction operation runs succeeded, test instruction operation performs failure, Scoket successful connection and Socket connection failure between described Test Application and described terminal between described Test Application and described terminal.
4. method according to claim 3, wherein, described operation according to the test instruction of described first variable to the execute exception of described test instruction operation execution result instruction carries out abnormality processing, comprising:
When described test instruction execution result is for performing unsuccessfully, uses described Test Application to resend test instruction to described terminal, making described terminal re-execute described test instruction, until test instruction execution result is for running succeeded; Or
When described test instruction execution result is Socket connection failure, the Socket re-established between described Test Application with described terminal is connected, until test instruction operation execution result is Socket successful connection.
5. method according to claim 1, wherein, before the described test instruction operation execution result obtained when using Test Application to test terminal, described method also comprises:
Obtained the SOT state of termination of described terminal by described Test Application, and described SOT state of termination assignment is given the second variable preset in described Test Application;
Call the SOT state of termination process class of the described SOT state of termination of process preset in described Test Application, obtain described second variable by described SOT state of termination process class, and according to described second variable, abnormality processing is carried out to the abnormality that described SOT state of termination indicates.
6. method according to claim 5, wherein, the SOT state of termination of the described terminal of described acquisition, comprising:
Revise the second function in described Test Application, and obtain the SOT state of termination of described terminal by amended second function.
7. method according to claim 6, wherein, described second function is the WaitForConnection function in MonkeyRunner.
8. method according to claim 6, wherein, the second function in the described Test Application of described amendment, comprising:
The first static variable and the second static variable is increased in described second function;
Wherein, described first static variable is used for the identification information of storage terminal; Described second static variable is used for the connection time-out information of storage terminal.
9. the method according to claim 5 or 6, wherein, described SOT state of termination, comprising:
Bootload state, dummy status, off-line state, presence, to return to form and unauthorized state.
10. a data handling system, comprising:
Operation execution result assignment module, for obtaining test instruction operation execution result when using Test Application to test terminal, and gives described test instruction operation execution result assignment the first variable preset in described Test Application;
First abnormality processing module, for calling the execution result process class of the process preset in described Test Application described test instruction operation execution result, obtain described first variable by described execution result process class, and carry out abnormality processing according to the test instruction operation of described first variable to the execute exception of described test instruction operation execution result instruction.
CN201510303439.6A 2015-06-04 2015-06-04 Data processing method and system Pending CN104965780A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510303439.6A CN104965780A (en) 2015-06-04 2015-06-04 Data processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510303439.6A CN104965780A (en) 2015-06-04 2015-06-04 Data processing method and system

Publications (1)

Publication Number Publication Date
CN104965780A true CN104965780A (en) 2015-10-07

Family

ID=54219815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510303439.6A Pending CN104965780A (en) 2015-06-04 2015-06-04 Data processing method and system

Country Status (1)

Country Link
CN (1) CN104965780A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516429A (en) * 2015-12-07 2016-04-20 腾讯科技(深圳)有限公司 Method and system for processing offline of terminal
CN108459961A (en) * 2017-12-29 2018-08-28 微梦创科网络科技(中国)有限公司 The method, client and server of examination are resurveyed after a kind of failure of testing case
CN109299012A (en) * 2018-09-26 2019-02-01 广州云测信息技术有限公司 A kind of test method, device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130077846A (en) * 2011-05-09 2013-07-09 현대자동차주식회사 Exception handling test device and method thereof
CN103268285A (en) * 2013-05-31 2013-08-28 百度在线网络技术(北京)有限公司 Method and device for automatic generation of robustness test case of API interface
US20140081892A1 (en) * 2012-09-20 2014-03-20 IfWizard Corporation Method and system for simplified knowledge engineering
CN103744761A (en) * 2014-01-22 2014-04-23 广东欧珀移动通信有限公司 Method and system for controlling multiple mobile terminals to automatically execute tasks
CN103885429A (en) * 2014-03-31 2014-06-25 航天东方红卫星有限公司 Intelligent remote metering polling control method
CN104105114A (en) * 2013-04-03 2014-10-15 中国移动通信集团公司 Data transmission method, device and terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130077846A (en) * 2011-05-09 2013-07-09 현대자동차주식회사 Exception handling test device and method thereof
US20140081892A1 (en) * 2012-09-20 2014-03-20 IfWizard Corporation Method and system for simplified knowledge engineering
CN104105114A (en) * 2013-04-03 2014-10-15 中国移动通信集团公司 Data transmission method, device and terminal
CN103268285A (en) * 2013-05-31 2013-08-28 百度在线网络技术(北京)有限公司 Method and device for automatic generation of robustness test case of API interface
CN103744761A (en) * 2014-01-22 2014-04-23 广东欧珀移动通信有限公司 Method and system for controlling multiple mobile terminals to automatically execute tasks
CN103885429A (en) * 2014-03-31 2014-06-25 航天东方红卫星有限公司 Intelligent remote metering polling control method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
施懿民: "《Android应用测试与调试实战》", 30 April 2014, 北京:机械工业出版社 *
林政: "《深入浅出:Windows Phone8.1应用开发》", 30 September 2014, 北京:清华大学出版社 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516429A (en) * 2015-12-07 2016-04-20 腾讯科技(深圳)有限公司 Method and system for processing offline of terminal
CN105516429B (en) * 2015-12-07 2019-12-17 腾讯科技(深圳)有限公司 terminal offline processing method and system
CN108459961A (en) * 2017-12-29 2018-08-28 微梦创科网络科技(中国)有限公司 The method, client and server of examination are resurveyed after a kind of failure of testing case
CN109299012A (en) * 2018-09-26 2019-02-01 广州云测信息技术有限公司 A kind of test method, device and electronic equipment

Similar Documents

Publication Publication Date Title
CN108876619B (en) Processing method, device, equipment and medium based on block chain intelligent contract
CN109739523B (en) Application program packaging method and device, storage medium and terminal
KR102281052B1 (en) Mobile terminal application update method and apparatus
CN109062617A (en) A kind of application method, the mobile terminal of platform that supporting polymorphic type equipment
CN104699616A (en) Method, device and system for testing application
US8464230B2 (en) Methods and systems to implement non-ABI conforming features across unseen interfaces
CN103019941B (en) program debugging method and device
CN110119280A (en) The method and device of more firmware upgrades
CN114077423A (en) Airport APP development container architecture based on mobile cross-platform
CN104750528A (en) Management method and device for components in Android program
CN111026439B (en) Application program compatibility method, device, equipment and computer storage medium
CN104965780A (en) Data processing method and system
CN108037941A (en) Application program update method, electronic equipment based on public plug-in unit, storage medium
CN109144525A (en) A kind of software installation method and system of network self-adapting
CN106021101A (en) Method and device for testing mobile terminal
CN113384896A (en) Unity-based resource packaging method, device, equipment and medium
CN115098139A (en) Firmware updating method and system, lower computer and storage medium
CN110221840B (en) Function implementation method and device of application program, equipment and storage medium
CN104765624A (en) Update processing method and device for virtual machine application
CN104484176A (en) Android system window object acquiring method and android system window object acquiring device
CN116248526A (en) Method and device for deploying container platform and electronic equipment
CN114564241B (en) Method and device for accessing hardware device, computer device and storage medium
CN109725905A (en) Software architecture and implementation method based on source code collection, plug-in unit and application method for compiling pins component
CN112559336B (en) Method, device and system for self-adaptively debugging heterogeneous computing chip and main board chip
CN109766115A (en) A kind of foolproof method and system of smart machine upgrading

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151007

RJ01 Rejection of invention patent application after publication