A universal virtual peripheral modeling method across different platform architectures

CN117687687BActive Publication Date: 2026-10-09CHENGDU AIRCRAFT DESIGN INST OF AVIATION IND CORP OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311619971.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2026-10-09
Estimated Expiration
2043-11-29

AI Technical Summary

Technical Problem

[0005]本发明的目是提供一种跨不同平台架构的通用化虚拟外设建模方法,解决当前各个虚拟仿真工具虚拟外设建模方式不一致导致需要重复开发的技术短板、一次建模,跨多平台架构使用,提高数字化平台建设效率,高效支撑型号任务数字化装备交付

Benefits of technology

[0022] Compared with the prior art, the present invention has the following technical features:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117687687B_ABST
    Figure CN117687687B_ABST
Patent Text Reader

Abstract

The application provides a universal virtual peripheral modeling method across different platform architectures, comprising the following steps: S1, writing an implementation pseudo code of a peripheral service layer according to a configuration keyword of a hardware manual use specification of a hardware peripheral; S2, opening a modeling analysis tool module, selecting a target platform architecture in a graphical option box, and calling a modeling configuration file module to perform pseudo code specification verification on the pseudo code; S3, the modeling analysis tool module loads a corresponding analysis mapping configuration of the target platform architecture according to the modeling configuration file module, and analyzes modeling code of the target platform architecture into the pseudo code; S4, the modeling analysis tool module generates a corresponding dynamic link library according to a preset modeling configuration file module, a compiler depended by the target platform architecture, a resource dependent file and a dependent library; and S5, placing the compiled dynamic link library into the target platform architecture, so that a graphical virtual peripheral module is obtained in a system modeling editing interface of the target platform architecture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital twin device modeling, and more specifically, to a universal virtual peripheral modeling method that spans different platform architectures. Background Technology

[0002] With the rapid application of digital twin technology in aerospace and aviation embedded R&D, hardware resource costs have been significantly reduced, R&D cycles have been shortened, equipment delivery efficiency has been improved, and a new wave of digital equipment has begun. Due to the increasing maturity of virtual simulation technology and its widespread application in engineering, digital functional prototypes of aircraft, virtual flight tests, and virtual maintenance and support for aircraft are no longer news in the industry. Through virtual simulation technology, the software under test can run completely independently of the real target aircraft in a virtual target system, enabling effective software verification. In situations of resource or schedule constraints, virtual simulation systems can facilitate collaborative parallel software development and verification work, accelerating the software development cycle.

[0003] Currently, mainstream virtual simulation platform providers focus on their own technical implementation paths, such as Wind River's Simcis, the open-source project Qemu, Shanghai Chuangjing's iSystem, Beijing Xuanyu's VTEST, and Zhejiang Dijie's SKYEYE, etc. Their peripheral modeling methods are self-contained and incompatible with each other. Since the majority of the workload in digital equipment modeling currently lies in peripheral modeling, this incompatibility in modeling methods leads to repeated modeling for different platforms, causing significant inconvenience for large-scale heterogeneous platform simulation. Therefore, there is an urgent need to establish a universal virtual peripheral modeling method that can mask differences, enable one-time modeling for multiple platforms, and improve modeling efficiency.

[0004] From the input perspective of the virtual peripheral module, the modeling is based on actual hardware manuals, and the business implementation level is consistent. However, in the implementation process, different suppliers have not effectively separated the business from the underlying implementation, resulting in a strong correlation between the current modeling methods and platform architecture, lacking universality. By establishing a unified description of the hardware business, the focus during virtual peripheral modeling can be solely on the hardware function implementation itself. Then, through configuration files for different platform architectures, the unified modeling description file is parsed into modeling code for the corresponding platform architecture using a modeling parsing tool module, generating corresponding recognizable dynamic link libraries. This allows for modeling once and use across different platform architectures, enabling business personnel to focus on business implementation, reducing repetitive modeling workload caused by platform limitations, improving the efficiency of digital platform construction, and efficiently supporting the delivery of digital equipment for model tasks. Summary of the Invention

[0005] The purpose of this invention is to provide a universal virtual peripheral modeling method that can be used across different platform architectures. This method addresses the technical shortcomings of inconsistent virtual peripheral modeling methods in various virtual simulation tools, which leads to repeated development. It enables one-time modeling for use across multiple platform architectures, improves the efficiency of digital platform construction, and efficiently supports the delivery of digital equipment for model missions.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] A generalized virtual peripheral modeling method across different platform architectures includes:

