WO2020186781A1 - Test code handover control method and apparatus, electronic device, and computer non-volatile readable storage medium - Google Patents

Test code handover control method and apparatus, electronic device, and computer non-volatile readable storage medium Download PDF

Info

Publication number
WO2020186781A1
WO2020186781A1 PCT/CN2019/117654 CN2019117654W WO2020186781A1 WO 2020186781 A1 WO2020186781 A1 WO 2020186781A1 CN 2019117654 W CN2019117654 W CN 2019117654W WO 2020186781 A1 WO2020186781 A1 WO 2020186781A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
load
task amount
processing task
preset
Prior art date
Application number
PCT/CN2019/117654
Other languages
French (fr)
Chinese (zh)
Inventor
陈晰亮
Original Assignee
平安普惠企业管理有限公司
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 平安普惠企业管理有限公司 filed Critical 平安普惠企业管理有限公司
Publication of WO2020186781A1 publication Critical patent/WO2020186781A1/en

Links

Classifications

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

Definitions

  • This application relates to the technical field of software testing, and in particular to a test code transfer control method and device, electronic equipment, and computer non-volatile readable storage media.
  • the test code corresponding to the business system that needs to be tested is usually transferred to the test environment.
  • the inventor of this application realizes that in the process of transferring the test code corresponding to the business system to the test environment, improper timing of the transfer often occurs. For example, when the test environment is congested, the transfer takes a long time. A situation that exceeds the normal handover time occurs.
  • the defect of the prior art is that the timing of the test code transfer to the test environment is not good, resulting in an excessively long transfer time.
  • this application provides a test code transfer control method and device.
  • a test code handover control method includes: when a handover instruction for instructing the test code to be handed over to a test environment is detected, acquiring node information in the test environment, where the node information includes at least a node Load status information and node processing capability information; determine the node processing task volume according to the node load status information; determine whether the node processing task volume is lower than the preset node processing task volume; when it is determined that the node task volume is higher than or When equal to the preset node processing task amount, obtain the node processing rate according to the node processing capability information; generate a handover time node matching the test code based on the node processing rate and the node task amount; When it is determined that the node task amount is lower than the preset node processing task amount, the current moment is determined as the handover time node that matches the test code.
  • a test code handover control device includes: a first obtaining unit configured to obtain node information in the test environment when a handover instruction for instructing to hand over the test code to the test environment is detected
  • the node information includes at least node load status information and node processing capability information; a first determining unit is used to determine the node processing task amount according to the node load status information; the judgment unit is used to determine whether the node processing task amount is Lower than a preset node processing task amount; 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 task amount is higher than or equal to the preset node processing task amount;
  • the generating unit is configured to generate a handover time node matching the test code based on the processing rate of the node and the task amount of the node; the second determining unit is used to determine that the task amount of the node is lower than the total When the preset node processes the task amount, the current moment is determined as the handover time node
  • an electronic device includes a processor and a memory, and computer-readable instructions are stored on the memory, and the computer-readable instructions implement the test code transfer control method as described above when executed by the processor.
  • a computer non-volatile readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the test code transfer control method as described above is realized.
  • the timing of the handover of the test code can be determined according to the node information in the test environment, so that the handover of the node tasks in the test environment is not high Test code, reduce the handover time, and solve the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
  • Fig. 1 is a schematic diagram showing a test code handover control device according to an exemplary embodiment
  • Fig. 2 is a flow chart showing a method for controlling test code handover according to an exemplary embodiment
  • Fig. 3 is a flowchart showing another test code handover control method according to an exemplary embodiment
  • Fig. 4 is a block diagram showing a test code handover control device according to an exemplary embodiment
  • Fig. 5 is a block diagram showing another test code handover control device according to an exemplary embodiment.
  • Fig. 1 is a schematic diagram showing a test code handover control device according to an exemplary embodiment.
  • the apparatus 100 may be the aforementioned portable mobile device.
  • the device 100 may include one or more of the following components: a processing component 102, a memory 104, a power supply 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 the overall operations of the device 100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 102 may include one or more processors 118 to execute instructions to complete all or part of the steps of the following method.
  • the processing component 102 may include one or more modules to facilitate the interaction between the processing component 102 and other components.
  • the processing component 102 may include a multimedia module to facilitate the 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 in the device 100. Examples of these data include instructions for any application or method operating on the device 100.
  • the memory 104 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (Static Random Access Memory). Access Memory, SRAM for short), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (EPROM) Red-Only Memory, PROM for short), Read-Only Memory (ROM for short), magnetic memory, flash memory, magnetic disk or optical disk.
  • the memory 104 also stores one or more modules, and the one or more modules are configured to be executed by the one or more processors 118 to complete all or part of the steps in the method shown below.
  • the power supply component 106 provides power to various components of the device 100.
  • the power supply component 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.
  • the screen may include a liquid crystal display (Liquid Crystal Display, referred to as LCD) and touch panel. If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, 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 related to the touch or slide operation.
  • the screen may also include an organic electroluminescence display (Organic Light Emitting Display, OLED for short).
  • the audio component 110 is configured to output and/or input audio signals.
  • the audio component 110 includes a microphone (Microphone, MIC for short).
  • the microphone is configured to receive an external audio signal.
  • the received audio signal can be further stored in the memory 104 or sent via the communication component 116.
  • the audio component 110 further includes a speaker for outputting audio signals.
  • the sensor component 114 includes one or more sensors for providing the device 100 with various aspects of state evaluation.
  • the sensor component 114 can detect the open/close state of the device 100 and the relative positioning of components.
  • the sensor component 114 can also detect the position change of the device 100 or a component of the device 100 and the temperature change of the device 100.
  • the sensor component 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 can access a wireless network based on a communication standard, such as WiFi (Wireless-Fidelity, wireless fidelity).
  • the communication component 116 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 116 further includes a near field communication (Near Field Communication, NFC for short) module for facilitating short-range communication.
  • NFC Near Field Communication
  • the NFC module can be based on radio frequency identification (Radio Frequency Identification, referred to as RFID) technology, infrared data association (Infrared Data Association, referred to as IrDA) technology, ultra-wideband (Ultra Wideband, referred to as UWB) technology, Bluetooth technology and other technologies.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB ultra-wideband
  • Bluetooth Bluetooth technology and other technologies.
  • the apparatus 100 may be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuits). Specific Integrated Circuit, referred to as ASIC), digital signal processor, digital signal processing equipment, programmable logic device, field programmable gate array, controller, microcontroller, microprocessor or other electronic components to implement the following method.
  • ASIC Application Specific Integrated Circuit
  • digital signal processor digital signal processing equipment
  • programmable logic device programmable logic device
  • field programmable gate array programmable gate array
  • controller microcontroller
  • microprocessor microprocessor or other electronic components to implement the following method.
  • Fig. 2 is a flow chart showing a method for controlling test code handover according to an exemplary embodiment. As shown in Figure 2, this method includes the following steps:
  • Step 201 When a handover instruction for instructing the handover of the test code to the test environment is detected, obtain node information in the test environment.
  • the node information includes at least node load status information and node processing capability information.
  • the test environment includes several nodes, and each node can process corresponding test tasks.
  • the node information of each node may include, but is not limited to, node processing capability information and node load status information.
  • the processing capability information can indicate the number of tasks that the node can process
  • the node load status information can indicate the number of tasks that the node is currently processing.
  • Step 202 Determine the node processing task amount according to the node load status information.
  • determining the node processing task amount according to the node load status information may include:
  • the node load status information includes the processing task amount of each node, and the average value of the processing task amount of each node is used as the node processing task amount to reflect the current overall node processing task amount of all nodes Circumstances, enhance the grasp of the overall node processing task volume.
  • the average value of the amount of tasks being processed can be calculated according to the amount of tasks being processed by each node, and the average value can be determined as the amount of node processing tasks, so as to obtain a comprehensive evaluation of the node's processing tasks.
  • the task volume index is used to determine the time node of the test code handover, which is more reliable.
  • Step 203 Determine whether the node processing task amount is lower than the preset node processing task amount, if yes, execute step 206, if not, execute step 204 to step 205.
  • the preset node processing task amount may be the preset maximum node processing task amount under the normal working condition of the test environment. If the node processing task amount is lower than the preset node processing task amount, it means that the node processing task amount at the current moment is within the normal working node processing task amount of the test environment. At this time, the current moment can be determined as the handover that matches the test code time frame. If the node processing task amount is higher than or equal to the preset node processing task amount, it means that the node processing task amount at the current moment is not within the normal working node processing task amount range of the test environment. At this time, it can be further based on the node processing rate and node task amount. Quantities determine the handover time node.
  • Step 204 Obtain the node processing rate according to the node processing capability information.
  • the node processing capability information includes at least the processing rate of each node.
  • the average value can be calculated according to the processing rate of each node and used as the node processing rate.
  • the node processing rate is used to reflect the current node processing rate.
  • the speed information of the data is used to reflect the current node processing rate.
  • acquiring the node processing rate according to the node processing capability information may include: acquiring the node processing rate of each node according to the node processing capability information; calculating the average value of the node processing rate of each node, and calculating the average The value is determined as the node processing rate.
  • the average value of the node processing rate can be calculated according to the node processing rate of each node, and the average value is determined as the node processing rate, thereby obtaining a comprehensive evaluation of the node processing rate Indicators, based on which to determine the time node of the test code handover, are more reliable.
  • Step 205 Generate a handover time node matching the test code based on the node processing rate and the node task amount.
  • generating the handover time node that matches the test code may include: calculating the predicted time node phase based on the node task volume, the node processing rate, and a preset prediction formula.
  • the target node handles the task amount; the target predicted time node that matches the target node's processing task amount is determined as the handover time node that matches the test code.
  • the unit of the node processing rate v can be specified as the number of tasks/second
  • the unit of the predicted time node t can be seconds
  • the predicted time node t can indicate the passage of t from the current moment, for example, when the predicted time node When t is 30s, it means the time after 30 seconds.
  • the preset prediction formula can be used to calculate the number of future processing tasks of the node corresponding to a certain time in the future (1s, 2s, 3s, etc.) in the future.
  • this optional implementation it is possible to calculate the future processing tasks of a number of predicted time nodes that match each predicted time node, obtain the node timing forecast summary table, and determine the node future processing from the node timing forecast summary table
  • the task volume is less than the target predicted time node for the task volume of the preset node, so that the test code transfer is performed as early as possible under the premise of the node task volume is small, and the accuracy of selecting the test code transfer timing is improved.
  • Step 206 Determine the current moment as the handover time node that matches the test code.
  • the timing of the handover of the test code can be determined according to the node information in the test environment, so as to handover when the amount of node tasks in the test environment is not high Test code, reduce the handover time, and solve the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
  • Fig. 3 is a flowchart showing another test code handover control method according to another exemplary embodiment. As shown in Figure 3, this method includes the following steps:
  • Step 301 When a handover instruction for instructing the handover of the test code to the test environment is detected, obtain node information in the test environment.
  • the node information includes at least node load status information and node processing capability information.
  • Step 302 Determine the node processing task amount according to the node load status information.
  • step 303 it is determined whether the processing task amount of the node is lower than the preset node processing task amount, if yes, execute step 304 to step 305, if not, execute step 306 to step 307.
  • Step 304 Obtain the node processing rate according to the node processing capability information.
  • Step 305 Generate a handover time node matching the test code based on the node processing rate and the node task volume.
  • Step 306 Obtain distribution information of processing tasks of nodes in the test environment.
  • the node processing task amount distribution information may include the node processing task amount matched by each node in the test environment.
  • Step 307 Determine whether the node processing task amount distribution information matches the deviation distribution information, if yes, end this process, if not, execute step 308.
  • the deviation distribution information includes at least a preset low-load node deviation ratio and a preset high-load node deviation ratio.
  • the preset low-load node deviation ratio is the maximum ratio of the preset low-load node to the total number of nodes.
  • the preset high-load node deviation ratio is the maximum ratio of the preset high-load node to the total number of nodes.
  • judging whether the node processing task volume distribution information matches the deviation distribution information may include: obtaining the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information; calculating the number of low-load nodes The first ratio of the total number of nodes, and the second ratio of the number of high-load nodes to the total number of nodes is calculated; the preset low-load node deviation ratio and the preset high-load node deviation ratio in the deviation distribution information are obtained; judge whether the first ratio is Higher than the preset low-load node deviation ratio and determine whether the second ratio is higher than the 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 When the high load node deviation ratio, it is determined that the node processing task load distribution information does not match 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
  • the first ratio 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, it indicates that the node processing tasks are unevenly distributed at this time. If the processing tasks are unevenly distributed, it is determined not to be handed over.
  • the node processing task volume distribution information matches the deviation distribution information according to the number of high-load nodes and the number of low-load nodes. If they match, it indicates that the current node load is uneven, although the average is The amount of processing tasks is low, but the handover time is likely to be longer due to uneven node load, and the handover is not performed at this time, which improves the reliability of determining the handover time.
  • obtaining the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information may include: obtaining the standard load task volume of each node according to the node processing capability information; processing task volume distribution information by the node As a basis, calculate the difference between the standard load task load of each node and the node processing task load; determine the node whose absolute value of the difference is greater than the preset difference and the difference is positive as a low-load node, and determine the difference Nodes whose absolute value is greater than the preset difference value and the difference value is negative are determined as high load nodes; the number of low load nodes corresponding to low load nodes is counted, and the number of high load nodes corresponding to high load nodes is counted.
  • the standard load task amount is the normal task amount that the node can handle. If the task amount is much higher than the standard load task amount, it means that the node is an overloaded node, that is, the node is determined as For a high-load node, if the task volume is much less than the standard load task volume, it means that the node is a low-load node, that is, the node is determined as a low-load node.
  • the number of low-load nodes and the number of high-load nodes can be accurately obtained according to the standard load tasks of each node and the distribution of node processing tasks, thereby improving the accuracy of identifying the uneven load of nodes degree.
  • the following steps may be performed: sending to the maintenance terminal that matches the test environment a reminder of the node load in the test environment Uneven notification message.
  • the maintenance terminal matching the test environment may be an electronic device used by maintenance personnel who configure the test environment.
  • Step 308 Determine the current moment as the handover time node that matches the test code.
  • the timing of the handover of the test code can be determined according to the node information in the test environment, so as to handover when the amount of node tasks in the test environment is not high Test code, reduce the handover time, and solve the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
  • Fig. 4 is a block diagram showing a test code handover control device according to an exemplary embodiment. As shown in Figure 4, the device includes:
  • the first obtaining unit 401 is configured to obtain node information in the test environment when a handover instruction for instructing the handover of the test code to the test environment is detected, and the node information includes at least node load status information and node processing capability information.
  • the test environment includes several nodes, and each node can process corresponding test tasks.
  • the node information of each node may include, but is not limited to, node processing capability information and node load status information.
  • the processing capability information can indicate the number of tasks that the node can process
  • the node load status information can indicate the number of tasks that the node is currently processing.
  • the first determining unit 402 is configured to determine the node processing task amount according to the node load status information.
  • the first determining unit 402 determining the processing task amount of the node according to the node load status information includes: the first determining unit 402 obtains the processing task amount of each node according to the node load status information; the first determining unit 402 Calculate the average value of the processing tasks of each node, and determine the average value as the node processing task amount.
  • the node load status information includes the processing task amount of each node, and the average value of the processing task amount of each node is used as the node processing task amount to reflect the current overall node processing task amount of all nodes Circumstances, enhance the grasp of the overall node processing task volume.
  • the average value of the amount of tasks being processed can be calculated according to the amount of tasks being processed by each node, and the average value can be determined as the amount of node processing tasks, so as to obtain a comprehensive evaluation of the node's processing tasks.
  • the task volume index is used to determine the time node of the test code handover, which is more reliable.
  • the judging unit 403 is used to judge whether the node processing task amount is lower than the preset node processing task amount.
  • the preset node processing task amount may be the preset maximum node processing task amount under the normal working condition of the test environment. If the node processing task amount is lower than the preset node processing task amount, it means that the node processing task amount at the current moment is within the normal working node processing task amount of the test environment. At this time, the current moment can be determined as the handover that matches the test code time frame. If the node processing task amount is higher than or equal to the preset node processing task amount, it means that the node processing task amount at the current moment is not within the normal working node processing task amount range of the test environment. At this time, it can be further based on the node processing rate and node task amount. Quantities determine the handover time node.
  • the second acquiring unit 404 is configured to acquire the node processing rate according to the node processing capability information when it is determined that the node task amount is higher than or equal to the preset node processing task amount.
  • the node processing capability information includes at least the processing rate of each node.
  • the average value can be calculated according to the processing rate of each node and used as the node processing rate.
  • the node processing rate is used to reflect the current node processing rate.
  • the speed information of the data is used to reflect the current node processing rate.
  • the second acquiring unit 404 acquiring the node processing rate according to the node processing capability information may include: the second acquiring unit 404 acquiring the node processing rate of each node according to the node processing capability information; the second acquiring unit 404 Calculate the average value of the node processing rate of each node, and determine the average value as the node processing rate.
  • the average value of the node processing rate can be calculated according to the node processing rate of each node, and the average value is determined as the node processing rate, thereby obtaining a comprehensive evaluation of the node processing rate Indicators, based on which to determine the time node of the test code handover, are more reliable.
  • the generating unit 405 is configured to generate a handover time node matching the test code based on the node processing rate and the node task amount.
  • this optional implementation it is possible to calculate the future processing tasks of a number of predicted time nodes that match each predicted time node, obtain the node timing forecast summary table, and determine the node future processing from the node timing forecast summary table
  • the task volume is less than the target predicted time node for the task volume of the preset node, so that the test code transfer is performed as early as possible under the premise of the node task volume is small, and the accuracy of selecting the test code transfer timing is improved.
  • the second determining unit 406 is configured to determine the current moment as the handover time node that matches the test code when it is determined that the node task amount is lower than the preset node processing task amount.
  • the timing of the test code handover can be determined according to the node information in the test environment.
  • the test code is handed over, which reduces the handover time, and solves the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
  • Fig. 5 is a block diagram showing another test code handover control device according to an exemplary embodiment.
  • Fig. 5 is optimized on the basis of Fig. 4.
  • the test code handover control device shown in Fig. 5 further includes: a third obtaining unit 407 for obtaining a test environment The nodes in the processing task volume distribution information.
  • the node processing task amount distribution information may include the node processing task amount matched by each node in the test environment.
  • the judging unit 403 is also used to judge whether the node processing task distribution information matches the deviation distribution information, and if it does not match, trigger the second determining unit 406 to execute the handover time node that determines the current moment as the test code matching.
  • the deviation distribution information includes at least a preset low-load node deviation ratio and a preset high-load node deviation ratio.
  • the preset low-load node deviation ratio is the maximum ratio of the preset low-load node to the total number of nodes.
  • the preset high-load node deviation ratio is the maximum ratio of the preset high-load node to the total number of nodes.
  • the judging unit 403 judging whether the node processing task volume distribution information matches the deviation distribution information may include: the judging unit 403 obtains the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information; The judging unit 403 calculates the first ratio of the number of low-load nodes to the total number of nodes, and calculates the second ratio of the number of high-load nodes to the total number of nodes; the judging unit 403 obtains the preset low-load node deviation ratio and the predicted value in the deviation distribution information.
  • the judging unit 403 determines whether the first ratio is higher than the preset low load node deviation ratio and whether the second ratio is higher than the preset high load node deviation ratio; when the first ratio is less than or equal to the preset low When the load node deviation ratio and/or the second ratio are less than or equal to the preset high load node deviation ratio, the judgment unit 403 determines that the node processing task volume distribution information does not match the deviation distribution information; when the first ratio is higher than the preset low load node deviation ratio When the node deviation ratio and the second ratio are higher than the preset high-load node deviation ratio, the judgment unit 403 determines that the node processing task amount distribution information matches the deviation distribution information.
  • the first ratio 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, it indicates that the node processing tasks are unevenly distributed at this time. If the processing tasks are unevenly distributed, it is determined not to be handed over.
  • the node processing task volume distribution information matches the deviation distribution information according to the number of high-load nodes and the number of low-load nodes. If they match, it indicates that the current node load is uneven, although the average is The amount of processing tasks is low, but the handover time is likely to be longer due to uneven node load, and the handover is not performed at this time, which improves the reliability of determining the handover time.
  • the judging unit 403 obtaining the number of high-load nodes and the number of low-load nodes according to the distribution information of the node processing task amount may include: the judging unit 403 obtains the standard load task amount of each node according to the node processing capability information; The judging unit 403 calculates the difference between the standard load task amount of each node and the node processing task amount based on the distribution information of the node processing task amount; the judgment unit 403 determines the absolute value of the difference value to be greater than the preset difference value and the difference value is a positive number Determine the node with a low load as a low-load node, and determine a node whose absolute value of the difference is greater than a preset difference and a negative difference as a high-load node; the judging unit 403 counts the number of low-load nodes corresponding to the low-load node, and the statistical high The number of high load nodes corresponding to load nodes.
  • the standard load task amount is the normal task amount that the node can handle. If the task amount is much higher than the standard load task amount, it means that the node is an overloaded node, that is, the node is determined as For a high-load node, if the task volume is much less than the standard load task volume, it means that the node is a low-load node, that is, the node is determined as a low-load node.
  • the number of low-load nodes and the number of high-load nodes can be accurately obtained according to the standard load tasks of each node and the distribution of node processing tasks, thereby improving the accuracy of identifying the uneven load of nodes degree.
  • the judgment unit 403 may also be used to: send a reminder to the maintenance terminal that matches the test environment A message indicating uneven load on nodes in the test environment.
  • the maintenance terminal matching the test environment may be an electronic device used by maintenance personnel who configure the test environment.
  • the maintenance personnel at the maintenance terminal that matches the test environment can be prompted to maintain the uneven load of nodes in the test environment, thereby improving the stability of the test environment.
  • the timing of the test code handover can be determined according to the node information in the test environment.
  • the test code is handed over, which reduces the handover time, and solves the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
  • the present application also provides an electronic device, the electronic device includes: a processor; a memory, the memory is stored with computer-readable instructions, when the computer-readable instructions are executed by the processor, the test code transfer control as shown above is realized method.
  • the electronic device may be the test code transfer device 100 shown in FIG. 1.
  • the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the test code transfer control method shown above is implemented.

