Reflection memory communication management method and system based on publish / subscribe mode
By combining the publish-subscribe model with Extensible Markup Language, the conflict problem of reflective memory network address resource allocation and reclamation is solved, realizing efficient management of reflective memory addresses in a multi-user cluster simulation platform and reducing the risk of manual design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2026-04-14
AI Technical Summary
In large-scale cluster hardware-in-the-loop simulation systems, there are conflicts in the allocation and reclamation of reflective memory network address resources. Existing technologies have failed to effectively solve the address management problem in multi-user designs and publish-subscribe patterns.
It adopts a publish-subscribe model, uses Extensible Markup Language to standardize the communication content of the reflective memory network nodes, establishes a maintenance table for the publish and subscribe regions, determines the data correspondence based on index matching, realizes the dynamic allocation and reclamation of reflective memory addresses, and uses a doubly linked circular list structure to manage memory space.
It improves the utilization efficiency of reflected memory addresses, reduces the risk of manual design, and realizes efficient management of real-time network addresses in multi-user simulation platforms.
Smart Images

Figure CN116471230B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hardware-in-the-loop simulation real-time network communication technology, specifically to a reflection memory communication management method and system based on a publish-subscribe model. Background Technology
[0002] In large-scale clustered hardware-in-the-loop simulation systems, each test user needs to occupy multiple node resources, and there are numerous communication tasks between these nodes, all relying on a real-time reflective memory network. Data transmission in the reflective memory network is address-based, and different test users often use addresses haphazardly, easily leading to address conflicts. Given limited network address resources, how to efficiently serve different users and achieve address resource allocation and reclamation is a pressing problem for clustered simulation platforms. This invention is based on a "centralized service-edge interaction" real-time simulation platform architecture. A reflective memory management service is maintained in the central simulation resource management and scheduler, dynamically managing real-time network address resources according to the needs of different users.
[0003] Patent document CN103678001A (application number: 201310577175.4) discloses a multi-node automatic memory allocation method based on a reflective memory network. Patent document CN111949570B (application number: 202010627296.5) discloses a reflective memory address automatic allocation method and system based on XML format.
[0004] However, the above methods are not designed for multiple users, do not adopt a publish-subscribe matching pattern, and do not involve methods for managing the reflection memory address space. Summary of the Invention
[0005] In view of the deficiencies in the prior art, the purpose of this invention is to provide a reflection memory communication management method and system based on the publish-subscribe model.
[0006] A method for managing reflective memory communication based on a publish-subscribe pattern according to the present invention includes:
[0007] The steps for defining publish / subscribe regions are as follows: Extensible Markup Language is used to standardize the description of communication content between nodes in the reflective memory network, which is divided into publish regions and subscription regions;
[0008] Publish / subscribe region matching steps: Based on the published / subscribe region definition, establish a published region maintenance table and a subscribed region maintenance table, and determine the correspondence between published data and subscribed data based on index matching;
[0009] Reflection memory address allocation steps: Request the published data memory address from the reflection memory management service, determine the correspondence between published data and subscribed data based on the matching, complete the reflection memory address mapping of the subscription area, and distribute the allocated memory address to each simulation node via Ethernet;
[0010] Reflective memory network communication steps: In the simulation experiment, a communication structure is created according to the publish / subscribe region definition. The mapped reflective memory address is read and written in units of the communication structure, thereby realizing real-time interaction of experimental data.
[0011] Preferably, the standardized description is pre-configured and edited at the test management node, and the editing methods include dragging and dropping program text and graphics;
[0012] The communication content includes the region ID, region name, number of attributes, subordinate relationship, and attribute content;
[0013] The subordinate relationship includes node ID and trial name information, wherein the publishing region node ID represents the network location of the publishing node, and the subscription region node ID represents the network node location of the data source;
[0014] The attribute content includes basic information about the regional data, including the name, type, and maximum and minimum values of the regional data.
[0015] Preferably, after the publish / subscribe region is defined, the corresponding publish and subscribe files are uploaded to the top-level simulation resource management system, and the reflection memory management service maintains the experimental publish and subscribe regions.
[0016] The published regions and subscribed regions in the published region maintenance table and the subscribed region maintenance table are indexed by unique hash codes. The unique hash code index is established based on the node ID, test name, and attribute characteristics corresponding to the region as keywords.
[0017] Preferably, the reflection memory management service describes the entire reflection memory network space in a doubly linked circular list structure, including the space start address, space size, space occupancy identifier, and hash index.
[0018] Preferably, when the reflection memory management service receives a memory usage request message sent by the test management node, it searches for a free memory block starting from the current linked list position. If the free memory block is smaller than the usage request size, it searches backward along the linked list. When a memory block of sufficient size is found, the memory block is divided into an occupied block and a remaining free block. The address of the occupied block is returned to the publishing area maintenance table, thus completing the occupation of the reflection memory address space.
[0019] When the reflection memory management service receives a memory reclamation request message sent by the test management node, it changes the occupied flag of the corresponding memory block in the linked list to the free flag and performs a merge operation on the adjacent free blocks.
[0020] A reflection-based memory communication management system based on a publish-subscribe model, according to the present invention, includes:
[0021] Publish / Subscribe Region Definition Module: Uses Extensible Markup Language to standardize the description of communication content between nodes in the Reflection Memory Network, which is divided into publish regions and subscription regions;
[0022] Publish / Subscribe Region Matching Module: Based on the published / subscribe region definition, establish a published region maintenance table and a subscribed region maintenance table, and determine the correspondence between published data and subscribed data based on index matching;
[0023] Reflection memory address allocation module: Requests published data memory addresses from the reflection memory management service, determines the correspondence between published data and subscribed data based on the matching, completes the reflection memory address mapping of the subscription area, and distributes the allocated memory addresses to each simulation node via Ethernet;
[0024] Reflective memory network communication module: In the simulation experiment, a communication structure is created according to the publish / subscribe region definition. The mapped reflective memory address is read and written in units of the communication structure, thereby realizing real-time interaction of experimental data.
[0025] Preferably, the standardized description is pre-configured and edited at the test management node, and the editing methods include dragging and dropping program text and graphics;
[0026] The communication content includes the region ID, region name, number of attributes, subordinate relationship, and attribute content;
[0027] The subordinate relationship includes node ID and trial name information, wherein the publishing region node ID represents the network location of the publishing node, and the subscription region node ID represents the network node location of the data source;
[0028] The attribute content includes basic information about the regional data, including the name, type, and maximum and minimum values of the regional data.
[0029] Preferably, after the publish / subscribe region is defined, the corresponding publish and subscribe files are uploaded to the top-level simulation resource management system, and the reflection memory management service maintains the experimental publish and subscribe regions.
[0030] The published regions and subscribed regions in the published region maintenance table and the subscribed region maintenance table are indexed by unique hash codes. The unique hash code index is established based on the node ID, test name, and attribute characteristics corresponding to the region as keywords.
[0031] Preferably, the reflection memory management service describes the entire reflection memory network space in a doubly linked circular list structure, including the space start address, space size, space occupancy identifier, and hash index.
[0032] Preferably, when the reflection memory management service receives a memory usage request message sent by the test management node, it searches for a free memory block starting from the current linked list position. If the free memory block is smaller than the usage request size, it searches backward along the linked list. When a memory block of sufficient size is found, the memory block is divided into an occupied block and a remaining free block. The address of the occupied block is returned to the publishing area maintenance table, thus completing the occupation of the reflection memory address space.
[0033] When the reflection memory management service receives a memory reclamation request message sent by the test management node, it changes the occupied flag of the corresponding memory block in the linked list to the free flag and performs a merge operation on the adjacent free blocks.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] 1. The present invention’s reflective memory management service accurately matches communication addresses based on the supply and demand relationship of experimental user data, thereby reducing the risk of manual design.
[0036] 2. This invention maintains and manages memory through a reflection memory management service, allocating and reclaiming memory according to the needs of simulation applications, thereby improving the utilization efficiency of real-time network addresses. Attached Figure Description
[0037] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0038] Figure 1 This is a schematic diagram of the structure of the reflection memory communication management method based on the publish-subscribe pattern of the present invention;
[0039] Figure 2 In this invention, the example uses a modular graphical drag-and-drop method for editing the content of the publishing area;
[0040] Figure 3 This is the result of defining the aircraft position and attitude publishing area based on Extensible Markup Language in this invention;
[0041] Figure 4 These are the publication area maintenance table and subscription area maintenance table based on index matching in this invention.
[0042] Figure 5 This is a schematic diagram of the doubly linked circular list structure of the reflective memory network space in this invention. Detailed Implementation
[0043] 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.
[0044] According to the present invention, a reflection-based memory communication management method based on a publish-subscribe pattern is provided, such as... Figure 1 As shown, it includes:
[0045] The steps for defining publish / subscribe zones are as follows: Extensible Markup Language (XML) is used to standardize the communication content of reflective memory network nodes, dividing it into publish and subscribe zones. This standardized description is pre-configured and edited on the test management node. In other words, the publish / subscribe zone definition is configured by the test system users on the management node, with editing methods including program text and graphical drag-and-drop. Figure 2 As shown, in the case simulation platform, the publish / subscribe area is edited using a modular graphical drag-and-drop method.
[0046] Specifically, the communication content includes the region ID, region name, number of attributes, hierarchy, and attribute content. The hierarchy includes node IDs and experiment name information, where the node IDs include the publishing region node ID and the subscribing region node ID. Specifically, the publishing region node ID represents the network location of the publishing node, and the subscribing region node ID represents the network node location of the data source. The attribute content includes basic information about the region data, including the data name, type, and maximum and minimum values.
[0047] Furthermore, such as Figure 3 As shown, the definition of the publishing area for aircraft position and attitude data forms an expandable tagged text. In the "Simu2023" experiment, "Sec001" defines the publishing content of the aircraft's pitch, yaw, and roll data, with the data coming from network node 1; "Sec002" defines the publishing content of the aircraft's XYZ geographic coordinate data, with the data coming from network node 2.
[0048] Publish / Subscribe Region Matching Steps: Based on the published / subscribe region definitions, establish a published region maintenance table and a subscribed region maintenance table, and determine the correspondence between published and subscribed data based on index matching. Once the published / subscribed region definitions are complete, upload the corresponding published and subscribed files to the top-level simulation resource management system, where the reflection memory management service maintains the experimental published and subscribed regions. The published and subscribed regions in the published and subscribed region maintenance tables are indexed by unique hash codes, which are established using the node ID, experiment name, and attribute characteristics corresponding to the region as keywords. Specifically, as shown... Figure 4 As shown, the release and ordering regions of the case simulation test system match, and its index space forms a one-to-one or one-to-many relationship.
[0049] The reflection memory address allocation process involves: requesting published data memory addresses from the reflection memory management service; determining the correspondence between published and subscribed data based on the matching; completing the reflection memory address mapping for the subscription region; and distributing the allocated memory addresses to each simulation node via Ethernet. Specifically, based on the hash matching of the published region maintenance table and the subscription region maintenance table, the allocated reflection memory addresses are mapped to the subscription regions, achieving uniformity of published and subscribed reflection memory addresses. The allocated results are then transmitted to each simulation test node via Ethernet. The reflection memory management service describes the entire reflection memory network space using a doubly linked circular list structure, including the space start address, space size, space occupancy identifier, hash index, and doubly linked list pointer, as shown in the structure below. Figure 5 As shown. When the reflection memory management service receives a memory usage request message sent by the test management node, it searches for a free memory block starting from the current linked list position. If the free memory block is smaller than the usage request size, it searches along the linked list. When a memory block of sufficient size is found, it is divided into an occupied block and a remaining free block. The address of the occupied block is returned to the publishing area maintenance table, thus completing the occupation of the reflection memory address space.
[0050] When the reflection memory management service receives a memory reclamation request message sent by the test management node, it changes the occupied flag of the corresponding memory block in the linked list to the free flag and performs a merge operation on the adjacent free blocks.
[0051] Reflective memory network communication steps: In the simulation experiment, a communication structure is created according to the publish / subscribe region definition. Read and write operations are performed on the mapped reflective memory address using this communication structure as a unit, thereby achieving real-time interaction of experimental data. Specifically, based on the publish / subscribe region definition, a reflective memory data communication structure can be created: First, the structure name is defined by combining the region ID and region name. Then, the attribute content is traversed, and structure member variables are added according to the data name and data type, completing the creation of the entire communication structure.
[0052] Furthermore, according to the appendix Figure 3 The publishing region is defined, and structures Sec001_Attitude and Sec002_Position and structure variables gAttitude and gPosition are created. During the simulation, the reflective memory write function RFM2gWrite is used to publish the region content, realizing real-time data communication between different nodes.
[0053] RFM2gWrite(Handle,AllocateAddr1,&gAttitude,sizeof(Sec001_Attitude));
[0054] RFM2gWrite(Handle,AllocateAddr2,&gPosition,sizeof(Sec002_Position));
[0055] Where Handle is the operation handle of the reflection memory board, AllocateAddr1 and AllocateAddr2 are the communication addresses allocated by the reflection memory management service to the publishing areas Sec001 and Sec002, respectively, & is the address-of operator, and sizeof is the byte-count operator.
[0056] This invention aims to solve the problem of network address management of reflection memory in a multi-user cluster simulation test platform.
[0057] The present invention also provides a reflective memory communication management system based on a publish-subscribe pattern. Those skilled in the art can implement the reflective memory communication management system based on a publish-subscribe pattern by executing the steps of the method. In other words, the method based on a publish-subscribe pattern can be understood as a preferred embodiment of the reflective memory communication management system based on a publish-subscribe pattern.
[0058] A reflection-based memory communication management system based on a publish-subscribe model, according to the present invention, includes:
[0059] The publish / subscribe region definition module uses Extensible Markup Language (EXPLAIN) to standardize the description of communication content between reflective memory network nodes, dividing it into publish regions and subscribe regions. This standardized description is pre-configured and edited on the experiment management node, using both text and drag-and-drop editing methods. The communication content includes region ID, region name, number of attributes, dependency relationships, and attribute content. The dependency relationships include node ID and experiment name information, where the publish region node ID represents the network location of the publishing node, and the subscribe region node ID represents the network node location of the data source. Attribute content includes basic information about the region data, including the region data name, type, and maximum and minimum values.
[0060] The publish / subscribe region matching module: Based on the published / subscribe region definitions, establishes a publish region maintenance table and a subscribe region maintenance table, and determines the correspondence between published and subscribed data based on index matching. Once the publish / subscribe region definitions are complete, the corresponding publish and subscribe files are uploaded to the top-level simulation resource management system, where the reflection memory management service maintains the experimental publish and subscribe regions. The publish and subscribe regions in the publish and subscribe region maintenance tables are indexed by unique hash codes, which are established using the node ID, experiment name, and attribute characteristics corresponding to the region as keys.
[0061] The reflection memory address allocation module requests published data memory addresses from the reflection memory management service. Based on the matching, it determines the correspondence between published and subscribed data, completes the reflection memory address mapping for the subscription area, and distributes the allocated memory addresses to each simulation node via Ethernet. The reflection memory management service describes the entire reflection memory network space using a doubly linked circular list structure, including the space start address, space size, space occupancy flag, and hash index. When the reflection memory management service receives a memory usage request message from the test management node, it searches for free memory blocks starting from the current linked list position. If the free memory block is smaller than the requested size, it searches further down the list. When a sufficiently large memory block is found, it divides the memory block into an occupied block and a remaining free block, returns the address of the occupied block to the publishing area maintenance table, and completes the occupancy of the reflection memory address space. When the reflection memory management service receives a memory reclamation request message from the test management node, it changes the occupancy flag of the corresponding memory block in the linked list to a free flag and performs a merging operation on adjacent free blocks.
[0062] Reflective memory network communication module: In the simulation experiment, a communication structure is created according to the publish / subscribe region definition. The mapped reflective memory address is read and written in units of the communication structure, thereby realizing real-time interaction of experimental data.
[0063] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.
[0064] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A reflection-based memory communication management method based on a publish-subscribe pattern, characterized in that, include: The steps for defining publish / subscribe regions are as follows: Extensible Markup Language is used to standardize the description of communication content between nodes in the reflective memory network, which is divided into publish regions and subscription regions; Publish / subscribe region matching steps: Based on the published / subscribe region definition, establish a published region maintenance table and a subscribed region maintenance table, and determine the correspondence between published data and subscribed data based on index matching; Reflection memory address allocation steps: Request the published data memory address from the reflection memory management service, determine the correspondence between published data and subscribed data based on the matching, complete the reflection memory address mapping of the subscription area, and distribute the allocated memory address to each simulation node via Ethernet; Reflective memory network communication steps: In the simulation experiment, a communication structure is created according to the publish / subscribe region definition. Read and write operations are performed on the mapped reflective memory address in units of the communication structure, thereby realizing real-time interaction of experimental data. The Reflection Memory Management Service describes the entire reflection memory network space as a doubly linked circular list structure, including the space start address, space size, space occupancy identifier, and hash index. When the reflection memory management service receives a memory usage request message sent by the test management node, it searches for a free memory block starting from the current linked list position. If the free memory block is smaller than the usage request size, it searches along the linked list. When a memory block of sufficient size is found, the memory block is divided into an occupied block and a remaining free block. The address of the occupied block is returned to the publishing area maintenance table, thus completing the occupation of the reflection memory address space. When the reflection memory management service receives a memory reclamation request message sent by the test management node, it changes the occupied flag of the corresponding memory block in the linked list to the free flag and performs a merge operation on the adjacent free blocks.
2. The reflection memory communication management method based on the publish-subscribe pattern according to claim 1, characterized in that, The standardized description is pre-configured and edited at the test management node, and the editing methods include program text and graphic drag-and-drop. The communication content includes the region ID, region name, number of attributes, subordinate relationship, and attribute content; The subordinate relationship includes node ID and trial name information, wherein the publishing region node ID represents the network location of the publishing node, and the subscription region node ID represents the network node location of the data source; The attribute content includes basic information about the regional data, including the name, type, and maximum and minimum values of the regional data.
3. The reflection memory communication management method based on the publish-subscribe pattern according to claim 1, characterized in that, Once the publish / subscribe regions are defined, the corresponding publish and subscribe files are uploaded to the top-level simulation resource management system, and the reflection memory management service maintains the experimental publish and subscribe regions. The published regions and subscribed regions in the published region maintenance table and the subscribed region maintenance table are indexed by unique hash codes. The unique hash code index is established based on the node ID, test name, and attribute characteristics corresponding to the region as keywords.
4. A reflection-based memory communication management system based on a publish-subscribe model, characterized in that, include: Publish / Subscribe Region Definition Module: Uses Extensible Markup Language to standardize the description of communication content between nodes in the Reflection Memory Network, which is divided into publish regions and subscription regions; Publish / Subscribe Region Matching Module: Based on the published / subscribe region definition, establish a published region maintenance table and a subscribed region maintenance table, and determine the correspondence between published data and subscribed data based on index matching; Reflection memory address allocation module: Requests published data memory addresses from the reflection memory management service, determines the correspondence between published data and subscribed data based on the matching, completes the reflection memory address mapping of the subscription area, and distributes the allocated memory addresses to each simulation node via Ethernet; Reflective memory network communication module: In the simulation experiment, a communication structure is created according to the publish / subscribe region definition. Read and write operations are performed on the mapped reflective memory address in units of the communication structure, thereby realizing real-time interaction of experimental data. The Reflection Memory Management Service describes the entire reflection memory network space as a doubly linked circular list structure, including the space start address, space size, space occupancy identifier, and hash index. When the reflection memory management service receives a memory usage request message sent by the test management node, it searches for a free memory block starting from the current linked list position. If the free memory block is smaller than the usage request size, it searches along the linked list. When a memory block of sufficient size is found, the memory block is divided into an occupied block and a remaining free block. The address of the occupied block is returned to the publishing area maintenance table, thus completing the occupation of the reflection memory address space. When the reflection memory management service receives a memory reclamation request message sent by the test management node, it changes the occupied flag of the corresponding memory block in the linked list to the free flag and performs a merge operation on the adjacent free blocks.
5. The reflection memory communication management system based on the publish-subscribe model according to claim 4, characterized in that, The standardized description is pre-configured and edited at the test management node, and the editing methods include program text and graphic drag-and-drop. The communication content includes the region ID, region name, number of attributes, subordinate relationship, and attribute content; The subordinate relationship includes node ID and trial name information, wherein the publishing region node ID represents the network location of the publishing node, and the subscription region node ID represents the network node location of the data source; The attribute content includes basic information about the regional data, including the name, type, and maximum and minimum values of the regional data.
6. The reflection memory communication management system based on the publish-subscribe model according to claim 4, characterized in that, Once the publish / subscribe regions are defined, the corresponding publish and subscribe files are uploaded to the top-level simulation resource management system, and the reflection memory management service maintains the experimental publish and subscribe regions. The published regions and subscribed regions in the published region maintenance table and the subscribed region maintenance table are indexed by unique hash codes. The unique hash code index is established based on the node ID, test name, and attribute characteristics corresponding to the region as keywords.
Citation Information
Patent Citations
Multi-node automatic memory allocation method based on reflective memory network
CN103678001A
A method and system for automatic memory address allocation based on XML format using reflection
CN111949570B
Reflective memory network organization and management method based on OpenDDS
CN111245919A
XML format-based reflective memory address automatic allocation method and system
CN111949570A