CN111240973A - Simulation-based equipment testing method and system and readable storage medium - Google Patents

Simulation-based equipment testing method and system and readable storage medium Download PDF

Info

Publication number
CN111240973A
CN111240973A CN202010011118.XA CN202010011118A CN111240973A CN 111240973 A CN111240973 A CN 111240973A CN 202010011118 A CN202010011118 A CN 202010011118A CN 111240973 A CN111240973 A CN 111240973A
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.)
Granted
Application number
CN202010011118.XA
Other languages
Chinese (zh)
Other versions
CN111240973B (en
Inventor
李维祥
谢廷进
唐晓扬
蔡东楷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Melco Electromechanical Technology Co Ltd
Original Assignee
Guangzhou Melco Electromechanical Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Melco Electromechanical Technology Co Ltd filed Critical Guangzhou Melco Electromechanical Technology Co Ltd
Priority to CN202010011118.XA priority Critical patent/CN111240973B/en
Publication of CN111240973A publication Critical patent/CN111240973A/en
Application granted granted Critical
Publication of CN111240973B publication Critical patent/CN111240973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/261Functional testing by simulating additional hardware, e.g. fault simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing 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/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total 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 simulation-based equipment testing method, a system and a readable storage medium, wherein the method comprises the following steps: acquiring simulation configuration parameters corresponding to the equipment to be tested, and determining a simulation equipment execution list of the equipment type corresponding to the equipment to be tested according to the simulation configuration parameters; simulating various devices to be simulated of the device types corresponding to the devices to be tested according to the simulation device execution list to generate simulation devices; and (3) forming the simulation equipment and the equipment to be tested into integral equipment corresponding to the equipment type, and controlling the integral equipment to operate so as to test the equipment to be tested. According to the scheme, the device component which is not assembled in the whole device and the device to be tested form the whole device through simulation, so that the device to be tested is tested; the time for assembling the whole equipment is saved, and the problem that other elements in the whole equipment are damaged due to abnormal work 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

Simulation-based equipment testing method and system and readable storage medium
Technical Field
The invention mainly relates to the technical field of testing, in particular to a simulation-based equipment testing method and system and a readable storage medium.
Background
With the development of production technology, more and more devices are used to realize streamlined production through a production line. 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 to use after the test is correct.
Currently, for the test before the equipment is delivered to the market, the test is usually performed after all the components, modules and the like of the equipment are assembled into a complete machine. However, the whole machine assembly operation needs to consume more manpower time, and the testing efficiency is seriously influenced under the condition of more testing equipment; meanwhile, when the assembled equipment is subjected to high-power current or voltage test, the high-power current or voltage easily causes the equipment to work abnormally, so that certain components in the whole machine are damaged, the problems of the equipment in the test are difficult to locate, a large amount of time is required to search problem points, and the test efficiency is also influenced.
Therefore, the problems of low testing efficiency and easy damage to components in the whole machine in the equipment testing process are the technical problems to be solved urgently at present.
Disclosure of Invention
The invention mainly aims to provide a simulation-based equipment testing method, a simulation-based equipment testing system 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 the whole machine are easily damaged in the equipment testing process.
In order to achieve the above object, the present invention provides a simulation-based device testing method, which includes the following steps:
acquiring simulation configuration parameters corresponding to equipment to be tested, and determining a simulation equipment execution list of the equipment type corresponding to the equipment to be tested according to the simulation configuration parameters;
simulating various devices to be simulated of the device types corresponding to the devices to be tested according to the simulation device execution list to generate 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 operate so as to test the equipment to be tested.
Preferably, 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 parameters, the simulation type parameters, the protocol parameters respectively corresponding to the simulation type parameters and the working parameters to a preset script frame to generate a script file;
and analyzing the script file to generate a simulation equipment execution list of the equipment type corresponding to the equipment to be tested.
Preferably, the step of analyzing the script file to generate a simulation device execution list of the device type corresponding to the device to be tested includes:
performing lexical analysis and syntactic 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;
arranging the equipment identifications of the various equipment to be simulated according to the overall working sequence to generate a simulation equipment execution list;
and adding the working time sequence of each type of equipment to be simulated and the working mode of each type of equipment to be simulated into the simulation equipment execution list.
Preferably, the step of simulating various devices to be simulated of the device type corresponding to the device to be simulated according to the simulation device execution list to generate simulation devices 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 to generate the simulation equipment;
and acquiring the working time sequence and the working mode of the currently simulated equipment to be simulated in the simulation equipment execution list, and adding the working time sequence and the working mode into the simulation equipment generated by current simulation.
Preferably, the step of controlling the operation of the overall device to test the device under test includes:
determining a testing 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 to operate according to the testing process flow one by one;
taking the currently running simulation equipment or the equipment to be tested 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 the trigger events corresponding to the current working time sequence and the current working mode until the simulation equipment and the equipment to be tested in the whole equipment are finished running in the testing process flow.
Preferably, the step of controlling the overall device to operate so as to test the device under test includes:
obtaining test results generated by the operation of each simulation device and the device to be tested in the test process flow in the whole device, and generating each test result into a test report 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;
and if the abnormal test conclusion does not exist, outputting prompt information of successful test.
Preferably, the step of controlling the overall device to operate so as to test the device under test includes:
when the detection reaches a preset period, calculating the fault 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 operation times of each simulation device in the preset period;
and predicting an abnormal reason according to the distribution trend of each abnormal frequency, and outputting prompt information based on the abnormal reason.
Preferably, the step of obtaining the simulation configuration parameters corresponding to the device under test includes:
when a simulation test instruction is detected, judging whether a user account corresponding to the simulation test instruction has a configuration simulation authority or not;
and if the configuration simulation authority exists, starting a configuration interface to configure simulation configuration parameters corresponding to the equipment to be tested based on the configuration interface.
In addition, in order to achieve the above object, the present invention further provides a simulation-based device testing system, which includes: 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;
the processor is used for executing the simulation-based device testing program to realize the simulation-based device testing method.
In addition, to achieve the above object, the present invention also provides a readable storage medium storing one or more programs, which are executable by one or more processors, for implementing the simulation-based device testing method as described above.
In the simulation-based device testing method of this embodiment, when the simulation configuration parameters corresponding to the device to be tested are obtained and represent that there is a need for testing the device to be tested through simulation of the simulation configuration parameters, a simulation device execution list of the device type corresponding to the device to be tested is determined according to the simulation configuration parameters, and the simulation device execution list represents a device workflow of the overall device including the device to be tested; then, simulating various devices to be simulated of the device type corresponding to the device to be tested according to the simulation device execution list to generate simulation devices, namely simulating other devices lacking in the whole device where the device to be tested is located; and then, combining each simulated analog device and the device to be tested to form the whole device to run so as to test the device to be tested. Therefore, the device component which is not assembled in the whole device and the device to be tested are simulated to form the whole device, and the device to be tested is tested according to the running state of the device to be tested in the whole device; the time for assembling the whole equipment is saved, and the quick positioning of a fault point in the test is facilitated; in addition, the problem of damage to other elements in the whole equipment due to abnormal work of the equipment to be tested can be effectively avoided by simulating high-power current or voltage for testing; the safety performance of components in the whole equipment is ensured while the testing efficiency is improved.
Drawings
FIG. 1 is a schematic flow chart of a first embodiment of a simulation-based device testing method of the present invention;
FIG. 2 is a schematic flow chart diagram of a second embodiment of a simulation-based device testing method of the present invention;
FIG. 3 is a schematic flow chart diagram of a fourth embodiment of a simulation-based device testing method of the present invention;
fig. 4 is a schematic device structure diagram of a hardware operating environment related to the method according to the embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a simulation-based equipment testing method.
Referring to fig. 1, fig. 1 is a schematic flow chart of a simulation-based device testing method according to a first embodiment of the present invention. In this embodiment, the simulation-based device testing method includes:
step S10, acquiring simulation configuration parameters corresponding to the equipment to be tested, and determining a simulation equipment execution list of the equipment type corresponding to the equipment to be tested according to the simulation configuration parameters;
the simulation-based equipment testing method is applied to a simulation system, is suitable for simulating the 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 tests whether the working flow, the working mode and each function of the assembled equipment components in the whole equipment are correct. The simulation system can realize simulation test aiming at different types of equipment in a configuration mode, namely for equipment components assembled in different types of overall equipment, the simulation system configures the equipment components which are not assembled in each type and the working modes thereof, and the equipment components which are assembled in each type form the overall component to test the equipment components assembled in each type. The simulation system comprises a hardware system and a software system, wherein the hardware system comprises a test simulation board connected with the assembled equipment components, the software system is used for analyzing the script file generated by 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 are simulated through the various information, the running of the formed whole equipment is controlled, and the working state of the assembled equipment components in the whole equipment is tested by combining the hardware system and the software system.
It should be noted that the testing device is various types of products produced by the production line, and may be household appliances such as a television, a microwave oven, an induction cooker, and the like, or industrial devices such as a welding machine, a dispenser, and the like. In the present embodiment, a welding machine is preferably used as an example for description, where an assembled device component is used as a device to be tested, and an unassembled device component is used as a device to be simulated; the configured equipment to be simulated is simulated to form a complete welding machine with the equipment to be tested, and various functions of the equipment to be tested in the welding machine are tested.
Furthermore, various types of equipment parameters supporting configuration are developed for various types of welding machines in a script development mode in advance according to differences of the equipment to be tested, which need to be tested, of the various types of welding machines. The equipment parameters at least comprise simulated equipment to be simulated supported by various welding machines, and parameter information such as working modes, working sequences, triggering conditions and the like of the equipment to be simulated, so that the 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 tested belongs to simulate the equipment, and the equipment to be tested in various welding machines is simulated by running the equipment according to the configured parameter information.
Furthermore, the simulation system includes a display device such as a liquid crystal display or a Light Emitting Diode (LED) display for displaying the device parameters configured for each type of welding machine. And the user selects the equipment to be simulated which is not assembled in the welding machine of the type from the displayed equipment parameters according to the welding machine type to which the equipment to be tested belongs, and then initiates a simulation configuration instruction so as to configure the equipment to be simulated for simulation. The selected content can select the working mode and the working sequence of the equipment to be simulated and the working flow of a welding machine where the equipment to be tested is located besides the equipment to be simulated, so that the welding machine composed of the equipment to be tested and the simulated simulation equipment runs 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 which is suitable for the currently tested equipment to be tested and belongs to are selected from the equipment to be simulated. And sending the selected welding machine work flow, the equipment to be simulated, the work mode and the work sequence of each equipment to be simulated as simulation configuration parameters and simulation configuration instructions to a simulation system together so as to configure each equipment to be simulated for simulation and test the equipment to be tested.
Further, in order to ensure the safety of the configuration simulation and test, a mechanism for performing authentication before selecting the configuration is provided. 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 a configuration simulation authority or not;
and b, if the configuration simulation authority exists, starting a configuration interface to configure simulation configuration parameters corresponding to the equipment to be tested based on the configuration interface.
Further, when the simulation test of the equipment is required, the user performs login operation on a display device of the simulation system through the registered account, and initiates a simulation test instruction after the login is successful. After the control terminal detects 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 which is preset for representing that the user account has the configuration simulation authority or not, and if so, indicates that the user account has the configuration simulation authority, thereby starting a 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 to display the equipment parameters of each equipment to be simulated of each type of welding machine; the simulation configuration parameters are converted through script editing software, and a simulation equipment execution list representing the work flow among equipment components in the welding machine where the equipment to be tested is located is obtained.
Otherwise, if the permission identifier is not consistent with the preset configuration identifier, it indicates that the user account does not have the configuration simulation permission, and at this time, the display interface of the display device only stays in the interface after login, and the configuration interface is not started. The virtual key for applying the configuration simulation authority is arranged in the logged interface, and for the user who does not have the configuration simulation authority but does need to configure simulation, the virtual key is triggered to apply the temporary configuration simulation authority. The method comprises the steps that a simulation authority is configured and butted with a manager with authority configuration, after a user triggers a virtual key for configuring the simulation authority application, the user is prompted to upload a certificate, after the certificate is received, the certificate is transmitted to a mailbox or an instant messaging software account of the manager with the authority configuration, so that the manager with the authority configuration can allocate temporary configuration simulation authority to the user according to the certificate, the user can configure the device to be simulated for simulation, the device to be tested is tested, and the configuration simulation is met while the safety is ensured.
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 frequency or date of use is exceeded, the device to be simulated cannot be configured for simulation. Meanwhile, a blacklist can be set, after the user uploads the certificate, the user information is read from the certificate, and whether the user information exists in the blacklist or not is judged. If the current state exists in the blacklist, directly refusing the application of configuring the simulation authority; if the certificate does not exist in the blacklist, the certificate is transmitted to a mailbox of a manager with authority configuration or an instant messaging software account so as to further ensure the safety of configuration simulation.
Furthermore, after the user has the configuration simulation authority and sends the simulation configuration instruction to the simulation system on the configuration interface, the simulation system receives the simulation configuration instruction and reads the simulation configuration parameters which are carried in the simulation configuration instruction and represent the configuration required by the equipment to be tested, so that the workflow of the welding machine where the equipment to be tested is located and each equipment to be simulated can be conveniently configured according to the simulation configuration parameters, and the configuration simulation requirements of the user can be met.
Understandably, the simulation configuration parameters comprise parameters for representing the work flow of the welding machine where the equipment to be tested is located, and the parameters of the work flow are essentially parameters for describing the work sequence of each equipment assembly in the welding machine and represent the test process flow of the operation of the welding machine. Therefore, in order to ensure that all equipment components in the welding machine obtained through simulation can run in the required working sequence, after the simulation configuration parameters are read, all equipment to be simulated can be arranged according to the working sequence of the equipment to be simulated in the welding machine according to the parameters representing the working process, and a simulation equipment execution list of the equipment type corresponding to the equipment to be tested is generated. The device type is used for representing the whole device type to which the device to be tested belongs, such as a welding machine belonging to a specific model, and the generated simulation device execution list represents each device component in the welding machine of the type and the operation workflow thereof.
It should be noted that the simulation device execution list is substantially a data structure, and 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 converts the script file into the data structure of the simulation execution list. And configuring the equipment to be simulated for simulation through the simulation execution list, so that the welding machine where the equipment to be tested is located runs according to the configured work flow, and all equipment components in the welding machine run according to the respective configured work sequence and work mode, so as to test the working state of the equipment to be tested in the welding machine.
Step S20, according to the simulation equipment execution list, simulating various equipment to be simulated of the equipment type corresponding to the equipment to be tested to generate simulation equipment;
further, after a simulation device execution list representing the to-be-simulated devices to be simulated and the working parameters thereof is generated, various to-be-simulated devices corresponding to the to-be-simulated devices can be simulated according to the simulation device execution list, simulation devices of various types capable of being combined with the to-be-simulated devices into an integral device are generated, and the working sequence and the working mode of the simulated simulation devices of various types are configured according to the working parameters of the to-be-simulated devices in the simulation device execution list, so that the to-be-simulated devices can operate according to the mode required by the integral device of the device type to which the to-be-simulated devices belong, and the operating state of the to-be-simulated devices in the integral device is tested.
Step S30, forming the simulation devices and the device to be tested into an overall device corresponding to the device type, and controlling the overall device to operate so as to test the device to be tested.
Furthermore, the various simulated analog devices and the device to be tested form an integral device, and the integral device is the device of the device type to which the device to be tested belongs. Then, controlling various analog devices and devices to be tested in the welding machine to operate according to the work flow 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 work flow set by the device to be tested; meanwhile, for various analog devices, the simulation equipment runs in the working mode and the working sequence set by the simulation equipment execution list, and for the equipment to be tested, the simulation equipment runs in the working mode and the working sequence of the equipment to be tested so as to test the working state of the equipment to be tested in the whole equipment.
Then, if the requirement for testing some assembled equipment upgraded by other types of welding machines or the same type of welding machine exists, only the simulation configuration instruction needs to be initiated again, and the simulation equipment execution list of the equipment type to which the new equipment to be tested belongs is determined according to the simulation configuration parameters in the simulation configuration instruction, so that the new simulation equipment can be simulated; and then, the new various types of simulation equipment and the equipment to be tested form new integral equipment to operate, so that the equipment to be tested of other types of welding machines or the equipment to be tested after the same type of welding machine is upgraded is tested, and different testing requirements of different types of welding machines are met through configuration simulation. Therefore, when the equipment to be tested is changed, the test can be realized only by reconfiguring the simulation analog equipment according to the requirement of the new equipment to be tested. The software system and the hardware system in the simulation system do not need to be changed, and the test of the new device to be tested can be completed only by generating a new text script file according to the requirement of the new device to be tested, so that the time cost of the test is greatly saved, and the test efficiency is improved.
In the simulation-based device testing method of this embodiment, when the simulation configuration parameters corresponding to the device to be tested are obtained and represent that there is a need for testing the device to be tested through simulation of the simulation configuration parameters, a simulation device execution list of the device type corresponding to the device to be tested is determined according to the simulation configuration parameters, and the simulation device execution list represents a device workflow of the overall device including the device to be tested; then, simulating various devices to be simulated of the device type corresponding to the device to be tested according to the simulation device execution list to generate simulation devices, namely simulating other devices lacking in the whole device where the device to be tested is located; and then, combining each simulated analog device and the device to be tested to form the whole device to run so as to test the device to be tested. Therefore, the device component which is not assembled in the whole device and the device to be tested are simulated to form the whole device, and the device to be tested is tested according to the running state of the device to be tested in the whole device; the time for assembling the whole equipment is saved, and the quick positioning of a fault point in the test is facilitated; in addition, the problem of damage to other elements in the whole equipment due to abnormal work of the equipment to be tested can be effectively avoided by simulating high-power current or voltage for testing; the safety performance of components in the whole equipment is ensured while the testing efficiency is improved.
Further, referring to fig. 2, a second embodiment of the simulation-based device testing method according to the present invention is provided based on the first embodiment of the simulation-based device testing method according to the present invention, and in the second embodiment, the step of determining the simulation device execution list of the device type corresponding to the device under test according to the simulation configuration parameters includes:
step S11, reading the device type parameter, the simulation type parameter, the protocol parameter corresponding to each simulation type parameter and the working parameter in the simulation configuration parameter;
step S12, transmitting the equipment type parameters, each simulation type parameter, and the protocol parameters and the working parameters corresponding to each simulation type parameter to a preset script frame to generate a script file;
and step S13, analyzing the script file to generate a simulation equipment execution list of the equipment type corresponding to the equipment to be tested.
In the process of determining the simulation device execution list according to the simulation configuration parameters, the simulation configuration parameters are first converted into the script file, and then the script file is analyzed, so that the simulation device execution list is obtained. Specifically, a preset script frame for generating a script file is preset, and codes representing the device type corresponding to the device to be tested, the device to be simulated which needs to be simulated, the working protocol thereof and the working parameters thereof in the preset script frame are expressed by code variables. When the requirement for generating the simulation equipment execution list exists, calling a preset script frame, and reading the equipment type corresponding to the equipment to be tested, which is represented in the simulation configuration parameters, as an equipment type parameter in the simulation configuration parameters; and simultaneously, taking the type of the device to be simulated, which is absent in the device type corresponding to the characterization device to be tested and needs to be simulated, as a simulation type parameter, and reading a protocol parameter corresponding to the simulation type parameter and representing a communication transmission protocol supported between the devices to be simulated and a working parameter representing the working sequence and the working mode of the devices to be simulated. And respectively transmitting the read equipment type parameters, the read simulation type parameters, the corresponding protocol parameters and the corresponding working parameters to a preset script frame, and replacing respective code variables to generate a script file. And analyzing the generated script file to obtain a simulation equipment execution list for simulating the equipment to be simulated which is lacked in the equipment type of the equipment to be tested and representing the operation logic of the whole equipment of the equipment type.
In a specific embodiment, a code variable Mi, Ni, Wi and Ki are used for respectively representing an equipment type parameter, a simulation type parameter, a protocol parameter and a working parameter which respectively correspond to the simulation type parameter in a preset script frame; if the device type parameter and the simulation type parameter are read as f1 and f2 respectively, and the corresponding protocol parameter and the corresponding operating parameter are f3 and f4 respectively. After the preset script frame is called, f1, f2, f3 and f4 are respectively transmitted into the preset script frame, so that Mi, Ni, Wi and Ki are respectively f1, f2, f3 and f 4. After the parameters related to each device to be tested in the simulation configuration parameters are replaced to the preset script frame, a script file can be generated. And then, by analyzing the script file, a simulation equipment execution list which is used for simulating and representing the operation logic and corresponds to the equipment type of the equipment to be tested can be obtained.
The step of analyzing the script file and generating a simulation equipment execution list of the equipment type corresponding to the equipment to be tested comprises the following steps:
step S131, performing lexical analysis and syntactic 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, arranging the equipment identifications of the various equipment to be simulated according to the overall working sequence to generate a simulation equipment execution list;
step S133, adding the working timing of each type of device to be simulated and the working mode of each type of device to be simulated to the simulation device execution list.
And further, calling a preset lexical analyzer to perform lexical analysis on the script file. The lexical analyzer is generated by combining large data script files randomly collected on a network for pre-training on the basis of a human language word set. During lexical analysis, word segmentation processing is carried out on the script file to obtain a plurality of character strings, and labels are added to data, keywords, logic structures and the like corresponding to the character strings.
Furthermore, a preset grammar analyzer is called to analyze the grammar of the character string of the script file after word segmentation and label addition. And during syntactic analysis, judging whether the syntactic structure of the script file is correct or not, if so, generating a tree structure corresponding to the logic structure of each keyword according to syntactic description by using each label added by the lexical analyzer. The tree nodes of the tree structure contain 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 testing process flow of the operation of the overall equipment or the operation logic of the overall equipment; the simulation type parameters are used for representing the equipment to be simulated which is lacking in the whole equipment, the protocol parameters and the working parameters which are respectively corresponding to the simulation type parameters represent the working modes of various equipment to be simulated, and the parameters which represent the working sequence of the equipment to be simulated in the working parameters of the simulation type parameters are determined as the working time sequence of the various equipment to be simulated.
Understandably, various devices to be simulated are distinguished by device identifications, after the tree-shaped structure is traversed to obtain the overall working sequence of the overall device, the devices to be simulated, the working time sequence and the working mode of the devices to be simulated, the device identifications for characterizing the various devices to be simulated are arranged according to the testing process flow represented by the overall working sequence to generate a simulation device execution list, and the simulation configuration parameters are converted into the data structure of the simulation device execution list.
Furthermore, in order to ensure that each device to be simulated in the simulation device execution list works in the working mode and the working timing sequence set by the user, after the simulation device execution list is generated, information representing the working timing sequence and the working mode set by the user for each module to be simulated is added into the simulation device execution list, so that when the simulation system controls a certain simulation device simulated in the whole device to run, the working timing sequence and the working mode of the simulation system are determined according to the information representing the working timing sequence and the working mode in the simulation device execution list, and the simulation system is started in the working timing sequence and the working mode. And then, simulating the missing equipment to be simulated in the whole equipment through the simulation equipment execution list to generate simulation equipment, and testing the running state of the module to be tested in the whole equipment according to the interaction condition between the module to be tested and the started simulation equipment. Specifically, the step of simulating various devices to be simulated of the device type corresponding to the device to be simulated according to the simulation device execution list, and generating the simulation device includes:
step S21, according to the arrangement order of the device identifiers in the simulation device execution list, simulating the device to be simulated corresponding to the device identifiers one by one to generate the simulation device;
step S22, obtaining the working timing and working mode of the currently simulated device to be simulated in the simulation device execution list, and adding the working timing and working mode to the simulation device generated by the current simulation.
Furthermore, after generating the simulation device execution list to be simulated for the device type to which the device to be tested belongs, 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 represented by the overall working sequence, so that the simulation equipment which is generated one by one according to the arrangement sequence is the operation sequence of the simulation modules in the test process flow, and the overall equipment of the equipment type to which the equipment to be tested belongs is controlled to operate according to the test process flow according to the generation sequence of the simulation equipment.
In the process of simulating each device to be simulated one by one, the working time sequence and the working mode of the current simulated device to be simulated are obtained from the simulation device execution list, and the obtained working time sequence and the working mode are added into the simulation device generated by the current simulation, so that the working mode required by the device type of the device to be tested on the current simulated simulation device is represented. After the current simulated equipment to be simulated is simulated, the simulation equipment is generated, and a working time sequence and a working mode are added, the equipment to be simulated represented by the module identifiers arranged in the next sequence is searched from the simulation equipment execution list for simulation until the equipment to be simulated represented by each module identifier in the simulation equipment execution list generates the simulation equipment through simulation, and the working time sequence and the working mode are added to each simulation equipment, so that the working mode of each simulation equipment in the whole equipment comprising the equipment to be simulated is determined.
In the embodiment, configured simulation configuration parameters including device type parameters, simulation type parameters, protocol parameters thereof and working parameters are firstly generated into script files, so that the script files are generated to represent the test process flow of the device type of the device to be tested, the device type of the simulation device to be simulated, the working modes of various simulation devices and the like; converting the script file into a module execution list, and simulating and generating all simulation equipment and equipment to be tested to form integral equipment through the module execution list so as to test the equipment to be tested; as long as equipment to be tested is assembled, the test can be carried out in a simulation mode, and the test efficiency is improved.
Further, a third embodiment of the simulation-based device testing method according to the present invention is provided based on the second embodiment of the simulation-based device testing method according to the present invention, and in the third embodiment, the step of controlling the operation of the whole device to test the device to be tested includes:
step S31, determining the testing 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 to operate according to the testing process flow one by one;
step S32, using the currently running analog device or the device to be tested in the whole device as a current device, and determining a current working timing sequence and a current working mode of the current device according to a working timing sequence and a working mode of each analog device generated by simulation or according to a working identifier of the device to be tested;
step S33, controlling the current device to operate according to the trigger events corresponding to the current working timing sequence and the current working mode until the operation of each of the simulation devices and the device to be tested in the whole device is completed by the test process flow.
Furthermore, the simulation system controls the operation of the whole device generated by simulation so as to test the device to be tested according to the operation state of the device to be tested in the whole device, and the whole working sequence represents the test process flow of the operation of the whole device, so that the test process flow of the whole device can be determined according to the whole working sequence, and then each simulation device and the device to be tested which form the whole device are controlled to operate according to the test process flow. If the overall working sequence of the overall equipment comprising the equipment to be tested p1 and the analog equipment p2 and p3 is p2, p3 and p1, the test process flow comprises the steps of firstly controlling p2 to operate, then controlling p3 to operate, and finally controlling p1 to operate, and the operation state of the equipment to be tested in the overall equipment is tested through the operation sequence.
Understandably, the simulation equipment and the equipment to be tested which form the whole equipment have respective working modes, namely respective working time sequence and working mode, so that when the simulation equipment or the equipment to be tested of the whole equipment is controlled to run, the running working mode needs to be determined firstly. Specifically, the currently running analog device or the device to be tested in the whole device is taken as the current device, and if the currently running device is the analog device, that is, the current device is the analog 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 analog device in the simulation process. If the currently running equipment is equipment to be tested, namely the currently running 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 identifier which is set in the production process of the equipment to be tested and represents the working time sequence and the working mode of the equipment to be tested.
Further, after the current working time sequence and the current working mode representing the running mode of the current equipment are determined, the current equipment can be controlled to run at the current working time sequence and the current working mode. The current equipment has a life cycle in the running process, namely a time period from starting to stopping working; in different time periods of a life cycle from starting to stopping working, the current equipment operates in different working modes, namely a working mode. For example, for equipment for welding circular arcs, the current is generally small in the initial stage of welding, so that the problem of difficult fusion exists, the current is gradually increased, the arc is required to be closed in the initial stage of welding to the stage of ending the welding, and the current is required to be reduced in order to avoid over-welding. Thus, at least three periods, an initial phase, a stable phase and a final phase, are included in the life cycle of the device, and the different phases are distinguished by the current magnitude. 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 determined, if the trigger event is triggered, the current equipment is controlled to run 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 current equipment is operated, operating the next simulation equipment or equipment to be tested 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 that a single analog device or a 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 that constitute the whole device may also be triggered by events. If a welding start event E0 is generated in the simulation system, the whole device detects an event E0, controls the simulation device D1 generated by configuration simulation according to the first device node in the simulation device execution list to operate, generates an event E1 after the operation is completed, and triggers the next simulation device to operate by the same event E1, so that the triggering event is continuously generated until all the simulation devices and the devices to be tested in the whole device operate.
Understandably, after the operation of each simulation device and the device to be tested in the whole device is completed 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 operation of the whole device to test the device to be tested includes:
step S34, obtaining test results generated by the operation of each simulation device and the device to be tested in the test process flow in the whole device, and generating each test result as a test report according to the whole work 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.
Furthermore, each simulation device and the 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 item of test data, preset standard data are set in advance for each piece of simulation equipment and equipment to be tested. In the process of testing according to the testing process flow, once the test data is detected, the preset standard data corresponding to the currently running current equipment is searched, the test data and the preset standard data are compared, whether the test data and the preset standard data are consistent or not is judged, and the test result of the equipment to be tested in the running process of the current equipment is generated according to the consistency of the test data and the preset standard data. When the test data is determined to be inconsistent with the preset standard data through comparison, the test data is wrong, and the generated test result is 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, the consistency between the test data and the preset standard data is set with different judgment standards according to different test functions. The judgment standard has uniqueness on the type-judging result; only when the test data and the preset standard data are identical, the test data and the preset standard data are judged to be identical. If the connectivity test is carried out, the preset standard data are connected, and the test data are also connected, so that the two data can be judged to be consistent. For the result of the numerical value type, the judgment standard has interval floatability; when the test data is not completely the same as 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 consistent. For example, in the voltage test, the preset standard data is 220V, and the difference between the test data and the preset standard data is within plus or minus 10, and the two data can still be considered to be consistent.
Furthermore, each simulation device and the device to be tested in the whole device are numerous, and each simulation device and the device to be tested operate according to the test process flow to generate test data, and the test data is compared with the corresponding preset standard data to generate respective test results. After the whole equipment finishes running according to the test process flow and generates each test result, the test results 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 running state of the equipment to be tested in the whole equipment is generated.
Furthermore, each test result is presented in the test report, and the generated test result of test failure exists in the form of an abnormal test conclusion when the test data is inconsistent with the preset standard data; and if the test data are consistent with the preset standard data, the generated test result with successful test exists in the form of a normal test conclusion in the test report. In order to determine the integrity conclusion of the device under test, the test report is tested to determine whether an abnormality test conclusion exists therein. If the abnormity test conclusion exists, the performance of the equipment to be tested is proved to have problems when the whole equipment runs; and adding the performance corresponding to the generated abnormality test conclusion into the prompt information of the 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 the anomaly test conclusion does not exist, the performance of the equipment to be tested is good when the whole equipment runs, and no problem exists; and after the prompt information of successful test is output, the test of the equipment to be tested is completed.
In 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 testing process flow, so that the 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 into 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 in a problem, the cause of the problem can be quickly determined through each abnormal test conclusion, and therefore the problem point of the device to be tested can be quickly 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, and in the fourth embodiment, the step of controlling the overall device to operate so as to test the device under test includes:
step S40, when the detection reaches a preset period, calculating the fault rate of the device to be tested;
step S50, judging whether the failure rate is greater than a preset threshold, and if so, acquiring the abnormal operation times of each simulation device in the preset period;
and step S60, predicting the abnormal reasons according to the distribution trend of each abnormal frequency, and outputting prompt information based on the abnormal reasons.
Understandably, with the use of the simulation system, both a hardware system and a software system may have a fault, and the present embodiment is provided with a mechanism for predicting the possibility of the fault of the simulation system through the fault rate of the device to be tested. Specifically, a preset period, such as one year or half year, is set in advance according to requirements; and calculating the fault rate of the device to be tested in the preset period every time the detection reaches the preset period. Counting the total number of the tested devices 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 greater than the preset threshold value is judged. If the fault rate is greater than the preset threshold value, the fault rate is higher; otherwise, if the failure rate is not greater than the preset threshold, it is indicated that the failure rate is low. When the failure rate is determined to be high through comparison, which indicates that the device under test fails in the test for a high number of times, the failure may be caused by the device under test itself on one hand, and may be caused by a simulation system for simulation test on the other hand. In order to determine the failure reason, after the failure rate is judged to be larger than the preset threshold value, the failure times of the operation of each simulation device in the preset period are 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 the failure test results of the simulation devices in the preset period, namely the abnormal times of the operation of the simulation modules in the preset period.
Understandably, the failure rate caused by the problems of the devices to be tested is high, the devices to be tested do not have regularity in the operation process of the simulation devices, one device to be tested may have abnormality in the operation process of a certain simulation device to cause test failure, the other device to be tested has abnormality in the operation process of the other simulation device to cause test failure, although the failure rate is raised on the whole, the abnormal times in the operation process of each simulation device are different, and the test failure condition is relatively dispersed in each simulation device. For the problem of the simulation system for the simulation test, the simulation equipment has regularity in the operation process, a plurality of pieces of equipment to be tested fail in the operation process of the same simulation equipment, the failure rate is increased on the whole, the abnormal times of the simulation equipment are high, and the test failure condition is relatively concentrated on the simulation equipment. Therefore, after the abnormal times of the operation of each simulation device are obtained, the simulation devices which are possibly abnormal in each simulation device can be presumed according to the distribution trend of the abnormal times. Namely, if the distribution trend is relatively dispersed, the reason of the equipment to be tested is predicted, and prompt information for checking and optimizing the production flow of the equipment to be tested can be output; and if the distribution trend is relatively concentrated, predicting the concentrated simulation equipment as abnormal simulation equipment. The abnormality of the simulation equipment is essentially a code script problem simulating the simulation equipment, and prompt information for optimizing the code script can be output.
The method calculates the fault rate in the preset period, predicts the abnormal reasons causing the high fault rate through the distribution trend of the abnormal times of the operation of each simulation device when the fault rate is high, and outputs the optimization prompt information according to the abnormal reasons, so as to avoid the inaccuracy of the test of the device to be tested caused by the outside and improve the accuracy of the test.
Referring to fig. 4, fig. 4 is a schematic device structure diagram of a hardware operating environment related to the method according to the embodiment of the present invention.
The device testing system based on simulation in the embodiment of the invention can be a Personal Computer (PC), and can also be terminal devices such as a smart phone, a tablet computer, an electronic book reader and a portable computer.
As shown in fig. 4, the simulation-based device test system may include: a processor 1001, such as a CPU (central processing Unit), a memory 1005, a communication bus 1002, an excitation module, and a detection module. The communication bus 1002 is used for realizing connection and communication 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 Random Access Memory (RAM) or a non-volatile memory (disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
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 broadband) module, and the like. The user interface may comprise a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may also 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 does not constitute a limitation of simulation-based device testing systems, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 4, a memory 1005, which is a kind of readable storage medium, may include therein an operating system, a network communication module, and a simulation-based device test program. An operating system is a program that manages and controls the hardware and software resources of the simulation-based device test system, supporting the operation of the simulation-based device test program as well as other software and/or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as with other hardware and software in the simulation-based device test system.
In the simulation-based device test system shown in fig. 4, the processor 1001 is configured to execute a simulation-based device test program stored in the memory 1005 to implement the following steps:
acquiring simulation configuration parameters corresponding to equipment to be tested, and determining a simulation equipment execution list of the equipment type corresponding to the equipment to be tested according to the simulation configuration parameters;
simulating various devices to be simulated of the device types corresponding to the devices to be tested according to the simulation device execution list to generate 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 operate so as to test the equipment to be tested.
Further, the step of determining, according to the simulation configuration parameters, 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 parameters, the simulation type parameters, the protocol parameters respectively corresponding to the simulation type parameters and the working parameters to a preset script frame to generate a script file;
and analyzing the script file to generate a simulation equipment execution list of the equipment type corresponding to the equipment to be tested.
Further, the step of analyzing the script file to generate a simulation device execution list of the device type corresponding to the device to be tested includes:
performing lexical analysis and syntactic 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;
arranging the equipment identifications of the various equipment to be simulated according to the overall working sequence to generate a simulation equipment execution list;
and adding the working time sequence of each type of equipment to be simulated and the working mode of each type of equipment to be simulated into the simulation equipment execution list.
Further, the step of simulating various devices to be simulated of the device type corresponding to the device to be simulated according to the simulation device execution list, 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 to generate the simulation equipment;
and acquiring the working time sequence and the working mode of the currently simulated equipment to be simulated in the simulation equipment execution list, and adding the working time sequence and the working mode into the simulation equipment generated by current simulation.
Further, the step of controlling the operation of the overall device to test the device under test includes:
determining a testing 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 to operate according to the testing process flow one by one;
taking the currently running simulation equipment or the equipment to be tested 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 the trigger events corresponding to the current working time sequence and the current working mode until the simulation equipment and the equipment to be tested in the whole equipment are finished running in the testing process flow.
Further, after the step of controlling the overall device to operate to test the device under test, the processor 1001 is configured to execute the simulation-based device test program stored in the memory 1005 to implement the following steps:
obtaining test results generated by the operation of each simulation device and the device to be tested in the test process flow in the whole device, and generating each test result into a test report 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;
and if the abnormal test conclusion does not exist, outputting prompt information of successful test.
Further, after the step of controlling the overall device to operate to test the device under test, the processor 1001 is configured to execute the simulation-based device test program stored in the memory 1005 to implement the following steps:
when the detection reaches a preset period, calculating the fault 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 operation times of each simulation device in the preset period;
and predicting an abnormal reason according to the distribution trend of each abnormal frequency, and outputting prompt information based on the abnormal reason.
Further, before the step of obtaining the simulation configuration parameters corresponding to the device under test, the processor 1001 is configured to execute the 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 a configuration simulation authority or not;
and if the configuration simulation authority exists, starting a configuration interface to configure simulation configuration parameters corresponding to the equipment to be tested based on the configuration interface.
The present invention provides a readable storage medium storing one or more programs which are also executable by one or more processors for implementing 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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a readable storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A simulation-based device testing method is characterized by comprising the following steps:
acquiring simulation configuration parameters corresponding to equipment to be tested, and determining a simulation equipment execution list of the equipment type corresponding to the equipment to be tested according to the simulation configuration parameters;
simulating various devices to be simulated of the device types corresponding to the devices to be tested according to the simulation device execution list to generate 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 operate so as to test the equipment to be tested.
2. The simulation-based device testing method of claim 1, wherein the step of determining, according to the simulation configuration parameters, a simulation device execution list of the device type corresponding to the device under test comprises:
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 parameters, the simulation type parameters, the protocol parameters respectively corresponding to the simulation type parameters and the working parameters to a preset script frame to generate a script file;
and analyzing the script file to generate a simulation equipment execution list of the equipment type corresponding to the equipment to be tested.
3. The simulation-based device testing method of claim 2, wherein the step of parsing the script file to generate a simulation device execution list of device types corresponding to the device under test comprises:
performing lexical analysis and syntactic 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;
arranging the equipment identifications of the various equipment to be simulated according to the overall working sequence to generate a simulation equipment execution list;
and adding the working time sequence of each type of equipment to be simulated and the working mode of each type of equipment to be simulated into the simulation equipment execution list.
4. The simulation-based device testing method of claim 3, wherein the step of simulating various devices to be simulated of the device type corresponding to the device to be tested according to the simulation device execution list to generate simulation devices comprises:
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 to generate the simulation equipment;
and acquiring the working time sequence and the working mode of the currently simulated equipment to be simulated in the simulation equipment execution list, and adding the working time sequence and the working mode into the simulation equipment generated by current simulation.
5. The simulation-based device testing method of claim 4, wherein the step of controlling the operation of the overall device to test the device under test comprises:
determining a testing 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 to operate according to the testing process flow one by one;
taking the currently running simulation equipment or the equipment to be tested 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 the trigger events corresponding to the current working time sequence and the current working mode until the simulation equipment and the equipment to be tested in the whole equipment are finished running in the testing process flow.
6. The simulation-based device testing method of claim 5, wherein the step of controlling the overall device operation to test the device under test is followed by:
obtaining test results generated by the operation of each simulation device and the device to be tested in the test process flow in the whole device, and generating each test result into a test report 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;
and if the abnormal test conclusion does not exist, outputting prompt information of successful test.
7. The simulation-based device testing method of any of claims 1-6, wherein the step of controlling the overall device operation to test the device under test is followed by:
when the detection reaches a preset period, calculating the fault 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 operation times of each simulation device in the preset period;
and predicting an abnormal reason according to the distribution trend of each abnormal frequency, and outputting prompt information based on the abnormal reason.
8. The simulation-based device testing method of any of claims 1-6, wherein the step of obtaining simulation configuration parameters corresponding to the device under test previously comprises:
when a simulation test instruction is detected, judging whether a user account corresponding to the simulation test instruction has a configuration simulation authority or not;
and if the configuration simulation authority exists, starting a configuration interface to configure simulation configuration parameters corresponding to the equipment to be tested based on the configuration interface.
9. 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;
the processor is configured to execute the simulation based device testing program to implement the steps of the simulation based device testing method according to any of claims 1-8.
10. A readable storage medium having stored thereon a simulation-based device testing program which, when executed by a processor, performs the steps of the simulation-based device testing method of any one of claims 1-8.
CN202010011118.XA 2020-01-06 2020-01-06 Equipment testing method and system based on simulation and readable storage medium Active CN111240973B (en)

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 true CN111240973A (en) 2020-06-05
CN111240973B 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)