Abstract

A test code handover control method and apparatus, the method comprising: when a handover instruction is detected, determining a node processing task quantity according to node load condition information in node information; determining whether the node processing task quantity is lower than a preset node processing task quantity (S203); obtaining the node processing rate according to node processing capability information when determined that the node task quantity is higher than or equal to the preset node processing task quantity (S204); on the basis of the node processing rate and the node task quantity, generating a handover time node that matches a test code (S205); and when determined that the node task quantity is lower than the preset node processing task quantity, determining the current moment to be a handover time node that matches the test code (S206). The described method is based on software testing technology, and test code handover is performed at the proper moment, thereby solving the problem of the duration of handover being too long due to a test code being handed over to a test environment at an improper moment.

Description

测试代码移交控制方法及装置、电子设备、计算机非易失性可读存储介质Test code transfer control method and device, electronic equipment, computer non-volatile readable storage medium 技术领域Technical field
本申请要求2019年3月18日递交、申请名称为“一种测试代码移交控制方法及装置”的中国专利申请201910203983.1的优先权,在此通过引用将其全部内容合并于此。This application claims the priority of the Chinese patent application 201910203983.1 filed on March 18, 2019 with the application name "A test code transfer control method and device", the entire content of which is incorporated herein by reference.
本申请涉及软件测试技术领域,尤其涉及一种测试代码移交控制方法及装置、电子设备、计算机非易失性可读存储介质。This application relates to the technical field of software testing, and in particular to a test code transfer control method and device, electronic equipment, and computer non-volatile readable storage media.
背景技术Background technique
目前,系统测试已广泛应用到不同领域的业务系统中,通过对业务系统进行系统测试能够及时发现业务系统存在的问题并予以解决,以此提高业务系统运行的可靠性。At present, system testing has been widely applied to business systems in different fields. System testing of business systems can promptly discover and solve business system problems, thereby improving the reliability of business system operation.
针对涵盖多个业务系统的业务系统群进行测试时,通常会将需要进行测试的业务系统对应的测试代码移交测试环境。在实践中本申请的发明人意识到,该业务系统对应的测试代码移交测试环境的过程中,经常会出现移交时机不恰当的现象,如在测试环境拥塞时进行移交,从而导致移交时长远远超过正常移交时长的情况发生。When testing a business system group covering multiple business systems, the test code corresponding to the business system that needs to be tested is usually transferred to the test environment. In practice, the inventor of this application realizes that in the process of transferring the test code corresponding to the business system to the test environment, improper timing of the transfer often occurs. For example, when the test environment is congested, the transfer takes a long time. A situation that exceeds the normal handover time occurs.
技术问题technical problem
综上,现有技术的缺陷在于:测试代码移交测试环境的时机不佳导致移交时长过长。In summary, the defect of the prior art is that the timing of the test code transfer to the test environment is not good, resulting in an excessively long transfer time.
技术解决方案Technical solutions
为了解决上述技术问题,本申请提供了一种测试代码移交控制方法及装置。In order to solve the above technical problems, this application provides a test code transfer control method and device.
其中,本申请所采用的技术方案为:Among them, the technical solutions adopted in this application are:
一方面,一种测试代码移交控制方法,包括:当检测到用于指示将所述测试代码移交至测试环境的移交指令时,获取所述测试环境中的节点信息,所述节点信息至少包括节点负荷状况信息和节点处理能力信息;根据所述节点负荷状况信息确定节点处理任务量;判断所述节点处理任务量是否低于预设节点处理任务量;当判断出所述节点任务量高于或者等于所述预设节点处理任务量时,根据所述节点处理能力信息获取节点处理速率;以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点;当判断出所述节点任务量低于所述预设节点处理任务量时,将当前时刻确定为所述测试代码相匹配的移交时间节点。In one aspect, a test code handover control method includes: when a handover instruction for instructing the test code to be handed over to a test environment is detected, acquiring node information in the test environment, where the node information includes at least a node Load status information and node processing capability information; determine the node processing task volume according to the node load status information; determine whether the node processing task volume is lower than the preset node processing task volume; when it is determined that the node task volume is higher than or When equal to the preset node processing task amount, obtain the node processing rate according to the node processing capability information; generate a handover time node matching the test code based on the node processing rate and the node task amount; When it is determined that the node task amount is lower than the preset node processing task amount, the current moment is determined as the handover time node that matches the test code.
另一方面,一种测试代码移交控制装置,包括:第一获取单元,用于当检测到用于指示将所述测试代码移交至测试环境的移交指令时,获取所述测试环境中的节点信息,所述节点信息至少包括节点负荷状况信息和节点处理能力信息;第一确定单元,用于根据所述节点负荷状况信息确定节点处理任务量;判断单元,用于判断所述节点处理任务量是否低于预设节点处理任务量;第二获取单元,用于当判断出所述节点任务量高于或者等于所述预设节点处理任务量时,根据所述节点处理能力信息获取节点处理速率;生成单元,用于以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点;第二确定单元,用于当判断出所述节点任务量低于所述预设节点处理任务量时,将当前时刻确定为所述测试代码相匹配的移交时间节点。On the other hand, a test code handover control device includes: a first obtaining unit configured to obtain node information in the test environment when a handover instruction for instructing to hand over the test code to the test environment is detected The node information includes at least node load status information and node processing capability information; a first determining unit is used to determine the node processing task amount according to the node load status information; the judgment unit is used to determine whether the node processing task amount is Lower than a preset node processing task amount; 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 task amount is higher than or equal to the preset node processing task amount; The generating unit is configured to generate a handover time node matching the test code based on the processing rate of the node and the task amount of the node; the second determining unit is used to determine that the task amount of the node is lower than the total When the preset node processes the task amount, the current moment is determined as the handover time node that matches the test code.
另一方面,一种电子设备,包括处理器及存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时实现如上所述的测试代码移交控制方法。On the other hand, an electronic device includes a processor and a memory, and computer-readable instructions are stored on the memory, and the computer-readable instructions implement the test code transfer control method as described above when executed by the processor.
另一方面,一种计算机非易失性可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述的测试代码移交控制方法。On the other hand, a computer non-volatile readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the test code transfer control method as described above is realized.
有益效果Beneficial effect
本申请实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present application may include the following beneficial effects:
此方法下,基于软件测试技术,在检测到指示移交测试代码的移交指令时,能够根据测试环境中的节点信息确定测试代码移交的时机,以此在测试环境中的节点任务量不高时移交测试代码,减少移交时间,解决了测试代码移交测试环境的时机不佳导致移交时长过长的问题。Under this method, based on software testing technology, when a handover instruction that instructs the handover of the test code is detected, the timing of the handover of the test code can be determined according to the node information in the test environment, so that the handover of the node tasks in the test environment is not high Test code, reduce the handover time, and solve the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并于说明书一起用于解释本申请的原理。The drawings herein are incorporated into the specification and constitute a part of the specification, show embodiments that conform to the application, and are used together with the specification to explain the principle of the application.
图1是根据一示例性实施例示出的一种测试代码移交控制装置的示意图;Fig. 1 is a schematic diagram showing a test code handover control device according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种测试代码移交控制方法的流程图;Fig. 2 is a flow chart showing a method for controlling test code handover according to an exemplary embodiment;
图3是根据一示例性实施例示出的另一种测试代码移交控制方法的流程图;Fig. 3 is a flowchart showing another test code handover control method according to an exemplary embodiment;
图4是根据一示例性实施例示出的一种测试代码移交控制装置的框图;Fig. 4 is a block diagram showing a test code handover control device according to an exemplary embodiment;
图5是根据一示例性实施例示出的另一种测试代码移交控制装置的框图。Fig. 5 is a block diagram showing another test code handover control device according to an exemplary embodiment.
本发明的实施方式Embodiments of the invention
这里将详细地对示例性实施例执行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Here, an exemplary embodiment will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are only examples of devices and methods consistent with some aspects of the application as detailed in the appended claims.
图1是根据一示例性实施例示出的一种测试代码移交控制装置示意图。装置100可以是上述便携移动设备。如图1所示,装置100可以包括以下一个或多个组件:处理组件102,存储器104,电源组件106,多媒体组件108,音频组件110,传感器组件114以及通信组件116。Fig. 1 is a schematic diagram showing a test code handover control device according to an exemplary embodiment. The apparatus 100 may be the aforementioned portable mobile device. As shown in FIG. 1, the device 100 may include one or more of the following components: a processing component 102, a memory 104, a power supply component 106, a multimedia component 108, an audio component 110, a sensor component 114, and a communication component 116.
处理组件102通常控制装置100的整体操作,诸如与显示,电话呼叫,数据通信,相机操作以及记录操作相关联的操作等。处理组件102可以包括一个或多个处理器118来执行指令,以完成下述的方法的全部或部分步骤。此外,处理组件102可以包括一个或多个模块,用于便于处理组件102和其他组件之间的交互。例如,处理组件102可以包括多媒体模块,用于以方便多媒体组件108和处理组件102之间的交互。The processing component 102 generally controls the overall operations of the device 100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 102 may include one or more processors 118 to execute instructions to complete all or part of the steps of the following method. In addition, the processing component 102 may include one or more modules to facilitate the interaction between the processing component 102 and other components. For example, the processing component 102 may include a multimedia module to facilitate the interaction between the multimedia component 108 and the processing component 102.
存储器104被配置为存储各种类型的数据以支持在装置100的操作。这些数据的示例包括用于在装置100上操作的任何应用程序或方法的指令。存储器104可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(Static Random Access Memory,简称SRAM),电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,简称EEPROM),可擦除可编程只读存储器(Erasable Programmable Read Only Memory,简称EPROM),可编程只读存储器(Programmable Red-Only Memory,简称PROM),只读存储器(Read-Only Memory,简称ROM),磁存储器,快闪存储器,磁盘或光盘。存储器104中还存储有一个或多个模块,用于该一个或多个模块被配置成由该一个或多个处理器118执行,以完成如下所示方法中的全部或者部分步骤。The memory 104 is configured to store various types of data to support operations in the device 100. Examples of these data include instructions for any application or method operating on the device 100. The memory 104 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (Static Random Access Memory). Access Memory, SRAM for short), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (EPROM) Red-Only Memory, PROM for short), Read-Only Memory (ROM for short), magnetic memory, flash memory, magnetic disk or optical disk. The memory 104 also stores one or more modules, and the one or more modules are configured to be executed by the one or more processors 118 to complete all or part of the steps in the method shown below.
电源组件106为装置100的各种组件提供电力。电源组件106可以包括电源管理系统,一个或多个电源,及其他与为装置100生成、管理和分配电力相关联的组件。The power supply component 106 provides power to various components of the device 100. The power supply component 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.
多媒体组件108包括在所述装置100和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(Liquid Crystal Display,简称LCD)和触摸面板。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。屏幕还可以包括有机电致发光显示器(Organic Light Emitting Display,简称OLED)。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 (Liquid Crystal Display, referred to as LCD) and touch panel. If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, sliding, 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 related to the touch or slide operation. The screen may also include an organic electroluminescence display (Organic Light Emitting Display, OLED for short).
音频组件110被配置为输出和/或输入音频信号。例如,音频组件110包括一个麦克风(Microphone,简称MIC),当装置100处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器104或经由通信组件116发送。在一些实施例中,音频组件110还包括一个扬声器,用于输出音频信号。The audio component 110 is configured to output and/or input audio signals. For example, the audio component 110 includes a microphone (Microphone, MIC for short). When the device 100 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 104 or sent via the communication component 116. In some embodiments, the audio component 110 further includes a speaker for outputting audio signals.
传感器组件114包括一个或多个传感器,用于为装置100提供各个方面的状态评估。例如,传感器组件114可以检测到装置100的打开/关闭状态,组件的相对定位,传感器组件114还可以检测装置100或装置100一个组件的位置改变以及装置100的温度变化。在一些实施例中,该传感器组件114还可以包括磁传感器,压力传感器或温度传感器。The sensor component 114 includes one or more sensors for providing the device 100 with various aspects of state evaluation. For example, the sensor component 114 can detect the open/close state of the device 100 and the relative positioning of components. The sensor component 114 can also detect the position change of the device 100 or a component of the device 100 and the temperature change of the device 100. In some embodiments, the sensor component 114 may also include a magnetic sensor, a pressure sensor or a temperature sensor.
通信组件116被配置为便于装置100和其他设备之间有线或无线方式的通信。装置100可以接入基于通信标准的无线网络,如WiFi(Wireless-Fidelity,无线保真)。在一个示例性实施例中,通信组件116经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件116还包括近场通信(Near Field Communication,简称NFC)模块,用于以促进短程通信。例如,在NFC模块可基于射频识别(Radio Frequency Identification,简称RFID)技术,红外数据协会(Infrared Data Association,简称IrDA)技术,超宽带(Ultra Wideband,简称UWB)技术,蓝牙技术和其他技术来实现。The communication component 116 is configured to facilitate wired or wireless communication between the apparatus 100 and other devices. The device 100 can access a wireless network based on a communication standard, such as WiFi (Wireless-Fidelity, wireless fidelity). In an exemplary embodiment, the communication component 116 receives a broadcast signal 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 (Near Field Communication, NFC for short) module for facilitating short-range communication. For example, the NFC module can be based on radio frequency identification (Radio Frequency Identification, referred to as RFID) technology, infrared data association (Infrared Data Association, referred to as IrDA) technology, ultra-wideband (Ultra Wideband, referred to as UWB) technology, Bluetooth technology and other technologies.
在示例性实施例中,装置100可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit,简称ASIC)、数字信号处理器、数字信号处理设备、可编程逻辑器件、现场可编程门阵列、控制器、微控制器、微处理器或其他电子元件实现,用于执行下述方法。In an exemplary embodiment, the apparatus 100 may be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuits). Specific Integrated Circuit, referred to as ASIC), digital signal processor, digital signal processing equipment, programmable logic device, field programmable gate array, controller, microcontroller, microprocessor or other electronic components to implement the following method.
图2是根据一示例性实施例示出的一种测试代码移交控制方法的流程图。如图2所示,此方法包括以下步骤:Fig. 2 is a flow chart showing a method for controlling test code handover according to an exemplary embodiment. As shown in Figure 2, this method includes the following steps:
步骤201,当检测到用于指示将测试代码移交至测试环境的移交指令时,获取测试环境中的节点信息,节点信息至少包括节点负荷状况信息和节点处理能力信息。Step 201: When a handover instruction for instructing the handover of the test code to the test environment is detected, obtain node information in the test environment. The node information includes at least node load status information and node processing capability information.
本申请实施例中,测试环境中包含若干个节点,每个节点可以处理相应的测试任务,并且,每个节点的节点信息可以包括但不限于节点处理能力信息以及节点负荷状况信息,其中,节点处理能力信息可以指示节点可以处理的任务数量,节点负荷状况信息可以指示节点当前正在处理的任务数量。In the embodiment of the present application, the test environment includes several nodes, and each node can process corresponding test tasks. Moreover, the node information of each node may include, but is not limited to, node processing capability information and node load status information. The processing capability information can indicate the number of tasks that the node can process, and the node load status information can indicate the number of tasks that the node is currently processing.
步骤202,根据节点负荷状况信息确定节点处理任务量。Step 202: Determine the node processing task amount according to the node load status information.
作为一种可选的实施方式,根据节点负荷状况信息确定节点处理任务量可以包括:As an optional implementation manner, determining the node processing task amount according to the node load status information may include:
    根据节点负荷状况信息获取各个节点的正在处理任务量;... Obtain the amount of tasks being processed by each node according to the node load status information;
