Process security defense method, product, device and medium

By introducing a secure memory controller between the system bus and the memory controller, matching the process identifier and memory address interval, the problem that traditional AI security technology cannot prevent hardware-level attacks is solved, and efficient security defense for AI systems is achieved and improved Overall safety and stability.

CN119066652AActive Publication Date: 2024-12-03INSPUR (BEIJING) ELECTRONICS INFORMATION IND CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411045237.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-03
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

Traditional artificial intelligence security technology cannot completely solve the security risks of AI systems. Attackers can launch attacks through hardware vulnerabilities, steal or tamper with data from AI programs, resulting in security risks.

Method used

Introduce a secure memory controller between the system bus and the memory controller. By obtaining the current process identifier and the pre-established secure memory control table, matching the process identifier and memory address interval, determining access rights, and ensuring that only secure processes can access specific Memory area.

Benefits of technology

Effectively prevent malware or unauthorized processes from accessing sensitive memory areas, improve the overall security and stability of the system, strengthen security verification at the hardware level, reduce computing complexity and do not affect memory access speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066652A_ABST
    Figure CN119066652A_ABST
Patent Text Reader

Abstract

The invention discloses a process security defense method, a product, a device and a medium, and relates to the technical field of network security. Through a hardware level, a secure memory controller is additionally added and located between a system bus and a memory controller, a control mode of combining hardware and software is adopted, and any access to a physical memory needs to be matched with the physical memory through security verification of the secure memory controller. Each security process is recorded in the security memory control table and is associated with the specific memory address interval, and the corresponding memory area can be accessed only after the security process is verified, so that data is prevented from being stolen and tampered by programs of other non-security processes in a program running process. Malicious software or other unauthorized processes are effectively prevented from accessing a sensitive memory area, so that the overall security and stability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a process security defense method, product, device and medium. Background Art

[0002] Artificial intelligence security technology is a rapidly developing field that involves multiple aspects of protecting the artificial intelligence system itself and the network security enhanced by artificial intelligence technology. Traditional artificial intelligence security technology adopts software defense strategies. Attackers launch attacks from multiple dimensions. Its programs are stolen and tampered with by other programs running on the host during operation (such as the weights, features, models and other data of the artificial intelligence program). It cannot completely solve the artificial intelligence security problem, resulting in the existence of security risks.

[0003] Therefore, how to improve the security and defensiveness of artificial intelligence technology is an urgent issue that technical personnel in this field need to solve. Summary of the invention

[0004] The purpose of the present invention is to provide a process security defense method, product, device and medium to solve the problem of reducing the security risks of artificial intelligence security technology.

[0005] In order to solve the above technical problems, the present invention provides a process security defense method, which is applied to a secure memory controller; the secure memory controller is located between a system bus and a memory controller, and includes:

[0006] Obtaining a current process identifier and a pre-established secure memory control table; wherein the secure memory control table records accessible secure processes and corresponding memory address intervals;

[0007] Matching the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process;

[0008] If the matching result is successful, determining the access rights of the current process according to the matching relationship between the current read and write address of the current process in the secure memory space corresponding to the secure memory controller and the memory address interval of the secure memory control table;

[0009] When the access permission of the current process is enabled, the current process is determined to be a secure process so as to access the data in the successfully matched memory address range.

[0010] On the one hand, the process of establishing the secure memory control table includes:

[0011] Get the accessible security processes in the server;

[0012] A mapping relationship between the process identifier of the security process and the corresponding memory address interval is established to complete the security memory control table; wherein, the memory address interval of the security process is at least one.

[0013] On the other hand, matching the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process includes:

[0014] Determine whether the current process identifier is the same as the process identifier of the secure memory control table;

[0015] If there is a match, it is determined that the current process to which the current process identifier belongs matches successfully.

[0016] On the other hand, after matching the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process, and before determining that the matching result is successful, the method further includes:

[0017] Obtaining an enable flag of the secure memory control table;

[0018] In the case that the current process to which the current process identifier belongs is matched successfully, obtaining a current enable flag of the current process;

[0019] If the current enable flag is identical to the enable flag of the secure memory control table, it is determined that the final matching result of the current process is successful.

[0020] On the other hand, the process of establishing the enable flag of the secure memory control table includes:

[0021] When part of the system memory space in the secure memory space is occupied, the process corresponding to the part of the system memory space and the process corresponding to the secure memory space are distinguished by the enable mark to establish the enable mark of the secure memory control table.

[0022] On the other hand, the process of determining the secure memory space includes:

[0023] Get the size and preset ratio of system memory space;

[0024] Determine the size of the corresponding secure memory space in the reserved physical memory according to the relationship between the size of the system memory space and the preset ratio;

[0025] Acquire address information corresponding to the system memory space in the physical memory;

[0026] The address information of the secure memory space is determined according to the address information of the system memory space and the size of the secure memory space, wherein the address information of the secure memory space is higher than the address information of the system memory space.

