An intelligent distribution network terminal heterogeneous core information partition interaction method

CN122332343BActive Publication Date: 2026-09-15GUANGZHOU JOINT INSPECTION & CERTIFICATION TECHNOLOGY DEVELOPMENT SERVICES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610440727.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-04
Publication Date
2026-09-15
Estimated Expiration
2046-04-04

AI Technical Summary

Technical Problem

这种矛盾在业务过程中具体表现为,系统设计者依据预先规划为多种交互信息设立独立分区,但硬件对齐要求导致地址空间中出现大量空洞

Benefits of technology

本发明公开了一种智能配网终端异构核间信息分区交互方法。针对智能配网终端ARM核与RISC-V核共享内存区域中因保护单元幂次对齐导致的填充碎片问题,本发明通过ARM侧页表逐级解析获取各分区虚实地址映射关系,识别出填充碎片区段并计算其占分区总空间的比例,对碎片占比超标的区域,进一步分析相邻分区隔离收益消长特征,包括填充碎片增量与保护边界偏移量的正负变化方向,以此作为相似度依据采用聚类方式对高碎片分区进行逻辑分组。随后基于碎片占比最小化且隔离粒度不低于原配置的目标,逐级优化合并序列,确定满足RISC-V区域保护单元对齐要求的新分区边界地址及物理范围,最终通过硬件更新实现共享内存结构重构。该方法有效减少了异构核间内存碎片,提升地址空间利用率,同时维持了双核读写安全隔离边界,为智能配网终端持续可靠的信息交互与资源高效部署提供了技术保障。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122332343B_ABST
    Figure CN122332343B_ABST
Patent Text Reader

Abstract

The application provides a kind of intelligent network terminal heterogeneous core information partition interaction method, comprising: the target partition with the adjacent partition corresponding to the grouping after the formation of the partition set with the merging feasibility is summarized;From the partition set after grouping, extract the actual boundary address, through the boundary address combination of each partition by level recursion, based on the constraint relationship of fragment proportion and isolation granularity optimization partition merging sequence, determine the new partition boundary address after merging;Get the new partition boundary address after merging, update the alignment configuration of physical memory protection area through RISC-V side area protection unit, get the updated shared memory partition structure based on the boundary definition requirement of RISC-V side hardware;Through the comparison of address space utilization under the updated shared memory partition structure and the original address space utilization, evaluate the adjustment effect, extract the read-write safety boundary of dual-core, reallocate the virtual-real address mapping of interactive information partition, obtain the partition configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, and in particular to a method for information partitioning and interaction between heterogeneous cores of intelligent distribution network terminals. Background Technology

[0002] In power distribution automation systems, heterogeneous computing platforms are widely used. These platforms integrate processor cores with multiple architectures, such as ARM and RISC-V, requiring efficient and secure data exchange to support the reliable operation of power grid terminal equipment, such as feeder terminals (DTUs) or smart distribution terminals (TTs). These terminal devices are often deployed in remote substations or underground distribution rooms in cities, facing harsh environments such as high temperatures, high humidity, and electromagnetic interference. They must process massive amounts of real-time data, including voltage and current monitoring, fault location, and load balancing commands. Secure isolation and efficient resource utilization in inter-core communication are fundamental to ensuring system stability and real-time performance, as any data leakage or delay can trigger a chain reaction of failures, such as widespread power outages. Currently, to improve the security of inter-core data interaction, systems typically divide shared memory into multiple independent regions, storing different types of information such as control commands, status feedback, and alarm logs separately. This partitioning is similar to setting up independent storage compartments for sensitive files, aiming to prevent one type of data from contaminating another or being maliciously accessed. However, this approach has inherent limitations. While emphasizing increasing the number of isolated regions for fine-grained control, it ignores the physical constraints of hardware-level memory region partitioning, leading to reduced effectiveness of security strategies in actual deployment. For example, when a system includes processors conforming to specific architecture specifications, its physical memory protection mechanism requires that the start and end addresses of protected regions be aligned to powers of 2 (e.g., 4K, 8K bytes). This hardware requirement constitutes a core technical characteristic. Under existing partitioning methods that pursue fine-grained isolation, each new memory partition must have address padding inserted before actual information storage begins to meet this alignment rule. Although the system design phase typically pre-plans the required number of partitions based on service types and reserves a certain amount of redundancy, the types of services faced by intelligent distribution network terminals in actual operation are quite diverse. Control commands, telemetry data, remote signaling status, fault recordings, alarm logs, and firmware upgrades all need to be stored independently and in isolation, resulting in a high total number of partitions even after pre-planning. Under this existing partition size, the cumulative proportion of "pad fragments"—those unable to store valid data due to alignment constraints—in the total address space increases significantly. The more partitions there are, the finer the nominal isolation appears. However, the usable effective address space is constantly eroded by fragmentation, and the proportion of "useful" areas actually used for security isolation decreases. This contradiction manifests in business operations as follows: system designers create independent partitions for various interactive information based on pre-planned specifications, but hardware alignment requirements result in numerous gaps in the address space. For example, suppose ten shared memory partitions are needed for ten different types of control and status information. Each partition may waste several KB of space on average due to alignment constraints, potentially accumulating to tens of KB of wasted space. This is a significant loss in resource-constrained embedded terminals. Address space utilization is severely reduced, while the expected benefits of security isolation are greatly diminished due to the shrinking effective space.Therefore, how to achieve sufficiently fine inter-core information isolation while avoiding excessive consumption of address space due to invalid filling, under the premise of satisfying the rigid alignment constraints of hardware, has become a key issue in balancing the security and resource efficiency of heterogeneous inter-core communication in smart distribution network terminals. Summary of the Invention

[0003] This invention provides a method for information partitioning and interaction between heterogeneous cores of intelligent distribution network terminals, mainly including: The process involves obtaining the page start addresses required for each partition in the shared memory region, resolving the virtual address to physical address mapping path step by step through the ARM side page table, and resolving the actual mapping base address of each partition in physical memory based on the virtual-physical address mapping relationship. It also identifies the padded fragmentation segments between the page start address and the power-order alignment boundary defined by the RISC-V side region protection unit. The fragmentation percentage of each partition is calculated using a formula that represents the proportion of the padded fragmentation segment to the total space of the partition. For partitions with a fragmentation percentage exceeding a preset threshold, the boundary addresses of adjacent partitions are obtained. The feasibility of merging adjacent target partitions is evaluated by comparing the isolation granularity and fragmentation percentage of each partition before and after merging. Finally, a summary of target partitions with merging feasibility and their corresponding... Adjacent partitions form a grouped partition set; the actual boundary addresses are extracted from the grouped partition set, and the partition merging sequence is optimized based on the constraint relationship between fragmentation ratio and isolation granularity by recursively deriving the boundary address combination of each partition, thus determining the boundary address of the merged new partition; the boundary address of the merged new partition is obtained, and the alignment configuration of the physical memory protection region is updated through the RISC-V side region protection unit, and the updated shared memory partition structure is obtained based on the boundary definition requirements of the RISC-V side hardware; the adjustment effect is evaluated by comparing the address space utilization under the updated shared memory partition structure with the original address space utilization, and the virtual and physical address mapping of the interactive information partition is reallocated to obtain the partition configuration.

[0004] Furthermore, the process of obtaining the page start address required for each partition in the shared memory region, parsing the virtual address to physical address mapping path step by step through the ARM-side page table, resolving the actual mapping base address of each partition in physical memory based on the virtual-physical address mapping relationship of each partition, and identifying the padded fragment segment between the page start address and the power-order alignment boundary defined by the RISC-V-side region protection unit includes: Obtain the page start address of each partition in the heterogeneous shared memory area of ​​the intelligent distribution network terminal. According to the hierarchical order of the first-level page table entry index and the second-level page table descriptor offset on the ARM side, extract the physical base address corresponding to the virtual address of each partition from the page table tree on the ARM side to obtain the virtual and physical address mapping relationship table of each partition. Based on the physical base address of each partition in the virtual-physical address mapping table, the power-order alignment requirement applied by the RISC-V side region protection unit to the starting address of the memory protection region is read, and the physical base address of each partition is rounded up to the nearest power-order alignment boundary to obtain the actual effective alignment start address of each partition under the RISC-V side region protection unit. From the continuous address segment between the alignment start address and the physical base address, extract the address range that cannot store valid interactive information due to power alignment constraints, mark the address range as the filling fragment segment, and record the start address, end address and partition number of the filling fragment segment in the filling fragment segment index table. Based on the filling fragment segment index table, the start and end addresses of each filling fragment segment are extracted partition by partition. The address boundaries of each filling fragment segment are verified by comparing with the aligned start address, and the filling fragment segment identification results of each partition after boundary verification are obtained.