Cited By (7)

* Cited by examiner, † Cited by third party
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
CN112882454A (en) * 2021-01-11 2021-06-01 阳光电源股份有限公司 Road spectrum testing method, system and computer readable storage medium
CN113485157A (en) * 2021-07-01 2021-10-08 杭州加速科技有限公司 Wafer simulation test method and device and wafer test method
CN113578699A (en) * 2021-09-28 2021-11-02 常州铭赛机器人科技股份有限公司 Track path teaching method for space dispensing and dispensing system
CN114048520A (en) * 2022-01-11 2022-02-15 沐曦集成电路(上海)有限公司 Detection system for cross-chip access control
CN115756996A (en) * 2023-01-09 2023-03-07 苏州浪潮智能科技有限公司 Chip testing method, device and equipment and readable storage medium
CN116089199A (en) * 2023-03-30 2023-05-09 湖南华自信息技术有限公司 IO port testing method and server

Citations (6)

* Cited by examiner, † Cited by third party
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
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

Cited By (10)

* Cited by examiner, † Cited by third party
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
CN112882454A (en) * 2021-01-11 2021-06-01 阳光电源股份有限公司 Road spectrum testing method, system and computer readable storage medium
CN113485157A (en) * 2021-07-01 2021-10-08 杭州加速科技有限公司 Wafer simulation test method and device and wafer test method
CN113485157B (en) * 2021-07-01 2023-04-07 杭州加速科技有限公司 Wafer simulation test method, device and wafer test method
CN113578699A (en) * 2021-09-28 2021-11-02 常州铭赛机器人科技股份有限公司 Track path teaching method for space dispensing and dispensing system
CN114048520A (en) * 2022-01-11 2022-02-15 沐曦集成电路(上海)有限公司 Detection system for cross-chip access control
CN114048520B (en) * 2022-01-11 2022-04-08 沐曦集成电路(上海)有限公司 Detection system for cross-chip access control
CN115756996A (en) * 2023-01-09 2023-03-07 苏州浪潮智能科技有限公司 Chip testing method, device and equipment and readable storage medium
CN116089199A (en) * 2023-03-30 2023-05-09 湖南华自信息技术有限公司 IO port testing method and server
CN116089199B (en) * 2023-03-30 2023-07-11 湖南华自信息技术有限公司 IO port testing method and server