[0027] On the other hand, the current process identifier is a process identifier applied to the model, and the process of establishing the memory address interval includes:

[0028] Obtaining a model size parameter accessible in the server; wherein the model size parameter is a model parameter corresponding to a process applied to the model;

[0029] Determining the memory space to be applied for according to the model size parameter accessible in the server;

[0030] Applying for a corresponding target memory in the secure memory space according to the memory space to be applied for;

[0031] The requested target memory is named through the block space to establish the memory address range.

[0032] On the other hand, determining the memory space to be applied for according to the model size parameter accessible in the server includes:

[0033] Obtain the corresponding number of parameters and the corresponding floating-point number type in the model size parameter of the target model;

[0034] The memory space to be applied for the target model is determined according to the relationship between the number of parameters, the floating point number type and the unit byte.

[0035] On the other hand, the memory address interval corresponding to the block space is used as the memory address interval of the secure memory control table, and is arranged in the form of columns; wherein one block space corresponds to one memory address interval.

[0036] In another aspect, the method further comprises:

[0037] When applying for the memory space to be applied for, if the block space corresponding to the target memory is full, the excess memory space will be named the next block space, and the memory address range corresponding to the next block space will be used as a new column of memory address ranges in the security memory control table and written into the corresponding security process.

[0038] On the other hand, determining the access rights of the current process according to the matching relationship between the current read and write address of the current process in the secure memory space corresponding to the secure memory controller and the memory address interval of the secure memory control table includes:

[0039] Matching the current read and write address of the current process in the secure memory space corresponding to the secure memory controller with the current memory address interval corresponding to the target secure process with a successful matching result in the secure memory control table;

[0040] If the match is successful, it is determined that the access permission of the current process is enabled;

[0041] If the match fails, the current read / write address is matched with the next memory address interval corresponding to the target secure process with a successful matching result in the secure memory control table, until the memory address intervals of all columns of the target secure process with a successful matching result in the secure memory control table are matched;

[0042] If the memory address intervals of all columns of the target secure process with successful matching results in the secure memory control table fail to match, it is determined that the access permission of the current process is prohibited.

[0043] On the other hand, matching is performed according to the current read and write address of the current process in the secure memory space corresponding to the secure memory controller with the current memory address interval corresponding to the target secure process with a successful matching result in the secure memory control table, including:

[0044] Obtaining the starting address information and the ending address information of the current memory address range;

[0045] Performing an AND operation on the current read / write address and the start address information to obtain a first read / write address;

[0046] Determining whether the first read / write address is the same as the starting address information;

[0047] If the first read / write address is the same as the starting address information, the address information of the first predetermined number of bits of the current read / write address beyond the starting address information and the address information of the first predetermined number of bits of the ending address information are processed by OR operation to obtain the second read / write address;

[0048] Determine whether the second read-write address is 0;

[0049] If the second read / write address is not 0, it is determined that the current read / write address successfully matches the current memory address interval.

[0050] In order to solve the above technical problems, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the security defense method of the process when the computer program / instruction is executed by a processor.

[0051] In order to solve the above technical problems, the present invention also provides a process security defense device, comprising:

[0052] Memory for storing computer programs;

[0053] A processor is used to implement the steps of the process security defense method as described when executing the computer program.

[0054] In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the security defense method for the process as described are implemented.

[0055] The present invention provides a process security defense method, which is applied to a secure memory controller; the secure memory controller is located between a system bus and a memory controller, and comprises: obtaining a current process identifier and a pre-established secure memory control table; wherein the secure memory control table records accessible secure processes and corresponding memory address intervals; matching the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process; in the case of a successful matching result, determining the access rights of the current process according to a matching relationship between a current read / write address of a secure memory space corresponding to the current process in the secure memory controller and a memory address interval of the secure memory control table; in the case of an opening of the access rights of the current process, determining the current process as a secure process, so as to facilitate access to data in the successfully matched memory address interval.

[0056] The beneficial effect of the present invention is that, through the hardware level, an additional secure memory controller is added, located between the system bus and the memory controller, and a control method combining hardware and software is adopted. Any access to the physical memory needs to be matched with the physical memory through the security verification of the secure memory controller. Each secure process record in the secure memory control table is associated with a specific memory address range. Only after being verified as a secure process can the corresponding memory area be accessed, thereby avoiding data being stolen and tampered by programs of other non-secure processes during program operation. Effectively prevent malware or other unauthorized processes from accessing sensitive memory areas, thereby improving the overall security and stability of the system.

[0057] Secondly, the process of establishing the secure memory control table is the process of determining the security verification for the access of the current process. Each process is associated with a specific physical memory area in the table to ensure that the current process can safely access the memory area and improve the overall security and stability of the system. The process identifier is used for matching to complete the initial screening of the current process and improve the matching efficiency. The process identifier and the enable tag are matched separately to complete the initial screening and further screening of the current process, improving the accuracy and progress of the matching. The address information of the secure memory space is distinguished from the address information of the system memory space, and a certain amount of physical memory space is reserved for its use to ensure the security and ease of use of the secure memory, and also prevent conflicts with applications or system components in the system memory space. The address matching process of logical operations reduces the computational complexity and does not affect the memory access speed, achieving memory security in hardware.