[0005] Furthermore, the fragmentation ratio of each partition is obtained using the formula that fills the fragmented segments to the total space of the partition. For partitions with a fragmentation ratio exceeding a preset threshold, the boundary addresses of adjacent partitions are obtained. The feasibility of merging adjacent target partitions is evaluated by comparing the isolation granularity and fragmentation ratio of each partition before and after merging, including: Extract the number of bytes in the filled fragment segment and the total number of bytes in the partition from the filled fragment segment index table. Divide the number of bytes in the filled fragment segment by the total number of bytes in the partition to obtain the fragmentation ratio of each partition. Compare the fragmentation ratio with a preset threshold partition by partition to identify the set of target partitions whose fragmentation ratio exceeds the preset threshold. Obtain the upper and lower boundary addresses of the adjacent partitions of each partition in the target partition set. Use the address range enclosed by the upper and lower boundary addresses as the candidate range for merging. Compare the independent isolation granularity of each partition before merging with the isolation granularity corresponding to the candidate range for merging. Extract the direction and magnitude of the increase or decrease in isolation granularity before and after merging and define them as the isolation benefit and loss characteristics. Based on the characteristics of the rise and fall of isolation benefits, the sum of the fragment proportions of each target partition before the merger is compared with the fragment proportion of the merger candidate interval. If the fragment proportion of the merger candidate interval is lower than the sum of the fragment proportions before the merger, and the isolation granularity of the merger candidate interval is not lower than the minimum value of the isolation granularity of each partition before the merger, then the adjacent partitions are determined to be feasible for merger.

[0006] Furthermore, the aggregation of target partitions with merging feasibility and their corresponding adjacent partitions to form a grouped partition set includes: Extract the target partition numbers that are deemed feasible for merging and their corresponding adjacent partition numbers from the feasibility assessment results of each target partition. Check each target partition pair for a connection between their partition numbers. If the adjacent partition number in one target partition pair is the same as the target partition number in another target partition pair, then the two target partition pairs are determined to belong to the same continuous merging candidate range. The target partition pairs with a connection are merged into the same partition group to obtain the set of target partition numbers corresponding to each partition group. For each partition group, using the partition group number as an index, the physical address range and fragmentation ratio of all target partitions within the same partition group are summarized and recorded to obtain the grouped partition set.

[0007] Furthermore, after assessing the feasibility of merging adjacent target partitions by comparing the isolation granularity and fragmentation ratio of each partition before and after merging, the process includes: obtaining the filling fragmentation increment and protection boundary offset of each partition, where the filling fragmentation increment is the difference between the fragmentation ratio of the candidate merge interval and the sum of the fragmentation ratios of each partition before merging, and the protection boundary offset is the address deviation between the alignment start address of the candidate merge interval and the alignment start address of each partition. For the incremental filling fragments and the offset of the protection boundary, the positive and negative directions of the isolation benefits of each partition are marked respectively, so as to obtain the benefit direction mark set of each partition; Based on the set of revenue direction markers, for partitions with consistent revenue direction markers, the difference between the increment of the filling fragments and the difference between the offset of the protection boundary are compared pairwise. If the difference between the increment of the filling fragments and the difference between the offset of the protection boundary do not exceed the preset similarity threshold, it is determined that the two partitions have similar increment and decrement, and they are identified as candidate clustering units to obtain a set of candidate clustering units. For the candidate clustering unit set, the consistency between the direction of change of the filling fragment segment and the direction of adjustment of the protection boundary in each candidate clustering unit is used as the aggregation basis. Candidate clustering units with filling fragment segments changing in the same direction and the direction of adjustment of the protection boundary are merged into the same partition set to obtain the grouped partition set.

[0008] Furthermore, the step of extracting actual boundary addresses from the grouped partition set, and optimizing the partition merging sequence based on the constraint relationship between fragmentation ratio and isolation granularity by recursively proposing the boundary address combinations of each partition, includes: Extract the upper and lower boundary addresses of each partition from the grouped partition set. Arrange the upper and lower boundary addresses of each partition in the same partition set from low to high according to the physical address to form the boundary address sequence of the partition set. For the boundary address sequence, starting from the lowest address, the boundary addresses of two adjacent partitions are combined in pairs level by level. The upper and lower boundary addresses of each pair are used as the boundary of the merge interval at that level. This process is repeated level by level until all partitions in the partition set are covered, resulting in a step-by-step merge interval sequence. For the step-by-step merging interval sequence, the fragmentation ratio of each merging interval is calculated step by step. If the fragmentation ratio of a certain merging interval is lower than that of the previous level and the isolation granularity is not lower than the minimum value of the isolation granularity of each partition in the original partition set, then the merging interval of that level is retained. Otherwise, the merging interval of the previous level is used as the termination level to obtain a merging sequence that satisfies the minimum fragmentation ratio and the isolation granularity is not lower than the original configuration.

[0009] Further, determining the new partition boundary address after merging includes: extracting the upper and lower boundary addresses outside the terminating merging interval of the merging sequence to obtain the new partition boundary address after merging.

[0010] Furthermore, the process of obtaining the merged new partition boundary address, updating the alignment configuration of the physical memory protection region through the RISC-V side region protection unit, and obtaining the updated shared memory partition structure based on the boundary definition requirements of the RISC-V side hardware includes: Obtain the new partition boundary address that meets the alignment requirements of the RISC-V side region protection unit, and write the lower boundary coordinate and upper boundary coordinate in the new partition boundary address into the physical memory protection region register of the RISC-V side region protection unit partition by partition to complete the update of the physical memory protection region alignment configuration and obtain the protection region registration record of each new partition in the RISC-V side region protection unit. Based on the protection region registration record, the lower boundary coordinates and upper boundary coordinates of each new partition are read back from the physical memory protection region register of the RISC-V side region protection unit. The physical address range of each new partition is constructed using the read-back lower boundary coordinates and upper boundary coordinates. The physical address ranges of all new partitions are summarized to obtain the updated shared memory partition structure.

[0011] Furthermore, the evaluation of the adjustment effect by comparing the address space utilization under the updated shared memory partition structure with the original address space utilization, and the reallocation of the virtual and physical address mappings of the interactive information partitions to obtain the partition configuration, includes: Extract the physical address range of each new partition from the updated shared memory partition structure. Subtract the sum of the number of bytes filling the fragmented segments from the number of bytes in the physical address range of each new partition, and divide by the total number of bytes in the shared memory region to obtain the updated address space utilization. Compare the updated address space utilization with the original address space utilization. If the updated address space utilization is higher than the original address space utilization, extract the lower boundary coordinates and upper boundary coordinates of each new partition from the updated shared memory partition structure as the read / write safety boundary of the dual core. Based on the read / write security boundary of the dual core, for various interactive information such as control commands, telemetry data, remote signaling status, fault recordings and alarm logs, the various interactive information is allocated to the physical address range of the corresponding new partition according to its data scale. Through the ARM side page table, the virtual address of each interactive information partition is mapped to the physical address within the read / write security boundary through the hierarchical path of first-level page table index and second-level page table descriptor offset, thus obtaining the virtual and physical address mapping relationship of each interactive information partition. Based on the virtual and physical address mapping relationship, the virtual starting address, physical base address and partition byte length of each interactive information partition are summarized to obtain the partition configuration for continuous deployment of the dual-core shared memory area of ​​the intelligent distribution network terminal.

