A Remote Embedded Experimental System Resource Collaboration Architecture and Method
Through the remote embedded experimental system resource collaboration architecture, the peripheral abstract collaboration module and address mapping module are used to solve the data synchronization problem between the hardware experimental device and the cloud simulation platform, real-time and reliable transmission of peripheral states is realized, and system overhead is reduced.
Patent Information
- Application Number
- CN202211464476.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-11-22
AI Technical Summary
In the existing embedded system simulation teaching, the data synchronization method of hardware experimental devices and cloud simulation platforms increases system overhead and does not have universality and flexibility, making it difficult to achieve real-time and reliable transmission of peripheral states.
The remote embedded experimental system resource collaboration architecture is adopted, including peripheral abstract collaboration module, address mapping module and communication module, data transmission is carried out through IP addresses and register addresses, and communication is carried out using TCP MODBUS protocol to communicate, reducing system overhead and real-time abstraction of peripheral states.
Real-time and reliable transmission of peripheral states of hardware experimental devices to cloud simulation platforms is realized, reducing system overhead and suitable for systems with resource-constrained.
Smart Images

Figure CN115665099B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of embedded system experimental simulation and teaching, and particularly relates to a remote embedded experimental system resource collaboration architecture and method. Background Art
[0002] Due to the strong theoretical nature and wide range of knowledge involved in the embedded system course, experimental operations and practices are required. The experimental simulation teaching method of the embedded system can be carried out at any time and place without being restricted by time and location, and has been used in major universities. However, most of them are pure software methods, based on professional software such as Protues software, which can load the target execution code of the embedded system MCU chip to run. Since the teaching of the embedded system involves the combination of software and hardware, the data accuracy of the pure software simulation experimental teaching method is not high, and the actual effect is not ideal. The current simulation experimental platform based on the hardware simulation device is still in its initial stage, that is, the hardware is used as the running carrier of the embedded target code, and the state is fed back to the simulation platform. This method improves the accuracy of the program experiment. The embedded system simulation teaching based on hardware simulation generally adopts the mode supported by remote cloud simulation and low-end hardware experimental devices, that is, the cloud simulation platform performs task management, status detection and control, and the low-end hardware experimental device runs the target code and feeds back the status of each peripheral to the cloud simulation platform.
[0003] The general method for abstracting the peripheral state of the current hardware experimental device is to create a peripheral state array in the memory, read the peripheral state of the device through a function, and put it into the peripheral state array. When the cloud simulation platform reads the peripheral state of the experimental device, the data in the array is directly fed back to the cloud platform. However, this method must establish a separate thread to achieve the synchronization of the array and register data through the system function, which increases the system overhead and cannot guarantee the real-time performance of the state data. Another commonly used method is that when the cloud simulation platform needs to query the peripheral state, the hardware experimental device queries the peripheral state through the system function and feeds it back to the cloud simulation platform. However, this method does not have universality, cannot achieve flexible peripheral expansion query, and is not convenient for batch management of hardware experimental devices. Summary of the Invention
[0004] The purpose of the present invention is to provide a remote embedded experimental system resource collaboration architecture and method to solve the above technical problems.
[0005] To solve the above technical problems, the specific technical solutions of a remote embedded experimental system resource collaboration architecture and method of the present invention are as follows:
[0006] A resource collaboration architecture for a remote embedded experimental system, including a peripheral abstraction collaboration module, an address mapping module, and a communication module. The peripheral abstraction collaboration module is deployed in the cloud simulation platform, and the address mapping module and the communication module are deployed in the hardware experimental device. The peripheral collaboration module is responsible for real-time monitoring of peripheral data and sending of peripheral control instructions. The address mapping module is responsible for data extraction and transmission of the registers corresponding to the peripherals. The communication module is responsible for communication between the cloud simulation platform and the hardware experimental device.
[0007] Further, there is a configuration file of the peripheral in the cloud simulation platform. The configuration file includes the configuration information of the peripheral, and the peripheral abstraction collaboration module loads the configuration information when running.
[0008] Further, the configuration information includes the IP address, the register address corresponding to the IO peripheral, the bit index of the data in the register, and the valid status bit.
[0009] Further, the peripheral abstraction collaboration module obtains all the data of the register corresponding to the IO peripheral through the IP address and the register address of the IO peripheral, and then parses the status of the IO peripheral according to the bit index and the valid status bit corresponding to the IO peripheral.
[0010] Further, when the communication module receives a register query command sent by the cloud simulation platform, the address mapping module directly returns the data corresponding to the register address to the cloud simulation platform.
[0011] Further, when the cloud simulation platform sets the peripheral status, it first reads the latest status of the register corresponding to the IO peripheral, then modifies the data value of the corresponding position according to the bit index of the IO peripheral in the register to form a new register value, and then sends it to the hardware experimental device. The hardware experimental device directly writes the register data to the address where the register is located to complete the update of the peripheral status.
[0012] Further, the communication method between the cloud simulation platform and the communication module of the hardware experimental device is a wired network, the application layer protocol is TCP MODBUS, and the MCU of the hardware experimental device is of the Coretex-M3 series.
[0013] The present invention also discloses a method for resource collaboration of a remote embedded experimental system, including the following steps:
[0014] Step 1: The peripheral abstraction cooperation module of the cloud simulation platform obtains all the data of the registers corresponding to the IO peripheral through the IP address and the register address of the IO peripheral, and then parses the status of the IO peripheral according to the bit index and the valid status bit corresponding to the IO peripheral; Step 2: When the hardware experiment device receives the register query command sent by the cloud simulation platform through the communication module, the address mapping module directly returns the data corresponding to the register address to the cloud simulation platform;
[0015] Step 3: When the cloud simulation platform sets the peripheral status, it first reads the latest status of the register corresponding to the IO peripheral, then modifies the data value of the corresponding position according to the bit index of the IO peripheral in the register to form a new register value, and then sends it to the hardware experiment device.
[0016] Step 4: The hardware experiment device directly writes the register data to the address where the register is located to complete the update of the peripheral status.
[0017] The resource cooperation architecture and method of a remote embedded experimental system of the present invention have the following advantages: The present invention can complete the real-time abstraction of the peripherals (such as LEDs, buttons, etc.) of the hardware experiment device to the cloud simulation platform, which is real and reliable. Since there is no need for an independent thread in the hardware experiment device to query the peripheral status in real time, this method reduces the system overhead and is also applicable to resource-constrained systems. Description of the Drawings
[0018] Figure 1 is the resource cooperation architecture diagram of the remote embedded experimental system of the present invention;
[0019] Figure 2 is the peripheral configuration file table of the LED indicator;
[0020] Figure 3 is the schematic diagram of the communication message between the cloud simulation platform and the hardware experiment device. Detailed Embodiment
[0021] In order to better understand the purpose, structure and function of the present invention, the following further describes in detail a remote embedded experimental system resource cooperation architecture and method of the present invention with reference to the drawings.
[0022] The remote embedded experimental system includes a cloud simulation platform and a hardware experiment device. As Figure 1As shown in the figure, a resource collaboration architecture of a remote embedded experimental system according to the present invention includes a peripheral abstraction collaboration module, an address mapping module, and a communication module. The peripheral abstraction collaboration module is deployed in a cloud simulation platform, and the address mapping module and the communication module are deployed in a hardware experimental device. The peripheral collaboration module is responsible for real-time monitoring of peripheral data and sending of peripheral control instructions. The address mapping module is responsible for data extraction and transmission of registers corresponding to the peripherals. The communication module is responsible for communication between the cloud simulation platform and the hardware experimental device.
[0023] There is a configuration file of the peripheral in the cloud simulation platform. The configuration file includes configuration information of the peripheral, including the IP address, the register address corresponding to the IO peripheral, the bit index of the data in the corresponding register, and the valid status bit. When the peripheral abstraction collaboration module in the cloud simulation platform runs, it loads this configuration information. The peripheral abstraction collaboration module in the cloud simulation platform can obtain all the data of the register corresponding to the IO peripheral through the IP address and the register address of the IO peripheral, and then parse the status of the IO peripheral according to the bit index and the valid status bit corresponding to the IO peripheral.
[0024] When the hardware experimental device receives a register query command sent by the cloud simulation platform through the communication module, the address mapping module directly returns the data corresponding to the register address to the cloud simulation platform. When the cloud simulation platform sets the peripheral status, it first reads the latest status of the register corresponding to the IO peripheral, then modifies the data value of the corresponding position according to the bit index of the IO peripheral in the register to form a new register value, and then sends it to the hardware experimental device. The hardware experimental device directly writes the register data to the address where the register is located to complete the update of the peripheral status. The communication method between the communication modules of the cloud simulation platform and the hardware experimental device is a wired network, the application layer protocol is TCP MODBUS, and the MCU of the hardware experimental device is of the Coretex-M3 series.
[0025] The present invention will be described in detail by taking the status of an LED-1 indicator as an example.
[0026] The MCU adopted by the hardware experimental device is STM32F207VCTC. The control pin of the LED-1 pin is the GPIO_Pin_0 pin of GPIOB. The address of the GPIOB register is 0x40010C00. GPIO_Pin_0 represents the 0th bit of this register. When this bit is "0", the pin is at a low level, and the LED-1 indicator is on; when the 0th bit is "1", the pin is at a high level, and the LED-1 indicator is off. Therefore, as Figure 2 shown, in the information of the LED-1 peripheral saved by the cloud simulation platform, the IP address is: 192.168.1.100, the address of the GPIO register is: 0x40010C00, the bit index is 0, and the valid status bit is 0.
[0027] The data query and setting messages between the cloud simulation platform and the hardware experiment device are as follows Figure 3 shown. In the read request frame, 0x03 is the read command word, A0, A1, A2, A3 represent the 32-bit register address to be read, CRCH and CRCL represent CRC checksums. In the query response message, in the read response frame, 0x03 is the read command word, A0, A1, A2, A3 represent the 32-bit register address to be read, B0, B1, B2, B3 represent the register data to be read, and CRCH and CRCL represent CRC checksums. In the write request frame, 0x10 is the write command word, A0, A1, A2, A3 represent the 32-bit register address to be set, B0, B1, B2, B3 represent the register data to be set, and CRCH and CRCL represent CRC checksums. In the write response frame, 0x10 is the write command word, A0, A1, A2, A3 represent the 32-bit register address to be set, and CRCH and CRCL represent CRC checksums.
[0028] When the cloud simulation platform queries the status of LED-1, it sends a data query message with the register address 0x40010C00 to the hardware experiment device with the IP address 192.168.1.100. After receiving the message, the hardware experiment device feeds back the data corresponding to the register address 0x40010C00 through the response message, and the register data is 0x00000001. The cloud simulation platform receives the read response frame to obtain the register data. According to the bit index of LED-1, the control pin status bit "1" of LED-1 is obtained. According to the valid status bit, LED-1 is in the off state.
[0029] When LED-1 is to be in the valid state, the cloud simulation platform uses the read request frame to read the register value corresponding to LED-1, and obtains the register value 0x0000001. Since the bit index of LED-1 is 0, the 0th bit of the register value is modified to the valid status bit "0" of LED-1, and the latest register value 0x00000000 is obtained. The cloud simulation platform writes 0x00000000 to the register address 0x40010C00 through the write request frame. At this time, the register value corresponding to LED-1 changes, and LED-1 lights up. The cloud simulation platform reads the register value corresponding to LED-1 again, parses that the LED-1 bit is "0", and according to the valid bit status, LED-1 is in the on state.
[0030] This method can complete the real-time abstraction of the peripherals (such as LEDs, buttons, etc.) of the hardware experiment device to the cloud simulation platform, which is real and reliable. Since there is no need for an independent thread in the hardware experiment device to query the peripheral status in real time, this method reduces the system overhead and is also applicable to resource-constrained systems.
[0031] It will be understood that the present invention is described by way of some embodiments, and those skilled in the art will know that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the present invention. Additionally, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the scope protected by the present invention.
Claims
1. A collaborative architecture for resources of a remote embedded experimental system, characterized in that, It includes a peripheral abstraction collaboration module, an address mapping module, and a communication module. The peripheral abstraction collaboration module is deployed in the cloud simulation platform, and the address mapping module and the communication module are deployed in the hardware experimental device; The peripheral abstraction collaboration module is responsible for the real-time monitoring of peripheral data and the sending of peripheral control instructions. The address mapping module is responsible for the data extraction and transmission of the registers corresponding to the peripherals. The communication module is responsible for the communication between the cloud simulation platform and the hardware experimental device; The peripheral abstraction collaboration module obtains all the data of the registers corresponding to the IO peripheral through the IP address and the register address of the IO peripheral, and then parses the status of the IO peripheral according to the bit index and the valid status bit corresponding to the IO peripheral.
2. The collaborative architecture of resources for the remote embedded experimental system according to claim 1, wherein There is a configuration file of the peripheral in the cloud simulation platform. The configuration file includes the configuration information of the peripheral, and the peripheral abstraction collaboration module loads the configuration information when running.
3. The resource collaboration architecture of the remote embedded experimental system according to claim 2, characterized in that, The configuration information includes the IP address, the register address corresponding to the IO peripheral, the bit index of the data in the register, and the valid status bit.
4. The collaborative architecture of resources for the remote embedded experimental system according to claim 1, characterized in that, When the communication module receives the register query command sent by the cloud simulation platform, the address mapping module directly returns the data corresponding to the register address to the cloud simulation platform.
5. The remote embedded experimental system resource collaboration architecture according to claim 1, characterized in that, When the cloud simulation platform sets the peripheral status, it first reads the latest status of the register corresponding to the IO peripheral, then modifies the data value at the corresponding position according to the bit index of the IO peripheral in the register to form a new register value, and then sends it to the hardware experimental device. The hardware experimental device directly writes the register data to the address where the register is located to complete the update of the peripheral status.
6. The collaborative architecture of resources of the remote embedded experimental system according to claim 1, wherein The communication mode between the cloud simulation platform and the communication module of the hardware experimental device is a wired network, and the application layer protocol is TCP MODBUS. The MCU of the hardware experimental device is of the Coretex-M3 series.
7. An experimental system resource collaboration method for the remote embedded experimental system resource collaboration architecture according to any one of claims 1-6, characterized in that, It includes the following steps: Step 1: The peripheral abstraction collaboration module of the cloud simulation platform obtains all the data of the registers corresponding to the IO peripheral through the IP address and the register address of the IO peripheral, and then parses the status of the IO peripheral according to the bit index and the valid status bit corresponding to the IO peripheral; Step 2: When the hardware experimental device receives the register query command sent by the cloud simulation platform through the communication module, the address mapping module directly returns the data corresponding to the register address to the cloud simulation platform; Step 3: When the cloud simulation platform sets the peripheral status, it first reads the latest status of the register corresponding to the IO peripheral, then modifies the data value at the corresponding position according to the bit index of the IO peripheral in the register to form a new register value, and then sends it to the hardware experimental device; Step 4: The hardware experimental device directly writes the register data to the address where the register is located to complete the update of the peripheral status.
Citation Information
Patent Citations
Simulation method and simulation system
CN101630343A
Satellite peripheral interface simulation system and method
CN110674579A