[0058] In addition, the present invention also provides a computer program product, a process security defense device, and a computer-readable storage medium, which have the same beneficial effects as the above-mentioned process security defense method. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 A flowchart of a process security defense method provided by an embodiment of the present invention;

[0061] Figure 2 A schematic diagram of the location of a secure memory controller provided by an embodiment of the present invention;

[0062] Figure 3 A structural diagram of a process security defense device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] The core of the present invention is to provide a process security defense method, product, device and medium to solve the problem of reducing the security risks of artificial intelligence security technology.

[0065] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0066] The deployment of artificial intelligence systems in business scenarios requires three levels of defense:

[0067] 1. Offensive and defensive security: targeted defense mechanisms designed for known attacks;

[0068] 2. Model security: Improve model robustness through model verification and other means;

[0069] 3. Architecture security: Design different security mechanisms in businesses deployed with artificial intelligence (AI) to ensure architecture security.

[0070] Conventional AI security technologies are mostly based on software, attempting to avoid risks by enhancing model robustness, data encryption, security auditing, and other means. However, this software-based defense strategy cannot completely solve the AI ​​security problem because attackers can launch attacks from multiple dimensions. For example, attackers can exploit hardware vulnerabilities to implant malicious code on the hardware platform where the model runs, directly affecting the execution results of the model. Even if the model itself undergoes rigorous security testing, it cannot resist attacks at the hardware level. The process security defense method provided by the present invention can solve the above technical problems.

[0071] Figure 1 A flowchart of a process security defense method provided by an embodiment of the present invention, such as Figure 1 As shown, it is applied to a secure memory controller; the secure memory controller is located between the system bus and the memory controller, and includes:

[0072] S11: Obtaining a current process identifier and a pre-established secure memory control table; wherein the secure memory control table records accessible secure processes and corresponding memory address ranges;

[0073] S12: Match the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process;

[0074] S13: If the matching result is successful, the access rights of the current process are determined according to the matching relationship between the current read and write addresses of the secure memory space corresponding to the secure memory controller and the memory address range of the secure memory control table;

[0075] S14: When the access permission of the current process is enabled, the current process is determined to be a secure process, so as to access the data in the successfully matched memory address range.

[0076] Specifically, the secure memory controller of the present invention is to enhance the security of system memory and act as a gatekeeper for memory access. Any access to physical memory must first be verified by the controller. Its working principle is to match the physical memory through the process ID (Identity document, ID) of the process, mainly using physical methods for matching, which can be logical operations, without affecting the access speed of the memory. Figure 2 A schematic diagram of the location of a secure memory controller provided by an embodiment of the present invention, such as Figure 2 As shown, the secure memory controller 1 is located between the system bus 2 and the memory controller 3, and can be an additional control unit or a processor unit, and can be packaged independently or together with other control units. The system bus 2 is connected to the central processing unit 4 and the hard disk 5. Secondly, the memory controller 3 is connected to the double data rate memory 6. In addition, the present invention can also be applied to any scenario based on any security defense, which is not limited here.

[0077] The current process identifier in step S11 is used to identify the current process, mainly considering that the essence of artificial intelligence security technology is to protect the security policy of each model during operation, and the corresponding current process is a process that needs to access physical memory. The current process identifier (Process Identifier, PID) is a unique number used to identify the running process in the operating system, allowing the operating system and users to track and manage it. The secure memory control table is used to record the secure processes and memory address ranges that can be accessed. It can be understood that the secure process is based on the process in the current process that is allowed to access physical memory. The memory address range is the address information accessed by the secure process, which is stored in the secure memory control table in the form of address information records.

[0078] Table 1 is a secure memory control table 1, as shown in Table 1, including the PID of the secure process and the memory address ranges corresponding to multiple physical addresses.

[0079] Table 1

[0080] Secure Process Identifier Memory address range 1 Memory address range 22 101 0×10000000-0×10200000 0×10000000-0x20200000

[0081] In step S12, the matching result of the current process is determined based on the matching of the current process identifier with the process identifier in the secure memory control table (the process identifier of the secure process). If the matches are the same, it is determined that the current process to which the current process identifier belongs can perform subsequent access rights determination. If the matches are different, it is determined that the current process to which the current process identifier belongs is not in the secure memory control table.

[0082] In step S13, the access permission result of the current process is determined based on the matching relationship between the current read and write address of the current process and the memory address range of the secure memory control table, that is, the address information of multiple memory address ranges in Table 1 is matched with the current read and write address information. If the match is successful, the current process can be allowed to access, and the current process is determined to be a secure process, so as to access the data in the memory address range that is successfully matched in step S14.

