CN114116356A - Simulation test method, device, equipment and medium - Google Patents

Simulation test method, device, equipment and medium Download PDF

Info

Publication number
CN114116356A
CN114116356A CN202111449667.6A CN202111449667A CN114116356A CN 114116356 A CN114116356 A CN 114116356A CN 202111449667 A CN202111449667 A CN 202111449667A CN 114116356 A CN114116356 A CN 114116356A
Authority
CN
China
Prior art keywords
data
simulation
reported
authentication
simulation test
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
Application number
CN202111449667.6A
Other languages
Chinese (zh)
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.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance 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 China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202111449667.6A priority Critical patent/CN114116356A/en
Publication of CN114116356A publication Critical patent/CN114116356A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • 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/2247Verification or detection of system hardware configuration
    • 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/2273Test methods
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to the technical field of function test, and discloses a simulation test method, a simulation test device, simulation test equipment and a simulation test medium, wherein the method comprises the following steps: receiving a simulation request, and acquiring a protocol type, authentication information, simulation data and verification data associated with the simulation data in the simulation request; scheduling an equipment simulation unit matched with the protocol type by using a simulation scheduling strategy, authenticating the authentication information through a container in the scheduled equipment simulation unit, and judging whether the authentication passes; if the authentication is passed, encoding and packaging the analog data to obtain data to be reported, and inserting the data to be reported into a message queue; uploading the data to be reported to a cloud server through a message queue; and receiving response data returned by aiming at the data to be reported through the message queue, and checking the response data according to the check data to obtain a simulation test result. The invention realizes the test link of entering the equipment in advance and improves the test efficiency of the access equipment.

Description

