Dynamic measurement method and system for TPCM double system of memory zero-copy

By splitting memory pages and constructing an array of metric descriptors in the TPCM dual-system architecture, and passing physical addresses for metric calculation, the efficiency and real-time issues caused by memory copy overhead are resolved, achieving efficient and reliable dynamic measurement.

CN122240535APending Publication Date: 2026-06-19XIAN THERMAL POWER RES INST CO LTD +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN THERMAL POWER RES INST CO LTD
Filing Date
2026-03-13
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

The existing TPCM dual-system architecture suffers from high memory copy overhead, impacting CPU computation cycles and memory bandwidth when implementing dynamic metrics, resulting in insufficient efficiency and real-time performance.

Method used

By splitting memory pages on the computing core into multiple physical addresses, constructing an array of metric descriptors, and passing it to the trusted core through a shared communication interface, the direct copying of memory data is avoided, and metric calculations are performed by directly accessing physical addresses.

🎯Benefits of technology

It significantly improves the efficiency of dynamic measurement, boosting performance by several orders of magnitude, ensuring the high-performance operation of the main system, and bypassing potentially tampered operating systems through physical address access, thus guaranteeing the authenticity and immutability of measurement data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240535A_ABST
    Figure CN122240535A_ABST
Patent Text Reader

Abstract

This application relates to a TPCM dual-system dynamic measurement method and system with zero-copy memory, belonging to the field of communication technology. The method includes: obtaining a target memory segment based on the code segment and read-only data segment of the process on the core in memory, and splitting the target memory segment into multiple memory pages. The virtual address of each memory page is converted to a physical address using a preset page lookup table to construct a measurement descriptor array. The measurement descriptor array is sent to a trusted core through a shared communication interface. The trusted core accesses the physical address, reads the byte content of multiple memory pages, and calculates the measurement value of the byte content. The measurement value is verified based on a preset benchmark value, and a security response mechanism is triggered if the verification fails. This invention only transmits the physical address, which not only improves the efficiency and real-time performance of dynamic measurement, but also allows the trusted core to directly access memory through the physical address, bypassing the potentially tampered operating system on the computing core, ensuring the authenticity and immutability of the measurement data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a TPCM dual-system dynamic measurement method and system with zero-copy memory. Background Technology

[0002] Currently, existing trusted computing is based on the root of trust and mainly measures components during the system startup phase. To address security threats during runtime, dynamic measurement technology has emerged, which requires continuous integrity measurement of the running system (such as application memory code segments, read-only data segments, kernel code, system call tables, kernel symbol tables, interrupt descriptors, etc.).

[0003] Existing technologies propose a dual-architecture design for TPCM, separating the "trusted core" and the "computation core." The computation core runs a feature-rich general-purpose operating system, while the trusted core is responsible for security measurement and decision-making. This architecture isolates security functions from computational functions, improving security. However, a key technical challenge in implementing dynamic measurement in existing dual-architecture designs is how to securely provide the memory data to be measured from the computation core to the trusted core. Current practices involve memory copying, where the computation core copies the data from the target memory region to a buffer, and then passes this buffer to the trusted core. This approach has significant performance drawbacks. (1) High CPU overhead: Copying a large amount of memory data (especially the code segment of the entire process) will consume a lot of CPU computing cycles.

[0004] (2) Memory bandwidth usage: Memory copying operations will consume valuable memory bandwidth and affect the performance of other applications on the main system.

[0005] (3) Measurement delay: The copying process takes a long time, which leads to a delay in measurement results and makes it impossible to reflect the security status of the system in real time, which may give an opportunity for instantaneous attacks.

[0006] In summary, existing dual-system architectures struggle to completely eliminate memory copy overhead when implementing dynamic metrics, resulting in room for improvement in the efficiency and real-time performance of dynamic metrics. Summary of the Invention

[0007] Therefore, it is necessary to provide a TPCM dual-system dynamic measurement method and system that can completely eliminate memory copy overhead and thus improve the efficiency and real-time performance of dynamic measurement by addressing the above-mentioned technical problems.

[0008] This invention provides a memory-zero copy TPCM dual-system dynamic measurement method, the method comprising: The target memory segment is obtained based on the code segment and read-only data segment of the on-core process in memory, and the target memory segment is split into multiple memory pages; The virtual address of each memory page is translated into a physical address by using a pre-defined lookup page table to construct an array of metric descriptors; The metric descriptor array is sent to the trusted core through a shared communication interface, and the physical address is accessed through the trusted core to read the byte content of the multiple memory pages and calculate the metric value of the byte content; The metric value is verified based on a preset benchmark value, and a security response mechanism is triggered if the verification fails.

