Micro-ROS containerization real-time communication method based on lightweight time synchronization
By extracting data source identifiers in Micro-ROS nodes, counting quantitative relationships, calculating boundary crossing indexes and content aggregation coefficients, generating mixed interference indexes, and dynamically adjusting writing strategies, the problem of data cross-coverage under inconsistent multiple sources is solved, ensuring communication stability and data consistency.
Patent Information
- Application Number
- CN202511255855.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-04
AI Technical Summary
The existing Micro-ROS containerized real-time communication technology cannot effectively identify and regulate data writing within the cache space when multiple data sources are inconsistent, resulting in data cross-over and boundary confusion, affecting data analysis and control decisions.
By extracting data source identification, counting quantitative relationships, filtering abnormal data content, calculating boundary crossing index and content clustering coefficient, generating mixed interference index, and implementing dynamic control writing strategy, data structure consistency is ensured.
It achieves data structure isolation and communication stability in multi-source inconsistency scenarios, avoids data dislocation and content loss, and improves communication efficiency and real-time performance.
Smart Images

Figure CN120803615A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of Micro-ROS containerization technology, in particular to a Micro-ROS containerization real-time communication method based on lightweight time synchronization. BACKGROUND
[0002] “Micro-ROS containerization” refers to deploying Micro-ROS related components, especially its communication agent (Micro-ROS Agent) or application node, in a container technology such as Docker to achieve a modular, lightweight, portable running environment, thereby improving the deployment efficiency and system consistency of embedded systems or edge computing devices in real-time communication. This approach not only solves the problems of complex environment configuration and poor runtime consistency in traditional embedded deployment, but also supports building a bridge between resource-constrained devices and the ROS 2 ecosystem. “Micro-ROS containerization real-time communication based on lightweight time synchronization” is a high-efficiency, low-resource overhead time synchronization mechanism (different from traditional large-resource occupation such as NTP or PTP) designed under the containerization architecture to achieve high-precision clock coordination and event consistency among multiple Micro-ROS nodes, thereby ensuring the orderly exchange and cooperation of sensor data, control instructions, state information, etc. in the system within a strict time limit. This method is not only suitable for industrial robots, intelligent terminals or distributed collaborative control systems, but also provides a new solution for high-reliability real-time communication in resource-constrained scenarios.
[0003] The existing Micro-ROS containerized real-time communication technology based on lightweight time synchronization mainly constructs an efficient communication link between the Micro-ROS node and the Micro-ROS Agent in the containerized environment, and introduces a lightweight time synchronization mechanism to ensure the real-time and consistency of data exchange between nodes. This synchronization mechanism usually uses event-triggered time alignment or compact timestamp broadcast technology to avoid the high resource consumption problem of traditional PTP / NTP protocol in embedded devices, thereby realizing high-precision synchronization in resource-constrained environments. The specific implementation steps include: first, deploying Micro-ROS nodes and Agents inside the container, establishing a communication channel through DDS middleware; second, introducing a lightweight synchronization module on the Agent side to adjust or synchronize the data stream from each container node; third, each data packet carries a lightweight synchronization time tag to ensure that messages follow a unified time reference during scheduling, forwarding and processing; finally, through the synchronization bridge module inside and outside the container, a closed loop of synchronization communication link between multiple containers and nodes is realized, ensuring that the system as a whole completes end-to-end data transmission and response within milliseconds or even sub-milliseconds, meeting the demand for low latency and high synchronization accuracy in industrial control, collaborative robots and other scenarios.
[0004] The existing technology has the following shortcomings:
[0005] When the Micro-ROS node receives data from multiple containers and prepares to build a cache space for subsequent communication, if the number of data content sources from each container is inconsistent, the source content will be mixed in the cache. Due to the differences in format division, content layout and boundary position between different sources, when the node still follows the default strategy to write all received data into the same cache area, it will cause cross-over or boundary confusion between data, and this confusion is particularly serious when the number of sources is inconsistent. The existing Micro-ROS containerized real-time communication technology based on lightweight time synchronization cannot dynamically regulate the data writing action in the cache space according to the mixing interference degree when the number of multiple data content sources is inconsistent, because the current writing mechanism lacks judgment and separation logic for source boundaries, resulting in that even if there is potential interference risk between data, the unified writing operation is still forced to be executed, causing the content boundary overlap and structure disorder in the cache. Further, this mixed writing will cause the receiving end to be unable to accurately restore the content structure of each source when parsing data, resulting in data misplacement, partial content loss, and ultimately affecting subsequent scheduling execution, control decision and data consistency guarantee.
[0006] The above information disclosed in the background section is only for the purpose of enhancing the understanding of the background of the present disclosure, and therefore it can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY
[0007] The object of the present application is to provide a Micro-ROS containerized real-time communication method based on lightweight time synchronization to solve the problems in the background.
[0008] In order to achieve the above-mentioned object, the present application provides the following technical scheme: a Micro-ROS containerized real-time communication method based on lightweight time synchronization, specifically comprising the following steps:
[0009] Extract the source identifier of each piece of data in all containers received by the Micro-ROS node, and count the number of data contents corresponding to each source according to the source identifier, to establish a corresponding relationship between the source and the number;
[0010] Compare the established corresponding relationship, filter out all sources with inconsistent data content quantities, and mark the corresponding data contents as abnormal data contents;
[0011] Obtain the write fusion evaluation information of each abnormal data content, and analyze it after obtaining, to determine the mixed use interference degree between each abnormal data content;
[0012] According to the determination result, dynamically regulate the data write action in the cache space;
[0013] Summarize the source identifier, write position, write method and mixed use interference degree of each regulated data content, generate structure synchronization information, and send the structure synchronization information and data content to the receiving end through the lightweight time synchronization communication link.
[0014] Preferably, comparing the established corresponding relationship, filtering out all sources with inconsistent data content quantities, and marking the corresponding data contents as abnormal data contents, specifically:
[0015] Iteratively compare the established corresponding relationship between the source and the number, to determine whether there is a case where the number of data contents corresponding to a source is not equal to the number of data contents of any other source;
[0016] In the case of inequality, the source is determined as a data content quantity inconsistency source, and all data contents corresponding to the source are marked as abnormal data contents.
[0017] Preferably, the write fusion evaluation information of each abnormal data content is obtained, and after obtaining, it is analyzed to determine the mixed use interference degree between each abnormal data content, specifically comprising the following steps:
[0018] Obtain the write fusion evaluation information of each abnormal data content and preprocess it after obtaining it;
[0019] Extracting address boundary configuration information and structural density distribution information from the pre-processed write fusion assessment information, and analyzing them after extraction to generate a boundary crossing index and a content clustering coefficient respectively;
[0020] Based on the generated boundary intersection index and content clustering coefficient, a mixed interference index is generated through weighted summation;
[0021] A pre-set mixed interference index threshold interval is determined, and after determination, it is compared with the generated mixed interference index, and the mixed interference degree between each abnormal data content is determined according to the comparison result.
[0022] Preferably, the logic for obtaining the boundary crossing index is as follows:
[0023] The address boundary configuration information is extracted from the pre-processed write fusion evaluation information, including the write start address and write length of each abnormal data content, and marked as and , Indicates the The writing start address of the abnormal data content, Indicates the The length of the abnormal data content written, , is a positive integer;
[0024] Calculate the content of any two abnormal data and The address overlap length is calculated as follows: Where, Abnormal data content and The address overlap length, ,and , Indicates the The writing start address of the abnormal data content, Indicates the The length of the abnormal data content written;
[0025] Calculate the boundary crossing index. The specific calculation formula is as follows: Where, is the boundary crossing index.
[0026] Preferably, the logic for obtaining the content aggregation coefficient is as follows:
[0027] The structural density distribution information is extracted from the preprocessed write fusion evaluation information, specifically including the total byte length of each abnormal data content, the number of logical fields, and the size of the buffer reserved space used, and is respectively labeled as , and , represents the total byte length of the th abnormal data content, represents the number of logical fields of the th abnormal data content, represents the size of the buffer reserved space used by the th abnormal data content, , is a positive integer;
[0028] The content aggregation coefficient is calculated, and the specific calculation formula is as follows: ; in the formula, is the content aggregation coefficient.
[0029] Preferably, based on the generated boundary crossing index and the content aggregation coefficient , a mixed interference index is generated by weighted summation, and the specific calculation formula is as follows: ; in the formula, is the mixed interference index, and are non-zero weight coefficients of the boundary crossing index and the content aggregation coefficient , respectively, and .
[0030] Preferably, a pre-set mixed interference index threshold interval is determined, and after being determined, it is compared with the generated mixed interference index , and according to the comparison result, the mixed interference degree between each abnormal data content is determined, and the specific comparison analysis is as follows:
[0031] If , the mixed interference degree between each abnormal data content is tolerable;
[0032] If , the mixed interference degree between each abnormal data content is critical;
[0033] If , the mixed interference degree between each abnormal data content is intolerable.
[0034] Preferably, according to the determination result, the data write operation in the cache space is dynamically regulated, specifically:
[0035] When the mixed use interference degree is tolerable, the original write order is continued, each abnormal data content is written into the shared cache area, and identification information for indicating the content source is attached;
[0036] When the mixed use interference degree is critical, a fixed length buffer interval content is inserted between each adjacent abnormal data content before performing the write operation to divide the write position of adjacent data contents;
[0037] When the mixed use interference degree is intolerable, each abnormal data content is sequentially rearranged and written into the corresponding independent cache segment to avoid different abnormal data contents occupying the same write area.
[0038] In the above technical solutions, the technical effects and advantages provided by the present application are:
[0039] 1. The present application can accurately identify the data content that may cause mixed use interference under inconsistent source quantity conditions and implement calibration by comprehensively counting and comparing the source identification and quantity relationship of each data content received by the Micro-ROS node. The identification process not only has automation and accuracy, but also provides a basis guarantee for subsequent interference analysis, solving the problem that the prior art cannot actively distinguish the abnormal write risk source. At the same time, by constructing write fusion evaluation information, the system can deeply model the abnormal data content from the spatial dimension (address boundary) and structural dimension (content aggregation), so that the subsequent interference judgment no longer depends on artificial experience or static rules, but has a calculable, reproducible objective evaluation ability.
[0040] 2. The present application introduces two composite parameters of boundary intersection index and content aggregation coefficient driven by multiple source information, which not only realizes accurate quantification of the interference relationship between abnormal data contents, but also generates a unified mixed use interference index through weighting, so that the system can dynamically identify the interference level based on the comparison between the index and the set threshold interval. This design effectively overcomes the problem of single write strategy in the prior art, which cannot flexibly respond to interference complexity. With the help of the differentiated regulation strategies corresponding to the three types of interference degrees, including additional identification writing, inserting a buffer interval or separating the write cache segment, the scheme realizes an on-demand, gradual and intelligent regulation mechanism, ensuring data structure isolation, boundary distinguishability and communication stability under different complexity conditions.
[0041] 3、The application can automatically collect the source identification, writing mode, address information and interference level of the regulated data after writing regulation, generate structure synchronization information and synchronously send it to the receiving end, realizing parallel transmission of structure information and data body in the communication process. This design not only enhances the structure restoration ability of the data receiving side, avoids the problems of misplacement and content loss, but also deeply integrates with the lightweight time synchronization link, ensuring the communication efficiency and real-time performance. Overall, this technical solution effectively solves the problem of uncontrollable data mixing risk in the inconsistent source quantity scene, improves the robustness, intelligence and data consistency guarantee level in the containerized real-time communication process, and has significant practical value and innovation height. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art according to these drawings.
[0043] Figure 1 The flowchart of the Micro-ROS containerized real-time communication method based on lightweight time synchronization of the present application. DETAILED DESCRIPTION
[0044] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these example implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art. Like reference numerals refer to like elements throughout the description.
[0045] The present application provides a Micro-ROS containerized real-time communication method based on lightweight time synchronization as shown in Figure 1 The method specifically comprises the following steps:
[0046] Extract the source identification of each piece of data in all containers received by the Micro-ROS node, and according to the source identification, count the number of data contents corresponding to each source to establish the corresponding relationship between the source and the number;
[0047] The extraction operation can be implemented by parsing the source identification field in the data frame structure of the data content while the data content is received by the Micro-ROS node. To ensure that each piece of data has source traceability, a unique identifier can be preset for each piece of data on the container side, such as encoding based on the container instance ID or node name, and attached to the meta information area of the data packet. On the Micro-ROS node side, by listening to the data queue transmitted by DDS or the agent layer, each piece of data is parsed, a unified meta information extraction logic module is called, the source identification field is extracted, and the identification is associated with the data packet and stored in the local cache area. The extraction process can be automatically completed in the data receiving buffer by an asynchronous processing thread without interfering with the main communication process, ensuring efficiency and integrity.
[0048] After the source identification is extracted, a set of dynamically updated key-value mapping table structures can be constructed based on the software layer, with the source identification as the key and the corresponding value as the number of data content received by the source. After the source identification of each piece of data is extracted, it is quickly queried whether the identification exists in the mapping table through hash mapping. If it exists, the corresponding value is incremented by one. If it does not exist, a new entry is created and the count value is initialized to one. In this way, the correspondence between the source and the number can be established in real time, and dynamic maintenance, incremental update and access query can be supported during the data receiving process. To improve statistical efficiency and thread safety, thread locks or lock-free concurrent structures can be used to perform concurrent write control on the mapping table.
[0049] Extracting the source identification and counting the number of data content corresponding to each source is a prerequisite for identifying the key abnormal condition of "inconsistent number of sources" subsequently. Since the Micro-ROS node does not distinguish the source structure by default before the data content enters the cache space, when there are multiple sources and the number is uneven, it will cause problems such as mixed writing and structure boundary crossing in the cache. Therefore, the perception ability of the source and the number must be established through software before writing to identify which source data has a deviation in the number distribution in advance. Only after the corresponding relationship is established, the data set with mixed interference risk can be screened out, so that evaluation and dynamic write control can be performed, and real-time communication quality guarantee from the source to the execution can be realized. This process is the most basic and key link in the whole mixed risk perception and control mechanism.
[0050] By comparing the established corresponding relationship, all sources with inconsistent data content numbers are screened out, and the corresponding data content is marked as abnormal data content.
[0051] In this embodiment, by comparing the established corresponding relationship, all sources with inconsistent data content numbers are screened out, and the corresponding data content is marked as abnormal data content, specifically:
[0052] The established correspondence between the source and the number is compared, and it is judged whether there is a situation that the number of data content corresponding to the source is not equal to the number of data content of any other source;
[0053] The number of data content of each source can be recorded by constructing a mapping structure between the source and the number (such as a hash table or a key-value pair dictionary). After the structure is established, the number value corresponding to each source in the mapping structure can be traversed by software, and the number value currently traversed is compared with the number value of the remaining sources in turn. The judgment process can adopt a double-loop or set mapping comparison method, and when the number of any source is found to be not equal to the number of any other source, the source is identified as a number inconsistency source. The judgment operation can be packaged as an independent logic function and continuously run in the data receiving processing link before the cache construction, to ensure that the screening is completed before the data enters the write channel.
[0054] The reason why the correspondence between the source and the number needs to be compared and the inconsistent source is identified is that the data content must be guaranteed to be coordinated in the source structure before being written into the cache. If the number of data of different sources is greatly different, it will produce the risk of boundary interlacing and mixed content in the data flat writing process, resulting in the failure of subsequent structure restoration and communication analysis. By judging whether there is a difference between the numbers of the sources, the source that may have mixed interference can be accurately identified before writing, so that the data content corresponding to these sources is regarded as the key object and is processed by the subsequent evaluation and control logic, to ensure that the cache structure is clear, the communication path is stable, and the content is accurately deconstructed. This is an indispensable basic judgment link in the whole data writing control mechanism.
[0055] In the case of inequality, the source is determined as a data content number inconsistency source, and all data content corresponding to the source is marked as abnormal data content.
[0056] When the number of data content of a source is found to be not equal to that of any other source through traversal comparison, the source can be marked as a number inconsistency source in the software structure. Specifically, the identification of the source can be written into an "abnormal source record table" as the basis for subsequent abnormal marking processing. Then, before writing into the cache, all received data content in the current cache buffer is searched and matched with the source identification attached thereto; once the source identification of a piece of data is identified as an entry in the abnormal source record table, an abnormal marking bit or classification identification information is attached to the data content structure, thereby completing the software level "abnormal data content" marking. This process can be completed by an independent thread or an event-driven method to ensure efficiency and data consistency.
[0057] Abnormal labeling of data content from inconsistent sources is a key prerequisite for subsequent mixed-use interference analysis and write control. Quantity inconsistency often means that data flow distribution is abnormal or source synchronization fails. If this type of content is not accurately identified and labeled before writing, it will be treated equally in the subsequent writing process, which will destroy the integrity and analyzability of the cache structure. By completing the abnormal labeling in the receiving stage in advance, the risk content can be effectively isolated from the normal content, and only the identified and evaluated data will enter the control process, improving the system's adaptability to complex source structures and avoiding instability or analysis errors in the overall communication chain caused by abnormal content mixing.
[0058] Obtain write fusion evaluation information of each abnormal data content, and analyze it after obtaining to determine the mixed-use interference degree between each abnormal data content;
[0059] In this embodiment, the write fusion evaluation information of each abnormal data content is obtained, and after obtaining, it is analyzed to determine the mixed-use interference degree between each abnormal data content, which specifically includes the following steps:
[0060] Obtain write fusion evaluation information of each abnormal data content, and pre-process it after obtaining;
[0061] The data content object labeled as abnormal in the Micro-ROS node receiving cache management logic can be monitored, and the data extraction function can be called synchronously in the write preparation stage to automatically obtain the original data set containing the fields of "write start address", "content byte length", "field number", "cache reserved space", etc. These data belong to the basic metadata of abnormal data content allocated or analyzed by the system in the receiving scheduling, cache registration and structure analysis process, and do not need additional calculation or setting. They can be automatically extracted and classified by software. The acquisition process can be realized by embedding data scanning and field grabbing logic in the cache scheduling thread. All the extracted fields are organized into a set of structured information containing multiple data entries, i.e. write fusion evaluation information, which can be directly input into the subsequent analysis process.
[0062] The main purpose of the preprocessing is to provide a structured, semantically clear and data complete input carrier for subsequent extraction of "address boundary configuration information" and "structure density distribution information", to prevent the field missing, data format inconsistency or numerical anomaly in the original information from interfering with subsequent analysis. The specific preprocessing operations include: eliminating or filling in missing field values, converting fields with inconsistent units (such as bytes and bits), filtering fields values that are obviously above the cache upper limit or below the logical threshold, and uniquely identifying and binding each abnormal data content to ensure the accuracy of the subsequent operation object. These operations can be completed by software logic executing a cleaning function after structured data import, and finally outputting a write fusion evaluation information set that is format specified, field complete and directly usable for analysis and calculation.
[0063] Extracting address boundary configuration information and structure density distribution information from the preprocessed write fusion evaluation information, and analyzing after extraction to generate boundary crossing index and content aggregation coefficient respectively;
[0064] Extracting address boundary configuration information and structure density distribution information from the preprocessed write fusion evaluation information can be achieved by setting a double-channel field mapper in the data analysis process. First, the software automatically classifies the data based on field labels after importing the preprocessed evaluation information set: maps the fields containing the write start address and write length of each abnormal data content to the address boundary configuration information channel, and the system calculates the write end address of each content based on these fields and forms a complete address boundary triple; at the same time, the data containing the content byte length, the number of logical fields and the cache reserved space are mapped to the structure density distribution information channel, and the units and formats are unified. The entire process is automatically completed through the corresponding rules of structure field name and data structure template, and does not depend on manual setting, which can complete information classification immediately when loading data, and output two independent data set structures as the basis for generating boundary crossing index and content aggregation coefficient.
[0065] Based on the generated boundary crossing index and content aggregation coefficient, a mixed interference index is generated by weighted summation;
[0066] Determining the pre-set mixed interference index threshold interval, and comparing it with the generated mixed interference index to determine the degree of mixed interference between each abnormal data content according to the comparison result.
[0067] The determination of the pre-set mixed interference index threshold interval can be realized by introducing a historical evaluation model combined with a dynamic reference strategy in the software. Specifically, the software first loads a plurality of cache write scenarios accumulated in the previous system running, and the corresponding association data set between the mixed interference index and the subsequent communication stability. Then, through statistical analysis methods such as cluster analysis or segmented linear regression, the interval boundaries of the interference index are identified in the data set, and they are divided into three continuous threshold intervals, representing low, medium and high interference levels respectively. This process can be automatically performed by the software during system initialization or configuration update, and the generated interval boundaries are written into the parameter configuration table and loaded into the current evaluation task as the standard reference for subsequent classification of the real-time calculated mixed interference index, ensuring that the threshold interval has data support, strong adaptability and does not require manual definition.
[0068] In this embodiment, the acquisition logic of the boundary crossing index is as follows:
[0069] The address boundary configuration information is extracted from the pre-processed write fusion evaluation information, specifically including the write start address and write length of each abnormal data content, and is respectively marked as and , represents the write start address of the th abnormal data content, represents the write length of the th abnormal data content, , is a positive integer;
[0070] The write start address and write length of each abnormal data content can be obtained by software-level monitoring and parsing of the data write operations performed by the Micro-ROS node during the cache construction phase. Specifically, before each data content is written to the cache space, the Micro-ROS node will dynamically allocate the write start address of the data according to the scheduling queue and memory allocation strategy. This information can be obtained at the memory allocation interface through instrumentation interception, or by recording the target address parameter in the write function call. The write length is usually determined by the structure of the data content itself. For example, if a piece of abnormal data is a sensor data packet from container A, containing 128 bytes of structured information, then its write length is 128 bytes. This value can be directly obtained by calling the memory size function of the data structure, reading the length field of the data frame header, or parsing the serialization format. In terms of software implementation, a runtime data tracking logic can be embedded in the Micro-ROS communication agent or receiving node. Whenever a piece of data content is received, it triggers the recording of the target address (i.e., starting address) and the overall memory length (i.e., write length) of its write operation. This data is cached and saved in the form of timestamps or sequential numbers, thereby forming an "address-length" mapping information for each abnormal data content. For example, the control instruction content transmitted by container B starts at the write address 0x08010000 and has a length of 64 bytes, while the log data uploaded by container C starts at the address 0x08010040 and has a length of 96 bytes. In this way, the write range of each abnormal data can be accurately extracted without interfering with the actual communication process, providing basic data support for subsequent cross-detection and boundary analysis.
[0071] Calculate the content of any two abnormal data and The address overlap length is calculated as follows: Where, Abnormal data content and The address overlap length, ,and , Indicates the The writing start address of the abnormal data content, Indicates the The length of the abnormal data content written;
[0072] The meaning of this formula is to calculate the The abnormal data content is the same as the The purpose of the calculation is to determine whether there is a risk of cross-overlapping of the physical location when two data are written into the cache. The calculation process of the formula is divided into three steps: the first step is to use and Obtain the write end address of the two segments of data, and then take the smaller value to indicate the right boundary of the potential overlapping segment; the second step is to and Obtain the write start address of the two segments of data, and then take the larger value to indicate the left boundary of the potential overlapping segment; the third step is to subtract the left boundary from the right boundary to calculate the theoretical overlap length. If the result is a negative number, it means that the two segments of data do not overlap. In this case, use It is reset to 0 to ensure that the overlap length is non-negative. This calculation method is logically complete and closed, applicable to determining the overlap of any two data segments in the address space, independent of a priori order, and universally applicable. The results are used to further measure whether the abnormal data content has address overlap in the shared cache space, providing a precise basis for subsequent conflict assessment and write control.
[0073] Calculate the boundary crossing index. The specific calculation formula is as follows: Where, is the boundary crossing index.
[0074] The boundary crossing index The calculation formula is designed to quantitatively evaluate the degree of address overlap between multiple abnormal data contents when they are written into the cache space. The evaluation logic is constructed through the following steps: First, for any two abnormal data contents and , respectively obtain the write start address 、 and write length 、 , based on which the overlapping length of their address space is calculated , which is calculated by Implementation, ensuring that only when there is indeed an address intersection , otherwise it is 0; then, for each pair of abnormal data content, the overlapping length is squared as the reinforcement item of the cross degree, the purpose is to amplify the impact of serious cross, and then the natural logarithm function is used to add one to the square value and take the logarithm. This operation plays the role of compressing extreme values and smoothing fluctuations, so that occasional crosses will not be overly amplified, ensuring the stability of the evaluation results and engineering availability; finally, by traversing all The cross-influence values of the two combinations of abnormal data contents are summed up, and the Normalization is performed to obtain the average boundary overlap strength between all abnormal data contents. This calculation method takes into account both enhanced identification of conflict severity and global balance of the number of abnormal pairs, and can be used for subsequent precise dynamic control of cache write operations to ensure orderly write structure and avoid boundary confusion.
[0075] Boundary Crossing Index The size of the boundary crossing index directly reflects the severity of address overlap between the abnormal data contents in the cache space writing process, and thus can be used as an important basis for judging the mixing interference degree between them. Specifically, the larger the boundary crossing index, the more cross regions there are between the abnormal data contents in the writing address space, the wider the overlapping area, the higher the coincidence intensity, which means that the contents are more likely to have boundary overlap, structure misplacement or content coverage, etc. The mixing interference risk is significant; on the contrary, the smaller the boundary crossing index, the more independent the writing position distribution of each abnormal data content in the cache, the lower the crossing degree, the lighter the interference between the written contents, and the structure remains clear. Therefore, the boundary crossing index can be used as an important quantitative index to measure whether there is a strong conflict between the abnormal data contents at the address level and whether the writing behavior needs to be regulated, and through the numerical size, the mixing interference degree can be accurately judged and classified.
[0076] In this embodiment, the acquisition logic of the content aggregation coefficient is as follows:
[0077] The structure density distribution information is extracted from the preprocessed write fusion evaluation information, specifically including the total byte length, the number of logical fields and the size of the buffer reserved space of each abnormal data content, and is respectively marked as , and , , , , , , , , ,
[0078] In actual software implementation, the total byte length, number of logical fields, and the amount of buffer reserve used for each abnormal data item can be obtained by performing structured analysis of the received data within the Micro-ROS node. First, the total byte length can be determined by reading the actual number of bytes occupied by each abnormal data item in the memory buffer. This is done by extracting the starting and ending addresses of the data item in the buffer and using the difference between the two to determine the total byte length. For example, if a data item starts at address 0x1000 and ends at address 0x1040, its total byte length is 64 bytes. Second, the number of logical fields can be determined by parsing the data content's encoding structure (such as JSON, CBOR, or Protobuf). This information is the number of fields represented by key-value pairs or structure units within the statistics. For example, if a data item contains fields such as "header," "timestamp," "payload," and "checksum," the number of logical fields is 4. Finally, the size of the buffer reserve can be obtained from the preset value recorded when the node allocates the buffer. That is, before each data is written, the Micro-ROS node usually allocates a fixed-length cache area for it. This length can be directly read from the memory management unit or write scheduling logic. For example, 80 bytes of space are reserved for each data. In this way, the system can collect all quantitative data related to the write fusion evaluation without human intervention, providing an accurate and traceable data foundation for the subsequent calculation of the content aggregation coefficient.
[0079] Calculate the content aggregation coefficient. The specific calculation formula is as follows: Where, is the content clustering coefficient.
[0080] The content clustering coefficient is used to comprehensively measure the structural density of each abnormal data content in its allocated buffer space, thereby quantifying its ability to potentially interfere with other data content in terms of spatial layout. Indicates the The total length in bytes of the abnormal data content, reflecting the data volume; Indicates the number of logical fields, reflecting the complexity of the data structure; It is the size of the buffer reserved space occupied by it in the cache, reflecting the adequacy of resource usage. Multiplication is used to express the overall load intensity of the data in terms of content volume and structural complexity. The denominator is This represents the compactness of the load within the buffer space, thus forming the information density per unit space. Squaring and averaging ensure that high-density data has amplified weight in the overall assessment, effectively identifying the risk of structural compression caused by intensive writes. Finally, taking the square root maintains the rationality and comparability of the numerical scale. Therefore, this formula quantitatively reveals the contribution of each abnormal data content to "mixed use interference" in the physical cache layout through a density-driven approach, with clear engineering significance and regulatory value.
[0081] Content aggregation coefficient The value of directly reflects the structural density of each abnormal data content within its corresponding buffer, and therefore serves as an important criterion for assessing the degree of intermixing interference. A large content clustering coefficient indicates that multiple abnormal data contents carry a high information load within the limited cache space, including longer data volumes (byte lengths) and more complex field structures. This high-density writing easily leads to overlapping or compression of adjacent data at spatial boundaries, increasing the risk of interference when intermixing occurs. Conversely, a small content clustering coefficient indicates a relatively sparse data structure, more ample buffer space, and greater spatial independence of each data content, resulting in a lower likelihood of intermixing interference. Therefore, in practical applications, the value of the content clustering coefficient can be analyzed to determine the interference sensitivity of each abnormal data content in the current spatial configuration. This can be combined with the boundary crossing index to form a comprehensive assessment of the degree of intermixing interference. In other words, a larger content clustering coefficient indicates a higher potential for interference, and the greater need for targeted control strategies to optimize write operations and boundary management.
[0082] In this embodiment, based on the generated boundary crossing index and content clustering coefficient , the mixed interference index is generated by weighted summation. The specific calculation formula is as follows: Where, is the mixed interference index, and Boundary Crossing Index and content clustering coefficient The non-zero weight coefficient of .
[0083] In actual software implementation, the mixed interference index is generated This can be achieved by calling the weight calculation module in the data processing process. The specific operations include: First, the system completes the boundary crossing index Content aggregation coefficient After the calculation of , these two parameters are passed as input to the hybrid evaluation unit; then, according to the set non-zero weight coefficient and right and perform weighted summation to generate the final value. Among them, and are a pair of complementary floating-point scale factors used to regulate the and influence weight in the mixed use interference index. For example, if the system pays more attention to the influence of boundary overlap on mixed use interference, set , ; on the contrary, if the structure density is more sensitive to interference, adjust it to , . The setting of these two coefficients can be predefined in the configuration file, or dynamically adjusted during deployment through online learning, ensuring the adaptability and scenario flexibility of the evaluation mechanism. Through the above way, the system can generate a unified mixed use interference evaluation value based on multi-dimensional indicators, providing quantitative support for subsequent write action regulation and data classification.
[0084] In this embodiment, the pre-set mixed use interference index threshold interval is determined, and the generated mixed use interference index is compared, and the mixed use interference degree between each abnormal data content is determined according to the comparison result. The specific comparison and analysis are as follows:
[0085] If , the mixed use interference degree between each abnormal data content is tolerable;
[0086] This case indicates that although there is a write-in area overlap or structure density difference between the abnormal data contents, the coverage range is limited and the field layout is relatively independent, and the overall interference degree is low. At this time, the data boundary in the cache space can still be accurately identified, and the receiving end analysis mechanism can normally restore the data structure, which will not affect the data consistency and control logic of the system. Therefore, this interference belongs to the tolerable range, and no additional regulation measures are needed, only the current state needs to be recorded for subsequent monitoring or trend judgment.
[0087] If , the mixed use interference degree between each abnormal data content is critical;
[0088] This case indicates that there are significant write-in overlaps and structure crowding phenomena between multiple abnormal data contents, which may cause cache boundary ambiguity and field recognition accuracy decline. Although the system still has certain analysis ability at this time, it constitutes a potential risk for the subsequent scheduling chain or real-time control system, which is easy to cause error behavior under high-frequency communication or burst load. This kind of interference degree belongs to the "critical" category, and it is recommended to adjust the write-in behavior, such as preferentially using buffer isolation strategy or asynchronous cache mechanism to avoid further deterioration.
[0089] If , the mixing interference degree between each abnormal data content is intolerable.
[0090] This case shows that the boundary crossing and structure overlapping between abnormal data contents are serious, and the buffer area cannot guarantee independence and integrity. This state usually causes obvious misplacement, field loss or even overall data failure during data parsing at the receiving end, thereby affecting the stability and reliability of data communication, and ultimately causing control response delay, task scheduling abnormality and other problems. Such interference degree is intolerable, and strong intervention strategies such as reconstructing cache allocation logic, re-planning the writing path or interrupting the current communication behavior need to be implemented immediately to ensure the overall safety and functional recovery of the system data link.
[0091] According to the determination result, the data writing action in the cache space is dynamically regulated;
[0092] In this embodiment, according to the determination result, the data writing action in the cache space is dynamically regulated, specifically:
[0093] When the mixing interference degree is tolerable, the original writing order is continued, each abnormal data content is written into the shared cache area, and identification information for indicating the content source is attached;
[0094] In the case where the mixing interference degree is evaluated as tolerable, the interference risk between abnormal data contents is low, so the original data writing strategy can be maintained. To realize "continuing to use the original writing order, writing each abnormal data content into the shared cache area, and attaching identification information for indicating the content source", an additional mark injection stage can be introduced in the writing process through software logic control. The specific implementation manner is: before each abnormal data content is written into the shared cache area, the source identification field of the data content in the receiving queue is read, and the identification is attached to the head or tail of the data content to form a data packet containing the source identification. This operation can be realized by programming to set the identification bit in the data structure, or reserving a specific bit width in the memory buffer area for inserting the source information before data writing. In this way, while maintaining efficient sequential writing, it is ensured that the original source of each piece of data can be quickly identified in the subsequent reading or parsing stage. The reason for doing so is that even in the case of low interference degree, the traceability of the content source is still important for data scheduling, error backtracking and system fault tolerance analysis, thereby maintaining the system's information transparency and data controllability while ensuring performance.
[0095] When the mixing interference degree is critical, a fixed-length buffer interval content is inserted between each adjacent abnormal data content before the writing action is performed to divide the writing positions of adjacent data contents;
[0096] When the mixed-use interference degree is evaluated as a critical degree, although there is no strong interference between the abnormal data contents, there is a risk of boundary ambiguity or structural adjacency being too close. At this time, logical isolation is needed by inserting a fixed-length buffer interval content. This regulation method can be realized through software in the scheduling queue processing stage before data writing. The specific method is that when the system identifies that two adjacent abnormal data contents are about to be continuously written, it judges that their interference level is "critical", and then inserts a segment of padding data between them. The padding data should be a preset characteristic content that will not be misidentified as valid data in structure, such as a segment of all-zero bytes or a specified redundancy code, and has a fixed length (such as 16 bytes or 32 bytes, depending on the buffer management strategy), ensuring that the data boundary position can be clearly determined when reading later. In software implementation, the write function can realize the physical and logical writing interval by dynamically inserting a buffer object and adjusting the writing offset address before calling. The reason for using this way is to effectively reduce the risk of misreading caused by structural crossing without introducing complex rearrangement mechanisms, thereby ensuring the boundary separation, enabling the parser to accurately locate the start and end areas of each data unit when reading continuous data, and enhancing the robustness and communication stability of the system.
[0097] When the mixed-use interference degree is intolerable, each abnormal data content is sequentially rearranged and written into the corresponding independent cache segment to avoid different abnormal data contents occupying the same writing area.
[0098] When the mixed use interference degree is evaluated as an intolerable degree, it indicates that there is a serious risk of write conflict between abnormal data contents, and if the shared cache space is continued to be used, it may cause data overlap, boundary confusion or information damage. Therefore, each abnormal data content must be sequentially rearranged by software and allocated with an independent cache segment to achieve physical isolation. The specific implementation is: in the data write scheduling stage, the software constructs a rearrangement queue according to the receiving order of the abnormal data content, sorts it according to the receiving time or identification priority, and maps it to different cache partitions in turn. At the memory management level, the system can pre-divide the cache into multiple independent address segments (such as logical partitions or virtual page blocks), and whenever the "intolerable degree" label is detected, the memory allocation function is called to allocate space independently for the content, and the allocation address and write range are recorded. In addition, in order to avoid subsequent reading errors, the index table or directory structure of the content in the memory needs to be updated synchronously, so that the reading logic can directly locate the independent cache area corresponding to each piece of data. The reason for taking this way is that when the boundaries of data seriously overlap or the structure density is highly concentrated, any shared write is difficult to avoid data interference, and only by rearranging and isolating can the cross-influence be fundamentally eliminated to ensure the integrity and analyzability of each piece of data, thereby maintaining the communication accuracy and stability of the system in a high interference environment.
[0099] The source identification, write position, write method and mixed use interference degree of each regulated data content are summarized to generate structure synchronization information, and the structure synchronization information and data content are sent to the receiving end through a lightweight time synchronization communication link.
[0100] In order to realize "summarizing the source identification, write position, write method and mixed use interference degree of each regulated data content", the unified meta-information management logic can be called by software in the regulation result arrangement stage after cache writing is completed to collect the meta-attributes of all abnormal data contents. The implementation is: after each write action (whether it is shared write, interval insertion or independent cache allocation) is completed, the source identification (such as container number or task ID) of the data content, its actual write start address and length in the cache space, the write method (such as sequential write, interval insertion, independent isolation) used, and the previously evaluated mixed use interference degree result are recorded in the structure synchronization information table. The table structure can be an array or a key-value pair set, which supports aggregation of all meta-attributes according to data content index, facilitating subsequent unified packaging and transmission.
[0101] After the generation of the structure synchronization information, in order to realize integrated and synchronous transmission with the data content, the structure synchronization information can be packaged and sent through a lightweight time synchronization communication link. The specific manner is as follows: in the ROS communication publishing stage, the structure synchronization information is first packaged as a header or an additional segment together with the data content to form an integrated data frame; then, relying on the lightweight agent mechanism of Micro-ROS, a synchronization label (such as a lightweight timestamp or a message sequence index) is embedded at the Agent end, and end-to-end delivery is completed through an efficient protocol such as UDP or a real-time DDS channel. This manner does not need to introduce redundant protocol overhead, and can utilize the existing containerized ROS communication channel to maintain the real-time performance and resource lightweight characteristics of the overall link.
[0102] The reason for doing so is to ensure that the receiving end can not only parse the original data body, but also synchronously obtain the write logic and interference background information before the data content is sent. The transmission of the structure synchronization information can significantly improve the restoring ability of the receiving end to the content boundary, arrangement logic and source information, thereby reducing the risk of misjudgment and failure of reconstruction, especially in complex or high-interference scenarios, providing key information support for subsequent scheduling decisions, abnormal tracking and distributed synchronous control, and helping to maintain the traceability and consistency of the entire Micro-ROS containerized communication mechanism.
[0103] The above formulas are dimensionless values calculated, and the formulas are obtained by software simulation of a large amount of data to obtain a formula of the latest real situation, and the preset parameters in the formula are set by a person skilled in the art according to the actual situation.
[0104] The above embodiments can be realized wholly or partially by software, hardware, firmware or any other combination. When realized by software, the above embodiments can be realized wholly or partially in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions according to the embodiments of the present application are wholly or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another through a wired or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center and the like containing one or more available medium collections. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD) or a semiconductor medium. The semiconductor medium can be a solid-state disk.
[0105] It should be understood that the size of the sequence number of the above processes does not mean the order of execution in various embodiments of the present application, and the execution order of the processes should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0106] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0107] In several embodiments provided in the present application, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described embodiments are only illustrative, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0108] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.
[0109] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0110] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A Micro-ROS containerized real-time communication method based on lightweight time synchronization, characterized in that: The specific steps include: Extract the source identifier of each data in all containers received by the Micro-ROS node, and count the data content corresponding to each source based on the source identifier, and establish a corresponding relationship between the source and the quantity; Compare the established correspondences, filter out all sources with inconsistent data content, and mark their corresponding data content as abnormal data content; Obtaining write fusion assessment information for each abnormal data content, and analyzing it after obtaining it to determine the degree of mixed interference between the abnormal data contents; According to the determination result, the data writing action in the cache space is dynamically regulated; The source identification, writing location, writing method and mixing interference degree of each regulated data content are summarized to generate structural synchronization information, and the structural synchronization information is sent to the receiving end together with the data content through a lightweight time synchronization communication link.
2. The Micro-ROS containerized real-time communication method based on lightweight time synchronization according to claim 1 is characterized in that: Compare the established correspondences, filter out all sources with inconsistent data content, and mark their corresponding data content as abnormal data content, specifically: Performing a traversal comparison on the established correspondence between sources and quantities to determine whether the quantity of data content corresponding to a source is not equal to the quantity of data content from any other source; In the event of inequality, the source is determined as a source of inconsistent data content quantity, and all data content corresponding to the source is marked as abnormal data content.
3. The Micro-ROS containerized real-time communication method based on lightweight time synchronization according to claim 2 is characterized in that: Obtaining write fusion assessment information of each abnormal data content, and analyzing it after obtaining it to determine the degree of mixed interference between the abnormal data contents, specifically including the following steps: Obtain the write fusion evaluation information of each abnormal data content and preprocess it after obtaining it; Extracting address boundary configuration information and structural density distribution information from the pre-processed write fusion assessment information, and analyzing them after extraction to generate a boundary crossing index and a content clustering coefficient respectively; Based on the generated boundary intersection index and content clustering coefficient, a mixed interference index is generated through weighted summation; A pre-set mixed interference index threshold interval is determined, and after determination, it is compared with the generated mixed interference index, and the mixed interference degree between each abnormal data content is determined according to the comparison result.
4. The Micro-ROS containerized real-time communication method based on lightweight time synchronization according to claim 3 is characterized in that: The logic for obtaining the boundary crossing index is as follows: The address boundary configuration information is extracted from the pre-processed write fusion assessment information, including the write start address and write length of each abnormal data content, and marked as and , Indicates the The writing start address of the abnormal data content, Indicates the The length of the abnormal data content written, , is a positive integer; Calculate the content of any two abnormal data and The address overlap length is calculated as follows: Where, Abnormal data content and The address overlap length, ,and , Indicates the The writing start address of the abnormal data content, Indicates the The length of the abnormal data content written; Calculate the boundary crossing index. The specific calculation formula is as follows: Where, is the boundary crossing index.
5. The Micro-ROS containerized real-time communication method based on lightweight time synchronization according to claim 4 is characterized in that: The logic for obtaining the content aggregation coefficient is as follows: The structural density distribution information is extracted from the pre-processed write fusion assessment information, including the total byte length of each abnormal data content, the number of logical fields, and the size of the buffer reserved space used, and is marked as 、 and , Indicates the The total length in bytes of the abnormal data content, Indicates the The number of logical fields of abnormal data content, Indicates the The size of the buffer reserved for each abnormal data content, , is a positive integer; Calculate the content aggregation coefficient. The specific calculation formula is as follows: Where, is the content clustering coefficient.
6. The Micro-ROS containerized real-time communication method based on lightweight time synchronization according to claim 5 is characterized in that: Based on the generated boundary crossing index and content clustering coefficient , the mixed interference index is generated by weighted summation. The specific calculation formula is as follows: Where, is the mixed interference index, and Boundary Crossing Index and content clustering coefficient The non-zero weight coefficient of .
7. The Micro-ROS containerized real-time communication method based on lightweight time synchronization according to claim 6 is characterized in that: Determine the pre-set mixed interference index threshold range , and after determination, the generated mixed interference index Perform a comparison and determine the degree of mixed interference between the abnormal data contents based on the comparison results. The specific comparison analysis is as follows: like ,The mixed interference degree between the abnormal data contents is tolerable; like ,The mixed interference degree between the abnormal data contents is critical; like , the degree of mixed interference between the abnormal data contents is intolerable.
8. The Micro-ROS containerized real-time communication method based on lightweight time synchronization according to claim 7 is characterized in that: Based on the determination result, the data writing action in the cache space is dynamically regulated, specifically: When the mixed interference level is tolerable, the original writing order is continued to be used to write the abnormal data content into the shared cache area, and identification information for indicating the source of the content is added; When the mixed interference level is critical, before executing the write operation, a fixed-length buffer interval is inserted between each adjacent abnormal data content to divide the write position of the adjacent data content; When the mixed interference level is intolerable, each abnormal data content is reordered and written into the corresponding independent cache segment respectively to avoid different abnormal data contents occupying the same write area.
Citation Information
Patent Citations
Method and system for analyzing boundary data by clustering method
CN110851414A
Artificial intelligence based data-driven interconnected digital twins
EP4478144A1
Methods and apparatus for data analysis
SG145272A1
Fact data unifying method and apparatus
US7181471B1