[0083] It is understandable that the matching process in step S13 can be performed by logical operation or by other comparison and determination methods, which are not limited here and can be set according to actual conditions.

[0084] Regarding the establishment of the secure memory control table, it is necessary to reserve secure memory space in the physical memory to store the parameters of the model. Based on the specific memory space size of different models in the secure memory space, the model size parameter can be used, that is, the number of parameters to be run, and the block storage method can be used to prevent access address fragmentation and realize centralized access.

[0085] The embodiment of the present invention provides a process security defense method, which is applied to a secure memory controller; the secure memory controller is located between the system bus and the memory controller, including: the secure memory controller is located between the system bus and the memory controller, including: obtaining the current process identifier and a pre-established secure memory control table; wherein the secure memory control table records the accessible secure processes and the corresponding memory address intervals; matching the current process identifier with the process identifier of the secure memory control table to determine the matching result of the current process; in the case of a successful matching result, determining the access rights of the current process according to the matching relationship between the current read and write address of the secure memory space corresponding to the current process in the secure memory controller and the memory address interval of the secure memory control table; in the case of the access rights of the current process being enabled, determining the current process as a secure process, so as to facilitate access to the data in the successfully matched memory address interval. Through the hardware level, an additional secure memory controller is added, which is located between the system bus and the memory controller, and a control method combining hardware and software is adopted. Any access to the physical memory needs to be matched to the physical memory through the security verification of the secure memory controller. Each secure process record is associated with a specific memory address range in the secure memory control table. Only after being verified as a secure process can it access the corresponding memory area, preventing data from being stolen or tampered with by other non-secure processes during program execution. This effectively prevents malware or other unauthorized processes from accessing sensitive memory areas, thereby improving the overall security and stability of the system.

[0086] In some embodiments, the process of establishing the secure memory control table includes:

[0087] Get the accessible security processes in the server;

[0088] A mapping relationship between a process identifier of a security process and a corresponding memory address interval is established to complete a security memory control table; wherein the memory address interval of the security process is at least one.

[0089] It is understandable that the accessible process in the server is a secure process. For security verification, it is necessary to obtain the process identifier of the secure process, and establish a mapping relationship between the process identifier of the secure process and the memory address interval to establish a secure memory control table. The mapping relationship is to ensure the link between the process identifier of the secure process and the corresponding memory address interval. The memory address interval can be found through the process identifier of the secure process, so as to facilitate the subsequent determination of address access rights.

[0090] The process of establishing the secure memory control table provided in this embodiment is a process for determining security verification for access by the current process. Each process is associated with a specific physical memory area in the table to ensure that the current process can securely access the memory area, thereby improving the overall security and stability of the system.

[0091] In some embodiments, matching the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process includes:

[0092] Determine whether the current process identifier is the same as the process identifier of the secure memory control table;

[0093] If there is a match, it is determined that the current process to which the current process identifier belongs matches successfully.

[0094] It is understandable that the comparison between the current process identifier and the process identifier of the secure memory control table can be performed by data comparison. If the identifier is long, it is necessary to compare it through feature information to ensure the accuracy of the comparison.

[0095] This embodiment does not limit how to compare, as long as the comparison result between the current process identifier and the process identifier of the secure memory control table can be determined, if they are the same, the current process to which the current process identifier belongs is considered to have matched successfully, and the subsequent access permission matching process can be performed; if they are different, access is denied.

[0096] This embodiment provides matching using process identifiers to complete the initial screening of the current process and improve matching efficiency.

[0097] In some embodiments, after matching the current process identifier with the process identifier of the secure memory control table to determine the matching result of the current process, and before determining that the matching result is successful, the method further includes:

[0098] Get the enable flag of the secure memory control table;

[0099] When the current process to which the current process identifier belongs is matched successfully, the current enable flag of the current process is obtained;

[0100] If the current enable flag is identical to the enable flag of the secure memory control table, it is determined that the final matching result of the current process is successful.

[0101] It is understandable that after step S12 and before step S13, on the basis of matching by process identifier, a second screening is performed by comparing the enable tags. If the enable tags are the same, the final matching result is determined to be successful. Considering that if there is a system memory situation in the current secure memory space, a comparison will be performed to exclude the process access allowed by the system memory. In order to comprehensively utilize physical memory, there will be an application scenario where the current system memory space occupies a large amount of space, resulting in the original system memory space being filled and occupying part of the secure memory space. Then the data stored in the secure memory space and the process contain the system memory space.

[0102] In some embodiments, the process of establishing the enable flag of the secure memory control table includes:

[0103] When part of the system memory space is occupied in the secure memory space, the process corresponding to the part of the system memory space and the process corresponding to the secure memory space are distinguished by an enable mark to establish the enable mark of the secure memory control table.

[0104] Therefore, the enable mark is used to distinguish whether the process is accessible to the system memory space or the process is accessible to the secure memory space, so as to ensure the comprehensive utilization of the memory space and the distinction between valid processes.

[0105] Table 2 is a secure memory control table 2, as shown in Table 2, including an enable flag, a PID of a secure process, and a memory address range corresponding to multiple physical addresses.

[0106] Table 2

[0107]

[0108] Therefore, the enable flag of the secure memory control table is obtained, and when the current process to which the current process identifier belongs in the above embodiment is matched successfully, the current enable flag of the current process is obtained; the current enable flag of the current process is compared with the enable flag of the secure memory control table, and if there is a similarity, it is determined that the final matching result of the current process is successful. The comparison process here and the comparison process of the current process identifier and the process identifier of the secure memory control table in the above embodiment can be the same or different, and are not limited here.

[0109] This embodiment provides the use of separate matching of process identifiers and enable tags to complete the initial screening and further screening of the current process, thereby improving the accuracy and progress of the matching.

[0110] In some embodiments, the process of determining the secure memory space includes:

[0111] Get the size and preset ratio of system memory space;

[0112] Determine the size of the corresponding secure memory space in the reserved physical memory according to the relationship between the size of the system memory space and the preset ratio;

[0113] Get the address information of the corresponding system memory space in the physical memory;

[0114] The address information of the secure memory space is determined according to the address information of the system memory space and the size of the secure memory space, wherein the address information of the secure memory space is higher than the address information of the system memory space.

[0115] Specifically, this embodiment takes into account that the size of the system memory space determines the size of the secure memory space corresponding to the reserved physical memory based on a preset ratio, that is, according to the preset ratio, a portion of the physical memory is allocated to the secure memory space. In order to avoid conflicts with the application or system component of the system memory space and to isolate the address space of the application or system component of the system memory space, the address information of the secure memory space is higher than the address information of the system memory space. The address information of the secure memory space can be determined by the address information of the system memory space and the size of the secure memory space, that is, in combination with the size of the secure memory space, the address information of the secure memory space is stored at the next address of the address information of the system memory space.

[0116] For example: 80% of the address space is allocated to AI secure memory, and the reserved space is located at (20%-100%)*total memory size; if it is also used to run other processes, 50% is reserved for AI secure memory, and the reserved space is located at (50%-100%)*total memory size.

[0117] In addition, the secure memory space will be used to store and run sensitive data and code related to the AI ​​process, such as model parameters, training data, and security policies. By reserving this space during the kernel startup phase, the availability and isolation of AI secure memory can be ensured, providing a safe and reliable operating environment for the AI ​​process.

[0118] This embodiment provides a method for distinguishing the address information of the secure memory space from the address information of the system memory space, and specifically reserving a certain physical memory space for its use, thereby ensuring the security and usability of the secure memory and preventing conflicts with applications or system components in the system memory space.

[0119] In some embodiments, the current process identifier is a process identifier applied to the model, and the process of establishing the memory address interval includes:

[0120] Obtain a model size parameter accessible in the server; wherein the model size parameter is a model parameter corresponding to a process applied to the model;

[0121] Determine the memory space to be requested based on the model size parameter accessible in the server;

[0122] Apply for the corresponding target memory in the secure memory space according to the memory space to be applied for;

[0123] The requested target memory is named through the block space to establish the memory address range.

[0124] Specifically, the process identifier applied to the model is the process identifier of the model process that can be run considering the storage in the current server. The memory space to be applied is determined according to the model size parameter accessed in the server. Here, the model size parameter is mainly the model parameter corresponding to the process applied to the model, such as the number of parameters. The corresponding target memory is applied according to the memory space to be applied, and the block space is used for naming to establish the memory space.

[0125] In some embodiments, determining the memory space to be applied for according to the model size parameter accessible in the server includes:

[0126] Get the corresponding number of parameters and the corresponding floating-point number type in the model size parameter of the target model;

[0127] The memory space to be applied for the target model is determined based on the relationship between the number of parameters, floating-point number type and unit bytes.

[0128] Specifically, when a model has 10B (10 billion) parameters, the "10B" here means that there are 10 billion parameters in the model. In the field of computer science and machine learning, model parameters usually refer to the number of trainable parameters such as weights and biases in a neural network. A large model with 10B parameters means that the model has 10 billion parameters. The memory size occupied by the parameters is usually a 32-bit floating point type. A 32-bit floating point number occupies 4 bytes (32 bits = 4 bytes). Therefore, the memory size occupied by a large model with 10B parameters is approximately: 40GB (Gigabytes).

[0129] Table 3 is a memory address allocation table. As shown in Table 3, the applicable models correspond to different numbers of parameters, and the corresponding memory sizes are also different, and the naming method of the block space is adopted.

[0130] Table 3

[0131] Blockname size Applicable models Block_0 40G byte >=10B parameters Block_1 4G byte >=1B parameters Block_2 400M byte >=100M parameters Block_3 40M byte >=10M parameters Block_4 4Mbyte >=1M parameters Block_5 400Kbyte ……

[0132] Among them, the reserved memory address is allocated in blocks, and the size of the block can be configured according to the running model size parameter. Different applications can have different block sizes, thereby reducing memory idleness.

[0133] The establishment of the memory address interval provided in this embodiment is intuitively represented by the memory address intervals 1 and 2 in Table 1 and Table 2. The traditional memory allocation will allocate the physical memory used by the user to various discontinuous memory spaces in a scattered manner, which will increase the matching time of the secure memory controller. Therefore, a block allocation method is adopted to allocate the memory allocated to each process to a number of memory blocks with continuous addresses, which can increase the address allocation speed. In this way, the re-allocation of memory blocks can be minimized, thereby ensuring the continuity of memory blocks.

[0134] In some embodiments, the memory address interval corresponding to the block space is used as the memory address interval of the secure memory control table and is arranged in the form of columns; wherein one block space corresponds to one memory address interval.

[0135] Specifically, the memory address intervals corresponding to the block spaces in Table 3 are arranged in columns as the memory address intervals in Table 1 and Table 2. That is, one block space corresponds to one memory address interval, and one process corresponds to at least one memory address interval or at least one block space.

[0136] In some embodiments, the method further comprises:

[0137] When applying for the memory space to be applied for, if the block space corresponding to the target memory is full, the excess memory space will be named the next block space, and the memory address range corresponding to the next block space will be used as a new column of memory address ranges in the security memory control table and written into the corresponding security process.

[0138] Specifically, when the storage space size of the block space corresponding to the target memory is full, the excess memory space needs to be named as the next block space. At the same time, the memory address interval corresponding to the next block space is used as a new column of memory address intervals in the secure memory control table and written into the corresponding secure process. Taking Table 1 as an example, a new column of memory address intervals, namely memory address interval 3, will be added.

[0139] This embodiment provides that when the pre-applied range (memory address interval) is full, a block size of Block_(n+1) is used when memory needs to be re-applied. After the memory allocation is completed, the system creates a new row in the secure memory control table and writes the corresponding memory range to the corresponding process number.

[0140] In some embodiments, if the secure memory space is full and there is memory space to be requested, the method further includes:

[0141] Obtain the access frequency of each secure process in the secure memory space;

[0142] Release the memory address interval corresponding to the least frequently accessed secure process to facilitate storage of the process to be requested for memory space, and update the secure memory control table;

[0143] Alternatively, a corresponding memory space is reserved in the system memory space according to the size of the memory space to be applied for so as to store the process of the memory space to be applied for, and the secure memory control table is updated.

[0144] It is understandable that the size of the secure memory space is limited. The required block size Block_n is estimated based on the model size and the memory size required by the program is estimated. The system pre-allocates the corresponding number of memory blocks (required memory size / Block_n) based on the maximum memory requested. If the pre-requested range is full, it is necessary to re-request memory. At this time, the secure memory space is relatively full, so it is necessary to release free memory space or borrow from the system memory space to ensure that the current pre-requested space is accessed by subsequent processes.

[0145] This embodiment provides a method of releasing free memory space or borrowing memory space from the system to ensure that the currently pre-applied space is accessible to subsequent processes.

[0146] In some embodiments, determining the access rights of the current process according to the matching relationship between the current read and write addresses of the current process in the secure memory space corresponding to the secure memory controller and the memory address range of the secure memory control table includes:

[0147] Matching the current read / write address of the current process in the secure memory space corresponding to the secure memory controller with the current memory address interval corresponding to the target secure process with a successful matching result in the secure memory control table;

[0148] If the match is successful, it is determined that the access permission of the current process is enabled;

[0149] If the match fails, the current read / write address is matched with the next memory address interval corresponding to the target secure process with a successful match result in the secure memory control table, until the memory address intervals of all columns of the target secure process with a successful match result in the secure memory control table are matched;

[0150] If the memory address intervals of all columns of the target secure process with successful matching results in the secure memory control table fail to match, it is determined that the access permission of the current process is prohibited.

[0151] Specifically, see Table 1 and Table 2. A security process corresponds to at least one memory address interval. Therefore, it is necessary to match the current read and write address of the current process with a memory address interval corresponding to a target security process with a successful matching result. If successful, the access permission of the current process is set to an enabled state. If unsuccessful, continue to match the next memory address interval of the target security process until all memory address intervals of the target security process are matched. If all matches fail, the access permission of the current process is determined to be prohibited.

[0152] When the access permission is prohibited, the secure memory controller will deny access and return an error, while triggering a system warning for illegal memory access. This mechanism can effectively prevent malware or other unauthorized processes from accessing sensitive memory areas, thereby improving the overall security and stability of the system.

[0153] In some embodiments, matching is performed based on the current read / write address of the current process in the secure memory space corresponding to the secure memory controller and the current memory address interval corresponding to the target secure process with a successful matching result in the secure memory control table, including:

[0154] Get the starting address information and ending address information of the current memory address range;

[0155] Perform an AND operation on the current read / write address and the start address information to obtain a first read / write address;

