# US 2019/0317791 A1 · Running method for embedded type virtual device and system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2019/0317791 A1
- Document ID: US20190317791A1
- Status: Published application
- Kind: A1
- Application number: 16/343,389
- Filed: 2017-05-26
- Published: 2019-10-17
- Earliest claimed: 2016-10-20
- Assignees: Nr Electric Co., Ltd; Nr Engineering Co., Ltd
- Applicants: Nr Electric Co., Ltd; Nr Engineering Co., Ltd
- Inventors: Hongjun CHEN; Qiang ZHOU; Jifeng WEN; Jiuhu LI; Dongfang XU; Guanghua LI; Wei LIU; Dewen LI; Lei ZHOU; Tianen ZHAO
- Web page: https://patentgrep.com/patent/US20190317791A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 9/451: Execution arrangements for user interfaces
- G06F 9/45504: {Abstract machines for program code execution, e.g. Java virtual machine [JVM], interpreters or emulators}
- G06F 11/364: {tracing values on a bus}
- G06F 2009/4557: {Distribution of virtual machine instances; Migration and load balancing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed by the present invention are a running method for an embedded type virtual device and a system, an embedded type device being divided into a managing process, a plurality of real-time modules and a plurality of non-real-time modules. The managing process reading a configuration file, loading real-time and non-real-time module libraries of each processor and completing initialization interaction by means of a virtual controller area network (CAN) bus and first in, first out (FIFO) communication. The managing process starting a real-time thread and serially scheduling real-time task according to a task period setting relation. The managing process starting a plurality of non-real-time threads, calling a period task of a non-real-time module and carrying out parallel communication with a plurality of debugging clients. The real-time modules exchange data with each other by means of a virtual data bus, and the real-time modules exchange data with the non-real-time modules by means of a sharing memory.

## Claims

### Claim 1

A running method for an embedded type virtual device, wherein the method comprises the following specific steps:
step 1: simulation information is set, a virtual managing process of an embedded type device is started, and the virtual managing process reads the configuration file of the device, acquires the configuration information of hardware, loads the real-time module of each processor, acquires the process configuration information of a main CPU, and loads the corresponding non-real-time module; the virtual managing process reads the man-machine communication configuration information in the configuration file, and creates a configuration sharing memory;
when loading modules, the virtual managing process extracts and records a predefined module export function address;
step 2: the virtual managing process carries out initialization interaction by means of a virtual CAN bus and the real-time modules according to a hardware statement order, and the virtual managing process gathers the data exchange information of each real-time module and creates a data bus; the virtual managing process carries out initialization interaction by means of virtual FIFO and the non-real-time modules according to a non-real-time process statement order in the configuration file;
step 3: the virtual managing process starts a virtual real-time task scheduling thread, calls an export interface predefined by the real-time modules, and serially schedules the real-time tasks in each period in grades; the virtual managing process starts a plurality of non-real-time threads, calls period tasks of non-real-time modules, and carries out parallel communication with a plurality of debugging clients; and
step 4: in the running process of the virtual device, the real-time modules acquire interactive data between processors based on the data bus, and the real-time modules exchange data with the non-real-time modules based on the sharing memory; the real-time SLAVE module refreshes the variable agents of the non-real-time modules to the data bus so as to be transferred to other processors.

### Claim 2 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 1, the real-time module of a DSP processor is a dynamic link library and is compiled by an operating system-less application program of the embedded type device and a virtual system library of the DSP;
the real-time module SLAVE of a main CPU is a dynamic link library and is compiled by a real-time program developed by the embedded type device based on an operating system after transplantation and reconstruction and a virtual real-time system library of the main CPU;
the non-real-time module is compiled by a non-real-time program developed by the embedded type device based on the operating system after transplantation and reconstruction and a virtual non-real-time system library of the main CPU; and based on a virtual platform library of a PC, the compiling environment of the application program of the device is switched to realize recompilation, and a virtual simulation device and an actual device share the same configuration file.

### Claim 3 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 3, the tasks of each real-time module are serially managed according to the period grade, the virtual real-time task scheduling thread calculates the least common multiple of a plurality of real-time task periods of the device, the least common multiple is taken as a step size cycle, and when the step sizes are accumulated to the period value of the corresponding grade, the task of this grade is called and the time mark of the virtual device is updated to the sharing memory.

### Claim 4 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 3, the virtual real-time task scheduling thread carries out scheduling according to an order of data bus reading, real-time task operation and data bus writing so as to accurately simulate one point delay of a parallel bus of the embedded type device;
or the virtual real-time task scheduling thread carries out scheduling according to an order of data bus reading, data bus writing and real-time task operation so as to accurately simulate two point delays of a serial bus of the embedded type device.

### Claim 5 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 3, a period calling interface of a non-real-time thread supports communication message receiving and transmitting tasks based on event trigger, and supports reading of the actual time of a PC to execute a millisecond-grade period task.

### Claim 6 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 4, the real-time module SLAVE creates a circular buffer area, stores the second-grade data accumulated by the data bus, and is used for recording a plurality of period data before recording trigger during recording of the virtual device; and the non-real-time module reads the data of the corresponding point from the buffer area according to the current virtual time mark in the sharing memory so as to be transferred to a debugging client to be displayed.

### Claim 7 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 1, after the virtual managing process is started, the prompt information in initialization and running processes of the virtual device is displayed in real time by means of output redirection.

### Claim 8 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 1, the simulation modes supported by the simulation information comprise specified Comtrade waveform file input, PSCAD/Hypersim data array input, process layer network GOOSE data or null data.

### Claim 9 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 1, Makefile is formed by importing a directory of application programs, and a dynamic link library of the application programs is formed by calling a PC compiler.

### Claim 10 (depends on 1)

The running method for the embedded type virtual device according to claim 1, wherein in step 1, interface display is provided for the task operation statistical information recorded by the virtual managing process, the content of information interface display comprises the task operation time of each grade and the current task count, and the form of information interface display supports tabular information display and graphical information display.

### Claim 11

A running system for an embedded type virtual device, wherein the system comprises a visual configuration subsystem, a simulation interface subsystem, a virtual managing subsystem, a real-time subsystem, a non-real-time subsystem, a platform interface library subsystem, a virtual data input subsystem and a debugging client subsystem, wherein the visual configuration subsystem is used for configuring hardware and software functions of the embedded type device, setting application functions of the device by adopting graphical symbols and visual pages, and forming a drive packet and a configuration file of the device;
the simulation interface subsystem is used for setting simulation information, starting or stopping simulation, displaying virtual device output information and task statistics, and automatically compiling application programs;
the simulation interface subsystem supports user import of a plurality of directory files, automatically forms Makefile, and compiles application programs; the simulation interface subsystem supports setting of simulation modes and simulation data sources, starts the virtual managing process, acquires and displays the output information of the virtual managing process, acquires the statistical information of the real-time task, and displays the statistical information of the real-time task in modes of a table, a chart and the like;
the virtual managing subsystem reads the configuration file of the device, loads the real-time subsystem and the non-real-time subsystem of the device, schedules real-time tasks and non-real-time tasks, and creates and releases a sharing memory;
the real-time subsystem is corresponding to the program function of each processor of the device and is compiled into a dynamic link library;
the non-real-time subsystem is corresponding to the non-real-time process developed by a main CPU of the device based on an operating system, is used for simulation of various communication server terminals and public service processes of the device, and is compiled into a dynamic link library;
the platform interface library subsystem comprises a real-time library of DSP, a real-time library of the main CPU and a non-real-time library of the main CPU, provides device platform-based public interfaces and services, defines export interface functions of the real-time modules and the non-real-time modules, and provides functions of data registration, variable management, bus communication and the like;
the virtual data input subsystem provides data sources for the virtual device, supports waveform reading and analysis and channel mapping, supports the output data of third-party simulation software, and supports a data array in a self-defining format;
the debugging client subsystem comprises a visual debugging client for supporting visual page debugging, comprises a virtual liquid crystal debugging client for displaying the liquid-crystal hierarchical menu and main screen content of a physical device, comprises an IEC61850 debugging client for displaying device models, reports, data sets and constant values, comprises an IEC103 debugging client for displaying general packet data and uploading waveforms, and comprises a printing client for printing device menus, constant values and waveform data;
and the debugging client subsystem is developed based on a public system library interface, and new sub-modules can be flexibly added.