[0009] In one embodiment, the step of obtaining a target memory segment based on the code segment and read-only data segment of the on-core process in memory, and splitting the target memory segment into multiple memory pages, includes: Obtain the code segment and read-only data segment in memory of the kernel process to be measured, and locate the start and end addresses of the code segment and read-only data segment; The target memory segment is determined based on the start address and end address, and the target memory segment is split into multiple memory pages of the same size and arranged in order.

[0010] In one embodiment, the step of converting the virtual address of each memory page to a physical address using a preset page lookup table to construct a metric descriptor array includes: Obtain a preset query page table, and traverse the multiple memory pages according to their initial arrangement order; The query page table is used to convert each traversed memory page into its corresponding physical address, and all physical addresses corresponding to the multiple memory pages are encapsulated into a pre-allocated array according to the initial arrangement order to obtain the metric descriptor array.

[0011] In one embodiment, the step of sending the metric descriptor array to a trusted core via a shared communication interface, and accessing the physical address through the trusted core to read the byte content of the plurality of memory pages and calculate the metric value of the byte content includes: Select a trusted shared communication interface and send the metric descriptor array to the trusted core through the trusted shared communication interface; The trusted shared communication interface is a verified shared communication interface.

[0012] In one embodiment, the step of sending the metric descriptor array to the trusted core via a shared communication interface, and accessing the physical address through the trusted core to read the byte content of the plurality of memory pages and calculate the metric value of the byte content, further includes: After the trusted core receives the metric descriptor array, it obtains the physical address one by one according to the address arrangement order in the metric descriptor array. The trusted core's memory access function reads the byte content of the memory page corresponding to each physical address and calculates the metric value of each byte content in real time.

[0013] In one embodiment, the verification of the metric value based on a preset benchmark value, and the triggering of a security response mechanism when the verification fails, includes: Obtain a preset benchmark value, and compare the measured value with the preset benchmark value to calculate the measurement deviation between the measured value and the benchmark value; The measurement value is verified based on the measurement deviation, and the security response mechanism is triggered when the measurement deviation exceeds a set threshold.

[0014] In one embodiment, the verification of the metric value based on a preset benchmark value, and the triggering of a security response mechanism when the verification fails, includes: When the measurement deviation exceeds the first threshold, an alarm message is sent to the user terminal; When the measurement deviation exceeds the second threshold, the current process is paused and an alarm message is sent to the user terminal. When the measurement deviation exceeds the third threshold, the current process is terminated and an alarm message is sent to the user terminal. Wherein, the first threshold is less than the second threshold, and the second threshold is less than the third threshold.

[0015] This invention also provides a memory-zero copy TPCM dual-system dynamic measurement system for implementing the memory-zero copy TPCM dual-system dynamic measurement method described in any of the above claims, the system comprising: The memory page splitting module is used to obtain a target memory segment based on the code segment and read-only data segment of the on-core process in memory, and split the target memory segment into multiple memory pages; The physical array construction module is used to convert the virtual address of each memory page into a physical address through a preset lookup page table in order to construct an array of metric descriptors; The metric calculation module is used to send the metric descriptor array to the trusted core through a shared communication interface, and access the physical address through the trusted core to read the byte content of the multiple memory pages and calculate the metric value of the byte content; The security response triggering module is used to verify the measurement value based on a preset benchmark value, and to trigger a security response mechanism when the verification fails.

[0016] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the TPCM dual-system dynamic measurement method with zero-copy memory as described above.

[0017] The present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the TPCM dual-system dynamic measurement method with zero-copy memory as described above.

[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the TPCM dual-system dynamic measurement method with zero-copy memory as described above.

[0019] The aforementioned zero-copy memory TPCM dual-system dynamic measurement method and system allocates a temporary buffer in its user space or kernel space when measurement is needed. Then, all data from the target memory region to be measured (e.g., a 1MB code segment) is copied byte-by-byte into this temporary buffer. This buffer, containing the data copy, is then passed to the trusted core via shared memory or inter-process communication mechanisms. Finally, the trusted core receives the buffer, reads the data from it, and performs measurement calculations such as hashing. Therefore, regardless of the size of the target memory region, the amount of data to be transferred is only an array of physical addresses (e.g., measuring 1MB of code only requires transferring 256 addresses, approximately 2KB of data). Compared to copying 1MB of memory, this represents a performance improvement of several orders of magnitude, with measurement efficiency increased by over 80%. Because large-scale memory copying is avoided, the impact on the CPU utilization and memory bandwidth of the computing core is negligible, ensuring the high-performance operation of business applications on the main system. Furthermore, this invention only transfers physical addresses; the trusted core directly accesses memory through these physical addresses, bypassing the potentially tampered operating system on the computing core, ensuring the authenticity and immutability of the measurement data. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0021] Figure 1 One of the flowcharts for the memory-zero copy TPCM dual-system dynamic measurement method provided by the present invention; Figure 2A schematic diagram of the overall process of the TPCM dual-system dynamic measurement method with zero-copy memory in a specific embodiment of the present invention; Figure 3 The second flowchart illustrates the memory-zero copy TPCM dual-system dynamic measurement method provided by this invention. Figure 4 The third flowchart of the TPCM dual-system dynamic measurement method with zero-copy memory provided by the present invention; Figure 5 The fourth flowchart illustrates the memory-zero copy TPCM dual-system dynamic measurement method provided by this invention. Figure 6 The fifth flowchart illustrating the memory-zero copy TPCM dual-system dynamic measurement method provided by this invention; Figure 7 The sixth flowchart illustrating the memory-zero copy TPCM dual-system dynamic measurement method provided by this invention; Figure 8 A schematic diagram of the structure of the memory-zero copy TPCM dual-system dynamic measurement system provided by the present invention; Figure 9 This is a diagram of the internal structure of the electronic device provided by the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] The following is combined Figures 1 to 9 This invention describes the TPCM dual-system dynamic measurement method and system with zero-copy memory.

[0024] like Figure 1 As shown, in one embodiment, a memory-zero copy TPCM dual-system dynamic measurement method includes the following steps: Step S110: Obtain the target memory segment based on the code segment and read-only data segment of the process on the kernel in memory, and split the target memory segment into multiple memory pages.

[0025] Specifically, when it is necessary to dynamically measure a specific process on the computing core, the server obtains the target memory segment based on the code segment and read-only data segment of the process in memory on the core, and splits the obtained target memory segment into multiple memory pages with the same byte content size and arranged in order.

[0026] Combination Figure 2 As shown in the specific embodiment, the core of the TPCM dual-system dynamic measurement method with zero-copy memory provided by this invention lies in not directly copying the memory data itself, but rather allowing the trusted core to directly and securely access the memory space of the computing core by passing an array of physical addresses of memory pages, thereby achieving efficient measurement with "zero copy". The code segment or read-only data segment of the dynamically measured process is split into memory pages of 4096 bytes each, instead of directly passing the physical addresses corresponding to the start and end addresses of the process code segment. This is because, according to the operating system's memory management standard, the start and end addresses of the code segment and read-only data segment of the process managed by the operating system are virtual addresses. They are logically contiguous, but their corresponding physical addresses are not contiguous. If the computing core sends the physical addresses corresponding to the start and end addresses to the trusted core, the trusted core will not be able to read the accurate memory content because the memory space layout between the two is not contiguous. Although the physical addresses corresponding to the start and end addresses of the code segment and read-only data segment are not contiguous in spatial layout, the operating system manages memory in units of pages (4096 bytes each). Specifically, a page is contiguous in the memory space layout. Therefore, by querying the page table in sequence, the physical address corresponding to each memory page can be obtained and sent to the trusted core. The trusted core can then use its direct memory access capability to read the memory data of each page from the physical address in the given order and assemble them to obtain the complete memory data.

[0027] In this embodiment, the first step is to perform target memory region analysis and page partitioning: When it is necessary to dynamically measure a specific process on a computing core, the start and end addresses of the process's code segment and read-only data segment in memory are first located. The target memory segment (code segment and read-only data segment) is then split into memory pages of 4096 bytes each. This step is a standard practice that is consistent with the granularity of the operating system's memory management.

[0028] Step S120: Convert the virtual address of each memory page into a physical address using a preset lookup page table to construct a metric descriptor array.