[0156] Determine whether the first read / write address is the same as the start address information;

[0157] If the first read / write address is the same as the start address information, the information of the first predetermined number of bits of the current read / write address beyond the start address information and the address information of the first predetermined number of bits of the end address information are processed by OR operation to obtain the second read / write address;

[0158] Determine whether the second read / write address is 0;

[0159] If the second read / write address is not 0, it is determined that the current read / write address successfully matches the current memory address range.

[0160] Specifically, this embodiment performs a logical operation on the address information of a limited number of block addresses to complete the address matching operation. A memory address interval includes the starting address information and the ending address information, and the current read / write address is ANDed and ORed with the starting address information. Here, it is considered that the current read / write address may be a multiple of the starting address information. The multiple relationship here is based on whether the number of 0s after the position where the last 1 is located after the current read / write address information and the starting address information are converted into hexadecimal is the same. If they are the same, it means that the two address information are in a multiple relationship.

[0161] In order to take into account the multiple relationship, the logical operation is performed in the AND operation and the OR operation to determine the match success. The current read-write address and the starting address information are processed by the AND operation to obtain the first read-write address. After the first read-write address is the same as the starting address information, the current read-write address is processed, that is, the current read-write address exceeds the first predetermined number of bits in the current read-write address corresponding to the starting address information and the end address information is processed by the OR operation to obtain the second read-write address. It should be noted that the first predetermined number of bits in the current read-write address is the first few bits of address information corresponding to the current read-write address. The first few bits of address information here are the parts that need to be compared with the starting address information. For example, the starting address information is 1K, and the corresponding hexadecimal is 0000 0100 0000 0000, and the address information higher than 1K is the first 5 bits, as the high address bit. Correspondingly, the end address information is compared with the address information of the first predetermined number of bits corresponding to the information. Combined with the above example, the first 5 bits of address information are also used for OR operation processing.

[0162] If the second read / write address is not 0, the match is determined to be successful. If the match fails, the next memory address interval of the target security process needs to be matched until all memory address intervals of the target security process are matched. If all matches fail, the access permission of the current process is determined to be prohibited.

[0163] The address matching process of the logic operation provided in this embodiment reduces the computational complexity and does not affect the memory access speed, thereby achieving memory security in hardware.

[0164] Furthermore, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the process security defense method when the computer program / instruction is executed by a processor.

[0165] For an introduction to a computer program product provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. It has the same beneficial effects as the security defense method of the above process.

[0166] The above describes in detail various embodiments corresponding to the process security defense method. On this basis, the present invention also discloses a process security defense device corresponding to the above method. Figure 3 A structural diagram of a process security defense device provided by an embodiment of the present invention, such as Figure 3 As shown, the device comprises:

[0167] A memory 21, used for storing computer programs;

[0168] The processor 22 is used to implement the steps of the process security defense method when executing the computer program.

[0169] The process security defense device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0170] Among them, the processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 22 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 22 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 22 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0171] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used to store the following computer program 211, wherein, after the computer program is loaded and executed by the processor 22, it can implement the relevant steps of the security defense method of the process disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 21 may also include an operating system 212 and data 213, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 212 may include Windows, Unix, Linux, etc. The data 213 may include, but is not limited to, data involved in the security defense method of the process, etc.

[0172] In some embodiments, the process security defense device may also include a display screen 23, an input and output interface 24, a communication interface 25, a power supply 26 and a communication bus 27.

[0173] Those skilled in the art can understand that Figure 3 The structure shown in does not constitute a limitation on the security defense device of the process and may include more or fewer components than those shown in the figure.

[0174] The processor 22 implements the process security defense method provided by any of the above embodiments by calling the instructions stored in the memory 21.

[0175] For an introduction to a security defense device for a process provided by the present invention, please refer to the above method embodiment, and the present invention will not be repeated here. It has the same beneficial effects as the security defense method for the above process.

[0176] Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor 22, the steps of the security defense method of the above process are implemented.

[0177] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0178] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. It has the same beneficial effects as the security defense method of the above process.

[0179] The above is a detailed introduction to the security defense method, product, device and medium for a process provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the present invention.

[0180] It should also be noted that, in this specification, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A process security defense method, characterized in that: Applied to a secure memory controller; the secure memory controller is located between a system bus and a memory controller, and includes: Obtaining a current process identifier and a pre-established secure memory control table; wherein the secure memory control table records accessible secure processes and corresponding memory address intervals; Matching the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process; If the matching result is successful, determining the access rights of the current process according to the matching relationship between the current read and write address of the current process in the secure memory space corresponding to the secure memory controller and the memory address interval of the secure memory control table; When the access permission of the current process is enabled, the current process is determined to be a secure process so as to access the data in the successfully matched memory address range.

2. The process security defense method according to claim 1, characterized in that: The process of establishing the secure memory control table includes: Get the accessible security processes in the server; A mapping relationship between the process identifier of the security process and the corresponding memory address interval is established to complete the security memory control table; wherein, the memory address interval of the security process is at least one.