Simulation test method, device, equipment and medium
Technical Field
The invention relates to the technical field of function testing, in particular to a simulation testing method, a simulation testing device, simulation testing equipment and a simulation testing medium.
Background
At present, in the prior art, most cloud devices of the internet of things need to test all data transmission protocol ports in each accessed device or various different access devices, and transmission tests are performed one by one in a manual test mode by using different test devices through testers in a large-batch, multi-device and multi-interface device or application scene, so that the problem of low test efficiency exists.
Disclosure of Invention
The invention provides a simulation test method, a simulation test device, computer equipment and a storage medium, which are used for realizing access test of various devices, verifying the capability of a cloud server and subsequent auxiliary service development and improving the test efficiency.
A simulation test method, comprising:
receiving a simulation request, and acquiring a protocol type, authentication information, simulation data and verification data associated with the simulation data in the simulation request;
scheduling an equipment simulation unit matched with the protocol type by using a simulation scheduling strategy, authenticating the authentication information through a container in the scheduled equipment simulation unit, and judging whether the authentication is passed;
if the authentication is passed, encoding and packaging the analog data to obtain data to be reported, and inserting the data to be reported into a message queue;
uploading the data to be reported to a cloud server through the message queue;
and receiving response data returned aiming at the data to be reported through the message queue, and checking the response data according to the check data to obtain a simulation test result.
A simulation test apparatus comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a simulation request, and acquiring a protocol type, authentication information, simulation data and verification data related to the simulation data in the simulation request;
the scheduling module is used for scheduling the equipment simulation unit matched with the protocol type by applying a simulation scheduling strategy, authenticating the authentication information through a container in the scheduled equipment simulation unit and judging whether the authentication is passed;
the encapsulation module is used for coding and encapsulating the analog data to obtain data to be reported and inserting the data to be reported into a message queue if the authentication is passed;
the uploading module is used for uploading the data to be reported to a cloud server through the message queue;
and the checking module is used for receiving response data returned aiming at the data to be reported through the message queue and checking the response data according to the checking data to obtain a simulation test result.
A computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the above simulation test method when executing said computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned simulation test method.
According to the simulation test method, the simulation test device, the computer equipment and the storage medium, provided by the invention, a simulation request is received, and a protocol type, authentication information, simulation data and verification data related to the simulation data in the simulation request are obtained; scheduling an equipment simulation unit matched with the protocol type by using a simulation scheduling strategy, authenticating the authentication information through a container in the scheduled equipment simulation unit, and judging whether the authentication is passed; if the authentication is passed, encoding and packaging the analog data to obtain data to be reported, and inserting the data to be reported into a message queue; uploading the data to be reported to a cloud server through the message queue; response data returned by aiming at the data to be reported are received through the message queue, the response data are checked according to the check data, and a simulation test result is obtained, so that communication and test of multiple protocols can be realized, an optimized scheduling strategy can be realized, actual test equipment can be not required to be built, the environment of a node can be simulated, the test can be carried out through the multi-protocol intelligent simulator as long as the protocol is determined and the function is determined, the test link of the equipment can be entered in advance, the running-in period of the access equipment is saved, the test efficiency of the access equipment is improved, the access test of the multiple equipment is realized, the capability of a cloud server is verified, and the test efficiency is improved through subsequent auxiliary service development.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention 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 that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram of an application environment of a simulation test method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a simulation test method according to an embodiment of the present invention;
FIG. 3 is a schematic block diagram of an exemplary simulation test apparatus;
FIG. 4 is a functional block diagram of a verification module of the simulation test apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a computer device in an embodiment of the invention.
Detailed Description
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 some, not all, embodiments of the present invention. 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.
The simulation test method provided by the invention can be applied to the application environment shown in fig. 1, wherein a client (computer device) communicates with a server through a network. The client (computer device) includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, a simulation testing method is provided, which mainly includes the following steps S10-S50:
and S10, receiving the simulation request, and acquiring the protocol type, the authentication information, the simulation data and the verification data associated with the simulation data in the simulation request.
Understandably, the protocol type is a type of a preset protocol of the analog access device, the protocol type includes protocol types such as MQTT, CoAP, LWM2M, the authentication information is information related to transmission authentication or/and analog user authentication of the analog device, for example, the authentication information is user information representing uniqueness and privacy such as an account number and a password, the analog data is data transmitted by the analog device generated by the analog device, the verification data is data responding to the analog data, the verification data may be the same as the analog data, indicating that the cloud server receives the analog data, and the verification data may be service feedback data corresponding to the analog data, indicating that the cloud server responds to the analog data after performing corresponding operations.
In an embodiment, before the step S10, that is, before the receiving the simulation request, the method includes:
receiving a simulation data generation request, and acquiring data configuration in the simulation data generation request; wherein the data configuration comprises data identification, data type, data range, event attribute or/and service attribute.
Understandably, the data identifier is data that is assigned with an identifier unique to a variable, the data type is a type that defines the data identifier, the data range is a range that defines the data identifier, the event attribute is a code that is converted from an event executed on the data identifier, and the service attribute is attribute content that defines a related state returned by the data identifier.
Randomly generating the analog value matching the data range based on the data type.
Understandably, according to the data type, calling a generator corresponding to the data type, inputting the data range into the called generator, and generating the analog value matched in the data range through the generator, wherein the analog value is a value generated in a simulation actual operation process, and the generator is a model randomly generating irregular numbers or letters.
And searching the verification data matched with the data identification and the simulation value from a simulation comparison table.
Understandably, the simulation comparison table stores various data identifications which correspondingly return corresponding verification data under the condition of different simulation values, and the verification data corresponding to the data identifications and the simulation values can be inquired from the simulation comparison table.
And carrying out rule generation on the data identification, the simulation value, the event attribute or/and the service attribute to generate the simulation data.
Understandably, the data identifier, the simulation value, the event attribute or/and the service attribute are subjected to rule generation according to a format of an object model, namely, the data identifier, the simulation value, the event attribute or/and the service attribute are generated according to a format rule of three dimensions of attribute-event-service, so as to obtain the simulation data.
Correlating the simulation data with the verification data.
The invention realizes that the data configuration in the analog data generation request is obtained by receiving the analog data generation request; the data configuration comprises data identification, data type, data range, event attribute or/and service attribute; randomly generating the analog value matched with the data range based on the data type; searching the verification data matched with the data identification and the simulation value from a simulation comparison table; carrying out rule generation on the data identification, the simulation value, the event attribute or/and the service attribute to generate simulation data; the simulation data and the verification data are correlated, so that the simulation data meeting the requirements can be automatically generated through data configuration, the corresponding verification data can be automatically searched, and a reference is provided for outputting a subsequent simulation test result, therefore, the cost of manually generating the simulation data and the verification data is saved, the accuracy and the correctness of the generation of the simulation data are improved, and the correctness of the matching of the verification data is ensured.
And S20, scheduling the equipment simulation unit matched with the protocol type by using a simulation scheduling strategy, authenticating the authentication information through a container in the scheduled equipment simulation unit, and judging whether the authentication is passed.
Understandably, the simulation scheduling policy is a device simulator matched with scheduling resources, that is, a device simulation unit which is idle and the same as or similar to the last simulated protocol, an identification bit is reserved in a storage area of each device simulation unit to store the last simulated protocol type, the identification bit can be compared with the currently simulated protocol type, and according to the comparison result, the similarity can be determined, and the process of determining the similarity can be as follows: each protocol type corresponds to an identification bit of a digital number, the identification bit can be composed of multiple digits, a cosine similarity calculation method can be applied, the cosine values of the identification bit corresponding to the last simulated protocol and the cosine values of the identification bit corresponding to the currently simulated protocol are mapped to form similarity values of the two, and thus, the process of scheduling the equipment simulation unit matched with the protocol type is as follows: firstly, detecting operation identifiers in each equipment simulation unit, judging whether the corresponding equipment simulation unit is idle or not through the operation identifiers, and acquiring the equipment simulation unit corresponding to the idle operation identifier; secondly, comparing the protocol type with the identification bits of each idle equipment simulation unit to obtain similarity; finally, sequencing all the similarities, determining the equipment simulation unit corresponding to the identification bit corresponding to the maximum similarity as a scheduled equipment simulator matched with the protocol type, when the similarity is 100%, the two protocols are indicated to be the same, so that the deployment time can be reduced by scheduling the equipment simulation unit matched with the protocol type, because the plug-ins or components deployed by the device simulation unit with high similarity are similar, the situation that deployment is wrong or the deployment time is long is avoided, the device simulation unit builds an independent container corresponding to the device simulation unit, the containers can manage each edge node in the device simulation unit, the containers in the device simulation unit can realize the authentication function, the authentication process is a process of judging whether the information related to transmission authentication or/and simulated user authentication in the authentication information can pass or not.
In an embodiment, the step S20, namely, the step of authenticating the authentication information by the container in the scheduled device simulation unit and determining whether the authentication is passed includes:
and distributing the edge node corresponding to the protocol type through a container in the equipment simulation unit.
Understandably, the container is a container based on a Docker architecture and built in the device simulation unit, the container includes a plurality of edge nodes (agents) connected with the device simulation unit, the device simulation unit is subjected to container management, different protocol types are built into different edge nodes, one protocol type corresponds to one edge node, the distribution process is to query the edge node consistent with the protocol type in a container management list of the container, and the edge node consistent with the protocol type is confirmed as a distributed edge node.
And authenticating the authentication information through the edge node, and judging whether the authentication is passed.
Understandably, the authentication process is to inquire whether a result consistent with the authentication information exists in an authentication list, if the result consistent with the authentication information cannot be inquired, the authentication is judged not to pass, and if the result consistent with the authentication information can be inquired, the authentication is judged to pass.
The invention realizes that the edge nodes corresponding to the protocol types are distributed through the container in the equipment simulation unit; the edge nodes authenticate the authentication information and judge whether the authentication passes, so that a plurality of edge nodes are managed through the container, the authentication operation of the authentication information is completed through the edge nodes, the authentication strategies can be matched according to different protocol types, and the pertinence is strong.
And S30, if the authentication is passed, coding and packaging the analog data to obtain data to be reported, and inserting the data to be reported into a message queue.
Understandably, if the authentication is passed, it indicates that the authenticated simulation device can perform session or data transmission with an edge node in the device simulation unit, the encoding is a process of encoding the simulation data according to a format of a physical model, that is, encoding according to a format of three dimensions of attribute-event-service, the packaging is a process of converting the encoded simulation data according to the protocol type, so as to obtain the data to be reported, the data to be reported is data to be reported to a cloud server, that is, data reported to the cloud server by the simulation device, the message queue is a queue for reporting to the cloud server, and the message queue sends messages in the queue according to a first-in first-out rule.
In an embodiment, the step S30, namely, the encoding and encapsulating the analog data to obtain data to be reported, and inserting the data to be reported into a message queue includes:
and carrying out model coding on the simulation data according to the format of the object model to obtain coded data.
Understandably, the object model is formatted in three dimensions of attribute-event-service, such as: the simulation data of the well lid state is characterized in that the simulation data is a well lid identification, a well lid data type and a well lid data range according to attributes, events are well lid initialization, timing well lid state collection or well lid closing is set, service is a timing collection interval, the process of carrying out model coding on the simulation data is to extract the former preset digit of the simulation data as the attribute, extract the last preset digit of the simulation data as the service, and use the remaining digits in the middle as the events, so that the coded data are obtained.
And carrying out protocol encapsulation on the coded data according to the protocol type to obtain the data to be reported.
Understandably, different protocol types correspond to different encapsulation code templates, and the encapsulation code templates corresponding to the protocol types are obtained, wherein the protocol encapsulation process is a processing process of filling the input coded data according to the obtained encapsulation code templates and filling the attributes, events and services in the coded data according to corresponding positions in the encapsulation codes.
And sending the data to be reported to the message queue corresponding to the object model topic corresponding to the coded data.
Understandably, the object model topics are contents of topic types divided according to attributes in the object model, corresponding relations between the attributes and the object model topics are preset, each object model topic corresponds to one message queue, all data related to the coded data corresponding to the object model topics are sent to the corresponding message queues and then sent out from the message queues, and therefore the data to be reported are sent to the message queues and can be reported to the corresponding cloud server through the message queues.
The invention realizes the model coding of the simulation data according to the format of the object model to obtain coded data; according to the protocol type, carrying out protocol encapsulation on the coded data to obtain the data to be reported; and sending the data to be reported to the message queue corresponding to the object model topic corresponding to the coded data, so that the simulation data can be coded according to the structure of the object model, and corresponding packaging can be automatically carried out according to the protocol type, thereby reducing the workload of manual coding and packaging, and improving the efficiency of simulation test.
And S40, uploading the data to be reported to a cloud server through the message queue.
Understandably, the information queue is uploaded to the cloud server in a subscription mode, the cloud server can be a server device of an internet of things platform and a platform server for managing all access devices, the subscription mode is that the information queue corresponding to one physical model topic is reported to the cloud server paying attention to the physical model topic, only the cloud server paying attention to the same physical model topic can receive data reported by the corresponding information queue, and only the information queue paying attention to the same physical model topic can receive data sent by the cloud server.
And S50, receiving response data returned by aiming at the data to be reported through the message queue, and checking the response data according to the check data to obtain a simulation test result.
Understandably, response data made by the cloud server is returned after the cloud server receives the data to be reported through the message queue, the response data is obtained according to a subscription mode, the verification data and the response data are checked, whether the verification data and the response data are consistent or not is judged, if the verification data and the response data are consistent, the simulation test result is qualified, if the verification data and the response data are inconsistent, the simulation test result is unqualified, and whether the simulation data in the simulation request are qualified or not can be shown through the simulation test result, so that whether the multi-protocol transmission of the access equipment meets the test requirements or not can be simulated.
The method and the device realize that the protocol type, the authentication information, the simulation data and the verification data related to the simulation data in the simulation request are obtained by receiving the simulation request; scheduling an equipment simulation unit matched with the protocol type by using a simulation scheduling strategy, authenticating the authentication information through a container in the scheduled equipment simulation unit, and judging whether the authentication is passed; if the authentication is passed, encoding and packaging the analog data to obtain data to be reported, and inserting the data to be reported into a message queue; uploading the data to be reported to a cloud server through the message queue; response data returned by aiming at the data to be reported are received through the message queue, the response data are checked according to the check data to obtain a simulation test result, therefore, communication and test of multiple protocols can be realized, an optimized scheduling strategy can be realized, actual test equipment can be not required to be built, the environment of a node can be simulated, the test can be carried out through the multi-protocol intelligent simulator as long as protocol determination and function determination are carried out, the test link of the equipment can be entered in advance, the running-in period of the access equipment is saved, the test efficiency of the access equipment is improved, the access test of the multiple equipment is realized, the capability of a cloud server is verified, subsequent auxiliary service development is realized, and the test efficiency is improved.
In an embodiment, the checking the response data according to the verification data in step S50 to obtain a simulation test result includes:
and carrying out protocol decoding corresponding to the protocol type on the response data through the edge node to obtain decoded data.
Understandably, the protocol decoding is the inverse process of protocol encapsulation, that is, the response data is removed according to an encapsulation code template corresponding to the protocol type, the content identical to the encapsulation code template is removed, the content of attributes, events and services is reserved, and the content is recorded as the decoding data.
And performing object model decoding on the decoded data to decode return data.
Understandably, the object model decodes as an inverse process of the encoding in the format of the object model, thereby decoding the return data.
And comparing the returned data with the check data to obtain the simulation test result.
Understandably, comparing the coincidence degree of the returned data and the check data by using a character string comparison mode, if all characters between the returned data and the check data are completely coincided or partially coincided, outputting the simulation test result according to the coincidence degree, namely, when all characters between the returned data and the check data are completely coincided, determining that the simulation test result is passed, if all characters between the returned data and the check data are partially coincided, comparing the non-coincided character part with the allowable tolerance range in the check data, judging whether the non-coincided character part falls into the allowable tolerance range in the check data, if so, determining that the simulation test result is passed, and if not, determining that the simulation test result is not passed, and if the characters between the returned data and the verification data are not coincident, determining that the simulation test result is not passed.
The invention realizes that the response data is subjected to protocol decoding corresponding to the protocol type through the edge node to obtain decoded data; decoding the decoded data by an object model to obtain returned data; and comparing the returned data with the check data to obtain the simulation test result, so that corresponding contents are automatically decoded through protocol decoding, the returned data which are really returned can be decoded through object model decoding, and the simulation test result is automatically compared, therefore, the manual decoding and checking process is not needed, the simulation test efficiency is improved, and the simulation test cost is saved.
In an embodiment, after the step S20, that is, after the determining whether the authentication is passed, the method includes:
and if the authentication fails, returning an authentication failure result through the container, and taking the authentication failure result as a simulation test result corresponding to the simulation request.
Understandably, if the authentication fails, returning an authentication failure result through the container, wherein the authentication failure result is a result of the prompt content corresponding to the option which fails to pass the authentication, and returning the authentication failure result as the simulation test result.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a simulation test apparatus is provided, and the simulation test apparatus corresponds to the simulation test method in the above embodiments one to one. As shown in fig. 3, the simulation test apparatus includes a receiving module 11, a scheduling module 12, a packaging module 13, an uploading module 14, and a collating module 15. The functional modules are explained in detail as follows:
the receiving module 11 is configured to receive a simulation request, and acquire a protocol type, authentication information, simulation data, and verification data associated with the simulation data in the simulation request;
the scheduling module 12 is configured to schedule an equipment simulation unit matched with the protocol type by using a simulation scheduling policy, authenticate the authentication information through a container in the scheduled equipment simulation unit, and determine whether the authentication passes;
the encapsulation module 13 is configured to encode and encapsulate the analog data to obtain data to be reported and insert the data to be reported into a message queue if the authentication passes;
the uploading module 14 is configured to upload the data to be reported to the cloud server through the message queue;
and the checking module 15 is configured to receive response data returned by the message queue for the data to be reported, and check the response data according to the check data to obtain a simulation test result.
In one embodiment, as shown in fig. 4, the verification module 15 comprises:
a first decoding unit 51, configured to perform protocol decoding corresponding to the protocol type on the response data through an edge node to obtain decoded data;
a second decoding unit 52, configured to perform object model decoding on the decoded data to decode return data;
and the comparison unit 53 is configured to compare the returned data with the verification data to obtain the simulation test result.
For the specific definition of the simulation test device, reference may be made to the above definition of the simulation test method, which is not described herein again. The modules in the analog testing device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a simulation testing method.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the simulation test method in the above embodiments is implemented.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the simulation test method in the above-mentioned embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A simulation test method, comprising:
receiving a simulation request, and acquiring a protocol type, authentication information, simulation data and verification data associated with the simulation data in the simulation request;
scheduling an equipment simulation unit matched with the protocol type by using a simulation scheduling strategy, authenticating the authentication information through a container in the scheduled equipment simulation unit, and judging whether the authentication is passed;
if the authentication is passed, encoding and packaging the analog data to obtain data to be reported, and inserting the data to be reported into a message queue;
uploading the data to be reported to a cloud server through the message queue;
and receiving response data returned aiming at the data to be reported through the message queue, and checking the response data according to the check data to obtain a simulation test result.
2. The simulation test method of claim 1, wherein the authenticating the certification information by the scheduled container in the device simulation unit to determine whether the certification is passed comprises:
distributing edge nodes corresponding to the protocol types through a container in the equipment simulation unit;
and authenticating the authentication information through the edge node, and judging whether the authentication is passed.
3. The simulation test method of claim 1, wherein the encoding and encapsulating the simulation data to obtain data to be reported and inserting the data to be reported into a message queue comprises:
according to the format of the object model, carrying out model coding on the simulation data to obtain coded data;
according to the protocol type, carrying out protocol encapsulation on the coded data to obtain the data to be reported;
and sending the data to be reported to the message queue corresponding to the object model topic corresponding to the coded data.
4. The simulation test method of claim 1, wherein said checking said response data according to said verification data to obtain a simulation test result comprises:
carrying out protocol decoding corresponding to the protocol type on the response data through an edge node to obtain decoded data;
decoding the decoded data by an object model to obtain returned data;
and comparing the returned data with the check data to obtain the simulation test result.
5. The simulation test method of claim 1, wherein after determining whether the authentication is passed, the method comprises:
and if the authentication fails, returning an authentication failure result through the container, and taking the authentication failure result as a simulation test result corresponding to the simulation request.
6. The simulation test method of claim 1, wherein prior to receiving the simulation request, comprising:
receiving a simulation data generation request, and acquiring data configuration in the simulation data generation request; the data configuration comprises data identification, data type, data range, event attribute or/and service attribute;
randomly generating the analog value matched with the data range based on the data type;
searching the verification data matched with the data identification and the simulation value from a simulation comparison table;
carrying out rule generation on the data identification, the simulation value, the event attribute or/and the service attribute to generate simulation data;
correlating the simulation data with the verification data.
7. A simulation test apparatus, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a simulation request, and acquiring a protocol type, authentication information, simulation data and verification data related to the simulation data in the simulation request;
the scheduling module is used for scheduling the equipment simulation unit matched with the protocol type by applying a simulation scheduling strategy, authenticating the authentication information through a container in the scheduled equipment simulation unit and judging whether the authentication is passed;
the encapsulation module is used for coding and encapsulating the analog data to obtain data to be reported and inserting the data to be reported into a message queue if the authentication is passed;
the uploading module is used for uploading the data to be reported to a cloud server through the message queue;
and the checking module is used for receiving response data returned aiming at the data to be reported through the message queue and checking the response data according to the checking data to obtain a simulation test result.
8. The simulation test apparatus of claim 7, wherein the verification module comprises:
the first decoding unit is used for carrying out protocol decoding corresponding to the protocol type on the response data through an edge node to obtain decoded data;
the second decoding unit is used for decoding the decoded data by an object model to obtain returned data;
and the comparison unit is used for comparing the returned data with the check data to obtain the simulation test result.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the simulation test method of any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the simulation test method according to any one of claims 1 to 6.
CN202111449667.6A 2021-11-30 2021-11-30 Simulation test method, device, equipment and medium Pending CN114116356A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111449667.6A CN114116356A (en) 2021-11-30 2021-11-30 Simulation test method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111449667.6A CN114116356A (en) 2021-11-30 2021-11-30 Simulation test method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114116356A true CN114116356A (en) 2022-03-01