[0012] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects: This invention discloses a method for information partitioning and interaction between heterogeneous cores in a smart distribution network terminal. Addressing the issue of fragmentation caused by power-law alignment of protection units in the shared memory region between the ARM and RISC-V cores of a smart distribution network terminal, this invention obtains the virtual and physical address mapping relationships of each partition through step-by-step parsing of the ARM sidepage table, identifies fragmented segments, and calculates their proportion of the total space occupied by the partition. For regions with excessive fragmentation, the invention further analyzes the characteristics of the gains and losses in isolation between adjacent partitions, including the positive and negative directions of the increase in fragmentation and the offset of the protection boundary. This is used as a similarity criterion for logical grouping of high-fragmentation partitions using clustering. Subsequently, based on the goal of minimizing the fragmentation ratio while maintaining an isolation granularity no less than the original configuration, the merging sequence is optimized step-by-step to determine the new partition boundary address and physical range that meet the protection unit alignment requirements of the RISC-V region. Finally, the shared memory structure is reconstructed through hardware updates. This method effectively reduces memory fragmentation between heterogeneous cores, improves address space utilization, and maintains the secure isolation boundary for dual-core read / write operations, providing technical support for continuous and reliable information interaction and efficient resource deployment in smart distribution network terminals. Attached Figure Description

[0013] Figure 1 This is a flowchart of a method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to the present invention.

[0014] Figure 2 This is a schematic diagram of a method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to the present invention.

[0015] Figure 3 This is another schematic diagram of a method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to the present invention. Detailed Implementation

[0016] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0017] like Figures 1-3 This embodiment of a method for information partitioning and interaction between heterogeneous cores of a smart distribution network terminal may specifically include: Step S101: Obtain the page start address required for each partition in the shared memory region, resolve the mapping path from virtual address to physical address step by step through the ARM side page table, resolve the actual mapping base address of each partition in physical memory based on the virtual and physical address mapping relationship of each partition, and identify the padded fragment segment between the page start address and the power-order alignment boundary defined by the RISC-V side region protection unit.

[0018] Obtain the page start address of each partition in the heterogeneous shared memory area of ​​the intelligent distribution network terminal. For the page start address, extract the physical base address corresponding to the virtual address of each partition from the ARM-side page table tree in hierarchical order of the first-level page table entry index and the second-level page table descriptor offset, to obtain the virtual-physical address mapping table of each partition. Based on the physical base address of each partition in the virtual-physical address mapping table, read the power-law alignment requirement imposed by the RISC-V side region protection unit on the start address of the memory protection area. If the physical base address does not fall on the power-law alignment boundary, round up to the nearest power-law alignment boundary to obtain the actual effective alignment start address of each partition under the RISC-V side region protection unit. From the continuous address segment between the alignment start address and the physical base address, extract the address range that cannot store valid interactive information due to power-law alignment constraints, mark the address range as a fill fragment segment, and record the start address, end address, and partition number of the fill fragment segment in the fill fragment segment index table. According to the filling fragment segment index table, the start address and end address of each filling fragment segment are extracted partition by partition. The address boundary of each filling fragment segment is checked against the alignment start address to see if it meets the power-order alignment constraint of the RISC-V side region protection unit. If it does not meet the constraint, the end address of the filling fragment segment is redefined with the nearest power-order alignment boundary to obtain the filling fragment segment identification result after boundary verification for each partition.

[0019] In heterogeneous core communication scenarios within smart distribution network terminals, ARM-based processor cores and RISC-V-based processor cores share the same physical memory region, but their methods of accessing memory addresses differ fundamentally. The ARM side employs a multi-level page table mechanism to manage the mapping from virtual addresses to physical addresses, while the RISC-V side relies on region protection units to impose power-law alignment constraints on the physical address range. This difference leads to a large number of fragmented segments in the shared memory partition that cannot store valid interactive information during actual deployment.

[0020] Specifically, ARM side page tables typically employ a two-level structure. The first-level page table uses the high-order bits of the virtual address as an index to locate the corresponding first-level page table entry, which stores the physical base address of the second-level page table. The second-level page table then uses the middle bit of the virtual address as an offset to locate the specific second-level page table descriptor, which records the starting address and access attributes of the target physical page. In the shared memory management of intelligent distribution network terminals, for various partitions such as control command partitions, telemetry data partitions, and remote signaling status partitions, the ARM side page table is traversed one by one according to the above two-level index path. The physical base address corresponding to the virtual address of each partition is extracted from the second-level page table descriptor, and the correspondence between the virtual address and the physical base address is recorded as a virtual-physical address mapping table.

[0021] In one embodiment, for the shared memory configuration of a smart distribution terminal (feeder terminal unit), the virtual starting address of the control command partition is indexed by the ARM-side first-level page table to locate the page table entry storing the second-level page table descriptor of that partition, and the physical base address is read from it to complete the extraction of the virtual-physical address mapping relationship of that partition. The remaining partitions, such as the telemetry data partition and the fault recording partition, are extracted sequentially along the same path to form a mapping relationship table containing the virtual-physical address correspondence of all partitions. Based on the physical base address of each partition in the virtual-physical address mapping relationship table, the power-order alignment constraint of the RISC-V side area protection unit on the starting address of the protected area is further processed. Power-order alignment means that the RISC-V side area protection unit requires the starting address of the protected memory area to be an integer multiple of the number of bytes raised to the power of 2, such as 4096 bytes, 8192 bytes, or 16384 bytes. The specific power is determined by the protection granularity registered by the partition in the area protection unit. If the physical base address of a partition happens to fall on the power-order alignment boundary, the partition can be directly protected by the area protection unit without additional padding. If the physical base address does not fall on the power-law alignment boundary, it needs to be moved up to the nearest power-law alignment boundary to obtain the alignment start address. The process of rounding up is as follows: take the power-law alignment granularity as the divisor and the remainder of the physical base address. If the remainder is not zero, add the difference between the power-law alignment granularity and the remainder to the physical base address. The result is the alignment start address. In the scenario of intelligent distribution network terminals, if the physical base address of the alarm log partition falls in a non-aligned position, its alignment start address will be shifted forward by a certain number of bytes relative to the physical base address. This forward shift interval constitutes the main body of the fragmented segment filling.

[0022] It should be noted that the power-order alignment granularity is not a fixed value, but is determined by the protection boundary granularity configured by the RISC-V side region protection unit for different partitions. The larger the protection granularity, the greater the maximum deviation between the alignment start address and the physical base address, and the larger the potential size of the fragmented fill segment. Therefore, the calculation result of the alignment start address directly reflects the actual constraint degree of the RISC-V side hardware on the physical memory layout of the partition. After obtaining the alignment start address of each partition, the address segment that cannot store effective interactive information such as control commands, telemetry data, and tele-signaling status is extracted from the continuous address interval between the alignment start address and the physical base address, and this address segment is marked as a fragmented fill segment. The start address of the fragmented fill segment is the physical base address of the partition, and the end address is the position of the byte before the alignment start address. The start address, end address, and partition number of the fragmented fill segment are written into the fragmented fill segment index table to form a fragmentation distribution record covering all partitions.

[0023] Preferably, the filling fragment segment index table uses the partition number as the primary key and arranges the fragment records of each partition in ascending order of physical address, which facilitates subsequent boundary verification processing of the filling fragment segments according to address order.

[0024] In one possible implementation, the firmware upgrade partition has a significantly larger number of bytes in its fragmented fill segments compared to the control command partition or remote signaling status partition due to a large deviation between its physical base address and the power-law alignment boundary required by the RISC-V side region protection unit. A fragmented fill segment index table allows for a direct comparison of the fragment size differences between partitions. Based on this index table, the start and end addresses of the fragmented fill segments are extracted for each partition. The end address of the fragmented fill segment is then compared with the alignment start address of each partition to verify whether it aligns with the alignment start address on the power-law boundary. If there is a byte deviation between the end address and the alignment start address, it indicates that the alignment start address does not strictly meet the power-law alignment constraint of the RISC-V side region protection unit. In this case, the end address of the fragmented fill segment is redefined using the nearest power-law alignment boundary, and the fragment boundary record for that partition is updated in the fragmented fill segment index table. This yields the fragmented fill segment identification results for each partition after boundary verification, completing the full identification of fragmented fill segments in each partition within the shared memory region.

[0025] Step S102: The fragmentation ratio of each partition is obtained by using the formula of the proportion of the fragmentation segment to the total space of the partition. For partitions whose fragmentation ratio exceeds the preset threshold, the boundary address of the adjacent partition is obtained. The feasibility of merging the adjacent target partitions is evaluated by comparing the isolation granularity and fragmentation ratio of each partition before and after merging.

[0026] Extract the number of bytes in the filled fragmented segments (denoted as F) and the total number of bytes in the partition space (denoted as S) from the filled fragmented segment index table. Calculate the fragmentation ratio of each partition as F / S. Compare the fragmentation ratio with a preset threshold of 0.3 (set based on system optimization experience) partition by partition to identify the target partition set whose fragmentation ratio exceeds the preset threshold. For each partition in the target partition set, obtain the upper and lower boundary addresses of its immediate neighboring partitions in the shared memory region. Use the address interval enclosed by the upper and lower boundary addresses as the candidate interval for merging. Compare the independent isolation granularity of each partition before merging with the isolation granularity corresponding to the candidate interval for merging. Extract the direction and magnitude of the increase or decrease in isolation granularity before and after merging and define them as the isolation gain / loss characteristics (positive gain indicates improved isolation, negative gain indicates decreased isolation). Based on the characteristics of the rise and fall of isolation benefits, the sum of the fragment ratios of each target partition before merging is compared with the fragment ratio of the candidate merging interval (this ratio is calculated by extracting the number of bytes of the fragmented segment filled in the merging interval and dividing it by the total number of bytes of space in the interval). If the fragment ratio of the candidate merging interval is lower than the sum of the fragment ratios before merging, and the isolation granularity of the candidate merging interval is not lower than the minimum value of the isolation granularity of each partition before merging, then the adjacent partitions are determined to be feasible for merging, and the merging feasibility assessment results of each target partition are obtained.

[0027] In the shared memory management of intelligent distribution network terminals, each partition generates fragmented segments due to the power-order alignment constraints of the RISC-V side region protection units, and the fragmentation scale varies among different partitions. The fragmentation ratio is a core indicator for measuring the degree of address space waste in a single partition. It is calculated by dividing the number of bytes of fragmented segments in the partition by the total number of bytes in the partition's space; the resulting ratio is the fragmentation ratio of that partition.

[0028] Specifically, the fill fragmentation segment index table records the start and end addresses of the fill fragmentation segments for each partition, and the difference between the two is the number of bytes in the fill fragmentation segment. The total number of bytes in the partition space is determined by the difference between the upper and lower boundaries of the address registered by the partition in the shared memory region. After dividing the number of bytes in the fill fragmentation segment by the total number of bytes in the partition space to obtain the fragmentation ratio of each partition, each partition is compared with a preset threshold. Partitions with a fragmentation ratio exceeding the preset threshold are marked as target partitions, and the set of target partitions is obtained after aggregation. In the scenario of intelligent distribution network terminals, firmware upgrade partitions or fault recording partitions often have a larger physical base address offset due to their relatively small total partition space, and their fragmentation ratio often exceeds the preset threshold first, thus entering the target partition set. Based on the target partition set, the boundary addresses of adjacent partitions are further processed. Isolation granularity is an indicator that measures the fineness of physical isolation between two partitions, specifically the length of the independently protected address interval of each of the two adjacent partitions. The shorter the independent address interval, the finer the isolation granularity, and the more accurate the distinction between different types of interactive information; conversely, if two partitions are merged into a larger protected interval, the isolation granularity will become coarser. For each partition in the target partition set, obtain the upper and lower boundary addresses of its immediate neighboring partitions. Use the continuous address interval enclosed by the outer boundary addresses of the two partitions as the candidate interval for merging. Compare the isolation granularity of the two partitions before merging with the isolation granularity corresponding to the candidate interval for merging. Extract the direction and magnitude of the increase or decrease in isolation granularity before and after merging to obtain the characteristics of the rise and fall of isolation benefits.

[0029] In one embodiment, the remote signaling status partition and the alarm log partition are adjacent in shared memory, and their independent isolation granularity corresponds to their respective protected address range lengths. After merging, the merged candidate interval covers the complete address range of both, and the isolation granularity is expanded from two independent intervals to a joint interval. The isolation benefit variation characteristic is recorded as a positive expansion of isolation granularity and a possible reduction in fragmented segments.

[0030] Preferably, the isolation benefit variation feature simultaneously records the sum of the fragment proportions of each partition before merging and the fragment proportion of the candidate merge interval, with the difference between the two reflecting the actual reduction in the number of filling fragments caused by the merge operation. If the fragment proportion of the candidate merge interval is lower than the sum of the fragment proportions before merging, and the isolation granularity of the candidate merge interval is not lower than the minimum value of the isolation granularity of each partition before merging, then the adjacent partitions are determined to be feasible for merging, and the merging feasibility assessment results of each target partition are obtained.

[0031] Step S103: Summarize the target partitions that are feasible to be merged and their corresponding adjacent partitions to form a grouped partition set.

[0032] From the feasibility assessment results of each target partition, the target partition numbers deemed feasible for merging and their corresponding adjacent partition numbers are extracted. Each pair of target partitions is checked for a connection between their partition numbers; that is, if an adjacent partition number in one target partition pair matches the target partition number in another, the two target partition pairs are determined to belong to the same continuous merge candidate range. Target partition pairs with a connection are merged into the same partition group, resulting in a set of target partition numbers for each partition group. For each partition group, using the partition group number as an index, the physical address range and fragmentation ratio of all target partitions within the same partition group are summarized and recorded, resulting in the grouped partition set.

[0033] In the shared memory management of intelligent distribution network terminals, the feasibility assessment results provide a merging decision for each target partition whose fragmentation ratio exceeds a preset threshold, along with its adjacent partitions. These decisions exist in the form of target partition pairs, each recording a target partition number and its adjacent partition numbers that are feasible for merging. All target partition pairs deemed feasible for merging are arranged in ascending order of physical address, resulting in a target partition pair list, providing ordered input data for subsequent grouping operations. The core of grouping the target partition pair list lies in identifying the connection relationship between target partition pairs. The connection relationship refers to the fact that the adjacent partition number in one target partition pair matches the target partition number in another target partition pair, indicating that the two target partition pairs are physically connected end-to-end, forming a continuous range of candidate merges.

[0034] Specifically, for each record in the target partition pair list, the adjacent partition numbers are extracted one by one and compared with the target partition numbers of the other target partition pairs in the list. If a match is found, it is determined that the two target partition pairs have a connection relationship, and the target partition pairs with the connection relationship are merged into the same partition group. The merging operation is performed recursively: if partition pair A has a connection relationship with partition pair B, and partition pair B has a connection relationship with partition pair C, then partition pairs A, B, and C all belong to the same partition group, until no further connection partition pairs can be found in the target partition pair list, forming a complete set of target partition numbers for that partition group.

[0035] In one embodiment, the telemetry data partition and the remote signaling status partition in the shared memory of the smart distribution network terminal constitute a target partition pair, and the remote signaling status partition and the alarm log partition constitute another target partition pair. The two are connected by the number of the remote signaling status partition and are merged into the same partition group, which covers the continuous physical address range from the telemetry data partition to the alarm log partition.

[0036] Preferably, if a target partition pair has no connection with any other target partition pair in the list, then the target partition pair constitutes a separate partition group, and its target partition number set contains only the two partition numbers from that target partition pair. This group is then included in the subsequent partition set. Further, for each partition group, using the partition group number as an index, the physical address range and fragmentation ratio of all target partitions within the same partition group are summarized and recorded to obtain the grouped partition set. This partition set completely records the physical layout and fragmentation distribution of the target partitions within each group, providing structured data input for subsequent group-based merging operations.

[0037] The incremental filling fragments and the offset of the protection boundary in each partition are analyzed. The positive and negative directions of the increase and decrease of isolation benefits between adjacent partitions are analyzed. Partition combinations with similar increase and decrease magnitudes are identified as candidate clustering units, forming a partition set based on the similarity of the increase and decrease of isolation benefits. The filling fragment segments of each partition in the set change in the same direction and the adjustment direction of the protection boundary is consistent.

[0038] The fill fragment increment and protection boundary offset of each partition are analyzed. The fill fragment increment is the difference between the fragment ratio of the merged candidate interval and the sum of the fragment ratios of each partition before merging. The protection boundary offset is the address deviation between the alignment start address of the merged candidate interval and the alignment start address of each partition. For the fill fragment increment and protection boundary offset, the positive and negative directions of isolation benefit for each partition are marked, resulting in a benefit direction label set for each partition. Based on the benefit direction label set, for partitions with consistent benefit direction labels, the difference between their fill fragment increment and the difference between their protection boundary offset are compared pairwise. If the difference between the fill fragment increment and the difference between their protection boundary offset do not exceed a preset similarity threshold, the two partitions are determined to have similar increment / decrement magnitudes and are identified as candidate clustering units, resulting in a candidate clustering unit set. For the candidate clustering unit set, the consistency between the direction of change of the filling fragment segment and the direction of adjustment of the protection boundary in each candidate clustering unit is used as the aggregation basis. Candidate clustering units whose filling fragment segments change in the same direction and whose protection boundary adjustment directions are consistent are merged into the same partition set, resulting in a partition set based on the similarity of the rise and fall of isolation benefits.

[0039] In the shared memory partition management of intelligent distribution network terminals, each partition generates fill fragments due to the power-order alignment constraints of the RISC-V side region protection units. The fill fragment increment and protection boundary offset of different partitions reflect the specific characteristics of address space changes under the merging operation. The fill fragment increment refers to the difference between the fragment ratio of the merge candidate interval and the sum of the fragment ratios of each partition before merging. A negative difference indicates that the merging operation reduces fill fragments, while a positive difference indicates that the merging operation increases fill fragments. The protection boundary offset refers to the address deviation between the alignment start address of the merge candidate interval and the alignment start address of each partition, reflecting the adjustment range of the RISC-V side region protection unit protection boundary position by the merging operation.

[0040] Specifically, the incremental value of fill fragments for each partition is read from the isolation benefit fluctuation characteristics. If the value is less than zero, the partition is marked as having a positive isolation benefit direction; if the value is greater than zero, it is marked as having a negative benefit direction. Simultaneously, the guard boundary offset is read, marked as a positive offset in the direction of address increase and a negative offset in the direction of address decrease. These two labels are merged to form the benefit direction label for that partition. The benefit direction label set is obtained by summing all the benefit direction labels for all partitions. Based on the benefit direction label set, partitions with consistent benefit direction labels are compared pairwise. Consistent benefit direction labels mean that the fill fragment increments of two partitions are both positive or both negative benefits, and the guard boundary offset directions are the same. Furthermore, the absolute value of the difference between the fill fragment increments of the two partitions and the absolute value of the difference between the guard boundary offsets are compared. If neither difference exceeds a preset similarity threshold, the two partitions are determined to have similar increase / decrease rates and are marked as candidate clustering units. The candidate clustering unit set is then obtained. The preset similarity threshold is pre-configured based on the total address space of the shared memory of the smart distribution network terminals, and is used to define the judgment boundary when the increase or decrease is similar.

[0041] In one embodiment, the telemetry data partition and the tele-signaling status partition of the smart distribution network terminal have negative and similar absolute values ​​for their fill fragment increments, and their protection boundary offset directions are both positive with offset differences not exceeding a preset similarity threshold. Both are identified as candidate clustering units and enter the candidate clustering unit set. Further, for the candidate clustering unit set, aggregation is performed based on the consistency between the fill fragment segment change direction and the protection boundary adjustment direction within each candidate clustering unit. A consistent fill fragment segment change direction means that the fill fragment increment signs of each partition within the set are consistent, i.e., both increasing or both decreasing; consistent protection boundary adjustment direction means that the protection boundary offset directions of each partition within the set are the same. Candidate clustering units that meet the above two consistency conditions are merged into the same partition set, resulting in a partition set aggregated based on the similarity of isolation benefit fluctuations. Each partition within this partition set exhibits similar address space change patterns under the merging operation.

[0042] Step S104: Extract the actual boundary addresses from the grouped partition set, and optimize the partition merging sequence based on the constraint relationship between fragmentation ratio and isolation granularity by recursively deriving the boundary address combination of each partition, and determine the boundary address of the merged new partition.

[0043] Extract the upper and lower boundary addresses of each partition from the grouped partition set. Arrange the upper and lower boundary addresses of each partition within the same partition set in ascending order of physical address to form the boundary address sequence of the partition set, thus obtaining the boundary address sequence set corresponding to each partition set. Based on the boundary address sequence set, for each partition set, starting from the lowest address end of the boundary address sequence, combine the boundary addresses of adjacent partitions in pairs level by level. Use the outer upper and lower boundary addresses of each pair as the boundary of the merge interval for that level, and recursively extend this process until all partitions within the partition set are covered, thus obtaining the level-wise merge interval sequence for each partition set. For the aforementioned hierarchical merging interval sequence, the number of bytes in the filled fragment segment of each merging interval is extracted and the total number of bytes in the merging interval is extracted. The ratio of these two values ​​is used to obtain the fragmentation ratio of that level of merging interval. The total number of bytes in the merging interval is used as the isolation granularity for that level. If the fragmentation ratio of a certain level of merging interval is lower than that of the previous level and the isolation granularity is not lower than the minimum value of the isolation granularity of each partition in the original partition set, then that level of merging interval is retained. Otherwise, the previous level of merging interval is used as the termination level, resulting in a merging sequence that satisfies the minimum fragmentation ratio and the isolation granularity not lower than the original partition configuration. Based on the terminating level merging interval of the merging sequence, its outer upper boundary address and lower boundary address are extracted to obtain the boundary address of the new partition after merging.

[0044] In the shared memory management of intelligent distribution network terminals, the partition set after similarity aggregation of isolation benefit fluctuations exhibits consistency in the direction of fragmentation change and protection boundary adjustment among its internal partitions. This provides a foundation for subsequent group-based merging operations. The core of the merging operation lies in constructing a merging interval sequence from the boundary addresses of the partition set through a step-by-step recursive approach. At each level of recursion, both the fragmentation ratio and isolation granularity constraints are evaluated to determine the new partition boundary addresses that satisfy both constraints. From the grouped partition set, the upper and lower boundary addresses registered in the shared memory region for each partition are read one by one. The upper and lower boundary addresses of all partitions within the same partition set are arranged from low to high physical address, forming the boundary address sequence of that partition set. The boundary address sequence completely records the physical distribution of each partition within the partition set and serves as the data source for subsequent step-by-step merging recursion. The boundary address sequence set is obtained by summarizing the boundary address sequences of all partition sets. Based on the boundary address sequence set, the construction of the step-by-step merging interval sequence is the core processing step of this scheme.

[0045] Specifically, for a given set of partitions, starting from the lowest physical address in its boundary address sequence, the two adjacent partitions with the lowest physical addresses in the sequence are selected. The lower boundary address of the lowest physical address in these two partitions is used as the lower boundary of the merged interval, and the upper boundary address of the highest physical address is used as the upper boundary of the merged interval, forming a first-level merged interval covering these two partitions. Based on the first-level merged interval, its upper boundary address is combined with the upper boundary address of the next partition in the boundary address sequence to expand and form a second-level merged interval covering three partitions. This process is repeated level by level until the final merged interval covers all partitions in the set, forming a hierarchical merged interval sequence from two partitions to all partitions. Each level of merged interval records its lower boundary address, upper boundary address, and the range of partition numbers it covers, which are then summarized to obtain the hierarchical merged interval sequence for each set of partitions.

[0046] It's important to note that the significance of the step-by-step recursion lies in decomposing the merge operation into multiple evaluable intermediate states, rather than merging all partitions at once. Each merge interval represents a possible merge granularity, corresponding to different degrees of fragmentation reduction and isolation granularity changes. Dual-constraint evaluation is performed independently at each level, thereby identifying the merge termination position with the minimum fragmentation percentage and isolation granularity that satisfies the constraints. Furthermore, for the step-by-step merge interval sequence, starting from the first merge interval, the number of bytes in the filled fragmentation segment and the total number of bytes in the merge interval are extracted level by level. The fragmentation percentage of that merge interval is obtained by dividing the number of bytes in the filled fragmentation segment by the total number of bytes in the merge interval. The number of bytes in the filled fragmentation segment comes from the sum of the number of bytes in the filled fragmentation segment of each partition covered by that merge interval in the filled fragmentation segment index table. The total number of bytes in the merge interval is the difference between the upper and lower boundary addresses of the merge interval. Simultaneously, the total number of bytes in the merge interval is used as the isolation granularity for that level, reflecting the length of the joint address range protected by the RISC-V side region protection unit after the merge.

[0047] In one embodiment, the alarm log partition and firmware upgrade partition of the smart distribution network terminal belong to the same partition set. The first-level merging interval covers both, and its fragmentation ratio is lower than the sum of the independent fragmentation ratios of the two partitions. Moreover, the isolation granularity is not lower than the minimum isolation granularity of the two partitions. It is determined that the first-level merging interval meets the double constraint condition, and the process continues to the second level. If the fragmentation ratio is higher than that of the first level after the second-level merging interval includes the adjacent remote signaling status partition, then the double constraint condition is not met, the process terminates, and the first-level merging interval is used as the termination level.

[0048] Preferably, both the fragmentation percentage constraint and the isolation granularity constraint must be satisfied simultaneously. If either constraint is not satisfied, the recursion immediately terminates and no further expansion to higher levels occurs. If the first-level merging interval does not satisfy the dual constraint conditions, the merging operation is not performed on the partition set, and each partition retains its original independent boundary configuration. Based on the termination level of the progressive merging interval sequence, the lower and upper boundary addresses of the termination-level merging interval are extracted. These lower and upper boundary addresses are used as the boundary addresses of the new partitions after merging, thus obtaining the boundary addresses of the new partitions after merging each partition set, completing the partition merging boundary determination process based on dual-constraint recursion.

[0049] The upper and lower boundary coordinates and power-order alignment reference points in each partition boundary address combination are retrieved. The reduction of the filling fragment segment and the degree of preservation of the isolation granularity under different merging schemes are evaluated. The boundary merging position that minimizes the fragment segment and ensures that the isolation granularity is not lower than the original value is determined, and a new partition boundary address that meets the alignment requirements of the RISC-V side region protection unit is obtained.

[0050] Retrieve the upper and lower boundary addresses of each merged partition from the new partition boundary address. Based on the power-law alignment requirements of the RISC-V side region protection unit for the starting address of the protected region, round up the lower boundary address to the nearest power-law alignment boundary to obtain the power-law alignment reference point for each merged partition. Record the address deviation between the power-law alignment reference point and the lower boundary address as the alignment offset. Based on the alignment offset, divide the number of bytes of the filled fragmented segment in each merged partition by the total number of bytes in the merged partition to obtain the fragmentation ratio after the merge. Compare this with the sum of the fragmentation ratios of the original partitions before the merge to extract the reduction range of the filled fragmented segment. Simultaneously, use the difference between the upper boundary address and the power-law alignment reference point as the isolation granularity after the merge. Compare this with the minimum value of the isolation granularity of the original partitions before the merge to extract the degree of preservation of the isolation granularity, resulting in a comparison table of the reduction range and preservation range of each merged partition. According to the comparison table of reduction magnitude and preservation degree, if the reduction magnitude of the fragment segment is positive and the preservation degree of isolation granularity is not lower than the original value, then the boundary merging position is determined by taking the power alignment reference point as the lower boundary and the upper boundary address as the upper boundary, so as to obtain the new partition boundary address and the corresponding physical address range that meet the alignment requirements of the RISC-V side region protection unit.

[0051] After the shared memory partition merging operation of the smart distribution network terminal is completed, the boundary address of the merged partition must meet the power-law alignment requirement of the RISC-V side area protection unit for the starting address of the protected area. The power-law alignment reference point refers to the address position obtained by rounding up the lower boundary coordinate of the merged partition to the nearest power-law multiple, using the number of bytes as the alignment granularity. This address position is the actual effective protection start address of the RISC-V side area protection unit and also the termination boundary for filling fragmented segments.

[0052] Specifically, the upper and lower boundary coordinates of each merged partition are retrieved from the new partition boundary address. Based on the power-law alignment granularity configured in the RISC-V side region protection unit, the lower boundary coordinates are rounded up: the power-law alignment granularity is used as the divisor, and the remainder is taken. If the remainder is not zero, the difference between the power-law alignment granularity and the remainder is added to the lower boundary coordinates. The result is the power-law alignment reference point. The address deviation between the power-law alignment reference point and the lower boundary coordinates is the alignment offset. This offset reflects the number of padded fragment bytes that cannot be eliminated from the merged partition at the current boundary position.

[0053] In one embodiment, after merging the alarm log partition and the firmware upgrade partition of the smart distribution network terminal, the lower boundary coordinates of the merged partition fall at a non-power-law alignment position. Using 4096 bytes as the power-law alignment granularity, the power-law alignment reference point is obtained by rounding up. The alignment offset is recorded as the difference between the two. Further, based on the alignment offset, the reduction magnitude of the filling fragment segment is extracted by comparing the sum of the fragment proportions of each original partition before merging with the fragment proportion of the merged partition. The fragment proportion of the merged partition is obtained by dividing the alignment offset by the total number of bytes in the merged partition. The sum of the fragment proportions of each original partition before merging is derived from the accumulated fragment proportions of each original partition in the filling fragment segment index table. The reduction magnitude is the sum of the fragment proportions before merging minus the fragment proportion of the merged partition; a positive value indicates that the merging operation reduced the filling fragments, and a negative value indicates that the filling fragments increased. Simultaneously, the difference between the upper boundary coordinates of the merged partition and the power-law alignment reference point is used as the isolation granularity after merging. This is compared with the minimum value of the isolation granularity of each original partition before merging to obtain the degree of preservation of the isolation granularity. It is recorded whether the isolation granularity after merging is not lower than the minimum value before merging. The reduction magnitude and retention degree are summarized to obtain a comparison table of reduction magnitude and retention degree for each merged partition.

[0054] Preferably, the reduction magnitude and preservation degree comparison table is arranged according to the partition set number, and records the fragment reduction magnitude value and the determination result of the isolation granularity preservation degree of each merged partition in row, which facilitates the confirmation of the boundary merging position for subsequent partition-by-partition execution. According to the reduction magnitude and preservation degree comparison table, if the fragment segment reduction magnitude of a merged partition is positive and the isolation granularity preservation degree is determined to be no less than the original value, then the power-law alignment reference point is used as the boundary merging position of the merged partition, the power-law alignment reference point is used as the lower boundary, and the upper boundary coordinates are used as the upper boundary to determine the new partition boundary address and the corresponding physical address range that meet the alignment requirements of the RISC-V side region protection unit.

[0055] Step S105: Obtain the new partition boundary address after merging, update the alignment configuration of the physical memory protection region through the RISC-V side region protection unit, and obtain the updated shared memory partition structure based on the boundary definition requirements of the RISC-V side hardware.

[0056] Obtain the new partition boundary address that meets the alignment requirements of the RISC-V side region protection unit. Write the lower and upper boundary coordinates from the new partition boundary address into the physical memory protection region register of the RISC-V side region protection unit partition by partition, completing the update of the physical memory protection region alignment configuration and obtaining the protection region registration record of each new partition in the RISC-V side region protection unit. Based on the protection region registration record, read back the lower and upper boundary coordinates of each new partition from the physical memory protection region register of the RISC-V side region protection unit. Construct the physical address range of each new partition using the read-back lower and upper boundary coordinates. Summarize the physical address ranges of all new partitions to obtain the updated shared memory partition structure.

[0057] In the management of shared memory between heterogeneous cores in intelligent distribution network terminals, the boundary address of the merged new partition must be written to the physical memory protection region register of the RISC-V side region protection unit to ensure that the hardware-level protection boundary is consistent with the new partition configuration. The physical memory protection region register is a hardware register used by the RISC-V side region protection unit to store the start and end addresses of the protected memory region, and its contents directly determine the access control range of the RISC-V side processor core over the shared memory region.

[0058] Specifically, the lower boundary coordinates and upper boundary coordinates in the boundary address of each new partition are written into the physical memory protection region register corresponding to the RISC-V side region protection unit in the order of partition number. After the writing is completed, each new partition forms a protection region registration record in the RISC-V side region protection unit. This record reflects the new partition boundary configuration that the hardware has accepted.

[0059] It should be noted that the write operation uses the lower boundary coordinates of the new partition as the starting address of the protected area and the upper boundary coordinates as the ending address of the protected area. Both satisfy the aforementioned power-law alignment requirement, so they can be directly recognized and activated by the RISC-V side region protection unit. Further, the lower and upper boundary coordinates of each new partition are read back from the physical memory protected area register of the RISC-V side region protection unit. The physical address range of each new partition is constructed using these read lower and upper boundary coordinates. The physical address ranges of all new partitions are then summarized to obtain the updated shared memory partition structure. This partition structure records the actual physical layout of the dual-core shared memory region of the intelligent distribution terminal after merging and optimization.

[0060] Step S106: Evaluate the adjustment effect by comparing the address space utilization under the updated shared memory partition structure with the original address space utilization, extract the read / write security boundary of the dual cores, reallocate the virtual and physical address mapping of the interactive information partition, and obtain the partition configuration.

[0061] The physical address range of each new partition is extracted from the updated shared memory partition structure. The sum of the number of bytes in the physical address range of each new partition minus the number of bytes in the padded fragment segment is divided by the total number of bytes in the shared memory region to obtain the updated address space utilization. The updated address space utilization is compared with the original address space utilization. If the updated address space utilization is higher than the original address space utilization, the adjustment is considered successful. The lower and upper boundary coordinates of each new partition are extracted from the updated shared memory partition structure as the read-write security boundaries for the dual-core. Based on the read-write security boundaries, for various interactive information such as control commands, telemetry data, remote signaling status, fault recordings, and alarm logs, each type of interactive information is allocated to the physical address range of the corresponding new partition according to its data size. Through the ARM side page table, following the hierarchical path of first-level page table index and second-level page table descriptor offset, the virtual address of each interactive information partition is mapped to the physical address within the read-write security boundaries, thus obtaining the virtual-physical address mapping relationship of each interactive information partition. Based on the virtual and physical address mapping relationship, the virtual starting address, physical base address and partition byte length of each interactive information partition are summarized to obtain the partition configuration for continuous deployment of the dual-core shared memory area of ​​the intelligent distribution network terminal.

[0062] After the shared memory partition merging operation is completed and the updated shared memory partition structure is obtained in the smart distribution network terminal, the adjustment effect must be quantitatively evaluated to confirm that the merging operation has indeed improved the effective utilization of the address space. Address space utilization refers to the proportion of the number of bytes in the shared memory region that can actually store valid interactive information to the total number of bytes in the shared memory region. The updated address space utilization is calculated by subtracting the sum of the number of bytes in the physical address range of each new partition from the sum of the number of bytes in its fill fragmentation segments, and then dividing by the total number of bytes in the shared memory region. The fill fragmentation segments refer to invalid byte segments in the partition caused by memory alignment or unused portions; their byte count is calculated using the formula PE (P is the number of bytes in the physical address range of the partition, and E is the number of bytes of valid interactive information). The original address space utilization is calculated by subtracting the sum of the number of bytes in the physical address range of each original partition from the sum of the number of bytes in its fill fragmentation segments, and then dividing by the total number of bytes in the shared memory region. If the updated address space utilization is higher than the original address space utilization, the adjustment is considered successful.

[0063] It should be noted that the read / write security boundary refers to the boundary of the physical address range that the ARM and RISC-V dual-cores are allowed to access during read / write operations after each new partition is registered by the RISC-V side region protection unit. This boundary is determined by the lower and upper boundary coordinates of each new partition. The extraction of the read / write security boundary directly originates from the updated shared memory partition structure, reflecting the actual physical protection range of the dual-core shared memory region after the merging operation. Based on the read / write security boundary, various interactive information such as control commands, telemetry data, remote signaling status, fault recordings, and alarm logs are redistributed. The data size of each type of interactive information is determined by its maximum single data volume during the operation of the intelligent distribution network terminal. Control commands, with their smaller data volume, are allocated to new partitions with fewer bytes; fault recordings and telemetry data, with their larger data volume, are allocated to new partitions with more bytes. After allocating various interactive information according to the matching relationship between data size and the physical address range of the new partitions, the starting physical address of each interactive information partition falls within the read / write security boundary. Furthermore, the virtual and physical address mapping relationship of each interactive information partition is re-established through the ARM side page table. The ARM side page table adopts a two-level structure: The high-order field of the virtual start address of each interactive information partition is used as an index to locate the corresponding page table entry in the first-level page table; then, the middle field of the virtual start address is used as an offset to locate the second-level page table descriptor, and the physical base address field in this descriptor is updated to the starting physical address of the interactive information partition within the new partition's physical address range. After this hierarchical update, a correspondence is established between the virtual address of each interactive information partition and its physical address within the new partition's physical address range, thus obtaining the virtual-physical address mapping relationship for each interactive information partition.

[0064] In one embodiment, the alarm log interaction information partition of the intelligent distribution network terminal (DTU) is located at its virtual starting address via an index in the ARM-side first-level page table to a second-level page table descriptor storing the partition mapping relationship. The physical base address field in the descriptor is then updated to the corresponding starting address within the range of the merged new partition's physical address, completing the virtual-physical address mapping update for this interaction information partition. Based on the virtual-physical address mapping relationship of each interaction information partition, the virtual starting address, physical base address, and partition byte length of each partition are summarized and recorded to obtain the partition configuration for continuous deployment in the dual-core shared memory region of the intelligent distribution network terminal.

[0065] If the technical solution of this application involves the collection, storage, use, processing, transmission, provision, disclosure, or deletion of personal information, the products using this technical solution have clearly and understandably informed the users of the personal information processing rules before processing personal information, and have obtained the individuals' voluntary consent in accordance with the law. If the technical solution of this application involves sensitive personal information (such as biometrics, religious beliefs, specific identities, medical and health information, financial accounts, and location tracking), the products using this solution have obtained the individuals' separate consent before processing sensitive personal information, and have also met the requirement of "express consent," ensuring that individuals make authorization decisions voluntarily based on full knowledge.

[0066] Specific implementation methods include, but are not limited to, the following: setting up clear and prominent signs at personal information collection devices such as cameras and sensors to inform relevant personnel that they have entered the scope of personal information collection and that their personal information will be collected and processed. If an individual voluntarily enters the collection scope after being informed, it is deemed that they have agreed to the collection of their personal information; or using obvious icons, text descriptions, or other means on the terminal device or system interface for personal information processing to inform them of the rules for personal information processing, and obtaining the individual's explicit authorization through interactive methods such as pop-up prompts, check confirmation boxes, or asking the individual to upload their personal information themselves.

[0067] The aforementioned personal information processing rules should include, but are not limited to, the name and contact information of the personal information processor, the specific purpose of personal information processing, the processing method, the types of personal information processed, the retention period, and the methods and procedures for individuals to exercise their relevant rights.

[0068] The above-described 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.

Claims

1. A method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal, characterized in that, The method includes: Obtain the page start address required for each partition in the shared memory region, resolve the mapping path from virtual address to physical address step by step through the ARM side page table, resolve the actual mapping base address of each partition in physical memory based on the virtual and physical address mapping relationship of each partition, and identify the padded fragment segment between the page start address and the power-order alignment boundary defined by the RISC-V side region protection unit. The fragmentation ratio of each partition is obtained by using the formula that fills the fragmentation segment to occupy the total space of the partition. For partitions whose fragmentation ratio exceeds the preset threshold, the boundary address of the adjacent partition is obtained. The feasibility of merging adjacent target partitions is evaluated by comparing the isolation granularity and fragmentation ratio of each partition before and after merging. The target partitions with merging feasibility and their corresponding adjacent partitions are summarized to form a grouped partition set; the fill fragment increment and protection boundary offset of each partition are obtained, where the fill fragment increment is the difference between the fragment ratio of the candidate merge interval and the sum of the fragment ratios of each partition before merging, and the protection boundary offset is the address deviation between the alignment start address of the candidate merge interval and the alignment start address of each partition. For the filling fragment increment and the protection boundary offset, mark the positive and negative directions of the isolation benefits of each partition, and obtain the benefit direction label set of each partition; Based on the set of profit direction markers, for partitions with consistent profit direction markers, the difference between the increment of the filling fragments and the difference between the offset of the protection boundary are compared pairwise. If the difference between the increment of the filling fragments and the difference between the offset of the protection boundary do not exceed a preset similarity threshold, then the two partitions are determined to have similar increments and decrements, and they are identified as candidate clustering units to obtain a set of candidate clustering units. For the candidate clustering unit set, the consistency between the direction of change of the filling fragment segment and the direction of adjustment of the protection boundary in each candidate clustering unit is used as the aggregation basis. Candidate clustering units with filling fragment segments changing in the same direction and the direction of adjustment of the protection boundary are merged into the same partition set to obtain the grouped partition set. The actual boundary addresses are extracted from the grouped partition set. By recursively deriving the boundary address combination of each partition, the partition merging sequence is optimized based on the constraint relationship between fragmentation ratio and isolation granularity, and the boundary addresses of the merged new partitions are determined. Obtain the new partition boundary address after merging, update the alignment configuration of the physical memory protection region through the RISC-V side region protection unit, and obtain the updated shared memory partition structure based on the boundary definition requirements of the RISC-V side hardware. The effect of the adjustment is evaluated by comparing the address space utilization under the updated shared memory partition structure with that of the original address space utilization. The virtual and physical address mappings of the interactive information partition are then reallocated to obtain the partition configuration.

