CN111240973B - Equipment testing method and system based on simulation and readable storage medium - Google Patents
Equipment testing method and system based on simulation and readable storage medium Download PDFInfo
- Publication number
- CN111240973B CN111240973B CN202010011118.XA CN202010011118A CN111240973B CN 111240973 B CN111240973 B CN 111240973B CN 202010011118 A CN202010011118 A CN 202010011118A CN 111240973 B CN111240973 B CN 111240973B
- Authority
- CN
- China
- Prior art keywords
- equipment
- simulation
- tested
- test
- simulated
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
- G06F11/261—Functional testing by simulating additional hardware, e.g. fault simulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/31—User authentication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2141—Access rights, e.g. capability lists, access control lists, access tables, access matrices
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Quality & Reliability (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Testing And Monitoring For Control Systems (AREA)
Abstract
The invention discloses a device testing method and system based on simulation and a readable storage medium, wherein the method comprises the following steps: acquiring simulation configuration parameters corresponding to equipment to be tested, and determining a simulation equipment execution list of equipment types corresponding to the equipment to be tested according to the simulation configuration parameters; according to the simulation device execution list, simulating various devices to be simulated, which correspond to the device types of the devices to be simulated, to generate simulation devices; and forming the simulation devices and the devices to be tested into integral devices corresponding to the device types, and controlling the integral devices to run so as to test the devices to be tested. According to the scheme, the equipment assembly which is not assembled in the whole equipment and the equipment to be tested form the whole equipment, so that the equipment to be tested is tested; the time for assembling the whole equipment is saved, and the problem that other components in the whole equipment are damaged due to abnormal operation of the equipment to be tested in the test process is effectively avoided; the safety of components in the whole equipment is ensured while the testing efficiency is improved.
Description
Technical Field
The invention mainly relates to the technical field of testing, in particular to a device testing method and system based on simulation and a readable storage medium.
Background
As production technology advances, more and more equipment is run through the production line to achieve streamlined production. In order to ensure the normal realization of all functions of the produced equipment, all the functions of the equipment need to be tested, and the equipment can flow to the market for users after being tested without errors.
Currently, the test of the equipment before the equipment flows to the market is usually performed after all components, modules and the like of the equipment are assembled into a whole machine. However, the whole machine assembly operation needs to consume more manpower time, and the test efficiency is seriously affected under the condition of more test equipment; meanwhile, when high-power current or voltage test is carried out on the assembled equipment, the high-power current or voltage easily causes abnormal operation of the equipment, so that certain components in the whole machine are damaged, the problems in the test of the equipment are difficult to locate, a great deal of time is required to find out the problem points, and the test efficiency is also influenced.
Therefore, the problem that the components in the whole machine are easily damaged due to low testing efficiency in the equipment testing process is a technical problem to be solved urgently at present.
Disclosure of Invention
The invention mainly aims to provide a device testing method and system based on simulation and a readable storage medium, and aims to solve the technical problems that in the prior art, the testing efficiency is low and components in a complete machine are easy to damage in the device testing process.
In order to achieve the above object, the present invention provides a simulation-based device testing method, which includes the steps of:
acquiring simulation configuration parameters corresponding to equipment to be tested, and determining a simulation equipment execution list of equipment types corresponding to the equipment to be tested according to the simulation configuration parameters;
according to the simulation device execution list, simulating various devices to be simulated of the device type corresponding to the device to be simulated, and generating simulation devices;
and forming the simulation equipment and the equipment to be tested into integral equipment corresponding to the equipment type, and controlling the integral equipment to run so as to test the equipment to be tested.
Preferably, the step of determining a simulated device execution list corresponding to the device type to be tested according to the simulated configuration parameter includes:
reading equipment type parameters, simulation type parameters, protocol parameters and working parameters which respectively correspond to the simulation type parameters in the simulation configuration parameters;
Transmitting the equipment type parameter, each simulation type parameter, and the protocol parameter and the working parameter respectively corresponding to each simulation type parameter to a preset script frame to generate a script file;
and analyzing the script file to generate a simulation device execution list corresponding to the device type of the device to be tested.
Preferably, the step of parsing the script file to generate a simulation device execution list corresponding to the device type to be tested includes:
performing lexical analysis and grammar analysis on the script file, and determining the overall working sequence of the equipment type corresponding to the equipment to be tested, various equipment to be simulated of the equipment type corresponding to the equipment to be tested, the working time sequence of the various equipment to be simulated and the working modes of the various equipment to be simulated;
according to the overall working sequence, device identifiers of various devices to be simulated are arranged to generate a simulation device execution list;
and adding the working time sequences of the various devices to be simulated and the working modes of the various devices to be simulated into the simulation device execution list.
Preferably, the step of generating the simulation device includes:
Simulating the equipment to be simulated corresponding to each equipment identifier one by one according to the arrangement sequence of each equipment identifier in the simulation equipment execution list, and generating the simulation equipment;
and acquiring the working time sequence and the working mode of the equipment to be simulated, which are in the simulation equipment execution list and are simulated currently, and adding the working time sequence and the working mode into the simulation equipment generated by the current simulation.
Preferably, the step of controlling the operation of the whole device to test the device under test includes:
determining a test process flow of the whole equipment according to the whole working sequence, and controlling each simulation equipment and the equipment to be tested in the whole equipment one by one to run according to the test process flow;
taking the simulation equipment or the equipment to be tested which is currently operated in the whole equipment as current equipment, and determining the current working time sequence and the current working mode of the current equipment according to the working time sequence and the working mode of each simulation equipment generated by simulation or according to the working identification of the equipment to be tested;
and controlling the current equipment to run according to trigger events corresponding to the current working time sequence and the current working mode until each simulation equipment and the equipment to be tested in the whole equipment run to be completed in the test technological process.
Preferably, the step of controlling the overall device to operate to test the device under test includes:
obtaining test results generated by running the simulation equipment and the equipment to be tested in the whole equipment in the test process flow, and generating the test results into test reports according to the whole working sequence;
detecting whether an abnormal test conclusion corresponding to the equipment to be tested exists in the test report;
if the abnormal test conclusion exists, outputting prompt information of test failure;
if the abnormal test conclusion does not exist, outputting prompt information of successful test.
Preferably, the step of controlling the overall device to operate to test the device under test includes:
when the detection reaches a preset period, calculating the failure rate of the equipment to be tested;
judging whether the fault rate is greater than a preset threshold value, and if so, acquiring the abnormal times of operation of each simulation device in the preset period;
and predicting an abnormality reason according to the distribution trend of the abnormality times, and outputting prompt information based on the abnormality reason.
Preferably, the step of obtaining the simulation configuration parameters corresponding to the device to be tested includes:
when a simulation test instruction is detected, judging whether a user account corresponding to the simulation test instruction has configuration simulation permission;
if the configuration simulation authority is provided, a configuration interface is started to configure simulation configuration parameters corresponding to the device to be tested based on the configuration interface.
In addition, in order to achieve the above object, the present invention also proposes a simulation-based device testing system, including: a memory, a processor, a communication bus, an excitation module, a detection module, and a simulation-based device test program stored on the memory;
the communication bus is used for realizing connection communication between the processor and the memory;
the excitation module is used for outputting excitation to equipment to be tested so as to drive the equipment to be tested to work;
the detection module is used for reading various output signals output by the equipment to be detected so as to judge whether the equipment to be detected works normally or not;
the processor is configured to execute the simulation-based device test program to implement the simulation-based device test method described above.
In addition, to achieve the above object, the present invention also provides a readable storage medium storing one or more programs executable by one or more processors for implementing the simulation-based device testing method as described above.
According to the simulation-based equipment testing method, when the simulation configuration parameters corresponding to the equipment to be tested are obtained, and the requirements for testing the equipment to be tested through the simulation of the simulation configuration parameters are represented, a simulation equipment execution list of equipment types corresponding to the equipment to be tested is determined according to the simulation configuration parameters, and the simulation equipment execution list represents the equipment workflow of the whole equipment containing the equipment to be tested; then, according to the simulation device execution list, simulating various devices to be simulated of the device type corresponding to the device to be tested, and generating simulation devices, namely simulating other devices lacking in the whole device where the device to be tested is located; and combining the simulated simulation devices and the device to be tested to form integral device operation for testing the device to be tested. The equipment components which are not assembled in the whole equipment and the equipment to be tested form the whole equipment, and the equipment to be tested is tested according to the running state of the equipment to be tested in the whole equipment; the time for assembling the whole equipment is saved, and the fault point in the test can be positioned quickly; in addition, the simulation high-power current or voltage is used for testing, so that the problem that other components in the whole equipment are damaged due to abnormal operation of the equipment to be tested can be effectively avoided; the safety performance of components in the whole equipment is ensured while the testing efficiency is improved.
Drawings
FIG. 1 is a flow chart of a first embodiment of a simulation-based device testing method of the present invention;
FIG. 2 is a flow chart of a second embodiment of a simulation-based device testing method of the present invention;
FIG. 3 is a flow chart of a fourth embodiment of a simulation-based device testing method of the present invention;
FIG. 4 is a schematic diagram of a device architecture of a hardware operating environment involved in a method according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a device testing method based on simulation.
Referring to fig. 1, fig. 1 is a flowchart of a first embodiment of a simulation-based device testing method according to the present invention. In this embodiment, the simulation-based device testing method includes:
step S10, obtaining simulation configuration parameters corresponding to equipment to be tested, and determining a simulation equipment execution list of equipment types corresponding to the equipment to be tested according to the simulation configuration parameters;
the equipment testing method based on simulation is applied to a simulation system, is suitable for simulating equipment components which are not assembled in the whole equipment through the simulation system to form the whole equipment together with the equipment components which are assembled in the whole equipment, and is used for testing whether the work flow, the work mode and all functions of the assembled equipment components in the whole equipment are correct. The simulation system can realize simulation test for different types of equipment in a configuration mode, namely, for assembled equipment components in different types of overall equipment, the equipment components which are not assembled in each type and the working modes thereof are configured, and the assembled equipment components in each type form the overall components, so that the assembled equipment components in each type are tested. The simulation system comprises a hardware system and a software system, wherein the hardware system comprises a test simulation board used for being connected with the assembled equipment components, the software system is used for analyzing script files generated through configuration to obtain various information such as the work flow of the whole equipment where the assembled equipment components are located, the equipment components which are not assembled, the working modes of the equipment components and the like, so that the equipment components which are not assembled can be simulated through the various information, the running of the formed whole equipment is controlled, and the working states of the assembled equipment components in the whole equipment are tested together by combining the hardware system and the software system.
The test equipment is various products produced by a production line, and can be household appliances such as televisions, microwave ovens, electromagnetic ovens and industrial equipment such as welding machines and dispensing machines. In the embodiment, a welding machine is preferably taken as an example for explanation, wherein an assembled device component is taken as a device to be tested, and a device component which is not assembled is taken as a device to be simulated which needs to be simulated; and simulating the configured equipment to be simulated to form a complete welding machine with the equipment to be tested, and testing various functions of the equipment to be tested in the welding machine.
Further, according to the variability of the to-be-tested devices required to be tested by the various types of welding machines, developing various types of device parameters supporting configuration for the various types of welding machines in advance through a script development mode. The equipment parameters at least comprise parameter information such as working modes, working sequences, triggering conditions and the like of equipment to be simulated supported by various welding machines, so that required equipment to be simulated is selected from the equipment to be simulated according to the type of the welding machine to which the equipment to be simulated belongs, and the equipment to be simulated runs according to the configured parameter information, thereby realizing simulation test of the equipment to be simulated in various welding machines.
Furthermore, the simulation system comprises a display device such as a liquid crystal display screen or an LED (Light Emitting Diode ) display screen, and the like, and is used for displaying equipment parameters of support configuration of various types of welding machines. And the user initiates a simulation configuration instruction after selecting the to-be-simulated equipment which is not assembled in the welding machine of the type from the displayed equipment parameters according to the type of the welding machine to which the to-be-simulated equipment belongs, so as to configure the to-be-simulated equipment for simulation. The selected content can select the working mode and the working sequence of the equipment to be simulated, which are required to be simulated, besides the equipment to be simulated, the working flow of a welding machine where the equipment to be simulated is located, and the like, so that the welding machine consisting of the equipment to be tested and the simulated simulation equipment operates according to the working flow, the equipment to be tested is tested, and when the equipment to be simulated supports different working modes and working sequences of different types of welding machines, the working mode and the working sequence of the welding machine where the equipment to be tested is suitable for the current test are selected. And sending the selected working flow of the welding machine, the equipment to be simulated, the working modes and the working sequences of the equipment to be simulated as simulation configuration parameters and a simulation configuration instruction to a simulation system together so as to configure the equipment to be simulated for simulation, and testing the equipment to be tested.
Further, in order to ensure security of configuration simulation and testing, a mechanism is provided for authentication before configuration is selected. Specifically, the step of obtaining the simulation configuration parameters corresponding to the device to be tested includes:
step a, when a simulation test instruction is detected, judging whether a user account corresponding to the simulation test instruction has configuration simulation authority;
and b, if the configuration simulation authority is provided, starting a configuration interface to configure simulation configuration parameters corresponding to the equipment to be tested based on the configuration interface.
Further, when the requirement for performing simulation test on the equipment is met, a user performs login operation on a display device of the simulation system through a registered account, and initiates a simulation test instruction after login is successful. After detecting the simulation test instruction, the control terminal firstly acquires the authority identification in the user account initiating the instruction, judges whether the authority identification is consistent with a preset identification preset for representing that the user account has the configuration simulation authority, and if so, indicates that the user account has the configuration simulation authority, thereby starting the configuration interface. The configuration interface can be realized through preset script editing software, and a display area is set in the script editing software to serve as the configuration interface so as to display equipment parameters of all equipment to be simulated of all types of welding machines; the method is convenient for a user to select required equipment to be simulated and equipment parameters thereof as simulation configuration parameters, and converts the simulation configuration parameters through script editing software to obtain a simulation equipment execution list representing the workflow among equipment components in a welding machine where the equipment to be simulated is located.
Otherwise, if the permission identification is inconsistent with the preset configuration identification, the user account is indicated to have no configuration simulation permission, and at the moment, the display interface of the display device only stays at the logged-in interface and the configuration interface is not started. The virtual key for configuring the simulation permission application is arranged in the logged-in interface, and for users who do not have the simulation permission to configure, but do need to configure simulation, the virtual key can be triggered to apply for temporary configuration simulation permission. The method comprises the steps that a configuration simulation authority application is abutted to a manager with authority configuration, after a user triggers a virtual key of the configuration simulation authority application, the user is prompted to upload a certification file, after the certification file is received, the certification file is transmitted to a mailbox or an instant messaging software account of the manager with authority configuration, so that the manager with authority configuration distributes temporary configuration simulation authorities for the user according to the certification file, the user can configure equipment to be simulated to simulate, and the requirement of testing the equipment to be tested is met, so that the safety is ensured while the configuration simulation is met.
The temporary configuration simulation authority can exist in a frequency mode or a date mode, if the temporary configuration simulation authority can be used for 5 times or one month, and when the use frequency or the date is exceeded, the equipment to be simulated can not be configured for simulation. Meanwhile, a blacklist can be set, after the user uploads the evidence file, the user information is read from the evidence file, and whether the user information exists in the blacklist is judged. If the application exists in the blacklist, directly refusing the application of configuring the simulation authority; if the configuration simulation information is not in the blacklist, the certification file is transmitted to a mailbox or an instant messaging software account number of a manager with authority configuration, so that the safety of the configuration simulation is further ensured.
Furthermore, after the user has the configuration simulation authority and the configuration interface sends the simulation configuration instruction to the simulation system, the simulation system receives the simulation configuration instruction and reads the simulation configuration parameters of the configuration required by the equipment to be tested according to the characterization carried in the simulation configuration instruction, so that the workflow of the welding machine where the equipment to be tested is positioned and each equipment to be simulated are configured according to the simulation configuration parameters, and the configuration simulation requirements of the user are met.
It is understood that, because the simulation configuration parameters include parameters representing the working flow of the welding machine where the device to be tested is located, the parameters of the working flow are parameters describing the working sequence of each device component in the welding machine, and represent the testing process flow of the operation of the welding machine. Therefore, in order to ensure that each equipment component in the simulated welding machine can run in the required working sequence, after the simulation configuration parameters are read, each equipment to be simulated can be arranged according to the working sequence of each equipment in the welding machine according to the parameters representing the working flow, and a simulation equipment execution list corresponding to the equipment type to be simulated is generated. The device type is used for representing the overall device type of the device to be tested, such as a welding machine belonging to a specific model, and the generated simulation device execution list is used for representing each device component in the welding machine of the specific model and the operating workflow thereof.
It should be noted that, the simulation device execution list is essentially a data structure, after the simulation configuration parameters are configured in the script editing software as the display area of the configuration interface and sent to the simulation system, the simulation system converts the simulation configuration parameters through the script editing software to generate a script file, and then the script file is converted into the data structure of the simulation execution list. The equipment to be simulated is configured to simulate through the simulation execution list, so that the welding machine where the equipment to be simulated is located operates according to the configured working flow, and all equipment components in the welding machine operate according to the respective configured working sequence and working mode, so that the working state of the equipment to be simulated in the welding machine is tested.
Step S20, according to the simulation device execution list, simulating various devices to be simulated of the device type corresponding to the device to be simulated, and generating simulation devices;
further, after generating the simulation equipment execution list representing the equipment to be simulated and the working parameters thereof required to be simulated, various equipment to be simulated corresponding to the equipment type to be simulated can be simulated according to the simulation equipment execution list, various types of simulation equipment which can be combined with the equipment to be simulated into the whole equipment can be generated, the working sequence and the working mode of the simulated various types of simulation equipment are configured according to the working parameters of the equipment to be simulated in the simulation equipment execution list, so that the equipment to be simulated operates according to the mode required by the whole equipment of the equipment type to be simulated, and the operation state of the equipment to be simulated in the whole equipment is tested.
And step S30, forming the simulation equipment and the equipment to be tested into integral equipment corresponding to the equipment type, and controlling the integral equipment to run so as to test the equipment to be tested.
Furthermore, various simulated devices and the device to be tested form an integral device, and the integral device is the device of the device type of the device to be tested. Then, controlling various simulation devices and devices to be tested in the welding machine to operate according to the workflow represented by the simulation device execution list, namely enabling the whole device where the devices to be tested are located to operate according to the workflow set by the whole device; meanwhile, for various simulation devices, the simulation device runs in the working mode and the working sequence set by the simulation device execution list, and for the device to be tested, the simulation device runs in the working mode and the working sequence of the simulation device to test the working state of the device to be tested in the whole device.
After that, if the requirements of testing other types of welding machines or some assembled devices after the welding machines of the same type are upgraded are met, only a simulation configuration instruction is required to be restarted, and a simulation device execution list of the device type of the new device to be tested is determined according to the simulation configuration parameters in the simulation configuration instruction, so that the new simulation device can be obtained through simulation; and then, the new various simulation devices and the to-be-tested devices form a new integral device to operate so as to test other types of welders or the to-be-tested devices after the same type of welders are upgraded, and different test requirements of different types of welders are realized through configuration simulation. Therefore, when the equipment to be tested is changed, the implementation can realize the test by only reconfiguring the simulation equipment according to the requirement of the new equipment to be tested. The software system in the simulation system does not need to be changed, the hardware system does not need to be changed, and the test of the new equipment to be tested can be completed only by generating a new text script file according to the requirements of the new equipment to be tested, so that the time cost of the test is greatly saved, and the test efficiency is improved.
According to the simulation-based equipment testing method, when the simulation configuration parameters corresponding to the equipment to be tested are obtained, and the requirements for testing the equipment to be tested through the simulation of the simulation configuration parameters are represented, a simulation equipment execution list of equipment types corresponding to the equipment to be tested is determined according to the simulation configuration parameters, and the simulation equipment execution list represents the equipment workflow of the whole equipment containing the equipment to be tested; then, according to the simulation device execution list, simulating various devices to be simulated of the device type corresponding to the device to be tested, and generating simulation devices, namely simulating other devices lacking in the whole device where the device to be tested is located; and combining the simulated simulation devices and the device to be tested to form integral device operation for testing the device to be tested. The equipment components which are not assembled in the whole equipment and the equipment to be tested form the whole equipment, and the equipment to be tested is tested according to the running state of the equipment to be tested in the whole equipment; the time for assembling the whole equipment is saved, and the fault point in the test can be positioned quickly; in addition, the simulation high-power current or voltage is used for testing, so that the problem that other components in the whole equipment are damaged due to abnormal operation of the equipment to be tested can be effectively avoided; the safety performance of components in the whole equipment is ensured while the testing efficiency is improved.
Further, referring to fig. 2, based on the first embodiment of the simulation-based device testing method of the present invention, a second embodiment of the simulation-based device testing method of the present invention is provided, in the second embodiment, the step of determining, according to the simulation configuration parameters, a simulation device execution list corresponding to a device type of the device to be tested includes:
step S11, reading equipment type parameters, simulation type parameters, protocol parameters and working parameters which respectively correspond to the simulation type parameters in the simulation configuration parameters;
step S12, transmitting the equipment type parameter, each simulation type parameter, the protocol parameter and the working parameter respectively corresponding to each simulation type parameter to a preset script frame to generate a script file;
and S13, analyzing the script file to generate a simulation device execution list corresponding to the device type of the device to be tested.
In the process of determining the simulation equipment execution list according to the simulation configuration parameters, the embodiment firstly converts the simulation configuration parameters into script files, and then analyzes the script files to obtain the simulation equipment execution list. Specifically, a preset script frame for generating a script file is preset, and codes for representing the type of equipment corresponding to the equipment to be tested, the equipment to be simulated required to be simulated, the working protocol and the working parameters of the equipment to be simulated and the working protocol are represented by code variables in the preset script frame. When the requirement of generating an execution list of the simulation equipment is met, calling a preset script frame, and reading equipment types corresponding to equipment to be tested, which are represented in simulation configuration parameters, as equipment type parameters in the simulation configuration parameters; and simultaneously taking the type of the equipment to be simulated, which is required to be simulated and is lack of the equipment type corresponding to the equipment to be simulated, as a simulation type parameter, and reading protocol parameters which are corresponding to the simulation type parameter and are used for representing a communication transmission protocol supported between the equipment to be simulated and working parameters which are used for representing the working sequence and the working mode of the equipment to be simulated. And respectively transmitting the read equipment type parameter, the simulation type parameter, the corresponding protocol parameter and the corresponding working parameter to a preset script frame, and replacing respective code variables to generate a script file. And then analyzing the generated script file to obtain a simulation device execution list for simulating the device to be simulated which is lack in the device type to be tested and representing the operation logic of the whole device of the device type to be tested.
In a specific embodiment, the code variables Mi, ni, wi and Ki are used for respectively representing the equipment type parameter, the simulation type parameter, the protocol parameter and the working parameter which respectively correspond to the simulation type parameter in a preset script frame; if the equipment type parameter read in the simulation parameter configuration is f1, the simulation type parameter is f2, and the corresponding protocol parameter and working parameter are f3 and f4 respectively. After the preset script frame is called, the f1, f2, f3 and f4 are respectively transmitted to the preset script frame, so that Mi, ni, wi and Ki are respectively f1, f2, f3 and f4. After parameters related to each device to be tested in the simulation configuration parameters are replaced by a preset script frame, a script file can be generated. And further, analyzing the script file to obtain a simulation device execution list which is used for simulating and representing the operation logic and corresponds to the device type of the device to be tested.
The step of analyzing the script file and generating a simulation device execution list corresponding to the device type of the device to be tested comprises the following steps:
step S131, performing lexical analysis and grammar analysis on the script file, and determining the overall working sequence of the equipment type corresponding to the equipment to be tested, various equipment to be simulated of the equipment type corresponding to the equipment to be tested, the working time sequence of the various equipment to be simulated and the working modes of the various equipment to be simulated;
Step S132, according to the whole working sequence, arranging the device identifiers of various devices to be simulated to generate a simulation device execution list;
and step S133, adding the working time sequences of the various devices to be simulated and the working modes of the various devices to be simulated into the simulation device execution list.
Further, a preset lexical analyzer is called to conduct lexical analysis on the script file. The lexical analyzer is generated by pre-training based on a human language word set and combined with big data script files randomly collected on a network. And in the lexical analysis, word segmentation is carried out on the script file to obtain a plurality of character strings, and tags are added to data, keywords, logic structures and the like corresponding to the character strings.
Further, a preset grammar analyzer is called to carry out grammar analysis on the character strings of the script file after word segmentation and label addition. When the grammar analysis is carried out, whether the grammar structure of the script file is correct is firstly judged, if so, each label added by the lexical analyzer is convenient, and a tree structure corresponding to the logic structure of each keyword is generated according to the grammar description. The tree nodes of the tree structure comprise equipment type parameters, simulation type parameters, protocol parameters and working parameters which respectively correspond to the simulation type parameters in simulation configuration parameters represented by data in the character strings, and the tree structure is traversed to obtain the information. The equipment type parameter is used for representing the overall working sequence of the overall equipment of the equipment type of the equipment to be tested, and describing the working sequence of each equipment component in the overall equipment, namely the test process flow of the operation of the overall equipment or the operation logic of the overall equipment; the parameters of each simulation type are used for representing the equipment to be simulated which is lack of the whole equipment and are required to be simulated, the protocol parameters and the working parameters which are respectively corresponding to the parameters of each simulation type are used for representing the working modes of various equipment to be simulated, and the parameters which are used for representing the working sequence of the equipment to be simulated in the working parameters of each simulation type parameter are determined to be the working time sequences of the equipment to be simulated.
Understandably, various devices to be simulated are distinguished by device identifiers, after traversing the tree structure to obtain the overall working sequence of the overall device, the devices to be simulated, the working sequence and the working mode thereof to be simulated are obtained, the device identifiers of the various devices to be simulated are arranged according to the test process flow characterized by the overall working sequence, a simulation device execution list is generated, and the data structure for converting simulation configuration parameters into the simulation device execution list is realized.
Further, in order to ensure that each device to be simulated in the simulation device execution list works in a working mode and a working time sequence set by a user, after the simulation device execution list is generated, information representing the working time sequence and the working mode set by the user for each type of module to be simulated is added into the simulation device execution list, so that when a simulation system controls a certain simulation device simulated in the whole device to run, the working time sequence and the working mode of the simulation system are determined according to the information representing the working time sequence and the working mode in the simulation device execution list, and the simulation system is started in the working time sequence and the working mode. And the simulation equipment is generated by simulating the equipment to be simulated which is lack in the whole equipment through the simulation equipment execution list, and the running state of the module to be tested in the whole equipment is tested according to the interaction condition between the module to be tested and the started simulation equipment. Specifically, according to the simulation device execution list, various devices to be simulated corresponding to the device types of the devices to be simulated are simulated, and the step of generating the simulation device comprises the following steps:
Step S21, according to the arrangement sequence of the equipment identifiers in the simulation equipment execution list, simulating the equipment to be simulated corresponding to the equipment identifiers one by one to generate the simulation equipment;
step S22, the working time sequence and the working mode of the equipment to be simulated, which are simulated currently, in the simulation equipment execution list are obtained, and the working time sequence and the working mode are added into the simulation equipment generated through current simulation.
Furthermore, after generating the simulation device execution list to be simulated for the device type of the device to be tested, the simulation system can simulate the device to be simulated represented by each module identifier one by one according to the arrangement sequence of each module identifier in the simulation device execution list to generate each simulation device. The simulation equipment execution list is generated according to the test process flow characterized by the whole working sequence, so that each simulation equipment generated one by one according to the arrangement sequence is the operation sequence of each simulation module in the test process flow, and the whole equipment of the equipment type of the equipment to be tested is conveniently controlled to operate according to the test process flow according to the generation sequence of the simulation equipment.
And in the process of simulating each device to be simulated one by one, acquiring the working time sequence and the working mode of the device to be simulated of the current simulation from a simulation device execution list, adding the acquired working time sequence and working mode into the simulation device generated by the current simulation, and representing the working mode required by the type of the device to be simulated on the simulation device of the current simulation. After the current simulation equipment to be simulated is simulated to generate simulation equipment and the working time sequence and the working mode are added, searching the equipment to be simulated represented by the module identifiers arranged in the next sequence from a simulation equipment execution list to simulate the equipment to be simulated, until the equipment to be simulated represented by each module identifier in the simulation equipment execution list is simulated to generate simulation equipment, and adding the working time sequence and the working mode to each simulation equipment, so that the working mode of each simulation equipment in the whole equipment including the equipment to be simulated is determined.
According to the embodiment, the configured simulation configuration parameters including the equipment type parameters, the simulation type parameters, the protocol parameters and the working parameters are firstly generated into the script file, so that the script file is generated to represent the test technological process of the equipment type of the equipment to be tested, the equipment type of the simulation equipment to be simulated, the working modes of various simulation equipment and the like; the script file is converted into a module execution list, and each simulation device and the device to be tested form integral devices through simulation by the module execution list so as to test the device to be tested; the test can be performed in a simulation mode as long as the equipment to be tested is assembled, and the test efficiency is improved.
Further, based on the second embodiment of the simulation-based device testing method of the present invention, a third embodiment of the simulation-based device testing method of the present invention is provided, in which the step of controlling the operation of the whole device to test the device to be tested includes:
step S31, determining a test process flow of the whole equipment according to the whole working sequence, and controlling each simulation equipment and the equipment to be tested in the whole equipment one by one to run according to the test process flow;
step S32, taking the simulation equipment or the equipment to be tested which is currently operated in the whole equipment as current equipment, and determining the current working time sequence and the current working mode of the current equipment according to the working time sequence and the working mode of each simulation equipment generated by simulation or according to the working identification of the equipment to be tested;
and step S33, controlling the current equipment to run according to the triggering event corresponding to the current working time sequence and the current working mode until each simulation equipment and the equipment to be tested in the whole equipment run to be completed in the test process flow.
Furthermore, the simulation system controls the running of the whole equipment generated by simulation so as to characterize the running test process flow of the whole equipment according to the running state of the equipment to be tested in the whole equipment, so that the test process flow of the whole equipment can be determined according to the whole working sequence, and then the simulation equipment and the equipment to be tested forming the whole equipment are controlled to run according to the test process flow. If the overall equipment comprising the equipment to be tested p1 and the analog equipment p2 and p3 is provided with the overall working sequences p2, p3 and p1, the test process flow is to control the operation of p2 firstly, then control the operation of p3 and finally control the operation of p1, and the operation state of the equipment to be tested in the overall equipment is tested through the operation sequence.
It is understood that the analog devices and the devices to be tested which form the overall device have respective working modes, namely respective working time sequences and working modes, so that when the analog devices or the devices to be tested of the overall device are controlled to operate, the operating working modes need to be determined first. Specifically, the simulation device or the device to be tested currently operated in the whole device is used as the current device, and if the current device is the simulation device, namely the current device is the simulation device, the current working time sequence and the current working mode of the current device are determined according to the working time sequence and the working mode added to each simulation device in the simulation process. If the current running equipment is the equipment to be tested, namely the current equipment is the equipment to be tested, the working time sequence and the working mode of the equipment to be tested are determined according to the working identification which is set in the production process and is used for representing the working time sequence and the working mode of the equipment to be tested.
Further, after determining the current operation timing and the current operation mode that characterize the operation mode of the current device, the current device may be controlled to operate in the current operation timing and the current operation mode. The life cycle of the current equipment is the period from starting to stopping operation in the running process of the current equipment; in different time periods from starting to stopping the life cycle, the current equipment operates in different working modes, namely a working mode. For example, for an apparatus for welding arc, there is generally a problem that the current is small in the initial stage of welding, there is difficulty in fusion, then the current is gradually increased, the arc needs to be drawn up to the welding in the initial stage to the welding to be finished, and at this time, the current needs to be reduced in order to avoid excessive welding. So that at least three periods are included in the life cycle of the device, an initial phase, a steady phase and a final phase, and the different phases are distinguished by the magnitude of the current. Therefore, the current can be used as a trigger event corresponding to the current working time sequence and the current working mode, when the current equipment is controlled to work in the current working time sequence and the current working mode, whether the corresponding trigger event is triggered or not is firstly determined, if so, the current equipment is controlled to operate in the current working time sequence and the current working mode, otherwise, the working mode and the working time sequence are not changed. And after the operation of the current equipment is finished, the next simulation equipment or equipment to be tested is operated as the current equipment according to the test process flow until the operation of each simulation equipment and equipment to be tested in the whole equipment is finished according to the process flow.
It should be noted that, besides the single analog device or the device to be tested operates in different working states triggered by events in its life cycle, the operation between each analog device and the device to be tested which form the whole device may also be triggered by events. If a welding start event E0 is generated in the simulation system, the whole equipment detects the event E0, the simulation equipment D1 generated by performing configuration simulation according to the first equipment node of the simulation equipment execution list is controlled to run, after the running is completed, the event E1 is generated, and the next simulation equipment is triggered by the co-event E1, so that a trigger event is continuously generated until all the simulation equipment and equipment to be tested in the whole equipment run.
Understandably, after each simulation device and the device to be tested in the whole device are operated according to the test process flow, a test result representing the working state of the device to be tested in the whole device is generated, and whether the test of the device to be tested is successful or not can be judged according to the test result. Specifically, the step of controlling the whole device to run so as to test the device to be tested includes:
step S34, obtaining test results generated by running the simulation equipment and the equipment to be tested in the whole equipment in the test process flow, and generating the test results into test reports according to the whole working sequence;
Step S35, detecting whether an abnormal test conclusion corresponding to the equipment to be tested exists in the test report;
step S36, if the abnormal test conclusion exists, outputting prompt information of test failure;
and step S37, if the abnormal test conclusion does not exist, outputting prompt information of successful test.
Further, each simulation device and each device to be tested of the whole device generate respective test data in the process of running according to the test process flow; in order to represent the correctness of each test data, preset standard data are preset for each simulation device and each device to be tested. In the process of testing according to the testing technological process, once the testing data is detected, searching preset standard data corresponding to the current equipment running currently, comparing the testing data with the preset standard data, judging whether the testing data and the preset standard data are consistent, and generating a testing result of the equipment to be tested in the running process of the current equipment according to the consistency of the testing data and the preset standard data. When the comparison determines that the test data is inconsistent with the preset standard data, the test data is incorrect, and the generated test result is a test failure; otherwise, when the test data is consistent with the preset standard data, the test data is correct, and the generated test result is successful.
It should be noted that, consistency between the test data and the preset standard data is set with different judgment standards according to different test functions. Judging whether the standard has uniqueness for the result of the type or not; only when the test data and the preset standard data are identical, it is judged that the test data and the preset standard data are identical. If the connectivity test is performed, the preset standard data are connected, and only if the test data are also connected, the consistency of the preset standard data and the test data can be judged. For the result of the numerical value type, the judgment standard has interval floatability; when the test data is not identical with the preset standard data, the test data floats in a certain range interval, and the test data and the preset standard data can be judged to be identical. If the voltage test is performed, the preset standard data is 220V, and the difference between the test data and the preset standard data floats within plus or minus 10, the test data and the preset standard data can still be considered to be consistent.
Further, the simulation devices and the devices to be tested in the whole device are numerous, each simulation device and each device to be tested can operate according to the test technological process, test data are generated, and the test data are compared with corresponding preset standard data to generate respective test results. After the whole equipment operates according to the test technological process and generates each test result, each test result can be arranged according to the whole working sequence of the whole equipment, namely the generation sequence of each test result, and a test report representing the operation state of the equipment to be tested in the whole equipment is generated.
Furthermore, each test result is presented in a test report, and for the test data inconsistent with the preset standard data, the generated test result of test failure exists in the form of an abnormal test conclusion in the test report; and for the consistency of the test data and the preset standard data, the generated test result of successful test exists in a test report in the form of a normal test conclusion. In order to determine the integrity conclusion of the device under test, the test report is tested to determine whether an abnormal test conclusion exists therein. If an abnormality test conclusion exists, the performance of the equipment to be tested is problematic when the whole equipment operates; and adding the performance corresponding to the generated abnormal test conclusion into prompt information of test failure and outputting the prompt information so as to detect the reason causing the performance test failure according to the prompt information. Otherwise, if no abnormal test conclusion exists, the device to be tested is good in performance when the whole device operates, and no problem exists; and after outputting prompt information of successful test, completing the test of the equipment to be tested.
According to the embodiment, each simulation device and the device to be tested in the whole device are controlled to operate in respective working time sequence and working mode according to the test process flow, so that performance test of the device to be tested in the whole device is realized. Meanwhile, test data of each simulation device and the device to be tested are generated as test results, and an overall test report is generated according to each test result, so that whether the performance of the device to be tested in the overall device is good or not can be determined through the test report. When the performance is problematic, the cause of the problem can be rapidly determined through each abnormal test conclusion, so that the problem points of the equipment to be tested can be rapidly positioned and detected.
Further, referring to fig. 3, a fourth embodiment of the simulation-based device testing method according to the present invention is provided based on the first, second or third embodiments of the simulation-based device testing method according to the present invention, in the fourth embodiment, the step of controlling the overall device to run to test the device to be tested includes:
step S40, when the detection reaches a preset period, calculating the failure rate of the device to be tested;
step S50, judging whether the fault rate is larger than a preset threshold value, and if so, acquiring the abnormal times of operation of each simulation device in the preset period;
and step S60, predicting the reason of the abnormality according to the distribution trend of the abnormal times, and outputting prompt information based on the reason of the abnormality.
As can be appreciated, with the use of the simulation system, the hardware system or the software system may fail, and this embodiment is provided with a mechanism for predicting the probability of failure of the simulation system by the failure rate of the device under test. Specifically, preset periods, such as one year and half years, are preset according to requirements in advance; and each time the detection reaches the preset period, calculating the fault rate of the device to be tested in the preset period. And counting the total number of the tested devices to be tested in the preset period and the failure number of the test failures, and making a ratio between the failure number and the total number, wherein the result of the ratio is the failure rate in the preset period.
Further, a preset threshold value representing the fault rate is preset, the calculated fault rate is compared with the preset threshold value, and whether the fault rate is larger than the preset threshold value is judged. If the failure rate is greater than the preset threshold value, the failure rate is higher; otherwise, if the failure rate is not greater than the preset threshold, the failure rate is lower. When the failure rate is high through comparison and judgment, and the number of times that the device to be tested fails through the test is high, the reason of the failure may be a problem of the device to be tested on one hand, and a problem of a simulation system for simulation test on the other hand. In order to determine the failed reasons, after the determined failure rate is greater than a preset threshold, the number of failures of each simulation device in a preset period is counted. When the test result of any simulation equipment in the whole equipment is failure, accumulating and counting the failure times of the simulation equipment; and counting the times of failure test results of each simulation device in a preset period, namely, the abnormal times of operation of each simulation module in the preset period.
It is understood that, for the failure rate caused by the problem of the device to be tested, there is no regularity in the operation process of the simulation devices, one device to be tested may be abnormal in the operation process of a certain simulation device to cause test failure, and the other device to be tested is abnormal in the operation process of another simulation device to cause test failure, although the failure rate is raised as a whole, the abnormal times in the operation process of each simulation device are different, and the test failure situation is relatively dispersed in each simulation device. For the simulation system problem used for simulation test, the simulation system problem has regularity in the operation process of the simulation equipment, a plurality of equipment to be tested fail in the operation process of the same simulation equipment, the abnormal times of the simulation equipment are high while the fault rate is increased as a whole, and the condition of test failure is relatively concentrated on the simulation equipment. Therefore, after the abnormal times of the operation of each simulation device are obtained, the simulation device which may have the abnormality in each simulation device can be estimated according to the distribution trend of the abnormal times. If the distribution trend is relatively scattered, predicting the reason of the equipment to be tested, and outputting prompt information for verifying and optimizing the production flow of the equipment to be tested; if the distribution trend is relatively concentrated, the concentrated simulation equipment is predicted to be abnormal simulation equipment. The abnormality of the simulation equipment is essentially a code script problem for simulating the simulation equipment, and prompt information for optimizing the code script can be output.
According to the method, the fault rate in the preset period is calculated, when the fault rate is high, the abnormal reasons causing the high fault rate are predicted through the distribution trend of the abnormal times of operation of each simulation device, and the optimization prompt information is output according to the abnormal reasons, so that the inaccuracy of the device to be tested caused by the outside is avoided, and the accuracy of the test is improved.
Referring to fig. 4, fig. 4 is a schematic device structure of a hardware running environment related to a method according to an embodiment of the present invention.
The simulation-based equipment testing system of the embodiment of the invention can be a PC (personal computer ) or terminal equipment such as a smart phone, a tablet personal computer, an electronic book reader, a portable computer and the like.
As shown in fig. 4, the simulation-based device testing system may include: a processor 1001, such as a CPU (Central Processing Unit ), a memory 1005, a communication bus 1002, an excitation module, a detection module. Wherein the communication bus 1002 is used to enable connectivity communications between the processor 1001 and the memory 1005; the excitation module is used for outputting excitation to the equipment to be tested so as to drive the equipment to be tested to work; the detection module is used for reading various output signals output by the equipment to be detected so as to judge whether the equipment to be detected works normally. The memory 1005 may be a high-speed RAM (random access memory ) or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the simulation-based device testing system may further include a user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi (Wireless Fidelity, wireless broadband) module, and the like. The user interface may comprise a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface may further comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Those skilled in the art will appreciate that the simulation-based device testing system architecture shown in FIG. 4 is not limiting of the simulation-based device testing system and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 4, an operating system, a network communication module, and an emulation-based device test program may be included in the memory 1005 as one type of readable storage medium. An operating system is a program that manages and controls the hardware and software resources of a simulation-based device test system, supporting the execution of simulation-based device test programs, as well as other software and/or programs. The network communication module is used to enable communication between components within the memory 1005 and other hardware and software in the simulation-based device test system.
In the simulation-based device test system shown in fig. 4, a processor 1001 is configured to execute a simulation-based device test program stored in a memory 1005 to implement the steps of:
acquiring simulation configuration parameters corresponding to equipment to be tested, and determining a simulation equipment execution list of equipment types corresponding to the equipment to be tested according to the simulation configuration parameters;
according to the simulation device execution list, simulating various devices to be simulated of the device type corresponding to the device to be simulated, and generating simulation devices;
and forming the simulation equipment and the equipment to be tested into integral equipment corresponding to the equipment type, and controlling the integral equipment to run so as to test the equipment to be tested.
Further, the step of determining, according to the simulation configuration parameter, a simulation device execution list of a device type corresponding to the device to be tested includes:
reading equipment type parameters, simulation type parameters, protocol parameters and working parameters which respectively correspond to the simulation type parameters in the simulation configuration parameters;
transmitting the equipment type parameter, each simulation type parameter, and the protocol parameter and the working parameter respectively corresponding to each simulation type parameter to a preset script frame to generate a script file;
And analyzing the script file to generate a simulation device execution list corresponding to the device type of the device to be tested.
Further, the step of parsing the script file to generate a simulation device execution list corresponding to the device type to be tested includes:
performing lexical analysis and grammar analysis on the script file, and determining the overall working sequence of the equipment type corresponding to the equipment to be tested, various equipment to be simulated of the equipment type corresponding to the equipment to be tested, the working time sequence of the various equipment to be simulated and the working modes of the various equipment to be simulated;
according to the overall working sequence, device identifiers of various devices to be simulated are arranged to generate a simulation device execution list;
and adding the working time sequences of the various devices to be simulated and the working modes of the various devices to be simulated into the simulation device execution list.
Further, according to the simulation device execution list, simulating various devices to be simulated corresponding to the device type to be simulated, and generating the simulation device includes:
simulating the equipment to be simulated corresponding to each equipment identifier one by one according to the arrangement sequence of each equipment identifier in the simulation equipment execution list, and generating the simulation equipment;
And acquiring the working time sequence and the working mode of the equipment to be simulated, which are in the simulation equipment execution list and are simulated currently, and adding the working time sequence and the working mode into the simulation equipment generated by the current simulation.
Further, the step of controlling the operation of the whole device to test the device under test includes:
determining a test process flow of the whole equipment according to the whole working sequence, and controlling each simulation equipment and the equipment to be tested in the whole equipment one by one to run according to the test process flow;
taking the simulation equipment or the equipment to be tested which is currently operated in the whole equipment as current equipment, and determining the current working time sequence and the current working mode of the current equipment according to the working time sequence and the working mode of each simulation equipment generated by simulation or according to the working identification of the equipment to be tested;
and controlling the current equipment to run according to trigger events corresponding to the current working time sequence and the current working mode until each simulation equipment and the equipment to be tested in the whole equipment run to be completed in the test technological process.
Further, after the step of controlling the overall device operation to test the device under test, the processor 1001 is configured to execute a simulation-based device test program stored in the memory 1005, so as to implement the following steps:
obtaining test results generated by running the simulation equipment and the equipment to be tested in the whole equipment in the test process flow, and generating the test results into test reports according to the whole working sequence;
detecting whether an abnormal test conclusion corresponding to the equipment to be tested exists in the test report;
if the abnormal test conclusion exists, outputting prompt information of test failure;
if the abnormal test conclusion does not exist, outputting prompt information of successful test.
Further, after the step of controlling the overall device operation to test the device under test, the processor 1001 is configured to execute a simulation-based device test program stored in the memory 1005, so as to implement the following steps:
when the detection reaches a preset period, calculating the failure rate of the equipment to be tested;
judging whether the fault rate is greater than a preset threshold value, and if so, acquiring the abnormal times of operation of each simulation device in the preset period;
And predicting an abnormality reason according to the distribution trend of the abnormality times, and outputting prompt information based on the abnormality reason.
Further, before the step of obtaining the simulation configuration parameters corresponding to the device under test, the processor 1001 is configured to execute a simulation-based device test program stored in the memory 1005, so as to implement the following steps:
when a simulation test instruction is detected, judging whether a user account corresponding to the simulation test instruction has configuration simulation permission;
if the configuration simulation authority is provided, a configuration interface is started to configure simulation configuration parameters corresponding to the device to be tested based on the configuration interface.
The present invention provides a readable storage medium storing one or more programs that are further executable by one or more processors for performing the steps in the embodiments of the simulation-based device testing method described above.
It should also be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a readable storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the invention, and all equivalent structural changes made by the specification and drawings of the present invention or direct/indirect application in other related technical fields are included in the scope of the present invention.
Claims (6)
1. A simulation-based device testing method, characterized in that the simulation-based device testing method comprises the following steps:
acquiring simulation configuration parameters corresponding to equipment to be tested, and determining a simulation equipment execution list of equipment types corresponding to the equipment to be tested according to the simulation configuration parameters;
according to the simulation device execution list, simulating various devices to be simulated of the device type corresponding to the device to be simulated, and generating simulation devices;
forming the simulation equipment and the equipment to be tested into integral equipment corresponding to the equipment type, and controlling the integral equipment to run so as to test the equipment to be tested;
wherein, the step of determining the simulation device execution list corresponding to the device type to be tested according to the simulation configuration parameters includes:
reading equipment type parameters, simulation type parameters, protocol parameters and working parameters which respectively correspond to the simulation type parameters in the simulation configuration parameters;
transmitting the equipment type parameter, each simulation type parameter, and the protocol parameter and the working parameter respectively corresponding to each simulation type parameter to a preset script frame to generate a script file;
Analyzing the script file to generate a simulation equipment execution list of equipment types corresponding to the equipment to be tested;
the step of analyzing the script file and generating a simulation device execution list corresponding to the device type of the device to be tested comprises the following steps:
performing lexical analysis and grammar analysis on the script file, and determining the overall working sequence of the equipment type corresponding to the equipment to be tested, various equipment to be simulated of the equipment type corresponding to the equipment to be tested, the working time sequence of the various equipment to be simulated and the working modes of the various equipment to be simulated;
according to the overall working sequence, device identifiers of various devices to be simulated are arranged to generate a simulation device execution list;
adding the working time sequences of various types of equipment to be simulated and the working modes of various types of equipment to be simulated into the simulation equipment execution list;
the step of simulating various devices to be simulated corresponding to the device type to be simulated according to the simulation device execution list, and generating the simulation device comprises the following steps:
simulating the equipment to be simulated corresponding to each equipment identifier one by one according to the arrangement sequence of each equipment identifier in the simulation equipment execution list, and generating the simulation equipment;
Acquiring the working time sequence and the working mode of the equipment to be simulated, which are in the simulation equipment execution list and are simulated currently, and adding the working time sequence and the working mode into the simulation equipment generated by the current simulation;
wherein, the step of controlling the operation of the whole device to test the device to be tested includes:
determining a test process flow of the whole equipment according to the whole working sequence, and controlling each simulation equipment and the equipment to be tested in the whole equipment one by one to run according to the test process flow;
taking the simulation equipment or the equipment to be tested which is currently operated in the whole equipment as current equipment, and determining the current working time sequence and the current working mode of the current equipment according to the working time sequence and the working mode of each simulation equipment generated by simulation or according to the working identification of the equipment to be tested;
and controlling the current equipment to run according to trigger events corresponding to the current working time sequence and the current working mode until each simulation equipment and the equipment to be tested in the whole equipment run to be completed in the test technological process.
2. The simulation-based device testing method of claim 1, wherein the step of controlling the overall device operation to test the device under test comprises, after:
obtaining test results generated by running the simulation equipment and the equipment to be tested in the whole equipment in the test process flow, and generating the test results into test reports according to the whole working sequence;
detecting whether an abnormal test conclusion corresponding to the equipment to be tested exists in the test report;
if the abnormal test conclusion exists, outputting prompt information of test failure;
if the abnormal test conclusion does not exist, outputting prompt information of successful test.
3. The simulation-based device testing method of claim 1 or 2, wherein the step of controlling the overall device operation to test the device under test comprises, after:
when the detection reaches a preset period, calculating the failure rate of the equipment to be tested;
judging whether the fault rate is greater than a preset threshold value, and if so, acquiring the abnormal times of operation of each simulation device in the preset period;
And predicting an abnormality reason according to the distribution trend of the abnormality times, and outputting prompt information based on the abnormality reason.
4. The simulation-based device testing method of claim 1 or 2, wherein the step of acquiring simulation configuration parameters corresponding to the device under test is preceded by:
when a simulation test instruction is detected, judging whether a user account corresponding to the simulation test instruction has configuration simulation permission;
if the configuration simulation authority is provided, a configuration interface is started to configure simulation configuration parameters corresponding to the device to be tested based on the configuration interface.
5. A simulation-based device testing system, the simulation-based device testing system comprising: a memory, a processor, a communication bus, an excitation module, a detection module, and a simulation-based device test program stored on the memory;
the communication bus is used for realizing connection communication between the processor and the memory;
the excitation module is used for outputting excitation to equipment to be tested so as to drive the equipment to be tested to work;
the detection module is used for reading various output signals output by the equipment to be detected so as to judge whether the equipment to be detected works normally or not;
The processor is configured to execute the simulation-based device test program to implement the steps of the simulation-based device test method of any one of claims 1-4.
6. A readable storage medium, characterized in that it has stored thereon a simulation-based device test program, which, when executed by a processor, implements the steps of the simulation-based device test method according to any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010011118.XA CN111240973B (en) | 2020-01-06 | 2020-01-06 | Equipment testing method and system based on simulation and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010011118.XA CN111240973B (en) | 2020-01-06 | 2020-01-06 | Equipment testing method and system based on simulation and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111240973A CN111240973A (en) | 2020-06-05 |
CN111240973B true CN111240973B (en) | 2023-05-02 |
Family
ID=70874257
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010011118.XA Active CN111240973B (en) | 2020-01-06 | 2020-01-06 | Equipment testing method and system based on simulation and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111240973B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112415388A (en) * | 2020-11-20 | 2021-02-26 | 珠海格力电器股份有限公司 | Motor fault detection method and device, electronic equipment and heating and ventilation equipment |
CN112882454B (en) * | 2021-01-11 | 2022-05-24 | 阳光电源股份有限公司 | Road spectrum testing method, system and computer readable storage medium |
CN113485157B (en) * | 2021-07-01 | 2023-04-07 | 杭州加速科技有限公司 | Wafer simulation test method, device and wafer test method |
CN113578699B (en) * | 2021-09-28 | 2022-11-18 | 常州铭赛机器人科技股份有限公司 | Track path teaching method for space dispensing and dispensing system |
CN114048520B (en) * | 2022-01-11 | 2022-04-08 | 沐曦集成电路(上海)有限公司 | Detection system for cross-chip access control |
CN115756996B (en) * | 2023-01-09 | 2023-04-18 | 苏州浪潮智能科技有限公司 | Chip testing method, device and equipment and readable storage medium |
CN116089199B (en) * | 2023-03-30 | 2023-07-11 | 湖南华自信息技术有限公司 | IO port testing method and server |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106227935A (en) * | 2016-07-20 | 2016-12-14 | 浙江大学 | The system of a kind of satellite gravity anomaly integrative simulation and implementation method |
CN106324383A (en) * | 2016-07-29 | 2017-01-11 | 北京润科通用技术有限公司 | Airborne device testing method and system and simulation control testing device |
CN106597947A (en) * | 2016-12-23 | 2017-04-26 | 国网浙江宁波市鄞州区供电公司 | Substation equipment test method and system, server and tester |
CN106774223A (en) * | 2017-02-14 | 2017-05-31 | 广州秉优信息科技有限公司 | A kind of production line three-view diagram intelligent linkage method, system |
CN107678307A (en) * | 2017-11-09 | 2018-02-09 | 重庆鲁班机器人技术研究院有限公司 | Half-practicality imitation test method, apparatus and system |
CN107894762A (en) * | 2017-11-09 | 2018-04-10 | 重庆鲁班机器人技术研究院有限公司 | Practicality imitation test method, apparatus and system |
-
2020
- 2020-01-06 CN CN202010011118.XA patent/CN111240973B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106227935A (en) * | 2016-07-20 | 2016-12-14 | 浙江大学 | The system of a kind of satellite gravity anomaly integrative simulation and implementation method |
CN106324383A (en) * | 2016-07-29 | 2017-01-11 | 北京润科通用技术有限公司 | Airborne device testing method and system and simulation control testing device |
CN106597947A (en) * | 2016-12-23 | 2017-04-26 | 国网浙江宁波市鄞州区供电公司 | Substation equipment test method and system, server and tester |
CN106774223A (en) * | 2017-02-14 | 2017-05-31 | 广州秉优信息科技有限公司 | A kind of production line three-view diagram intelligent linkage method, system |
CN107678307A (en) * | 2017-11-09 | 2018-02-09 | 重庆鲁班机器人技术研究院有限公司 | Half-practicality imitation test method, apparatus and system |
CN107894762A (en) * | 2017-11-09 | 2018-04-10 | 重庆鲁班机器人技术研究院有限公司 | Practicality imitation test method, apparatus and system |
Also Published As
Publication number | Publication date |
---|---|
CN111240973A (en) | 2020-06-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111240973B (en) | Equipment testing method and system based on simulation and readable storage medium | |
CN111026645B (en) | User interface automatic test method and device, storage medium and electronic equipment | |
CN111459794A (en) | Communication network testing method, device, computer equipment and storage medium | |
CN109379251B (en) | Automatic testing method and system for GOOSE and SV communication of relay protection device process layer | |
CN109633351B (en) | Intelligent IT operation and maintenance fault positioning method, device, equipment and readable storage medium | |
CN101287266B (en) | Test system and method for mobile phone | |
CN105094783A (en) | Method and device for testing Android application stability | |
CN105302722B (en) | CTS automatic testing method and device | |
CN111242445B (en) | Method, apparatus and readable storage medium for testing products based on configuration production line | |
CN110362545A (en) | Log monitoring method, device, terminal and computer readable storage medium | |
CN110647471A (en) | Interface test case generation method, electronic device and storage medium | |
CN107102949B (en) | Application program offline testing method and tool | |
CN111090592A (en) | Automatic testing method of buried point, terminal and readable storage medium | |
CN113238930B (en) | Method and device for testing software system, terminal equipment and storage medium | |
CN112269746A (en) | Automatic testing method and related equipment | |
CN109388420A (en) | Application upgrade test method, device, computer equipment and storage medium | |
CN114371974A (en) | Buried point data checking method and electronic equipment | |
CN112596651B (en) | Acceptance method, device, equipment and storage medium for power distribution terminal debugging | |
CN117493188A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN111104331B (en) | Software management method, terminal device and computer readable storage medium | |
CN116383061A (en) | Method and related device for testing basic platform interface of substation control system | |
CN111026651A (en) | Test method, test device, storage medium and electronic equipment | |
CN116166536A (en) | Test method, test device, electronic equipment and storage medium | |
CN115934559A (en) | Testing method of intelligent form testing system | |
CN114911656A (en) | Automatic IPMI instruction testing method, single chip microcomputer and related device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |