Application program processing method and device, equipment and storage medium
By using random mimicry input sequence generator and memory image generator technology when initializing the application process of the application program, the problem of poor security in the application process in the prior art is solved, and higher data storage security is achieved.
Patent Information
- Application Number
- CN202411651890.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, data storage of application processes in continuous order is poor and is vulnerable to the risk of security intrusion and malicious replacement.
When the application process is initialized, the random mimicry input sequence generator is started, the logical addresses of the application process are stored in memory in pseudo-random sequence order, and the reverse-sequence mirrored memory block is generated through the memory mirror generator, bit-to-bit operations and comparisons are performed to detect the modification of the memory block.
It greatly improves the security of application process data storage and reduces the risk of security intrusion and malicious replacement.
Smart Images

Figure CN119885299A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for processing an application. Background Art
[0002] In the field of mobile computing engineering, internationally accepted current technologies are still widely used in mobile frameworks and standard design directions. As a result, there are some security risks in the design maturity and security of the software, and the risks in security are particularly prominent.
[0003] In the related art, the security when processing the relevant data of the application is low. For example, when storing the process data of the application, sequential storage is usually used. For example: under a 64-bit system, the logical memory of a certain address is a sequential storage space from 0x00000000000 to 0xFFFFFFFFFFFFFFFF, and the memory is filled in sequence from low to high and from left to right. This storage method makes the memory continuous and easy to manage, but the defects it brings are also obvious. The above-mentioned memory is arranged continuously, making it particularly easy and easy to implement security intrusion or malicious replacement and injection of a certain section of memory. This is particularly prominent in the field of mobile security. Hackers or destroyers can easily export the entire block of memory, thereby restoring and replacing the entire function or the entire structural logic, making the application easy to be invaded, greatly reducing the security of the application data.
[0004] Therefore, how to improve the security of data storage in the process of data processing of application programs is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present invention provides an application processing method, device, equipment and storage medium, which are used to solve the defect of poor security of application process data of application processes stored in a continuous order in the prior art, and realize secure storage of application process data of application processes by storing the logical addresses of application processes in a pseudo-random sequence order, thereby greatly improving the security of application process data storage of applications.
[0006] In a first aspect, the present invention provides a method for processing an application, comprising the following steps: When the application process of the application is initialized, the random mimic input sequence generator is started; Based on the random mimetic input sequence generator, the application processes of the application are stored in a memory in a pseudo-random sequence order; The pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in an initial order using the random pseudo-input sequence generator.
[0007] Preferably, according to the application processing method provided by the present invention, after the step of storing the application process of the application in the memory in a pseudo-random sequence order, the method comprises: Creating a memory image generator, wherein the memory image generator is created by a kernel of the operating system while the operating system is started; Mirroring the application memory blocks of the application process based on the memory mirror generator to generate at least two groups of identical mirrored memory blocks; The storage order of the storage addresses of the mirror memory block is opposite to the storage order of the storage addresses of the application memory block.
[0008] Preferably, according to the application processing method provided by the present invention, after the step of mirroring the application memory blocks of the application process based on the memory mirror generator to generate at least two groups of identical mirror memory blocks, the method includes: In each preset memory update cycle of the application memory block, the storage address of the application memory block is respectively subjected to a bitwise AND operation with the storage addresses of the at least two groups of identical mirror memory blocks to obtain at least two corresponding operation results; Compare the at least two calculation results with the preset calculation results respectively to obtain at least two comparison results; When the at least two comparison results are the same, determining that the application memory block is not modified; When there is at least one difference between the at least two comparison results, the application memory block is updated using at least one set of mirror memory blocks.
[0009] Preferably, according to the application processing method provided by the present invention, the pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in the initial order using the random pseudo-input sequence generator, comprising: determining the bitness of the operating system; Generate an initial sequence number according to the number of bits of the operating system, and mark the logical addresses of the application processes arranged in the initial sequence; Obtaining a random number from the initial sequence number; The random pseudo-input sequence generator and the random number are used to discretely process the marked logical addresses of the application processes arranged in the initial order to determine the pseudo-random sequence order of the logical addresses of the application processes.
[0010] Preferably, according to the application processing method provided by the present invention, storing the application processes of the application in a memory in a pseudo-random sequence order comprises: determining free memory in the memory; The application processes of the application program are stored in the free memory in the pseudo-random sequence order.
[0011] Preferably, according to the application processing method provided by the present invention, while storing the application process of the application in the free memory in the pseudo-random sequence order, the method includes: The logical addresses of the application processes stored in the free memory in the order of the pseudo-random sequence are connected through a linked list.
[0012] Preferably, according to the application processing method provided by the present invention, before the step of starting the random mimic input sequence generator while initializing the application process of the application, the method includes: Loading a mimic thread resident library between a system call module of the kernel of the operating system and a preset language base library module; The pseudo-thread resident library is written in assembly language to provide a calling interface between the application process and the system process of the operating system.
[0013] Preferably, according to the application processing method provided by the present invention, before the step of starting the random mimic input sequence generator while initializing the application process of the application, the method further includes: Creating a thread virtualization generator while initializing the system process of the operating system; The thread virtualization generator generates a corresponding virtual thread for each of the system processes, so as to control the corresponding system process according to the virtual thread.
[0014] In a second aspect, the present invention further provides an application processing device, comprising the following modules: A startup module, used to start the random mimic input sequence generator while the application process of the application is initialized; A storage module is used to store the application process of the application in a memory in a pseudo-random sequence order based on the random mimetic input sequence generator; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in an initial order using the random mimetic input sequence generator.
[0015] In a third aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for processing an application as described above is implemented.
[0016] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for processing an application as described in any one of the above.
[0017] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements a processing method for an application program as described above.
[0018] The present invention provides an application processing method, device, equipment and storage medium, which starts a random mimic input sequence generator while initializing the application process of the application; based on the random mimic input sequence generator, the application process of the application is stored in the memory in a pseudo-random sequence order; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application process arranged in the initial order using the random mimic input sequence generator. It is used to solve the defect of poor security of application process data stored in a continuous order in the prior art, and realizes the safe storage of application process data of the application process by storing the logical addresses of the application process in a pseudo-random sequence order, thereby greatly improving the security of application process data storage of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0020] Figure 1 It is a schematic diagram of storage arranged in an initial order in the prior art provided by the present invention.
[0021] Figure 2 This is one of the flowcharts of the application processing method provided by the present invention.
[0022] Figure 3 This is one of the schematic diagrams of storing in a pseudo-random sequence order provided by the present invention.
[0023] Figure 4 This is the second schematic diagram of storing in a pseudo-random sequence provided by the present invention.
[0024] Figure 5 It is a schematic diagram of the bitwise AND operation provided by the present invention.
[0025] Figure 6It is a schematic diagram of the position relationship of the mimic thread resident library provided by the present invention.
[0026] Figure 7 This is the second flow chart of the method for processing an application provided by the present invention.
[0027] Figure 8 It is a structural schematic diagram of the processing device of the application provided by the present invention.
[0028] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0030] First, some nouns involved in this application are analyzed: The kernel is the core of an operating system. It is the first layer of software expansion based on hardware, providing the most basic functions of the operating system. It is the basis for the operation of the operating system. It is responsible for managing the system's processes, memory, device drivers, files, and network systems, and determines the system's performance and stability. The C language basic library is an important part of the C programming language. It provides developers with a set of common and convenient functions. Through these functions, they can efficiently process strings, perform mathematical operations, manage memory, etc. It contains a set of header files, each of which defines a group of related functions, macros and types. The design goal of the standard library is to provide efficient and portable solutions for common programming tasks.
[0031] Resident library pseudo thread resident library refers to a library used to manage and schedule lightweight threads running in the background. In multithreaded programming, a daemon thread is a special type of thread that runs in the background and usually does not prevent the Java virtual machine (JVM) from exiting. When all user threads terminate, the JVM will exit even if the resident thread is still running. Resident threads are often used to perform some service-like tasks, such as garbage collection, monitoring, and scheduled tasks. Process, a process is the execution process of a program on a computer, and is the basic unit for resource allocation and scheduling of the operating system. As the basis of the operating system structure, the process carries the running instance of the program and plays a core role in system resource management and scheduling.
[0032] A thread is an entity in a process and the basic unit of CPU scheduling and dispatching. It is a smaller and independently running unit than a process. Basic definition: A thread is sometimes also called a lightweight process. It is the smallest unit of program execution flow and consists of a thread ID, a current instruction pointer (PC), a register set, and a stack. A thread does not own system resources, but only a few resources that are essential for operation. However, it can share all the resources owned by the process with other threads belonging to the same process.
[0033] The main characteristics of threads: The entities in a thread basically do not own system resources, but have some essential resources that can ensure independent operation. A thread is the smallest unit that the operating system can schedule operations on. It is included in the process and is the actual operating unit in the process.
[0034] Thread-related properties: Multiple threads in the same process can be executed concurrently, and even all threads in a process can be executed concurrently; similarly, threads in different processes can also be executed concurrently. Each thread in the same process can share the resources owned by the process, which is first manifested in that all threads have the same address space (the address space of the process).
[0035] Implementation method: User-level threads only exist in user space, and the kernel is not aware of the existence of multiple threads. User-level thread creation, cancellation, synchronization and communication functions between threads cannot be implemented using system calls. Kernel-level thread creation and destruction are all run with the support of the kernel, managed by the operating system, and completed through system calls.
[0036] State transition: There are three basic states of threads: ready, blocked, and running. The ready state means that the thread has all the conditions to run, can run logically, and is waiting for the processor; the running state means that the thread occupies the processor and is running; the blocked state means that the thread is waiting for an event (such as a semaphore) and cannot be executed logically.
[0037] In the related art, the security of processing the application-related data is low. For example, when storing the process data of the application, sequential storage is usually used. For example: Figure 1As shown in the figure, in a 64-bit system, the logical memory of a certain address is a sequential storage space from 0x00000000000 to 0xFFFFFFFFFFFFFFFF, and the memory is filled in order from low to high and from left to right. This storage method makes the memory continuous and easy to manage, but the defects it brings are also obvious. The above memory is arranged continuously, making it particularly easy and easy to implement security intrusion or malicious replacement and injection of a certain memory segment, which is particularly prominent in the field of mobile security. Hackers or destroyers can easily export the entire block of memory, thereby restoring and replacing the entire function or the entire structure logic, making the application easy to be invaded, which will greatly reduce the security of application data.
[0038] Combine the following Figure 2-Figure 9 The present invention describes an application processing method, device, equipment and storage medium, which are used to solve the defect of poor security of application process data of application processes stored in continuous order in the prior art, and realize secure storage of application process data of application processes by storing logical addresses of application processes in pseudo-random sequence order, thereby greatly improving the security of application process data storage of applications.
[0039] Figure 2 This is one of the flow charts of a method for processing an application program provided by the present invention, such as Figure 2 As shown, the method may include but is not limited to steps S100 to S200: S100, while the application process of the application is initialized, starting a random mimic input sequence generator; S200, based on the random mimetic input sequence generator, storing the application process of the application in the memory in a pseudo-random sequence order; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in an initial order using the random mimetic input sequence generator.
[0040] In step S100 of some embodiments, the random mimic input sequence generator is started while the application process of the application is initialized.
[0041] It is understandable that when the user's application is called and loaded, the application process of the user's application needs to be initialized first, so that the application can be loaded and called according to the application process. Then, while the application process is initialized, the random pseudo-input sequence generator is started, so that the application data can be efficiently stored in the memory in a pseudo-random sequence order.
[0042] It should be noted that the random pseudo-input sequence generator is an electronic device or algorithm that can generate a pseudo-random sequence. In an embodiment of the present invention, it is a random sequence independent of the memory controller, which can distribute sequentially arranged logical memory in the form of a random virtual state throughout the memory.
[0043] The main functions of the random mimic input sequence generator are: 1. Encrypted communication: The random mimic input sequence generator can be used to generate an encryption key sequence to encrypt communication data and protect the security of communication content.
[0044] 2. Pseudo-random number generation: The random pseudo-input sequence generator can be used to generate pseudo-random number sequences, which can be applied in pseudo-random number generation algorithms in cryptography, simulation experiments, randomization algorithms and other applications.
[0045] 3. Signal processing: Random pseudo-input sequence generator can be used to generate signal sequences with specific properties, such as sequences with good spectral characteristics, frequency hopping signal sequences, etc. It is widely used in various signal processing applications such as communications, radar systems, and radio measurements.
[0046] 4. Detector test: The random simulated input sequence generator can be used to perform performance tests on receivers in digital communications. By comparing with known normal inputs, the performance indicators of the receiver such as bit error rate, bit error rate, frame error rate, etc. can be detected.
[0047] In step S200 of some embodiments, based on the random mimic input sequence generator, the application process of the application is stored in the memory in a pseudo-random sequence order.
[0048] The pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in the initial order using the random pseudo-input sequence generator. It is understandable that the logical addresses of the application process are originally arranged in an initial order, but the random pseudo-input sequence generator can be used to discretely process the logical addresses arranged in the initial order to determine the pseudo-random sequence order. The order of pseudo-random sequence order storage is randomly determined, so storing in pseudo-random sequence order is more secure.
[0049] In some embodiments of the present invention, the pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in the initial order using the random pseudo-input sequence generator, including: determining the bitness of the operating system; Generate an initial sequence number according to the number of bits of the operating system, and mark the logical addresses of the application processes arranged in the initial sequence; Obtaining a random number from the initial sequence number; The random pseudo-input sequence generator and the random number are used to discretely process the marked logical addresses of the application processes arranged in the initial order to determine the pseudo-random sequence order of the logical addresses of the application processes.
[0050] It can be understood that the system bit number of the current operating system is first determined. For example, if it is a 32-bit operating system, the system bit number is 32, and if it is a 64-bit operating system, the operating system bit number is 64. If it is an 8-bit operating system, the operating system bit number is 8.
[0051] An initial sequence number is generated according to the number of bits of the operating system. For example, if the number of bits of the operating system is 8, a sequence number from 1 to 8 is generated, namely, the initial sequence number.
[0052] It should be noted that the initial sequence number is used to mark the free memory in the logical memory, and then a random number is randomly selected from the initial sequence each time. According to the selected random number, the logical address of the corresponding application process and the application process are stored in the memory in the order of the random numbers. This storage order is the pseudo-random sequence order. Finally, the logical addresses of the application processes stored in the pseudo-random sequence order are linked together through a linked list. The linking effect is as follows: Figure 3 As shown, the memory of the same continuous function is discretely stored in various locations of the memory space, and stored and used in a fragmented form. The above approach can greatly improve security.
[0053] Furthermore, the initial sequence number is first determined, and then the unused free memory is clearly marked. The free memory is not a continuous area. Then, through the determined random number, the logical address is filled in the free memory of the non-continuous area in the order determined by the random number, thereby determining the pseudo-random sequence order.
[0054] Furthermore, the requested memory is randomly arranged vertically in the form of N-bit blocks in the form of random numbers. The first block is placed at any vertical position of the lowest physical address, the second block is placed at any vertical position of the highest address, the third block is placed at any position close to the highest address of the second block -N / 2, the fourth block is placed at any position close to the lowest address of the first block +N / 2, and so on. Figure 4 As shown, the security of data storage and use can be improved, and the ability of intruder analysis and regression can be greatly improved.
[0055] In some embodiments of the present invention, storing the application processes of the application program in a memory in a pseudo-random sequence order includes: determining free memory in the memory; The application processes of the application program are stored in the free memory in the pseudo-random sequence order.
[0056] It can be understood that the data size of the application process of the application and the size of the logical address of the application process are determined, and according to the size to be stored, the operating system kernel is requested to allocate free memory of the same size as the space to be stored. When the operating system kernel receives the request information, it will query the free memory in the memory and randomly select the memory space matching the request information from the free memory in the memory to allocate to the application to store the application process data and logical address data of the application.
[0057] After determining the free memory in the memory, the application processes of the application program are stored in the free memory in the pseudo-random sequence order.
[0058] In some embodiments of the present invention, while storing the application processes of the application program in the free memory in the pseudo-random sequence order, the method includes: The logical addresses of the application processes stored in the free memory in the order of the pseudo-random sequence are connected through a linked list.
[0059] It can be understood that while storing the application process of the application in the free memory in the pseudo-random sequence order, the logical addresses of the application processes stored in the free memory in the pseudo-random sequence order can be linked through pointers by calling the pointers of each logical address for easy query and management.
[0060] In some embodiments of the present invention, after the step of storing the application processes of the application program in a pseudo-random sequence in a memory, the method includes: Creating a memory image generator, wherein the memory image generator is created by a kernel of the operating system while the operating system is started; Mirroring the application memory blocks of the application process based on the memory mirror generator to generate at least two groups of identical mirrored memory blocks; The storage order of the storage addresses of the mirror memory block is opposite to the storage order of the storage addresses of the application memory block.
[0061] It should be noted that the memory mirror generator is a reverse-order mirror memory group in the memory based on the original process. It is created by the kernel and exists as a comparison reference memory for the mirror of the application memory block of the application. Generally, there are 2-3 groups in the form of reverse memory mirrors. When the memory of the application is injected by the hacker process and the memory is changed, error correction can be performed through AND operations, eliminating the security issues caused by dynamic debugging of the original process.
[0062] When an application is started, the operating system simultaneously derives two identical memory images. The storage method of its logical memory in the physical memory is "mirror-symmetric" and "in reverse order" with the original memory. That is, the original memory storage address is from high to low and from left to right, while the memory image is from low to high and from right to left, thereby improving the security of the application memory block and also playing a role in risk prevention.
[0063] In some embodiments of the present invention, after the step of mirroring the application memory blocks of the application process based on the memory mirror generator to generate at least two groups of identical mirror memory blocks, the method includes: In each preset memory update cycle of the application memory block, the storage address of the application memory block is respectively subjected to a bitwise AND operation with the storage addresses of the at least two groups of identical mirror memory blocks to obtain at least two corresponding operation results; Compare the at least two calculation results with the preset calculation results respectively to obtain at least two comparison results; When the at least two comparison results are the same, determining that the application memory block is not modified; When there is at least one difference between the at least two comparison results, the application memory block is updated using at least one set of mirror memory blocks.
[0064] It is understandable that the operating system is provided with a timestamp, and within a preset memory update cycle, for example, the application memory block is updated and queried once every 10 minutes to query the data of the application memory block. Within each preset memory update cycle, the storage address of the application memory block is respectively bitwise ANDed with the storage addresses of the at least two groups of identical mirror memory blocks to obtain corresponding at least two operation results, i.e. Figure 5 shown.
[0065] In order to verify the security of the application memory block, let the application memory block be A, and there are two sets of mirror memory blocks, B1 and B2. Perform a bitwise AND operation on A and B1 to obtain the operation result C1, and perform a bitwise AND operation on A and B2 to obtain the operation result C2.
[0066] In order to improve the accuracy of verification and prevent one of the mirrored memories from being maliciously tampered with, at least two groups of identical mirrored memory blocks need to be set to verify at least two operation results.
[0067] Compare the calculation result C1 with the preset calculation result. If they are the same, it proves that the mirror memory block B1 has not been modified. Compare the calculation result C2 with the preset calculation result. If they are the same, it proves that the mirror memory block C2 has not been modified.
[0068] When the operation results C1 and C2 are compared with the preset operation results and are the same, it is proved that the application memory block is safe and has not been modified.
[0069] When the operation result C1 and the operation result C2 are compared with the preset operation result, there is at least one difference, which proves that the application memory block or the mirror memory block is unsafe, and the cause of the abnormality is analyzed to determine whether the mirror memory block is modified or the application memory block is modified. If it is determined that the mirror memory block is modified, the modified abnormal mirror memory block is deleted and a corresponding set of mirror memory blocks is regenerated. If it is determined that the application memory block is modified, the communication link between the application memory block and the external malicious process is immediately cut off, and the application memory block is updated using at least one set of normal mirror memory blocks. In this way, the application process of the application can be continuously and efficiently protected.
[0070] In some embodiments of the present invention, before the step of starting the random mimic input sequence generator while initializing the application process of the application, the method includes: Loading a mimic thread resident library between a system call module of the kernel of the operating system and a preset language base library module; The pseudo-thread resident library is written in assembly language to provide a calling interface between the application process and the system process of the operating system.
[0071] It should be noted that the preset language basic library may be a C language basic library.
[0072] Understandably, Figure 6It is a schematic diagram of the position relationship of the mimic thread resident library provided by the present invention. In some embodiments of the present invention, the mimic thread resident library is another basic library loaded between the mobile terminal operating system kernel system call module and the C language basic library module, which is written in pure assembly language and cannot be written in C language, because the C language compiler will artificially perform semantic optimization during the compilation and optimization process, and some user-level memory-related functions in the C language basic library are often used by hackers as a springboard for jump attacks, which poses obvious security risks. Using assembly language to write the "mimetic thread resident library" has a natural immune effect on some frameworks that are known to rely on C language libraries for penetration attacks, and has security characteristics.
[0073] It should be noted that the mimic thread resident library simplifies and manages the creation, scheduling, and destruction of these background threads by providing a series of tools and interfaces. It can include but is not limited to the following functions: Thread creation and management: Provides easy methods to create and manage resident threads, including setting thread attributes and priorities.
[0074] Task Scheduling: Supports scheduling of background tasks to ensure they are executed at the appropriate time.
[0075] Resource management: helps manage the resources used by threads and avoid resource leaks.
[0076] Monitoring and debugging: Provides monitoring tools so that developers can track and debug the state and behavior of background threads.
[0077] Error handling: Implement an error handling mechanism to ensure that background threads can correctly handle and log exceptions when they encounter them.
[0078] Performance optimization: Improve the execution efficiency and response speed of background threads by optimizing algorithms and data structures.
[0079] Compatibility: Ensure compatibility of the library on different operating systems and Java versions.
[0080] Documentation and Examples: Provides detailed documentation and sample code to help developers quickly get started and use the library's functions.
[0081] In summary, the Mimic Thread Resident Library aims to provide an efficient, reliable, and easy-to-use framework to support and manage lightweight threads running in the background, thereby improving the performance and stability of applications.
[0082] In some embodiments of the present invention, before the step of starting the random mimic input sequence generator while initializing the application process of the application, the method further includes: Creating a thread virtualization generator while initializing the system process of the operating system; The thread virtualization generator generates a corresponding virtual thread for each of the system processes, so as to control the corresponding system process according to the virtual thread.
[0083] It can be understood that in some embodiments of the present invention, the thread virtualization generator is an independent resident memory, which is created by the kernel initialization process in the form of a mobile operating system service, belongs to the system service process, and is independent of the application memory space. It derives a thread for each process based on the process derived from the native kernel process scheduling unit. In the form of process virtualization, the derived thread is independent of the original process memory unit and is attached to the original process at the beginning of process creation. It is used to monitor and control the original process independently of the process space, and is responsible for communicating with other processes through message queues.
[0084] The present invention provides an application processing method, device, equipment and storage medium, which starts a random mimic input sequence generator while initializing the application process of the application; based on the random mimic input sequence generator, the application process of the application is stored in the memory in a pseudo-random sequence order; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application process arranged in the initial order using the random mimic input sequence generator. It is used to solve the defect of poor security of application process data stored in a continuous order in the prior art, and realizes the safe storage of application process data of the application process by storing the logical addresses of the application process in a pseudo-random sequence order, thereby greatly improving the security of application process data storage of the application.
[0085] Figure 7 This is the second flow chart of the method for processing an application provided by the present invention.
[0086] In some embodiments of the present invention, the application processing method provided by the present invention can be applied to, but is not limited to, mobile operating systems, especially mobile embedded processors, mobile embedded operating systems, mobile application development frameworks, mobile embedded compilers, and mobile application bytecode interpreters.
[0087] When the operating system starts, when the kernel starts and throws out the first process, the simulated thread resident library is loaded into the memory for use by the operating system. During the initialization of the operating system process No. 1, a thread virtualization generator is generated. During the initialization of the user application process, a random simulated input sequence generator is started.
[0088] The random pseudo-input sequence generator distributes the memory requested by the application in the form of random virtual states in various locations of the physical memory and arranges them in a discrete form. Its principle is to dynamically query the unused memory in the memory, discretely store the memory in a vertical order, and then connect the vertically stored memory one by one into an orderly whole through a linked list.
[0089] The memory mirror generator generates two or more mirror memories of the original application memory block. The mirror memories are symmetrical with the original application memory and stored in reverse order. The mirror memory block and the original application memory block perform a bitwise AND operation. If the original application memory block and the two or more mirror memory blocks can complete the bitwise AND operation, and the modulo remainder is 0, it is considered that the application process of application A has not been modified; when it is not 0, it is automatically filled from the mirror memory block to the original application memory, modifying the memory changed by the injection attack and terminating the process debugging, thereby improving the security of the storage and use of application process data from multiple aspects.
[0090] The following is a description of the application processing device provided by the present invention. The application processing device described below and the application processing method described above can be referenced to each other.
[0091] Reference Figure 8 As shown, the present invention also provides an application processing device, comprising the following modules: A starting module 810, used to start a random mimic input sequence generator while initializing an application process of the application program; The storage module 820 is used to store the application process of the application in the memory in a pseudo-random sequence order based on the random mimetic input sequence generator; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application process arranged in an initial order using the random mimetic input sequence generator.
[0092] According to the present invention, a processing device for an application is further used to create a memory image generator, wherein the memory image generator is created by the kernel of the operating system when the operating system is started; Mirroring the application memory blocks of the application process based on the memory mirror generator to generate at least two groups of identical mirrored memory blocks; The storage order of the storage addresses of the mirror memory block is opposite to the storage order of the storage addresses of the application memory block.
[0093] According to a processing device for an application provided by the present invention, the processing device is further configured to perform a bitwise AND operation on the storage address of the application memory block and the storage addresses of the at least two groups of identical mirror memory blocks in each preset memory update cycle of the application memory block, respectively, to obtain at least two corresponding operation results; Compare the at least two calculation results with the preset calculation results respectively to obtain at least two comparison results; When the at least two comparison results are the same, determining that the application memory block is not modified; When there is at least one difference between the at least two comparison results, the application memory block is updated using at least one set of mirror memory blocks.
[0094] According to an application processing device provided by the present invention, the storage module 820 is further used for determining the pseudo-random sequence order by discretely processing the logical addresses of the application processes arranged in the initial order using the random pseudo-input sequence generator, including: determining the bitness of the operating system; Generate an initial sequence number according to the number of bits of the operating system, and mark the logical addresses of the application processes arranged in the initial sequence; Obtaining a random number from the initial sequence number; The random pseudo-input sequence generator and the random number are used to discretely process the marked logical addresses of the application processes arranged in the initial order to determine the pseudo-random sequence order of the logical addresses of the application processes.
[0095] According to an application processing device provided by the present invention, the storage module 820 is further specifically used to determine the free memory in the memory; The application processes of the application program are stored in the free memory in the pseudo-random sequence order.
[0096] According to the present invention, a processing device for an application is further configured to connect the logical addresses of the application processes stored in the free memory in the order of the pseudo-random sequence through a linked list.
[0097] According to the present invention, a processing device for an application is further used to load a mimic thread resident library between a system call module of the kernel of the operating system and a preset language base library module; The pseudo-thread resident library is written in assembly language to provide a calling interface between the application process and the system process of the operating system.
[0098] According to the present invention, a processing device for an application is further used to create a thread virtualization generator while initializing the system process of the operating system; The thread virtualization generator generates a corresponding virtual thread for each of the system processes, so as to control the corresponding system process according to the virtual thread.
[0099] The present invention provides an application processing method, device, equipment and storage medium, which starts a random mimic input sequence generator while initializing the application process of the application; based on the random mimic input sequence generator, the application process of the application is stored in the memory in a pseudo-random sequence order; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application process arranged in the initial order using the random mimic input sequence generator. It is used to solve the defect of poor security of application process data stored in a continuous order in the prior art, and realizes the safe storage of application process data of the application process by storing the logical addresses of the application process in a pseudo-random sequence order, thereby greatly improving the security of application process data storage of the application.
[0100] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the processing method of the application program, the method comprising: while the application process of the application program is initialized, starting a random mimetic input sequence generator; based on the random mimetic input sequence generator, storing the application process of the application program in the memory in a pseudo-random sequence order; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application process arranged in the initial order using the random mimetic input sequence generator.
[0101] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the 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, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0102] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the application processing method provided by the above-mentioned methods, the method including: starting a random mimetic input sequence generator while initializing the application process of the application; based on the random mimetic input sequence generator, storing the application process of the application in a pseudo-random sequence order in a memory; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in an initial order using the random mimetic input sequence generator.
[0103] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a processing method for executing an application provided by the above-mentioned methods, the method comprising: starting a random mimic input sequence generator while initializing an application process of the application; based on the random mimic input sequence generator, storing the application process of the application in a pseudo-random sequence order in a memory; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in an initial order using the random mimic input sequence generator.
[0104] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing an application, characterized in that: include: When the application process of the application is initialized, the random mimic input sequence generator is started; Based on the random mimetic input sequence generator, the application processes of the application are stored in a memory in a pseudo-random sequence order; The pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in an initial order using the random pseudo-input sequence generator.
2. The method for processing an application according to claim 1, characterized in that: After the step of storing the application processes of the application program in a pseudo-random sequence in a memory, the method comprises: Creating a memory image generator, wherein the memory image generator is created by a kernel of the operating system while the operating system is started; Mirroring the application memory blocks of the application process based on the memory mirror generator to generate at least two groups of identical mirrored memory blocks; The storage order of the storage addresses of the mirror memory block is opposite to the storage order of the storage addresses of the application memory block.
3. The method for processing an application according to claim 2, characterized in that: After the step of mirroring the application memory blocks of the application process based on the memory mirror generator to generate at least two groups of identical mirror memory blocks, the method includes: In each preset memory update cycle of the application memory block, the storage address of the application memory block is respectively subjected to a bitwise AND operation with the storage addresses of the at least two groups of identical mirror memory blocks to obtain at least two corresponding operation results; Compare the at least two calculation results with the preset calculation results respectively to obtain at least two comparison results; When the at least two comparison results are the same, determining that the application memory block is not modified; When there is at least one difference between the at least two comparison results, the application memory block is updated using at least one set of mirror memory blocks.
4. The method for processing an application according to claim 2, characterized in that: The pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in the initial order using the random pseudo-input sequence generator, including: determining the bitness of the operating system; Generate an initial sequence number according to the number of bits of the operating system, and mark the logical addresses of the application processes arranged in the initial sequence; Obtaining a random number from the initial sequence number; The random pseudo-input sequence generator and the random number are used to discretely process the marked logical addresses of the application processes arranged in the initial order to determine the pseudo-random sequence order of the logical addresses of the application processes.
5. The method for processing an application according to claim 1, characterized in that: The step of storing the application processes of the application program in a memory in a pseudo-random sequence order comprises: determining free memory in the memory; The application processes of the application program are stored in the free memory in the pseudo-random sequence order.
6. The method for processing an application according to claim 5, characterized in that: While storing the application processes of the application program in the free memory in the pseudo-random sequence order, the method includes: The logical addresses of the application processes stored in the free memory in the order of the pseudo-random sequence are connected through a linked list.
7. The method for processing an application according to claim 2, characterized in that: Before the step of starting the random mimic input sequence generator while initializing the application process of the application program, the method includes: Loading a mimic thread resident library between a system call module of the kernel of the operating system and a preset language base library module; The pseudo-thread resident library is written in assembly language to provide a calling interface between the application process and the system process of the operating system.
8. The method for processing an application according to claim 7, characterized in that: Before the step of starting the random mimic input sequence generator while the application process of the application is initialized, the method further includes: Creating a thread virtualization generator while initializing the system process of the operating system; The thread virtualization generator generates a corresponding virtual thread for each of the system processes, so as to control the corresponding system process according to the virtual thread.
9. A device for processing an application, characterized in that: include: A startup module, used to start the random mimic input sequence generator while the application process of the application is initialized; A storage module is used to store the application process of the application in a memory in a pseudo-random sequence order based on the random mimetic input sequence generator; wherein the pseudo-random sequence order is determined by discretely processing the logical addresses of the application processes arranged in an initial order using the random mimetic input sequence generator.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for processing the application program according to any one of claims 1 to 8 is implemented.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for processing an application program according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for processing an application program according to any one of claims 1 to 8 is implemented.