[0008] Step S1: Write the pseudocode for the peripheral business layer using the standard configuration keywords according to the hardware manual of the hardware peripheral.

[0009] Step S2: Open the modeling analysis tool module, select the target platform architecture in the graphical option box, and the modeling analysis tool module calls the modeling configuration file module to perform pseudocode standardization verification on the pseudocode;

[0010] Step S3: The modeling parsing tool module loads the corresponding parsing mapping configuration of the target platform architecture according to the modeling configuration file module, and parses the modeling code of the target platform architecture into pseudocode;

[0011] Step S4: The modeling parsing tool module calls the compiler, resource dependency files and dependency libraries that the target platform architecture depends on, according to the preset modeling configuration file module, to generate the corresponding dynamic link library;

[0012] S5 allows you to place the compiled dynamic link library into the target platform architecture, and then obtain a graphical virtual peripheral module in the system modeling and editing interface of the target platform architecture.

[0013] Furthermore, the step of writing the implementation pseudocode for the peripheral service layer using standardized configuration keywords according to the hardware manual of the hardware peripheral includes:

[0014] Based on the peripheral modules identified from the business process, describe the peripheral modules according to the generalized modeling language specification.

[0015] The generalized modeling language specification module is used to standardize the description of general attributes and methods for virtual peripheral modeling, and to write the hardware function implementation process in the hardware peripheral manual into unified modeling pseudocode.

[0016] Furthermore, the generalized modeling language specification module provides simple, semantically indistinguishable keywords for describing modeling objects, setting attributes, and performing read / write operations based on hardware function descriptions.

[0017] Furthermore, the pseudocode validation process first checks whether the format conforms to the modeling specifications, then validates the keywords in the modeling specifications, and finally displays the validation results.

[0018] Furthermore, the modeling configuration file module dynamically configures the modeling specification keywords according to the platform, mapping them to different platform architecture API interfaces.

[0019] Furthermore, the modeling configuration file module establishes a one-to-one mapping between modeling pseudocode and supporting API interfaces of different platforms using dynamic and configurable XML attribute configuration, providing a basis for the grammar and syntax translation of the modeling parsing tool module; and classifies modeling keywords by attribute description using XML language, supporting dynamic expansion according to business changes.

[0020] Furthermore, the modeling parsing tool module is used to parse the modeling pseudocode into modeling code that can be recognized by the selected platform based on the target platform architecture selected by the user, and call the underlying modeling dependency library of the target platform to generate a dynamic link library that can be recognized by the target platform.

[0021] Furthermore, the modeling parsing tool module can graphically select the target platform based on prompts, has a built-in modeling syntax detection module, has a modeling language error prompting function, and calls the corresponding platform rules according to the modeling configuration file module to complete the parsing of modeling code, compile and generate a dynamic link library that can be recognized by the target platform, and directly recognize it as the corresponding virtual peripheral graphics module on the target platform.

[0022] Compared with the prior art, the present invention has the following technical features:

[0023] This invention can shield the differences in modeling languages ​​across different platforms, uniformly describe the business functions of peripherals from a business perspective, and transform a single model into a virtual peripheral module recognizable by different platforms; the configurable modeling settings file supports dynamic application and upgrades across multiple versions and platforms; the modeling language focuses on business implementation, is easy to understand, and has a low learning cost. Attached Figure Description

[0024] Figure 1 A diagram showing the interconnections between the generalized modeling language specification module, the modeling parsing tool module, and the modeling configuration file module;

[0025] Figure 2 A schematic diagram for modeling implementation. Detailed Implementation

[0026] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0027] This invention provides a generalized virtual peripheral modeling method across different platform architectures. Taking NS16650 modeling as an example, the method specifically includes:

[0028] Step S1: Write the pseudocode for the peripheral business layer using the standard configuration keywords according to the hardware manual of the hardware peripheral; identify the serial port device NS16550 as the peripheral module according to the business logic, and describe the peripheral module according to the generalized modeling language specification, such as name, attribute list, register address, operation behavior, etc.

[0029] (Register:

[0030] UART_LCR_DLAB=0x80 (Divisor latch access bit); UART_IER_MSI=0x08 (Enable Modem status interrupt); UART_IER_RLSI=0x04 (Enablereceiver line status interrupt); UART_IER_THRI=0x02 (EnableTransmitter holding register int); UART_IER_RDI=0x01 (Enable receiver datainterrupt);

[0031] Action: uart_init(); uart_io_write(); uart_io_read())

