Multi-task test method, device and equipment of FA, medium and program product
By constructing an independent task process for each FA test task and utilizing concurrent execution, the problem of low efficiency of FA function testing in the existing technology is solved, the simultaneous execution of multiple FA test tasks is realized, and the testing efficiency is improved.
Patent Information
- Application Number
- CN202410837538.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-17
AI Technical Summary
The FA function test efficiency of the power distribution automation system in the existing technology is low and multiple FA test tasks cannot be performed simultaneously, resulting in too long test time.
Design a multi-task testing method, by building an independent task process for each FA test task, and using concurrent execution of multiple task processes, using test case generation threads, test process management threads and test report generation threads to establish and test equipment Communication connection enables simultaneous execution of multiple FA test tasks.
By executing multiple task processes concurrently, it can support multiple FA test tasks at the same time, shorten test time, improve test efficiency, and avoid data contamination between different tasks.
Smart Images

Figure CN118656233A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power system automated testing, and in particular to a multi-task testing method, device, equipment, medium and program product for FA. Background Art
[0002] In recent years, the distribution automation system has developed rapidly, and feeder automation (FA) has been increasingly valued by power supply companies as an important means to improve power supply reliability. In the prior art, when testing the FA function of the distribution terminal, only one line FA test task can be performed each time, and the FA test task of one line takes a long time. Considering the actual factors of the project, it takes more than 1 hour. This method has the problem of low testing efficiency. Therefore, it is urgent to design a method that can support multiple on-site parallel FA tests. Summary of the invention
[0003] The present application provides a multi-task testing method, device, equipment, medium and program product for FA, which can support multiple FA tests at the same time, shorten the time for multiple FA tests, and improve the testing efficiency.
[0004] In a first aspect, the present application provides a multi-task testing method for FA, the method comprising:
[0005] Get multiple FA test tasks;
[0006] Constructing a corresponding task process for each FA test task in the multiple FA test tasks to obtain multiple task processes;
[0007] When each task process establishes a communication connection with the corresponding test device, the multiple task processes are executed concurrently to control the test device corresponding to each task process to complete the FA test task corresponding to each task process, thereby completing the multiple FA test tasks.
[0008] Furthermore, the method of constructing a corresponding task process for each of the multiple FA test tasks to obtain multiple task processes includes: for a target FA test task among the multiple FA test tasks, decomposing the target FA test task into multiple subtasks; determining the task intent of each subtask among the multiple subtasks; and constructing a corresponding thread for each subtask based on the task intent of each subtask, thereby obtaining a target task process corresponding to the target FA test task; wherein each task process includes multiple threads, and the multiple threads include at least a test case generation thread, a test process management thread, and a test report generation thread.
[0009] Furthermore, for the target task process among the multiple task processes, the multiple task processes are executed concurrently to control the test device corresponding to each task process to complete the FA test task corresponding to each task process, including: obtaining a test case by executing the test case generation thread in the target task process; sending the test case to the target test device corresponding to the target task process, so that the target test device performs FA testing based on the test case and obtains test data; and generating a FA test report based on the test data through the test report generation thread in the target task process.
[0010] Furthermore, in the process of concurrently executing the multiple task processes, the method also includes: generating a bidirectional status linked list for the target task process through the test process management thread in the target task process, and the bidirectional status linked list is used to manage the execution status of the target task process.
[0011] Furthermore, the test process management thread in the target task process generates a bidirectional status linked list for the target task process, including: when the target task process is started, determining the starting node of the bidirectional status linked list based on the attribute information of the target task process; executing multiple threads in the target task process in sequence, and adding the status nodes corresponding to the multiple threads after the starting node, so as to obtain the target node path corresponding to the bidirectional status linked list.
[0012] Furthermore, the method sequentially executes multiple threads in the target task process, and adds the state nodes corresponding to each of the multiple threads after the starting node, thereby obtaining the target node path corresponding to the bidirectional state linked list, including: for the current thread of the multiple threads, when the current thread is started, adding the current state node corresponding to the current thread to the generated current node path; determining whether the current thread meets the execution completion condition; if the execution completion condition is met, determining the flag bit of the current state node as successful execution; if the execution completion condition is not met, determining the flag bit of the current state node as failed execution, determining the previous state node corresponding to the current state node, and executing the previous thread corresponding to the previous state node; traversing the multiple threads in sequence to obtain the target node path corresponding to the bidirectional state linked list.
[0013] In a second aspect, the present application provides a multi-task testing device for FA, the device comprising:
[0014] Task acquisition module, used to acquire multiple FA test tasks;
[0015] A process construction module, used to construct a corresponding task process for each FA test task in the multiple FA test tasks to obtain multiple task processes;
[0016] The test execution module is used to control the test device corresponding to each task process to complete the FA test task corresponding to each task process by concurrently executing the multiple task processes when each task process establishes a communication connection with the corresponding test device, thereby completing the multiple FA test tasks.
[0017] In a third aspect, the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-task testing method of FA described in any embodiment of the present application.
[0018] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-task testing method of FA described in any embodiment of the present application when executed.
[0019] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the multi-task testing method of FA described in any embodiment of the present application.
[0020] In order to solve the defects of the prior art in the background technology, an embodiment of the present application provides a multi-task testing method for FA, and executing this method can bring the following beneficial effects: the present application constructs an independent task process for each FA test task, which will not cause data pollution between different tasks; by executing multiple task processes concurrently, multiple FA tests can be supported at the same time, which shortens the time for multiple FA tests and improves test efficiency.
[0021] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the FA multi-task test device, or may be packaged separately from the processor of the FA multi-task test device, which is not limited in this application.
[0022] The description of the second, third, ..., and fifth aspects in this application can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third, ..., and fifth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.
[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.
[0024] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, and usage scenarios of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A first flow chart of a multi-task testing method for FA provided in an embodiment of the present application;
[0027] Figure 2 A schematic diagram of the task execution process of multiple FA test tasks provided in an embodiment of the present application;
[0028] Figure 3 A second flow chart of a multi-task testing method for FA provided in an embodiment of the present application;
[0029] Figure 4 A schematic diagram of the state nodes of the FA test task provided in an embodiment of the present application;
[0030] Figure 5 A schematic diagram of the structure of a multi-task testing device for FA provided in an embodiment of the present application;
[0031] Figure 6 It is a block diagram of an electronic device used to implement a multi-task testing method of FA according to an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0033] It should be noted that the terms "first", "second", "target", and "original" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including", "having", and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0034] Figure 1 This is a first flow chart of a multi-task testing method for FA provided in an embodiment of the present application. This embodiment can be applied to the case where multiple FA testing tasks are performed online on the distribution terminals of the power system. The multi-task testing method for FA provided in this embodiment can be performed by a multi-task testing device for FA provided in an embodiment of the present application. The device can be implemented in software and / or hardware and integrated in an electronic device that executes the method. Preferably, the electronic device in the embodiment of the present application can be a controller configured with a distribution operation simulation system for performing FA multi-test tasks.
[0035] See also Figure 1 The method of this embodiment includes but is not limited to the following steps:
[0036] S110, obtaining multiple FA test tasks.
[0037] In one embodiment, the FA function of the power distribution terminal can be evaluated by the state evaluation component to obtain an evaluation result, and the FA test task can be automatically generated according to the evaluation result. In another embodiment, a regular inspection plan for regularly testing the FA function can be executed for the power distribution terminal. When the time set by the regular inspection plan arrives, the regular inspection plan is triggered and the FA test task is automatically generated.
[0038] In the embodiment of the present application, the FA test task is an offline task and is stored in a database of tasks to be tested. The controller executing multiple tasks obtains multiple (preset number) FA test tasks from the database.
[0039] S120 . Construct a corresponding task process for each FA test task in the multiple FA test tasks to obtain multiple task processes.
[0040] In an embodiment of the present application, the power distribution operation simulation system has real-time simulation function, modeling function, test case editing function, and test report generation function, and these functions are composed of multiple program threads, that is, a group of threads. When multiple FA test tasks are executed simultaneously, large object-oriented test application management can be configured. The large object treats the power distribution operation simulation system as an object, which includes a real-time simulation thread, a modeling thread, a test case editing thread, and a test report generation thread. When an FA test starts, an instance of this large object is created, that is, an instance of this group of threads. Different objects have clear boundaries and are independent of each other, and will not cause data pollution between different objects.
[0041] The following takes the target FA test task among multiple FA test tasks as an example to explain the detailed process of constructing the corresponding task process for the FA test task. Specifically, a corresponding task process is constructed for each FA test task among multiple FA test tasks to obtain multiple task processes, including: first, the target FA test task is decomposed into multiple subtasks, which may include: real-time simulation subtasks, modeling subtasks, test case editing subtasks, and test report generation subtasks. Then, the task intent of each subtask among the multiple subtasks is determined to obtain the execution object, interaction object and logical flow of each subtask. Finally, based on the task intent of each subtask, a corresponding thread is constructed for each subtask, thereby obtaining the target task process corresponding to the target FA test task. Among them, each task process includes multiple threads, that is, a group of threads; the multiple threads include at least a real-time simulation thread, a modeling thread, a test case generation thread, a test process management thread and a test report generation thread.
[0042] S130. When each task process establishes a communication connection with the corresponding test device, multiple task processes are executed concurrently to control the test device corresponding to each task process to complete the FA test task corresponding to each task process, thereby completing multiple FA test tasks.
[0043] Each task process is connected to the corresponding test equipment through the communication processing component. The test equipment refers to the test equipment for detecting the FA function of the power distribution terminal, which can be an automatic tester, and can include at least one automatic tester. The specific number of automatic testers is related to the number of switches of the test line.
[0044] In the embodiment of the present application, a data table can be configured to manage the execution status of multiple FA test tasks. When a new FA test task is added, a state management linked list start node for representing the FA test task is added to the data table. When the state of the FA test task changes, the state node corresponding to the state management linked list is located, and the corresponding node state is updated in the state management linked list.
[0045] The following takes the target FA test task among multiple FA test tasks as an example to explain the detailed process of executing the FA test task on the test device corresponding to the control task process. Specifically, by executing multiple task processes concurrently, the test device corresponding to each task process is controlled to complete the FA test task corresponding to each task process, including: obtaining the test case by executing the test case generation thread in the target task process; sending the test case to the target test device corresponding to the target task process, so that the target test device performs the FA test based on the test case and obtains the test data; generating the FA test report based on the test data by the test report generation thread in the target task process.
[0046] In an embodiment of the present application, the execution process of the test case generation thread may be: the power distribution operation simulation system also has a state evaluation function and a test case generation function. The power distribution terminal to be tested uploads its own state data (such as temperature, backup power supply voltage, FA function action results, etc.) to the power distribution operation simulation system. The power distribution operation simulation system performs a state evaluation and generates a test case based on the evaluation results. The execution process of the test report generation thread may be: collecting the cross-sectional data of the power distribution network to be tested in the FA test, and analyzing the cross-sectional data to obtain the FA test results of the power distribution network to be tested.
[0047] The technical solution provided by this embodiment obtains multiple FA test tasks; constructs a corresponding task process for each FA test task in the multiple FA test tasks to obtain multiple task processes; when each task process establishes a communication connection with the corresponding test device, the multiple task processes are executed concurrently to control the test device corresponding to each task process to complete the FA test task corresponding to each task process, thereby completing multiple FA test tasks. This application constructs an independent task process for each FA test task, which will not cause data pollution between different tasks; by executing multiple task processes concurrently, multiple FA tests can be supported at the same time, shortening the time for multiple FA tests and improving test efficiency.
[0048] like Figure 2 The figure shows a schematic diagram of the task execution process of multiple FA test tasks. As shown in the task generation part in the figure, the FA test task can be generated by the regular inspection plan module or the status assessment module and stored in the database of the task to be tested. The controller that performs multiple tasks obtains multiple (preset number) FA test tasks from the database. The controller builds a corresponding task process for each FA test task in the multiple FA test tasks. Each task process is connected to the corresponding at least one tester through the communication processing component. The communication processing component puts the data sent by the task process into the communication shared memory, which is processed cyclically by the unified communication process of the system. The communication processing component also receives the data uploaded by the tester and forwards it to the task process for processing.
[0049] The following further describes the multi-task testing method of FA provided by the embodiment of the present application. Figure 3 A second flow chart of a multi-task testing method for FA provided in an embodiment of the present application. The embodiment of the present application is optimized on the basis of the above embodiments, and the specific optimization is as follows: in the process of concurrently executing multiple task processes, the present embodiment provides a detailed explanation of the process of state management of multiple task processes through the test process management thread.
[0050] See also Figure 3 The method of this embodiment includes but is not limited to the following steps:
[0051] S210: When the target task process is started, the starting node of the bidirectional state linked list is determined based on the attribute information of the target task process.
[0052] The bidirectional state linked list is used to manage the execution status of the task process. The status of an FA test task can be: initial, case editing, case editing completed, case distribution, test execution, execution completed, result analysis, report generation, report output and task end. The attribute information can include the identification number of the task process.
[0053] In an embodiment of the present application, when the target task process is started, the test process management thread in the target task process determines the starting node of the bidirectional state linked list based on the identification number of the target task process.
[0054] The test process management thread can predefine each state node, for example: a) Startup state: FA test task is in the startup state from the moment it is created. b) Case editing state: After the case editing module is started, it will require the selection of associated tasks. Once a task is associated with case editing, the task is in the case editing state. c) Case editing completion state: When the case editing is completed, there will be an instruction to confirm the end of the case editing; if the case editing program is exited during the editing process, the editing state will continue and will not become the completion state. d) Case delivery state: After the tester has established communication with the power distribution operation simulation system, the test cases of the task begin to be delivered to the tester, and before the delivery is completed, they are all in the case delivery state. e) Case delivery end state: When the test case delivery is completed, it is the case delivery end state. f) Test execution state: When the power distribution operation simulation system delivers an execution command, the task is in the test case execution state. Each task will have multiple test cases, and these test cases are executed one by one. g) Execution completion state: All test cases of the task have been executed. h) Result analysis status: When the test case is executed, the analysis results will be started. During the analysis, it is the result analysis status. i) Report generation status: After the result analysis is completed, it will enter the automatic report generation status. j) End status: After the report is generated, the test task is completed.
[0055] S220. For a current thread of multiple threads, when the current thread is started, a current state node corresponding to the current thread is added to the generated current node path.
[0056] In the embodiment of the present application, the state nodes in the node path of the bidirectional state linked list are generated in real time, that is, each time the FA test task is executed to a thread, the current state node corresponding to the current thread is added to the existing node path of the bidirectional state linked list. Each thread in the target task process is executed in turn, and the state node corresponding to each thread is added after the start node.
[0057] S230: Determine whether the current thread satisfies the execution completion condition.
[0058] like Figure 4The figure shows the state node diagram of the FA test task. In the figure, an FA test task has the following states in order: start state → case editing state → case editing completed state → case delivery state → case delivery completed state → test execution state → execution completed state → result analysis state → report generation state → end state. When the execution completion condition is not met, the state is allowed to roll back. The rollback of each state is as follows: a) When the edited case is deleted and the case editing program is exited, the case editing state rolls back to the start state. b) When a task that has completed case editing is reassociated with the case editing program and starts editing, the case editing completed state will automatically roll back to the case editing state. c) When the test is terminated during the test process, the test execution state will roll back to the test case editing completed state. d) When the test case is executed, you can re-execute a case or all cases, and the execution completed state will roll back to the test execution state. e) If the test case is executed and the test case is edited again, the execution completed state will roll back to the case editing state. f) The test result analysis state and the report generation state can roll back to any previous state. When restarting the test case editing, it will roll back to the test case editing state; when restarting to issue the test case, it will roll back to the test case issuing state; when re-executing the test case, it will roll back to the test execution state.
[0059] In an embodiment of the present application, each status node has a status flag indicating executed, executing, and not executed. It is necessary to determine whether the current thread meets the execution completion condition. If so, execute step S240 and execute the next thread; if not, execute step S250 and roll back to the previous status node corresponding to the status node.
[0060] S240: If the execution completion condition is met, the flag bit of the current state node is determined as execution success.
[0061] In an embodiment of the present application, when the execution completion condition is met, the flag bit of the current state node is determined as successful execution; it is also necessary to determine the next thread corresponding to the current thread and execute the next thread.
[0062] S250: If the execution completion condition is not met, the flag bit of the current state node is determined as execution failure, the previous state node corresponding to the current state node is determined, and the previous thread corresponding to the previous state node is executed.
[0063] In the embodiment of the present application, when the execution completion condition is not met, the flag bit of the current state node is determined as execution failure; Figure 4 Determine the previous state node corresponding to the current state node, roll back to the previous state node, and execute the previous thread corresponding to the previous state node.
[0064] S260, traverse multiple threads in sequence to obtain the target node path corresponding to the bidirectional state linked list.
[0065] In the embodiment of the present application, steps S220 to S250 are repeatedly executed, and when all threads in the target task process are traversed, the target node path corresponding to the bidirectional state linked list can be obtained.
[0066] The technical solution provided by this embodiment is that when the target task process is started, the starting node of the bidirectional state linked list is determined based on the attribute information of the target task process; for the current thread of multiple threads, when the current thread is started, the current state node corresponding to the current thread is added to the generated current node path; it is determined whether the current thread meets the execution completion condition; if the execution completion condition is met, the flag bit of the current state node is determined as successful execution; if the execution completion condition is not met, the flag bit of the current state node is determined as failed execution, the previous state node corresponding to the current state node is determined, and the previous thread corresponding to the previous state node is executed; multiple threads are traversed in sequence to obtain the target node path corresponding to the bidirectional state linked list. This application constructs a corresponding bidirectional state linked list for each task process, adds a state node to the bidirectional state linked list each time a thread is executed, and when the state node rolls back, the corresponding state node is traced back from the bidirectional state linked list, so as to realize the management of multiple state nodes in multiple test tasks, improve the state management method for multiple FA test tasks, and improve the test efficiency.
[0067] Figure 5 A schematic diagram of the structure of a multi-task testing device for FA provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the apparatus 500 may include:
[0068] A task acquisition module 510 is used to acquire multiple FA test tasks;
[0069] A process construction module 520, configured to construct a corresponding task process for each FA test task in the plurality of FA test tasks, to obtain a plurality of task processes;
[0070] The test execution module 530 is used to control the test device corresponding to each task process to complete the FA test task corresponding to each task process by concurrently executing the multiple task processes when each task process establishes a communication connection with the corresponding test device, thereby completing the multiple FA test tasks.
[0071] Furthermore, the above-mentioned process construction module 520 can be specifically used to: for a target FA test task among the multiple FA test tasks, decompose the target FA test task into multiple subtasks; determine the task intent of each subtask among the multiple subtasks; build a corresponding thread for each subtask based on the task intent of each subtask, so as to obtain a target task process corresponding to the target FA test task; wherein each task process includes multiple threads, and the multiple threads include at least a test case generation thread, a test process management thread and a test report generation thread.
[0072] Furthermore, the above-mentioned test execution module 530 can be specifically used to: for a target task process among the multiple task processes, obtain a test case by executing the test case generation thread in the target task process; send the test case to a target test device corresponding to the target task process, so that the target test device performs FA testing based on the test case and obtains test data; and generate a FA test report based on the test data through the test report generation thread in the target task process.
[0073] Furthermore, the above-mentioned FA multi-task testing device may further include: a state management module;
[0074] The state management module is used to generate a bidirectional state linked list for the target task process through the test process management thread in the target task process during the concurrent execution of the multiple task processes, and the bidirectional state linked list is used to manage the execution state of the target task process.
[0075] Furthermore, the above-mentioned state management module can be specifically used for: when the target task process is started, determining the starting node of the bidirectional state linked list based on the attribute information of the target task process; executing multiple threads in the target task process in sequence, and adding the state nodes corresponding to each of the multiple threads after the starting node, so as to obtain the target node path corresponding to the bidirectional state linked list.
[0076] Furthermore, the above-mentioned state management module can also be specifically used for: for the current thread of the multiple threads, when the current thread is started, adding the current state node corresponding to the current thread to the generated current node path; determining whether the current thread meets the execution completion condition; if the execution completion condition is met, determining the flag bit of the current state node as successful execution; if the execution completion condition is not met, determining the flag bit of the current state node as failed execution, determining the previous state node corresponding to the current state node, and executing the previous thread corresponding to the previous state node; traversing the multiple threads in turn to obtain the target node path corresponding to the bidirectional state linked list.
[0077] The FA multi-task testing device provided in this embodiment can be applied to the FA multi-task testing method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0078] Figure 6 It is a block diagram of an electronic device for implementing a multi-task test method of FA of an embodiment of the present application. Electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, 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 processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0079] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0080] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0081] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the multi-task testing method of FA.
[0082] In some embodiments, the multi-task test method of FA can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the multi-task test method of FA described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the multi-task test method of FA in any other appropriate manner (for example, by means of firmware).
[0083] 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 chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0084] The computer programs for implementing the methods of the present application 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, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0085] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0086] To provide interaction with a user, the systems and techniques described herein may 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0087] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server) or a computing system that includes middleware components (e.g., an application server) or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein) or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0088] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0089] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. For example, those skilled in the art can use the various forms of processes shown above to reorder, add, or delete steps; the steps recorded in the present application can be performed in parallel, sequentially, or in different orders, as long as the desired results of the technical solution of the present application can be achieved, and this document does not limit them here.
[0090] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art 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 application should be included in the protection scope of this application.
Claims
1. A multi-task test method for feeder automation FA, characterized in that: The method comprises: Get multiple FA test tasks; Constructing a corresponding task process for each FA test task in the multiple FA test tasks to obtain multiple task processes; When each task process establishes a communication connection with the corresponding test device, the multiple task processes are executed concurrently to control the test device corresponding to each task process to complete the FA test task corresponding to each task process, thereby completing the multiple FA test tasks.
2. The multi-task testing method of FA according to claim 1, characterized in that: The step of constructing a corresponding task process for each FA test task in the multiple FA test tasks to obtain multiple task processes includes: For a target FA test task among the multiple FA test tasks, decompose the target FA test task into multiple subtasks; Determining a task intent for each of the plurality of subtasks; Constructing a corresponding thread for each subtask based on the task intent of each subtask, thereby obtaining a target task process corresponding to the target FA test task; Each of the task processes includes multiple threads, and the multiple threads include at least a test case generation thread, a test process management thread, and a test report generation thread.
3. The multi-task testing method of FA according to claim 2, characterized in that: For a target task process among the multiple task processes, the concurrently executing the multiple task processes to control the test device corresponding to each task process to complete the FA test task corresponding to each task process includes: A test case is obtained by executing the test case generation thread in the target task process; Sending the test case to a target test device corresponding to the target task process, so that the target test device performs FA testing based on the test case and obtains test data; Generate an FA test report based on the test data through the test report generation thread in the target task process.
4. The multi-task testing method of FA according to claim 3, characterized in that: In the process of concurrently executing the multiple task processes, the method further includes: A bidirectional state linked list is generated for the target task process through the test process management thread in the target task process, and the bidirectional state linked list is used to manage the execution state of the target task process.
5. The multi-task testing method of FA according to claim 4, characterized in that: The step of generating a bidirectional state linked list for the target task process through the test process management thread in the target task process includes: When the target task process is started, determining the starting node of the bidirectional state linked list based on the attribute information of the target task process; Execute multiple threads in the target task process in sequence, and add state nodes corresponding to each of the multiple threads after the start node, so as to obtain the target node path corresponding to the bidirectional state linked list.
6. The multi-task testing method of FA according to claim 5, characterized in that: The sequentially executing multiple threads in the target task process and adding the state nodes corresponding to the multiple threads after the start node, thereby obtaining the target node path corresponding to the bidirectional state linked list, includes: For a current thread of the multiple threads, when the current thread is started, adding a current state node corresponding to the current thread to the generated current node path; Determine whether the current thread satisfies the execution completion condition; If the execution completion condition is met, the flag bit of the current state node is determined as execution success; If the execution completion condition is not met, the flag bit of the current state node is determined as execution failure, the previous state node corresponding to the current state node is determined, and the previous thread corresponding to the previous state node is executed; The multiple threads are traversed in sequence to obtain a target node path corresponding to the bidirectional state linked list.
7. A multi-task testing device for FA, characterized in that: The device comprises: Task acquisition module, used to acquire multiple FA test tasks; A process construction module, used to construct a corresponding task process for each FA test task in the multiple FA test tasks to obtain multiple task processes; The test execution module is used to control the test device corresponding to each task process to complete the FA test task corresponding to each task process by concurrently executing the multiple task processes when each task process establishes a communication connection with the corresponding test device, thereby completing the multiple FA test tasks.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-task testing method for FA according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-task testing method for FA according to any one of claims 1 to 6 when executed. 10 . A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the multi-task testing method for FA according to any one of claims 1 to 6 .
Citation Information
Cited By
Task scheduling device integrated in power distribution operation and maintenance system
CN119621270A