Family

ID=80369792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111449667.6A Pending CN114116356A (en) 2021-11-30 2021-11-30 Simulation test method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114116356A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114679402A (en) * 2022-03-25 2022-06-28 武汉联影智融医疗科技有限公司 Method and device for testing communication protocol between upper computer and lower computer of medical robot
CN118075333A (en) * 2024-04-17 2024-05-24 天津华来科技股份有限公司 Method for constructing communication middleware framework of internet of things virtualization device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114679402A (en) * 2022-03-25 2022-06-28 武汉联影智融医疗科技有限公司 Method and device for testing communication protocol between upper computer and lower computer of medical robot
CN118075333A (en) * 2024-04-17 2024-05-24 天津华来科技股份有限公司 Method for constructing communication middleware framework of internet of things virtualization device

Similar Documents

Publication Publication Date Title
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN105306534B (en) A kind of information calibration method and open platform based on open platform
CN110535971B (en) Interface configuration processing method, device, equipment and storage medium based on block chain
CN114116356A (en) Simulation test method, device, equipment and medium
CN110784450A (en) Single sign-on method and device based on browser
CN110661829B (en) File downloading method and device, client and computer readable storage medium
CN111694749A (en) Automatic interface testing method and device, computer equipment and readable storage medium
CN105704178B (en) Task platform access method and device
CN110083384B (en) Application programming interface creating method and device
CN112860778B (en) Database management method, device, equipment and medium for desktop application program
CN112165448B (en) Service processing method, device, system, computer equipment and storage medium
CN110930254A (en) Data processing method, device, terminal and medium based on block chain
CN112328486A (en) Interface automation test method and device, computer equipment and storage medium
CN107645474B (en) Method and device for logging in open platform
CN112099964A (en) Interface calling method and device, storage medium and electronic device
CN110287070B (en) ESB special protocol interface test method, server and computer readable storage medium
CN112559352A (en) Interface test method, device, equipment and storage medium
CN109413200B (en) Resource import method, client, MES and electronic equipment
CN111211902A (en) Digital signature method and device based on enterprise browser
CN114785526B (en) Multi-user multi-batch weight distribution calculation and storage processing system based on block chain
CN114095272B (en) Intranet data linking method and device based on internal and external network security architecture
CN110162941A (en) A kind of terminal log-on message store method
CN114021175B (en) User portrait configuration method and device, computer equipment and medium
CN114429408B (en) Method, device, equipment and system for checking configuration file of intelligent substation
CN112597118B (en) Shared file adding method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination