CN109739621A - A kind of full soft data equipment simulating method of PaaSization - Google Patents
A kind of full soft data equipment simulating method of PaaSization Download PDFInfo
- Publication number
- CN109739621A CN109739621A CN201811620179.5A CN201811620179A CN109739621A CN 109739621 A CN109739621 A CN 109739621A CN 201811620179 A CN201811620179 A CN 201811620179A CN 109739621 A CN109739621 A CN 109739621A
- Authority
- CN
- China
- Prior art keywords
- data
- virtual
- equipment
- test
- paasization
- 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.)
- Withdrawn
Links
Abstract
The invention proposes a kind of full soft data equipment simulating methods of PaaSization, comprising the following steps: S1, analysis mode demand calculate virtual data number of devices and determine the corresponding variable of each equipment;S2, building virtual data equipment;S3, cloud client call virtual unit simulate plug-in unit generating device example, and establish Object Notation table;S4, virtual data equipment is divided into multiple threads;S5, virtual data equipment composition virtual test system is connected with proxy for equipment using virtual communication link;S6, the variable for carrying out virtual test according to default logic or modifying virtual unit in Object Notation table carry out virtual test;S7, the resident layer of data is transmitted test data to, and is successively saved in Redis database from resident layer.The method of the present invention uses full software design, can voluntarily assignment test, system stability is high, cost is relatively low, flexibility is preferable.
Description
Technical field
The present invention relates to a kind of complete soft a large amount of virtual data equipment simulating methods, belong to data equipment analogue technique neck
Domain.
Background technique
With the development of science and technology, some traditional forms of enterprises (such as water factory, power plant) are making the transition, the degree of automation of system
It is all being continuously improved with networking degree, it is more and more important by network real-time monitoring, test business equipment.Scope of the enterprise is more careless
Taste need to access main website equipment it is more, system pressure is bigger, and the stability of system is more and more tested, stringent
System testing is the pass that must pay attention to.
At present many enterprises when carrying out system testing using true data equipment measuring system constructing, this
Kind method cost is excessively high, and is easy to be limited by actual test place, it is difficult to simulate truth, while true hardware device
Solidify the specific needs for being difficult to accomplish to meet service layer and testing due to function, is also easy to safety problem occur.Some enterprises
Selection is tested by software analogue data equipment, makes analog machine software by research staff, tester carries out system
Test, but this mode must determine the function of simulation softward needs when developing software, if follow-up test
There is new demand in journey to simulation softward, generally require developer and rewrite script, take time and effort, and is difficult flexibly full
Sufficient testing requirement.
Summary of the invention
The technical problem to be solved in the invention is the problem that higher cost, flexibility are poor in data equipment test, this
Invention provides a kind of full soft data equipment simulating method of PaaSization, using python language building virtual data equipment, and
Cloud constructs Object Notation table, and in test phase, tester can be searched by Object Notation table needs object to be tested simultaneously
Assignment test is carried out to it using better simply assignment script.
In order to solve the above technical problems, present invention employs following technological means:
A kind of full soft data equipment simulating method of PaaSization, comprising the following steps:
S1, analysis mode demand calculate virtual data number of devices, and determine the corresponding variable of each equipment;
S2, virtual data equipment is constructed using python language;
The compiled virtual unit of S3, cloud client call simulates plug-in unit generating device example, and according to the corresponding variable of equipment
Establish Object Notation table;
S4, virtual data equipment is divided into multiple threads using multithreading equipment simulating algorithm;
S5, virtual data equipment composition virtual test system is connected with proxy for equipment using virtual communication link;
S6, the variable for carrying out virtual test according to default logic or modifying virtual unit in Object Notation table are virtually surveyed
Examination;
S7, the resident layer of data is transmitted test data to, and is successively saved in Redis database from resident layer.
Further, the variable in the step S1 refer in the virtual unit can assignment parameter.
Further, the concrete operations of the step S3 are as follows:
S31, virtual unit is called to simulate plug-in unit generating device example;
S32, device instance and the corresponding variable of device instance are numbered;
S33, the assignment script of device numbering, equipment variables title and equipment variables is sequentially stored in Object Notation table.
Further, the concrete operations of the step S4 are as follows:
The ratio value of interaction time-out during the time delay value of duration, interaction permission that S41, setting single thread are tested and test;
S42, pressurize virtual unit number in single thread, obtains single thread maximum and holds carrying capacity;
S43, virtual data equipment is divided by multiple threads according to single thread maximum appearance carrying capacity.
Further, the virtual communication link in step S5 is for by the virtual data equipment of any required communication with one another
The functional module connected, the virtual unit for needing to connect hardware serial ports for being connected to nearest serial ports by proxy for equipment
On, when some virtual unit connects hardware serial ports by proxy for equipment, the serial ports can show and occupy on that computer.Even
Multi-process+multithread mode is used during connecing virtual unit, conducive to the water of the resource in from cpu to process of server resource
Flat extension, centre coordinate the resource coordination between multi-process+multithreading by flexible bus mode.
Further, the concrete operations of step S6 are as follows:
S61, it calls the default script in virtual unit simulation plug-in unit to carry out virtual test, generates default test data;
S62, fc-specific test FC equipment is searched in Object Notation table;
S63, using the assignment script of equipment variables to variable assignments;
S64, operation assignment script, generate the test data of particular device.
Further, the concrete operations of the step S7 are as follows:
S71, the resident layer of data is established, storage queue identical and sequentially connected with number of threads is set, and it is resident that data are arranged
Time;
The test data that equipment generates in S72, thread is stored in data by connected storage queue and is resident layer;
S73, data are successively resident the storage of the data in layer to Redis database;
S74, the storing data that data are resident in layer is cleared up according to setting data residence time.
Using following advantage can be obtained after the above technological means:
The invention proposes a kind of full soft data equipment simulating methods of PaaSization, introduce the concept of Object Notation table, empty in building
The characteristics of each equipment is directed to when quasi- data equipment, selecting follow-up test needs equipment variables to be used, such as ammeter
Performance number develops corresponding assignment script for each variable, and name variable, assignment script check mark is stored in Object Notation
In table, in subsequent test process, both system testing can be carried out according to default script when developing, it can also be by testing
Personnel modify assignment script and are oriented test, and the test flexibility of the method for the present invention is higher, and because being full software design,
It is not take up space, is not related to material object, testing cost is smaller.The method of the present invention passes through multithreading equipment simulating algorithm for virtual data
Equipment is divided into multiple threads, it is ensured that the resource component of per thread utilizes, and avoids network resources waste, has further reduced test
Cost.
Detailed description of the invention
Fig. 1 is a kind of step flow chart of the full soft data equipment simulating method of PaaSization of the present invention.
Specific embodiment
Technical solution of the present invention is described further with reference to the accompanying drawing:
A kind of full soft data equipment simulating method of PaaSization, as shown in Figure 1, comprising the following steps:
S1, analysis mode demand calculate virtual data number of devices, and determine the corresponding variable of each equipment, variable herein
Refer in the virtual unit can assignment parameter.For example power plant's simulation system, the virtual data equipment needed have generator, pot
Furnace, ammeter etc., variable in need of consideration has rate, period, power, ammeter value etc. in ammeter.
S2, virtual data equipment is constructed using python language, it is virtual that developer writes code building on the server
Data equipment, to data equipment variable assign value interval, and according to normal operating conditions set a default value patrol
Volume, while one end assignment script is write, allow to carry out variable assignments by assignment script.
S3, the simulation plug-in unit generating device example in cloud client call S2 compiled virtual unit, and according to equipment
Corresponding variable establishes Object Notation table, and concrete operations are as follows:
S31, virtual unit is called to simulate plug-in unit generating device example, for example, calling the script of the ammeter of S2 compiling in computer
One simulation ammeter of upper generation.
S32, device instance and the corresponding variable of device instance are numbered, device instance and the corresponding change of device instance
The number of amount be it is the same, generally there are multiple identical virtual units in a test macro, all virtual units and
Its corresponding variable should have unique number.
S33, the assignment script of device numbering, equipment variables title and equipment variables is sequentially stored in Object Notation table
In.
S4, virtual data equipment is divided into multiple threads using multithreading equipment simulating algorithm, concrete operations are as follows:
The ratio value of interaction time-out, test during the time delay value of duration, interaction permission that S41, setting single thread are tested and test
Number of the interaction time delay more than the permissible delay value of setting and total interaction times during the ratio value of period interaction time-out is test
Ratio.
S42, virtual unit quantity is continuously increased in single thread, test meets the single thread of interaction time delay requirement
Maximum holds carrying capacity.
S43, all virtual data equipment is divided by multiple threads according to single thread maximum appearance carrying capacity.
S5, virtual data equipment composition virtual test system is connected with proxy for equipment using virtual communication link.It is virtual logical
Letter link is the functional module for connecting the virtual data equipment of any required communication with one another, both can connect same
Virtual unit in a thread can also connect virtual unit with cross-thread.Proxy for equipment will be for that will need to connect hardware serial ports
Virtual unit is connected on nearest serial ports, when some virtual unit connects hardware serial ports by proxy for equipment, in the computer
The upper serial ports, which can be shown, have been occupied, meanwhile, in the same thread, it is only necessary to which one of them proxied equipment opens physics string
Mouth can represent the equipment of all chain roads, and all serial ports is online.
In order to preferably resource be utilized to connect conducive to the horizontal extension of the resource in from cpu to process of server resource
Multi-process+multithread mode is used during virtual unit, centre is coordinated between multi-process+multithreading by flexible bus mode
Resource coordination.
S6, the variable for carrying out virtual test according to default logic or modifying virtual unit in Object Notation table carry out empty
Quasi- test, specific operation are as follows:
S61, the default script in virtual unit simulation plug-in unit is called to carry out virtual test, such as ammeter equipment, when calling exploitation
The logic in default script write, ammeter power changes according to sequence from low to high in the valued space of permission, generates
The ammeter power test data of default.
S62, by uniquely numbering or name variable is searched in Object Notation table and needs the equipment of fc-specific test FC.
S63, tester can give variable random assignment in Object Notation table using the assignment script of equipment variables.
S64, operation assignment script, change the variable of the virtual unit, generate specific equipment test data.
S7, the resident layer of data is transmitted test data to, and is successively saved in Redis database from resident layer, it is specific to grasp
Make as follows:
S71, data established in cloud client be resident layer, data, which are resident layer, has a fixed memory, data be resident in layer setting with
The number of threads of test macro is identical and sequentially connected storage queue, and the data resident time is arranged.
The test data that equipment generates in S72, some thread is stored in data by connected storage queue and is resident layer.
S73, data are successively resident the storage of the data in layer to Redis database sequentially in time;For liveness
Higher thread or equipment preferentially can be put in storage and be stored.
S74, in order to prevent loss of data, data will not be resident layer deletion from data at once after being stored in Redis database,
Data through being put in storage can be confirmed whether to be stored in Redis database after reaching data residence time, be not stored at once into
Row storage, only reaches data residence time and the data for being stored in Redis database just will do it cleaning.
Embodiments of the present invention are explained in detail above in conjunction with attached drawing, but the invention is not limited to above-mentioned
Embodiment within the knowledge of a person skilled in the art can also be before not departing from present inventive concept
It puts and makes a variety of changes.
Claims (7)
1. a kind of full soft data equipment simulating method of PaaSization, which comprises the following steps:
S1, analysis mode demand calculate virtual data number of devices, and determine the corresponding variable of each equipment;
S2, virtual data equipment is constructed using python language;
The compiled virtual unit of S3, cloud client call simulates plug-in unit generating device example, and according to the corresponding variable of equipment
Establish Object Notation table;
S4, virtual data equipment is divided into multiple threads using multithreading equipment simulating algorithm;
S5, virtual data equipment composition virtual test system is connected with proxy for equipment using virtual communication link;
S6, the variable for carrying out virtual test according to default logic or modifying virtual unit in Object Notation table are virtually surveyed
Examination;
S7, the resident layer of data is transmitted test data to, and is successively saved in Redis database from resident layer.
2. a kind of full soft data equipment simulating method of PaaSization according to claim 1, which is characterized in that the step
Variable in S1 refer in the virtual unit can assignment parameter.
3. a kind of full soft data equipment simulating method of PaaSization according to claim 1, which is characterized in that the step
The concrete operations of S3 are as follows:
S31, virtual unit is called to simulate plug-in unit generating device example;
S32, device instance and the corresponding variable of device instance are numbered;
S33, the assignment script of device numbering, equipment variables title and equipment variables is sequentially stored in Object Notation table.
4. a kind of full soft data equipment simulating method of PaaSization according to claim 1, which is characterized in that the step
The concrete operations of S4 are as follows:
The ratio value of interaction time-out during the time delay value of duration, interaction permission that S41, setting single thread are tested and test;
S42, pressurize virtual unit number in single thread, obtains single thread maximum and holds carrying capacity;
S43, virtual data equipment is divided by multiple threads according to single thread maximum appearance carrying capacity.
5. a kind of full soft data equipment simulating method of PaaSization according to claim 1, which is characterized in that connect in step S5
Connect during virtual data equipment using multi-process+multithread mode, by flexible bus mode coordinate multi-process+multithreading it
Between resource coordination.
6. a kind of full soft data equipment simulating method of PaaSization according to claim 3, which is characterized in that the tool of step S6
Gymnastics is made as follows:
S61, it calls the default script in virtual unit simulation plug-in unit to carry out virtual test, generates default test data;
S62, fc-specific test FC equipment is searched in Object Notation table;
S63, using the assignment script of equipment variables to variable assignments;
S64, operation assignment script, generate the test data of particular device.
7. a kind of full soft data equipment simulating method of PaaSization according to claim 1, which is characterized in that the step
The concrete operations of S7 are as follows:
S71, the resident layer of data is established, storage queue identical and sequentially connected with number of threads is set, and it is resident that data are arranged
Time;
The test data that equipment generates in S72, thread is stored in data by connected storage queue and is resident layer;
S73, data are successively resident the storage of the data in layer to Redis database;
S74, the storing data that data are resident in layer is cleared up according to setting data residence time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811620179.5A CN109739621A (en) | 2018-12-28 | 2018-12-28 | A kind of full soft data equipment simulating method of PaaSization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811620179.5A CN109739621A (en) | 2018-12-28 | 2018-12-28 | A kind of full soft data equipment simulating method of PaaSization |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109739621A true CN109739621A (en) | 2019-05-10 |
Family
ID=66361720
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811620179.5A Withdrawn CN109739621A (en) | 2018-12-28 | 2018-12-28 | A kind of full soft data equipment simulating method of PaaSization |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109739621A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111815146A (en) * | 2020-07-02 | 2020-10-23 | 上海微亿智造科技有限公司 | Quality inspection machine simulation test data method and system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101034370A (en) * | 2006-03-10 | 2007-09-12 | 大唐移动通信设备有限公司 | Software system multi-user characteristic testing method and system |
CN101788921A (en) * | 2010-02-08 | 2010-07-28 | 深圳市同洲电子股份有限公司 | Analog system of embedded equipment |
US20120060167A1 (en) * | 2010-09-08 | 2012-03-08 | Salsburg Michael A | Method and system of simulating a data center |
CN103489115A (en) * | 2012-06-11 | 2014-01-01 | 联想(北京)有限公司 | Electronic equipment customization method, server and client |
CN104360894A (en) * | 2014-11-18 | 2015-02-18 | 浪潮(北京)电子信息产业有限公司 | Method and device for simulating physical equipment |
CN104777758A (en) * | 2014-01-15 | 2015-07-15 | 深圳航天东方红海特卫星有限公司 | General purpose simulator for microsatellite equipment |
-
2018
- 2018-12-28 CN CN201811620179.5A patent/CN109739621A/en not_active Withdrawn
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101034370A (en) * | 2006-03-10 | 2007-09-12 | 大唐移动通信设备有限公司 | Software system multi-user characteristic testing method and system |
CN101788921A (en) * | 2010-02-08 | 2010-07-28 | 深圳市同洲电子股份有限公司 | Analog system of embedded equipment |
US20120060167A1 (en) * | 2010-09-08 | 2012-03-08 | Salsburg Michael A | Method and system of simulating a data center |
CN103489115A (en) * | 2012-06-11 | 2014-01-01 | 联想(北京)有限公司 | Electronic equipment customization method, server and client |
CN104777758A (en) * | 2014-01-15 | 2015-07-15 | 深圳航天东方红海特卫星有限公司 | General purpose simulator for microsatellite equipment |
CN104360894A (en) * | 2014-11-18 | 2015-02-18 | 浪潮(北京)电子信息产业有限公司 | Method and device for simulating physical equipment |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111815146A (en) * | 2020-07-02 | 2020-10-23 | 上海微亿智造科技有限公司 | Quality inspection machine simulation test data method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109412829A (en) | A kind of prediction technique and equipment of resource distribution | |
Fanti et al. | A three-level strategy for the design and performance evaluation of hospital departments | |
CN107368408A (en) | A kind of software fault towards interface injects automated testing method | |
CN106095673A (en) | Automated testing method based on WEB interface and system | |
Stankovic et al. | Transient power system analysis with measurement-based gray box and hybrid dynamic equivalents | |
CN110221858A (en) | Analogue data generation method, device, equipment and computer readable storage medium | |
CN107315889A (en) | The performance test methods and storage medium of simulation engine | |
CN107609794A (en) | A kind of technology maturity evaluation information processing unit | |
CN106408126B (en) | A kind of three perfecting by stage methods concurrently gathered towards energy consumption data | |
CN107025288A (en) | Distributed data digging method and system | |
CN109213658A (en) | A kind of method for inspecting and device | |
CN109739621A (en) | A kind of full soft data equipment simulating method of PaaSization | |
CN105912439A (en) | Method, device and system for computer monitoring | |
CN107741909A (en) | A kind of automated testing method and system for distributed block storage | |
Wang et al. | MetaOJ: A massive distributed online judge system | |
GOODGHILD et al. | Performance evaluation and work-load estimation for geographic information systems | |
CN104090185A (en) | Testing system and method | |
CN107544895A (en) | Hadoop big datas platform testing system and method | |
CN104753718A (en) | Deficiency service throughput rate complementing method and device based on non-negative polymerization | |
Basili | Resource models | |
Pourbafrani et al. | A python extension to simulate petri nets in process mining | |
CN106295808A (en) | Aircraft embedded real-time diagnosis reasoning algorithm test method | |
CN110430591A (en) | Base band resource pool intelligent deployment and reconstructing method | |
CN107102543A (en) | The forming method and device of a kind of energy router anti-interference controller | |
CN111708538B (en) | Transaction circulation method, device, computer equipment and computer readable storage medium |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190510 |
|
WW01 | Invention patent application withdrawn after publication |