CN115967638A - Equipment simulation system, method, equipment and storage medium - Google Patents
Equipment simulation system, method, equipment and storage medium Download PDFInfo
- Publication number
- CN115967638A CN115967638A CN202310082024.5A CN202310082024A CN115967638A CN 115967638 A CN115967638 A CN 115967638A CN 202310082024 A CN202310082024 A CN 202310082024A CN 115967638 A CN115967638 A CN 115967638A
- Authority
- CN
- China
- Prior art keywords
- data
- simulation
- equipment
- data generator
- generator
- 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.)
- Pending
Links
- 238000004088 simulation Methods 0.000 title claims abstract description 224
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000004590 computer program Methods 0.000 claims description 16
- 238000010586 diagram Methods 0.000 description 12
- 238000004891 communication Methods 0.000 description 9
- 238000012360 testing method Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 230000003993 interaction Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a device simulation system, a method, a device and a storage medium, wherein the system comprises: the simulation device and data generator creating module, the data generator and the simulation device; the simulation equipment and data generator creating module is used for reading the configuration file and creating at least one simulation equipment and at least one data generator according to the configuration information in the configuration file; each data generator corresponds to at least one simulation device, and each simulation device corresponds to one data generator; the data generator is used for generating equipment data and sending the equipment data to corresponding simulation equipment; the simulation equipment is used for responding to the external request and generating a reply message to the external request according to the received equipment data. The equipment simulation system provided by the invention can flexibly set the type and the number of the equipment to be simulated, match the port and the slave address for the equipment, and can simultaneously simulate a large amount of equipment without consuming excessive hardware resources.
Description
Technical Field
The present invention relates to the field of network management technologies, and in particular, to a system, a method, a device, and a storage medium for device emulation.
Background
With the development of the internet of things and the improvement of hardware performance, one industrial collector or controller may have access to more industrial devices. Due to the increase of access devices, the software performance requirements of collectors or controllers are gradually increased. In order to better guarantee the software performance of the collector or the controller and early discover the software problems caused by the increase of the access devices, more industrial devices need to be simulated to test the software performance of the collector or the controller.
In the existing method for testing the industrial collector or the controller, the industrial collector or the controller to be tested is usually connected with the slave simulator based on the Modbus protocol to perform testing. However, the existing Modbus slave simulator has limited maximum supported concurrent devices, or needs to add more hardware resources to simulate more concurrency, and is difficult to operate.
Disclosure of Invention
The invention provides a device simulation system and a device simulation method, which are used for testing an industrial collector or a controller by utilizing simulation equipment.
According to an aspect of the present invention, there is provided a device simulation system including: the simulation device and data generator creating module, the data generator and the simulation device;
the simulation equipment and data generator creating module is used for reading a configuration file and creating at least one simulation equipment and at least one data generator according to configuration information in the configuration file; each data generator corresponds to at least one simulation device, and each simulation device corresponds to one data generator;
the data generator is used for generating equipment data and sending the equipment data to the corresponding simulation equipment;
the simulation equipment is used for responding to an external request and generating a reply message to the external request according to the received equipment data.
Optionally, the configuration information includes: device type, number of devices, device data file address, network port, and device slave address.
Optionally, the simulation device and data generator creating module is specifically configured to:
according to the configuration information, the simulation equipment corresponding to the equipment type and the equipment number is created;
and acquiring the device data file address, the network port and the device slave address corresponding to each simulation device, and matching the device data file address, the network port and the device slave address to each simulation device.
Optionally, the manner of generating the device data by the data generator at least includes one of:
generating random said device data based on a set random data generating program;
and receiving the imported data file, and generating the equipment data according to the data file.
Optionally, the data generator is specifically configured to:
for each of the data generators, determining a corresponding simulation device;
determining a database table corresponding to the data file in a database storing the data file;
and starting a data generation thread, generating the equipment data according to the database table and sending the equipment data to each corresponding simulation equipment.
Optionally, the data generator is specifically configured to:
determining a target row in the database table;
and extracting the data in the target row as the equipment data according to the set data generation frequency.
Optionally, the simulation device is specifically configured to:
receiving the equipment data and storing the equipment data in a memory;
and when the external request is received, generating the reply message according to the equipment data in the memory.
According to another aspect of the present invention, there is provided a device simulation method applied to a device simulation system, the device simulation system including a simulation device and data generator creation module, a data generator and a simulation device, the method including:
reading configuration files through the simulation equipment and data generator creating module, and creating at least one simulation equipment and at least one data generator according to configuration information in the configuration files; wherein each data generator corresponds to at least one simulation device, and each simulation device corresponds to one data generator;
generating equipment data through the data generator, and sending the equipment data to the corresponding simulation equipment;
responding to an external request through the simulation equipment, and generating a reply message to the external request according to the received equipment data.
Further, the configuration information includes: device type, number of devices, device data file address, network port, and device slave address.
Further, reading a configuration file through the simulation device and data generator creating module, creating at least one simulation device according to configuration information in the configuration file, and including:
creating the simulation equipment corresponding to the equipment type and the equipment number according to the configuration information through the simulation equipment and data generator creating module;
and acquiring the device data file address, the network port and the device slave address corresponding to each simulation device, and matching the device data file address, the network port and the device slave address to each simulation device.
Further, the manner in which the data generator generates the device data includes at least one of:
generating random equipment data based on a set random data generation program;
and receiving the imported data file, and generating the equipment data according to the data file.
Further, receiving an imported data file, and generating the device data according to the data file, includes:
for each data generator, determining, by the data generator, the corresponding simulation device;
determining a database table corresponding to the data file in a database storing the data file;
and starting a data generation thread, generating the equipment data according to the database table and sending the equipment data to each corresponding simulation equipment.
Further, generating the device data according to the database table includes:
determining a target row in the database table;
and extracting the data in the target row as the equipment data according to the set data generation frequency.
Further, responding to an external request through the analog device, and generating a reply message to the external request according to the received device data, including:
receiving the equipment data and storing the equipment data in a memory;
and when the external request is received, generating the reply message according to the equipment data in the memory.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the device simulation method according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the device simulation method according to any one of the embodiments of the present invention when the computer instructions are executed.
The device simulation system provided by the embodiment of the invention comprises: the simulation device and data generator creating module, the data generator and the simulation device; the simulation equipment and data generator creating module is used for reading the configuration file and creating at least one simulation equipment and at least one data generator according to the configuration information in the configuration file; each data generator corresponds to at least one simulation device, and each simulation device corresponds to one data generator; the data generator is used for generating equipment data and sending the equipment data to corresponding simulation equipment; the simulation equipment is used for responding to the external request and generating a reply message to the external request according to the received equipment data. The equipment simulation system provided by the invention sets the simulation equipment and the data generator by using the configuration file, is simple to operate and deploy, can dynamically adjust the type and the number of the equipment to be simulated by modifying the configuration file, and can enable the number of the simulation equipment in the system not to be limited by the maximum address of the slave in the Modbus protocol theoretically by matching the network port with the address of the slave. For the data generator, the data of the equipment can be automatically produced, and the data file imported into the system can be received, so that the simulation equipment can more accurately simulate the equipment in a real scene.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a device simulation system according to an embodiment of the present invention;
FIG. 2 is a timing diagram illustrating an operation of a simulation system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a workflow of a data generator according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a data generation thread according to an embodiment of the present invention;
fig. 5 is a schematic start-up flow chart of an apparatus simulation system according to an embodiment of the present invention;
FIG. 6 is a flowchart of a device simulation method according to a second embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device implementing the device simulation method according to the third embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a schematic structural diagram of an apparatus simulation system according to an embodiment of the present invention, where the embodiment is applicable to a case where an industrial collector or a controller is tested by using a simulation apparatus instead of a real apparatus. As shown in fig. 1, the system includes: simulation device and data generator creation module 110, data generator 120, and simulation device 130.
The simulation device and data generator creation module 110 is configured to read the configuration file and create at least one simulation device 130 and at least one data generator 120 according to the configuration information in the configuration file. Each data generator 120 corresponds to at least one simulation device 130, and each simulation device 130 corresponds to one data generator 120.
The configuration file may be edited and set by a technician according to the requirements of an actual scene, or may be automatically filled in by the system based on a setting program.
In this embodiment, the simulation device and data generator creating module 110 may obtain the configuration file and read the configuration information therein. Optionally, the configuration information may include types and numbers of the simulation devices 130 to be created and the data generators 120 to be created, and accordingly, the simulation device and data generator creating module 110 may create the simulation devices 130 and the data generators 120 that conform to the configuration information.
Alternatively, each data generator 120 may provide data to one or more simulation devices 130, with each simulation device 130 accepting data generated by one data generator 120. Preferably, each data generator 120 can generate different types of device data, for example, the simulation device and data generator creating module 110 can create 3 simulation devices a, B, and c according to the configuration information, where the simulation device a and the simulation device B require device data of type one, and the simulation device c requires device data of type two, and then two corresponding data generators A, B can be created, the data generator a generates device data of type one to the simulation device a and the simulation device B, and the data generator B generates device data of type two to the simulation device c.
The data generator 120 is configured to generate device data and transmit the device data to the corresponding simulation device 130.
The device data is simulation data of the real device, and may be random data or data imported into the device simulation system according to historical operating data of the real device.
In this embodiment, the data generator 120 can provide the simulation device 130 with device data, so that the simulation device 130 can simulate the operation of a real device and interact with the industrial collector or controller under test.
Optionally, the data generator 120 may generate random or regular data according to a preset data generation rule, or may receive an externally imported data file, and perform parsing processing according to the imported data file to generate device data.
The analog device 130 is configured to generate a reply message to the external request according to the received device data in response to the external request.
The external request may be a request from outside the device simulation system, that is, a request from the tested industrial collector or controller, and the reply message is a reply message to the external request after the simulation device 130 responds to the external request.
In this embodiment, the simulation device 130 may directly communicate with the industrial collector or the controller to be tested, and generate a reply message according to the received device data to respond to the external request.
Optionally, the device simulation system and the tested industrial collector or controller may perform data interaction through a Modbus protocol. The Modbus is a serial communication protocol and is a common connection mode among industrial electronic equipment.
Fig. 2 is a timing diagram illustrating operation of a device simulation system according to an embodiment of the present invention, for example, when a controller is tested, as shown in the figure, the simulation device and data generator creating module 110 creates the simulation device 130 and the data generator 120 according to a configuration file. After the creation is successful, the simulation device 130 starts a monitoring thread for the measured controller, so as to receive a request sent by the measured controller at any time. After the simulation device 130 and the data generator 120 are started, the data generator 120 starts to cycle through the generated device data and call back to the simulation device 130. After the tested controller starts to be tested, the tested controller requests the simulation device 130 for device data, and the simulation device 130 returns a reply message to the tested controller according to the device data.
In this embodiment, the configuration information includes, but is not limited to: device type, number of devices, device data file address, network port, and device slave address.
Optionally, the simulation device and data generator creating module 110 is specifically configured to: creating simulation equipment 130 corresponding to the equipment type and the equipment number according to the configuration information; and acquiring the device data file address, the network port and the device slave address corresponding to each simulation device 130, and matching the device data file address, the network port and the device slave address to each simulation device 130.
Specifically, the simulation device and data generator creating module 110 may determine the type and number of the simulation devices 130 that need to be created from the configuration information, then correspondingly create the simulation devices 130 corresponding to the configuration information, and also determine information such as device data file addresses, network ports, device slave addresses, and the like corresponding to the simulation devices 130 from the configuration information, match the information to the simulation devices 130, so that the simulation devices acquire device data through the device data file addresses corresponding to the simulation devices 130, and communicate with the devices to be tested outside the system through the set network ports and device slave addresses. By means of matching network ports with addresses of slaves, the maximum number of simulated devices in the same device simulation system is (65535-1023) × 247 theoretically.
Optionally, the manner of generating the device data by the data generator 120 includes at least one of: generating random device data based on a set random data generation program; and receiving the imported data file, and generating equipment data according to the data file.
Specifically, the manner of generating the device data by the data generator 120 includes, but is not limited to, the above two manners, and the data generator 120 may be configured according to specific test requirements. Preferably, the device data generated by each data generator 120 is different for multiple data generators 120 in the same device simulation system.
Further, the data generator 120 is specifically configured to: for each data generator 120, determining a corresponding simulation device 130; determining a database table corresponding to the data file in a database for storing the data file; and starting a data generation thread, generating device data according to the database table and sending the device data to the corresponding simulation devices 130.
Specifically, when the device data is generated by receiving the imported data file, each data generator 120 determines its corresponding simulation device 130, that is, determines which simulation devices 130 the device data needs to be sent to after the device data is generated. And then searching a corresponding database table in a storage database of the imported data file, and extracting data in the database table as equipment data.
Fig. 3 is a schematic workflow diagram of a data generator according to an embodiment of the present invention, as shown in the figure, when an industrial collector or a controller is tested, according to a test requirement, if a data generator for generating device data required for the test does not exist in a device simulation system, a corresponding data generator needs to be created, and a handle of the data generator is inserted into a global queue, and if a corresponding data generator exists, a handle of the data generator may be directly inserted into the global queue. For the data generator, firstly, the number of corresponding simulation devices is determined, then, whether a storage database of the imported data file is opened or not is determined, and a corresponding database table is found and a data generation thread is started under the condition that the database is opened.
Further, the data generator 120 is specifically configured to: determining a target row in a database table; and extracting the data in the target row as the equipment data according to the set data generation frequency.
Specifically, after determining the database table corresponding to the data file, the data generator 120 determines the target row in the database table, traverses the data of the target row at the set data generation frequency, and calls back the data to each corresponding simulation device.
Fig. 4 is a schematic diagram of a data generation thread according to an embodiment of the present invention, as shown in the figure, in the data generation thread, the data generator 120 first determines a target row in the database table, then traverses the target row by using a cursor pointing to the database table, adds 1 to each row of data cursor until all target rows are traversed, and recalls data to each simulation device. The data generator 120 may repeatedly read the database tables at a set frequency to generate device data for provision to the simulation device.
Optionally, the simulation device 130 is specifically configured to: receiving equipment data and storing the equipment data in a memory; and when an external request is received, generating a reply message according to the equipment data in the memory.
Specifically, after the analog device 130 acquires the device data generated by the data generator 120, the data may be stored in a memory, and when the measured industrial collector or controller initiates a request, the analog device 130 generates a reply message according to the device data in the memory, and then replies to the measured industrial collector or controller.
Fig. 5 is a schematic start-up flow diagram of a device simulation system according to an embodiment of the present invention, as shown in the drawing, in a creation program of a simulation device and a data generator, the simulation device and data generator creation module 110 creates the simulation device 130 and the data generator 120 according to a configuration file, and then in the start-up program of the simulation device and data generator, the simulation device 130 and the data generator 120 are respectively started up to respectively start a listening thread to receive an external request and generate device data.
The equipment simulation system provided by the embodiment of the invention comprises simulation equipment, a data generator creating module, a data generator and simulation equipment; the simulation equipment and data generator creating module is used for reading the configuration file and creating at least one simulation equipment and at least one data generator according to configuration information in the configuration file; each data generator corresponds to at least one simulation device, and each simulation device corresponds to one data generator; the data generator is used for generating equipment data and sending the equipment data to corresponding simulation equipment; the simulation equipment is used for responding to the external request and generating a reply message to the external request according to the received equipment data. The equipment simulation system provided by the invention sets the simulation equipment and the data generator by using the configuration file, is simple to operate and deploy, can dynamically adjust the type and the number of the equipment to be simulated by modifying the configuration file, and can enable the number of the simulation equipment in the system not to be limited by the maximum address of the slave in the Modbus protocol theoretically by matching the network port with the address of the slave. For the data generator, the data of the equipment can be autonomously produced, and the data file imported into the system can be received, so that the simulation equipment can more accurately simulate the equipment in a real scene.
Example two
Fig. 6 is a flowchart of a device simulation method according to a second embodiment of the present invention, where the method may be executed by a device simulation system, and the device simulation system may be implemented in a form of hardware and/or software, and includes a simulation device and data generator creating module, a data generator, and a simulation device. As shown in fig. 6, the method includes:
s210, reading the configuration file through the simulation equipment and data generator creating module, and creating at least one simulation equipment and at least one data generator according to configuration information in the configuration file.
Each data generator corresponds to at least one simulation device, and each simulation device corresponds to one data generator.
In this embodiment, the configuration file may be edited and set by a technician according to the requirements of an actual scene, or may be automatically filled in by the system based on a setting program. The configuration information may include the types and the number of simulation devices to be created and the data generators to be created, and accordingly, the simulation device and data generator creating module may create the simulation devices and the data generators 120 according to the configuration information. Each data generator 120 may provide data to one or more simulation devices 130, with each simulation device 130 accepting data generated by one data generator 120.
In this embodiment, the configuration information includes, but is not limited to: device type, number of devices, device data file address, network port, and device slave address.
Optionally, the configuration file is read by the simulation device and data generator creating module, and the manner of creating at least one simulation device according to the configuration information in the configuration file may be: establishing simulation equipment corresponding to the equipment type and the equipment number according to the configuration information through a simulation equipment and data generator establishing module; and acquiring the device data file address, the network port and the device slave address corresponding to each simulation device, and matching the device data file address, the network port and the device slave address to each simulation device.
Specifically, the simulation device and data generator creating module may determine the type and number of simulation devices to be created from the configuration information, then correspondingly create simulation devices corresponding to the configuration information, and also may determine information such as device data file addresses, network ports, and device slave addresses corresponding to the simulation devices from the configuration information, match the information to the simulation devices, so that the simulation devices acquire device data through the device data file addresses corresponding to the simulation devices, and communicate with the device to be tested outside the system through the set network ports and device slave addresses.
And S220, generating equipment data through the data generator, and sending the equipment data to corresponding simulation equipment.
In this embodiment, the manner in which the data generator generates the device data includes at least one of: generating random device data based on a set random data generation program; and receiving the imported data file, and generating equipment data according to the data file.
Optionally, the data generator may provide device data for the simulation device, so that the simulation device may simulate the operation of the real device and interact with the industrial collector or controller being tested. The data generator can generate random or regular data through a preset data generation rule, and can also receive an externally imported data file and perform analysis processing according to the imported data file to generate equipment data.
Further, the method for receiving the imported data file and generating the device data according to the data file may be: for each data generator, determining corresponding simulation equipment through the data generator; determining a database table corresponding to the data file in a database for storing the data file; and starting a data generation thread, generating equipment data according to the database table and sending the equipment data to the corresponding simulation equipment.
Further, the way of generating device data from the database table may be: determining a target row in a database table; and extracting the data in the target row as the equipment data according to the set data generation frequency.
Specifically, when device data is generated by receiving an imported data file, each data generator determines its corresponding simulation device, that is, determines which simulation devices the device data needs to be sent to after the device data is generated. And then the data generator searches a corresponding database table in a storage database of the imported data file, determines a target row in the database table, traverses the data of the target row according to the set data generation frequency, and calls back to each corresponding simulation device.
And S230, responding to the external request through the simulation equipment, and generating a reply message to the external request according to the received equipment data.
In this embodiment, the simulation device may directly communicate with the industrial collector or the controller to be tested, and generate a reply message to respond to the external request according to the received device data.
Optionally, the method of responding to the external request by the analog device and generating a reply message to the external request according to the received device data may be as follows: receiving equipment data and storing the equipment data in a memory; and when an external request is received, generating a reply message according to the equipment data in the memory.
The device simulation method provided by the embodiment of the invention is executed by the device simulation system provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the device simulation system.
EXAMPLE III
FIG. 7 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 7, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. Processor 11 performs the various methods and processes described above, such as device emulation simulation methods.
In some embodiments, the device simulation method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the device emulation simulation described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the device emulation simulation method by any other suitable means (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved. The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. An equipment simulation system, comprising: the simulation device and data generator creating module, the data generator and the simulation device;
the simulation equipment and data generator creating module is used for reading a configuration file and creating at least one simulation equipment and at least one data generator according to configuration information in the configuration file; wherein each data generator corresponds to at least one simulation device, and each simulation device corresponds to one data generator;
the data generator is used for generating equipment data and sending the equipment data to the corresponding simulation equipment;
the simulation equipment is used for responding to an external request and generating a reply message to the external request according to the received equipment data.
2. The system of claim 1, wherein the configuration information comprises: device type, number of devices, device data file address, network port, and device slave address.
3. The system of claim 2, wherein the simulation device and data generator creation module is specifically configured to:
according to the configuration information, the simulation equipment corresponding to the equipment type and the equipment number is established;
and acquiring the equipment data file address, the network port and the equipment slave address corresponding to each simulation equipment, and matching the equipment data file address, the network port and the equipment slave address to each simulation equipment.
4. The system of claim 1, wherein the manner in which the data generator generates the device data comprises at least one of:
generating random said device data based on a set random data generating program;
and receiving the imported data file, and generating the equipment data according to the data file.
5. The system of claim 4, wherein the data generator is specifically configured to:
for each of the data generators, determining a corresponding one of the simulation devices;
determining a database table corresponding to the data file in a database storing the data file;
and starting a data generation thread, generating the equipment data according to the database table and sending the equipment data to each corresponding simulation equipment.
6. The system of claim 5, wherein the data generator is specifically configured to:
determining a target row in the database table;
and extracting the data in the target row as the equipment data according to the set data generation frequency.
7. The system of claim 1, wherein the simulation device is specifically configured to:
receiving the equipment data and storing the equipment data in a memory;
and when the external request is received, generating the reply message according to the equipment data in the memory.
8. A device simulation method is applied to a device simulation system, the device simulation system comprises a simulation device and data generator creation module, a data generator and a simulation device, and the method comprises the following steps:
reading a configuration file through the simulation equipment and data generator creating module, and creating at least one simulation equipment and at least one data generator according to configuration information in the configuration file; wherein each data generator corresponds to at least one simulation device, and each simulation device corresponds to one data generator;
generating equipment data through the data generator, and sending the equipment data to the corresponding simulation equipment;
responding to an external request through the simulation equipment, and generating a reply message to the external request according to the received equipment data.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the device simulation method of claim 8.
10. A computer-readable storage medium having stored thereon computer instructions for causing a processor to execute a method for device simulation as recited in claim 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310082024.5A CN115967638A (en) | 2023-01-16 | 2023-01-16 | Equipment simulation system, method, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310082024.5A CN115967638A (en) | 2023-01-16 | 2023-01-16 | Equipment simulation system, method, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115967638A true CN115967638A (en) | 2023-04-14 |
Family
ID=87352848
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310082024.5A Pending CN115967638A (en) | 2023-01-16 | 2023-01-16 | Equipment simulation system, method, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115967638A (en) |
-
2023
- 2023-01-16 CN CN202310082024.5A patent/CN115967638A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114157701B (en) | Task testing method, device, equipment and storage medium | |
CN114501501A (en) | Configuration management method, device, equipment and medium for mobile communication network target range | |
CN114389969A (en) | Client test method and device, electronic equipment and storage medium | |
CN115168130A (en) | Chip testing method and device, electronic equipment and storage medium | |
CN113127357B (en) | Unit test method, apparatus, device, storage medium, and program product | |
CN116126719A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN115599438A (en) | Method, device, equipment and medium for constructing application program publishing package | |
CN115934550A (en) | Test method, test device, electronic equipment and storage medium | |
CN115269431A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN115967638A (en) | Equipment simulation system, method, equipment and storage medium | |
CN115017047A (en) | Test method, system, equipment and medium based on B/S architecture | |
CN113691403A (en) | Topological node configuration method, related device and computer program product | |
CN113590217A (en) | Function management method and device based on engine, electronic equipment and storage medium | |
CN113656268B (en) | Performance test method and device for business service, electronic equipment and storage medium | |
CN115964243A (en) | Interface simulation method, device, electronic equipment and storage medium | |
CN115470193A (en) | Radar data simulation method, device, equipment and medium | |
CN116821217A (en) | Data distribution conversion method, device, equipment and storage medium | |
CN115061925A (en) | Performance test method and device of heterogeneous acceleration program and storage medium | |
CN116303071A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN116954570A (en) | Method, device, equipment and storage medium for generating analog data | |
CN117784763A (en) | Message sending method and device, electronic equipment and storage medium | |
CN114416040A (en) | Page construction method, device, equipment and storage medium | |
CN115269055A (en) | Nginx request data acquisition method, device, equipment and storage medium | |
CN116627820A (en) | Data creation method, device, equipment and medium | |
CN118433039A (en) | Node communication method and device during model training |
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 |