[0032] The generalized modeling language specification module is used to standardize the description of general attributes and methods for virtual peripheral modeling, and to write the hardware function implementation process in the hardware peripheral manual into unified modeling pseudocode. The generalized modeling language specification module provides simple, semantically indistinguishable descriptions of modeling objects, attribute settings, and read / write operation keywords based on hardware function descriptions, making it convenient for modelers to learn, understand, and use.

[0033] Step S2: Open the modeling analysis tool module, select the target platform architecture as Shanghai Chuangjing's iSystem in the graphical option box, and click the run button. The modeling analysis tool module calls the modeling configuration file module to perform pseudocode standardization verification: first, it verifies whether the format conforms to the modeling standard, then it verifies the modeling standard keywords, and finally it displays the verification results.

[0034] The modeling configuration file module dynamically configures the modeling specification keywords according to the platform, mapping them to different platform architecture API interfaces. The modeling configuration file module uses dynamic and configurable XML attribute configuration to establish a one-to-one mapping between modeling pseudocode and the supporting API interfaces of different platforms, providing a basis for the grammar and syntax translation of the modeling parsing tool module. The modeling keywords are classified and described by attributes through XML language, supporting dynamic expansion according to business changes.

[0035] The modeling parsing tool module parses the modeling pseudocode into modeling code recognizable by the selected target platform architecture, and calls the underlying modeling dependency libraries of the target platform to generate dynamic link libraries recognizable by the target platform. The module provides a graphical interface for selecting the target platform based on prompts, includes a built-in modeling syntax detection module with error message functionality, and automatically calls the corresponding platform rules based on the modeling configuration file module to complete the modeling code parsing, compile, and generate dynamic link libraries recognizable by the target platform, which are then directly recognized as corresponding virtual peripheral graphics modules on the target platform.

[0036] Step S3: The modeling parsing tool module loads the corresponding parsing mapping configuration of the target platform architecture iSystem according to the modeling configuration file module, and parses the modeling code of the target platform architecture iSystem into pseudocode;

[0037] The modeling and parsing tool module calls the object to create an NS16650 serial port object, generating the corresponding NS16650.h, NS16650.cpp, and interface.cpp files. Based on the attribute descriptions, it generates the corresponding macro definitions and attribute declarations in NS16650.h.

[0038] #define UART_LCR_DLAB 0x80 / *Divisor latch access bit* /

[0039] #define UART_IER_MSI 0x08 / *Enable Modem status interrupt* /

[0040] #define UART_IER_RLSI 0x04 / *Enable receiver line status interrupt* / #define UART_IER_THRI 0x02 / *Enable Transmitter holding register int.* /

[0041] #define UART_IER_RDI 0x01 / *Enable receiver data interrupt* / typedef struct SerialFIFO{

[0042] unsigned char data[UART_FIFO_LENGTH]; / / FIFO data arrayunsigned char count; / / real time count of FIFOunsigned char itl; / *interrupt trigger level such as 1, 4, 8, 14* /

[0043] unsigned char tail; / / tail

[0044] unsigned char head; / / head

[0045] }SerialFIFO; According to the operation behavior definition, initialize the module in NS16650.cpp: void uart_init(NS16550Object *pDevice, UINT32 nHostFreq){

[0046] pDevice->rbr = 0;

[0047] pDevice->ier = 0;

[0048] pDevice->iir = UART_IIR_NO_INT;

[0049] pDevice->lcr = 0;

[0050] pDevice->lsr = UART_LSR_TEMT|UART_LSR_THRE;

[0051] pDevice->msr = UART_MSR_DCD|UART_MSR_DSR|UART_MSR_CTS;

[0052] / *Default to 9600baud,1start bit,8data bits,1stop bit,no parity.* /

[0053] pDevice->divider = 0x0C;

[0054] pDevice->mcr=UART_MCR_OUT2;

[0055] pDevice->scr = 0;

[0056] pDevice->char_transmit_time=(nHostFreq / 115200)*10;

[0057] uart_fifo_clear(pDevice,RECV_FIFO);

[0058] uart_fifo_clear(pDevice,XMIT_FIFO);

[0059] }

[0060] In step S4, the modeling parsing tool module calls the compiler, resource dependency files, and dependency libraries that the target platform architecture iSystem depends on, based on the preset modeling configuration file module, to generate the corresponding dynamic link library.

