Simulator system, simulator, simulation method and device
By introducing a simulator platform, an actuator and a first simulator into the simulator system, dynamically generate and load simulation data packets, the problem of poor simulation degree in the prior art is solved, and more efficient simulation is achieved.
Patent Information
- Application Number
- CN202411706241.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-07
AI Technical Summary
In the prior art, simulators rely heavily on pre-imported interaction signaling data sets and matching rules, and cannot dynamically modify the interactive data, resulting in a greatly increasing difficulty in connecting specific scenarios and poor simulation degree of simulators.
A simulator system is provided, including a simulator platform, an executor and a first simulator. The simulator platform can generate simulation data packets based on real data and simulation data and send them to the executor, which sends the simulation data packets to the first simulator to load and perform simulation tasks.
Through the simulator platform, simulation data packets are generated based on real data and simulation data, the simulation scenarios are expanded, the problem of poor simulation degree of the simulator is solved, and the simulation degree of the simulator is improved.
Smart Images

Figure CN119583361A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communications, and in particular, to a simulator system, a simulator, a simulation method and a device. Background Art
[0002] In related technologies, since the simulator is strongly dependent on pre-imported interaction signaling data sets and matching rules, it is impossible to dynamically modify the interaction data during the docking process, which will greatly increase the difficulty of docking in specific scenarios.
[0003] It can be seen from this that there is a technical problem in the related technology that the simulator has a poor degree of simulation.
[0004] With respect to the above-mentioned problems existing in the related technologies, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a simulator system, a simulator, a simulation method and a device, so as to at least solve the problem of poor simulation degree of the simulator existing in the related art.
[0006] According to one embodiment of the present invention, a simulator system is provided, comprising: a simulator platform, wherein the simulator platform is used to generate a simulation data packet and send the simulation data packet, wherein the simulation data packet is a data packet generated based on real data and simulation data, wherein the real data is data generated by a target device in the process of executing a target business, and the simulation data is data corresponding to a protocol followed in executing the target business; an execution machine, connected to the simulator platform, and used to receive and determine a first simulator corresponding to the simulation data packet, and send the simulation data packet to the first simulator; and the first simulator, which is connected to the execution machine and used to load the simulation data packet and execute a simulation task based on the simulation data packet, wherein the simulation task is used to simulate the target device executing the target business.
[0007] In an exemplary embodiment, the simulator platform is also used to obtain a business database of the target device and send the business database to the execution machine, wherein the business database is used to store service components in the target device; the execution machine is also used to receive the business database and create at least one simulator, and deploy the target service components included in the business database in the created simulator.
[0008] In an exemplary embodiment, the simulator platform is also used to send a service component management instruction to a first execution machine included in the execution machine, wherein the service management instruction is used to instruct management of a target service component of a second simulator connected to the first execution machine; the first execution machine is also used to receive the service component management instruction and send the service component management instruction to the second simulator to instruct the second simulator to manage the target service component based on the service component.
[0009] In an exemplary embodiment, the simulator system also includes a protocol management platform for storing target protocols. The protocol management platform is connected to the simulator platform and is used to send a request protocol requested by the simulator platform to the simulator platform based on a protocol acquisition instruction sent by the simulator platform. The request protocol is a protocol included in the target protocol.
[0010] In an exemplary embodiment, the simulator system also includes a protocol management platform, which is further used to receive protocol management instructions, process the protocol to be managed indicated by the protocol management instructions based on the protocol management instructions, and generate an application component interface based on the processed protocol; the protocol management platform is also used to send the application component interface to a third simulator connected to the second execution machine through a second execution machine included in the execution machine, so as to instruct the third simulator to simulate the application component interface.
[0011] In an exemplary embodiment, the simulator system also includes a protocol agent tool connected to the simulator platform, wherein the protocol agent tool is used to receive data acquisition instructions, determine the real data to be acquired based on the data acquisition instructions, and determine the target device that generates the real data, and when the target device generates the real data, acquire the real data and send the real data to the simulator platform.
[0012] In an exemplary embodiment, the simulator system also includes a user data platform, which is connected to the simulator platform and is used to send multimedia data to the simulator platform to instruct the simulator platform to generate the simulation data packet based on the multimedia data, the real data and the simulation data.
[0013] According to one embodiment of the present invention, a simulator is provided, which is applied to the simulator system as described in the above embodiment, including: an application simulation layer, which is used to receive simulation data packets; an access service component layer, the access service component layer includes at least one service component, which is used to determine the service component to be simulated based on the received simulation data packet, and load the simulation data packet based on the service component.
[0014] In an exemplary embodiment, the simulator further comprises a management layer for receiving a service component management instruction and managing the component indicated by the service component management instruction based on the service component management instruction.
[0015] In an exemplary embodiment, the simulator further includes a system adaptation layer, which is used to encapsulate system calls of different platforms to obtain a target interface, so that the simulator can be deployed to the platform through the target interface.
[0016] According to one embodiment of the present invention, a simulation method is provided, which is applied to the simulator system as described in the above embodiment, including: receiving the simulation data packet sent by the simulator platform; determining the first simulator corresponding to the simulation data packet; sending the simulation data packet to the first simulator to instruct the first simulator to load the simulation data packet and execute the simulation task based on the simulation data packet.
[0017] In an exemplary embodiment, the method also includes: receiving a business database of a target device sent by the simulator platform, wherein the business database is used to store service components in the target device; determining a fourth simulator corresponding to the business database; if the fourth simulator exists, sending the business database to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database; if the fourth simulator does not exist, creating the fourth simulator and sending the business database to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database.
[0018] In an exemplary embodiment, the method further includes: receiving a service component management instruction, wherein the service management instruction is used to instruct management of a target service component of a second simulator; and sending the service component management instruction to the second simulator to instruct the second simulator to manage the target service component based on the service component.
[0019] According to another embodiment of the present invention, a simulation device is also provided, including: a receiving module for receiving a simulation data packet sent by a simulator platform; a determining module for determining a first simulator corresponding to the simulation data packet; and a sending module for sending the simulation data packet to the first simulator to instruct the first simulator to load the simulation data packet and perform a simulation task based on the simulation data packet.
[0020] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0021] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0022] According to yet another embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0023] Through the present invention, the simulator system includes a simulator platform, an execution machine, and a first simulator. The simulator platform can generate a simulation data packet from the real data generated by the target device in the process of executing the target business and the simulation data corresponding to the protocol followed by the execution of the target business, and send it to the execution machine. The execution machine sends the received simulation data packet to the first simulator, and the first simulator can load the simulation data packet and perform the simulation task according to the simulation data packet. Since the simulator platform can generate simulation data packets based on real data and simulation data, the simulation scenario is expanded. Therefore, the problem of poor simulation degree of the simulator existing in the related technology can be solved, thereby achieving the effect of improving the simulation degree of the simulator. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a schematic structural diagram of a simulator system according to an embodiment of the present invention;
[0025] Figure 2 is a schematic diagram of a specific structure of a simulator system according to an embodiment of the present invention;
[0026] Figure 3 is a schematic diagram of the structure of a simulator according to an embodiment of the present invention;
[0027] Figure 4 is a specific architecture diagram of a simulator according to an embodiment of the present invention;
[0028] Figure 5 is a schematic diagram of the format of request and response data according to the method of an embodiment of the present invention;
[0029] Figure 6 is a flow chart of a simulation method according to an embodiment of the present invention;
[0030] Figure 7 is a structural block diagram of a simulation device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0033] In this embodiment, a simulator system is provided. Figure 1 is a schematic diagram of the structure of a simulator system according to an embodiment of the present invention. Figure 1 As shown, the system may include:
[0034] A simulator platform 102, the simulator platform is used to generate a simulation data packet and send the simulation data packet, the simulation data packet is a data packet generated based on real data and simulation data, the real data is data generated by the target device in the process of executing the target business, and the simulation data is data corresponding to the protocol followed by executing the target business;
[0035] An execution machine 104, connected to the simulator platform, configured to receive and determine a first simulator corresponding to the simulation data packet, and send the simulation data packet to the first simulator;
[0036] The first simulator 106 is connected to the execution machine and is used to load the simulation data packet and execute a simulation task based on the simulation data packet, wherein the simulation task is used to simulate the target device executing the target service.
[0037] In the above embodiments, the simulator platform can be a simulation platform or a simulator cloud platform, such as an intelligent simulator cloud platform, etc. The simulator platform can be understood as a subsystem that manages execution machines and simulators, and can include user authority management, resource management, execution machines, and simulator management. The execution machine can be understood as an application, which can be one or more. An execution machine can manage or control one or more simulators, that is, there can be multiple simulators. The simulator can be understood as an application that integrates real devices or system components and can be used to simulate devices or systems. For example, the simulator can be used in the development, testing, and acceptance stages of devices and systems. When the resources of the docking object are limited, the simulator can be used to verify its business function logic.
[0038] In the above embodiment, the target device can be understood as a device that implements the operation, which can be a client or a server, and the target service can be the work that the target device wants to perform. In the process of the target device executing the target service, the simulator platform can obtain the real data of the target device when executing the target service, such as packet capture data, and the interactive protocol data (i.e., the above-mentioned simulation data) of the target device when executing the target service. The simulator platform can generate a Mock data resource set (i.e., the above-mentioned simulation data packet) based on the real data and the interactive protocol data, and the simulator platform can send the above-mentioned simulation data packet to the execution machine for operation. Among them, the Mock data resource set can include protocol data and some other static resources, which can be used for simulator service processing. The packet capture data may include the log of the target device when executing the target service.
[0039] In the above embodiment, the first simulator can be any one of the multiple simulators. When there are multiple execution machines, multiple simulators, and the simulator platform is an intelligent simulator cloud platform, the specific structural diagram of the simulator system can be found in the attached Figure 2 ,like Figure 2 As shown, the simulator platform (i.e., the intelligent simulator cloud platform) can be connected to multiple execution machines, and the execution machines can also be connected to multiple simulators respectively. Users can add execution machines on the simulator platform, and multiple simulators can be added under the execution machine. When an execution machine receives a simulation data packet sent by the intelligent simulator cloud platform, it can determine the simulator that receives the simulation data packet from multiple simulators, and send the simulation data packet to the determined simulator (i.e., the first simulator). When the first simulator receives the simulation data packet sent by the execution machine, it can load the simulation data packet and perform the operation of simulating the target device to perform the target business according to the simulation data packet (i.e., the above-mentioned simulation task).
[0040] Through the present invention, the simulator system includes a simulator platform, an execution machine, and a first simulator. The simulator platform can generate a simulation data packet from the real data generated by the target device in the process of executing the target business and the simulation data corresponding to the protocol followed by the execution of the target business, and send it to the execution machine. The execution machine sends the received simulation data packet to the first simulator, and the first simulator can load the simulation data packet and perform the simulation task according to the simulation data packet. Since the simulator platform can generate simulation data packets based on real data and simulation data, the simulation scenario is expanded. Therefore, the problem of poor simulation degree of the simulator existing in the related technology can be solved, thereby achieving the effect of improving the simulation degree of the simulator.
[0041] In an exemplary embodiment, the simulator platform is also used to obtain a business database of the target device and send the business database to the execution machine, wherein the business database is used to store service components in the target device; the execution machine is also used to receive the business database and create at least one simulator, and deploy the target service components included in the business database in the created simulator.
[0042] In the above embodiment, the business database can store all service components in the target device. Among them, the service component can be one or more. The simulator platform can obtain the business database and send it to the executor. The executor can send the business database to the simulator, and the simulator can automatically combine and extract the service components that need to be installed in the business database. For example, the business database may include service components A, B, C, D, E, and F. The executor can send the business database to simulator 1, simulator 2, simulator 3, and simulator 4. Simulator 1 can deploy A, C, and F, simulator 2 can deploy A, B, and C, simulator 3 can deploy A, B, C, D, E, and F, and simulator 4 can deploy D, E, and F. It should be noted that when the executor creates a simulator, the service components that need to be installed and deployed for each simulator can be determined according to the installation and deployment instructions. The installation and deployment instructions can include identification information of the service components that need to be installed and deployed for each simulator.
[0043] In an exemplary embodiment, the simulator platform is also used to send a service component management instruction to a first execution machine included in the execution machine, wherein the service management instruction is used to instruct management of a target service component of a second simulator connected to the first execution machine; the first execution machine is also used to receive the service component management instruction and send the service component management instruction to the second simulator to instruct the second simulator to manage the target service component based on the service component.
[0044] In the above embodiment, the simulation platform can send a service component management instruction to the first execution machine, and the execution machine can manage the simulator and send the received service component management instruction to the second simulator. Among them, the service component management instruction can be used to manage the target service component in the second simulator, including adding the target service component in the second simulator, deleting the target service component, modifying the target service component, viewing the target service component, etc. The second simulator can be one or more. When the second simulator is multiple, batch management of the simulator is realized. Through batch operations on the simulator, a good foundation can be laid for the access pressure and performance testing of the device. The second simulator can add and uninstall access modules, that is, service components, according to the service component management instruction, which can make the simulator application more flexible and personalized. Among them, the first execution machine can be any one of the execution machines, and the second simulator can also be any one of the simulators. In this embodiment, the simulator can start loading Mock data and each access service component under the simulator, and manage the target service component according to the received service component management instruction.
[0045] In an exemplary embodiment, the simulator system also includes a protocol management platform for storing target protocols. The protocol management platform is connected to the simulator platform and is used to send a request protocol requested by the simulator platform to the simulator platform based on a protocol acquisition instruction sent by the simulator platform. The request protocol is a protocol included in the target protocol.
[0046] In the above embodiment, the simulator system may further include a protocol management platform, which may be understood as a visual online platform that can be used to manage network interaction protocols. Figure 2 ,like Figure 2 As shown, the simulator platform is connected to the protocol management platform. The simulator platform can initiate a request to the protocol management platform, and the protocol management platform can send a request protocol containing the target protocol required to process the target task to the simulator platform based on the request.
[0047] In an exemplary embodiment, the simulator system also includes a protocol management platform, which is further used to receive protocol management instructions, process the protocol to be managed indicated by the protocol management instructions based on the protocol management instructions, and generate an application component interface based on the processed protocol; the protocol management platform is also used to send the application component interface to a third simulator connected to the second execution machine through a second execution machine included in the execution machine, so as to instruct the third simulator to simulate the application component interface.
[0048] In the above embodiment, the protocol management platform can be responsible for the standardized management of private protocols. Users can view all protocols on the protocol management platform, add and delete protocols, and edit the use case values of each field in the protocol, but they must meet the five types of standardized template definitions of the interface protocol document. The protocol management platform can automatically verify the legality of the protocol. When the changed protocol is illegal, an alarm reminder will be triggered. After receiving the protocol management instructions issued by the user, the protocol management platform can use low code to automatically generate an application component interface. Among them, the five types of interface protocol documents can include events, states, configurations, methods, and notifications. They can be stored in the cache in key-value form, and the value can be passively modified according to the needs of the target business. The application component interface can be equivalent to a protocol, which can be divided into field content, field names, combinations of field names, Mock data composed of field names and content, and the format of Mock data. The format of Mock data can be defined from Mock data according to the field names, input parameters, and output parameters in the replacement template. In this embodiment, the protocol management platform can also send the application component interface to the second execution machine, the second execution machine sends the application component interface to the third simulator, and the third simulator simulates the application component interface according to the instruction. The second execution machine can be any one of a plurality of execution machines, and the third simulator can be any one of a plurality of simulators. Mock data can be input according to user customization, and support the addition, deletion, query and modification of data. The operation is simple, and the simulator can be more personalized.
[0049] In an exemplary embodiment, the simulator system also includes a protocol agent tool connected to the simulator platform, wherein the protocol agent tool is used to receive data acquisition instructions, determine the real data to be acquired based on the data acquisition instructions, and determine the target device that generates the real data, and when the target device generates the real data, acquire the real data and send the real data to the simulator platform.
[0050] In the above embodiment, the simulator system may further include a protocol proxy tool, which may be understood as a visual interface that may be used to obtain protocol interaction data information, such as Figure 2 As shown, the protocol proxy tool is connected to the simulator platform and can receive a data acquisition instruction. Through the data acquisition instruction, the real data generated by the target device in the process of executing the target business can be determined, and the real data can be sent to the simulator platform. In this embodiment, users can obtain the required device interaction process information according to their respective needs. The protocol proxy tool can capture the interaction protocol data between the target device and the real platform, that is, the real data, and import the real data into its own simulator for loading and interacting with the simulator platform.
[0051] In an exemplary embodiment, the simulator system also includes a user data platform, which is connected to the simulator platform and is used to send multimedia data to the simulator platform to instruct the simulator platform to generate the simulation data packet based on the multimedia data, the real data and the simulation data.
[0052] In the above embodiment, the simulator system also includes a user data platform, such as Figure 2 As shown, the user data platform can be directly connected to the intelligent simulator cloud platform. Users can import audio resources, picture resources, video resources, etc. (i.e., the above-mentioned multimedia data) on the user data platform, and can combine multimedia data with simulation data to form a Mock data set (i.e., the above-mentioned simulation data packet).
[0053] The simulator system may include: a protocol management platform, a protocol proxy tool, a user data platform, an intelligent simulator cloud platform, multiple execution machines, and multiple simulators, wherein the protocol management platform may be deployed on a first server, the intelligent simulator cloud platform may be deployed on a second server, and the execution machines and simulators may be deployed on a third server. The protocol management platform is connected to the intelligent simulator cloud platform, the user data platform is connected to the intelligent simulator cloud platform, the protocol proxy tool is connected to the intelligent simulator cloud platform, the intelligent simulator cloud platform is connected to multiple execution machines, and the execution machines are connected to multiple simulators.
[0054] In the above embodiment, the user can add Mock data on the protocol management platform, and the intelligent simulator cloud platform can directly access the acquisition protocol and use low-code technology to automatically generate request, response and notification Mock data of the application interface. The user obtains packet capture information on the protocol proxy tool side, and can obtain Mock data of the interactive protocol during the interaction process on the intelligent simulator cloud platform. Users can also import pictures, audio, and video according to their needs, and together with the data of the above-mentioned interactive protocol, they form a Mock data resource set.
[0055] In the above embodiment, the user can add an execution machine deployed in the third server on the intelligent simulator cloud platform. The execution machine can create a simulator composed of multiple different access components. Each simulator can be bound to its own Mock data, and all Mock data can be shared online. The access component for building the simulator can be a plug-in, which is an access module from a real device, and can be automatically updated and replaced with the iteration of device functions and systems. At the same time, the access module can be added, deleted, and edited according to needs, which can make the simulator application more flexible and more user-friendly. During the operation of the simulator, Mock data can be loaded, and each access component under the simulator can be loaded at the same time. It can also be used to test the access module of the real target device and test the access service of the docking target device. The execution machine can communicate with the intelligent simulator cloud platform and the simulator. Communicating with the intelligent simulator cloud platform can be to synchronize the Mock data and access plug-ins issued by the platform to the simulator, and start the simulator through the instructions issued by the platform. Communicating with the simulator can be to control the services inside the simulator, which can include loading, unloading access plug-ins and starting or stopping access services. The execution machine can manage the simulator, and by configuring to support single and batch operations on the simulator, it can lay a good foundation for the access pressure and performance testing of the device.
[0056] In this embodiment, a simulator running on the above simulator system is provided. Figure 3 is a schematic diagram of the structure of a simulator according to an embodiment of the present invention, such as Figure 3 As shown, the simulator may include:
[0057] The application simulation layer 302 is used to receive simulation data packets;
[0058] The access service component layer 304 includes at least one service component, which is used to determine the service component to be simulated based on the received simulation data packet, and load the simulation data packet based on the service component.
[0059] In the above embodiment, the simulator may be a simulation device running on a server, which can fully simulate all access protocols supported by a device such as a camera device. Figure 4 is a specific architecture diagram of a simulator according to an embodiment of the present invention, such as Figure 4 As shown, the application Mock layer (i.e., the above-mentioned application simulation layer) can include streaming media interfaces, configuration interfaces, event interfaces, etc., which can be used to realize the generation of interfaces for all access service components. The interfaces can be automatically generated using low-code through the protocol of the protocol management platform, and the corresponding simulation data packets in the obtained simulator buffer can be processed as the output of the interface. Among them, the streaming media interface can be realized by reading and writing files.
[0060] In the above embodiment, the access service component layer can be used to abstract the private protocol and support dynamic loading and downloading, that is, the simulation degree of the simulator can be improved. Private protocols can be divided into five types according to their functions: events, states, configurations, methods, and notifications. Their data formats can all be set to JSON format. For example, the format of the method request and response data can be found in Figure 5 ,like Figure 5 As shown, the interface design can be to add a corresponding method name function under the corresponding service component name, the output parameter can be A, the output parameter can be B, and the format can be JSON type.
[0061] In the above embodiment, the access service component layer may include multiple service components. The service component can be understood as a plug-in from a real access module. All service components rely on a unified application component. It can be updated and replaced without perception as the device and system functions are iterated, for example: ONVIF (OpenNetwok Video InterfaceForem, open network video interface) component, GB28181 (GB18181 protocol) component, CGI (Common GatewayInterface, common gateway interface) component, MQTT (Message Queuing Telemetry, message queue telemetry transmission) component, private component and RPC (Remote Procedure Call, remote procedure call) component, etc.
[0062] In the above embodiment, the service components of the simulator can be freely combined, and each simulator can be bound to its own Mock data. After receiving the Mock data, the simulator can determine the service components to be simulated under the simulator based on the loading of the simulation data packet. The simulator in working state can also be used to test the access module of the target device, and can also test the access service of the target device.
[0063] Through the present invention, the simulator includes an application simulation layer and an access service component layer. The application simulation layer can receive a simulation data packet. The access service component layer includes multiple service components. The corresponding service component to be simulated can be determined according to the simulation data packet, and the simulation data packet is loaded based on the determined service component. Since the corresponding service component can be determined according to the simulation data packet, the simulation scenario can be expanded. Therefore, the problem of poor simulation degree of the simulator existing in the related art can be solved, thereby achieving the effect of improving the simulation degree of the simulator.
[0064] In an exemplary embodiment, the simulator further comprises a management layer for receiving a service component management instruction and managing the component indicated by the service component management instruction based on the service component management instruction.
[0065] In the above embodiment, if Figure 4 As shown, the simulator can also include a management layer, which can be used for simulator configuration management, service management, and Mock data management (i.e., use case management in the figure), etc. Configuration management can include various service-related configurations, such as startup ports, etc. Service management can include operations such as loading, unloading, and starting and stopping of various services, and Mock data management can include loading of Mock data, etc.
[0066] In an exemplary embodiment, the simulator further includes a system adaptation layer, which is used to encapsulate system calls of different platforms to obtain a target interface, so that the simulator can be deployed to the platform through the target interface.
[0067] In the above embodiment, if Figure 4 As shown, the simulator can also include a system adaptation layer, which can include Window implementation, MacOS implementation, and Linux implementation (i.e., the above different platforms) interfaces, and can encapsulate system calls of different platforms to obtain the same target interface. The simulator's system adaptation layer can use a real device or a system module library, and can support cross-platform deployment through the same target interface, which can achieve a higher degree of simulation and a scene closer to the real device.
[0068] In this embodiment, a simulation method running on the above simulator system is provided. Figure 6 is a flow chart of a simulation method according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:
[0069] Step S602, receiving the simulation data packet sent by the simulator platform;
[0070] Step S604, determining the first simulator corresponding to the simulation data packet;
[0071] Step S606: Send the simulation data packet to the first simulator to instruct the first simulator to load the simulation data packet and execute the simulation task based on the simulation data packet.
[0072] In the above embodiments, the simulator platform can be a simulation platform or a simulator cloud platform, such as an intelligent simulator cloud platform, etc. The simulator platform can be understood as a subsystem that manages the execution machine and the simulator, which can include user authority management, resource management, execution machine and simulator management. The simulator can be understood as an application that integrates real devices or system components and can be used to simulate devices or systems. For example, the simulator can be used in the development, testing and acceptance stages of devices and systems. When the resources of the docking object are limited, the simulator can be used to verify its business function logic. The simulator can be one or more, that is, the first simulator can be any one of multiple simulators.
[0073] In the above embodiment, the simulation data packet can be a Mock data resource set, which can include real data and simulation data, wherein the real data can be understood as the real data generated when the target device executes the target business; the simulation data can be understood as the interactive protocol data in the simulator platform interaction process. After the execution machine receives the simulation data packet sent by the simulator platform, it can determine the first simulator corresponding to the simulation data packet, and send the simulation data packet to the first simulator to instruct the first simulator to load the simulation data packet and execute the simulation task according to the simulation data packet. Among them, the Mock data resource set can contain protocol data and some other static resources, which can be used for simulator business processing.
[0074] In the above embodiment, the first simulator can be any one of the multiple simulators. When there are multiple execution machines, multiple simulators, and the simulator platform is an intelligent simulator cloud platform, the specific structural diagram of the simulator system can be found in the attached Figure 2 ,like Figure 2 As shown, the simulator platform (i.e., the intelligent simulator cloud platform) can be connected to multiple execution machines, and the execution machines can also be connected to multiple simulators respectively. Users can add execution machines on the simulator platform, and multiple simulators can be added under the execution machine. When an execution machine receives a simulation data packet sent by the intelligent simulator cloud platform, it can determine the simulator that receives the simulation data packet from multiple simulators, and send the simulation data packet to the determined simulator (i.e., the first simulator). When the first simulator receives the simulation data packet sent by the execution machine, it can load the simulation data packet and perform the operation of simulating the target device to perform the target business according to the simulation data packet (i.e., the above-mentioned simulation task).
[0075] In the above embodiment, the simulator system may further include a protocol management platform for storing the target protocol, the protocol management platform being connected to the simulator platform and being used to send the request protocol requested by the simulator platform to the simulator platform based on the protocol acquisition instruction sent by the simulator platform, the request protocol being the protocol included in the target protocol. In this embodiment, the protocol management platform may be understood as a visual online platform that may be used to manage network interaction protocols. Figure 2 ,like Figure 2 As shown, the simulator platform is connected to the protocol management platform, and the simulator platform can initiate a request to the protocol management platform, and the protocol management platform can send a request protocol containing the target protocol required to process the target task to the simulator platform according to the request. In this embodiment, the protocol management platform is also used to receive a protocol management instruction, process the protocol to be managed indicated by the protocol management instruction based on the protocol management instruction, and generate an application component interface based on the processed protocol; the protocol management platform is also used to send the application component interface to a third simulator connected to the second execution machine included in the execution machine through the second execution machine, so as to instruct the third simulator to simulate the application component interface.
[0076] In the above embodiment, the protocol management platform can be responsible for the standardized management of private protocols. Users can view all protocols on the protocol management platform, add and delete protocols, and edit the use case values of each field in the protocol, but they must meet the five types of standardized template definitions of the interface protocol document. The protocol management platform can automatically verify the legality of the protocol. When the changed protocol is illegal, an alarm reminder will be triggered. After receiving the protocol management instructions issued by the user, the protocol management platform can use low code to automatically generate an application component interface. Among them, the five types of interface protocol documents can include events, states, configurations, methods, and notifications. They can be stored in the cache in key-value form, and the value can be passively modified according to the needs of the target business. The application component interface can be equivalent to a protocol, which can be divided into field content, field names, combinations of field names, Mock data composed of field names and content, and the format of Mock data. The format of Mock data can be defined from Mock data according to the field names, input parameters, and output parameters in the replacement template. In this embodiment, the protocol management platform can also send the application component interface to the second execution machine, the second execution machine sends the application component interface to the third simulator, and the third simulator simulates the application component interface according to the instruction. The second execution machine can be any one of a plurality of execution machines, and the third simulator can be any one of a plurality of simulators. Mock data can be input according to user customization, and support the addition, deletion, query and modification of data. The operation is simple, and the simulator can be more personalized.
[0077] In the above embodiment, the simulator system also includes a protocol agent tool connected to the simulator platform, and the protocol agent tool is used to receive data acquisition instructions, determine the real data to be acquired and the target device that generates the real data based on the data acquisition instructions, and acquire the real data when the target device generates the real data, and send the real data to the simulator platform.
[0078] In the above embodiment, the simulator system may further include a protocol proxy tool, which may be understood as a visual interface that may be used to obtain protocol interaction data information, such as Figure 2 As shown, the protocol proxy tool is connected to the simulator platform and can receive a data acquisition instruction. The real data generated by the target device in the process of executing the target business can be determined through the data acquisition instruction, and the real data can be sent to the simulator platform. In this embodiment, users can obtain the required device interaction process information according to their respective needs. The protocol proxy tool can capture the interaction protocol data between the target device and the simulator platform, that is, the real data, and import the real data into its own simulator for loading and interacting with the simulator platform.
[0079] In the above embodiment, the simulator system also includes a user data platform, which is connected to the simulator platform and is used to send multimedia data to the simulator platform to instruct the simulator platform to generate the simulation data packet based on the multimedia data, the real data and the simulation data.
[0080] In the above embodiment, the simulator may be a simulation device running on a server, which can fully simulate all access protocols supported by a device such as a camera device. Figure 4 is a specific architecture diagram of a simulator according to an embodiment of the present invention, such as Figure 4 As shown, the application Mock layer (i.e., the above-mentioned application simulation layer) can include streaming media interfaces, configuration interfaces, event interfaces, etc., which can be used to realize the generation of interfaces for all access service components. The interfaces can be automatically generated using low-code through the protocol of the protocol management platform, and the corresponding simulation data packets in the obtained simulator buffer can be processed as the output of the interface. Among them, the streaming media interface can be realized by reading and writing files.
[0081] In the above embodiment, the access service component layer can be used to abstract the private protocol and support dynamic loading and downloading, that is, the simulation degree of the simulator can be improved. Private protocols can be divided into five types according to their functions: events, states, configurations, methods, and notifications. Their data formats can all be set to JSON format. For example, the format of the method request and response data can be found in Figure 5,like Figure 5 As shown, the interface design can be to add a corresponding method name function under the corresponding service component name, the output parameter can be A, the output parameter can be B, and the format can be JSON type.
[0082] In the above embodiment, the access service component layer may include multiple service components. The service component can be understood as a plug-in from a real access module. All service components rely on a unified application component. It can be updated and replaced without perception as the device and system functions are iterated, for example: ONVIF (OpenNetwok Video InterfaceForem, open network video interface) component, GB28181 (GB18181 protocol) component, CGI (Common GatewayInterface, common gateway interface) component, MQTT (Message Queuing Telemetry, message queue telemetry transmission) component, private component and RPC (Remote Procedure Call, remote procedure call) component, etc.
[0083] In the above embodiment, the service components of the simulator can be freely combined, and each simulator can be bound to its own Mock data. After receiving the Mock data, the simulator can determine the service components to be simulated under the simulator based on the loading of the simulation data packet. The simulator in working state can also be used to test the access module of the target device, and can also test the access service of the target device.
[0084] In the above embodiment, if Figure 4 As shown, the simulator can also include a management layer, which can be used for simulator configuration management, service management, and Mock data management (i.e., use case management in the figure), etc. Configuration management can include various service-related configurations, such as startup ports, etc. Service management can include operations such as loading, unloading, and starting and stopping of various services, and Mock data management can include loading of Mock data, etc.
[0085] In the above embodiment, if Figure 4 As shown, the simulator can also include a system adaptation layer, which can include Window implementation, MacOS implementation, and Linux implementation (i.e., the above different platforms) interfaces, and can encapsulate system calls of different platforms to obtain the same target interface. The simulator's system adaptation layer can use real devices or system module libraries, and can support cross-platform deployment through different target interfaces, which can achieve a higher degree of simulation and a scene closer to the real device.
[0086] Optionally, the execution subject of the above steps may be an execution machine, but is not limited thereto.
[0087] Through the present invention, after receiving the simulation data packet sent by the simulator platform, the first simulator corresponding to the simulation data packet can be determined, and the simulation data packet can be sent to the first simulator to indicate that the first simulator can load the simulation data packet and perform the simulation task according to the simulation data packet. Since the corresponding simulator can be determined by the simulation data packet, and the simulator can be instructed to perform the simulation operation according to the simulation data packet, the problem of poor simulation degree of the simulator existing in the related art can be solved, thereby achieving the effect of improving the simulation degree of the simulator.
[0088] In an exemplary embodiment, the method also includes: receiving a business database of a target device sent by the simulator platform, wherein the business database is used to store service components in the target device; determining a fourth simulator corresponding to the business database; if the fourth simulator exists, sending the business database to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database; if the fourth simulator does not exist, creating the fourth simulator and sending the business database to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database.
[0089] In the above embodiment, the business database can store all service components in the target device. Among them, the service component can be one or more. The executor can send the business database to the simulator, and the simulator can automatically combine and extract the service components that need to be installed in the business database. For example, the business database may include service components A, B, C, D, E, and F. The executor can send the business database to simulator 1, simulator 2, simulator 3, and simulator 4. Simulator 1 can deploy A, C, and F, simulator 2 can deploy A, B, and C, simulator 3 can deploy A, B, C, D, E, and F, and simulator 4 can deploy D, E, and F. It should be noted that when the executor creates a simulator, the service components that need to be installed and deployed for each simulator can be determined according to the installation and deployment instructions. The installation and deployment instructions can include identification information of the service components that need to be installed and deployed for each simulator.
[0090] In the above embodiment, the execution machine can determine whether the fourth simulator exists. When the fourth simulator exists, the execution machine can directly send the business database to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database; when the fourth simulator does not exist, the execution machine can create a simulator corresponding to the service component, and the service components required to execute the target service in the business database can be deployed in the created simulator, wherein the fourth simulator can be any one of multiple simulators, and the simulators created according to the business database can be one or more.
[0091] In an exemplary embodiment, the method further includes: receiving a service component management instruction, wherein the service management instruction is used to instruct management of a target service component of a second simulator; and sending the service component management instruction to the second simulator to instruct the second simulator to manage the target service component based on the service component.
[0092] In the above embodiment, the execution machine can manage the simulator and send the received service component management instructions to the second simulator, wherein the service component management instructions can be used to manage the target service component in the second simulator, including adding the target service component in the second simulator, deleting the target service component, modifying the target service component, viewing the target service component, etc. The second simulator can be one or more. When there are multiple second simulators, batch management of the simulators is achieved. Through batch operations on the simulators, a good foundation can be laid for the access pressure and performance testing of the equipment. The second simulator can add and uninstall access modules according to the service component management instructions, which can make the simulator application more flexible and personalized. Among them, the second simulator can also be any one of the simulators. In this embodiment, the simulator can start loading Mock data and each access service component under the simulator, and manage the target service component according to the received service component management instructions.
[0093] In the above embodiment, in addition to obtaining Mock data by packet capture, low-code technology can also be used to automatically generate data based on the protocol document, which can make the data richer and greatly reduce labor costs, and avoid scenarios where Mock data is incomplete due to factors such as network packet capture and packet loss. By configuring support for batch creation of simulators, operations can be made simpler. Accessing the business module library can support plug-and-play of simulators, and the functions of the simulators can be freely combined. On the basis of the adaptation of the server function interface to the target service, the simulation function of the simulator can be realized if the protocol document meets certain regular formats.
[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0095] In the present embodiment, a simulation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.
[0096] Figure 7 is a structural block diagram of a simulation device according to an embodiment of the present invention. Figure 7 As shown, the device comprises:
[0097] The receiving module 702 is used to receive the simulation data packet sent by the simulator platform;
[0098] A determination module 704, configured to determine a first simulator corresponding to the simulation data packet;
[0099] The sending module 706 is used to send the simulation data packet to the first simulator to instruct the first simulator to load the simulation data packet and perform a simulation task based on the simulation data packet.
[0100] In an exemplary embodiment, the apparatus may be used to receive a business database of a target device sent by the simulator platform, wherein the business database is used to store service components in the target device; determine a fourth simulator corresponding to the business database; if the fourth simulator exists, send the business database to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database; if the fourth simulator does not exist, create the fourth simulator and send the business database to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database.
[0101] In an exemplary embodiment, the device can also be used to receive service component management instructions, wherein the service management instructions are used to instruct management of a target service component of a second simulator; and send the service component management instructions to the second simulator to instruct the second simulator to manage the target service component based on the service component.
[0102] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0103] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0104] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0105] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0106] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0107] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method in each embodiment of the present application when the computer program is executed by a processor.
[0108] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0109] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A simulator system, characterized in that: include: A simulator platform, the simulator platform is used to generate a simulation data packet and send the simulation data packet, the simulation data packet is a data packet generated based on real data and simulation data, the real data is data generated by the target device in the process of executing the target business, and the simulation data is data corresponding to the protocol followed by executing the target business; an execution machine, connected to the simulator platform, for receiving and determining a first simulator corresponding to the simulation data packet, and sending the simulation data packet to the first simulator; The first simulator is connected to the execution machine and is used to load the simulation data packet and execute a simulation task based on the simulation data packet, wherein the simulation task is used to simulate the target device executing the target business.
2. The simulator system according to claim 1, characterized in that: The simulator platform is also used to obtain a service database of the target device and send the service database to the execution machine, wherein the service database is used to store service components in the target device; The execution machine is further used to receive the business database, create at least one simulator, and deploy the target service component included in the business database in the created simulator.
3. The simulator system according to claim 1, characterized in that: The simulator platform is further used to send a service component management instruction to a first execution machine included in the execution machines, wherein the service management instruction is used to instruct to manage a target service component of a second simulator connected to the first execution machine; The first execution machine is further configured to receive the service component management instruction and send the service component management instruction to the second simulator to instruct the second simulator to manage the target service component based on the service component.
4. The simulator system according to claim 1, characterized in that: The simulator system also includes a protocol management platform for storing the target protocol. The protocol management platform is connected to the simulator platform and is used to send a request protocol requested by the simulator platform to the simulator platform based on a protocol acquisition instruction sent by the simulator platform. The request protocol is a protocol included in the target protocol.
5. The simulator system according to claim 1, characterized in that: The simulator system also includes a protocol management platform, which is further used to receive a protocol management instruction, process the protocol to be managed indicated by the protocol management instruction based on the protocol management instruction, and generate an application component interface based on the processed protocol; The protocol management platform is also used to send the application component interface to a third simulator connected to the second execution machine through a second execution machine included in the execution machine, so as to instruct the third simulator to simulate the application component interface.
6. The simulator system according to claim 1, characterized in that: The simulator system also includes a protocol agent tool connected to the simulator platform. The protocol agent tool is used to receive data acquisition instructions, determine the real data to be acquired based on the data acquisition instructions, and determine the target device that generates the real data, and when the target device generates the real data, acquire the real data and send the real data to the simulator platform.
7. The simulator system according to claim 1, characterized in that: The simulator system also includes a user data platform, which is connected to the simulator platform and is used to send multimedia data to the simulator platform to instruct the simulator platform to generate the simulation data packet based on the multimedia data, the real data and the simulation data.
8. A simulator, characterized in that: A simulator system as claimed in any one of claims 1 to 7, comprising: Application emulation layer, used to receive emulation data packets; The access service component layer includes at least one service component, which is used to determine the service component to be simulated based on the received simulation data packet, and load the simulation data packet based on the service component.
9. The simulator according to claim 8, characterized in that The simulator also includes a management layer for receiving a service component management instruction and managing the component indicated by the service component management instruction based on the service component management instruction.
10. The simulator according to claim 8, characterized in that The simulator also includes a system adaptation layer, which is used to encapsulate system calls of different platforms to obtain a target interface, so that the simulator can be deployed to the platform through the target interface.
11. A simulation method, characterized in that: Applicable to the simulator system according to any one of claims 1 to 7, comprising: Receiving the simulation data packet sent by the simulator platform; Determine the first simulator corresponding to the simulation data packet; The simulation data packet is sent to the first simulator to instruct the first simulator to load the simulation data packet and execute the simulation task based on the simulation data packet.
12. The simulation method according to claim 11, characterized in that: The method further comprises: Receiving a business database of a target device sent by the simulator platform, wherein the business database is used to store service components in the target device; Determining a fourth simulator corresponding to the business database; In the case where the fourth simulator exists, sending the business database to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database; In the case that the fourth simulator does not exist, the fourth simulator is created, and the business database is sent to the fourth simulator to instruct the fourth simulator to deploy the service components in the business database.
13. The simulation method according to claim 11, characterized in that: The method further comprises: receiving a service component management instruction, wherein the service management instruction is used to instruct management of a target service component of the second simulator; The service component management instruction is sent to the second simulator to instruct the second simulator to manage the target service component based on the service component.
14. A simulation device, characterized in that: include: A receiving module, used for receiving simulation data packets sent by the simulator platform; A determination module, used to determine a first simulator corresponding to the simulation data packet; The sending module is used to send the simulation data packet to the first simulator to instruct the first simulator to load the simulation data packet and perform a simulation task based on the simulation data packet.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 11 to 13 when executed.
16. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 11 to 13.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 11 to 13 are implemented.