Communication method and device, equipment, medium and program product for simulator testing
By establishing a communication channel between the simulator and the simulator test platform, and using the RabbitMQ communication middleware module to parse and verify the test instructions, the problem of interactive exceptions in simulator testing is solved, and the reliable data transmission and system scalability and reliability are achieved.
Patent Information
- Application Number
- CN202510271834.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-03-10
AI Technical Summary
In the prior art, the interaction between the simulator and the simulator test platform is prone to abnormalities, resulting in the simulator testing being unable to proceed normally.
By establishing a communication channel between the simulator and the simulator test platform, the communication middleware module implemented by RabbitMQ is used to parse and verify the test instructions, and the parsed instructions are added to the communication queue to ensure reliable data transmission.
It realizes stable communication between the simulator and the simulator test platform, ensures safe and reliable transmission of data between different system components, and improves the scalability and reliability of the entire simulator test system.
Smart Images

Figure CN119788558B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of nuclear power simulators, and specifically relates to a communication method and device, equipment, medium and program product for simulator testing. Background Art
[0002] At present, nuclear power simulator technology is widely used in various nuclear power plants in my country, providing a solid foundation for the training of nuclear power plant operators.
[0003] Generally, in order to realize on-site simulator testing, a simulator testing platform is set up, and instructions are sent to the simulator through the simulator testing platform to realize the communication of the simulator. However, currently, due to network instability or certain service abnormalities, the interaction between the simulator and the simulator testing platform becomes abnormal, and the simulator testing cannot be carried out normally. Summary of the invention
[0004] In view of this, the present application is committed to providing a communication method and device, equipment, medium and program product for simulator testing, which establishes a communication channel between the simulator and the simulator testing platform to solve the technical problem in the prior art that the interaction between the simulator and the simulator testing platform is prone to abnormalities.
[0005] The first aspect of the present application provides a communication method for simulator testing, which includes: establishing a communication channel between a simulator and a simulator test platform, obtaining test instructions issued by the simulator test platform, the communication channel being provided by a communication middleware module implemented through RabbitMQ; parsing the test instructions using the communication middleware module, generating parsed test instructions, and verifying the identity of the simulator test platform according to the parsed test instructions; when the identity authentication of the simulator test platform is successful, calling the corresponding communication program according to the parsed test instructions; based on the called communication program, adding the parsed test instructions to the communication queue; and sending the parsed test instructions in the communication queue to the simulator through the communication channel.
[0006] In a specific embodiment of the present application, a communication channel is established between a simulator and a simulator test platform, and a test instruction issued by the simulator test platform is obtained, including: first initializing the connection of the automated test software on the simulator test platform, and when the application of the automated test software is started, establishing a connection to the RabbitMQ server and creating a communication channel; then defining the switch type and setting parameters; then creating a queue and setting the queue's properties; finally binding the queue to the switch and specifying a routing key; and obtaining the test instruction issued by the simulator test platform.
[0007] In a specific embodiment of the present application, a communication middleware module is used to parse a test instruction, generate a parsed test instruction, and verify the identity of a simulator test platform according to the parsed test instruction, including: parsing the test instruction to obtain a parsed test instruction. The parsed test instruction includes a message type, a command length, an ID card identification number, and parsed data; and verifying the identity of the simulator test platform according to the ID card identification number.
[0008] In a specific embodiment of the present application, based on the called communication program, the parsed test instruction is added to the communication queue, including: based on the called communication program, obtaining the routing key of the parsed test instruction; based on the routing key, after obtaining the communication queue corresponding to the parsed test instruction, the parsed test instruction is added to the communication queue.
[0009] In a specific implementation of the present application, the communication method for simulator testing further includes: real-time monitoring of the communication status between the simulator test platform and the simulator.
[0010] In a specific implementation of the present application, the communication method for simulator testing further includes: when an error occurs in sending the parsed test instruction, adding the parsed test instruction to a dead letter queue.
[0011] In a specific embodiment of the present application, the communication method for simulator testing further includes: when the simulator test platform is shut down, closing the communication channel.
[0012] In a specific embodiment of the present application, the communication middleware module is configured to have the function of automatically identifying and processing objects specified in test instructions, supporting asynchronous processing and remote calls, and integrating event and data flow management, and providing one or more functions of API interface management.
[0013] The second aspect of the present application provides a communication device for simulator testing, which includes a channel establishment module, an instruction parsing module, a communication program calling module, a queue joining module and a data sending module. The channel establishment module is used to establish a communication channel between the simulator and the simulator test platform, and obtain the test instructions issued by the simulator test platform. The communication channel is provided by a communication middleware module implemented by RabbitMQ. The instruction parsing module is used to parse the test instructions using the communication middleware module, generate parsed test instructions, and verify the identity of the simulator test platform according to the parsed test instructions. The communication program calling module is used to call the corresponding communication program according to the parsed test instructions when the identity authentication of the simulator test platform is successful. The queue joining module is used to add the parsed test instructions to the communication queue based on the called communication program. The data sending module is used to send the parsed test instructions in the communication queue to the simulator through the communication channel.
[0014] The third aspect of the present application provides an electronic device, which includes a processor and a memory. The processor is used to execute a communication method for simulator testing according to the first aspect of the present application. The memory is used to store executable instructions of the processor.
[0015] The fourth aspect of the present application provides a computer-readable storage medium on which computer executable instructions are stored. When the executable instructions are executed by a processor, a communication method for simulator testing according to the first aspect of the present application is implemented.
[0016] The fifth aspect of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements a communication method for simulator testing according to the first aspect of the present application.
[0017] The beneficial effect of the technical solution of the present application is that: by establishing a communication channel between the simulator and the simulator test platform, the communication channel is provided by a communication middleware module implemented by RabbitMQ, and the communication middleware module is used as a communication hub between the automated test software and the simulator on the simulator test platform to establish an efficient connection. The core responsibility of the communication middleware module is to receive the test instructions issued by the simulator test platform and parse them to obtain the parsed test instructions. The communication middleware module will accurately parse these test instructions so as to use the parsed test instructions to guide the simulator to perform corresponding operations. At the same time, the embodiment of the present application adopts the method of adding the parsed test instructions to the communication queue and then sending them, so that even in the case of network instability or temporary abnormalities of some services, the message queue can store messages, ensuring that data is not lost and reliably transmitted, and at the same time, the scalability and reliability of the entire simulator test system (including the simulator and the simulator test platform) are improved, and the flexibility of the entire simulator test system is increased, ensuring that data is safely and reliably transmitted between different system components such as the simulator and the simulator test platform in the simulator test system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The figure is a flow chart of a communication method for simulator testing provided in one embodiment of the present application.
[0019] Figure 2 Shown is a block diagram of a communication device for simulator testing provided in one embodiment of the present application.
[0020] Figure 3 Shown is a block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] At least one embodiment of the present application provides a communication method for simulator testing, referring to Figure 1 The communication method for simulator testing includes the following steps.
[0023] S100: Establish a communication channel between the simulator and the simulator test platform, and obtain the test instructions issued by the simulator test platform. The communication channel is provided by a communication middleware module implemented by RabbitMQ.
[0024] It should be noted that the test instructions issued by the simulator test platform are also the test instructions issued by the automated test software on the simulator test platform. RabbitMQ is an open source message broker software (also known as message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP).
[0025] S200: parsing the test instruction using the communication middleware module to generate a parsed test instruction, and verifying the identity of the simulator test platform according to the parsed test instruction.
[0026] It should be noted that the parsed test instructions include the operation instructions that can be executed by the simulator. For example, when the automated test software needs to modify or read the variable value, the communication middleware module will accurately parse these instructions and guide the simulator to perform the corresponding operation.
[0027] S300: When the identity authentication of the simulator test platform is successful, the corresponding communication program is called according to the parsed test instruction.
[0028] S400: Based on the retrieved communication program, the parsed test instruction is added to the communication queue.
[0029] S500: Send the parsed test instructions in the communication queue to the simulator through the communication channel.
[0030] According to the technical solution provided in the embodiment of the present application, by establishing a communication channel between the simulator and the simulator test platform, the communication channel is provided by a communication middleware module implemented by RabbitMQ, and the communication middleware module is used as a communication hub between the automated test software and the simulator on the simulator test platform to establish an efficient connection. The core responsibility of the communication middleware module is to receive the test instructions issued by the simulator test platform and parse them to obtain the parsed test instructions. The communication middleware module will accurately parse these test instructions so as to use the parsed test instructions to guide the simulator to perform corresponding operations. At the same time, the embodiment of the present application adopts the method of adding the parsed test instructions to the communication queue and then sending them, so that even in the case of network instability or temporary abnormalities of some services, the message queue can store messages, ensuring that data is not lost and reliably transmitted, and at the same time, the scalability and reliability of the entire simulator test system (including the simulator and the simulator test platform) are improved, and the flexibility of the entire simulator test system is increased, ensuring that data is safely and reliably transmitted between different system components such as the simulator and the simulator test platform in the simulator test system.
[0031] Step S100 is to establish a communication channel between the simulator and the simulator test platform, so that data such as parsed test instructions can be transmitted through the communication channel to ensure that the test task can be carried out smoothly according to the procedures. For example, in at least one embodiment of the present application, steps S110 to S150 are a specific implementation of the above step S100.
[0032] S110: First, the connection of the automated testing software on the simulator testing platform is initialized. When the application of the automated testing software is started, a connection to the RabbitMQ server is established, and a communication channel is created.
[0033] It should be noted that corresponding communication channels can be created according to actual needs.
[0034] S120: Then define the switch type and set parameters.
[0035] S130: Then create a queue and set the attributes of the queue.
[0036] S140: Finally, bind the queue to the switch and specify the routing key.
[0037] Specifically, according to the business logic, the queue is bound to the switch and a routing key is specified. When a message is sent to the switch, it can be routed to the correct queue according to the routing key. In this way, a communication channel between the simulator and the simulator test platform is established, and normal communication between the simulator and the simulator test platform can be achieved.
[0038] It should be noted that queues include communication queues and dead letter queues.
[0039] S150: Obtain the test instructions issued by the simulator test platform.
[0040] It should be noted that the automated testing software can also be called communication software for simulator testing. Switch types include but are not limited to direct, topic, fan-shaped or head switches. Parameters include but are not limited to persistence options. Queue properties include but are not limited to whether it is persistent, whether it is exclusive, whether it is automatically deleted, etc.
[0041] Step S200 is to parse the test instruction and verify the identity of the simulator test platform according to the parsed test instruction to ensure that data such as the parsed test instruction is safely and reliably transmitted between different system components. For example, in at least one embodiment of the present application, steps S210 and S220 are a specific implementation of the above step S200.
[0042] S210: Parse the test instruction to obtain a parsed test instruction. The parsed test instruction includes a message type, a command length, an ID number, a routing key, and parsed data.
[0043] Identity Document (ID) can be referred to as identity ID for short.
[0044] S220: Verify the identity of the simulator test platform according to the ID card identification number.
[0045] In an embodiment of the present application, the test instruction is first parsed. The test instruction generally contains information that can verify the identity of the sender and specific message data. Therefore, after parsing, the message type, command length, ID card identification number and parsed data can be obtained, and then the identity of the simulator test platform can be verified through the ID card identification number.
[0046] Step S300 is to call the corresponding communication program through the parsed test instructions. These communication programs are responsible for exchanging data with the simulator and performing operations such as variable modification and status reading to ensure the correct transmission of the test instructions and the precise control of the simulator.
[0047] For example, in some embodiments, the communication program includes at least a message communication program, a command communication program, and a script communication program.
[0048] For example, the message communication program is Rinsim1.0, the command communication program is Rinsim2.0, and the script communication program is the DCS (Distributed Control System) first-layer engineer station. Specifically, Rinsim1.0 uses messages to communicate with the existing S3server program on the simulator: the S3server program is a server program that can run on the unix / linux platform. It runs on the machine where the support platform (MST) is located, accepts the client's Transmission Control Protocol (TCP) connection, and provides the following functions to the client through interaction with MST and based on the S3server program:
[0049] a, register a set of variables and refresh the current values;
[0050] b. Issue certain control instructions to the simulator;
[0051] c, set / query the value of the variable;
[0052] d. Send and execute expert orders, etc.;
[0053] The communication protocol between the client and S3server program is as follows (the numbers below indicate the number of bytes in the corresponding part):
[0054] Message type + command length + client ID + specific message data:
[0055] 4 + 4 + 4 + N
[0056] The first three items are called message headers, the message type is a group of macro definitions, and the specific message types can be found in the s3cmsginfo.h header file. The command length is the length of the entire message (including the message header and message data), and the client ID is an integer used to distinguish clients on the server side (a random assignment method can be adopted during testing). The format of the last item "specific message data" is determined by the message type, and data services are provided to the client through a certain communication protocol. Currently, the programs that can communicate with the S3server program include the teaching control station simstation, the operator station simhmi, the curve program SimCurve, the debugging program simugd, etc. It should be noted that the specific message data is also the parsed test instructions.
[0057] The external data interface of the Rinsim2.0 platform is implemented using the Redis interface. Redis is a high-performance memory database that supports remote reading and writing over the network, memory persistence, key-value pair storage, and provides external operation interfaces in multiple programming languages.
[0058] The simulation verification platform interface adopts the observer design pattern in software development thinking and uses Redis list and hash table field types to simulate data windows and message queues.
[0059] When external software issues commands to the simulation verification platform (such as teaching and control, start and stop, fault, on-site, system loading and unloading, etc.) and queries and operates a single point or several points, the message queue method is adopted. The external platform sends an enqueue (lpush) instruction to a custom channel of the Redis Server for the communication software of the simulation verification platform. The simulation verification platform parses and responds to the enqueue instruction and returns the specified result information (JSON string format) to the queue. The communication software of the external platform performs a queue dequeue (rpop) operation on the custom channel to obtain the result information.
[0060] On the other hand, when external software needs to monitor variables and monitor certain fixed variable points, the variable window monitoring method is used. By remotely writing to the winnames set of the Redis Server, the point name can be written into the field for the point that needs to be monitored in real time. The platform will automatically write the real-time value of the point into the variable value to ensure that the value of the redis server is consistent with the value of the platform. At the same time, this operation method supports bidirectional reading and writing.
[0061] For the DCS first-layer engineer station, dynamic script generation is adopted. The simulator automation test software of the simulator test platform dynamically generates variable list query scripts or variable setting scripts according to the content of the regulations, and remotely connects to the DCS first-layer engineer station through the Secure Shell Protocol (SSH protocol), and sends the dynamically generated script as a file, and then calls the BAT batch command execution script on the DCS first-layer engineer station. After running the BAT batch command execution script, the result data is obtained and returned to the automation test system through data pipeline redirection.
[0062] Step S400 is a preparatory operation before the parsed test instruction is sent, by adding the parsed test instruction to the communication queue, thereby ensuring the orderly sending of the parsed test instruction. For example, in at least one embodiment of the present application, steps S410 and S420 are a specific implementation of the above step S400.
[0063] S410: Based on the retrieved communication program, obtain the routing key in the parsed test instruction.
[0064] S420: After acquiring the communication queue corresponding to the parsed test instruction based on the routing key, the parsed test instruction is added to the communication queue.
[0065] In this embodiment, before communication, according to the business logic, the queue is bound to the switch and the routing key is specified, so that when the message is sent to the switch, the message can be routed to the correct queue according to the routing key. Later, when the producer application performs the operation, the message is sent to the declared switch. The routing key of the message will determine which queue it is sent to. The consumer application receives the message from the queue. This is usually done by calling a method that blocks until a message arrives, or setting a callback function to process the received message.
[0066] In at least one embodiment of the present application, the communication method for simulator testing further includes the following step S600.
[0067] S600: Real-time monitoring of the communication status between the simulator test platform and the simulator.
[0068] For example, it checks the health status of the communication middleware modules, handles unexpected situations, and ensures the continuity of the simulator test system services. When the simulator test system fails or performance degrades, the daemon takes recovery measures, such as restarting services or reconnecting devices, to minimize the impact on the test process.
[0069] In an embodiment of the present application, by real-time monitoring of the communication status between the simulator test platform and the simulator, it is possible to monitor and maintain the stable operation of the entire simulator test system, which is conducive to timely discovering abnormal communication status between the simulator test platform and the simulator and taking recovery measures, thereby minimizing the impact on the test process.
[0070] In at least one embodiment of the present application, the communication method for simulator testing further includes the following step S700.
[0071] S700: When an error occurs in sending the parsed test instruction, the parsed test instruction is added to a dead letter queue.
[0072] In an embodiment of the present application, if an error occurs when processing a parsed test instruction, the parsed test instruction may be resent to the switch, or sent to a dedicated dead letter queue for subsequent analysis and processing.
[0073] In at least one embodiment of the present application, the communication method for simulator testing further includes the following step S800.
[0074] S800: When the simulator test platform is shut down, the communication channel is closed.
[0075] In the embodiment of the present application, when the automated testing software application on the simulator testing platform is closed or no longer needed, it is ensured that the channels and connections are properly closed to release resources.
[0076] In at least one embodiment of the present application, the communication middleware module is configured to have the function of automatically identifying and processing the objects specified in the test instructions. In this way, by configuring the communication middleware module to automatically identify and process the objects specified in the test instructions, such as updating the data of the simulator subnode, accurate control and data interaction are achieved.
[0077] In at least one embodiment of the present application, the communication middleware module is configured to support asynchronous processing and remote calls, and is integrated with event and data flow management, as well as providing API interface management functions. In this way, the automated test software on the simulator test platform can continue to perform other tasks after sending a message without waiting for a response. This asynchronous processing mechanism significantly improves the response speed and throughput of the simulator test system. At the same time, the communication middleware also integrates event and data flow management, can handle a large number of events and data flows, supports complex routing and filtering rules, and ensures that the correct message is sent to the correct destination. In addition, the communication middleware also provides an API interface management function, which makes the creation, release and management of API (Application Program Interface) simpler, and provides a unified access portal for different clients. In short, the communication middleware module is the key to efficient communication between the automated test software and the simulator, and it greatly simplifies the application integration and development work in a distributed environment.
[0078] At least one embodiment of the present application further provides a communication device for simulator testing, referring to Figure 2 The communication device for simulator testing includes a channel establishing module 11, an instruction parsing module 12, a communication program calling module 13, a queue joining module 14 and a data sending module 15.
[0079] The channel establishment module 11 is used to establish a communication channel between the simulator and the simulator test platform, and obtain the test instructions issued by the simulator test platform. The communication channel is provided by a communication middleware module implemented by RabbitMQ.
[0080] The instruction parsing module 12 is used to parse the test instruction using the communication middleware module, generate the parsed test instruction, and verify the identity of the simulator test platform according to the parsed test instruction.
[0081] The communication program calling module 13 is used to call the corresponding communication program according to the parsed test instruction when the identity authentication of the simulator test platform is successful.
[0082] The queue adding module 14 is used to add the parsed test instruction to the communication queue based on the called communication program.
[0083] The data sending module 15 is used to send the parsed test instructions in the communication queue to the simulator through the communication channel.
[0084] It should be noted that the module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can perform specific functions, which is more suitable for describing the execution process of communication for simulator testing than a program. For the specific implementation method of each module, please refer to the corresponding method embodiment above, which will not be repeated here.
[0085] In some embodiments, the instruction parsing module 12 is specifically used to: parse the test instruction to obtain a parsed test instruction, the parsed test instruction includes a message type, a command length, an ID card identification number and parsed data; and verify the identity of the simulator test platform according to the ID card identification number.
[0086] In some embodiments, the communication program includes at least a message communication program, a command communication program, and a script communication program.
[0087] In some embodiments, the queue joining module 14 is specifically used to: obtain the routing key of the parsed test instruction based on the called communication program; obtain the communication queue corresponding to the parsed test instruction based on the routing key, and then add the parsed test instruction to the communication queue.
[0088] In some embodiments, the communication device for simulator testing further includes a monitoring module, and the monitoring module is used to monitor the communication status between the simulator test platform and the simulator in real time.
[0089] In some embodiments, the communication device for simulator testing further includes an error handling module, and the error handling module is used to add the parsed test instruction to a dead letter queue when an error occurs in sending the parsed test instruction.
[0090] In some embodiments, the communication device for simulator testing further includes a channel closing module, and the channel closing module is used to close the communication channel when the simulator test platform is closed.
[0091] At least one embodiment of the present application further provides an electronic device, referring to Figure 3 The electronic device 10 includes a processor 110 and a memory 120. The processor 110 is used to execute a communication method for simulator testing according to any of the above embodiments of the present application.
[0092] It should be noted that the number of processors 110 may be one or more. Figure 3 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0093] The processor 110 is used to complete various control logics of the electronic device 10, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a digital signal processor (DSP) and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.
[0094] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the communication method for simulator testing in the embodiment of the present application. The processor 110 executes various functional applications and data processing of the electronic device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the communication method for simulator testing in the above method embodiment.
[0095] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating platform, an application required for at least one function; the data storage area may store data created according to the use of the electronic device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely disposed relative to the processor 110, and these remotely disposed memories may be connected to the electronic device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0096] One or more units are stored in the memory 120, and when executed by one or more processors 110, the communication method for simulator testing in any of the above method embodiments is executed, for example, the communication method described above is executed. Figure 1 The method comprises steps S100 to S500.
[0097] At least one embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S500.
[0098] In summary, the communication method and device, equipment, medium and program product for simulator testing provided by the present application first establish a communication channel between the simulator and the simulator test platform, and obtain the test instructions issued by the simulator test platform; then parse the test instructions, generate parsed test instructions, and verify the identity of the simulator test platform according to the parsed test instructions; then when the identity authentication of the simulator test platform is successful, call the corresponding communication program according to the parsed test instructions; then add the parsed data to the communication queue based on the called communication program; finally, send the parsed data in the communication queue to the simulator through the communication channel. Even in the case of unstable network or temporary abnormality of some services, the message queue can store messages to ensure that data is not lost and reliably transmitted, while also improving the scalability and reliability of the system, increasing the flexibility of the entire system, and ensuring that data is safely and reliably transmitted between different system components.
[0099] At least one embodiment of the present application further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, a communication method for simulator testing provided in any of the above embodiments of the present application is implemented.
[0100] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a computer program product that contributes to the prior art, and the computer program product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the simulator test communication method of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program check codes.
[0101] It should be noted that the combination of the various technical features in the embodiments of the present application is not limited to the combination described in the embodiments of the present application or the combination described in the specific embodiments, and all technical features described in the present application can be freely combined or combined in any way unless there is a contradiction between them.
[0102] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the term "comprising" only indicates that the steps and elements that have been clearly identified are included, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0103] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A communication method for simulator testing, characterized in that: include: Establish a communication channel between the simulator and the simulator test platform to obtain the test instructions issued by the simulator test platform. The communication channel is provided by the communication middleware module implemented through RabbitMQ; The communication middleware module is used to parse the test instruction, generate the parsed test instruction, and verify the identity of the simulator test platform according to the parsed test instruction; When the identity authentication of the simulator test platform is successful, the corresponding communication program is called according to the parsed test instructions; Based on the retrieved communication program, the parsed test instructions are added to the communication queue; Send the parsed test instructions in the communication queue to the simulator through the communication channel; Among them, establishing a communication channel between the simulator and the simulator test platform includes: First, initialize the connection of the automated test software on the simulator test platform. When the application of the automated test software starts, establish a connection to the RabbitMQ server and create a communication channel. Then define the switch type and set the parameters; Then create the queue and set the queue's properties; Finally, bind the queue to the switch and specify the routing key.
2. A communication method for simulator testing according to claim 1, characterized in that: The communication middleware module is used to parse the test instructions, generate parsed test instructions, and verify the identity of the simulator test platform according to the parsed test instructions, including: Parsing the test instruction to obtain a parsed test instruction, wherein the parsed test instruction includes a message type, a command length, an ID card identification number, a routing key, and parsed data; The identity of the simulator test platform is verified based on the ID card identification number.
3. A communication method for simulator testing according to claim 2, characterized in that: Based on the retrieved communication program, the parsed test instructions are added to the communication queue, including: Based on the called communication program, obtain the routing key in the parsed test instruction; After obtaining the communication queue corresponding to the parsed test instruction based on the routing key, the parsed test instruction is added to the communication queue.
4. A communication method for simulator testing according to claim 1, characterized in that: Also includes: Real-time monitoring of the communication status between the simulator test platform and the simulator; and / or, When an error occurs in sending the parsed test instruction, the parsed test instruction is added to the dead letter queue; and / or, When the simulator test platform is shut down, the communication channel is closed.
5. A communication method for simulator testing according to any one of claims 1 to 4, characterized in that: The communication middleware module is configured to have one or more functions including automatically identifying and processing objects specified in test instructions, supporting asynchronous processing and remote calls, integrating event and data flow management, and providing API interface management functions.
6. A communication device for simulator testing, characterized in that: It includes channel establishment module, instruction parsing module, communication program calling module, queue joining module and data sending module. The channel establishment module is used to establish a communication channel between the simulator and the simulator test platform, and obtain the test instructions issued by the simulator test platform. The communication channel is provided by a communication middleware module implemented by RabbitMQ. Establishing a communication channel between the simulator and the simulator test platform includes: first initializing the connection of the automated test software on the simulator test platform, establishing a connection to the RabbitMQ server when the application of the automated test software starts, and creating a communication channel; then defining the switch type and setting parameters; then creating a queue and setting the attributes of the queue; finally binding the queue to the switch and specifying the routing key; The instruction parsing module is used to parse the test instruction using the communication middleware module, generate the parsed test instruction, and verify the identity of the simulator test platform according to the parsed test instruction; The communication program calling module is used to call the corresponding communication program according to the parsed test instruction when the identity authentication of the simulator test platform is successful; The queue adding module is used to add the parsed test instruction to the communication queue based on the retrieved communication program; The data sending module is used to send the parsed test instructions in the communication queue to the simulator through the communication channel.
7. An electronic device, characterized in that: include: A processor, configured to execute a communication method for simulator testing as claimed in any one of claims 1 to 5; as well as A memory is used to store executable instructions of the processor.
8. A computer-readable storage medium having computer executable instructions stored thereon, characterized in that: When the executable instructions are executed by the processor, a communication method for simulator testing according to any one of claims 1 to 5 is implemented.
9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, a communication method for simulator testing according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Cloud robot system and implementation method
CN106534338A
Radio frequency coupling test method and device, storage medium and electronic equipment
CN118642899A