[0061] Step S5: Place the compiled dynamic link library into the specified directory of the target platform architecture iSystem. You will then obtain the graphical virtual peripheral module, i.e., the virtual NS16650 module, in the device toolbar of the system modeling and editing interface of the target platform architecture iSystem.

[0062] The method was validated using general virtualization modeling on another platform, SKYEYE, as follows:

[0063] (1) Open the modeling analysis tool module, select the target platform architecture as SKYEYE of Dijie in the graphical option box, and click the run button. The modeling analysis tool module calls the modeling specification configuration file to perform pseudocode specification verification on the pseudocode.

[0064] First, check if the format conforms to the specifications, then check the modeling keywords, and finally display the check results.

[0065] (2) The modeling parsing tool module loads the corresponding parsing mapping configuration of Dijie's SKYEYE peripheral modeling according to the configuration file, and the parsing pseudocode is the modeling code of the SKYEYE platform;

[0066] The modeling and parsing tool module calls the object to create an NS16650 serial port object, generating the corresponding NS16650.h and NS16650.c files. Based on the attribute descriptions, it generates the corresponding macro definitions and attribute declarations in NS16650.h.

[0067] #define UART_LCR_DLAB 0x80 / *Divisor latch access bit* /

[0068] #define UART_IER_MSI 0x08 / *Enable Modem status interrupt* /

[0069] #define UART_IER_RLSI 0x04 / *Enable receiver line status interrupt* / #define UART_IER_THRI 0x02 / *Enable Transmitter holding register int.* /

[0070] #define UART_IER_RDI 0x01 / *Enable receiver data interrupt* / typedefstruct uart_16550{

[0071] conf_object_t*obj;

[0072] reg_16550_t reg;

[0073] / *internal implement* /

[0074] memory_space_intf io_memory;

[0075] struct{

[0076] conf_object_t*obj;

[0077] skyeye_uart_intf*intf;

[0078] }term;

[0079] struct{

[0080] int num;

[0081] conf_object_t *obj;

[0082] general_signal_intf*intf;

[0083] }signal;

[0084] conf_object_t*uart_file;

[0085] uart_file_intf*uart_file_iface;

[0086] conf_object_t*uart_com;

[0087] uart_com_intf*uart_com_iface;

[0088] uint32_t enter_flag;

[0089] FIFO*rx_fifo;

[0090] FIFO*tx_fifo;

[0091] }uart_16550_t; Initialize the module in NS16650.c according to the operation behavior definition: void

[0092] init_16550_uart(void){

[0093] static skyeye_class_t class_data={

[0094] .class_name = "16550_uart",

[0095] .class_desc="16550_uart",

[0096] .new_instance=create_16550_uart,

[0097] .free_instance=free_16550_uart,

[0098] .reset_instance=reset_uart_16550,

[0099] .config_instance=config_16550_uart,

[0100] .set_attr = NULL,

[0101] .get_attr = NULL,

[0102] .module_type=SKYML_ONCHIP(SC_mpc8378 SC_mpc8641d_machSC_t2080),

[0103] };

[0104] REGS_NAME_INIT(UART_16550_REGS_LIST,

[0105] uart_16550_reg_name);

[0106] conf_class_t*class=SKY_register_device_class(class_data.class_name,&class_data);

[0107] static const memory_space_intf io_memory={

[0108] .read=uart_16550_read,

[0109] .write=uart_16550_write,

[0110] };

[0111] SKY_register_iface(class,MEMORY_SPACE_INTF_NAME,&io_memory);

[0112] static const skyeye_serial_device_t serial_device={

[0113] .write=serial_write,

[0114] .receive_ready=NULL,

[0115] };

[0116] SKY_register_iface(class,SERIAL_DEVICE_INTERFACE,&serial_device);

[0117] static const struct InterfaceDescription ifaces[]={

[0118] (struct InterfaceDescription){

[0119] .name=MEMORY_SPACE_INTF_NAME,

[0120] .iface=&io_memory,

[0121] },

[0122] (struct InterfaceDescription){

[0123] .name=SERIAL_DEVICE_INTERFACE,

[0124] .iface=&serial_device,

[0125] }

[0126] };

[0127] static const struct ConnectDescription connects[]={

[0128] (struct ConnectDescription){

[0129] .name=SKYEYE_UART_INTF,

[0130] .set=uart_term_set,

[0131] .get=uart_term_get,

[0132] },

[0133] (struct ConnectDescription){

[0134] .name=UART_FILE_INTF,

[0135] .set=uart_file_set,

[0136] .get=uart_file_get,

[0137] },

[0138] (struct ConnectDescription){

[0139] .name=GENERAL_SIGNAL_INTF_NAME,

[0140] .set = signal_set,

[0141] .get = signal_get,

[0142] },

[0143] (struct ConnectDescription){

[0144] .name = UART_COM_INTF,

[0145] .set = uart_com_set,

[0146] .get = uart_com_get,

[0147] }

[0148] };

[0149] class_register_ifaces(class,ifaces);

[0150] class_register_connects(class,connects);

[0151] uart_16550_register_attribute(class);

[0152] }