3. The process security defense method according to claim 2, characterized in that: Matching the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process includes: Determine whether the current process identifier is the same as the process identifier of the secure memory control table; If there is a match, it is determined that the current process to which the current process identifier belongs matches successfully.

4. The process security defense method according to claim 3, characterized in that: After matching the current process identifier with the process identifier of the secure memory control table to determine a matching result of the current process, and before determining that the matching result is successful, the method further includes: Obtaining an enable flag of the secure memory control table; In the case that the current process to which the current process identifier belongs is matched successfully, obtaining a current enable flag of the current process; If the current enable flag is identical to the enable flag of the secure memory control table, it is determined that the final matching result of the current process is successful.

5. The process security defense method according to claim 4, characterized in that: The process of establishing the enable flag of the secure memory control table includes: When part of the system memory space in the secure memory space is occupied, the process corresponding to the part of the system memory space and the process corresponding to the secure memory space are distinguished by the enable mark to establish the enable mark of the secure memory control table.

6. The process security defense method according to claim 3, characterized in that: The process of determining the secure memory space includes: Get the size and preset ratio of system memory space; Determine the size of the corresponding secure memory space in the reserved physical memory according to the relationship between the size of the system memory space and the preset ratio; Acquire address information corresponding to the system memory space in the physical memory; The address information of the secure memory space is determined according to the address information of the system memory space and the size of the secure memory space, wherein the address information of the secure memory space is higher than the address information of the system memory space.

7. The process security defense method according to claim 2, characterized in that: The current process identifier is a process identifier applied to the model, and the process of establishing the memory address interval includes: Obtaining a model size parameter accessible in the server; wherein the model size parameter is a model parameter corresponding to a process applied to the model; Determining the memory space to be applied for according to the model size parameter accessible in the server; Applying for a corresponding target memory in the secure memory space according to the memory space to be applied for; The requested target memory is named through the block space to establish the memory address range.

8. The process security defense method according to claim 7, characterized in that: Determining the memory space to be applied for according to the model size parameter accessible in the server includes: Obtain the corresponding number of parameters and the corresponding floating-point number type in the model size parameter of the target model; The memory space to be applied for the target model is determined according to the relationship between the number of parameters, the floating point number type and the unit byte.

9. The process security defense method according to claim 8, characterized in that: The memory address interval corresponding to the block space is used as the memory address interval of the secure memory control table, and is arranged in the form of columns; wherein one block space corresponds to one memory address interval.

10. The process security defense method according to claim 9, characterized in that: The method further comprises: When applying for the memory space to be applied for, if the block space corresponding to the target memory is full, the excess memory space will be named the next block space, and the memory address range corresponding to the next block space will be used as a new column of memory address ranges in the security memory control table and written into the corresponding security process.

11. The process security defense method according to any one of claims 1 to 10, characterized in that: Determining the access rights of the current process according to a matching relationship between a current read / write address of the current process in the secure memory space corresponding to the secure memory controller and a memory address interval of the secure memory control table includes: Matching the current read and write address of the current process in the secure memory space corresponding to the secure memory controller with the current memory address interval corresponding to the target secure process with a successful matching result in the secure memory control table; If the match is successful, it is determined that the access permission of the current process is enabled; If the match fails, the current read / write address is matched with the next memory address interval corresponding to the target secure process with a successful matching result in the secure memory control table, until the memory address intervals of all columns of the target secure process with a successful matching result in the secure memory control table are matched; If the memory address intervals of all columns of the target secure process with successful matching results in the secure memory control table fail to match, it is determined that the access permission of the current process is prohibited.

12. The process security defense method according to claim 11, characterized in that: Matching the current read / write address of the current process in the secure memory space corresponding to the secure memory controller with the current memory address interval corresponding to the target secure process with a successful matching result in the secure memory control table, including: Obtaining the starting address information and the ending address information of the current memory address range; Performing an AND operation on the current read / write address and the start address information to obtain a first read / write address; Determining whether the first read / write address is the same as the starting address information; If the first read / write address is the same as the starting address information, the address information of the first predetermined number of bits of the current read / write address beyond the starting address information and the address information of the first predetermined number of bits of the ending address information are processed by OR operation to obtain the second read / write address; Determine whether the second read-write address is 0; If the second read / write address is not 0, it is determined that the current read / write address successfully matches the current memory address interval.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the security defense method for the process described in any one of claims 1 to 12 are implemented.

14. A process security defense device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the security defense method for a process as described in any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the security defense method for a process as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Ethernet data frame VLAN double-layer label processing device and method based on flow classification

    CN101567854A

  • Computer and abnormal progress detection method

    CN101782954A

  • Method for establishing safe channel for process communication in space-ground integration project

    CN107589999A

  • Memory isolation protection method, isolation check hardware, SOC chip and storage medium

    CN109614204A

  • Process address space isolation protection method and device in operating system, equipment

    CN111914284A