[0029] Specifically, the computation core converts the virtual address of each memory page into a physical address using a pre-defined lookup page table, and stores the obtained physical addresses sequentially into a pre-allocated array to construct a metric descriptor array.

[0030] Combination Figure 2 As shown in the specific embodiment, the second step of the TPCM dual-system dynamic measurement method with zero-copy memory provided by the present invention is to construct a physical address array: The computing core traverses each memory page in the order of the memory pages. For each memory page, it uses a pre-stored lookup page table to convert its virtual address into the corresponding physical address. Then, it stores these physical addresses in order into a pre-allocated array, which is the metric descriptor array.

[0031] The computing core is used to run the rich operating system and user processes that need to be measured; the operating system on the computing core side is able to perform the translation of virtual addresses to physical addresses by the memory management unit.

[0032] In step S130, the metric descriptor array is sent to the trusted core through the shared communication interface, and the physical address is accessed through the trusted core to read the byte content of multiple memory pages and calculate the metric value of the byte content.

[0033] Specifically, the computation core sends the metric descriptor array to the trusted core through a secure and trusted shared communication interface, and then directly accesses the physical address through the trusted core to read the byte content of each memory page and calculate the metric value of each byte content.

[0034] Combination Figure 2 As shown in the specific embodiment, the third step of the memory-zero copy TPCM dual-system dynamic metric method provided by the present invention is to securely transfer the metric descriptor array: The computing core sends the encapsulated array of metric descriptors to the trusted core through a secure shared communication interface. This process only transmits physical address pointers, not the memory data itself, and the amount of data is extremely small.

[0035] The trusted core has independent secure storage and cryptographic operation capabilities and is responsible for performing measurement operations; the shared communication interface is used to transfer data and commands between the computing core and the trusted core (e.g., shared memory or message queue).

[0036] In this embodiment, the fourth step is direct reading and measurement of the trusted core: After receiving the array of metric descriptors, the trusted core retrieves each physical address sequentially according to the order in the array. For each physical address, the trusted core uses its direct memory access capability to directly read 4096 bytes of the corresponding page from physical memory. The trusted core calculates the metric value of the read content in real time and compares it with a pre-stored baseline value.

[0037] Step S140: Verify the measurement value based on the preset benchmark value, and trigger the security response mechanism if the verification fails.

[0038] Specifically, the metric value calculated in step S130 is compared with a preset benchmark value to verify the calculated metric value. If the verification fails, the trusted core will immediately trigger a security response mechanism to issue an alarm, suspend or terminate the current process.

[0039] Combination Figure 2 As shown in the specific embodiment, the fifth step of the memory-zero copy TPCM dual-system dynamic measurement method provided by the present invention is measurement result processing: If the comparison between the metric and the benchmark fails, the trusted kernel can immediately trigger a security response mechanism, such as alerting the system administrator, pausing or terminating the process. The specific security response method is determined by the magnitude of the deviation between the metric and the benchmark, and different response methods can be implemented by setting thresholds (i.e., the first threshold, the second threshold, and the third threshold).

[0040] The aforementioned zero-copy memory TPCM dual-system dynamic measurement method allocates a temporary buffer in either user space or kernel space when measurement is needed. Then, all data from the target memory region to be measured (e.g., a 1MB code segment) is copied byte-by-byte into this temporary buffer. This buffer, containing the data copy, is then passed to the trusted core via shared memory or inter-process communication mechanisms. Finally, the trusted core receives the buffer, reads the data from it, and performs measurement calculations such as hashing. Therefore, regardless of the size of the target memory region, the amount of data to be transferred is only an array of physical addresses (e.g., measuring 1MB of code requires transferring only 256 addresses, approximately 2KB of data). Compared to copying 1MB of memory, this represents a performance improvement of several orders of magnitude, with measurement efficiency increased by over 80%. Because large-scale memory copying is avoided, the impact on the CPU utilization and memory bandwidth of the computing core is negligible, ensuring the high-performance operation of business applications on the main system. Furthermore, this method only transfers physical addresses; the trusted core directly accesses memory through these physical addresses, bypassing the potentially tampered operating system on the computing core, ensuring the authenticity and immutability of the measurement data.

[0041] like Figure 3 As shown, in one embodiment, the memory-zero copy TPCM dual-system dynamic measurement method provided by the present invention includes the following steps in step S110: Step S111: Obtain the code segment and read-only data segment of the kernel process to be measured in memory, and locate the start and end addresses of the code segment and read-only data segment.

[0042] Step S112: Determine the target memory segment based on the start address and end address, and split the target memory segment into multiple memory pages of the same size and arranged in order.

[0043] like Figure 4As shown, in one embodiment, the memory-zero copy TPCM dual-system dynamic measurement method provided by the present invention includes the following steps in step S120: Step S121: Obtain the preset query page table and traverse the multiple memory pages according to the initial arrangement order of the multiple memory pages.

[0044] Step S122: Convert each traversed memory page into its corresponding physical address by querying the page table, and encapsulate all the physical addresses corresponding to multiple memory pages into a pre-allocated array according to the initial sorting order to obtain a measure descriptor array.

[0045] like Figure 5 As shown, in one embodiment, the memory-zero copy TPCM dual-system dynamic measurement method provided by the present invention includes the following steps in step S130: Step S131: Select a trusted shared communication interface and send the metric descriptor array to the trusted core through the trusted shared communication interface.

[0046] Among them, a trusted shared communication interface is a shared communication interface that has been verified.

[0047] Step S132: After the trusted kernel receives the metric descriptor array, it obtains the physical address one by one according to the address arrangement order in the metric descriptor array.

[0048] Step S133: Read the byte content of the memory page corresponding to each physical address through the memory access function of the trusted core, and calculate the metric value of each byte content in real time.

[0049] like Figure 6 As shown, in one embodiment, the memory-zero copy TPCM dual-system dynamic measurement method provided by the present invention includes the following steps in step S140: Step S141: Obtain a preset benchmark value and compare the measured value with the preset benchmark value to calculate the measurement deviation between the measured value and the benchmark value.

[0050] Step S142: Verify the measurement value based on the measurement deviation, and trigger the security response mechanism when the measurement deviation exceeds the set threshold.

[0051] like Figure 7 As shown, in one embodiment, the memory-zero copy TPCM dual-system dynamic measurement method provided by the present invention further includes the following steps in step S140: Step S141: When the measurement deviation exceeds the first threshold, an alarm message is sent to the user terminal.

[0052] Step S142: When the measurement deviation exceeds the second threshold, pause the current process and send an alarm message to the user terminal.

[0053] Step S143: When the measurement deviation exceeds the third threshold, terminate the current process and send an alarm message to the user terminal.

[0054] Among them, the first threshold is less than the second threshold, and the second threshold is less than the third threshold.

[0055] The following describes the memory-zero copy TPCM dual-system dynamic measurement system provided by the present invention. The memory-zero copy TPCM dual-system dynamic measurement system described below can be referred to in correspondence with the memory-zero copy TPCM dual-system dynamic measurement method described above.

[0056] like Figure 8 As shown, in one embodiment, a memory zero-copy TPCM dual-system dynamic measurement system includes a memory page splitting module 810, a physical array construction module 820, a measurement value calculation module 830, and a security response triggering module 840.

[0057] The memory page splitting module 810 is used to obtain the target memory segment based on the code segment and read-only data segment of the on-core process in memory, and split the target memory segment into multiple memory pages.

[0058] The physical array construction module 820 is used to convert the virtual address of each memory page into a physical address by using a preset lookup page table in order to construct a metric descriptor array.

[0059] The metric calculation module 830 is used to send the metric descriptor array to the trusted core through the shared communication interface, and access the physical address through the trusted core to read the byte content of multiple memory pages and calculate the metric value of the byte content.

[0060] The security response triggering module 840 is used to verify the measurement value based on a preset benchmark value, and to trigger the security response mechanism when the verification fails.

[0061] In this embodiment, the memory page splitting module 810 of the TPCM dual-system dynamic measurement system with zero-copy memory provided by the present invention is specifically used for: Obtain the code segment and read-only data segment in memory of the kernel process to be measured, and locate the start and end addresses of the code segment and read-only data segment.

[0062] The target memory segment is determined based on the start and end addresses, and then split into multiple memory pages of the same size arranged in order.

[0063] In this embodiment, the physical array construction module 820 of the memory-zero copy TPCM dual-system dynamic measurement system provided by the present invention is specifically used for: Obtain the preset query page table and traverse the multiple memory pages according to their initial arrangement.

[0064] By querying the page table, each memory page is converted into its corresponding physical address, and all physical addresses corresponding to multiple memory pages are encapsulated into a pre-allocated array according to the initial sorting order to obtain a measure descriptor array.

[0065] In this embodiment, the TPCM dual-system dynamic measurement system with zero-copy memory provided by the present invention, the measurement value calculation module 830 is specifically used for: Select a trusted shared communication interface and send the metric descriptor array to the trusted core through the trusted shared communication interface.

[0066] Among them, a trusted shared communication interface is a shared communication interface that has been verified.

[0067] In this embodiment, the TPCM dual-system dynamic measurement system with zero-copy memory provided by the present invention, the measurement value calculation module 830 is further used for: After the trusted kernel receives the array of metric descriptors, it retrieves the physical addresses one by one according to the address order in the array of metric descriptors.

[0068] The trusted core's memory access function reads the byte content of the memory page corresponding to each physical address and calculates the metric value of each byte content in real time.

[0069] In this embodiment, the security response triggering module 840 of the memory-zero copy TPCM dual-system dynamic measurement system provided by the present invention is specifically used for: Obtain a preset baseline value and compare the measured value with the preset baseline value to calculate the measurement deviation between the measured value and the baseline value.

[0070] The measurement value is verified based on the measurement deviation, and a security response mechanism is triggered when the measurement deviation exceeds a set threshold.

[0071] In this embodiment, the security response triggering module 840 of the memory-zero copy TPCM dual-system dynamic measurement system provided by the present invention is further used for: When the measurement deviation exceeds the first threshold, an alarm message is sent to the user terminal.

[0072] When the measurement deviation exceeds the second threshold, the current process is paused and an alarm message is sent to the user terminal.

[0073] When the measurement deviation exceeds the third threshold, the current process is terminated and an alarm message is sent to the user terminal.

[0074] Among them, the first threshold is less than the second threshold, and the second threshold is less than the third threshold.

[0075] Figure 9 This example illustrates a schematic diagram of the physical structure of an electronic device, which can be a smart terminal. Its internal structure diagram can be as follows: Figure 9 As shown. The electronic device includes a processor, internal memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a TPCM dual-system dynamic measurement method with zero-copy memory, which includes: The target memory segment is obtained based on the code segment and read-only data segment of the process on the kernel in memory, and the target memory segment is split into multiple memory pages; The virtual address of each memory page is translated into a physical address by using a pre-defined lookup page table to construct an array of metric descriptors; The metric descriptor array is sent to the trusted core through the shared communication interface, and the physical address is accessed through the trusted core to read the byte content of multiple memory pages and calculate the metric value of the byte content; The metric is validated based on a preset benchmark value, and a security response mechanism is triggered if the validation fails.

[0076] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the electronic device to which the present invention is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0077] On the other hand, the present invention also provides a computer storage medium storing a computer program, wherein the computer program, when executed by a processor, implements a TPCM dual-system dynamic measurement method with zero-copy memory, the method comprising: The target memory segment is obtained based on the code segment and read-only data segment of the process on the kernel in memory, and the target memory segment is split into multiple memory pages; The virtual address of each memory page is translated into a physical address by using a pre-defined lookup page table to construct an array of metric descriptors; The metric descriptor array is sent to the trusted core through the shared communication interface, and the physical address is accessed through the trusted core to read the byte content of multiple memory pages and calculate the metric value of the byte content; The metric is validated based on a preset benchmark value, and a security response mechanism is triggered if the validation fails.

[0078] On another front, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, it implements a TPCM dual-system dynamic measurement method with zero-copy memory, the method comprising: The target memory segment is obtained based on the code segment and read-only data segment of the process on the kernel in memory, and the target memory segment is split into multiple memory pages; The virtual address of each memory page is translated into a physical address by using a pre-defined lookup page table to construct an array of metric descriptors; The metric descriptor array is sent to the trusted core through the shared communication interface, and the physical address is accessed through the trusted core to read the byte content of multiple memory pages and calculate the metric value of the byte content; The metric is validated based on a preset benchmark value, and a security response mechanism is triggered if the validation fails.

[0079] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory.