[0153] (3) Based on the preset modeling configuration file module, call the compiler, resource dependency files and dependency libraries that SKYEYE depends on to generate the corresponding dynamic link library.

[0154] (4) Place the compiled dynamic link library into the specified directory of the SKYEYE platform to display the graphical virtual NS16650 module in the SKYEYE platform system modeling and editing interface. This shows that this method can perform general virtual peripheral modeling between different platform architectures iSystem and SKYEYE platform.

[0155] This invention provides a universal virtual peripheral modeling method that spans different platform architectures, enabling seamless modeling of peripherals across different platform architectures. This allows business personnel to focus on business implementation, reduces repetitive modeling workload caused by platform limitations, improves the efficiency of digital platform construction, and efficiently supports the delivery of digital equipment for model tasks.

[0156] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A universal virtual peripheral modeling method across different platform architectures, characterized in that, include: Step S1: Write the pseudocode for the peripheral business layer using the standard configuration keywords according to the hardware manual of the hardware peripheral. Step S2: Open the modeling analysis tool module, select the target platform architecture in the graphical option box, and the modeling analysis tool module calls the modeling configuration file module to perform pseudocode standardization verification on the pseudocode; The modeling configuration file module is dynamically configured according to the platform, mapping modeling specification keywords to different platform architecture API interfaces; The modeling configuration file module uses dynamic, configurable XML attribute configuration to establish a one-to-one mapping between modeling pseudocode and supporting API interfaces of different platforms, providing a basis for the syntax and grammar translation of the modeling parsing tool module; it also uses XML language to classify modeling keywords by attribute description, supporting dynamic expansion according to business changes; Step S3: The modeling parsing tool module loads the corresponding parsing mapping configuration of the target platform architecture according to the modeling configuration file module, and parses the modeling code of the target platform architecture into pseudocode; Step S4: The modeling parsing tool module calls the compiler, resource dependency files and dependency libraries that the target platform architecture depends on, according to the preset modeling configuration file module, to generate the corresponding dynamic link library; The modeling parsing tool module is used to parse the modeling pseudocode into modeling code that can be recognized by the selected platform based on the target platform architecture selected by the user, and call the underlying modeling dependency library of the target platform to generate a dynamic link library that can be recognized by the target platform. Step S5: Place the compiled dynamic link library into the target platform architecture, and you can get the graphical virtual peripheral module in the system modeling and editing interface of the target platform architecture. Step S1 includes: Based on the peripheral modules identified from the business process, describe the peripheral modules according to the generalized modeling language specification. The generalized modeling language specification module is used to standardize the description of general attributes and methods for virtual peripheral modeling, and to write the hardware function implementation process in the hardware peripheral manual into unified modeling pseudocode.

2. The universal virtual peripheral modeling method across different platform architectures according to claim 1, characterized in that, The generalized modeling language specification module provides simple, semantically indistinct keywords for describing modeling objects, setting attributes, and performing read / write operations based on hardware function descriptions.

3. The universal virtual peripheral modeling method across different platform architectures according to claim 1, characterized in that, The pseudocode validation process first checks whether the format conforms to the modeling specifications, then checks the keywords of the modeling specifications, and finally displays the validation results.

4. The universal virtual peripheral modeling method across different platform architectures according to claim 1, characterized in that, The modeling parsing tool module allows users to select the target platform graphically based on prompts. It has a built-in modeling syntax detection module with error message functionality for modeling languages. Based on the modeling configuration file module, it calls the corresponding platform rules to complete the parsing of the modeling code, compiles and generates a dynamic link library that can be recognized by the target platform, and directly identifies it as the corresponding virtual peripheral graphics module on the target platform.

Citation Information

Patent Citations

  • Digital twinning construction method applied to numerical control machine tool

    CN113742964A

  • Industrial digital twin system unit equipment computing interface construction method and device

    CN115454395A