Also Published As

Publication number Publication date
CN111240973B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN111240973B (en) Equipment testing method and system based on simulation and readable storage medium
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
CN105094783B (en) method and device for testing stability of android application
CN109726100A (en) Application performance test method, apparatus, equipment and computer readable 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
CN111104315A (en) Test script generation method and device and computer readable storage medium
CN110493812B (en) Distribution network test processing method, device and system, processor and master control equipment
CN107102949B (en) Application program offline testing method and tool
CN111090592A (en) Automatic testing method of buried point, terminal and readable storage medium
CN111181805B (en) Micro-service test baffle generation method and system based on test case
CN106407054B (en) BMC automatic test system and method
CN112115038A (en) Application testing method and device and storage medium
CN112269746A (en) Automatic testing method and related equipment
CN111242445B (en) Method, apparatus and readable storage medium for testing products based on configuration production line
CN114371974A (en) Buried point data checking method and electronic equipment
CN111104331B (en) Software management method, terminal device and computer readable storage medium
CN113495210A (en) Low-voltage switch sampling inspection control method, device, equipment and storage medium
CN105808422A (en) Network-based software test method, client and to-be-tested equipment
CN109783368A (en) Trapezoidal pattern programming software testing system and method
CN114676066A (en) Security testing method and device for target application, electronic equipment and storage medium
KR20150038983A (en) Method and apparatus for verifying application by using object extracting
CN115470095A (en) Test method, test system, electronic equipment and computer storage medium
CN112765041A (en) Game automatic testing method and device and electronic equipment
CN111026651A (en) Test method, test device, storage medium and electronic equipment

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