计算各个节点的正在处理任务量的平均值,并将平均值确定为节点处理任务量。Calculate the average value of the processing tasks of each node, and determine the average value as the node processing task amount.
本申请实施例中,节点负荷状况信息中包括各个节点的正在处理任务量,将各个节点的正在处理任务量的平均值作为节点处理任务量,以此反映当前的全部节点的整体节点处理任务量情况,增强了对整体节点处理任务量情况的把握。In the embodiment of the present application, the node load status information includes the processing task amount of each node, and the average value of the processing task amount of each node is used as the node processing task amount to reflect the current overall node processing task amount of all nodes Circumstances, enhance the grasp of the overall node processing task volume.
通过实施这种可选的实施方式,可以根据每个节点的正在处理任务量来计算正在处理任务量的平均值,将平均值确定为节点处理任务量,以此获得能够综合评价节点的正在处理任务量的指标,据此来确定测试代码移交时间节点,更加可靠。By implementing this optional implementation method, the average value of the amount of tasks being processed can be calculated according to the amount of tasks being processed by each node, and the average value can be determined as the amount of node processing tasks, so as to obtain a comprehensive evaluation of the node's processing tasks. The task volume index is used to determine the time node of the test code handover, which is more reliable.
步骤203,判断节点处理任务量是否低于预设节点处理任务量,如果是,执行步骤206,如果否,执行204至步骤205。Step 203: Determine whether the node processing task amount is lower than the preset node processing task amount, if yes, execute step 206, if not, execute step 204 to step 205.
本申请实施例中,预设节点处理任务量可以为预先设置的测试环境正常工作情况下的最大节点处理任务量。如果节点处理任务量低于预设节点处理任务量,则说明当前时刻的节点处理任务量处于测试环境正常工作的节点处理任务量范围内,此时可以将当前时刻确定为测试代码相匹配的移交时间节点。如果节点处理任务量高于或者等于预设节点处理任务量,则说明当前时刻的节点处理任务量不处于测试环境正常工作的节点处理任务量范围内,此时可以进一步根据节点处理速率以及节点任务量确定移交时间节点。In the embodiment of the present application, the preset node processing task amount may be the preset maximum node processing task amount under the normal working condition of the test environment. If the node processing task amount is lower than the preset node processing task amount, it means that the node processing task amount at the current moment is within the normal working node processing task amount of the test environment. At this time, the current moment can be determined as the handover that matches the test code time frame. If the node processing task amount is higher than or equal to the preset node processing task amount, it means that the node processing task amount at the current moment is not within the normal working node processing task amount range of the test environment. At this time, it can be further based on the node processing rate and node task amount. Quantities determine the handover time node.
步骤204,根据节点处理能力信息获取节点处理速率。Step 204: Obtain the node processing rate according to the node processing capability information.
本申请实施例中,节点处理能力信息至少包括各个节点的正在处理速率,可以根据各个节点的正在处理速率计算平均值,将其作为节点处理速率,其中,节点处理速率用于反应当前时刻节点处理数据的速度信息。In the embodiment of the present application, the node processing capability information includes at least the processing rate of each node. The average value can be calculated according to the processing rate of each node and used as the node processing rate. The node processing rate is used to reflect the current node processing rate. The speed information of the data.
作为一种可选的实施方式,根据节点处理能力信息获取节点处理速率可以包括:根据节点处理能力信息获取各个节点的节点正在处理速率;计算各个节点的节点正在处理速率的平均值,并将平均值确定为节点处理速率。As an optional implementation manner, acquiring the node processing rate according to the node processing capability information may include: acquiring the node processing rate of each node according to the node processing capability information; calculating the average value of the node processing rate of each node, and calculating the average The value is determined as the node processing rate.
通过实施这种可选的实施方式,可以根据每个节点的节点正在处理速率来计算节点正在处理速率的平均值,将平均值确定为节点处理速率,以此获得能够综合评价节点正在处理速率的指标,据此来确定测试代码移交时间节点,更加可靠。By implementing this optional implementation method, the average value of the node processing rate can be calculated according to the node processing rate of each node, and the average value is determined as the node processing rate, thereby obtaining a comprehensive evaluation of the node processing rate Indicators, based on which to determine the time node of the test code handover, are more reliable.
步骤205,以节点处理速率与节点任务量为依据,生成测试代码相匹配的移交时间节点。Step 205: Generate a handover time node matching the test code based on the node processing rate and the node task amount.
作为一种可选的实施方式,以节点处理速率与节点任务量为依据,生成测试代码相匹配的移交时间节点可以包括:根据节点任务量、节点处理速率以及预置预测公式计算预测时间节点相匹配的节点未来处理任务量,其中,预置预测公式为x=a-v×t;其中a表示节点任务量,v表示节点处理速率,t表示预测时间节点,x表示预测时间节点相匹配的节点未来处理任务量;将预测时间节点与预测时间节点相匹配的节点未来处理任务量对应存储,获得节点时序预测总表;在节点时序预测总表中选取节点未来处理任务量小于预设节点处理任务量的目标节点处理任务量;将目标节点处理任务量相匹配的目标预测时间节点确定为测试代码相匹配的移交时间节点。As an optional implementation manner, based on the node processing rate and the node task volume, generating the handover time node that matches the test code may include: calculating the predicted time node phase based on the node task volume, the node processing rate, and a preset prediction formula. The future processing task volume of the matched node, where the preset prediction formula is x=av×t; where a represents the node task volume, v represents the node processing rate, t represents the predicted time node, and x represents the future of the node matched by the predicted time node Processing task volume; correspondingly store the future processing task volume of the node matching the predicted time node and the predicted time node, and obtain the node timing forecast total table; select the node's future processing task amount in the node timing forecast total table to be less than the preset node processing task amount The target node handles the task amount; the target predicted time node that matches the target node's processing task amount is determined as the handover time node that matches the test code.
本申请实施例中,可以规定节点处理速率v的单位为任务数量/每秒,预测时间节点t的单位可以为秒,预测时间节点t可以表示从当前时刻开始经过t,例如,当预测时间节点t为30s时,表示经过30秒之后的时刻。通过该预置预测公式可以计算得到未来若干时刻(1s,2s,3s等之后的时刻)与该时刻对应的该节点未来处理任务数量。In the embodiment of the present application, the unit of the node processing rate v can be specified as the number of tasks/second, the unit of the predicted time node t can be seconds, and the predicted time node t can indicate the passage of t from the current moment, for example, when the predicted time node When t is 30s, it means the time after 30 seconds. The preset prediction formula can be used to calculate the number of future processing tasks of the node corresponding to a certain time in the future (1s, 2s, 3s, etc.) in the future.
通过实施这种可选的实施方式,可以计算出若干预测时间节点与每一预测时间节点相匹配的节点未来处理任务量,获得节点时序预测总表,从节点时序预测总表中确定节点未来处理任务量小于预设节点处理任务量的目标预测时间节点,从而在节点任务量较小的前提下尽可能早的进行测试代码移交,提高了选取测试代码移交时机的精准度。By implementing this optional implementation, it is possible to calculate the future processing tasks of a number of predicted time nodes that match each predicted time node, obtain the node timing forecast summary table, and determine the node future processing from the node timing forecast summary table The task volume is less than the target predicted time node for the task volume of the preset node, so that the test code transfer is performed as early as possible under the premise of the node task volume is small, and the accuracy of selecting the test code transfer timing is improved.
步骤206,将当前时刻确定为测试代码相匹配的移交时间节点。Step 206: Determine the current moment as the handover time node that matches the test code.
上述方法下,基于软件测试技术,在检测到指示移交测试代码的移交指令时,能够根据测试环境中的节点信息确定测试代码移交的时机,以此在测试环境中的节点任务量不高时移交测试代码,减少移交时间,解决了测试代码移交测试环境的时机不佳导致移交时长过长的问题。Under the above method, based on the software testing technology, when a handover instruction indicating the handover of the test code is detected, the timing of the handover of the test code can be determined according to the node information in the test environment, so as to handover when the amount of node tasks in the test environment is not high Test code, reduce the handover time, and solve the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
图3是根据另一示例性实施例示出的另一种测试代码移交控制方法的流程图。如图3所示,此方法包括以下步骤:Fig. 3 is a flowchart showing another test code handover control method according to another exemplary embodiment. As shown in Figure 3, this method includes the following steps:
步骤301,当检测到用于指示将测试代码移交至测试环境的移交指令时,获取测试环境中的节点信息,节点信息至少包括节点负荷状况信息和节点处理能力信息。Step 301: When a handover instruction for instructing the handover of the test code to the test environment is detected, obtain node information in the test environment. The node information includes at least node load status information and node processing capability information.
步骤302,根据节点负荷状况信息确定节点处理任务量。Step 302: Determine the node processing task amount according to the node load status information.
步骤303,判断节点处理任务量是否低于预设节点处理任务量,如果是,执行步骤304至步骤305,如果否,执行步骤306至步骤307。In step 303, it is determined whether the processing task amount of the node is lower than the preset node processing task amount, if yes, execute step 304 to step 305, if not, execute step 306 to step 307.
步骤304,根据节点处理能力信息获取节点处理速率。Step 304: Obtain the node processing rate according to the node processing capability information.
步骤305,以节点处理速率与节点任务量为依据,生成测试代码相匹配的移交时间节点。Step 305: Generate a handover time node matching the test code based on the node processing rate and the node task volume.
步骤306,获取测试环境中的节点处理任务量分布信息。Step 306: Obtain distribution information of processing tasks of nodes in the test environment.
本申请实施例中,节点处理任务量分布信息可以包括测试环境中的各个节点与其相匹配的节点处理任务量。In the embodiment of the present application, the node processing task amount distribution information may include the node processing task amount matched by each node in the test environment.
步骤307,判断节点处理任务量分布信息与偏差分布信息是否相匹配,如果是,结束本次流程,如果否,执行步骤308。Step 307: Determine whether the node processing task amount distribution information matches the deviation distribution information, if yes, end this process, if not, execute step 308.
本申请实施例中,偏差分布信息中至少包括预设低负荷节点偏差比值以及预设高负荷节点偏差比值,预设低负荷节点偏差比值为预先设置的低负荷节点可以占总节点数量的最大比值,预设高负荷节点偏差比值为预先设置的高负荷节点可以占总节点数量的最大比值。In the embodiment of the present application, the deviation distribution information includes at least a preset low-load node deviation ratio and a preset high-load node deviation ratio. The preset low-load node deviation ratio is the maximum ratio of the preset low-load node to the total number of nodes. , The preset high-load node deviation ratio is the maximum ratio of the preset high-load node to the total number of nodes.
作为一种可选的实施方式,判断节点处理任务量分布信息与偏差分布信息是否相匹配可以包括:根据节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量;计算低负荷节点数量占总节点数量的第一比值,以及计算高负荷节点数量占总节点数量的第二比值;获取偏差分布信息中的预设低负荷节点偏差比值以及预设高负荷节点偏差比值;判断第一比值是否高于预设低负荷节点偏差比值以及判断第二比值是否高于预设高负荷节点偏差比值;当第一比值小于或者等于预设低负荷节点偏差比值和/或第二比值小于或者等于预设高负荷节点偏差比值时,确定节点处理任务量分布信息与偏差分布信息不相匹配;当第一比值高于预设低负荷节点偏差比值且第二比值高于预设高负荷节点偏差比值时,确定节点处理任务量分布信息与偏差分布信息相匹配。As an optional implementation manner, judging whether the node processing task volume distribution information matches the deviation distribution information may include: obtaining the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information; calculating the number of low-load nodes The first ratio of the total number of nodes, and the second ratio of the number of high-load nodes to the total number of nodes is calculated; the preset low-load node deviation ratio and the preset high-load node deviation ratio in the deviation distribution information are obtained; judge whether the first ratio is Higher than the preset low-load node deviation ratio and determine whether the second ratio is higher than the 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 When the high load node deviation ratio, it is determined that the node processing task load distribution information does not match 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, It is determined that the distribution information of the node processing task amount matches the deviation distribution information.
本申请实施例中,当第一比值高于预设低负荷节点偏差比值且第二比值高于预设高负荷节点偏差比值时,说明此时节点处理任务量分布不均,据此可以对节点处理任务量分布不均的情况确定不进行移交。In the embodiment of the present application, 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, it indicates that the node processing tasks are unevenly distributed at this time. If the processing tasks are unevenly distributed, it is determined not to be handed over.
通过实施这种可选的实施方式,可以根据高负荷节点数量和低负荷节点数量来判断节点处理任务量分布信息与偏差分布信息是否相匹配,相匹配的话说明当前节点负荷不均,虽然平均正在处理任务量较低,但很有可能因节点负荷不均导致移交时间变长,此时也不进行移交,提高了确定移交时机的可靠性。By implementing this optional implementation, it is possible to determine whether the node processing task volume distribution information matches the deviation distribution information according to the number of high-load nodes and the number of low-load nodes. If they match, it indicates that the current node load is uneven, although the average is The amount of processing tasks is low, but the handover time is likely to be longer due to uneven node load, and the handover is not performed at this time, which improves the reliability of determining the handover time.
作为一种可选的实施方式,根据节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量可以包括:根据节点处理能力信息获取各个节点的标准负荷任务量;以节点处理任务量分布信息为依据,计算各个节点的标准负荷任务量与节点处理任务量的差值;将差值的绝对值大于预设差值且差值为正数的节点确定为低负荷节点,以及将差值的绝对值大于预设差值且差值为负数的节点确定为高负荷节点;统计低负荷节点对应的低负荷节点数量,以及统计高负荷节点对应的高负荷节点数量。As an optional implementation manner, obtaining the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information may include: obtaining the standard load task volume of each node according to the node processing capability information; processing task volume distribution information by the node As a basis, calculate the difference between the standard load task load of each node and the node processing task load; determine the node whose absolute value of the difference is greater than the preset difference and the difference is positive as a low-load node, and determine the difference Nodes whose absolute value is greater than the preset difference value and the difference value is negative are determined as high load nodes; the number of low load nodes corresponding to low load nodes is counted, and the number of high load nodes corresponding to high load nodes is counted.
本申请实施例中,标准负荷任务量为该节点能够处理的正常任务量,如果任务量远高于标准负荷任务量,说明该节点为超负荷工作的节点,也即是,将该节点确定为高负荷节点,如果任务量远小于标准负荷任务量,说明该节点为低负荷工作的节点,也即是,将该节点确定为低负荷节点。In the embodiment of this application, the standard load task amount is the normal task amount that the node can handle. If the task amount is much higher than the standard load task amount, it means that the node is an overloaded node, that is, the node is determined as For a high-load node, if the task volume is much less than the standard load task volume, it means that the node is a low-load node, that is, the node is determined as a low-load node.
通过实施这种可选的实施方式,能够根据各个节点的标准负荷任务量和节点处理任务分布量准确地获得低负荷节点数量和高负荷节点数量,从而提高了对节点负荷不均情况识别的准确度。By implementing this optional implementation method, the number of low-load nodes and the number of high-load nodes can be accurately obtained according to the standard load tasks of each node and the distribution of node processing tasks, thereby improving the accuracy of identifying the uneven load of nodes degree.
作为一种可选的实施方式,在判断出节点处理任务量分布信息与偏差分布信息相匹配之后,还可以执行以下步骤:向测试环境相匹配的维护终端发送用于提示测试环境中的节点负荷不均的提示消息。本申请实施例中,测试环境相匹配的维护终端可以为配置该测试环境的维护人员所使用的电子设备。通过实施这种可选的实施方式,可以提示测试环境相匹配的维护终端处的维护人员对测试环境中节点负荷不均的情况进行维护,从而提高了测试环境的稳定性。As an optional implementation manner, after judging that the node processing task amount distribution information matches the deviation distribution information, the following steps may be performed: sending to the maintenance terminal that matches the test environment a reminder of the node load in the test environment Uneven notification message. In the embodiment of the present application, the maintenance terminal matching the test environment may be an electronic device used by maintenance personnel who configure the test environment. By implementing this optional implementation manner, the maintenance personnel at the maintenance terminal that matches the test environment can be prompted to maintain the uneven load of nodes in the test environment, thereby improving the stability of the test environment.
步骤308,将当前时刻确定为测试代码相匹配的移交时间节点。Step 308: Determine the current moment as the handover time node that matches the test code.
上述方法下,基于软件测试技术,在检测到指示移交测试代码的移交指令时,能够根据测试环境中的节点信息确定测试代码移交的时机,以此在测试环境中的节点任务量不高时移交测试代码,减少移交时间,解决了测试代码移交测试环境的时机不佳导致移交时长过长的问题。Under the above method, based on the software testing technology, when a handover instruction indicating the handover of the test code is detected, the timing of the handover of the test code can be determined according to the node information in the test environment, so as to handover when the amount of node tasks in the test environment is not high Test code, reduce the handover time, and solve the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
图4是根据一示例性实施例示出的一种测试代码移交控制装置的框图。如图4所示,该装置包括:Fig. 4 is a block diagram showing a test code handover control device according to an exemplary embodiment. As shown in Figure 4, the device includes:
第一获取单元401,用于当检测到用于指示将测试代码移交至测试环境的移交指令时,获取测试环境中的节点信息,节点信息至少包括节点负荷状况信息和节点处理能力信息。The first obtaining unit 401 is configured to obtain node information in the test environment when a handover instruction for instructing the handover of the test code to the test environment is detected, and the node information includes at least node load status information and node processing capability information.
本申请实施例中,测试环境中包含若干个节点,每个节点可以处理相应的测试任务,并且,每个节点的节点信息可以包括但不限于节点处理能力信息以及节点负荷状况信息,其中,节点处理能力信息可以指示节点可以处理的任务数量,节点负荷状况信息可以指示节点当前正在处理的任务数量。In the embodiment of the present application, the test environment includes several nodes, and each node can process corresponding test tasks. Moreover, the node information of each node may include, but is not limited to, node processing capability information and node load status information. The processing capability information can indicate the number of tasks that the node can process, and the node load status information can indicate the number of tasks that the node is currently processing.
第一确定单元402,用于根据节点负荷状况信息确定节点处理任务量。The first determining unit 402 is configured to determine the node processing task amount according to the node load status information.
作为一种可选的实施方式,第一确定单元402根据节点负荷状况信息确定节点处理任务量包括:第一确定单元402根据节点负荷状况信息获取各个节点的正在处理任务量;第一确定单元402计算各个节点的正在处理任务量的平均值,并将平均值确定为节点处理任务量。As an optional implementation manner, the first determining unit 402 determining the processing task amount of the node according to the node load status information includes: the first determining unit 402 obtains the processing task amount of each node according to the node load status information; the first determining unit 402 Calculate the average value of the processing tasks of each node, and determine the average value as the node processing task amount.
本申请实施例中,节点负荷状况信息中包括各个节点的正在处理任务量,将各个节点的正在处理任务量的平均值作为节点处理任务量,以此反映当前的全部节点的整体节点处理任务量情况,增强了对整体节点处理任务量情况的把握。In the embodiment of the present application, the node load status information includes the processing task amount of each node, and the average value of the processing task amount of each node is used as the node processing task amount to reflect the current overall node processing task amount of all nodes Circumstances, enhance the grasp of the overall node processing task volume.
通过实施这种可选的实施方式,可以根据每个节点的正在处理任务量来计算正在处理任务量的平均值,将平均值确定为节点处理任务量,以此获得能够综合评价节点的正在处理任务量的指标,据此来确定测试代码移交时间节点,更加可靠。By implementing this optional implementation method, the average value of the amount of tasks being processed can be calculated according to the amount of tasks being processed by each node, and the average value can be determined as the amount of node processing tasks, so as to obtain a comprehensive evaluation of the node's processing tasks. The task volume index is used to determine the time node of the test code handover, which is more reliable.
判断单元403,用于判断节点处理任务量是否低于预设节点处理任务量。The judging unit 403 is used to judge whether the node processing task amount is lower than the preset node processing task amount.
本申请实施例中,预设节点处理任务量可以为预先设置的测试环境正常工作情况下的最大节点处理任务量。如果节点处理任务量低于预设节点处理任务量,则说明当前时刻的节点处理任务量处于测试环境正常工作的节点处理任务量范围内,此时可以将当前时刻确定为测试代码相匹配的移交时间节点。如果节点处理任务量高于或者等于预设节点处理任务量,则说明当前时刻的节点处理任务量不处于测试环境正常工作的节点处理任务量范围内,此时可以进一步根据节点处理速率以及节点任务量确定移交时间节点。In the embodiment of the present application, the preset node processing task amount may be the preset maximum node processing task amount under the normal working condition of the test environment. If the node processing task amount is lower than the preset node processing task amount, it means that the node processing task amount at the current moment is within the normal working node processing task amount of the test environment. At this time, the current moment can be determined as the handover that matches the test code time frame. If the node processing task amount is higher than or equal to the preset node processing task amount, it means that the node processing task amount at the current moment is not within the normal working node processing task amount range of the test environment. At this time, it can be further based on the node processing rate and node task amount. Quantities determine the handover time node.
第二获取单元404,用于当判断出节点任务量高于或者等于预设节点处理任务量时,根据节点处理能力信息获取节点处理速率。The second acquiring unit 404 is configured to acquire the node processing rate according to the node processing capability information when it is determined that the node task amount is higher than or equal to the preset node processing task amount.
本申请实施例中,节点处理能力信息至少包括各个节点的正在处理速率,可以根据各个节点的正在处理速率计算平均值,将其作为节点处理速率,其中,节点处理速率用于反应当前时刻节点处理数据的速度信息。In the embodiment of the present application, the node processing capability information includes at least the processing rate of each node. The average value can be calculated according to the processing rate of each node and used as the node processing rate. The node processing rate is used to reflect the current node processing rate. The speed information of the data.
作为一种可选的实施方式,第二获取单元404根据节点处理能力信息获取节点处理速率可以包括:第二获取单元404根据节点处理能力信息获取各个节点的节点正在处理速率;第二获取单元404计算各个节点的节点正在处理速率的平均值,并将平均值确定为节点处理速率。As an optional implementation manner, the second acquiring unit 404 acquiring the node processing rate according to the node processing capability information may include: the second acquiring unit 404 acquiring the node processing rate of each node according to the node processing capability information; the second acquiring unit 404 Calculate the average value of the node processing rate of each node, and determine the average value as the node processing rate.
通过实施这种可选的实施方式,可以根据每个节点的节点正在处理速率来计算节点正在处理速率的平均值,将平均值确定为节点处理速率,以此获得能够综合评价节点正在处理速率的指标,据此来确定测试代码移交时间节点,更加可靠。By implementing this optional implementation method, the average value of the node processing rate can be calculated according to the node processing rate of each node, and the average value is determined as the node processing rate, thereby obtaining a comprehensive evaluation of the node processing rate Indicators, based on which to determine the time node of the test code handover, are more reliable.
生成单元405,用于以节点处理速率与节点任务量为依据,生成测试代码相匹配的移交时间节点。The generating unit 405 is configured to generate a handover time node matching the test code based on the node processing rate and the node task amount.
作为一种可选的实施方式,生成单元405以节点处理速率与节点任务量为依据,生成测试代码相匹配的移交时间节点可以包括:生成单元405根据节点任务量、节点处理速率以及预置预测公式计算预测时间节点相匹配的节点未来处理任务量,其中,预置预测公式为x=a-v×t;其中,a表示节点任务量,v表示节点处理速率,t表示预测时间节点,x表示预测时间节点相匹配的节点未来处理任务量;生成单元405将预测时间节点与预测时间节点相匹配的节点未来处理任务量对应存储,获得节点时序预测总表;生成单元405在节点时序预测总表中选取节点未来处理任务量小于预设节点处理任务量的目标节点处理任务量;生成单元405将目标节点处理任务量相匹配的目标预测时间节点确定为测试代码相匹配的移交时间节点。As an optional implementation manner, the generating unit 405 is based on the node processing rate and the node task volume, and generating the handover time node matching the test code may include: the generating unit 405 according to the node task volume, the node processing rate, and preset predictions The formula calculates the future processing task volume of the node matching the predicted time node, where the preset prediction formula is x=av×t; where a represents the node task volume, v represents the node processing rate, t represents the predicted time node, and x represents the prediction The future processing task amount of the node matching the time node; the generating unit 405 correspondingly stores the predicted time node and the future processing task amount of the node matching the predicted time node to obtain the node timing prediction summary table; the generating unit 405 is in the node timing prediction summary table The target node processing task amount of the selected node whose future processing task amount is less than the preset node processing task amount; the generating unit 405 determines the target predicted time node matching the target node processing task amount as the handover time node matching the test code.
通过实施这种可选的实施方式,可以计算出若干预测时间节点与每一预测时间节点相匹配的节点未来处理任务量,获得节点时序预测总表,从节点时序预测总表中确定节点未来处理任务量小于预设节点处理任务量的目标预测时间节点,从而在节点任务量较小的前提下尽可能早的进行测试代码移交,提高了选取测试代码移交时机的精准度。By implementing this optional implementation, it is possible to calculate the future processing tasks of a number of predicted time nodes that match each predicted time node, obtain the node timing forecast summary table, and determine the node future processing from the node timing forecast summary table The task volume is less than the target predicted time node for the task volume of the preset node, so that the test code transfer is performed as early as possible under the premise of the node task volume is small, and the accuracy of selecting the test code transfer timing is improved.
第二确定单元406,用于当判断出节点任务量低于预设节点处理任务量时,将当前时刻确定为测试代码相匹配的移交时间节点。The second determining unit 406 is configured to determine the current moment as the handover time node that matches the test code when it is determined that the node task amount is lower than the preset node processing task amount.
可见,通过实施图4所描述的测试代码移交控制装置,基于软件测试技术,在检测到指示移交测试代码的移交指令时,能够根据测试环境中的节点信息确定测试代码移交的时机,以此在测试环境中的节点任务量不高时移交测试代码,减少移交时间,解决了测试代码移交测试环境的时机不佳导致移交时长过长的问题。It can be seen that by implementing the test code handover control device described in Figure 4, based on software testing technology, when a handover instruction indicating the handover of the test code is detected, the timing of the test code handover can be determined according to the node information in the test environment. When the task load of the nodes in the test environment is not high, the test code is handed over, which reduces the handover time, and solves the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
图5是根据一示例性实施例示出的另一种测试代码移交控制装置的框图。图5是在图4基础上优化得到的,与图4所示的测试代码移交控制装置相比,图5所示的测试代码移交控制装置还包括:第三获取单元407,用于获取测试环境中的节点处理任务量分布信息。Fig. 5 is a block diagram showing another test code handover control device according to an exemplary embodiment. Fig. 5 is optimized on the basis of Fig. 4. Compared with the test code handover control device shown in Fig. 4, the test code handover control device shown in Fig. 5 further includes: a third obtaining unit 407 for obtaining a test environment The nodes in the processing task volume distribution information.
本申请实施例中,节点处理任务量分布信息可以包括测试环境中的各个节点与其相匹配的节点处理任务量。In the embodiment of the present application, the node processing task amount distribution information may include the node processing task amount matched by each node in the test environment.
判断单元403,还用于判断节点处理任务量分布信息与偏差分布信息是否相匹配,如果不匹配,触发第二确定单元406执行上述将当前时刻确定为测试代码相匹配的移交时间节点。The judging unit 403 is also used to judge whether the node processing task distribution information matches the deviation distribution information, and if it does not match, trigger the second determining unit 406 to execute the handover time node that determines the current moment as the test code matching.
本申请实施例中,偏差分布信息中至少包括预设低负荷节点偏差比值以及预设高负荷节点偏差比值,预设低负荷节点偏差比值为预先设置的低负荷节点可以占总节点数量的最大比值,预设高负荷节点偏差比值为预先设置的高负荷节点可以占总节点数量的最大比值。In the embodiment of the present application, the deviation distribution information includes at least a preset low-load node deviation ratio and a preset high-load node deviation ratio. The preset low-load node deviation ratio is the maximum ratio of the preset low-load node to the total number of nodes. , The preset high-load node deviation ratio is the maximum ratio of the preset high-load node to the total number of nodes.
作为一种可选的实施方式,判断单元403判断节点处理任务量分布信息与偏差分布信息是否相匹配可以包括:判断单元403根据节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量;判断单元403计算低负荷节点数量占总节点数量的第一比值,以及计算高负荷节点数量占总节点数量的第二比值;判断单元403获取偏差分布信息中的预设低负荷节点偏差比值以及预设高负荷节点偏差比值;判断单元403判断第一比值是否高于预设低负荷节点偏差比值以及判断第二比值是否高于预设高负荷节点偏差比值;当第一比值小于或者等于预设低负荷节点偏差比值和/或第二比值小于或者等于预设高负荷节点偏差比值时,判断单元403确定节点处理任务量分布信息与偏差分布信息不相匹配;当第一比值高于预设低负荷节点偏差比值且第二比值高于预设高负荷节点偏差比值时,判断单元403确定节点处理任务量分布信息与偏差分布信息相匹配。As an optional implementation manner, the judging unit 403 judging whether the node processing task volume distribution information matches the deviation distribution information may include: the judging unit 403 obtains the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information; The judging unit 403 calculates the first ratio of the number of low-load nodes to the total number of nodes, and calculates the second ratio of the number of high-load nodes to the total number of nodes; the judging unit 403 obtains the preset low-load node deviation ratio and the predicted value in the deviation distribution information. Set the high load node deviation ratio; the judging unit 403 determines whether the first ratio is higher than the preset low load node deviation ratio and whether the second ratio is higher than the preset high load node deviation ratio; when the first ratio is less than or equal to the preset low When the load node deviation ratio and/or the second ratio are less than or equal to the preset high load node deviation ratio, the judgment unit 403 determines that the node processing task volume distribution information does not match the deviation distribution information; when the first ratio is higher than the preset low load node deviation ratio When the node deviation ratio and the second ratio are higher than the preset high-load node deviation ratio, the judgment unit 403 determines that the node processing task amount distribution information matches the deviation distribution information.
本申请实施例中,当第一比值高于预设低负荷节点偏差比值且第二比值高于预设高负荷节点偏差比值时,说明此时节点处理任务量分布不均,据此可以对节点处理任务量分布不均的情况确定不进行移交。In the embodiment of the present application, 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, it indicates that the node processing tasks are unevenly distributed at this time. If the processing tasks are unevenly distributed, it is determined not to be handed over.
通过实施这种可选的实施方式,可以根据高负荷节点数量和低负荷节点数量来判断节点处理任务量分布信息与偏差分布信息是否相匹配,相匹配的话说明当前节点负荷不均,虽然平均正在处理任务量较低,但很有可能因节点负荷不均导致移交时间变长,此时也不进行移交,提高了确定移交时机的可靠性。By implementing this optional implementation, it is possible to determine whether the node processing task volume distribution information matches the deviation distribution information according to the number of high-load nodes and the number of low-load nodes. If they match, it indicates that the current node load is uneven, although the average is The amount of processing tasks is low, but the handover time is likely to be longer due to uneven node load, and the handover is not performed at this time, which improves the reliability of determining the handover time.
作为另一种可选的实施方式,判断单元403根据节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量可以包括:判断单元403根据节点处理能力信息获取各个节点的标准负荷任务量;判断单元403以节点处理任务量分布信息为依据,计算各个节点的标准负荷任务量与节点处理任务量的差值;判断单元403将差值的绝对值大于预设差值且差值为正数的节点确定为低负荷节点,以及将差值的绝对值大于预设差值且差值为负数的节点确定为高负荷节点;判断单元403统计低负荷节点对应的低负荷节点数量,以及统计高负荷节点对应的高负荷节点数量。As another optional implementation manner, the judging unit 403 obtaining the number of high-load nodes and the number of low-load nodes according to the distribution information of the node processing task amount may include: the judging unit 403 obtains the standard load task amount of each node according to the node processing capability information; The judging unit 403 calculates the difference between the standard load task amount of each node and the node processing task amount based on the distribution information of the node processing task amount; the judgment unit 403 determines the absolute value of the difference value to be greater than the preset difference value and the difference value is a positive number Determine the node with a low load as a low-load node, and determine a node whose absolute value of the difference is greater than a preset difference and a negative difference as a high-load node; the judging unit 403 counts the number of low-load nodes corresponding to the low-load node, and the statistical high The number of high load nodes corresponding to load nodes.
本申请实施例中,标准负荷任务量为该节点能够处理的正常任务量,如果任务量远高于标准负荷任务量,说明该节点为超负荷工作的节点,也即是,将该节点确定为高负荷节点,如果任务量远小于标准负荷任务量,说明该节点为低负荷工作的节点,也即是,将该节点确定为低负荷节点。In the embodiment of this application, the standard load task amount is the normal task amount that the node can handle. If the task amount is much higher than the standard load task amount, it means that the node is an overloaded node, that is, the node is determined as For a high-load node, if the task volume is much less than the standard load task volume, it means that the node is a low-load node, that is, the node is determined as a low-load node.
通过实施这种可选的实施方式,能够根据各个节点的标准负荷任务量和节点处理任务分布量准确地获得低负荷节点数量和高负荷节点数量,从而提高了对节点负荷不均情况识别的准确度。By implementing this optional implementation method, the number of low-load nodes and the number of high-load nodes can be accurately obtained according to the standard load tasks of each node and the distribution of node processing tasks, thereby improving the accuracy of identifying the uneven load of nodes degree.
作为另一种可选的实施方式,在判断单元403判断出节点处理任务量分布信息与偏差分布信息相匹配之后,判断单元403还可以用于:向测试环境相匹配的维护终端发送用于提示测试环境中的节点负荷不均的提示消息。As another optional implementation manner, after the judgment unit 403 judges that the node processing task amount distribution information matches the deviation distribution information, the judgment unit 403 may also be used to: send a reminder to the maintenance terminal that matches the test environment A message indicating uneven load on nodes in the test environment.
本申请实施例中,测试环境相匹配的维护终端可以为配置该测试环境的维护人员所使用的电子设备。通过实施这种可选的实施方式,可以提示测试环境相匹配的维护终端处的维护人员对测试环境中节点负荷不均的情况进行维护,从而提高了测试环境的稳定性。In the embodiment of the present application, the maintenance terminal matching the test environment may be an electronic device used by maintenance personnel who configure the test environment. By implementing this optional implementation manner, the maintenance personnel at the maintenance terminal that matches the test environment can be prompted to maintain the uneven load of nodes in the test environment, thereby improving the stability of the test environment.
可见,通过实施图5所描述的测试代码移交控制装置,基于软件测试技术,在检测到指示移交测试代码的移交指令时,能够根据测试环境中的节点信息确定测试代码移交的时机,以此在测试环境中的节点任务量不高时移交测试代码,减少移交时间,解决了测试代码移交测试环境的时机不佳导致移交时长过长的问题。It can be seen that by implementing the test code handover control device described in Figure 5, based on software testing technology, when a handover instruction instructing the handover of the test code is detected, the timing of the test code handover can be determined according to the node information in the test environment. When the task load of the nodes in the test environment is not high, the test code is handed over, which reduces the handover time, and solves the problem that the handover time is too long due to the poor timing of the test code handover to the test environment.
本申请还提供一种电子设备,该电子设备包括:处理器;存储器,该存储器上存储有计算机可读指令,该计算机可读指令被处理器执行时,实现如前所示的测试代码移交控制方法。该电子设备可以是图1所示测试代码移交装置100。The present application also provides an electronic device, the electronic device includes: a processor; a memory, the memory is stored with computer-readable instructions, when the computer-readable instructions are executed by the processor, the test code transfer control as shown above is realized method. The electronic device may be the test code transfer device 100 shown in FIG. 1.
在一示例性实施例中,本申请还提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时,实现如前所示的测试代码移交控制方法。In an exemplary embodiment, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the test code transfer control method shown above is implemented.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围执行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It should be understood that the present application is not limited to the precise structure that has been described above and shown in the drawings, and various modifications and changes can be performed without departing from its scope. The scope of the application is only limited by the appended claims.

Claims (28)

  1. 一种测试代码移交控制方法,包括:A test code transfer control method, including:
    当检测到用于指示将所述测试代码移交至测试环境的移交指令时,获取所述测试环境中的节点信息,所述节点信息至少包括节点负荷状况信息和节点处理能力信息;When a handover instruction for instructing to hand over the test code to the test environment is detected, obtain node information in the test environment, where the node information includes at least node load status information and node processing capability information;
    根据所述节点负荷状况信息确定节点处理任务量;Determining the node processing task amount according to the node load status information;
    判断所述节点处理任务量是否低于预设节点处理任务量;Judging whether the node processing task amount is lower than a preset node processing task amount;
    当判断出所述节点任务量高于或者等于所述预设节点处理任务量时,根据所述节点处理能力信息获取节点处理速率;When it is determined that the node task volume is higher than or equal to the preset node processing task volume, acquiring the node processing rate according to the node processing capability information;
    以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点;Generating a handover time node matching the test code based on the node processing rate and the node task amount;
    当判断出所述节点任务量低于所述预设节点处理任务量时,将当前时刻确定为所述测试代码相匹配的移交时间节点。When it is determined that the node task amount is lower than the preset node processing task amount, the current moment is determined as the handover time node that matches the test code.
  2. 如权利要求1所述的方法,其中,所述根据所述节点负荷状况信息确定节点处理任务量,包括:The method according to claim 1, wherein said determining the amount of processing tasks of a node according to said node load status information comprises:
    根据所述节点负荷状况信息获取各个节点的正在处理任务量;Acquiring the amount of processing tasks of each node according to the node load status information;
    计算所述各个节点的正在处理任务量的平均值,并将所述平均值确定为节点处理任务量。Calculate the average value of the processing task amount of each node, and determine the average value as the node processing task amount.
  3. 如权利要求1所述的方法,其中,所述以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点,包括:The method according to claim 1, wherein the generating a handover time node matching the test code based on the processing rate of the node and the task amount of the node comprises:
    根据所述节点任务量、所述节点处理速率以及预置预测公式计算预测时间节点相匹配的节点未来处理任务量,其中,所述预置预测公式为
    Figure 482218dest_path_image001
    ;所述a表示所述节点任务量,所述v表示所述节点处理速率,所述t表示所述预测时间节点,所述x表示所述预测时间节点相匹配的所述节点未来处理任务量;
    According to the node task volume, the node processing rate, and a preset prediction formula, the future processing task volume of the node matching the predicted time node is calculated, wherein the preset prediction formula is
    Figure 482218dest_path_image001
    The a represents the node task volume, the v represents the node processing rate, the t represents the predicted time node, and the x represents the future processing task volume of the node that matches the predicted time node ;
    将所述预测时间节点与所述预测时间节点相匹配的所述节点未来处理任务量对应存储,获得节点时序预测总表;Correspondingly store the future processing task amount of the node that matches the predicted time node and the predicted time node, and obtain a node timing prediction summary table;
    在所述节点时序预测总表中选取所述节点未来处理任务量小于所述预设节点处理任务量的目标节点处理任务量;Select the target node processing task amount of which the future processing task amount of the node is less than the preset node processing task amount in the node timing prediction total table;
    将所述目标节点处理任务量相匹配的目标预测时间节点确定为所述测试代码相匹配的移交时间节点。The target predicted time node matching the processing task amount of the target node is determined as the handover time node matching the test code.
  4. 如权利要求1至3任一项所述的方法,其中,所述节点信息还包括节点处理任务量分布信息,在判断出所述节点任务量低于所述预设节点处理任务量之后,以及所述将当前时刻确定为所述测试代码相匹配的移交时间节点之前,所述方法还包括:     获取所述测试环境中的节点处理任务量分布信息;The method according to any one of claims 1 to 3, wherein the node information further includes node processing task volume distribution information, after determining that the node task volume is lower than the preset node processing task volume, and Before the determining the current moment as the handover time node that matches the test code, the method further includes: obtaining distribution information of the node processing task volume in the test environment;
    判断所述节点处理任务量分布信息与偏差分布信息是否相匹配;Judging whether the node processing task amount distribution information matches the deviation distribution information;
    如果不匹配,执行所述的将当前时刻确定为所述测试代码相匹配的移交时间节点。If it does not match, execute the handover time node that determines the current moment as the match of the test code.
  5. 如权利要求4所述的方法,其中,所述判断所述节点处理任务量分布信息与偏差分布信息是否相匹配,包括:5. The method according to claim 4, wherein the determining whether the node processing task amount distribution information matches the deviation distribution information comprises:
    根据所述节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量;Obtaining the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information;
    计算所述低负荷节点数量占总节点数量的第一比值,以及计算所述高负荷节点数量占所述总节点数量的第二比值;Calculating a first ratio of the number of low-load nodes to the total number of nodes, and calculating a second ratio of the number of high-load nodes to the total number of nodes;
    获取偏差分布信息中的预设低负荷节点偏差比值以及预设高负荷节点偏差比值;Obtain the preset low-load node deviation ratio and the 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 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, it is determined that the node processing task amount distribution information is The deviation distribution information does not match;
    当所述第一比值高于所述预设低负荷节点偏差比值且所述第二比值高于所述预设高负荷节点偏差比值时,确定所述节点处理任务量分布信息与所述偏差分布信息相匹配。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, determine the node processing task amount distribution information and the deviation distribution The information matches.
  6. 如权利要求5所述的方法,其中,所述根据所述节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量,包括:The method according to claim 5, wherein the obtaining the number of high-load nodes and the number of low-load nodes according to the distribution information of the node processing task volume comprises:
    根据所述节点处理能力信息获取各个节点的标准负荷任务量;Obtaining the standard load task amount of each node according to the node processing capability information;
    以所述节点处理任务量分布信息为依据,计算所述各个节点的所述标准负荷任务量与所述节点处理任务量的差值;Calculating the 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 node whose absolute value of the difference is greater than the preset difference and the difference is positive is determined as a low load node, and the absolute value of the difference is greater than the preset difference and the difference is Nodes with negative numbers are determined as high load nodes;
    统计所述低负荷节点对应的低负荷节点数量,以及统计所述高负荷节点对应的高负荷节点数量。Count the number of low-load nodes corresponding to the low-load nodes, and count the number of high-load nodes corresponding to the high-load nodes.
  7. 如权利要求4所述的方法,其中,判断出所述节点处理任务量分布信息与所述偏差分布信息相匹配之后,所述方法还包括:The method according to claim 4, wherein after determining that the node processing task amount distribution information matches the deviation distribution information, the method further comprises:
    向所述测试环境相匹配的维护终端发送用于提示所述测试环境中的节点负荷不均的提示消息。Sending a prompt message for prompting uneven load of nodes in the test environment to a maintenance terminal that matches the test environment.
  8. 一种测试代码移交控制装置,包括:A test code transfer control device, including:
    第一获取单元,用于当检测到用于指示将所述测试代码移交至测试环境的移交指令时,获取所述测试环境中的节点信息,所述节点信息至少包括节点负荷状况信息和节点处理能力信息;The first obtaining unit is configured to obtain node information in the test environment when a handover instruction for instructing the handover of the test code to the test environment is detected, where the node information includes at least node load status information and node processing Capability information
    第一确定单元,用于根据所述节点负荷状况信息确定节点处理任务量;The first determining unit is configured to determine the node processing task amount according to the node load status information;
    判断单元,用于判断所述节点处理任务量是否低于预设节点处理任务量;A judging unit for judging whether the node processing task amount is lower than a preset node processing task amount;
    第二获取单元,用于当判断出所述节点任务量高于或者等于所述预设节点处理任务量时,根据所述节点处理能力信息获取节点处理速率;The second acquiring unit is configured to acquire the node processing rate according to the node processing capability information when it is determined that the node task amount is higher than or equal to the preset node processing task amount;
    生成单元,用于以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点;A generating unit, configured to generate a handover time node that matches the test code based on the processing rate of the node and the task amount of the node;
    第二确定单元,用于当判断出所述节点任务量低于所述预设节点处理任务量时,将当前时刻确定为所述测试代码相匹配的移交时间节点。The second determining unit is configured to determine the current moment as the handover time node that matches the test code when it is determined that the node task amount is lower than the preset node processing task amount.
  9. 如权利要求8所述的装置,其中,所述第一确定单元包括:8. The apparatus of claim 8, wherein the first determining unit comprises:
    任务量获取单元,用于根据所述节点负荷状况信息获取各个节点的正在处理任务量;A task volume acquiring unit, configured to acquire the processing task volume of each node according to the node load status information;
    任务量计算单元,用于计算所述各个节点的正在处理任务量的平均值,并将所述平均值确定为节点处理任务量。The task amount calculation unit is configured to calculate the average value of the processing task amount of each node, and determine the average value as the node processing task amount.
  10. 如权利要求8所述的装置,其中,所述生成单元包括:The apparatus according to claim 8, wherein the generating unit comprises:
    匹配预测单元,用于根据所述节点任务量、所述节点处理速率以及预置预测公式计算预测时间节点相匹配的节点未来处理任务量,其中,所述预置预测公式为
    Figure 946698dest_path_image001
    ;所述a表示所述节点任务量,所述v表示所述节点处理速率,所述t表示所述预测时间节点,所述x表示所述预测时间节点相匹配的所述节点未来处理任务量;
    The matching prediction unit is configured to calculate the future processing task amount of the node matching the predicted time node according to the node task amount, the node processing rate, and a preset prediction formula, wherein the preset prediction formula is
    Figure 946698dest_path_image001
    The a represents the node task volume, the v represents the node processing rate, the t represents the predicted time node, and the x represents the future processing task volume of the node that matches the predicted time node ;
    任务量存储单元,用于将所述预测时间节点与所述预测时间节点相匹配的所述节点未来处理任务量对应存储,获得节点时序预测总表;A task amount storage unit, configured to correspondingly store the future processing task amount of the node that matches the predicted time node and the predicted time node, and obtain a node time sequence forecast summary table;
    任务量选取单元,用于在所述节点时序预测总表中选取所述节点未来处理任务量小于所述预设节点处理任务量的目标节点处理任务量;A task amount selection unit, configured to select a target node processing task amount whose future processing task amount of the node is less than the preset node processing task amount in the node time sequence prediction total table;
    节点确定单元,用于将所述目标节点处理任务量相匹配的目标预测时间节点确定为所述测试代码相匹配的移交时间节点。The node determining unit is configured to determine the target predicted time node matching the processing task amount of the target node as the handover time node matching the test code.
  11. 如权利要求8至10任一项所述的装置,其中,所述装置还包括:The device according to any one of claims 8 to 10, wherein the device further comprises:
    第三获取单元,用于获取所述测试环境中的节点处理任务量分布信息;The third acquiring unit is configured to acquire the distribution information of processing tasks of nodes in the test environment;
    匹配判断单元,用于判断所述节点处理任务量分布信息与偏差分布信息是否相匹配;The matching judgment unit is used to judge whether the node processing task amount distribution information matches the deviation distribution information;
    如果不匹配,执行所述的将当前时刻确定为所述测试代码相匹配的移交时间节点。If it does not match, execute the handover time node that determines the current moment as the match of the test code.
  12. 如权利要求11所述的装置,其中,所述匹配判断单元包括:The device according to claim 11, wherein the matching judgment unit comprises:
    节点数量获取单元,用于根据所述节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量;A node quantity obtaining unit, configured to obtain the number of high-load nodes and the number of low-load nodes according to the distribution information of the node processing task amount;
    比值计算单元,用于计算所述低负荷节点数量占总节点数量的第一比值,以及计算所述高负荷节点数量占所述总节点数量的第二比值;A ratio calculation unit, configured to calculate a first ratio of the number of low-load nodes to the total number of nodes, and calculate a second ratio of the number of high-load nodes to the total number of nodes;
    偏差比值获取单元,用于获取偏差分布信息中的预设低负荷节点偏差比值以及预设高负荷节点偏差比值;The deviation ratio obtaining unit is used to obtain the preset low-load node deviation ratio and the preset high-load node deviation ratio in the deviation distribution information;
    比值判断单元,用于判断所述第一比值是否高于所述预设低负荷节点偏差比值以及判断所述第二比值是否高于所述预设高负荷节点偏差比值;当所述第一比值小于或者等于所述预设低负荷节点偏差比值和/或所述第二比值小于或者等于所述预设高负荷节点偏差比值时,确定所述节点处理任务量分布信息与所述偏差分布信息不相匹配;当所述第一比值高于所述预设低负荷节点偏差比值且所述第二比值高于所述预设高负荷节点偏差比值时,确定所述节点处理任务量分布信息与所述偏差分布信息相匹配。The ratio judgment unit is used to judge whether the first ratio is higher than the preset low-load node deviation ratio and whether the second ratio is higher than the preset high-load node deviation ratio; when the first ratio is When it 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, it is determined that the node processing task amount distribution information is different from the deviation distribution information. Match; 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, determine the node processing task amount distribution information and the The deviation distribution information matches.
  13. 如权利要求12所述的装置,其中,所述节点数量获取单元,包括:The apparatus according to claim 12, wherein the node quantity obtaining unit comprises:
    标准负荷任务量获取单元,用于根据所述节点处理能力信息获取各个节点的标准负荷任务量;The standard load task amount obtaining unit is configured to obtain the standard load task amount of each node according to the node processing capability information;
    节点任务量差值计算单元,用于以所述节点处理任务量分布信息为依据,计算所述各个节点的所述标准负荷任务量与所述节点处理任务量的差值;A node task amount difference calculation unit, configured to calculate the 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;
    节点负荷确定单元,用于将所述差值的绝对值大于预设差值且所述差值为正数的节点确定为低负荷节点,以及将所述差值的绝对值大于所述预设差值且所述差值为负数的节点确定为高负荷节点;A node load determining unit, configured to determine a node whose absolute value of the difference is greater than a preset difference and the difference is positive as a low-load node, and determine the absolute value of the difference to be greater than the preset A node with a difference value and the difference value is negative is determined as a high load node;
    节点数量统计单元,用于统计所述低负荷节点对应的低负荷节点数量,以及统计所述高负荷节点对应的高负荷节点数量。The node number statistics unit is used to count the number of low-load nodes corresponding to the low-load nodes and the number of high-load nodes corresponding to the high-load nodes.
  14. 如权利要求11所述的装置,其中,所述装置还包括:The device of claim 11, wherein the device further comprises:
    提示单元,用于向所述测试环境相匹配的维护终端发送用于提示所述测试环境中的节点负荷不均的提示消息。The prompt unit is configured to send a prompt message for prompting the uneven load of the nodes in the test environment to the maintenance terminal that matches the test environment.
  15. 一种电子设备,包括:An electronic device including:
    当检测到用于指示将所述测试代码移交至测试环境的移交指令时,获取所述测试环境中的节点信息,所述节点信息至少包括节点负荷状况信息和节点处理能力信息;When a handover instruction for instructing to hand over the test code to the test environment is detected, obtain node information in the test environment, where the node information includes at least node load status information and node processing capability information;
    根据所述节点负荷状况信息确定节点处理任务量;Determining the node processing task amount according to the node load status information;
    判断所述节点处理任务量是否低于预设节点处理任务量;Judging whether the node processing task amount is lower than a preset node processing task amount;
    当判断出所述节点任务量高于或者等于所述预设节点处理任务量时,根据所述节点处理能力信息获取节点处理速率;When it is determined that the node task volume is higher than or equal to the preset node processing task volume, acquiring the node processing rate according to the node processing capability information;
    以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点;Generating a handover time node matching the test code based on the node processing rate and the node task amount;
    当判断出所述节点任务量低于所述预设节点处理任务量时,将当前时刻确定为所述测试代码相匹配的移交时间节点。When it is determined that the node task amount is lower than the preset node processing task amount, the current moment is determined as the handover time node that matches the test code.
  16. 如权利要求15所述的电子设备,其中,所述根据所述节点负荷状况信息确定节点处理任务量,所述处理器配置为实现以下步骤:The electronic device according to claim 15, wherein the processing task amount of the node is determined according to the node load status information, and the processor is configured to implement the following steps:
    根据所述节点负荷状况信息获取各个节点的正在处理任务量;Acquiring the amount of processing tasks of each node according to the node load status information;
    计算所述各个节点的正在处理任务量的平均值,并将所述平均值确定为节点处理任务量。Calculate the average value of the processing task amount of each node, and determine the average value as the node processing task amount.
  17. 如权利要求15所述的电子设备,其中,所述以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点,所述处理器配置为实现以下步骤:The electronic device according to claim 15, wherein said generating a handover time node matching said test code based on said node processing rate and said node task amount, and said processor is configured to implement the following steps :
    根据所述节点任务量、所述节点处理速率以及预置预测公式计算预测时间节点相匹配的节点未来处理任务量,其中,所述预置预测公式为
    Figure 271369dest_path_image001
    ;所述a表示所述节点任务量,所述v表示所述节点处理速率,所述t表示所述预测时间节点,所述x表示所述预测时间节点相匹配的所述节点未来处理任务量;
    According to the node task volume, the node processing rate, and a preset prediction formula, the future processing task volume of the node matching the predicted time node is calculated, wherein the preset prediction formula is
    Figure 271369dest_path_image001
    The a represents the node task volume, the v represents the node processing rate, the t represents the predicted time node, and the x represents the future processing task volume of the node that matches the predicted time node ;
    将所述预测时间节点与所述预测时间节点相匹配的所述节点未来处理任务量对应存储,获得节点时序预测总表;Correspondingly store the future processing task amount of the node that matches the predicted time node and the predicted time node, and obtain a node timing prediction summary table;
    在所述节点时序预测总表中选取所述节点未来处理任务量小于所述预设节点处理任务量的目标节点处理任务量;Select the target node processing task amount of which the future processing task amount of the node is less than the preset node processing task amount in the node timing prediction total table;
    将所述目标节点处理任务量相匹配的目标预测时间节点确定为所述测试代码相匹配的移交时间节点。The target predicted time node matching the processing task amount of the target node is determined as the handover time node matching the test code.
  18. 如权利要求15至17任一项所述的电子设备,其中,所述节点信息还包括节点处理任务量分布信息,在判断出所述节点任务量低于所述预设节点处理任务量之后,以及所述将当前时刻确定为所述测试代码相匹配的移交时间节点之前,,所述处理器还配置为实现以下步骤:The electronic device according to any one of claims 15 to 17, wherein the node information further includes node processing task volume distribution information, and after determining that the node task volume is lower than the preset node processing task volume, And before determining the current moment as the handover time node that matches the test code, the processor is further configured to implement the following steps:
    获取所述测试环境中的节点处理任务量分布信息;Acquiring distribution information of processing tasks of nodes in the test environment;
    判断所述节点处理任务量分布信息与偏差分布信息是否相匹配;Judging whether the node processing task amount distribution information matches the deviation distribution information;
    如果不匹配,执行所述的将当前时刻确定为所述测试代码相匹配的移交时间节点。If it does not match, execute the handover time node that determines the current moment as the match of the test code.
  19. 如权利要求18所述的电子设备,其中,所述判断所述节点处理任务量分布信息与偏差分布信息是否相匹配,所述处理器配置为实现以下步骤:18. The electronic device according to claim 18, wherein said determining whether said node processing task amount distribution information matches deviation distribution information, said processor is configured to implement the following steps:
    根据所述节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量;Obtaining the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information;
    计算所述低负荷节点数量占总节点数量的第一比值,以及计算所述高负荷节点数量占所述总节点数量的第二比值;Calculating a first ratio of the number of low-load nodes to the total number of nodes, and calculating a second ratio of the number of high-load nodes to the total number of nodes;
    获取偏差分布信息中的预设低负荷节点偏差比值以及预设高负荷节点偏差比值;Obtain the preset low-load node deviation ratio and the 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 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, it is determined that the node processing task amount distribution information is The deviation distribution information does not match;
    当所述第一比值高于所述预设低负荷节点偏差比值且所述第二比值高于所述预设高负荷节点偏差比值时,确定所述节点处理任务量分布信息与所述偏差分布信息相匹配。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, determine the node processing task amount distribution information and the deviation distribution The information matches.
  20. 如权利要求19所述的电子设备,其中,所述根据所述节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量,所述处理器配置为实现以下步骤:The electronic device according to claim 19, wherein the number of high-load nodes and the number of low-load nodes are obtained according to the distribution information of the node processing task volume, and the processor is configured to implement the following steps:
    根据所述节点处理能力信息获取各个节点的标准负荷任务量;Obtaining the standard load task amount of each node according to the node processing capability information;
    以所述节点处理任务量分布信息为依据,计算所述各个节点的所述标准负荷任务量与所述节点处理任务量的差值;Calculating the 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 node whose absolute value of the difference is greater than the preset difference and the difference is positive is determined as a low load node, and the absolute value of the difference is greater than the preset difference and the difference is Nodes with negative numbers are determined as high load nodes;
    统计所述低负荷节点对应的低负荷节点数量,以及统计所述高负荷节点对应的高负荷节点数量。Count the number of low-load nodes corresponding to the low-load nodes, and count the number of high-load nodes corresponding to the high-load nodes.
  21. 如权利要求18所述的电子设备,其中,断出所述节点处理任务量分布信息与所述偏差分布信息相匹配之后,所述处理器还配置为实现以下步骤:18. The electronic device according to claim 18, wherein, after determining that the node processing task amount distribution information matches the deviation distribution information, the processor is further configured to implement the following steps:
    向所述测试环境相匹配的维护终端发送用于提示所述测试环境中的节点负荷不均的提示消息。Sending a prompt message for prompting uneven load of nodes in the test environment to a maintenance terminal that matches the test environment.
  22. 一种计算机非易失性可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,所述处理器配置为实现以下步骤:A computer nonvolatile readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the processor is configured to implement the following steps:
    当检测到用于指示将所述测试代码移交至测试环境的移交指令时,获取所述测试环境中的节点信息,所述节点信息至少包括节点负荷状况信息和节点处理能力信息;When a handover instruction for instructing to hand over the test code to the test environment is detected, obtain node information in the test environment, where the node information includes at least node load status information and node processing capability information;
    根据所述节点负荷状况信息确定节点处理任务量;Determining the node processing task amount according to the node load status information;
    判断所述节点处理任务量是否低于预设节点处理任务量;Judging whether the node processing task amount is lower than a preset node processing task amount;
    当判断出所述节点任务量高于或者等于所述预设节点处理任务量时,根据所述节点处理能力信息获取节点处理速率;When it is determined that the node task volume is higher than or equal to the preset node processing task volume, acquiring the node processing rate according to the node processing capability information;
    以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点;Generating a handover time node matching the test code based on the node processing rate and the node task amount;
    当判断出所述节点任务量低于所述预设节点处理任务量时,将当前时刻确定为所述测试代码相匹配的移交时间节点。When it is determined that the node task amount is lower than the preset node processing task amount, the current moment is determined as the handover time node that matches the test code.
  23. 如权利要求22所述的计算机非易失性可读存储介质,其中,所述根据所述节点负荷状况信息确定节点处理任务量,所述处理器配置为实现以下步骤:22. The computer non-volatile readable storage medium according to claim 22, wherein the node processing task amount is determined according to the node load status information, and the processor is configured to implement the following steps:
    根据所述节点负荷状况信息获取各个节点的正在处理任务量;Acquiring the amount of processing tasks of each node according to the node load status information;
    计算所述各个节点的正在处理任务量的平均值,并将所述平均值确定为节点处理任务量。Calculate the average value of the processing task amount of each node, and determine the average value as the node processing task amount.
  24. 如权利要求22所述的计算机非易失性可读存储介质,其中,所述以所述节点处理速率与所述节点任务量为依据,生成所述测试代码相匹配的移交时间节点,所述处理器配置为实现以下步骤:The computer non-volatile readable storage medium of claim 22, wherein said generating a handover time node matching said test code based on said node processing rate and said node task amount, said The processor is configured to implement the following steps:
    根据所述节点任务量、所述节点处理速率以及预置预测公式计算预测时间节点相匹配的节点未来处理任务量,其中,所述预置预测公式为
    Figure 654945dest_path_image001
    ;所述a表示所述节点任务量,所述v表示所述节点处理速率,所述t表示所述预测时间节点,所述x表示所述预测时间节点相匹配的所述节点未来处理任务量;
    According to the node task volume, the node processing rate, and a preset prediction formula, the future processing task volume of the node matching the predicted time node is calculated, wherein the preset prediction formula is
    Figure 654945dest_path_image001
    The a represents the node task volume, the v represents the node processing rate, the t represents the predicted time node, and the x represents the future processing task volume of the node that matches the predicted time node ;
    将所述预测时间节点与所述预测时间节点相匹配的所述节点未来处理任务量对应存储,获得节点时序预测总表;Correspondingly store the future processing task amount of the node that matches the predicted time node and the predicted time node, and obtain a node timing prediction summary table;
    在所述节点时序预测总表中选取所述节点未来处理任务量小于所述预设节点处理任务量的目标节点处理任务量;Select the target node processing task amount of which the future processing task amount of the node is less than the preset node processing task amount in the node timing prediction total table;
    将所述目标节点处理任务量相匹配的目标预测时间节点确定为所述测试代码相匹配的移交时间节点。The target predicted time node matching the processing task amount of the target node is determined as the handover time node matching the test code.
  25. 如权利要求22至24任一项所述的计算机非易失性可读存储介质,其中,所述节点信息还包括节点处理任务量分布信息,在判断出所述节点任务量低于所述预设节点处理任务量之后,以及所述将当前时刻确定为所述测试代码相匹配的移交时间节点之前,,所述处理器还配置为实现以下步骤:The computer non-volatile readable storage medium according to any one of claims 22 to 24, wherein the node information further includes node processing task amount distribution information, and when it is determined that the node task amount is lower than the predetermined Assuming that after the node processes the task amount and before the current moment is determined as the handover time node that matches the test code, the processor is further configured to implement the following steps:
    获取所述测试环境中的节点处理任务量分布信息;Acquiring distribution information of processing tasks of nodes in the test environment;
    判断所述节点处理任务量分布信息与偏差分布信息是否相匹配;Judging whether the node processing task amount distribution information matches the deviation distribution information;
    如果不匹配,执行所述的将当前时刻确定为所述测试代码相匹配的移交时间节点。If it does not match, execute the handover time node that determines the current moment as the match of the test code.
  26. 如权利要求25所述的计算机非易失性可读存储介质,其中,所述判断所述节点处理任务量分布信息与偏差分布信息是否相匹配,所述处理器配置为实现以下步骤:25. The computer non-volatile readable storage medium according to claim 25, wherein the determining whether the node processing task amount distribution information matches the deviation distribution information, the processor is configured to implement the following steps:
    根据所述节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量;Obtaining the number of high-load nodes and the number of low-load nodes according to the node processing task volume distribution information;
    计算所述低负荷节点数量占总节点数量的第一比值,以及计算所述高负荷节点数量占所述总节点数量的第二比值;Calculating a first ratio of the number of low-load nodes to the total number of nodes, and calculating a second ratio of the number of high-load nodes to the total number of nodes;
    获取偏差分布信息中的预设低负荷节点偏差比值以及预设高负荷节点偏差比值;Obtain the preset low-load node deviation ratio and the 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 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, it is determined that the node processing task amount distribution information is The deviation distribution information does not match;
    当所述第一比值高于所述预设低负荷节点偏差比值且所述第二比值高于所述预设高负荷节点偏差比值时,确定所述节点处理任务量分布信息与所述偏差分布信息相匹配。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, determine the node processing task amount distribution information and the deviation distribution The information matches.
  27. 如权利要求26所述的计算机非易失性可读存储介质,其中,所述根据所述节点处理任务量分布信息获取高负荷节点数量和低负荷节点数量,所述处理器配置为实现以下步骤:The computer non-volatile readable storage medium according to claim 26, wherein the number of high-load nodes and the number of low-load nodes are obtained according to the distribution information of the node processing task volume, and the processor is configured to implement the following steps :
    根据所述节点处理能力信息获取各个节点的标准负荷任务量;Obtaining the standard load task amount of each node according to the node processing capability information;
    以所述节点处理任务量分布信息为依据,计算所述各个节点的所述标准负荷任务量与所述节点处理任务量的差值;Calculating the 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 node whose absolute value of the difference is greater than the preset difference and the difference is positive is determined as a low load node, and the absolute value of the difference is greater than the preset difference and the difference is Nodes with negative numbers are determined as high load nodes;
    统计所述低负荷节点对应的低负荷节点数量,以及统计所述高负荷节点对应的高负荷节点数量。Count the number of low-load nodes corresponding to the low-load nodes, and count the number of high-load nodes corresponding to the high-load nodes.
  28. 如权利要求25所述的计算机非易失性可读存储介质,其中,断出所述节点处理任务量分布信息与所述偏差分布信息相匹配之后,所述处理器还配置为实现以下步骤:25. The computer non-volatile readable storage medium according to claim 25, wherein after detecting that the node processing task amount distribution information matches the deviation distribution information, the processor is further configured to implement the following steps:
    向所述测试环境相匹配的维护终端发送用于提示所述测试环境中的节点负荷不均的提示消息。Sending a prompt message for prompting uneven load of nodes in the test environment to a maintenance terminal matching the test environment.
