CN109902023B - Test code handover control method and device - Google Patents

Test code handover control method and device Download PDF

Info

Publication number
CN109902023B
CN109902023B CN201910203983.1A CN201910203983A CN109902023B CN 109902023 B CN109902023 B CN 109902023B CN 201910203983 A CN201910203983 A CN 201910203983A CN 109902023 B CN109902023 B CN 109902023B
Authority
CN
China
Prior art keywords
node
processing task
task amount
load
preset
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.)
Active
Application number
CN201910203983.1A
Other languages
Chinese (zh)
Other versions
CN109902023A (en
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910203983.1A priority Critical patent/CN109902023B/en
Publication of CN109902023A publication Critical patent/CN109902023A/en
Priority to PCT/CN2019/117654 priority patent/WO2020186781A1/en
Application granted granted Critical
Publication of CN109902023B publication Critical patent/CN109902023B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Abstract

The invention relates to the technical field of software testing, and discloses a test code handover control method and a test code handover control device, which comprise the following steps: when a handover instruction is detected, determining the node processing task amount according to the node load condition information in the node information; judging whether the processing task quantity of the node is lower than the processing task quantity of a preset node or not; when the node processing task amount is judged to be higher than or equal to the preset node processing task amount, acquiring the node processing rate according to the node processing capacity information; generating a handover time node matched with the test code according to the node processing rate and the node processing task amount; and when the node processing task amount is judged to be lower than the preset node processing task amount, determining the current moment as a handover time node matched with the test code. Under the method, based on the software testing technology, the test codes are handed over at proper time, and the problem that the time for handing over the test codes is too long due to poor time for handing over the test environment is solved.

Description

Test code handover control method and device
Technical Field
The invention relates to the technical field of software testing, in particular to a test code handover control method and device.
Background
At present, system tests are widely applied to service systems in different fields, and the problems of the service systems can be found and solved in time by performing the system tests on the service systems, so that the reliability of the operation of the service systems is improved.
When testing a service system group covering a plurality of service systems, a test code corresponding to the service system to be tested is usually handed over to a test environment. In practice, it is found that in the process of transferring the test environment to the test code corresponding to the service system, a phenomenon that the transfer time is inappropriate often occurs, for example, when the test environment is congested, so that the transfer time far exceeds the normal transfer time.
In summary, the prior art has the following defects: the poor opportunity for test code to hand over to the test environment results in an excessively long hand-over time.
Disclosure of Invention
The invention provides a test code handover control method and device, aiming at solving the problem that the handover time is too long due to poor opportunity of handing over a test environment of a test code in the related art.
The first aspect of the embodiments of the present invention discloses a test code handover control method, which includes:
when a transfer instruction for instructing transfer of a test code to a test environment is detected, acquiring node information in the test environment, wherein the node information at least comprises node load condition information and node processing capacity information;
determining the processing task amount of the node according to the node load condition information;
judging whether the processing task quantity of the node is lower than the processing task quantity of a preset node or not;
when the node processing task amount is judged to be higher than or equal to the preset node processing task amount, acquiring the node processing rate according to the node processing capacity information;
calculating the future processing task quantity of the node matched with the predicted time node according to the processing task quantity of the node, the processing rate of the node and a preset prediction formula, wherein the preset prediction formula is as follows:
x=a-v×t
wherein a represents the node processing task quantity, v represents the node processing rate, t represents the predicted time node, and x represents the node future processing task quantity matched with the predicted time node;
correspondingly storing the predicted time node and the node future processing task amount matched with the predicted time node to obtain a node time sequence prediction summary table;
selecting a target node processing task amount of which the future processing task amount of the node is smaller than the preset node processing task amount from the node time sequence prediction summary table;
determining a target predicted time node matched with the target node processing task amount as a handover time node matched with the test code;
and when the node processing task amount is judged to be lower than the preset node processing task amount, determining the current moment as a handover time node matched with the test code.
A second aspect of the embodiments of the present invention discloses a test code handover control apparatus, including:
a first acquisition unit configured to acquire node information in a test environment when a handover instruction instructing handover of a test code to the test environment is detected, the node information including at least node load condition information and node processing capability information;
the first determining unit is used for determining the processing task amount of the node according to the node load condition information;
the judging unit is used for judging whether the processing task quantity of the node is lower than the processing task quantity of a preset node or not;
the second acquisition unit is used for acquiring the node processing rate according to the node processing capacity information when the node processing task amount is judged to be higher than or equal to the preset node processing task amount;
the generation unit is used for calculating the node future processing task amount matched with the predicted time node according to the node processing task amount, the node processing rate and a preset prediction formula, wherein the preset prediction formula is as follows:
x=a-v×t
wherein a represents the node processing task quantity, v represents the node processing rate, t represents the predicted time node, and x represents the node future processing task quantity matched with the predicted time node;
the generation unit is also used for correspondingly storing the predicted time node and the node future processing task amount matched with the predicted time node to obtain a node time sequence prediction summary table; selecting a target node processing task amount of which the future processing task amount of the node is smaller than the preset node processing task amount from the node time sequence prediction summary table; determining a target predicted time node matched with the target node processing task amount as a handover time node matched with the test code;
and the second determining unit is used for determining the current moment as a handover time node matched with the test code when the node processing task amount is judged to be lower than the preset node processing task amount.
A third aspect of an embodiment of the present invention discloses an electronic device, including:
a processor;
a memory having computer readable instructions stored thereon which, when executed by the processor, implement the method as before.
A fourth aspect of the embodiments of the present invention discloses a computer-readable storage medium storing a computer program that causes a computer to execute the foregoing method.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
the test code handover control method provided by the invention comprises the following steps of acquiring node information in a test environment when a handover instruction for instructing the handover of a test code to the test environment is detected, wherein the node information at least comprises node load condition information and node processing capacity information; determining the processing task amount of the node according to the node load condition information; judging whether the processing task quantity of the node is lower than the processing task quantity of a preset node or not; when the node processing task amount is judged to be higher than or equal to the preset node processing task amount, acquiring the node processing rate according to the node processing capacity information; calculating the future processing task quantity of the node matched with the predicted time node according to the processing task quantity of the node, the processing rate of the node and a preset prediction formula, wherein the preset prediction formula is as follows:
x=a-v×t
wherein a represents the node processing task quantity, v represents the node processing rate, t represents the predicted time node, and x represents the node future processing task quantity matched with the predicted time node; correspondingly storing the predicted time node and the node future processing task amount matched with the predicted time node to obtain a node time sequence prediction summary table; selecting a target node processing task amount of which the future processing task amount of the node is smaller than the preset node processing task amount from the node time sequence prediction summary table; determining a target predicted time node matched with the target node processing task amount as a handover time node matched with the test code; and when the node processing task amount is judged to be lower than the preset node processing task amount, determining the current moment as a handover time node matched with the test code.
Under the method, based on a software testing technology, when a handover instruction indicating handover of the test code is detected, the handover time of the test code can be determined according to the node information in the test environment, so that the test code is handed over when the node processing task amount in the test environment is not high, the handover time is reduced, and the problem that the handover time is too long due to poor handover time of the test code to the test environment is solved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic diagram illustrating a test code handoff control apparatus in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a test code handoff control method in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating another test code handoff control method in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating a test code handover control apparatus according to an example embodiment;
fig. 5 is a block diagram illustrating another test code handover control apparatus according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention.
The environment in which the invention is implemented may be a portable mobile device, such as a smartphone, tablet, desktop computer.
Fig. 1 is a schematic diagram illustrating a test code handover control apparatus according to an exemplary embodiment. The apparatus 100 may be the portable mobile device described above. As shown in fig. 1, the apparatus 100 may include one or more of the following components: a processing component 102, a memory 104, a power component 106, a multimedia component 108, an audio component 110, a sensor component 114, and a communication component 116.
The processing component 102 generally controls overall operation of the device 100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations, among others. The processing component 102 may include one or more processors 118 to execute instructions to perform all or a portion of the steps of the methods described below. Further, the processing component 102 can include one or more modules for facilitating interaction between the processing component 102 and other components. For example, the processing component 102 can include a multimedia module for facilitating interaction between the multimedia component 108 and the processing component 102.
The memory 104 is configured to store various types of data to support operations at the apparatus 100. Examples of such data include instructions for any application or method operating on the device 100. The Memory 104 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. Also stored in memory 104 are one or more modules for execution by the one or more processors 118 to perform all or a portion of the steps of the methods described below.
The power supply component 106 provides power to the various components of the device 100. The power components 106 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 100.
The multimedia component 108 includes a screen that provides an output interface between the device 100 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a touch panel. If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. The screen may further include an Organic Light Emitting Display (OLED for short).
The audio component 110 is configured to output and/or input audio signals. For example, the audio component 110 includes a Microphone (MIC) configured to receive external audio signals when the device 100 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 104 or transmitted via the communication component 116. In some embodiments, the audio component 110 further comprises a speaker for outputting audio signals.
The sensor assembly 114 includes one or more sensors for providing various aspects of status assessment for the device 100. For example, the sensor assembly 114 may detect the open/closed status of the device 100, the relative positioning of the components, the sensor assembly 114 may also detect a change in position of the device 100 or a component of the device 100, and a change in temperature of the device 100. In some embodiments, the sensor assembly 114 may also include a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 116 is configured to facilitate wired or wireless communication between the apparatus 100 and other devices. The device 100 may access a Wireless network based on a communication standard, such as WiFi (Wireless-Fidelity). In an exemplary embodiment, the communication component 116 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the Communication component 116 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, bluetooth technology, and other technologies.
In an exemplary embodiment, the apparatus 100 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital signal processors, digital signal processing devices, programmable logic devices, field programmable gate arrays, controllers, microcontrollers, microprocessors or other electronic components for performing the methods described below.
Fig. 2 is a flowchart illustrating a test code handover control method according to an exemplary embodiment.
As shown in fig. 2, the method comprises the steps of:
step 201, when a handover instruction for instructing the handover of the test code to the test environment is detected, node information in the test environment is acquired, wherein the node information at least comprises node load condition information and node processing capacity information.
In the embodiment of the present invention, the test environment includes a plurality of nodes, each node may process a corresponding test task, and the node information of each node may include, but is not limited to, node processing capability information and node load condition information, where the node processing capability information may indicate the number of tasks that the node may process, and the node load condition information may indicate the number of tasks that the node is currently processing.
Step 202, determining the processing task amount of the node according to the node load condition information.
As an optional implementation manner, determining the processing task amount of the node according to the node load condition information may include:
acquiring the task amount being processed of each node according to the node load condition information;
and calculating the average value of the quantities of the tasks being processed of each node, and determining the average value as the quantity of the tasks processed by the node.
In the embodiment of the invention, the node load condition information comprises the task amount being processed of each node, and the average value of the task amount being processed of each node is taken as the node processing task amount, so that the current overall node processing task amount condition of all the nodes is reflected, and the understanding of the overall node processing task amount condition is enhanced.
By implementing the alternative implementation mode, the average value of the task quantities being processed can be calculated according to the task quantities being processed of each node, the average value is determined as the node processing task quantity, and therefore an index capable of comprehensively evaluating the task quantities being processed of the nodes is obtained, and the node of the test code handover time is determined according to the index, and the method is more reliable.
Step 203, judging whether the node processing task amount is lower than the preset node processing task amount, if so, executing step 206, and if not, executing step 204 to step 205.
In the embodiment of the present invention, the preset node processing task amount may be a maximum node processing task amount under a preset normal working condition of the test environment. If the node processing task amount is lower than the preset node processing task amount, the node processing task amount at the current moment is in the range of the node processing task amount of normal work of the test environment, and at the moment, the current moment can be determined as the handover time node matched with the test code. If the node processing task amount is higher than or equal to the preset node processing task amount, it indicates that the node processing task amount at the current moment is not within the range of the node processing task amount of normal work of the test environment, and at this time, the handover time node can be further determined according to the node processing rate and the node processing task amount.
And step 204, acquiring the node processing rate according to the node processing capacity information.
In the embodiment of the present invention, the node processing capability information at least includes the processing rate of each node, and an average value may be calculated according to the processing rate of each node, and the average value is used as the node processing rate, where the node processing rate is used to reflect the speed information of the node processing data at the current time.
As an optional implementation manner, obtaining the node processing rate according to the node processing capability information may include:
acquiring the processing rate of each node according to the node processing capacity information;
and calculating the average value of the processing rates of the nodes, and determining the average value as the processing rate of the nodes.
By implementing the alternative implementation mode, the average value of the node processing rates can be calculated according to the node processing rate of each node, and the average value is determined as the node processing rate, so that an index capable of comprehensively evaluating the node processing rates is obtained, and the test code handover time node is determined according to the index, and the method is more reliable.
Step 205, based on the node processing rate and the node processing task amount, generating a handover time node matched with the test code.
As an alternative embodiment, the generating the handover time node with the test code matched according to the node processing rate and the node processing task amount may include:
calculating the future processing task quantity of the node matched with the predicted time node according to the processing task quantity of the node, the processing rate of the node and a preset prediction formula, wherein the preset prediction formula is as follows:
x=a-v×t
wherein, a represents the processing task amount of the node, v represents the processing rate of the node, t represents the predicted time node, and x represents the future processing task amount of the node matched with the predicted time node;
correspondingly storing the predicted time node and the node future processing task amount matched with the predicted time node to obtain a node time sequence prediction summary table;
selecting a target node processing task amount of which the future processing task amount of the node is smaller than the preset node processing task amount from the node time sequence prediction summary table;
and determining the target predicted time node matched with the target node processing task amount as the handover time node matched with the test code.
In the embodiment of the present invention, the unit of the node processing rate v may be defined as the number of tasks per second, the unit of the predicted time node t may be defined as seconds, and the predicted time node t may indicate the time after the elapse of t from the current time, for example, when the predicted time node t is 30s, the time after the elapse of 30 seconds. The number of the future processing tasks of the node corresponding to a plurality of future times (the times after 1s, 2s, 3s and the like) can be calculated by the preset prediction formula.
By implementing the optional implementation mode, the node future processing task amount of the plurality of predicted time nodes matched with each predicted time node can be calculated, the node time sequence prediction total table is obtained, and the target predicted time node with the node future processing task amount smaller than the preset node processing task amount is determined from the node time sequence prediction total table, so that the test code handover is performed as early as possible on the premise that the node processing task amount is small, and the accuracy of selecting the test code handover time is improved.
And step 206, determining the current moment as a handover time node matched with the test code.
Under the method, based on the software testing technology, when a handover instruction indicating the handover of the test code is detected, the handover time of the test code can be determined according to the node information in the test environment, so that the test code is handed over when the processing task quantity of the node in the test environment is not high, the handover time is reduced, and the problem that the handover time is too long due to the fact that the handover time is not good when the handover time of the test code is not good is solved.
Fig. 3 is a flowchart illustrating another test code handover control method according to another exemplary embodiment. As shown in fig. 3, the method comprises the steps of:
step 301, when a handover instruction for instructing handover of a test code to a test environment is detected, obtaining node information in the test environment, wherein the node information at least comprises node load condition information and node processing capacity information.
And step 302, determining the processing task amount of the node according to the node load condition information.
Step 303, determining whether the node processing task amount is less than the preset node processing task amount, if yes, executing step 304 to step 305, and if no, executing step 306 to step 307.
And step 304, acquiring the node processing rate according to the node processing capacity information.
Step 305, generating a handover time node matched with the test code according to the node processing rate and the node processing task amount.
Step 306, acquiring the distribution information of the processing task amount of the nodes in the test environment.
In the embodiment of the present invention, the node processing task amount distribution information may include a node processing task amount matched with each node in the test environment.
Step 307, judging whether the node processing task amount distribution information is matched with the deviation distribution information, if so, ending the process, and if not, executing step 308.
In the embodiment of the present invention, the deviation distribution information at least includes a preset low-load node deviation ratio and a preset high-load node deviation ratio, where the preset low-load node deviation ratio is a maximum ratio of preset low-load nodes to the total number of nodes, and the preset high-load node deviation ratio is a maximum ratio of preset high-load nodes to the total number of nodes.
As an optional implementation manner, determining whether the node processing task amount distribution information matches the deviation distribution information may include:
acquiring the number of high-load nodes and the number of low-load nodes according to the distribution information of the processing task amount of the nodes;
calculating a first ratio of the number of low-load nodes to the number of total nodes, and calculating a second ratio of the number of high-load nodes to the number of total nodes;
acquiring a preset low-load node deviation ratio and a preset high-load node deviation ratio in the deviation distribution information;
judging whether the first ratio is higher than a preset low-load node deviation ratio or not and judging whether the second ratio is higher than a preset high-load node deviation ratio or not;
when the first ratio is smaller than or equal to a preset low-load node deviation ratio and/or the second ratio is smaller than or equal to a preset high-load node deviation ratio, determining that the node processing task amount distribution information is not matched with the deviation distribution information;
and when the first ratio is higher than the preset low-load node deviation ratio and the second ratio is higher than the preset high-load node deviation ratio, determining that the node processing task amount distribution information is matched with the deviation distribution information.
In the embodiment of the invention, when the first ratio is higher than the preset low-load node deviation ratio and the second ratio is higher than the preset high-load node deviation ratio, the distribution of the processing task amount of the node at the moment is not uniform, and accordingly, the condition that the distribution of the processing task amount of the node is not uniform can be determined not to be handed over.
By implementing the optional implementation mode, whether the node processing task amount distribution information is matched with the deviation distribution information can be judged according to the number of high-load nodes and the number of low-load nodes, if the node processing task amount distribution information is matched with the deviation distribution information, the current node load is uneven, although the average processing task amount is lower, the transfer time is possibly prolonged due to the uneven node load, the transfer is not performed at the moment, and the reliability of determining the transfer time is improved.
As an optional implementation manner, the obtaining the number of high load nodes and the number of low load nodes according to the node processing task amount distribution information may include:
acquiring the standard load task quantity of each node according to the node processing capacity information;
calculating the difference value between the standard load task amount of each node and the node processing task amount based on the node processing task amount distribution information;
determining nodes with the absolute value of the difference larger than a preset difference and the difference being a positive number as low-load nodes, and determining nodes with the absolute value of the difference larger than the preset difference and the difference being a negative number as high-load nodes;
and counting the number of low-load nodes corresponding to the low-load nodes and counting the number of high-load nodes corresponding to the high-load nodes.
In the embodiment of the present invention, the standard load task amount is a normal task amount that can be processed by the node, and if the task amount is far higher than the standard load task amount, it is determined that the node is an overloaded node, that is, the node is determined to be a high-load node, and if the task amount is far smaller than the standard load task amount, it is determined that the node is a low-load node, that is, the node is determined to be a low-load node.
By implementing the optional implementation mode, the number of low-load nodes and the number of high-load nodes can be accurately obtained according to the standard load task quantity and the node processing task distribution quantity of each node, so that the accuracy of identifying the condition of uneven node load is improved.
As an optional implementation manner, after determining that the node processing task amount distribution information matches the deviation distribution information, the following steps may be further performed:
and sending a prompt message for prompting the uneven load of the nodes in the test environment to a maintenance terminal matched with the test environment.
In the embodiment of the invention, the maintenance terminal matched with the test environment can be electronic equipment used by maintenance personnel configuring the test environment.
By implementing the optional implementation mode, maintenance personnel at the maintenance terminal matched with the test environment can be prompted to maintain the condition of uneven node load in the test environment, so that the stability of the test environment is improved.
And step 308, determining the current moment as a handover time node matched with the test code.
Under the method, based on the software testing technology, when a handover instruction indicating the handover of the test code is detected, the handover time of the test code can be determined according to the node information in the test environment, so that the test code is handed over when the processing task quantity of the node in the test environment is not high, the handover time is reduced, and the problem that the handover time is too long due to the fact that the handover time is not good when the handover time of the test code is not good is solved.
The following are embodiments of the apparatus of the present invention.
Fig. 4 is a block diagram illustrating a test code handover control apparatus according to an exemplary embodiment. As shown in fig. 4, the apparatus includes:
a first obtaining unit 401, configured to, when a handover instruction instructing a handover of a test code to a test environment is detected, obtain node information in the test environment, where the node information includes at least node load condition information and node processing capability information.
In the embodiment of the present invention, the test environment includes a plurality of nodes, each node may process a corresponding test task, and the node information of each node may include, but is not limited to, node processing capability information and node load condition information, where the node processing capability information may indicate the number of tasks that the node may process, and the node load condition information may indicate the number of tasks that the node is currently processing.
A first determining unit 402, configured to determine the node processing task amount according to the node load condition information.
As an optional implementation manner, the determining, by the first determining unit 402, the node processing task amount according to the node load condition information may include:
the first determining unit 402 acquires the task amount being processed of each node according to the node load condition information;
the first determination unit 402 calculates an average value of the amounts of tasks being processed of the respective nodes, and determines the average value as the amount of node processing tasks.
In the embodiment of the invention, the node load condition information comprises the task amount being processed of each node, and the average value of the task amount being processed of each node is taken as the node processing task amount, so that the current overall node processing task amount condition of all nodes is reflected, and the understanding of the overall node processing task amount condition is enhanced.
By implementing the alternative implementation mode, the average value of the task quantities being processed can be calculated according to the task quantities being processed of each node, the average value is determined as the node processing task quantity, and therefore an index capable of comprehensively evaluating the task quantities being processed of the nodes is obtained, and the node of the test code handover time is determined according to the index, and the method is more reliable.
A judging unit 403, configured to judge whether the node processing task amount is smaller than a preset node processing task amount.
In the embodiment of the present invention, the preset node processing task amount may be a maximum node processing task amount under a preset normal working condition of the test environment. If the node processing task amount is lower than the preset node processing task amount, the node processing task amount at the current moment is in the range of the node processing task amount of normal work of the test environment, and at the moment, the current moment can be determined as the handover time node matched with the test code. If the node processing task amount is higher than or equal to the preset node processing task amount, it indicates that the node processing task amount at the current moment is not within the range of the node processing task amount of normal work of the test environment, and at this time, the handover time node can be further determined according to the node processing rate and the node processing task amount.
A second obtaining unit 404, configured to obtain the node processing rate according to the node processing capability information when it is determined that the node processing task amount is greater than or equal to the preset node processing task amount.
In the embodiment of the present invention, the node processing capability information at least includes the processing rate of each node, and an average value may be calculated according to the processing rate of each node, and the average value is used as the node processing rate, where the node processing rate is used to reflect the speed information of the node processing data at the current time.
As an alternative implementation, the obtaining, by the second obtaining unit 404, the node processing rate according to the node processing capability information may include:
the second obtaining unit 404 obtains the node processing rate of each node according to the node processing capability information;
the second acquisition unit 404 calculates an average value of the node-processing rates of the respective nodes, and determines the average value as the node processing rate.
By implementing the alternative implementation mode, the average value of the node processing rates can be calculated according to the node processing rate of each node, and the average value is determined as the node processing rate, so that an index capable of comprehensively evaluating the node processing rates is obtained, and the test code handover time node is determined according to the index, and the method is more reliable.
The generating unit 405 is configured to generate a handover time node with a test code matching according to the node processing rate and the node processing task amount.
As an alternative implementation, the generating unit 405 may generate the handover time node with the test code matching according to the node processing rate and the node processing task amount, where:
the generating unit 405 calculates the node future processing task amount matched with the predicted time node according to the node processing task amount, the node processing rate and a preset prediction formula, wherein the preset prediction formula is as follows:
x=a-v×t
wherein a represents the node processing task quantity, v represents the node processing rate, t represents the predicted time node, and x represents the node future processing task quantity matched with the predicted time node;
the generation unit 405 correspondingly stores the predicted time node and the node future processing task amount matched with the predicted time node, and obtains a node time sequence prediction summary table;
the generation unit 405 selects a target node processing task amount of which the future processing task amount of the node is smaller than the preset node processing task amount from the node timing prediction summary table;
the generation unit 405 determines a target predicted time node whose target node processing task amount matches as a handover time node whose test code matches.
By implementing the optional implementation mode, the node future processing task amount of the plurality of predicted time nodes matched with each predicted time node can be calculated, the node time sequence prediction total table is obtained, and the target predicted time node with the node future processing task amount smaller than the preset node processing task amount is determined from the node time sequence prediction total table, so that the test code handover is performed as early as possible on the premise that the node processing task amount is small, and the accuracy of selecting the test code handover time is improved.
And a second determining unit 406, configured to determine the current time as a handover time node matched with the test code when it is determined that the node processing task amount is lower than the preset node processing task amount.
It can be seen that, by implementing the test code handover control apparatus described in fig. 4, based on a software test technology, when a handover instruction indicating to handover a test code is detected, a handover timing of the test code can be determined according to node information in a test environment, so that the test code is handed over when a node processing task amount in the test environment is not high, handover time is reduced, and a problem that handover time is too long due to a poor handover timing of the test code to the test environment is solved.
Fig. 5 is a block diagram illustrating another test code handover control apparatus according to an example embodiment. Fig. 5 is optimized based on fig. 4, and compared with the test code handover control apparatus shown in fig. 4, the test code handover control apparatus shown in fig. 5 may further include:
a third obtaining unit 407, configured to obtain node processing task amount distribution information in the test environment.
In the embodiment of the present invention, the node processing task amount distribution information may include a node processing task amount matched with each node in the test environment.
The determining unit 403 is further configured to determine whether the node processing task amount distribution information matches the deviation distribution information, and if not, trigger the second determining unit 406 to execute the handover time node that determines the current time as the test code matching.
In the embodiment of the present invention, the deviation distribution information at least includes a preset low-load node deviation ratio and a preset high-load node deviation ratio, where the preset low-load node deviation ratio is a maximum ratio of preset low-load nodes to the total number of nodes, and the preset high-load node deviation ratio is a maximum ratio of preset high-load nodes to the total number of nodes.
As an alternative implementation, the determining unit 403 may determine whether the node processing task amount distribution information matches the deviation distribution information, including:
the judging unit 403 acquires the number of high load nodes and the number of low load nodes according to the distribution information of the node processing task amount;
the judging unit 403 calculates a first ratio of the number of low-load nodes to the total number of nodes, and calculates a second ratio of the number of high-load nodes to the total number of nodes;
the judging unit 403 obtains a preset low-load node deviation ratio and a preset high-load node deviation ratio in the deviation distribution information;
the determining unit 403 determines whether the first ratio is higher than a preset low-load node deviation ratio and determines whether the second ratio is higher than a preset high-load node deviation ratio;
when the first ratio is less than or equal to the preset low-load node deviation ratio and/or the second ratio is less than or equal to the preset high-load node deviation ratio, the judgment unit 403 determines that the node processing task amount distribution information is not matched with the deviation distribution information;
when the first ratio is higher than the preset low-load node deviation ratio and the second ratio is higher than the preset high-load node deviation ratio, the judgment unit 403 determines that the node processing task amount distribution information matches with the deviation distribution information.
In the embodiment of the invention, when the first ratio is higher than the preset low-load node deviation ratio and the second ratio is higher than the preset high-load node deviation ratio, the distribution of the processing task amount of the node at the moment is not uniform, and accordingly, the condition that the distribution of the processing task amount of the node is not uniform can be determined not to be handed over.
By implementing the optional implementation mode, whether the node processing task amount distribution information is matched with the deviation distribution information can be judged according to the number of high-load nodes and the number of low-load nodes, if the node processing task amount distribution information is matched with the deviation distribution information, the current node load is uneven, although the average processing task amount is lower, the transfer time is possibly prolonged due to the uneven node load, the transfer is not performed at the moment, and the reliability of determining the transfer time is improved.
As another optional implementation manner, the determining unit 403, according to the node processing task amount distribution information, acquiring the number of high load nodes and the number of low load nodes may include:
the judging unit 403 acquires the standard load task amount of each node according to the node processing capability information;
the determining unit 403 calculates a difference between the standard load task amount of each node and the node processing task amount based on the node processing task amount distribution information;
the judgment unit 403 determines a node whose absolute value of the difference is greater than the preset difference and whose difference is a positive number as a low-load node, and determines a node whose absolute value of the difference is greater than the preset difference and whose difference is a negative number as a high-load node;
the judging unit 403 counts the number of low-load nodes corresponding to the low-load nodes and counts the number of high-load nodes corresponding to the high-load nodes.
In the embodiment of the present invention, the standard load task amount is a normal task amount that can be processed by the node, and if the task amount is far higher than the standard load task amount, it is determined that the node is an overloaded node, that is, the node is determined to be a high-load node, and if the task amount is far smaller than the standard load task amount, it is determined that the node is a low-load node, that is, the node is determined to be a low-load node.
By implementing the optional implementation mode, the number of low-load nodes and the number of high-load nodes can be accurately obtained according to the standard load task quantity and the node processing task distribution quantity of each node, so that the accuracy of identifying the condition of uneven node load is improved.
As another alternative, after the determining unit 403 determines that the node processing task amount distribution information matches the deviation distribution information, the determining unit 403 may be further configured to:
and sending a prompt message for prompting the uneven load of the nodes in the test environment to a maintenance terminal matched with the test environment.
In the embodiment of the invention, the maintenance terminal matched with the test environment can be electronic equipment used by maintenance personnel configuring the test environment.
By implementing the optional implementation mode, maintenance personnel at the maintenance terminal matched with the test environment can be prompted to maintain the condition of uneven node load in the test environment, so that the stability of the test environment is improved.
It can be seen that, by implementing the test code handover control apparatus described in fig. 5, based on a software test technology, when a handover instruction indicating to handover a test code is detected, a handover timing of the test code can be determined according to node information in a test environment, so that the test code is handed over when a node processing task amount in the test environment is not high, handover time is reduced, and a problem that handover time is too long due to a poor handover timing of the test code to the test environment is solved.
The present invention also provides an electronic device, including:
a processor;
a memory having computer readable instructions stored thereon which, when executed by the processor, implement the test code handoff control method as previously described.
The electronic device may be the test code handing-over apparatus 100 shown in fig. 1
In an exemplary embodiment, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the test code handover control method as previously described.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

1. A test code handover control method, the method comprising:
when a handover instruction for instructing handover of the test code to a test environment is detected, acquiring node information in the test environment, wherein the node information at least comprises node load condition information and node processing capacity information;
determining the processing task amount of the node according to the node load condition information;
judging whether the node processing task amount is lower than a preset node processing task amount or not;
when the node processing task amount is judged to be higher than or equal to the preset node processing task amount, acquiring a node processing rate according to the node processing capacity information;
calculating the future processing task quantity of the node matched with the predicted time node according to the node processing task quantity, the node processing rate and a preset prediction formula, wherein the preset prediction formula is as follows:
x=a-v×t
wherein a represents the node processing task amount, v represents the node processing rate, t represents the predicted time node, and x represents the node future processing task amount matched with the predicted time node;
correspondingly storing the node future processing task amount matched with the prediction time node and the prediction time node to obtain a node time sequence prediction summary table;
selecting a target node processing task amount of which the future processing task amount of the node is smaller than the processing task amount of the preset node from the node time sequence prediction summary table;
determining the target predicted time node matched with the target node processing task amount as a handover time node matched with the test code;
and when the node processing task amount is judged to be lower than the preset node processing task amount, determining the current moment as a handover time node matched with the test code.
2. The method of claim 1, wherein determining the amount of node processing tasks based on the node load condition information comprises:
acquiring the task amount being processed of each node according to the node load condition information;
and calculating the average value of the task quantities being processed of each node, and determining the average value as the node processing task quantity.
3. The method according to any one of claims 1 to 2, wherein the node information further includes node processing task amount distribution information, and after determining that the node processing task amount is lower than the preset node processing task amount and before determining the current time as the handover time node where the test code matches, the method further includes:
acquiring the distribution information of the processing task amount of the nodes in the test environment;
judging whether the node processing task amount distribution information is matched with the deviation distribution information;
and if not, executing the handover time node which determines the current moment as the test code matched with the test code.
4. The method of claim 3, wherein determining whether the node processing task amount distribution information matches deviation distribution information comprises:
acquiring the number of high-load nodes and the number of low-load nodes according to the node processing task amount distribution information;
calculating a first ratio of the number of the low-load nodes to the total number of the nodes, and calculating a second ratio of the number of the high-load nodes to the total number of the nodes;
acquiring a preset low-load node deviation ratio and a preset high-load node deviation ratio in the deviation distribution information;
judging whether the first ratio is higher than the preset low-load node deviation ratio and judging whether the second ratio is higher than the preset high-load node deviation ratio;
when the first ratio is smaller than or equal to the preset low-load node deviation ratio and/or the second ratio is smaller than or equal to the preset high-load node deviation ratio, determining that the node processing task amount distribution information is not matched with the deviation distribution information;
and when the first ratio is higher than the preset low-load node deviation ratio and the second ratio is higher than the preset high-load node deviation ratio, determining that the node processing task amount distribution information is matched with the deviation distribution information.
5. The method according to claim 4, wherein said obtaining the number of high load nodes and the number of low load nodes according to the node processing task amount distribution information comprises:
acquiring the standard load task amount of each node according to the node processing capacity information;
calculating the difference value between the standard load task amount and the node processing task amount of each node according to the node processing task amount distribution information;
determining the node of which the absolute value of the difference is greater than a preset difference and the difference is a positive number as a low-load node, and determining the node of which the absolute value of the difference is greater than the preset difference and the difference is a negative number as a high-load node;
and counting the number of low-load nodes corresponding to the low-load nodes and counting the number of high-load nodes corresponding to the high-load nodes.
6. The method of claim 3, wherein after determining that the node processing task volume distribution information matches the variance distribution information, the method further comprises:
and sending a prompt message for prompting the uneven load of the nodes in the test environment to a maintenance terminal matched with the test environment.
7. A test code handover control apparatus, characterized in that the apparatus comprises:
a first acquisition unit configured to acquire node information in a test environment when a handover instruction instructing handover of the test code to the test environment is detected, the node information including at least node load condition information and node processing capability information;
the first determining unit is used for determining the processing task amount of the node according to the node load condition information;
the judging unit is used for judging whether the node processing task amount is lower than the preset node processing task amount or not;
a second obtaining unit, configured to obtain a node processing rate according to the node processing capability information when it is determined that the node processing task amount is greater than or equal to the preset node processing task amount;
a generating unit, configured to calculate a future processing task amount of a node matched with a prediction time node according to the processing task amount of the node, the processing rate of the node, and a preset prediction formula, where the preset prediction formula is as follows:
x=a-v×t
wherein a represents the node processing task amount, v represents the node processing rate, t represents the predicted time node, and x represents the node future processing task amount matched with the predicted time node;
the generation unit is also used for correspondingly storing the predicted time node and the node future processing task amount matched with the predicted time node to obtain a node time sequence prediction summary table; selecting a target node processing task amount of which the future processing task amount of the node is smaller than the processing task amount of the preset node from the node time sequence prediction summary table; determining the target predicted time node matched with the target node processing task amount as a handover time node matched with the test code;
and the second determining unit is used for determining the current moment as the handover time node matched with the test code when the node processing task amount is judged to be lower than the preset node processing task amount.
8. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory having stored thereon computer readable instructions which, when executed by the processor, implement the method of any of claims 1 to 6.
9. A computer-readable storage medium, characterized in that it stores a computer program that causes a computer to execute the method of any one of claims 1 to 6.
CN201910203983.1A 2019-03-18 2019-03-18 Test code handover control method and device Active CN109902023B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910203983.1A CN109902023B (en) 2019-03-18 2019-03-18 Test code handover control method and device
PCT/CN2019/117654 WO2020186781A1 (en) 2019-03-18 2019-11-12 Test code handover control method and apparatus, electronic device, and computer non-volatile readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910203983.1A CN109902023B (en) 2019-03-18 2019-03-18 Test code handover control method and device

Publications (2)

Publication Number Publication Date
CN109902023A CN109902023A (en) 2019-06-18
CN109902023B true CN109902023B (en) 2022-06-03

Family

ID=66953654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910203983.1A Active CN109902023B (en) 2019-03-18 2019-03-18 Test code handover control method and device

Country Status (2)

Country Link
CN (1) CN109902023B (en)
WO (1) WO2020186781A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109902023B (en) * 2019-03-18 2022-06-03 平安普惠企业管理有限公司 Test code handover control method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102711177A (en) * 2012-04-26 2012-10-03 北京邮电大学 Service prediction based load balancing method
CN105471933A (en) * 2014-08-07 2016-04-06 腾讯科技(深圳)有限公司 Server overload protecting method, server overload protecting system and server
CN105786592A (en) * 2014-12-15 2016-07-20 北大方正集团有限公司 Method and device for processing distributed transactions
CN106203662A (en) * 2016-07-13 2016-12-07 华南理工大学 A kind of based on ETC system realize highway pass through reservation method
CN108564247A (en) * 2018-03-02 2018-09-21 阿里巴巴集团控股有限公司 Data adjustment method, device and server
CN109102169A (en) * 2018-07-24 2018-12-28 武汉空心科技有限公司 Development approach and system based on function metering
CN109284895A (en) * 2018-08-15 2019-01-29 平安普惠企业管理有限公司 Project task distribution method, device, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096602A (en) * 2009-12-15 2011-06-15 中国移动通信集团公司 Task scheduling method, and system and equipment thereof
CN103473345B (en) * 2013-09-23 2017-03-29 融创天下(上海)科技发展有限公司 A kind of method for estimating duration
TWI549053B (en) * 2014-10-14 2016-09-11 The Dynamic Operation Environment Adjustment System and Method Based on Computing Work
CN107480041A (en) * 2016-06-07 2017-12-15 中兴通讯股份有限公司 The task automation method of testing and system of a kind of big data
US10664786B2 (en) * 2016-09-08 2020-05-26 International Business Machines Corporation Using run time and historical customer profiling and analytics to determine customer test vs. production differences, and to enhance customer test effectiveness
CN109902023B (en) * 2019-03-18 2022-06-03 平安普惠企业管理有限公司 Test code handover control method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102711177A (en) * 2012-04-26 2012-10-03 北京邮电大学 Service prediction based load balancing method
CN105471933A (en) * 2014-08-07 2016-04-06 腾讯科技(深圳)有限公司 Server overload protecting method, server overload protecting system and server
CN105786592A (en) * 2014-12-15 2016-07-20 北大方正集团有限公司 Method and device for processing distributed transactions
CN106203662A (en) * 2016-07-13 2016-12-07 华南理工大学 A kind of based on ETC system realize highway pass through reservation method
CN108564247A (en) * 2018-03-02 2018-09-21 阿里巴巴集团控股有限公司 Data adjustment method, device and server
CN109102169A (en) * 2018-07-24 2018-12-28 武汉空心科技有限公司 Development approach and system based on function metering
CN109284895A (en) * 2018-08-15 2019-01-29 平安普惠企业管理有限公司 Project task distribution method, device, computer equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
-1 Distributecl Routing Sclierne for Networks of the Future;M. El Zarki;《https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=138299》;20020806;全文 *
时间序列分析和预测;我不爱机器学习;《https://blog.csdn.net/mengjizhiyou/article/details/82683448》;20180917;全文 *
李军 ; 张国柱 ; 雍少为.代码移交测试模型及其应用.《现代电子技术》.2008,全文. *
计算机网络拥塞控制算法综述;刘晓飞;《铜仁学院学报》;20160907;全文 *

Also Published As

Publication number Publication date
CN109902023A (en) 2019-06-18
WO2020186781A1 (en) 2020-09-24

Similar Documents

Publication Publication Date Title
US11452012B2 (en) Method, apparatus for cell handover and user equipment
CN109509017B (en) User retention prediction method and device based on big data analysis
CN110134593B (en) Software testing method and device, electronic equipment and storage medium
CN108268366B (en) Test case execution method and device
CN105227626B (en) Content pushing method and device and terminal
WO2017113527A1 (en) Method and device for switching virtual sim card, and terminal
US9268387B2 (en) Method for saving power consumption and an electronic device thereof
US20140129501A1 (en) Method for predicting user operation and mobile terminal
CN103686912A (en) Electronic device and method for changing network connection
CN110147318B (en) Method and device for generating test data and electronic equipment
EP2672781B1 (en) Method and mobile terminal for predicting user operation
CN104333890A (en) Signal transmission control method, device and electronic equipment
CN105930020A (en) Method and apparatus for function icons of management terminal application program
US11317302B2 (en) Minimization of drive test configuration method and apparatus
CN106253996B (en) Sensitivity attenuation test method and device
CN111770540A (en) Cell switching method and device and electronic equipment
CN109902023B (en) Test code handover control method and device
CN108924908B (en) WiFi scanning method and device and electronic device
CN110913447A (en) Network control method, network control device, storage medium and electronic equipment
CN111092671A (en) Signal strength reporting method and device, storage medium and terminal equipment
CN110062452B (en) Power adjustment method, device, computer equipment and storage medium
CN105162931A (en) Method and device for classifying communication numbers
CN110169101B (en) Data transmission method and device
CN113451669A (en) Charging method and device, electronic device and storage medium
CN111352791A (en) System application detection method and device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 201, room 518000, building A, No. 1, front Bay Road, Qianhai Shenzhen Guangdong Shenzhen Hong Kong cooperation zone (Qianhai business secretary)

Applicant after: Pingan Pu Hui Enterprise Management Co., Ltd.

Address before: 518000 Guangdong city of Shenzhen province Qianhai Shenzhen Hong Kong cooperation zone before Bay Road No. 1 building 201 room A

Applicant before: Pingan Pu Hui Enterprise Management Co., Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant