Delay control, concurrent execution control method, device, equipment and storage medium
By configuring a working parameter injection component in the testing system, test cases are parsed into working state machine sequences and latency is controlled, solving the problem of traditional tools' difficulty in controlling multi-threaded timing. This achieves the effects of simplifying concurrent test control and improving the reliability of automated debugging.
Patent Information
- Application Number
- CN202210991290.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-08-18
AI Technical Summary
Traditional gray-box testing tools such as gdb require a high level of expertise to automate testing and are difficult to control the timing of multi-threading precisely, which increases the complexity of testing.
By configuring a working parameter injection component in the testing system, test cases are parsed into multiple working state machine sequences. Based on the working parameters and delay completion status, the processing strategy is determined to achieve pre-delay, post-delay, and flow control of the current working state.
It simplifies the control of concurrent testing scenarios, reduces the complexity of automated debugging, improves the reliability and accuracy of testing, and covers concurrent testing scenarios with various response capabilities.
Smart Images

Figure CN115328788B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data testing, and in particular to a delay control, concurrent execution control method, apparatus, device, and storage medium. Background Technology
[0002] Traditional gray-box testing typically involves testers writing easily executable test cases based on the software's source code implementation logic. However, as system logic becomes more complex, test cases need to precisely control multi-threaded timing scenarios.
[0003] In a Linux debugging environment, the debugging commands in the gdb debugging tool can be used to control multiple business threads in a running process, thereby achieving precise timing control of different business threads in the process during testing.
[0004] In the process of realizing this invention, the inventors discovered the following defects in the prior art: gdb is a mature and professional debugging tool that requires a high level of ability and a certain understanding of the target code to use, and it has certain technical difficulties in achieving automated testing. Summary of the Invention
[0005] This invention provides a delay control, concurrent execution control method, apparatus, device, and storage medium to simply and accurately control the concurrent execution of various working states in a parallel testing scenario.
[0006] According to one aspect of the present invention, a delay control method is provided, executed by a working parameter injection component configured in a test system, wherein the method includes:
[0007] Obtain the working parameters injected for the target test cases to be executed in the test system;
[0008] In the test system, the target test case is parsed into multiple working state machine sequences for parallel execution. Each working state machine sequence includes multiple working states, and the working parameters are used to identify the target working state in the target working state machine sequence that needs to be delayed before and / or delayed after.
[0009] When a load instruction for the current working state in the current working state machine sequence is received from the test system, a processing strategy for the current working state is determined and executed based on the working parameters and / or the delay in the completion of the current working state.
[0010] The processing strategy includes at least one of the following: instructing the test system to flow to the next working state of the current working state machine sequence for loading, and instructing the test system to complete the execution of the current working state, pre-execution delay processing, and post-execution delay processing.
[0011] Optionally, based on the work parameters and / or the delayed completion status of the current work state, a processing strategy for the current work state is determined and executed, including:
[0012] Based on the working parameters and the delay completion status of the current working state, detect whether the current working state requires pre-delay processing and has not yet performed pre-delay processing;
[0013] If so, perform pre-delay processing on the current working state and mark the current working state as having completed the pre-delay, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences;
[0014] If not, after executing the current working state, check whether the current working state needs to perform post-delay processing based on the working parameters;
[0015] If it is determined that post-delay processing is required, then post-delay processing is performed on the current working state, and a delay is marked after the current working state is completed, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences;
[0016] If it is determined that no post-delay processing is required, the test system is instructed to proceed to the next working state in the current working state machine sequence for loading.
[0017] The advantage of this setup is that by detecting the work parameters and the delayed completion status of the current work state, pre-delay processing and post-delay processing can be performed on the current work state. This allows for a clearer determination of the decision-making strategy required for the current work state, enabling timing control of jobs within the testing system and thus achieving concurrent control with other jobs.
[0018] Optionally, before detecting whether the current working state requires pre-delay processing and has not yet undergone pre-delay processing based on the working parameters and the delay completion status of the current working state, the method further includes:
[0019] If it is determined that the current work state will be delayed upon completion, then clear all completed delay markers for the current work state.
[0020] Instruct the test system to proceed to the next working state in the current working state machine sequence for loading.
[0021] The advantage of this setup is that by determining that the current working state has completed the delay, all completed delay markers need to be cleared and the process moved to the next working state. This makes it more certain that the current working state machine sequence has completed the processing of the current working state, thereby saving time and improving accuracy and efficiency.
[0022] Optionally, after performing pre-delay processing on the current working state, the method further includes:
[0023] Upon determining that the pre-delay completion condition is met, instruct the test system to reload the current working state;
[0024] The pre-delay completion conditions include: receiving a prompt message sent by the test system when it determines that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, or determining that the delay is to be delayed to a pre-set pre-delay waiting time.
[0025] The advantage of this setup is that by determining whether the pre-delay completion condition is met, the test system is instructed to reload the current working state machine sequence. This enables concurrent control with other jobs, covers concurrent test scenarios with varying response capabilities, and avoids resource waste caused by excessively long waiting times.
[0026] Optionally, after performing post-delay processing on the current working state, the method further includes:
[0027] Upon determining that the delayed completion conditions are met, instruct the test system to reload the current working state;
[0028] The post-delay completion conditions include: receiving a prompt message sent by the test system when it determines that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, or determining that the delay is to be extended to a pre-set post-delay waiting time.
[0029] The advantage of this setup is that by determining whether the delayed completion condition is met, the test system is instructed to reload the current working state machine sequence. This enables concurrent control with other jobs, covers concurrent test scenarios with varying response capabilities, and avoids resource waste caused by excessively long waiting times.
[0030] According to another aspect of the present invention, a concurrent execution control method is also provided, executed by a test system, wherein the method includes:
[0031] Obtain the target test case to be executed, and parse the target test case into multiple working state machine sequences for parallel execution. Each working state machine sequence includes multiple working states.
[0032] Trigger the parallel execution of each working state machine sequence;
[0033] When the execution reaches the loading of the current working state in the current working state machine sequence, a loading instruction for the current working state in the current working state machine sequence is sent to the working parameter injection component in the test system.
[0034] The working parameter injection component is used to determine and execute a processing strategy for the current working state based on the loading instruction, the working parameters of the pre-injected target test case, and / or the delay of the current working state.
[0035] Optionally, after sending a loading instruction for the current working state in the current working state machine sequence to the working parameter injection component in the test system, the method further includes:
[0036] When it is determined that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, a prompt message corresponding to the current working state is generated.
[0037] The prompt message is sent to the working parameter injection component to trigger the working parameter injection component to instruct the test system to reload the current working state.
[0038] The advantage of this setup is that by generating prompts corresponding to the current working state and sending them to the working parameter injection component, the current working state can be loaded more quickly and accurately, thereby improving the reliability and accuracy of automated debugging and reducing the complexity of concurrency control in automated debugging.
[0039] According to another aspect of the present invention, a delay control device is provided, executed by an operating parameter injection component configured in a test system, wherein the device comprises:
[0040] The working parameter acquisition module is used to acquire the working parameters injected for the target test cases to be executed in the test system;
[0041] In the test system, the target test case is parsed into multiple working state machine sequences for parallel execution. Each working state machine sequence includes multiple working states, and the working parameters are used to identify the target working state in the target working state machine sequence that needs to be delayed before and / or delayed after.
[0042] The processing strategy determination module is used to determine and execute a processing strategy for the current working state based on the working parameters and / or the delay completion status of the current working state when it receives a loading instruction from the test system for the current working state machine sequence.
[0043] The processing strategy includes at least one of the following: instructing the test system to flow to the next working state of the current working state machine sequence for loading, and instructing the test system to complete the execution of the current working state, pre-execution delay processing, and post-execution delay processing.
[0044] According to another aspect of the present invention, a concurrent execution control device is also provided, executed by a test system, comprising:
[0045] The target test case acquisition module is used to acquire the target test cases to be executed and parse the target test cases into multiple working state machine sequences for parallel execution. The working state machine sequence includes multiple working states.
[0046] The parallel execution triggering module is used to trigger the parallel execution of each working state machine sequence;
[0047] The loading instruction sending module is used to send a loading instruction for the current working state in the current working state machine sequence to the working parameter injection component in the test system when the execution reaches the loading of the current working state in the current working state machine sequence.
[0048] The working parameter injection component is used to determine and execute a processing strategy for the current working state based on the loading instruction, the working parameters of the pre-injected target test case, and / or the delay of the current working state.
[0049] According to another aspect of the present invention, an electronic device is provided, wherein the electronic device includes: at least one processor; and a memory communicatively connected to said at least one processor;
[0050] The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to execute the delay control method according to any embodiment of the present invention, or to execute the concurrent execution control method according to any embodiment of the present invention.
[0051] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute the delay control method according to any embodiment of the present invention, or to execute the concurrent execution control method according to any embodiment of the present invention.
[0052] The technical solution of this invention obtains working parameters for the target test cases to be executed in the test system through a working parameter injection component within the test system; upon receiving a loading instruction from the test system for the current working state in the current working state machine sequence, it determines and executes a processing strategy for the current working state based on the working parameters and / or the delay completion status of the current working state. This allows for simple and accurate delay control of each working state in a parallel test scenario by configuring working parameters, thereby solving the problem of difficult concurrency control in concurrent test scenarios, reducing the complexity of concurrency control in automated debugging, alleviating the debugging difficulty for testers, improving the reliability and accuracy of automated debugging, and achieving coverage of concurrent test scenarios with different response capabilities.
[0053] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1a This is a flowchart of a delay control method provided in Embodiment 1 of the present invention;
[0056] Figure 1b This is a schematic diagram of the working state machine sequence in the method provided according to Embodiment 1 of the present invention;
[0057] Figure 1c This is a schematic diagram of the injection working parameters in the method provided according to Embodiment 1 of the present invention;
[0058] Figure 2 This is a flowchart of a delay control method provided according to Embodiment 2 of the present invention;
[0059] Figure 3a This is a flowchart of a concurrent execution control method provided in Embodiment 3 of the present invention;
[0060] Figure 3b This is a flowchart of a method implemented by a working parameter injection component and a testing system, applicable to an embodiment of the present invention.
[0061] Figure 4This is a schematic diagram of the structure of a delay control device according to Embodiment 4 of the present invention;
[0062] Figure 5 This is a schematic diagram of the structure of a concurrent execution control device according to Embodiment 5 of the present invention;
[0063] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the method of the embodiments of the present invention. Detailed Implementation
[0064] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0065] It should be noted that the terms "target," "current," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0066] Example 1
[0067] Figure 1a This is a flowchart of a delay control method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where delay control is performed on various working states of operations within a test system in a system testing scenario. The method can be executed by a delay control device, which can be implemented in hardware and / or software. Specifically, it is executed by a working parameter injection component configured in the test system. The working parameter injection component can be pre-installed in the test system as an application or application plugin, or it can be pre-written into the system code of the test system as part of the system code.
[0068] Correspondingly, such as Figure 1a As shown, the method includes:
[0069] S110. Obtain the working parameters injected for the target test cases to be executed in the test system.
[0070] In this embodiment, the testing system can be understood as the hardware or software product to be tested. This product undergoes various functional tests by running pre-written test cases. Typically, the testing system can be a distributed system, such as a distributed block storage system.
[0071] A target test case can be understood as a specific test case that the test system needs to execute. Typically, a test case consists of multiple test steps linked together in sequence to achieve the set software test function; it can be program code that needs to be automated for testing.
[0072] The target test case can be parsed into multiple sequences of working state machines for parallel execution within the test system. Each working state machine sequence includes multiple working states, such as... Figure 1b The diagram shown is a schematic representation of the working state machine sequence. Figure 1b In the sequence of job state machines, there are multiple job states, each of which can be represented as job stage1, job stage2, ..., job stage n. Job parameters are used to identify the target job state in the target job state machine sequence that requires a pre-delay and / or post-delay.
[0073] As mentioned above, the testing system applicable to the embodiments of the present invention is mainly a distributed testing system. Therefore, for a target test case, it is necessary to first parse the target test case into multiple identical working state machine sequences according to the number of distributed nodes to be tested, and distribute them to different distributed nodes so that each distributed node can concurrently execute its own working state machine sequence.
[0074] Since multiple test steps are defined in the target test case, the working state corresponding to each test step can be generated by parsing the target test case, and then the working state machine sequence can be obtained by connecting them.
[0075] In this embodiment, testers can specify working state Aa in working state machine sequence A and working state Bb in working state machine sequence B to be executed concurrently, according to actual needs. Furthermore, testers can control the concurrent execution state of Aa and Bb by setting pre-delays for Aa and Bb respectively; that is, when both Aa and Bb are detected to be in a pre-delay state, the continued execution of Aa and Bb is triggered. Alternatively, testers can control the concurrent execution state of Aa and Bb by setting post-delays for the preceding working states of Aa and Bb respectively. Alternatively, testers can set pre-delays and post-delays for Aa and Bb separately, etc., and this embodiment does not impose any limitations on this.
[0076] Correspondingly, the operating parameter can be set to set a front delay, a back delay, or both for a specific target operating state in a specific target operating state machine sequence.
[0077] The "pre-delay" can be understood as a delay of a set duration before the target working state is executed, and the "post-delay" can be understood as a delay of a set duration after the target working state is executed and before the next working state is executed. Specifically, the set duration can be preset according to the actual situation. Generally, the set duration is set to a value that is relatively large compared to the execution time of the working state.
[0078] For example, suppose in a testing system, the target test case to be executed is parsed and determined to be three working state machine sequences for parallel execution (working state machine sequence 1, working state machine sequence 2, and working state machine sequence 3), where each working state machine sequence includes five working states (job stage 1, job stage 2, job stage 3, job stage 4, and job stage 5). The working parameters injected into the target test case to be executed can be the pre-delay set for job stage 1 in working state machine sequence 1, the pre-delay set for job stage 4 in working state machine sequence 2, etc.
[0079] In an optional implementation of this embodiment, one or more injection interfaces can be pre-encapsulated in the working parameter injection component. Working parameters matching the target test case to be executed are injected via interface calls. For example... Figure 1cThe diagram shows the structure for injecting working parameters. Working parameters matching the target test case can be injected into the working parameter injection component via an interface call. Specifically, the interface can include socket, pipe, and configuration file, and the working parameter injection component can be JIF (Job Injection Framework).
[0080] S120. Upon receiving a loading instruction from the test system for the current working state in the current working state machine sequence, determine and execute a processing strategy for the current working state based on the working parameters and / or the delay in the completion of the current working state.
[0081] The processing strategy includes at least one of the following: instructing the test system to flow to the next working state of the current working state machine sequence for loading, and instructing the test system to complete the execution of the current working state, pre-execution delay processing, and post-execution delay processing.
[0082] Specifically, instructing the test system to flow to the next working state in the current working state machine sequence for loading can be understood as instructing the test system to abandon the execution of the currently loaded current working state and flow to the next working state in the current working state machine sequence for loading; instructing the test system to complete the execution of the current working state can be understood as instructing the test system to directly execute the current working state; pre-execution delay processing can be understood as delaying the execution of the current working state after instructing the test system to execute the current working state; post-execution delay processing can be understood as delaying the execution of the current working state after determining that the test system has completed the execution of the current working state.
[0083] The delay completion status of the current working state refers to whether the current working state has completed the pre-delay processing, the post-delay processing, or both the pre-delay processing and the post-delay processing.
[0084] Continuing the previous example, when the test system receives a load instruction for the current working state in the current working state machine sequence, assuming the current working state is job stage 2 in working state machine sequence 1, that is, when the test system receives a load instruction for job stage 2 in working state machine sequence 1, it is necessary to determine and execute the processing strategy for job stage 2 based on at least one of the pre-injected working parameters for the target test case and the delayed completion status of job stage 2.
[0085] The technical solution of this invention obtains working parameters for the target test cases to be executed in the test system through a working parameter injection component within the test system; upon receiving a loading instruction from the test system for the current working state in the current working state machine sequence, it determines and executes a processing strategy for the current working state based on the working parameters and / or the delay completion status of the current working state. This allows for simple and accurate delay control of each working state in a parallel test scenario by configuring working parameters, thereby solving the problem of difficult concurrency control in concurrent test scenarios, reducing the complexity of concurrency control in automated debugging, alleviating the debugging difficulty for testers, improving the reliability and accuracy of automated debugging, and achieving coverage of concurrent test scenarios with different response capabilities.
[0086] Example 2
[0087] Figure 2 This is a flowchart of a delay control method provided in Embodiment 2 of the present invention. This embodiment is an optimization based on the above embodiments. In this embodiment, the operation of determining and executing a processing strategy for the current working state based on the working parameters and / or the delay completion status of the current working state is specified.
[0088] Correspondingly, such as Figure 2 As shown, the method specifically includes:
[0089] S210. Obtain the working parameters injected for the target test cases to be executed in the test system.
[0090] In the test system, the target test case is parsed into multiple working state machine sequences for parallel execution. Each working state machine sequence includes multiple working states, and the working parameters are used to identify the target working state in the target working state machine sequence that needs to be delayed before and / or delayed after.
[0091] S220. When the test system receives the instruction to load the current working state in the current working state machine sequence, it checks whether the current working state has completed the delay based on the delay completion status of the current working state: if yes, execute S230; otherwise, execute S240.
[0092] S230. Clear all completed delay markers of the current working state and instruct the test system to proceed to the next working state in the current working state machine sequence for loading.
[0093] Continuing the previous example, the current working state is job stage 2 in job state machine sequence 1. Assume the working parameters and delay completion status for job stage 2 are: delayed processing has been completed. Before checking whether job stage 2 needs to perform pre-delay processing and whether pre-delay processing has been performed, it is first necessary to determine whether job stage 2 has completed delayed processing. Since job stage 2 has already completed post-delay processing, all completed delay markers for job stage 2 need to be cleared, instructing the test system to proceed to job stage 3 of job stage 2 for loading.
[0094] The advantage of this setup is that by determining that the current working state has completed the delay, all completed delay markers need to be cleared and the process moved to the next working state. This makes it more certain that the current working state machine sequence has completed the processing of the current working state, thereby saving time and improving accuracy and efficiency.
[0095] S240. Based on the working parameters and the delay completion status of the current working state, detect whether the current working state requires pre-delay processing and has not yet performed pre-delay processing: if yes, execute S250; otherwise, execute S270.
[0096] S250, Perform pre-delay processing on the current working state and mark the current working state as having completed the pre-delay, then execute S260.
[0097] S260. When it is determined that the pre-delay completion condition is met, instruct the test system to reload the current working state.
[0098] The pre-delay completion conditions include: receiving a prompt message sent by the test system when it determines that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, or determining that the delay is to be extended to a pre-set pre-delay waiting time.
[0099] In this embodiment, before the test system reloads the current working state, it needs to determine whether the pre-delay completion condition is met. Specifically, the prompt message sent when the pre-delay completion condition is successfully met during asynchronous waiting, or the delay is until the pre-set pre-delay waiting time.
[0100] Continuing from the previous example, the current working state is job stage 2 in working state machine sequence 1. Assume that the pre-set pre-delay waiting time for job stage 2 in working state machine sequence 1 and job stage 3 in working state machine sequence 2 is 30 minutes.
[0101] Specifically, upon receiving the notification message from the test system confirming that job stage 2 in state machine sequence 1 and job stage 3 in state machine sequence 2 have successfully achieved asynchronous waiting, the test system is instructed to reload job stage 2 in state machine sequence 1. Alternatively, if job stage 2 in state machine sequence 1 does not receive the notification message indicating successful asynchronous waiting, and more than 30 minutes have passed, the test system is instructed to reload job stage 2 in state machine sequence 1.
[0102] The advantage of this setup is that by determining whether the pre-delay completion condition is met, the test system is instructed to reload the current working state machine sequence. This enables concurrent control with other jobs, covers concurrent test scenarios with varying response capabilities, and avoids resource waste caused by excessively long waiting times.
[0103] S270. After executing the current working state machine, detect whether the current working state needs to perform post-delay processing according to the working parameters: if yes, execute S280; otherwise, execute S2100.
[0104] S280, Perform post-delay processing on the current working state, mark the delay after the current working state is completed, and then execute S290.
[0105] S290. When it is determined that the delayed completion condition is met, instruct the test system to reload the current working state machine.
[0106] The post-delay completion conditions include: receiving a prompt message sent by the test system when it determines that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, or determining to delay to a pre-set post-delay waiting time.
[0107] In this embodiment, before the test system reloads the current working state, it needs to determine whether the post-delay completion condition is met. Specifically, the prompt message sent when the post-delay completion condition is successfully met during asynchronous waiting, or the delay until the preset post-delay waiting time.
[0108] Continuing the previous example, the current working state is job stage 2 in working state machine sequence 1. Assume that the pre-set post-delay waiting time for job stage 2 in working state machine sequence 1 and job stage 4 in working state machine sequence 3 is 30 minutes.
[0109] Specifically, upon receiving the notification message sent by the test system when it confirms that job stage 2 in working state machine sequence 1 and job stage 3 in working state machine sequence 2 have successfully achieved asynchronous waiting, the test system is instructed to reload job stage 2 in working state machine sequence 1. Alternatively, if job stage 2 in working state machine sequence 1 does not receive the notification message indicating successful asynchronous waiting, and more than 30 minutes have passed, the test system is instructed to reload the current working state machine sequence corresponding to job stage 2.
[0110] The advantage of this setup is that by determining whether the delayed completion condition is met, the test system is instructed to reload the current working state machine sequence. This enables concurrent control with other jobs, covers concurrent test scenarios with varying response capabilities, and avoids resource waste caused by excessively long waiting times.
[0111] S2100, instructs the test system to proceed to the next working state in the current working state machine sequence for loading.
[0112] Continuing the previous example, the current working state is job stage 2 in the working state machine sequence 1. Assume that the working parameters corresponding to job stage 2 and the delay completion status of the current working state are as follows: no pre-delay processing has been performed and pre-delay processing is required, and no post-delay processing has been performed and post-delay processing is required.
[0113] First, it is necessary to check whether job stage 2 needs to perform pre-delay processing and has not performed pre-delay processing. Since job stage 2 has not performed pre-delay processing and needs to perform pre-delay processing, it is necessary to perform pre-delay processing on job stage 2 and mark job stage 2 as having completed pre-delay processing. This is to control job stage 2 to asynchronously wait for associated work states in other work state machine sequences, that is, to asynchronously wait for associated work states in work state machine sequence 2 and work state machine sequence 3.
[0114] In another optional implementation of this embodiment, the current working state is jobstage 2 in the working state machine sequence 1. It is assumed that the working parameters corresponding to jobstage 2 and the delay completion status of the current working state are as follows: no pre-delay processing is required and the pre-delay processing has been completed; no post-delay processing has been performed and post-delay processing is required.
[0115] First, it is necessary to check whether job stage 2 requires pre-delay processing and whether it has not been performed. Since job stage 2 does not require pre-delay processing and has already completed it, after instructing the test system to complete the execution of job stage 2, it is necessary to check whether job stage 2 requires post-delay processing based on the job parameters.
[0116] Furthermore, if necessary, post-delay processing is performed on job stage 2, and a delay is marked after job stage 2 completes, to control job stage 2 to asynchronously wait for associated job states in other job state machine sequences (job state machine sequence 2 and job state machine sequence 3). If it is determined that this is not necessary, the test system is instructed to flow to the next job state of job stage 2 in the current job state machine sequence for loading.
[0117] The advantage of this setup is that by detecting the work parameters and the delayed completion status of the current work state, pre-delay processing and post-delay processing can be performed on the current work state. This allows for a clearer determination of the decision-making strategy required for the current work state, enabling timing control of jobs within the testing system and thus achieving concurrent control with other jobs.
[0118] The technical solution of this invention further determines and executes the processing strategy for the current working state by judging the working parameters and the delay in the completion of the current working state. This can more clearly determine the decision strategy required for the current working state, realize the timing control of the jobs in the test system, thereby realizing the concurrent control with other jobs, and achieving coverage of concurrent test scenarios with different response capabilities. This also avoids the waste of resources caused by excessive waiting time.
[0119] Example 3
[0120] Figure 3a This is a flowchart of a concurrent execution control method provided in Embodiment 3 of the present invention. This embodiment is applicable to the situation where a test system performs concurrent execution control on multiple concurrently executing working state machine sequences. The method can be executed by a concurrent execution control device, which can be implemented in hardware and / or software. Specifically, it can be executed by a test system, wherein the test system can be a distributed system that can immediately load target test cases for functional testing, and generally includes multiple distributed nodes.
[0121] Accordingly, as shown in Figure 3, the method includes:
[0122] S310. Obtain the target test cases to be executed, and parse the target test cases into multiple working state machine sequences for parallel execution.
[0123] The working state machine sequence includes multiple working states.
[0124] In this embodiment, the number of working state machine sequences parsed by the test system matches the number of distributed nodes that the tester needs to execute concurrently.
[0125] S320 triggers the parallel execution of each working state machine sequence.
[0126] Specifically, the testing system can distribute each working state machine sequence to a matching distributed node and trigger each distributed node to execute its received working state machine sequence in parallel.
[0127] S330. When the execution reaches the loading of the current working state in the current working state machine sequence, a loading instruction for the current working state in the current working state machine sequence is sent to the working parameter injection component in the test system.
[0128] The working parameter injection component is used to determine and execute a processing strategy for the current working state based on the loading instruction, the working parameters of the pre-injected target test case, and / or the delay of the current working state.
[0129] In this embodiment, whenever the test system loads the current working state in the current working state machine sequence, it first sends the current working state in the current working state machine sequence to the working parameter injection component, which then determines what processing strategy is needed for the current working state in the current working state machine sequence.
[0130] Specifically, the processing strategy includes at least one of the following: instructing the test system to flow to the next working state in the current working state machine sequence for loading, instructing the test system to complete the execution of the current working state, pre-execution delay processing, and post-execution delay processing.
[0131] In this embodiment, the testing system needs to obtain the target test cases to be executed and parse them into multiple working state machine sequences for parallel execution. For example, it can be parsed into 3 working state machine sequences for parallel execution (working state machine sequence 1, working state machine sequence 2, and working state machine sequence 3), where each working state machine sequence includes 5 working states (job stage 1, job stage 2, job stage 3, job stage 4, and job stage 5).
[0132] Furthermore, the test system can trigger the parallel execution of each working state machine sequence, that is, trigger the parallel execution of working state machine sequence 1, working state machine sequence 2 and working state machine sequence 3.
[0133] Correspondingly, when the execution reaches the loading of the current working state in the current working state machine sequence, such as loading job stage 2 in working state machine sequence 1, job stage 3 in working state machine sequence 2, and job stage 4 in working state machine sequence 3, the loading instructions for job stage 2 in working state machine sequence 1, job stage 3 in working state machine sequence 2, and job stage 4 in working state machine sequence 3 are sent to the working parameter injection component in the test system.
[0134] Optionally, after sending a load instruction for the current working state in the current working state machine sequence to the working parameter injection component in the test system, the following may also be included:
[0135] When it is determined that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, a prompt message corresponding to the current working state is generated; the prompt message is sent to the working parameter injection component to trigger the working parameter injection component to instruct the test system to reload the current working state machine sequence.
[0136] In this embodiment, when it is determined that the associated working state of the current working state machine sequence and other working state machine sequences has successfully achieved asynchronous waiting, that is, when the current working state machine sequence and other working state machine sequences are both in the pre-delay state or the post-delay state, that is, when the associated working state of the two has successfully achieved asynchronous waiting.
[0137] Continuing the previous example, suppose job stage 2 in state machine sequence 1 and job stage 3 in state machine sequence 2 need to be associated in terms of their working states. That is, both job stage 2 in state machine sequence 1 and job stage 3 in state machine sequence 2 are in either a pre-delayed or post-delayed state, requiring synchronous execution of both working states. Therefore, when job stage 3 in state machine sequence 2 implements asynchronous waiting, it is necessary to determine whether job stage 2 in state machine sequence 1 has completed its operation and entered asynchronous waiting. If job stage 2 in state machine sequence 1 enters asynchronous waiting, it is determined that the associated working state with job stage 3 in state machine sequence 2 has successfully implemented asynchronous waiting, and a prompt message corresponding to job stage 2 is generated.
[0138] Furthermore, a prompt message is sent to the job parameter injection component to trigger the job parameter injection component to instruct the test system to reload job stage 2 in job state machine sequence 1.
[0139] The advantage of this setup is that by generating prompts corresponding to the current working state and sending them to the working parameter injection component, the current working state can be loaded more quickly and accurately, thereby improving the reliability and accuracy of automated debugging and reducing the complexity of concurrency control in automated debugging.
[0140] The technical solution of this invention, by acquiring the target test case to be executed and parsing the target test case into multiple working state machine sequences for parallel execution; triggering the parallel execution of each working state machine sequence; and sending a loading instruction for the current working state in the current working state machine sequence to the working parameter injection component of the test system when the loading of the current working state in the current working state machine sequence is reached, can simply and accurately achieve delay control of each working state in the parallel test scenario by configuring working parameters. This solves the problem of difficult concurrency control in concurrent test scenarios, reduces the complexity of concurrency control in automated debugging, alleviates the debugging difficulty for testers, improves the reliability and accuracy of automated debugging, and achieves coverage of concurrent test scenarios with different response capabilities.
[0141] Specific application scenarios
[0142] Figure 3b This is a flowchart of a method implemented by a working parameter injection component and a testing system, applicable to an embodiment of the present invention.
[0143] Among them, such as Figure 3b As shown, the job parameter injection component can be a job inject framework, and the concurrent execution control method can be executed by the job framework in the test system.
[0144] Accordingly, the entire process includes: first, obtaining the target test cases to be executed through the job framework in the test system, parsing the target test cases into multiple working state machine sequences for parallel execution, and injecting working parameters into the job inject framework. The job inject framework then obtains the working parameters injected for the target test cases to be executed in the test system.
[0145] Furthermore, when the job inject framework receives a loading instruction from the test system for the current working state in the current working state machine sequence, it checks whether the current working state has completed its delay. If so, it clears all completed delay markers for the current working state and instructs the test system to proceed to the next working state in the current working state machine sequence for loading by returning a synchronization completion indicator value. Otherwise, it checks whether the current working state requires pre-delay processing and has not yet done so, based on the job parameters and the current working state's delay completion status.
[0146] If pre-delay processing is required but has not been performed, then pre-delay processing is performed on the current working state, and after marking the completion of the pre-delay for the current working state, an asynchronous wait indicator value is returned. Furthermore, when it is determined that the pre-delay completion condition is met, the test system can be instructed to reload the current working state by resubmitting the current working state to the job framework.
[0147] If no pre-delay processing is required, or if pre-delay processing has been completed, then after completing the execution of the current working state machine, the current working state is checked according to the working parameters to determine whether post-delay processing is required.
[0148] If the current working state requires post-delay processing, then the post-delay processing is performed on the current working state, and after the current working state is completed and the delay is marked, an asynchronous waiting indicator value is returned. Furthermore, when it is determined that the post-delay completion condition is met, the test system can be instructed to reload the current working state machine by re-projecting the current working state to the job framework.
[0149] If the current working state does not require post-delay processing, the test system is instructed to proceed to the next working state in the current working state machine sequence for loading by returning a synchronization completion indicator value.
[0150] Additionally, after the above operations are completed, the result of the synchronous completion indicator or the asynchronous waiting indicator is fed back to the job framework for judgment. The job framework in the test system will determine whether the job state machine sequence has been completed synchronously (or asynchronously) based on the above indicator, thereby determining the completion of the task.
[0151] Specifically, the Delay Timer determines whether the preset pre-delay or post-delay waiting time has been reached. If so, the current work status needs to be re-entered into the job framework of the test system.
[0152] Example 4
[0153] Figure 4 This is a schematic diagram of a delay control device provided in Embodiment 4 of the present invention. The delay control device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a server or terminal device to implement a delay control method according to an embodiment of the present invention. Figure 4 As shown, the device includes: a working parameter acquisition module 410 and a processing strategy determination module 420.
[0154] Among them, the working parameter acquisition module 410 is used to acquire the working parameters injected for the target test cases to be executed in the test system.
[0155] In the test system, the target test case is parsed into multiple working state machine sequences for parallel execution. Each working state machine sequence includes multiple working states, and the working parameters are used to identify the target working state in the target working state machine sequence that needs to be delayed before and / or delayed after.
[0156] The processing strategy determination module 420 is used to determine and execute a processing strategy for the current working state based on the working parameters and / or the delay completion status of the current working state when it receives a loading instruction from the test system for the current working state machine sequence.
[0157] The processing strategy includes at least one of the following: instructing the test system to flow to the next working state of the current working state machine sequence for loading, and instructing the test system to complete the execution of the current working state, pre-execution delay processing, and post-execution delay processing.
[0158] The technical solution of this invention obtains working parameters for the target test cases to be executed in the test system through a working parameter injection component within the test system; upon receiving a loading instruction from the test system for the current working state in the current working state machine sequence, it determines and executes a processing strategy for the current working state based on the working parameters and / or the delay completion status of the current working state. This allows for simple and accurate delay control of each working state in a parallel test scenario by configuring working parameters, thereby solving the problem of difficult concurrency control in concurrent test scenarios, reducing the complexity of concurrency control in automated debugging, alleviating the debugging difficulty for testers, improving the reliability and accuracy of automated debugging, and achieving coverage of concurrent test scenarios with different response capabilities.
[0159] Optionally, the processing strategy determination module 420 may specifically include:
[0160] The pre-delay detection unit is used to detect whether the current working state requires pre-delay processing and whether pre-delay processing has not been performed, based on the working parameters and the delay completion status of the current working state.
[0161] An asynchronous waiting unit is used when the current working state needs to perform pre-delay processing but has not yet performed pre-delay processing. In this case, the unit performs pre-delay processing on the current working state and marks the current working state as having completed pre-delay processing, thereby controlling the current working state to asynchronously wait for associated working states in other working state machine sequences.
[0162] The post-delay processing judgment unit is used to determine whether post-delay processing is required in the current working state if the current working state does not require pre-delay processing and has not been performed.
[0163] The post-delay processing execution unit is used to perform post-delay processing on the current working state if it is determined that post-delay processing is required, and to mark the current working state as having completed a delay, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences. The post-delay processing non-execution unit is used to instruct the test system to transition to the next working state in the current working state machine sequence for loading if it is determined that post-delay processing is not required.
[0164] Optionally, it may also include a delay marking unit, which can be used for:
[0165] Before detecting whether the current working state needs to perform pre-delay processing based on the working parameters and the delay completion status of the current working state, and before performing pre-delay processing, if it is determined that the current working state has completed the delay, then clear all completed delay markers of the current working state; instruct the test system to flow to the next working state in the current working state machine sequence for loading.
[0166] Optionally, it may also include a pre-delay completion condition determination unit, which can be used for:
[0167] After performing pre-delay processing on the current working state, when it is determined that the pre-delay completion condition is met, the test system is instructed to reload the current working state;
[0168] The pre-delay completion conditions include: receiving a prompt message sent by the test system when it determines that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, or determining that the delay is to be extended to a pre-set pre-delay waiting time.
[0169] Optionally, it may also include a post-delay completion condition determination unit, which can be used to: after performing post-delay processing on the current working state, when it is determined that the post-delay completion condition is met, instruct the test system to reload the current working state;
[0170] The post-delay completion condition may include: receiving a prompt message sent by the test system when it determines that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, or determining to delay until a pre-set post-delay waiting time.
[0171] The delay control device provided in the embodiments of the present invention can execute the delay control method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0172] Example 5
[0173] Figure 5 This is a schematic diagram of a concurrent execution control device provided in Embodiment 5 of the present invention. The concurrent execution control device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a server or terminal device to implement a concurrent execution control method according to an embodiment of the present invention. Figure 5 As shown, the device includes: a target test case acquisition module 510, a parallel execution triggering module 520, and a loading instruction sending module 530.
[0174] Among them, the target test case acquisition module 510 is used to acquire the target test cases to be executed and parse the target test cases into multiple working state machine sequences for parallel execution. The working state machine sequence includes multiple working states.
[0175] The parallel execution triggering module 520 is used to trigger the parallel execution of each working state machine sequence;
[0176] The loading instruction sending module 530 is used to send a loading instruction for the current working state in the current working state machine sequence to the working parameter injection component in the test system when the loading of the current working state in the current working state machine sequence is executed.
[0177] The working parameter injection component is used to determine and execute a processing strategy for the current working state based on the loading instruction, the working parameters of the pre-injected target test case, and / or the delay of the current working state.
[0178] The technical solution of this invention, by acquiring the target test case to be executed and parsing the target test case into multiple working state machine sequences for parallel execution; triggering the parallel execution of each working state machine sequence; and sending a loading instruction for the current working state in the current working state machine sequence to the working parameter injection component of the test system when the loading of the current working state in the current working state machine sequence is reached, can simply and accurately achieve delay control of each working state in the parallel test scenario by configuring working parameters. This solves the problem of difficult concurrency control in concurrent test scenarios, reduces the complexity of concurrency control in automated debugging, alleviates the debugging difficulty for testers, improves the reliability and accuracy of automated debugging, and achieves coverage of concurrent test scenarios with different response capabilities.
[0179] Optionally, it may also include a current working state loading module, which can be specifically used for:
[0180] When it is determined that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, a prompt message corresponding to the current working state is generated; the prompt message is sent to the working parameter injection component to trigger the working parameter injection component to instruct the test system to reload the current working state.
[0181] The concurrent execution control device provided in the embodiments of the present invention can execute the concurrent execution control method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0182] Example 6
[0183] Figure 6 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0184] like Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0185] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0186] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as latency control and concurrent execution control methods.
[0187] In some embodiments, the delay control and concurrent execution control methods may be implemented as computer programs tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the delay control and concurrent execution control methods described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the delay control and concurrent execution control methods by any other suitable means (e.g., by means of firmware).
[0188] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0189] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0190] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0191] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0192] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0193] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0194] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0195] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
[0196] Example 7
[0197] Embodiment 7 of the present invention also provides a computer-readable storage medium, wherein the computer-readable instructions, when executed by a computer processor, are used to perform a delay control method, the method comprising: acquiring working parameters injected for a target test case to be executed in a test system; upon receiving a loading instruction from the test system for the current working state in the current working state machine sequence, determining and executing a processing strategy for the current working state based on the working parameters and / or the delay completion status of the current working state. Alternatively, it can be used to perform a concurrent execution control method, the method comprising: acquiring a target test case to be executed, and parsing the target test case into multiple working state machine sequences for parallel execution, each working state sequence including multiple working states; triggering the parallel execution of each working state machine sequence; when execution reaches the loading of the current working state in the current working state machine sequence, sending a loading instruction for the current working state in the current working state machine sequence to a working parameter injection component in the test system.
[0198] Of course, the computer-executable instructions provided in the embodiments of the present invention, which include a computer-readable storage medium, are not limited to the method operations described above, but can also perform related operations in the delay control and concurrent execution control methods provided in any embodiment of the present invention.
[0199] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0200] It is worth noting that in the embodiments of the above-mentioned delay control and concurrent execution control devices, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0201] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A delay control method, executed by a working parameter injection component configured in a test system, characterized in that, include: Obtain the working parameters injected for the target test cases to be executed in the test system; In the test system, the target test case is parsed into multiple working state machine sequences for parallel execution. Each working state machine sequence includes multiple working states, and the working parameters are used to identify the target working state in the target working state machine sequence that needs to be delayed before and / or delayed after. When a load instruction for the current working state in the current working state machine sequence is received from the test system, a processing strategy for the current working state is determined and executed based on the working parameters and / or the delay in the completion of the current working state. The processing strategy includes at least one of the following: instructing the test system to flow to the next working state of the current working state machine sequence for loading, and instructing the test system to complete the execution of the current working state, pre-execution delay processing, and post-execution delay processing. The step of determining and executing a processing strategy for the current work state based on the work parameters and / or the delayed completion status of the current work state includes: Based on the working parameters and the delay completion status of the current working state, detect whether the current working state requires pre-delay processing and has not yet performed pre-delay processing; If so, perform pre-delay processing on the current working state and mark the current working state as having completed the pre-delay, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences; If not, after executing the current working state, check whether the current working state needs to perform post-delay processing based on the working parameters; If it is determined that post-delay processing is required, then post-delay processing is performed on the current working state, and a delay is marked after the current working state is completed, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences; If it is determined that no post-delay processing is required, the test system is instructed to proceed to the next working state in the current working state machine sequence for loading.
2. The method according to claim 1, characterized in that, Before determining whether the current working state requires pre-delay processing and whether pre-delay processing has not been performed based on the working parameters and the current working state's delay completion status, the process further includes: If it is determined that the current work state will be delayed upon completion, then clear all completed delay markers for the current work state. Instruct the test system to proceed to the next working state in the current working state machine sequence for loading.
3. The method according to claim 1, characterized in that, After performing pre-delay processing on the current working state, the process further includes: Upon determining that the pre-delay completion condition is met, instruct the test system to reload the current working state; The pre-delay completion conditions include: receiving a prompt message sent by the test system when it determines that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, or determining that the delay is to be delayed to a pre-set pre-delay waiting time.
4. The method according to claim 1, characterized in that, After performing post-delay processing on the current working state, the process also includes: Upon determining that the delayed completion conditions are met, instruct the test system to reload the current working state; The post-delay completion conditions include: receiving a prompt message sent by the test system when it determines that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, or determining that the delay is to be extended to a pre-set post-delay waiting time.
5. A concurrent execution control method, executed by a test system, characterized in that, include: Obtain the target test case to be executed, and parse the target test case into multiple working state machine sequences for parallel execution. Each working state machine sequence includes multiple working states. Trigger the parallel execution of each working state machine sequence; When the execution reaches the loading of the current working state in the current working state machine sequence, a loading instruction for the current working state in the current working state machine sequence is sent to the working parameter injection component in the test system. The working parameter injection component is used to determine and execute a processing strategy for the current working state based on the loading instruction, the working parameters of the pre-injected target test case, and / or the delay of the current working state. The step of determining and executing a processing strategy for the current working state based on the pre-injected target test case's working parameters and / or the latency of the current working state includes: Based on the working parameters and the delay completion status of the current working state, detect whether the current working state requires pre-delay processing and has not yet performed pre-delay processing; If so, perform pre-delay processing on the current working state and mark the current working state as having completed the pre-delay, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences; If not, after executing the current working state, check whether the current working state needs to perform post-delay processing based on the working parameters; If it is determined that post-delay processing is required, then post-delay processing is performed on the current working state, and a delay is marked after the current working state is completed, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences; If it is determined that no post-delay processing is required, the test system is instructed to proceed to the next working state in the current working state machine sequence for loading.
6. The method according to claim 5, characterized in that, After sending a load instruction for the current working state in the current working state machine sequence to the working parameter injection component in the test system, the method further includes: When it is determined that the current working state has successfully achieved asynchronous waiting with the associated working state in other working state machine sequences, a prompt message corresponding to the current working state is generated. The prompt message is sent to the working parameter injection component to trigger the working parameter injection component to instruct the test system to reload the current working state.
7. A delay control device, executed by a working parameter injection component configured in a test system, characterized in that, include: The working parameter acquisition module is used to acquire the working parameters injected for the target test cases to be executed in the test system; In the test system, the target test case is parsed into multiple working state machine sequences for parallel execution. Each working state machine sequence includes multiple working states, and the working parameters are used to identify the target working state in the target working state machine sequence that needs to be delayed before and / or delayed after. The processing strategy determination module is used to determine and execute a processing strategy for the current working state based on the working parameters and / or the delay completion status of the current working state when it receives a loading instruction from the test system for the current working state machine sequence. The processing strategy includes at least one of the following: instructing the test system to flow to the next working state of the current working state machine sequence for loading, and instructing the test system to complete the execution of the current working state, pre-execution delay processing, and post-execution delay processing. The processing strategy determination module includes: The pre-delay detection unit is used to detect whether the current working state requires pre-delay processing and has not been performed, based on the working parameters and the delay completion status of the current working state. An asynchronous waiting unit is used to perform pre-delay processing on the current working state if the current working state needs to perform pre-delay processing but has not yet performed pre-delay processing, and to mark the current working state as having completed pre-delay processing, so as to control the current working state to asynchronously wait for related working states in other working state machine sequences. The post-delay processing judgment unit is used to determine whether post-delay processing is required in the current working state if the current working state does not require pre-delay processing and has not been performed. The post-delay processing execution unit is used to perform post-delay processing on the current working state if it is determined that post-delay processing is required, and to mark the current working state as having completed the delay, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences; The post-delay processing non-execution unit is used to instruct the test system to transition to the next working state in the current working state machine sequence for loading if it is determined that post-delay processing is not required.
8. A concurrent execution control device, executed by a test system, characterized in that, include: The target test case acquisition module is used to acquire the target test cases to be executed and parse the target test cases into multiple working state machine sequences for parallel execution. The working state machine sequence includes multiple working states. The parallel execution triggering module is used to trigger the parallel execution of each working state machine sequence; The loading instruction sending module is used to send a loading instruction for the current working state in the current working state machine sequence to the working parameter injection component in the test system when the execution reaches the loading of the current working state in the current working state machine sequence. The working parameter injection component is used to determine and execute a processing strategy for the current working state based on the loading instruction, the working parameters of the pre-injected target test case, and / or the delay of the current working state. The step of determining and executing a processing strategy for the current working state based on the pre-injected target test case's working parameters and / or the latency of the current working state includes: Based on the working parameters and the delay completion status of the current working state, detect whether the current working state requires pre-delay processing and has not yet performed pre-delay processing; If so, perform pre-delay processing on the current working state and mark the current working state as having completed the pre-delay, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences; If not, after executing the current working state, check whether the current working state needs to perform post-delay processing based on the working parameters; If it is determined that post-delay processing is required, then post-delay processing is performed on the current working state, and a delay is marked after the current working state is completed, so as to control the current working state to asynchronously wait for associated working states in other working state machine sequences; If it is determined that no post-delay processing is required, the test system is instructed to proceed to the next working state in the current working state machine sequence for loading.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the delay control method of any one of claims 1-4, or to perform the concurrent execution control method of any one of claims 5-6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the delay control method of any one of claims 1-4, or to execute the concurrent execution control method of any one of claims 5-6.
Citation Information
Patent Citations
Regular expression failure model-based software test case generation method
CN108763049A