PCT/CN2019/117654 2019-03-18 2019-11-12 Test code handover control method and apparatus, electronic device, and computer non-volatile readable storage medium WO2020186781A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2020186781A1 true WO2020186781A1 (en) 2020-09-24

Family

ID=66953654

Family Applications (1)

Application Number Title Priority Date Filing Date
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

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 (5)

* 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
CN103473345A (en) * 2013-09-23 2013-12-25 深圳市融创天下科技股份有限公司 Method of predicating time duration
US20160103705A1 (en) * 2014-10-14 2016-04-14 National Applied Research Laboratories Operational-task-oriented system and method for dynamically adjusting operational environment
CN107480041A (en) * 2016-06-07 2017-12-15 中兴通讯股份有限公司 The task automation method of testing and system of a kind of big data
CN109902023A (en) * 2019-03-18 2019-06-18 平安普惠企业管理有限公司 A kind of test code handoffs control method and device

Family Cites Families (8)

* 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
CN105471933B (en) * 2014-08-07 2019-04-26 腾讯科技(深圳)有限公司 Server overload guard method, server overload protection 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
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
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

Patent Citations (5)

* 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
CN103473345A (en) * 2013-09-23 2013-12-25 深圳市融创天下科技股份有限公司 Method of predicating time duration
US20160103705A1 (en) * 2014-10-14 2016-04-14 National Applied Research Laboratories Operational-task-oriented system and method for dynamically adjusting operational environment
CN107480041A (en) * 2016-06-07 2017-12-15 中兴通讯股份有限公司 The task automation method of testing and system of a kind of big data
CN109902023A (en) * 2019-03-18 2019-06-18 平安普惠企业管理有限公司 A kind of test code handoffs control method and device

