Parallel joint simulation scheduling method, device and equipment for fault injection use case
By decomposing the use case file into sub-use case files and performing error judgment on tasks and nodes, the deterministic problem of use case errors in fault injection is solved, and the reliability of fault injection and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN202011236758.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-04
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2040-11-04
AI Technical Summary
Existing technologies have difficulty determining the content and cause of use case errors during fault injection, and are unable to effectively handle a large number of use case task errors and computing node errors, resulting in misjudgments and waste of resources.
Decompose the overall use case file into multiple sub-use case files and generate corresponding task files. Through the simulation calculation process, the error conditions of tasks and computing nodes are judged respectively. The cause of the error is determined by queue management and repeated simulation calculations, and unavailable nodes are marked.
It achieves accurate location and cause analysis of use case errors during fault injection, avoids resource waste, and improves the reliability and efficiency of fault injection.
Smart Images

Figure CN112328487B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fault injection technology, and in particular to a parallel joint simulation scheduling method, apparatus and device for fault injection use cases. Background Art
[0002] Fault injection is a reliability verification technique that intentionally introduces faults into a system through controlled experiments and observes the system's behavior in the presence of the faults. Software-based fault injection creates hardware-level faults by generating errors at the software level.
[0003] Currently, when users use Saber (a fault injection simulation software), they execute a large number of use cases (over 1,000) in parallel and distributed fashion across multiple compute nodes (over three). During this process, either the use cases or the compute nodes may fail. If a use case fails more than N times (specified by the user), the use case is considered faulty and moved to an error queue. If a compute node fails M times (specified by the user, with M>>N), the node is considered faulty and will not be used again. The use cases are executed in a loop until all use cases are executed, all use cases fail, or there are no more available compute nodes.
[0004] However, because the simulation use cases generated by Saber software are integrated files, it's difficult to pinpoint the specific details and causes of errors when they occur. Furthermore, due to the specific nature of the fault injection use cases, these can sometimes lead to a large number of errors in the use case tasks, and for various reasons, the compute nodes themselves can also fail. However, existing methods cannot effectively handle these large numbers of errors in both use case tasks and compute nodes (including the impact of the errors and the resulting problems). For example, a large number of consecutive test case errors can cause all available compute nodes to be set to unavailable, leading to misjudgments. Summary of the Invention
[0005] The present application provides a parallel joint simulation scheduling method, apparatus and equipment for fault injection use cases to solve the problems in traditional software-based fault injection methods, such as the inability to well determine the content and cause of the error when a use case fails, and the inability to well handle situations such as a large number of use case task errors and computing node errors.
[0006] The above-mentioned purpose of this application is achieved through the following technical solutions:
[0007] In a first aspect, the present application provides a parallel joint simulation scheduling method for a fault injection use case, comprising:
[0008] Decomposing the use case file based on the content segments of the acquired use case file and a preset decomposition number to obtain a plurality of sub-use case files;
[0009] Generate a corresponding task file for each of the sub-use case files;
[0010] Initialize the simulation calculation parameters and add the simulation tasks corresponding to all task files to the task queue to be executed;
[0011] Repeat the simulation calculation process until there are no simulation tasks or no available computing nodes in the task queue to be executed, summarize and count the simulation data and generate a simulation report;
[0012] The simulation calculation process includes:
[0013] Extracting a plurality of simulation tasks from the to-be-executed task queue, which is the same number as the number of available computing nodes, and distributing the plurality of simulation tasks and data, programs, and templates related to each simulation task to each available computing node, so that each available computing node performs simulation calculations respectively;
[0014] Determine whether the simulation calculation of each available computing node is wrong;
[0015] If the simulation calculation is correct, the corresponding simulation task is moved from the pending task queue to the completed task queue;
[0016] If the simulation calculation fails, the task error count of the corresponding simulation task is increased by one, and it is determined whether the task error count reaches a preset first threshold; if so, the corresponding simulation task is removed from the to-be-executed task queue to the error task queue; if not, the corresponding simulation task is retained in the to-be-executed task queue and waits for the next extraction;
[0017] If the simulation calculation fails, the number of node errors of the corresponding computing node will be increased by one, and it will be determined whether the number of node errors reaches a preset second threshold; if so, the corresponding computing node will be marked as an unavailable computing node; wherein the second threshold is greater than or equal to the first threshold.
[0018] Optionally, initializing the simulation calculation parameters includes:
[0019] Initialize the to-be-executed task queue, the completed task queue, and the error task queue, mark all computing nodes as available computing nodes, and obtain a first time threshold and a second time threshold set by a user.
[0020] Optionally, the determining whether the simulation calculation of each available computing node is wrong includes:
[0021] Whether the simulation calculation of each available computing node is wrong is determined based on whether the preset directory or file contains the result file uploaded by the corresponding simulation task after the preset polling time expires; wherein, the simulation task generates and uploads the result file after the simulation calculation is completed.
[0022] Optionally, retaining the corresponding simulation task in the to-be-executed task queue and waiting for next extraction includes:
[0023] The corresponding simulation task is moved to the front row of the task queue to be executed and waits for the next extraction.
[0024] Optionally, the method further includes:
[0025] For the simulation task with simulation calculation errors, the next time it is extracted, it will be distributed to other available computing nodes other than the available computing node where the simulation calculation error occurred.
[0026] Optionally, the method further includes:
[0027] When any available computing node completes a simulation calculation without error, the number of node errors of the corresponding computing node is cleared to zero.
[0028] Optionally, the method further includes:
[0029] For simulation tasks with simulation calculation errors, if the error also occurs after the simulation calculation is repeated on other available computing nodes, the node error count of the available computing node with the previous simulation calculation error will be reduced by one. If no error occurs after the simulation calculation is repeated on other available computing nodes, the node error count of the available computing node with the previous simulation calculation error will remain unchanged.
[0030] Optionally, the use case file is a file in .aim format, and the task file is a file in .bat format.
[0031] In a second aspect, the present application further provides a parallel joint simulation scheduling device for a fault injection use case, comprising:
[0032] A decomposition module, configured to decompose the use case file based on the content segments of the obtained use case file and a preset decomposition quantity to obtain a plurality of sub-use case files;
[0033] A generation module, configured to generate a corresponding task file for each of the sub-use case files;
[0034] The initialization module is used to initialize the simulation calculation parameters and add the simulation tasks corresponding to all task files to the task queue to be executed;
[0035] A simulation calculation module is used to repeatedly execute the simulation calculation process until there are no simulation tasks or no available computing nodes in the task queue to be executed, and to summarize and compile simulation data and generate a simulation report;
[0036] The simulation calculation module is specifically used for:
[0037] Extracting a plurality of simulation tasks from the to-be-executed task queue, which is the same number as the number of available computing nodes, and distributing the plurality of simulation tasks and data, programs, and templates related to each simulation task to each available computing node, so that each available computing node performs simulation calculations respectively;
[0038] Determine whether the simulation calculation of each available computing node is wrong;
[0039] If the simulation calculation is correct, the corresponding simulation task is moved from the pending task queue to the completed task queue;
[0040] If the simulation calculation fails, the task error count of the corresponding simulation task is increased by one, and it is determined whether the task error count reaches a preset first threshold; if so, the corresponding simulation task is removed from the to-be-executed task queue to the error task queue; if not, the corresponding simulation task is retained in the to-be-executed task queue and waits for the next extraction;
[0041] If the simulation calculation fails, the number of node errors of the corresponding computing node will be increased by one, and it will be determined whether the number of node errors reaches a preset second threshold: if so, the corresponding computing node will be marked as an unavailable computing node; wherein, the second threshold is greater than or equal to the first threshold.
[0042] In a third aspect, the present application further provides a smart device, comprising:
[0043] A memory and a processor connected to the memory;
[0044] The memory is used to store a computer program, and the computer program is used to at least execute the parallel joint simulation scheduling method for the fault injection use case described in any one of the above items;
[0045] The processor is configured to call and execute the computer program stored in the memory
[0046] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0047] In the technical solution provided by the embodiment of the present application, the original overall use case file is first decomposed into multiple sub-use case files, and corresponding simulation task files are generated, so that the simulation tasks obtained after the decomposition can be simulated and calculated separately. Then, when the simulation calculation fails, the content and cause of the error can be determined based on the statistical results. In addition, when the simulation calculation fails, the erroneous simulation task can be re-simulated and calculated multiple times until it is determined that the simulation task is indeed erroneous, or the simulation calculation error is caused by an error in the computing node, thereby being able to well cope with the situation of a large number of use case task errors and computing node errors in the prior art.
[0048] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0050] Figure 1 A flowchart of a parallel joint simulation scheduling method for a fault injection use case shown in an embodiment of the present application;
[0051] Figure 2-11 A schematic diagram of various steps of a specific simulation scheduling method shown in an embodiment of the present application;
[0052] Figure 12 A schematic structural diagram of a parallel joint simulation scheduling device for a fault injection use case shown in an embodiment of the present application;
[0053] Figure 13 This is a schematic diagram of the structure of a smart device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0054] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0055] First, as mentioned in the background technology, since the simulation case generated by the Saber software is a whole file, and the whole file contains multiple sections of content, when the simulation case fails, it is difficult to determine which section of content is wrong and the cause of the error, thereby failing to achieve the best simulation effect. In addition, due to the particularity of the fault injection case, sometimes a large number of case tasks will fail, and due to various reasons, the computing nodes themselves will also fail. However, the existing methods cannot handle these large numbers of case task errors and computing node errors (including the impact of the errors and the problems caused by them) well. For example, in general, a large number of consecutive test case errors will cause all available computing nodes to be set to unavailable, which will lead to misjudgment, that is, the computing nodes are set to unavailable when they are not actually wrong.
[0056] Therefore, in order to solve the above problems, the present application provides a parallel joint simulation scheduling method for fault injection use cases, as well as an apparatus and intelligent device applying the method. The following will describe the corresponding solution in detail through embodiments.
[0057] Example
[0058] Reference Figure 1 , Figure 1 The flowchart of a parallel joint simulation scheduling method for a fault injection use case shown in an embodiment of the present application is shown in FIG. In practical applications, the method can be implemented by computer software, that is, executed by a PC or similar smart device.
[0059] like Figure 1 As shown, the method includes the following steps:
[0060] S101: Decomposing the use case file based on the acquired content segments and a preset decomposition number to obtain a plurality of sub-use case files;
[0061] Specifically, taking the existing Saber software as an example, the use case file obtained is an overall file in the .aim format, which contains multiple segments of content. After obtaining the overall use case file, it can be decomposed based on the content segments of the use case file and the number of decompositions pre-set by the user to obtain a specified number of sub-use case files.
[0062] S102: Generate a corresponding task file for each sub-use case file;
[0063] Specifically, this step may generate a corresponding task file for each sub-use case file according to a preset rule, and the generated task file is executed by subsequent computing nodes, for example, a .bat format file (batch file) is generated.
[0064] S103: Initialize simulation calculation parameters and add simulation tasks corresponding to all task files to the task queue to be executed;
[0065] Initializing the simulation calculation parameters means assigning default values to related variables and setting controls to default states. Furthermore, in some embodiments, the specific process of initializing the simulation calculation parameters includes initializing a pending task queue, a completed task queue, and an error task queue, marking all computing nodes as available computing nodes, and obtaining a first and second number thresholds set by the user, wherein the second number threshold is greater than or equal to the first number threshold.
[0066] S104: Determine whether there is a simulation task in the queue of tasks to be executed, or whether there is an available computing node; if either determination result is negative, execute step S115; otherwise, execute step S105, that is, repeatedly execute the simulation calculation process until there is no simulation task in the queue of tasks to be executed or there is no available computing node;
[0067] S105: extracting a plurality of simulation tasks from the to-be-executed task queue, which is the same number as the number of available computing nodes, and distributing the plurality of simulation tasks and data, programs, and templates related to each simulation task to each available computing node, so that each available computing node performs simulation calculations respectively;
[0068] The data related to the simulation task include the task file generated in step S102 and other related data. The program (eg, Saber program) and template are used by the computing nodes to perform corresponding simulation calculations, affecting the process and results of the simulation calculations.
[0069] Of course, it should be understood that this step is based on the usual situation, assuming that the total number of simulation tasks (initial number) is greater than the number of available computing nodes, and that after multiple simulation calculations, if the number of simulation tasks remaining in the task queue to be executed is less than the number of available computing nodes, then all the remaining simulation tasks are extracted and distributed to the available computing nodes randomly or according to the set rules.
[0070] S106: Determine whether the simulation calculation of each available computing node is wrong; if the simulation calculation is not wrong, execute step S107; otherwise, further execute steps S108 and S112;
[0071] In some embodiments, a corresponding determination method is to determine whether a simulation calculation error occurred at each available computing node based on whether a preset directory or file contains a result file uploaded by the corresponding simulation task after a preset polling time has expired; wherein the simulation task generates and uploads the result file after the simulation calculation is completed. That is, after the polling time expires, if the preset directory or file contains the result file uploaded by the corresponding simulation task, then the calculation is determined to be correct; otherwise, it is determined to be an error.
[0072] Of course, other judgment methods in the prior art may also be used to judge whether a simulation calculation is wrong, and this application does not limit this.
[0073] S107: moving the corresponding simulation task from the to-be-executed task queue to the completed task queue;
[0074] Among them, after being moved to the completed task queue, it means that the task status of the corresponding task file is successful and simulation calculation will not be performed again.
[0075] S108: Increment the number of task errors of the corresponding simulation task by one;
[0076] Specifically, for each simulation task, the initial task error count is zero. When an error occurs during simulation calculation on a computing node, the corresponding task error count increases by one each time an error occurs.
[0077] S109: Determine whether the number of task errors reaches a preset first threshold; if so, execute step S110; otherwise, execute step S111;
[0078] The first number threshold is set by the user in step S103.
[0079] S110: moving the corresponding simulation task from the to-be-executed task queue to the error task queue;
[0080] Among them, after being moved to the error task queue, it means that the task status of the corresponding task file is error, and simulation calculation will not be performed again.
[0081] S111: Keep the corresponding simulation task in the to-be-executed task queue and wait for the next extraction;
[0082] Furthermore, for simulation tasks that have simulation errors, the next time they are extracted, they will be distributed to available computing nodes other than the one that previously had simulation errors. That is, when re-simulating a simulation task that previously had simulation errors, avoid distributing it to the same computing node that previously had errors for re-calculation, because the simulation results for the same simulation task on the same computing node generally remain unchanged. Furthermore, even if re-simulating, it is impossible to determine whether the previous simulation error was caused by an error in the file corresponding to the simulation task or by an error in the computing node.
[0083] Further, in some embodiments, in this step, when the corresponding simulation task is retained in the task queue to be executed and is waiting to be extracted next time, the corresponding simulation task can be moved to the forefront of the task queue to be executed and wait for the next time to be extracted. That is, when the next round of simulation tasks is extracted and distributed, the simulation tasks that have been calculated incorrectly are preferentially extracted and the simulation calculation is performed again. This arrangement is in order to determine as soon as possible whether the error is caused by the computing node or the problem of the simulation task itself, thereby being able to avoid the problem that a large number of continuous simulation tasks make mistakes and cause the computing node to also fail.
[0084] S112: The number of node errors of the corresponding computing node is increased by one;
[0085] Specifically, for each computing node, the initial node error count is zero. When an error occurs during simulation calculation, the corresponding node error count increases by one each time an error occurs.
[0086] S113: Determine whether the number of node errors reaches a preset second number threshold;
[0087] The second numerical threshold is also set by the user in step S103.
[0088] S114: Mark the corresponding computing node as an unavailable computing node;
[0089] Among them, the computing nodes marked as unavailable computing nodes will no longer be distributed simulation tasks and corresponding data, programs and templates in the subsequent simulation task process, that is, they can no longer perform simulation calculations.
[0090] S115: Summarize and compile statistics on the simulation data and generate a simulation report.
[0091] When there are no simulation tasks in the task queue to be executed (the simulation tasks are moved to the completed task queue or the error task queue), or there are no available computing nodes (all computing nodes are marked as unavailable computing nodes, which is a very extreme situation and generally does not occur), the simulation task data can be summarized and counted, and a report is automatically generated based on the statistical data. The report includes the calculation results of each simulation task (successful or error), the simulation calculation performed by each simulation task in which (or which) computing nodes, the time of the corresponding simulation calculation, etc., as well as the calculation results of each simulation task performed by each computing node from the perspective of the computing node. In addition, the specific implementation method of this step is similar to that in the prior art, so it is no longer described in detail.
[0092] In addition, based on the above solution, in some embodiments, the method further includes: when any available computing node completes a simulation calculation without error, clearing the number of node errors of the corresponding computing node to zero.
[0093] Specifically, when a computation node encounters an error in its simulation calculation (the number of node errors is greater than zero and less than a second threshold), if no errors are encountered in subsequent simulation calculations of other simulation tasks, this indicates that the previous error was not caused by the computation node error. In this case, the node error count for that computation node is reset to zero, thereby preventing the accumulation of errors from a large number of simulation tasks, which could lead to the available computation node being marked as unavailable. In other words, a computation node must fail in multiple consecutive simulation calculations (greater than or equal to the second threshold) before it is marked as unavailable.
[0094] In addition, based on the above scheme, in some embodiments, the method also includes: for simulation tasks in which simulation calculations have errors, if the error also occurs after re-simulation calculations on other available computing nodes, the number of node errors of the available computing nodes in which the simulation calculations have errors will be reduced by one; if no error occurs after re-simulation calculations on other available computing nodes, the number of node errors of the available computing nodes in which the simulation calculations have errors will be maintained unchanged.
[0095] That is, for a simulation task that previously encountered an error, if the error also occurs after re-simulation on another available computing node, this indicates that the calculation result of the computing node that previously encountered the error is correct, and the error is indeed caused by the error in the simulation task. Therefore, the node error count of the available computing node that previously encountered the error is reduced by one, thereby preventing the available computing node from being marked as unavailable. If the error does not occur after re-simulation on another available computing node, it indicates that the simulation task itself is correct, and it is reasonable to increase the node error count of the computing node that previously encountered the error by one.
[0096] Through the above scheme, the present application first decomposes the original overall use case file into multiple sub-use case files, and generates corresponding simulation task files, so that the simulation tasks obtained after the decomposition can be simulated and calculated separately. Then, when the simulation calculation fails, the content and cause of the error can be determined based on the statistical results. In addition, when the simulation calculation fails, the erroneous simulation task can be re-simulated and calculated multiple times until it is determined that the simulation task is indeed erroneous, or the simulation calculation error is caused by an error in the computing node, thereby being able to deal well with the large number of use case task errors and computing node errors in the prior art.
[0097] In order to make the technical solution of this application easier to understand, the following Figure 2-11 This article will illustrate this with a specific example. For specific examples, please refer to Figure 2-11 , Figure 2-11 A schematic diagram of various steps of a specific simulation scheduling method shown in an embodiment of the present application.
[0098] 1) If Figure 2 As shown, first create a project, upload the .aim file, automatically build groups, generate task units, and encapsulate the task units into .Bat files; and assume that the first count threshold N = 3 and the second count threshold M = 3;
[0099] 2) If Figure 3 As shown in the figure, according to the settings of task units and available computing nodes, a use case task queue (task nodes in the task queue will record the execution development time, assigned computing node number, task status, task completion time, etc.) and a computing node queue (nodes in the node queue will record the tasks on each round of assigned computing nodes and the execution status of the tasks) are constructed and initialized; Figure 3 In the example, it is assumed that 12 simulation tasks are encapsulated and 4 computing nodes are available. That is, Task1, Task2, Task3, ..., Task12 represent 12 simulation tasks, and Host1, Host2, Host3, Host4 represent 4 computing nodes.
[0100] 3) If Figure 4 As shown, four tasks are extracted: Task1 is executed on Host1, Task2 is executed on Host2, Task3 is executed on Host3, and Task4 is executed on Host4. Assume that Task2 times out when executing on Host2 (failed to upload data to FTP on time, that is, the simulation calculation fails), and, Figure 4-11 In the figure, the gray-filled grid indicates an erroneous simulation task or computing node;
[0101] 4) After the execution is completed, Task2 has an error. In order to confirm whether Task2 is valid as soon as possible, Task2 is placed in the first place in the waiting task queue for the next round of execution; the computing node also records the error in executing Task2. However, if the total number of errors of the computing node Host2 has not reached M, it will continue to be kept in the computing node queue. After completion, the final state is as follows Figure 5 As shown;
[0102] 5) If Figure 6 As shown, the tasks are continued to be executed. Task2 is executed on Host1, Task5 is executed on Host2, Task6 is executed on Host3, and Task7 is executed on Host4. Assume that Task7 times out on Host3.
[0103] 6) After the execution is completed, Task 2 is successfully executed on Host 1, and Task 7 has an error on Host 4, and is placed at the first position in the task queue for the next round of execution; the computing node also records the error in executing Task 7, but the total number of errors on the computing node Host 4 has not yet reached M, so it continues to be kept in the computing node queue. After this round of calculation is completed, the status of each queue is as follows Figure 7 As shown;
[0104] 7) If Figure 8 As shown, the tasks are continued to be executed. Task7 is executed on Host1, Task8 is executed on Host2, Task9 is executed on Host3, and Task10 is executed on Host4. Assume that Task7 times out again on Host1.
[0105] 8) After the execution is completed, Task 7 has an error again. Since the total number of errors for Task 7 has not yet reached N, it is put back to the first position in the task queue and waits for the next round of execution. The computing node also records the error in executing Task 7, but the total number of errors for computing node Host1 has not yet reached M, so it continues to be kept in the computing node queue. After this round of calculation is completed, the status of each queue is as follows: Figure 9 As shown;
[0106] 9) If Figure 10 As shown, the tasks continue to be executed. Task7 is assigned again. Since it has been executed on Host1 and Host4, it is assigned to Host2 in order this time. Task11 is executed on Host1, and Task12 is executed on Host3. Assume that Task7 fails again.
[0107] 10) After the execution is completed, Task 7 has an error, and it has already failed 3 times (reaching the first error threshold N), and is added to the task error queue; the computing node also records the error in executing Task 7, but the number of consecutive errors of computing node Host2 has not reached M recently, so it continues to be in the computing node queue. The final status of each queue is as follows Figure 11 As shown;
[0108] 11) Finally, the task queue is empty; all tasks have been completed. Eleven use case tasks completed successfully, and one use case task (Task7) failed. Four use case tasks were run on Host1 (three successful, one failed); four tasks were run on Host2 (two successful, two failed); four use case tasks were run on Host3 (four successful, zero failed); and three use case tasks were run on Host4 (two successful, one failed).
[0109] Furthermore, corresponding to the parallel co-simulation scheduling method for the fault injection use case described in the above embodiment, an embodiment of the present application also provides a parallel co-simulation scheduling device for the fault injection use case. This device is a functional module for executing the corresponding steps in the computer software for implementing the parallel co-simulation scheduling method for the fault injection use case described in the above embodiment.
[0110] Reference Figure 12 , Figure 12 A structural diagram of a parallel joint simulation scheduling device for a fault injection use case shown in an embodiment of the present application.
[0111] like Figure 12 Said device comprises:
[0112] A decomposition module 121 is configured to decompose the use case file based on the content segments of the obtained use case file and a preset decomposition number to obtain a plurality of sub-use case files;
[0113] A generating module 122, configured to generate a corresponding task file for each of the sub-use case files;
[0114] Initialization module 123, used to initialize simulation calculation parameters and add simulation tasks corresponding to all task files to the task queue to be executed;
[0115] The simulation calculation module 124 is used to repeatedly execute the simulation calculation process until there are no simulation tasks or no available computing nodes in the task queue to be executed, and to summarize and compile simulation data and generate a simulation report;
[0116] The simulation calculation module 124 is specifically used for:
[0117] Extracting a plurality of simulation tasks from the to-be-executed task queue, which is the same number as the number of available computing nodes, and distributing the plurality of simulation tasks and data, programs, and templates related to each simulation task to each available computing node, so that each available computing node performs simulation calculations respectively;
[0118] Determine whether the simulation calculation of each available computing node is wrong;
[0119] If the simulation calculation is correct, the corresponding simulation task is moved from the pending task queue to the completed task queue;
[0120] If the simulation calculation fails, the task error count of the corresponding simulation task is increased by one, and it is determined whether the task error count reaches a preset first threshold; if so, the corresponding simulation task is removed from the to-be-executed task queue to the error task queue; if not, the corresponding simulation task is retained in the to-be-executed task queue and waits for the next extraction;
[0121] If the simulation calculation fails, the number of node errors of the corresponding computing node will be increased by one, and it will be determined whether the number of node errors reaches a preset second threshold; if so, the corresponding computing node will be marked as an unavailable computing node; wherein the second threshold is greater than or equal to the first threshold.
[0122] The specific implementation of the steps executed by each functional module in the above-mentioned device can be implemented with reference to the corresponding contents in the above-mentioned method embodiment, and will not be described in detail here.
[0123] In addition, corresponding to the parallel co-simulation scheduling method for the fault injection use case described in the above embodiment, the present application also provides an intelligent device. The intelligent device is a PC or similar device for executing the parallel co-simulation scheduling method for the fault injection use case described in the above embodiment.
[0124] Reference Figure 13 , Figure 13 This is a schematic diagram of the structure of a smart device shown in an embodiment of the present application. Figure 13 As shown, the device includes:
[0125] A memory 131 and a processor 132 connected to the memory 131;
[0126] The memory 131 is used to store a computer program, wherein the computer program is at least used to execute the parallel joint simulation scheduling method for the fault injection use case described above;
[0127] The processor 132 is configured to call and execute the computer program stored in the memory 131 .
[0128] The specific implementation of the method executed by the computer program can be implemented by referring to the corresponding content in the aforementioned method embodiment, and will not be described in detail here.
[0129] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0130] It should be noted that, in the description of this application, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0131] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0132] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0133] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0134] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0135] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0136] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0137] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A parallel joint simulation scheduling method for fault injection use cases, characterized in that: include: Decomposing the use case file based on the content segments of the acquired use case file and a preset decomposition number to obtain a plurality of sub-use case files; Generate a corresponding task file for each of the sub-use case files; Initialize the simulation calculation parameters and add the simulation tasks corresponding to all task files to the task queue to be executed; Repeat the simulation calculation process until there are no simulation tasks or no available computing nodes in the task queue to be executed, summarize and count the simulation data and generate a simulation report; The simulation calculation process includes: Extracting a plurality of simulation tasks from the to-be-executed task queue, which is the same number as the number of available computing nodes, and distributing the plurality of simulation tasks and data, programs, and templates related to each simulation task to each available computing node, so that each available computing node performs simulation calculations respectively; Determine whether the simulation calculation of each available computing node is wrong; If the simulation calculation is correct, the corresponding simulation task is moved from the pending task queue to the completed task queue; If the simulation calculation fails, the task error count of the corresponding simulation task is increased by one, and it is determined whether the task error count reaches a preset first threshold; if so, the corresponding simulation task is removed from the to-be-executed task queue to the error task queue; if not, the corresponding simulation task is retained in the to-be-executed task queue and waits for the next extraction; If a simulation calculation error occurs, the node error count of the corresponding computing node is increased by one, and it is determined whether the node error count reaches a preset second threshold; if so, the corresponding computing node is marked as an unavailable computing node; wherein the second threshold is greater than or equal to the first threshold; For the simulation task with simulation calculation errors, the next time it is extracted, it will be distributed to other available computing nodes other than the available computing node where the simulation calculation error occurred.
2. The method according to claim 1, characterized in that Initializing the simulation calculation parameters includes: Initialize the to-be-executed task queue, the completed task queue, and the error task queue, mark all computing nodes as available computing nodes, and obtain a first time threshold and a second time threshold set by a user.
3. The method according to claim 1, characterized in that The step of respectively judging whether the simulation calculation of each available computing node is wrong includes: Whether the simulation calculation of each available computing node is wrong is determined based on whether the preset directory or file contains the result file uploaded by the corresponding simulation task after the preset polling time expires; wherein, the simulation task generates and uploads the result file after the simulation calculation is completed.
4. The method according to claim 1, wherein The step of retaining the corresponding simulation task in the to-be-executed task queue and waiting for next extraction includes: The corresponding simulation task is moved to the front row of the task queue to be executed and waits for the next extraction.
5. The method according to claim 1, characterized in that Also includes: When any available computing node completes a simulation calculation without error, the number of node errors of the corresponding computing node is cleared to zero.
6. The method according to claim 5, characterized in that Also includes: For simulation tasks with simulation calculation errors, if the error also occurs after the simulation calculation is repeated on other available computing nodes, the node error count of the available computing node with the previous simulation calculation error will be reduced by one. If no error occurs after the simulation calculation is repeated on other available computing nodes, the node error count of the available computing node with the previous simulation calculation error will remain unchanged.
7. The method according to claim 1, characterized in that The use case file is a file in .aim format, and the task file is a file in .bat format.
8. A parallel joint simulation scheduling device for fault injection use cases, characterized in that: include: A decomposition module, configured to decompose the use case file based on the content segments of the obtained use case file and a preset decomposition quantity to obtain a plurality of sub-use case files; A generation module, configured to generate a corresponding task file for each of the sub-use case files; The initialization module is used to initialize the simulation calculation parameters and add the simulation tasks corresponding to all task files to the task queue to be executed; A simulation calculation module is used to repeatedly execute the simulation calculation process until there are no simulation tasks or no available computing nodes in the task queue to be executed, and to summarize and compile simulation data and generate a simulation report; The simulation calculation module is specifically used for: Extracting a plurality of simulation tasks from the to-be-executed task queue, which is the same number as the number of available computing nodes, and distributing the plurality of simulation tasks and data, programs, and templates related to each simulation task to each available computing node, so that each available computing node performs simulation calculations respectively; Determine whether the simulation calculation of each available computing node is wrong; If the simulation calculation is correct, the corresponding simulation task is moved from the pending task queue to the completed task queue; If the simulation calculation fails, the task error count of the corresponding simulation task is increased by one, and it is determined whether the task error count reaches a preset first threshold; if so, the corresponding simulation task is removed from the to-be-executed task queue to the error task queue; if not, the corresponding simulation task is retained in the to-be-executed task queue and waits for the next extraction; If a simulation calculation error occurs, the node error count of the corresponding computing node is increased by one, and it is determined whether the node error count reaches a preset second threshold; if so, the corresponding computing node is marked as an unavailable computing node; wherein the second threshold is greater than or equal to the first threshold; For the simulation task with simulation calculation errors, the next time it is extracted, it will be distributed to other available computing nodes other than the available computing node where the simulation calculation error occurred.
9. A smart device, characterized in that: include: A memory and a processor connected to the memory; The memory is used to store a computer program, wherein the computer program is at least used to execute the parallel joint simulation scheduling method for the fault injection use case according to any one of claims 1 to 7; The processor is configured to call and execute the computer program stored in the memory.
Citation Information
Patent Citations
Saber-based circuit failure simulation analyzing method
CN102156760A
MapReduce fault injection external member
CN104331324A