2. The method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to claim 1, characterized in that, The process of obtaining the page start address required for each partition in the shared memory region involves parsing the virtual address to physical address mapping path step by step through the ARM-side page table, resolving the actual mapping base address of each partition in physical memory based on the virtual-physical address mapping relationship of each partition, and identifying the padded fragment segment between the page start address and the power-order alignment boundary defined by the RISC-V-side region protection unit, including: Obtain the page start address of each partition in the heterogeneous shared memory area of ​​the intelligent distribution network terminal. According to the hierarchical order of the first-level page table entry index and the second-level page table descriptor offset on the ARM side, extract the physical base address corresponding to the virtual address of each partition from the page table tree on the ARM side to obtain the virtual and physical address mapping relationship table of each partition. Based on the physical base address of each partition in the virtual-physical address mapping table, the power-order alignment requirement applied by the RISC-V side region protection unit to the starting address of the memory protection region is read, and the physical base address of each partition is rounded up to the nearest power-order alignment boundary to obtain the actual effective alignment start address of each partition under the RISC-V side region protection unit. From the continuous address segment between the alignment start address and the physical base address, extract the address range that cannot store valid interactive information due to power alignment constraints, mark the address range as the filling fragment segment, and record the start address, end address and partition number of the filling fragment segment in the filling fragment segment index table. Based on the filling fragment segment index table, the start and end addresses of each filling fragment segment are extracted partition by partition. The address boundaries of each filling fragment segment are verified by comparing with the aligned start address, and the filling fragment segment identification results of each partition after boundary verification are obtained.

3. The method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to claim 1, characterized in that, The fragmentation ratio of each partition is obtained using a formula that calculates the proportion of fragmented segments to the total space of the partition. For partitions with fragmentation ratios exceeding a preset threshold, the boundary addresses of adjacent partitions are obtained. The feasibility of merging adjacent target partitions is evaluated by comparing the isolation granularity and fragmentation ratio of each partition before and after merging, including: Extract the number of bytes in the filled fragment segment and the total number of bytes in the partition from the filled fragment segment index table. Divide the number of bytes in the filled fragment segment by the total number of bytes in the partition to obtain the fragmentation ratio of each partition. Compare the fragmentation ratio with a preset threshold partition by partition to identify the set of target partitions whose fragmentation ratio exceeds the preset threshold. Obtain the upper and lower boundary addresses of the adjacent partitions of each partition in the target partition set. Use the address range enclosed by the upper and lower boundary addresses as the candidate range for merging. Compare the independent isolation granularity of each partition before merging with the isolation granularity corresponding to the candidate range for merging. Extract the direction and magnitude of the increase or decrease in isolation granularity before and after merging and define them as the isolation benefit and loss characteristics. Based on the characteristics of the rise and fall of isolation benefits, the sum of the fragment proportions of each target partition before the merger is compared with the fragment proportion of the merger candidate interval. If the fragment proportion of the merger candidate interval is lower than the sum of the fragment proportions before the merger, and the isolation granularity of the merger candidate interval is not lower than the minimum value of the isolation granularity of each partition before the merger, then the adjacent partitions are determined to be feasible for merger.

4. The method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to claim 1, characterized in that, The aggregated target partitions that are feasible for merging and their corresponding adjacent partitions form a grouped set of partitions, including: Extract the target partition numbers that are deemed feasible for merging and their corresponding adjacent partition numbers from the feasibility assessment results of each target partition. Check each target partition pair for a connection between their partition numbers. If the adjacent partition number in one target partition pair is the same as the target partition number in another target partition pair, then the two target partition pairs are determined to belong to the same continuous merging candidate range. The target partition pairs with a connection are merged into the same partition group to obtain the set of target partition numbers corresponding to each partition group. For each partition group, using the partition group number as an index, the physical address range and fragmentation ratio of all target partitions within the same partition group are summarized and recorded to obtain the grouped partition set.

5. The method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to claim 1, characterized in that, The step of extracting actual boundary addresses from the grouped partition set, and optimizing the partition merging sequence based on the constraint relationship between fragmentation ratio and isolation granularity by recursively proposing the boundary address combinations of each partition, includes: Extract the upper and lower boundary addresses of each partition from the grouped partition set. Arrange the upper and lower boundary addresses of each partition in the same partition set from low to high according to the physical address to form the boundary address sequence of the partition set. For the boundary address sequence, starting from the lowest address, the boundary addresses of two adjacent partitions are combined in pairs level by level. The upper and lower boundary addresses of each pair are used as the boundary of the merge interval at that level. This process is repeated level by level until all partitions in the partition set are covered, resulting in a step-by-step merge interval sequence. For the step-by-step merging interval sequence, the fragmentation ratio of each merging interval is calculated step by step. If the fragmentation ratio of a certain merging interval is lower than that of the previous level and the isolation granularity is not lower than the minimum value of the isolation granularity of each partition in the original partition set, then the merging interval of that level is retained. Otherwise, the merging interval of the previous level is used as the termination level to obtain a merging sequence that satisfies the minimum fragmentation ratio and the isolation granularity is not lower than the original configuration.

6. The method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to claim 5, characterized in that, Determining the new partition boundary address after merging includes: extracting the upper and lower boundary addresses outside the terminating merging interval of the merging sequence to obtain the new partition boundary address after merging.

7. The method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to claim 1, characterized in that, The process of obtaining the new partition boundary address after merging, updating the alignment configuration of the physical memory protection region through the RISC-V side region protection unit, and obtaining the updated shared memory partition structure based on the boundary definition requirements of the RISC-V side hardware includes: Obtain the new partition boundary address that meets the alignment requirements of the RISC-V side region protection unit, and write the lower boundary coordinate and upper boundary coordinate in the new partition boundary address into the physical memory protection region register of the RISC-V side region protection unit partition by partition to complete the update of the physical memory protection region alignment configuration and obtain the protection region registration record of each new partition in the RISC-V side region protection unit. Based on the protection region registration record, the lower boundary coordinates and upper boundary coordinates of each new partition are read back from the physical memory protection region register of the RISC-V side region protection unit. The physical address range of each new partition is constructed using the read-back lower boundary coordinates and upper boundary coordinates. The physical address ranges of all new partitions are summarized to obtain the updated shared memory partition structure.

8. The method for information partitioning and interaction between heterogeneous cores of an intelligent distribution network terminal according to claim 1, characterized in that, The process of evaluating the adjustment effect by comparing the address space utilization under the updated shared memory partition structure with the original address space utilization, and reallocating the virtual and physical address mappings of the interactive information partitions to obtain the partition configuration includes: Extract the physical address range of each new partition from the updated shared memory partition structure. Subtract the sum of the number of bytes filling the fragmented segments from the number of bytes in the physical address range of each new partition, and divide by the total number of bytes in the shared memory region to obtain the updated address space utilization. Compare the updated address space utilization with the original address space utilization. If the updated address space utilization is higher than the original address space utilization, extract the lower boundary coordinates and upper boundary coordinates of each new partition from the updated shared memory partition structure as the read / write safety boundary of the dual core. Based on the read / write security boundary of the dual core, for various interactive information such as control commands, telemetry data, remote signaling status, fault recordings and alarm logs, the various interactive information is allocated to the physical address range of the corresponding new partition according to its data scale. Through the ARM side page table, the virtual address of each interactive information partition is mapped to the physical address within the read / write security boundary through the hierarchical path of first-level page table index and second-level page table descriptor offset, thus obtaining the virtual and physical address mapping relationship of each interactive information partition. Based on the virtual and physical address mapping relationship, the virtual starting address, physical base address and partition byte length of each interactive information partition are summarized to obtain the partition configuration for continuous deployment of the dual-core shared memory area of ​​the intelligent distribution network terminal.

Citation Information

Patent Citations

  • Asynchronous communication-based file system client kernel mode and user mode communication method

    CN120950251A

  • Pixel merge unit efficiency by identifying silhouette pixels

    US20160364845A1