Also Published As

Publication number Publication date
CN109902023B (en) 2022-06-03
CN109902023A (en) 2019-06-18

Similar Documents

Publication Publication Date Title
US11334193B2 (en) Touch control method and apparatus
US9268387B2 (en) Method for saving power consumption and an electronic device thereof
WO2020211382A1 (en) Dynamic timeout period adjustment method and system for redis-based distributed lock
US9799080B2 (en) Method and apparatus for providing a contact address
CN109509017B (en) User retention prediction method and device based on big data analysis
CN110471763B (en) Scheduling method, system, medium and electronic equipment based on shared object pool
CN109992370A (en) Applied program processing method and device, electronic equipment, computer readable storage medium
CN110134593B (en) Software testing method and device, electronic equipment and storage medium
CN108536490B (en) Application program starting method, mobile terminal and computer storage medium
WO2020237966A1 (en) Building control method, apparatus, device, and system, and storage medium
WO2019057089A1 (en) Network card image packet capture method, terminal, and readable storage medium
CN108805492A (en) Order allocator, device and storage medium
CN107423220A (en) The detection method and device of RAM leakage, electronic equipment
CN109766247B (en) Alarm setting method and system based on system data monitoring
RU2014148333A (en) METHODS FOR ADAPTIVE CONTROLLED LIGHTING BASED ON TRANSPORT FLOW IN EXTERIOR LIGHTING NETWORKS
WO2020186781A1 (en) Test code handover control method and apparatus, electronic device, and computer non-volatile readable storage medium
CN109992380A (en) Applied program processing method and device, electronic equipment, computer readable storage medium
US11856571B2 (en) Information feedback method and apparatus
WO2020140645A1 (en) Abnormal data provision detection method and apparatus based on data migration, and terminal device
CN109783332B (en) Server warning method and system based on data modeling
CN115409094A (en) Equipment fault prediction method, device and storage medium
CN109327866A (en) Flow control methods, device, mobile terminal and storage medium
CN112997507A (en) Audio system control method, device, terminal and computer readable storage medium
CN109783313B (en) System exception handling method and system
CN111596827B (en) Icon display control method and device, storage medium and mobile terminal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19919842

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.01.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19919842

Country of ref document: EP

Kind code of ref document: A1