Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed
Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific
The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Fig. 1 shows the implementation process of the method for managing and monitoring of safety test task provided in an embodiment of the present invention, the party
Method process includes step S101 to S106.The method for managing and monitoring is suitable for supervising the simulator for executing safety test task
The situation of keyholed back plate reason.The method for managing and monitoring is executed by monitoring management apparatus, and the monitoring management apparatus is configured at terminal device,
It can be implemented by software and/or hardware.Terminal device includes desktop computer, laptop, tablet computer (Portable
Android Device, PAD), the portable or non-portable terminal device such as smart phone and server.The same luck of terminal device
The multiple simulators of row.The specific implementation principle of each step is as follows.
S101 obtains the occupancy result information of simulator, filters out unappropriated mould based on the occupancy result information
Quasi- device.
Wherein, terminal device runs multiple simulators simultaneously.Simulator is the virtual terminal equipment in terminal device, such as
Virtual machine, for simulating true hardware terminal equipment, to run application program in simulator.
It occupies result information and includes whether simulator is marked as having occupied.It is when simulator is assigned Detection task, i.e., non-
When idle state, simulator is labeled as having occupied;When simulator completes safety test task, the occupancy shape of simulator is discharged
State.
The occupancy result information of simulator is obtained, to filter out unappropriated simulation based on the occupancy result information
Device.
S102 determines target simulator from unappropriated simulator, distributes safety test to the target simulator
Task.
Wherein, target simulator is determined from unappropriated simulator, and safety test task is distributed into target simulation
Device, and the target simulator for being assigned with safety test task is labeled as having occupied.To carry out safety test next time times
When business distribution, safety test task is no longer distributed to the simulator occupied, improves detection efficiency.
S103 obtains the application information of the safety test task, according to application information acquisition
The installation kit of safety test task.
Wherein, safety test task includes application name to be measured, after safety test task has been determined, just really
Application program to be measured is determined.Multiple application informations are stored in the safety test assignment database of terminal device, true
After having determined safety test task, the installation kit of safety test task can be obtained according to application information, i.e., application to be measured
The installation kit of program.The application information includes at least application name, application version information and installation kit and deposits
Store up path.
In embodiments of the present invention, according to the installation kit store path in the application information, it can be obtained detection
The installation kit of task, is installed and activated application program in simulator, to carry out the subsequent safety detection stream to application program
Journey.
S104 controls the target simulator and installs the installation kit, generates the application program of the safety test task.
S105 carries out safe inspection to the application program in the target simulator after application program unlatching
Flow gauge.
Wherein, safety test data are sent to application program to run, monitor the safety detection result of simulator, i.e.,
The output of simulator is as a result, to judge whether application program passes through safety detection according to output result.
Illustratively, in the operational process of application program, the component that the outside in application program can call is passed to abnormal
Shape parameter, receive output after the deformity parameter by monitoring application program as a result, acquisition safety test task safety
Test result.The output journal and document content information that simulator can be monitored, judge output journal and document content information
Whether exception is occurred, application program is determined if there is exception, and there are security breaches, and group can be called by recording the outside currently tested
Part, continuing to test next outside can invocation component.
S106 exports the safety test result of the application program after safety detection process.
Wherein, after the completion of all detections, safety detection result is analyzed, analyzes safety existing for application program
Loophole, and summarize and generate safety test result.
When output safety test result, it is meant that the safety test task of simulator has been completed, at this point, release simulation
The occupied state of device.
In the embodiment of the present invention, by running multiple simulators simultaneously on the terminal device, the occupancy shape of simulator is obtained
Safety test task is distributed to unappropriated simulator by state information, is detected to realize automatically to application security
Automatic realization, and can pass through multiple simulators realize simultaneously multitask detection.In addition, will test task distribute to it is unoccupied
Simulator, improve the stability of terminal device.
On the basis of the above embodiments, as shown in Fig. 2, the present invention also provides a kind of monitoring pipes of safety test task
Reason method, the present embodiment on the basis of the above embodiments, before step S101 the step of more initialization simulators.The reality
Example place same as the previously described embodiments is applied to repeat no more, as shown in Fig. 2, the method for managing and monitoring include step S201 extremely
S207.The specific implementation principle of each step is as follows.
S201, obtains the initial number of simulator, and opens the simulator of the initial number.
As an embodiment of the present invention, mould is arranged in the resource size according to shared by the load capacity of terminal device and simulator
The initial number of quasi- device simultaneously starts resident.As another embodiment of the present invention, the initial number of simulator is rule of thumb set, is led to
Often estimated according to the quantity of current detection task, meanwhile, the simulator for opening initial number can't occupied terminal equipment
Whole resources, to ensure the stability of system operation.
In addition, obtaining terminal device present load ability before subsequent allocations Detection task, determine whether to open new
Simulator or close operation simulator.By changing the simulator quantity of operation, safeguarded while improving detection efficiency
The stability of system will be described in detail in subsequent embodiment, and details are not described herein again, the 101-106 in 202-207 and embodiment one
Identical, details are not described herein.
On the basis of above-mentioned Fig. 1 or embodiment illustrated in fig. 2, the present invention also provides a kind of monitoring of safety test task
Management method, the present embodiment increase the step for changing the simulator quantity of operation on the basis of above-mentioned Fig. 1 or Fig. 2 embodiment
Suddenly, while improving detection efficiency maintenance system stability, the embodiment of the present invention carries out based on embodiment described in Fig. 2
It is illustrated for improvement, as shown in figure 3, the method for managing and monitoring includes step S301 to S308.The specific reality of each step
Existing principle is as follows.
S301, obtains the initial number of simulator, and opens the simulator of the initial number.
S302 obtains the occupancy result information of simulator, filters out unappropriated mould based on the occupancy result information
Quasi- device.
S303 is set if the quantity of safety test task is higher than the quantity of the unappropriated simulator according to terminal
Standby current load situation, it is determined whether new simulator is opened, if the present load of terminal device is not up to preset threshold,
Open new simulator.
Wherein, safety test task is obtained, if the quantity of the safety test task obtained is higher than unappropriated simulator
Quantity when, monitor terminal device current load situation, according to the current load situation of terminal device, it is determined whether open new
Simulator, if the present load of terminal device is not up to preset threshold, i.e. the load of terminal device is more than needed, then opens new simulation
Device, to increase unoccupied simulator.
The quantity for opening new simulator determines according to simulator current load situation, the new simulator number of unlatching
Amount, cannot make the load of terminal device equal or exceed preset threshold, i.e., cannot make the load too high of terminal device.
New simulator is opened to increase the quantity of unappropriated simulator, to improve detection efficiency.
Preset threshold is empirical value, is typically expressed as the load capacity of terminal device, for example, may be configured as terminal device money
Source occupancy 60% to 85% when payload size etc..The present invention is not particularly limited this.
It should be noted that according to the current load situation of terminal device, it is determined whether new simulator is opened, if terminal
The present load of equipment equals or exceeds preset threshold, then is not turned on new simulator, i.e., does not increase unoccupied simulator.This
Outside, if the present load of terminal device is more than preset threshold, the process of unappropriated simulator can also be closed, to reduce end
The load of end equipment.The embodiment of the present invention while on the one hand improving detection efficiency, also maintains the stability of system.
As an embodiment of the present invention, if the quantity of safety test task is higher than the number of the unappropriated simulator
When measuring a preset value, according to the current load situation of terminal device, it is determined whether new simulator is opened, if terminal device
Present load is not up to preset threshold, then opens new simulator.
S304 determines target simulator from unappropriated simulator, distributes safety test to the target simulator
Task.
Wherein, target simulator is determined from unappropriated simulator, distributes safety test to the target simulator
Task, comprising: according to the quantity of the quantity of safety test task and unappropriated simulator, from unappropriated simulator
It determines target simulator, distributes safety test task to the target simulator.
If the quantity of the safety test task received be it is N number of, unappropriated simulator is M, and wherein M is greater than or waits
In N, then N number of target simulator is determined from unappropriated M simulator, be respectively used to execute in safety test task queue
N number of safety test task, wherein M and N is positive integer;
If the quantity of the safety test task received be it is N number of, unappropriated simulator is M, and wherein M is less than N, then
Unappropriated M simulator is determined as target simulator, is respectively used to execute the M of head of the queue in safety test task queue
A safety test task.
Further, N number of target simulator is determined from unappropriated M simulator, is respectively used to execute safe survey
Try N number of safety test task in task queue, comprising:
Obtain each target simulator execute respectively resource CPn1, CPn2 shared by N number of safety test task ...,
CPnN, wherein CPn1, CPn2 ..., CPnN respectively indicate n-th of target simulator execute respectively the 1st to n-th pacify
Resource shared by full test assignment;The value of n is the positive integer from 1 to N;
Resource shared by N number of safety test task is executed respectively based on N number of target simulator, generates resources costs matrix
COST;
Each element (i, j) of resources costs Matrix C OST is subtracted into its minimum value CPimin of the row and column
Minimum value CPjmin obtains intermediate Cost matrix COST ';
The row and/or column that intermediate Cost matrix is covered using the horizontal line and vertical line of minimum total number, to cover institute
State all elements 0 in intermediate Cost matrix;
Determine the least member in uncovered element;
Uncovered element each element of the row is individually subtracted the least member, and by each of capped column
Element adds the least member, until the element 0 in intermediate Cost matrix can be covered using N horizontal line and vertical line,
I.e. minimum total number is N;At this point, resultant costs Matrix C OST " is generated, at least N number of element in resultant costs Matrix C OST "
It is 0;
According to element in resultant costs Matrix C OST " be 0 the corresponding resources costs Matrix C OST of element position element,
The corresponding relationship of N number of target simulator Yu N number of safety test task is obtained, so that it is determined that N number of target simulator is respectively used to hold
N number of safety test task in row safety test task queue.
As an embodiment of the present invention, resultant costs matrix are as follows:
Wherein, the element position of the element 0 in resultant costs Matrix C OST " is (i, j), i=j, resources costs matrix
The corresponding element of element position is successively in COST are as follows: first aim simulator is thus used for by CP11, CP22 ..., CPNN
First safety test task is executed, second target simulator is for executing second safety test task, and so on, the
N number of simulator is for executing n-th safety test task.
As further embodiment of this invention, resultant costs matrix are as follows:
Wherein, the element position of the element 0 in resultant costs Matrix C OST " be (1,2), (2,1), (3, j) ..., (N,
N), wherein the positive integer that j value is 1 to N, the corresponding element of element position is successively in resources costs Matrix C OST are as follows: CP12,
CP21 ..., CPNN, thus, first aim simulator is used to execute second safety test task, second target mould
Quasi- device is for executing first safety test task, and so on, n-th simulator is for executing n-th safety test task.
By this set, safety test task can be distributed thereby executing safety in the case where occupying the least situation of resource
Test assignment greatly improves detection efficiency, and 305-308 is identical as the 103-106 in embodiment one, and details are not described herein.
On the basis of above-mentioned Fig. 1, Fig. 2 or embodiment illustrated in fig. 3, the present invention also provides a kind of safety test tasks
Method for managing and monitoring, the present embodiment increase terminal device and web terminal are handed on the basis of above-mentioned Fig. 1, Fig. 2 or Fig. 3 embodiment
Mutual step, the embodiment of the present invention is illustrated for improving based on the embodiment described in Fig. 1, as shown in figure 4, described
Method for managing and monitoring includes step S401 to S406.The specific implementation principle of each step is as follows.
S401 obtains the occupancy result information of simulator, filters out unappropriated mould based on the occupancy result information
Quasi- device.
S402 determines target simulator from unappropriated simulator, distributes safety test to the target simulator
Task.
S403 obtains the application information of the safety test task, according to institute from safety test assignment database
State the installation kit that application information obtains the safety test task.
Wherein, the safety test assignment database is the safety test task application program information uploaded from web terminal
Storing data library, safety test assignment database is stored with the application information of safety test task, for terminal device to mould
It is read when quasi- device distribution Detection task.Web terminal can be user terminal.
S404 controls the target simulator and installs the installation kit, generates the application program of the safety test task.
S405 carries out safe inspection to the application program in the target simulator after application program unlatching
Flow gauge.
S406 exports the safety test of the application program as a result, the safety is surveyed after safety detection process
Test result is stored in testing result database, transfers and shows for web terminal.
In embodiments of the present invention, web terminal is mainly used for user's login, uploads application program to be detected, display detection knot
Fruit.Using the mode for separating web terminal with the terminal device for executing method for managing and monitoring, the two reads data in the database,
For example, application program to be detected is deposited into safety test assignment database by web terminal, and terminal device goes to read automatically, has run
After monitor supervisor, operation result is stored to testing result database, web terminal reads testing result.Wherein, safety test
Assignment database and testing result database can all be the database in web server.It is not deposited between the end Web and terminal device
In mutual the case where calling, the problem of leading to web terminal thread block can be collapsed to avoid because of simulator.
Optionally, on the basis of the embodiment described in Fig. 1, Fig. 2, Fig. 3 or Fig. 4, unappropriated simulator is being filtered out
Later, further includes: obtain the current load situation of terminal device, if the present load of terminal device is more than preset threshold, tie
The process of the unappropriated simulator of beam.
Wherein, after filtering out unappropriated simulator, the current load situation of terminal device is obtained, if terminal is set
Standby present load is more than preset threshold, the i.e. load too high of terminal device, then terminates the process of unappropriated simulator, with
The load of the terminal device is reduced, thus the further stability of maintenance system.
It should be noted that suspending the distribution of Detection task after terminating the process of unappropriated simulator, until having
Simulator release busy state, at this point, the current load situation of terminal device is obtained again, if the present load of terminal device is not
Reach preset threshold, then determine target simulator from unappropriated simulator, is surveyed to target simulator distribution safety
Trial business.
It is optionally, described after the application program unlatching on the basis of embodiment described in Fig. 1, Fig. 2, Fig. 3 or Fig. 4,
In the target simulator to the application program carry out safety detection process after, further includes:
When monitoring that the safety detection process is not finished within preset duration, or listen to the safety detection process
It generates exception to report an error, then forces the safety test task for terminating the target simulator, discharge the occupied state of present day analog device,
And check whether the target simulator survives;If the target simulator is not survive, pressure terminates the target simulation
Device process, and mark and generate abnormal safety test task;
According to the current load situation of terminal device, it is determined whether new simulator is opened, if terminal device is current negative
It carries and is not up to preset threshold, then open new simulator, and the safety test for being to label by the new simulator
Task re-starts test;If causing the safety detection process of new simulator default labeled as abnormal safety test task
Be not finished or generate within duration it is abnormal report an error, then end mark is the distribution of abnormal safety test task, and feedback flag
It is the feedback information of abnormality detection task for abnormal safety test task.
Wherein, when monitoring that the safety detection process is not finished within preset duration, i.e., the target simulator occupies
Overlong time, or listen to the safety detection process generation exception and report an error, then force the safety for terminating the target simulator
Test assignment, discharges the occupied state of present day analog device, and checks whether the target simulator survives;If the target simulation
Device is not survive, then forces to terminate the target simulator process, and reject the simulator from simulator list, join it not
With the distribution of subsequent detection task, label generates abnormal safety test task.Hereafter, if the present load of terminal device does not reach
To preset threshold, then new simulator, and the safety test task weight for being to label by the new simulator are opened
Newly tested;If again leading to the safety detection process of new simulator when default labeled as abnormal safety test task
Exception is not finished or generated within length to report an error, then end mark is the distribution of abnormal safety test task, and feedback flag is
Abnormal safety test task is the feedback information of abnormality detection task.At this point, confirming that the Detection task is deposited by detecting twice
In exception, detection accuracy is improved.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Corresponding to method for managing and monitoring described in foregoing embodiments, Fig. 5 shows monitoring pipe provided in an embodiment of the present invention
The structural block diagram of device is managed, for ease of description, only parts related to embodiments of the present invention are shown.
Referring to Fig. 5, which includes:
Screening module 51 is filtered out not for obtaining the occupancy result information of simulator based on the occupancy result information
Occupied simulator;
Distribution module 52, for determining target simulator from unappropriated simulator, to the target simulator point
With safety test task;
Module 53 is obtained, for obtaining the application information of the safety test task, is believed according to the application program
Breath obtains the installation kit of the safety test task;
Generation module 54 installs the installation kit for controlling the target simulator, generates the safety test task
Application program;
Safety detection module 55 is used for after application program unlatching, to the application in the target simulator
Program carries out safety detection process;
Output module 56, for exporting the safety test result of the application program after safety detection process.
Optionally, as shown in fig. 6, the monitoring management apparatus further include:
Initialization module 50 for obtaining the initial number of simulator, and opens the simulator of the initial number.
Terminate scheduler module 57, for obtaining the current load situation of terminal device, if the present load of terminal device is super
Preset threshold is crossed, then terminates the process of unappropriated simulator.
Optionally, as shown in fig. 7, the monitoring management apparatus further include:
Loading module 58, if the quantity for safety test task is higher than the quantity of the unappropriated simulator,
According to the current load situation of terminal device, it is determined whether new simulator is opened, if the present load of terminal device is not up to
Preset threshold then opens new simulator.
Optionally, as shown in figure 8, the monitoring management apparatus further include:
Detection module 59 monitors that the safety detection process is not finished within preset duration for working as, or listens to
The safety detection process generates exception and reports an error, then forces the safety test task for terminating the target simulator, and release is current
The occupied state of simulator, and check whether the target simulator survives;If the target simulator is not survive, force
Terminate the target simulator process, and marks and generate abnormal safety test task;
According to the current load situation of terminal device, it is determined whether new simulator is opened, if terminal device is current negative
It carries and is not up to preset threshold, then open new simulator, and the safety test for being to label by the new simulator
Task re-starts test;If causing the safety detection process of new simulator default labeled as abnormal safety test task
Be not finished or generate within duration it is abnormal report an error, then end mark is the distribution of abnormal safety test task, and feedback flag
It is the feedback information of abnormality detection task for abnormal safety test task.
Fig. 9 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in figure 9, the terminal of the embodiment is set
Standby 9 include: processor 90, memory 91 and are stored in the meter that can be run in the memory 91 and on the processor 90
Calculation machine program 92, such as monitor supervisor.The processor 90 realizes above-mentioned monitoring pipe when executing the computer program 92
Manage the step in embodiment of the method, such as step S101 to S106 shown in FIG. 1.Alternatively, the processor 90 executes the meter
The function of each module/unit in above-mentioned each Installation practice, such as the function of module 51 to 56 shown in Fig. 5 are realized when calculation machine program 92
Energy.
Illustratively, the computer program 92 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 91, and are executed by the processor 90, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for
Implementation procedure of the computer program 92 in the terminal device 9 is described.
The terminal device 9 can be desktop computer, laptop, PAD, smart phone and server etc..The end
End equipment 9 may include, but be not limited only to, processor 90, memory 91.It will be understood by those skilled in the art that Fig. 9 is only eventually
The example of end equipment 9 does not constitute the restriction to terminal device 9, may include than illustrating more or fewer components or group
Certain components or different components are closed, such as the terminal device can also be set including input-output equipment, network insertion
Standby, bus etc..
Alleged processor 90 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng.
The memory 91 can be the internal storage unit of the terminal device 9, such as the hard disk or interior of terminal device 9
It deposits.The memory 91 is also possible to the External memory equipment of the terminal device 9, such as be equipped on the terminal device 9
Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge
Deposit card (Flash Card) etc..Further, the memory 91 can also both include the storage inside list of the terminal device 9
Member also includes External memory equipment.The memory 91 is for storing needed for the computer program and the terminal device
Other programs and data.The memory 91 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing
The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list
Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system
The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.