[0080] By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0081] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0082] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A memory-zero copy TPCM dual-system dynamic measurement method, characterized in that, The method includes: The target memory segment is obtained based on the code segment and read-only data segment of the on-core process in memory, and the target memory segment is split into multiple memory pages; The virtual address of each memory page is translated into a physical address by using a pre-defined lookup page table to construct an array of metric descriptors; The metric descriptor array is sent to the trusted core through a shared communication interface, and the physical address is accessed through the trusted core to read the byte content of the multiple memory pages and calculate the metric value of the byte content; The metric value is verified based on a preset benchmark value, and a security response mechanism is triggered if the verification fails.

2. The memory-zero copy TPCM dual-system dynamic measurement method according to claim 1, characterized in that, The step of obtaining the target memory segment based on the code segment and read-only data segment of the on-core process in memory, and splitting the target memory segment into multiple memory pages, includes: Obtain the code segment and read-only data segment in memory of the kernel process to be measured, and locate the start and end addresses of the code segment and read-only data segment; The target memory segment is determined based on the start address and end address, and the target memory segment is split into multiple memory pages of the same size and arranged in order.

3. The TPCM dual-system dynamic measurement method with zero-copy memory as described in claim 1, characterized in that, The step of converting the virtual address of each memory page to a physical address using a preset lookup page table to construct a metric descriptor array includes: Obtain a preset query page table, and traverse the multiple memory pages according to their initial arrangement order; The query page table is used to convert each traversed memory page into its corresponding physical address, and all physical addresses corresponding to the multiple memory pages are encapsulated into a pre-allocated array according to the initial arrangement order to obtain the metric descriptor array.

4. The memory-zero copy TPCM dual-system dynamic measurement method according to claim 1, characterized in that, The step of sending the metric descriptor array to the trusted core through a shared communication interface, and accessing the physical address through the trusted core to read the byte content of the plurality of memory pages and calculate the metric value of the byte content includes: Select a trusted shared communication interface and send the metric descriptor array to the trusted core through the trusted shared communication interface; The trusted shared communication interface is a verified shared communication interface.

5. The memory-zero copy TPCM dual-system dynamic measurement method according to claim 4, characterized in that, The step of sending the metric descriptor array to the trusted core through a shared communication interface, and accessing the physical address through the trusted core to read the byte content of the plurality of memory pages and calculate the metric value of the byte content, further includes: After the trusted core receives the metric descriptor array, it obtains the physical address one by one according to the address arrangement order in the metric descriptor array. The trusted core's memory access function reads the byte content of the memory page corresponding to each physical address and calculates the metric value of each byte content in real time.

6. The memory-zero copy TPCM dual-system dynamic measurement method according to claim 1, characterized in that, The verification of the metric value based on a preset benchmark value, and the triggering of a security response mechanism when the verification fails, includes: Obtain a preset benchmark value, and compare the measured value with the preset benchmark value to calculate the measurement deviation between the measured value and the benchmark value; The measurement value is verified based on the measurement deviation, and the security response mechanism is triggered when the measurement deviation exceeds a set threshold.

7. The memory-zero copy TPCM dual-system dynamic measurement method according to claim 6, characterized in that, The verification of the metric value based on a preset benchmark value, and the triggering of a security response mechanism when the verification fails, includes: When the measurement deviation exceeds the first threshold, an alarm message is sent to the user terminal; When the measurement deviation exceeds the second threshold, the current process is paused and an alarm message is sent to the user terminal. When the measurement deviation exceeds the third threshold, the current process is terminated and an alarm message is sent to the user terminal. Wherein, the first threshold is less than the second threshold, and the second threshold is less than the third threshold.

8. A memory-zero copy TPCM dual-system dynamic measurement system, characterized in that, The system is used to implement the memory-zero copy TPCM dual-system dynamic measurement method according to any one of claims 1 to 7, the system comprising: The memory page splitting module is used to obtain a target memory segment based on the code segment and read-only data segment of the on-core process in memory, and split the target memory segment into multiple memory pages; The physical array construction module is used to convert the virtual address of each memory page into a physical address through a preset lookup page table in order to construct an array of metric descriptors; The metric calculation module is used to send the metric descriptor array to the trusted core through a shared communication interface, and access the physical address through the trusted core to read the byte content of the multiple memory pages and calculate the metric value of the byte content; The security response triggering module is used to verify the measurement value based on a preset benchmark value, and to trigger a security response mechanism when the verification fails.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the TPCM dual-system dynamic measurement method with zero-copy memory as described in any one of claims 1 to 7.

10. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the TPCM dual-system dynamic measurement method with zero-copy memory as described in any one of claims 1 to 7.