Data processing method, device and computer program product
By obtaining the application's startup event parameters and using a structure array and PFN database to determine the target storage block, the problem of inaccurate file fragment acquisition in existing technologies is solved, and the resource utilization efficiency of application startup is improved.
Patent Information
- Application Number
- CN202510997429.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-11-07
AI Technical Summary
Existing technologies cannot accurately capture the details required for process operation when acquiring application file fragments, and also consume additional system resources.
By responding to the application's startup event, the first execution parameters are obtained, the target storage block is determined using the structure array and the PFN database, and file fragments are accurately obtained based on the storage block information.
It enables precise acquisition of file fragments, reduces system resource consumption, and improves resource utilization efficiency during application startup.
Smart Images

Figure CN120909511A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of information technology, and in particular, to a data processing method, device and computer program product. BACKGROUND
[0002] In the starting process of an application, it is usually necessary to obtain file fragments required by the application, wherein the file fragments usually refer to code and / or resource fragments required to be loaded into the memory during the running of the application. The file fragments required by the application are obtained through related technologies, which not only cannot accurately capture specific details such as file fragments required in the process work, but also consume additional system resources. SUMMARY
[0003] To overcome the problems in the related art, the present disclosure provides a data processing method, device and computer program product, which can improve the accuracy of obtaining file fragments, reduce the additional consumption of system resources caused by monitoring and processing system-level events, and improve the resource utilization efficiency in the starting process of an application.
[0004] According to a first aspect of an embodiment of the present disclosure, a data processing method is provided, comprising:
[0005] In response to a first starting event of an application being triggered, obtaining a first execution parameter of a second starting event executed by the application, wherein the second starting event is triggered before the first starting event;
[0006] Based on the first execution parameter, determining a first target storage block from a current first array of structures;
[0007] Based on storage block information of the first target storage block, determining file fragments required for starting the application based on the first starting event.
[0008] According to a second aspect of an embodiment of the present disclosure, a data processing device is provided, comprising:
[0009] The obtaining module is configured to, in response to a first starting event of an application being triggered, obtain a first execution parameter of a second starting event executed by the application, wherein the second starting event is triggered before the first starting event;
[0010] The first determining module is configured to, based on the first execution parameter, determine a first target storage block from a current first array of structures;
[0011] The second determining module is configured to, based on storage block information of the first target storage block, determine file fragments required for starting the application based on the first starting event.
[0012] In a third aspect, an electronic device is provided, comprising:
[0013] a processor;
[0014] a memory for storing processor-executable instructions;
[0015] The processor executes the computer program or instructions to implement the steps of the method of any one of the first aspect.
[0016] According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, which stores computer programs or instructions, and when the computer programs or instructions in the storage medium are executed by a processor, the steps of the method of any one of the first aspect are implemented.
[0017] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, which includes computer programs or instructions, and when the computer programs or instructions are executed by a processor, the steps of the method of any one of the first aspect are implemented. The technical solutions provided by the embodiments of the present disclosure can include the following beneficial effects:
[0018] In the technical solutions of the present disclosure, by responding to the first starting event of triggering the application program, the first execution parameter of the second starting event before the first starting event is obtained, and the first target storage block is determined from the first array of structure bodies according to the first execution parameter, and then the file segment required for starting the application program based on the first starting event is determined based on the storage block information of the first target storage block.
[0019] In the first aspect, since the data in the first array of structure bodies can indicate specific details of the process work, by determining the first target storage block from the first array of structure bodies and determining the file segment required for starting the application program based on the storage block information of the first target storage block, the accurate acquisition of the file segment can be achieved. In the second aspect, compared with the way of determining the file segment by relying on the system event tracking mechanism or the system call function in the related art, the additional system resource consumption caused by monitoring and processing system-level events can be reduced, and the resource utilization efficiency in the application program starting process is improved.
[0020] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0021] The accompanying drawings, which are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0022] Figure 1is a flow chart of a data processing method according to an example embodiment.
[0023] Figure 2 is a schematic diagram of a target time window according to an example embodiment.
[0024] Figure 3 is a flow chart of another data processing method according to an example embodiment.
[0025] Figure 4 is a schematic diagram of determining file segments required for running a process according to an example embodiment.
[0026] Figure 5 is a block diagram of a data processing apparatus according to an example embodiment.
[0027] Figure 6 is a structural schematic diagram of an electronic device according to an example embodiment. DETAILED DESCRIPTION
[0028] The example embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements, unless otherwise indicated. The following description of example embodiments is not representative of all embodiments consistent with the present disclosure. Rather, it is merely an example of apparatus and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0029] In related art, Windows Event Tracing (ETW) is a high-performance event tracing mechanism in the Windows operating system, which is used to collect event information of system and application. ETW sets event providers in the system kernel and application, when a specific event occurs, the event provider sends event data to the event session, and the event session delivers the data to the event consumer for processing. ETW is mainly used to collect system-level event information, and may not be able to accurately capture the specific details of the file segments required in the process work. Because its original intention is to track the overall running state and performance indicators of the system, rather than focusing on the file operation details of a specific process, some key information may be missed when obtaining the file segments, resulting in inaccurate data.
[0030] Hook is a technology for intercepting and modifying system calls or function calls. Through Hook, custom code can be inserted into the process of system calls or function calls, so as to realize the monitoring and modification of the calling process. For example, file operation related system calls such as CreateFile, ReadFile, etc. can be Hooked to obtain the process operation information of the file. The implementation of Hook depends on the interception of specific calling paths, but the working process of the process may be very complex, involving multiple calling levels and different calling paths. If the Hook point is not properly selected or cannot cover all related calling paths, it may not be able to accurately obtain the required file fragments of the process, resulting in missing or error situations. Hook technology needs to insert additional code in the process of system calls or function calls, which will increase the complexity and execution time of the calls. Each call needs to go through the processing of the Hook code, which will consume additional CPU resources. In addition, in order to implement Hook, the memory layout, function pointers, etc. of the system may need to be modified and maintained, which also increases the memory overhead and resource consumption of the system.
[0031] The present disclosure provides a data processing method, Figure 1 is a flow chart of a data processing method according to an exemplary embodiment. As shown in the figure, the method mainly includes the following steps: Figure 1
[0032] In step 101, in response to a first start event of an application program, a first execution parameter of the application program executing a second start event is obtained, and the second start event is triggered before the first start event;
[0033] In step 102, based on the first execution parameter, a first target storage block is determined from the current first array of structures;
[0034] In step 103, based on the storage block information of the first target storage block, a file fragment required for starting the application program based on the first start event is determined.
[0035] It should be noted that the data processing method proposed in the present disclosure can be applied to electronic devices and servers. Here, the electronic device can include a terminal device, such as a mobile terminal or a fixed terminal. The mobile terminal can include a mobile phone, a tablet computer, a notebook computer, etc. The fixed terminal can include a desktop computer, a smart TV, etc. The server, as a kind of computer, can provide computing or application services for other clients (such as computers, smart phones, etc. terminal equipment or even large equipment such as train systems) in the network. Exemplarily, the data processing method of the present disclosure can be executed through the operating system of the electronic device, for example, it can be executed through the Android operating system.
[0036] The data processing method in the embodiments of the present disclosure can be configured in a data processing apparatus, which can be arranged in a server or an electronic device, and the embodiments of the present disclosure do not limit this.
[0037] It should be noted that the execution subject of the embodiments of the present disclosure can be, for example, a central processing unit (CPU) in a server or an electronic device in hardware, and can be, for example, a related background service in a server or an electronic device in software, and the present disclosure does not limit this.
[0038] During the starting process of the application program, the file fragments can include code and resource fragments that need to be loaded into the memory during the running of the application program. For example, the file fragments can include executable code of the application program, a dynamic link library (DLL), a configuration file, a resource file (such as an icon, a string, etc.), and the like.
[0039] In the embodiments of the present disclosure, in the case of triggering a first starting event of an application program, a first execution parameter of the application program executing a second starting event can be acquired. The second starting event is triggered before the first starting event, and the first execution parameter can include associated data of the application program executing the second starting event, for example, a starting duration of the application program executing starting based on the second starting event, a starting speed of the application program executing starting based on the second starting event, and the like.
[0040] It should be noted that the triggering of the second starting event means that the initiating action of the second starting event has occurred and the application program has been running, for example, a related process has received a starting instruction or meets a starting condition, and the corresponding application program or process has entered a running state, and thus the first execution parameter of the application program executing the second starting event can be acquired. In some embodiments, the first starting event and the second starting event can be two independent starting events, that is, the starting events triggered at different times for the same application program, for example, the first starting event is used to trigger the current starting of the application program, and the second starting event is used to trigger the last starting of the application program.
[0041] After the first execution parameter is acquired, the first target storage block can be determined from the current first array of structures based on the first execution parameter. It should be noted that the array of structures can include a global array of structures and a page frame number database (PFN database). The global array of structures is a global data structure in programming, used to store and share multiple structure data in the program scope, and the PFN database is a data structure used by the operating system to track virtual allocation storage blocks and manage storage blocks. The storage block is a memory area used by a program or operating system to store data. At the program level, it can be an element in the global array of structures, used to store specific structure data such as objects or data sets; at the operating system level, the storage block is an entry in the PFN database, representing a physical memory block allocated to a program or process, used to track its state and usage. For example, the storage block can be a physical page frame in the PFN database. The storage block can store code, data or resources in the program, and can be a part of the memory in the system for the program to use. When the program needs memory, the operating system will allocate it from the free storage block and recycle it to the free list after release.
[0042] The PFN database can record detailed information of the storage block in the current memory through a page frame number entry (PFN Entry). The PFN Entry is a structure in the Windows operating system for describing a physical page frame (Physical Page Frame). Each physical page frame has a unique number in memory, called the page frame number (PFN). The PFN Entry is an entry in the PFN database (PFN Database) that stores detailed information about the physical page frame. Since each PFN Entry records detailed information about each storage block in the current memory, the PFN database can be used to obtain the status of the storage block in the current memory, and to filter the required storage block from the PFN database, and then to confirm the file segment required to start the application based on the storage block information.
[0043] In the embodiments of the present disclosure, after the first execution parameter is acquired, the first target storage block can be determined from the first array of structures based on the first execution parameter, and the file segment required to start the application based on the first start event can be determined based on the storage block information of the first target storage block.
[0044] In the embodiments of the present disclosure, after the first execution parameter is acquired, the first target storage block can be determined from the first array of structure bodies based on the first execution parameter. For example, the first execution parameter can be parsed to extract key information in the first execution parameter, such as the startup duration, the startup speed, and the like of the application program based on the second startup event. Then, the key information in the first execution parameter is compared and matched with the PFN entries in the array of structure bodies to determine the storage block associated with the key information. For example, by analyzing the state and type of the memory storage block recorded in the PFN entry, the storage block with the access frequency greater than the preset frequency and / or the priority higher than the preset priority in the second startup event is found, so as to be determined as the first target storage block. Since the first target storage block determined based on this manner corresponds to the core executable code of the application program, the key DLL file, or the important resource file, and the like, the file segment determined based on the first target storage block can more ensure the normal startup of the application program.
[0045] In some embodiments, in a case where the first execution parameter includes the startup duration of the application program based on the second startup event, the first target storage block is determined from the current first array of structure bodies based on the first execution parameter, including:
[0046] loading the key file of the application program based on the first startup event;
[0047] determining a target time window based on the loading time of the key file and the startup duration;
[0048] determining, as the first target storage block, the storage block in the first array of structure bodies with the loading time in the target time window.
[0049] In the embodiments of the present disclosure, the key file of the application program based on the first startup event can be loaded, and the loading time of the key file can be determined. The key file can include the executable file, the dynamic link library (DLL), the configuration file, and the resource file of the application program, and the like. For example, the key file can be the dynamic link library loaded earliest in the process of starting the application program based on the first startup event.
[0050] The loading time can include the time when the file is loaded into the memory. By monitoring and recording the loading time of the key file, basic data can be provided for the subsequent determination of the time window. It should be noted that the loading time is a time point, which is used to indicate the time when the file is loaded into the memory. For example, a dynamic link library is loaded into the system memory at 14:30:00 on July 7, 2025, and the time point is the loading time of the file.
[0051] In some embodiments, the loading time can be determined based on a time stamp variable in the PFN entry, for example, the time stamp variable can be determined as the loading time, or the minimum value among all variable values can be determined as the loading time when the time stamp variable appears to be updated.
[0052] It should be noted that the time stamp (TimeStamp) variable in the PFN entry can be used to confirm the key data of the storage block, wherein the time stamp variable is related to the time when the file segment enters the memory, which can be in seconds as the time unit, and the time stamp variable can be used to indicate the time when the current storage block is last operated. If the application is in a cold start state, the time stamp variable can be used to indicate the time when the file segment on the current storage block first enters the memory.
[0053] For example, in the PFN entry, the time stamp variable records the time when the storage block is last accessed or modified. In the cold start process, the time stamp variable can be used to indicate the time when the file segment first enters the memory. In the case of cold start, the operating system will load the necessary files and data into the memory, at this time the storage block is accessed for the first time, and the time stamp variable is set to this time. After that, if the storage block is accessed or modified again, the time stamp variable will be updated to the latest time.
[0054] In the embodiments of the present disclosure, after the loading time of the key file is determined, the target time window can be determined based on the loading time and the startup duration of the application based on the second startup event. The startup duration refers to the total time from the triggering of the second startup event to the completion of the startup of the application. The target time window is a preset time range, which is used to filter out the first target storage block.
[0055] As shown in Figure 2 , the target time window can be constituted by taking the loading time as the reference and taking the startup duration as the duration. Taking the key file as the dynamic link library that is loaded earliest in the process of starting the application based on the first startup event as an example, the loading time of the key file can be the time of the dynamic link library that is loaded earliest in the process of starting the application based on the first startup event. In other embodiments, the loading time can be taken as the reference, and the startup duration can be adjusted to constitute the target time window. In some embodiments, the startup duration can be adjusted as needed, for example, the startup duration can be adjusted according to the type of the application, so that the determined target time window is more matched with the application.
[0056] After the target time window is determined, the storage blocks in the first structure array whose loading time is within the target time window are determined as the first target storage block.
[0057] Taking the dynamic link library that is the earliest loaded in the process of starting the application based on the first starting event as an example, all memory blocks that enter the memory in the process of starting the application based on the second starting event can be screened out based on the target time window, i.e., the first target memory block.
[0058] It should be noted that the files required in each starting process of the same application are the same. Based on the loading time of the key files of the application loaded in the first starting event and the starting duration of the application started based on the second starting event, the target time window can be determined, and the memory blocks in the first structure array can be screened based on the target time window to determine the first target memory block.
[0059] In some embodiments, the first target memory block is determined from the current first structure array based on the first execution parameter, including:
[0060] determining a reference list of the application;
[0061] determining a candidate memory block from the first structure array according to the target path in the reference list;
[0062] determining the first target memory block from the candidate memory block based on the first execution parameter.
[0063] Figure 3 is a flowchart of another data processing method according to an exemplary embodiment. As shown in Figure 3 the method mainly includes the following steps:
[0064] In step 301, the first structure array is parsed.
[0065] In step 302, all file information in the first structure array is obtained, the key files of the application loaded based on the first starting event are determined, and the loading time of the key files is determined.
[0066] In step 303, a candidate memory block is determined from the first structure array according to the target path in the reference list.
[0067] It should be noted that the reference list of the application can be equivalent to a whitelist mechanism, and the reference list includes the set target path, such as the installation path of the application, the plug-in directory (including the cache directory) of the application, and part of the system directory. By setting the target path, the memory blocks related to the application can be effectively screened out, and the interference of irrelevant memory blocks can be reduced.
[0068] Exemplarily, the candidate memory block can be determined from the first structure array according to the target path in the reference list, i.e., the memory block located in the specified path is determined.
[0069] In some embodiments, the method further comprises:
[0070] determining the target path based on the attribute information of the application and / or the installation parameter of the application, and storing the target path into the reference list of the application;
[0071] updating the reference list of the application based on a second execution parameter of performing the first starting event, in a case that the application is successfully started based on the first starting event.
[0072] In the present embodiment, the target path can be determined based on the attribute information of the application and / or the installation parameter of the application, and the target path can be stored into the reference list of the application. It should be noted that the attribute information of the application can include but is not limited to the type, use, and development manufacturer of the application, and the installation parameter can include configuration information generated in the installation process of the application. For example, the installation parameter can include the installation path, the plug-in directory, and the cache directory. Illustratively, the target path can be determined based on the attribute information of the application. Further illustratively, the target path can be determined based on the installation parameter of the application. Further illustratively, the target path can be determined based on the attribute information of the application and the installation parameter of the application.
[0073] In some embodiments, after obtaining the attribute information of the application, the attribute information of the application can be processed by preset rules and algorithms to determine the target path. For example, different path templates can be preconfigured for different attribute information of the application, and after the attribute information of the application is determined, the target path can be determined based on the attribute information of the application and the preconfigured path template. Illustratively, the path template can be preconfigured based on the type of the application, and in a case that the attribute information of the application is the type of the application, the target path can be determined based on the preconfigured path template. For example, for office software, the preconfigured path template can be C:\Program Files\<application name> or C:\Users\<username>\AppData\Roaming\<application name>.
[0074] In some embodiments, after obtaining the installation parameter of the application, the installation parameter of the application can be processed by preset rules and algorithms to determine the target path. Illustratively, the installation path can be parsed, and at least part of the installation path can be determined as the target path. For example, for the application App1, the target path can include the installation path (such as “C:\Program Files\App1”), the plug-in directory (such as “C:\Users<username>\AppData\Roaming\App1\Plugins”), and the cache directory.
[0075] In some embodiments, the attribute information and installation parameters of the application program can be processed by preset rules and algorithms to determine the target path. Illustratively, the target path determined based on the attribute information of the application program and the target path determined based on the installation parameters of the application program can be stored as target paths to the reference list.
[0076] By means of the attribute information of the application program and / or the installation parameters of the application program, the location range of the files related to the start of the application program can be preliminarily determined, and these paths can be stored as the initial reference list.
[0077] In the subsequent start process of the application program, after the application program is successfully started based on the first start event, the reference list of the application program can be updated based on the second execution parameter of executing the first start event. The second execution parameter can include the file path actually accessed in the start process, the access frequency, the loading time and the like. For example, if it is found that the application program accesses the files in a certain system directory more than a preset number of times when starting, or the access amount of the files in a certain plug-in directory is greater than a preset access amount, these paths can be added to the reference list to update the reference list. At the same time, for the paths in the reference list that are accessed less than a preset number of times in the start process or are no longer used, the priority of the path in the reference list can be reduced, or the path can be deleted from the reference list to update the reference list.
[0078] Through the technical solutions of the present disclosure, the reference list can dynamically adapt to the actual use of the application program, continuously optimize the accuracy and efficiency of pre-reading, and ensure that the necessary file segments can be more accurately pre-read in the subsequent start, so as to improve the start speed of the application program.
[0079] In step 304, a first target storage block is determined from the candidate storage blocks.
[0080] Here, after the candidate storage blocks are determined, the first target storage block can be selected and determined from the candidate storage blocks based on the first execution parameter, that is, the storage block that needs to be loaded by the application program in the subsequent start is obtained. Through the screening method of the white list mechanism, the accuracy and efficiency of pre-reading can be effectively improved, the waste of system resources can be reduced, and the pre-reading speed and performance can be ensured.
[0081] In the embodiments of the present disclosure, by analyzing the files loaded in the previous start process and the corresponding file segments, the file segments that the application program will need to read can be determined in advance before the next start. In this way, in the subsequent start process, the operating system can prepare and optimize the loading process of these files in advance, thereby improving the start efficiency of the application program.
[0082] In some embodiments, a PFN database snapshot can be acquired, and a first target storage block can be filtered from the first array of structures based on the PFN database snapshot. The PFN database snapshot refers to a record of the content of the PFN database at a certain time, which can be used for debugging and analyzing memory usage.
[0083] Taking the start time of the target time window as T1 and the end time as T2 as an example, after acquiring the PFN database snapshot, the disclosure can filter from the snapshot a storage block whose loading time is between T1 and T2 and satisfies at least one of the following conditions:
[0084] The target storage block is located in the paged pool;
[0085] The target storage block is located in the standby list;
[0086] The storage content of the target storage block satisfies a preset format;
[0087] The target storage block has been mapped to a target process.
[0088] It should be noted that in the memory management of the operating system, the paged pool (Paged Pool) is a memory pool in the kernel mode, used to store data that can be paged. The memory in the paged pool can be swapped to a paging file on the disk for reloading into the physical memory when needed. Through the paged pool, the operating system can more flexibly manage memory resources, especially when the physical memory is tight.
[0089] In the memory management of the Windows operating system, the memory region in standby refers to the storage block being in the standby list (Standby List). The standby list is used in the memory management of Windows to store storage blocks that have been released but still retain their contents. These storage blocks can be quickly reallocated to processes that need memory, thereby improving the performance of the system.
[0090] The storage content of the target storage block satisfying a preset format includes that the storage content of the target storage block is a file or an image. In memory management, a file can be mapped to memory for quick access to its content, which is called a memory-mapped file (Memory-Mapped File). Through the memory-mapped file, the content of the file can be directly read and written in memory without explicit file I / O operations, thereby improving performance. An image refers to the representation of an executable file (such as an.exe file) or a dynamic link library (DLL) in memory. When the operating system loads an executable file, it maps the content of the file to memory to form an image. This image contains the code and data of the program for the CPU to execute.
[0091] In an operating system, each process has its own virtual address space, while physical memory storage blocks are actual hardware memory units. In order to enable a process to access physical memory, the operating system needs to map virtual addresses to physical addresses. This mapping process is handled by a memory management unit (MMU). A target storage block having been mapped to a target process can include that the target storage block has been or has been mapped to the target process.
[0092] In the embodiments of the present disclosure, the target storage block can be obtained by taking a snapshot of the PFN database and screening the target storage block. The target storage block can be screened from the snapshot of the PFN database, which is loaded within a target time window (T1 to T2) and meets certain conditions. The conditions can include that the storage block is located in the paging pool or the standby list, the content conforms to a preset format (such as a file or an image), and has been mapped to the target process. Not only can the efficiency of memory be improved, but the operating system can also be allowed to flexibly manage resources when the memory is tight, to accelerate the startup speed of the application program, and to reduce unnecessary file I / O operations. The performance can be improved through the memory mapping file mechanism, and the process can quickly access the required physical memory storage block, thereby improving the overall system performance and user experience.
[0093] In step 305, based on the storage block information of the first target storage block, a file segment required for starting the application program based on the first startup event is determined.
[0094] In some embodiments, based on the storage block information of the first target storage block, the file segment required for starting the application program based on the first startup event is determined, including:
[0095] Based on the size of the first target storage block and the cluster size of the file system, the file segment required for starting the application program based on the first startup event is determined.
[0096] In the embodiments of the present disclosure, after the first target storage block is determined, the storage block information of the first target storage block can be obtained, including the size of the first target storage block, the memory address, and the like. In combination with the cluster size of the file system, the file name and the offset corresponding to the first target storage block can be found from the file cache information.
[0097] It should be noted that the offset refers to the starting position of the file segment in the file, the distance relative to the beginning of the file, and is usually measured in bytes. For example, if the offset of a file segment is 1024 bytes, it means that the file segment starts from the 1024th byte of the file. Through the offset, the part to be read in the file can be accurately located. The cluster size of the file system is the basic unit of storage space allocated by the file system, which can be fixed (such as 4KB, 8KB, etc.). The size of the first target storage block is also fixed (such as 4KB). Through the size of the first target storage block and the cluster size of the file system, the range of the segment to be read in the file can be determined. For example, if the size of the first target storage block is 4KB and the cluster size of the file system is also 4KB, then one first target storage block corresponds to one cluster, so that the starting position and length of the file segment can be directly determined. According to the correspondence between the first target storage block and the file cluster, combined with the offset, the exact position of the file segment can be calculated, so as to determine the file segment required for starting the application program.
[0098] Based on the calculation method of the size of the first target storage block, the cluster size of the file system, and the offset, the part to be loaded in the file can be accurately located, unnecessary data reading is avoided, and the starting efficiency is improved. At the same time, through the file name and the offset in the file cache information, the corresponding file segment can be quickly found, and the file loading process in the starting process is further optimized.
[0099] In step 306, the registry is output for use in the pre-reading stage.
[0100] In some embodiments, after determining the file segment required for starting the application program, a corresponding registry entry can be generated for use in the pre-reading stage. Illustratively, the determined file segment and the information related to the file segment are stored in a designated position in the registry. The information related to the file segment can include key data such as the path, offset, size, and priority of the file segment. Before entering the pre-reading stage, the operating system reads the registry entry and loads these file segments into the memory in advance according to the information related to the file segment in the registry.
[0101] The present disclosure can effectively reduce the disk I / O operation when starting the application program and improve the starting efficiency by loading the file segment in advance in the pre-reading stage.
[0102] In some embodiments, in the case where the application program is successfully started based on the first starting event, the method further comprises:
[0103] In response to the end of starting the application program, a second array of structures after the end of starting is determined;
[0104] The first structure array is updated based on the difference information between the first structure array and the second structure array, to obtain an updated first structure array.
[0105] Exemplarily, before the application program is started, a snapshot of the first structure array can be recorded, i.e., a state table containing all current memory storage block information. After the application program is started, a snapshot of the second structure array at this time is recorded again, and a state table containing all current memory storage block information is also formed. By comparing the changes in the storage block information in the two snapshots, such as adding a storage block, modifying a storage block, or releasing a storage block, the specific operations on the memory storage block during the starting of the application program can be identified. Then, the first structure array is updated based on the difference information, to reflect the changes in the memory storage block after the application program is started.
[0106] In this way, in subsequent starting of the application program, the updated first structure array can be used to more accurately predict and preload the required file segments. For example, when analyzing a virus sample, the initial state of the PFN database can be recorded before the sample is run, and the final state is recorded again after the sample is run. By comparing the differences between the two states, the system can identify the modifications of the memory storage block by the virus sample during the running process, and then update the PFN database, so that in subsequent analysis or processing, the behavior of similar samples can be more effectively identified and dealt with.
[0107] By updating the structure array in real time, the accuracy and real-time performance of the data in the structure array can be ensured, and the accuracy of the determined file segments can be improved.
[0108] In some embodiments, in a case where the application program is successfully started based on the first starting event, the method further includes:
[0109] In response to a third starting event of the application program being triggered, a second target storage block is determined from the updated first structure array based on a second execution parameter of executing the first starting event.
[0110] Based on the storage block information of the second target storage block, a file segment required for starting the application program based on the third starting event is determined.
[0111] In the embodiments of the present disclosure, in a case where the application program is successfully started based on the first starting event, if a third starting event of the application program is triggered again, in response to the third starting event of the application program being triggered, a second target storage block is determined from the updated first structure array based on a second execution parameter of executing the first starting event. Exemplarily, the second target storage block related to the third starting event is determined from the updated first structure array by using the relevant information in the second execution parameter, such as the starting duration, in combination with the latest storage block information in the updated first structure array.
[0112] After the second target storage block is determined, the file segment required for starting the application based on the third starting event can be determined based on the storage block information of the second target storage block. The storage block information generally includes the size, memory address, access frequency, etc. of the storage block, and by analyzing these information, the file segment required for starting the application can be accurately located.
[0113] Exemplarily, after the second target storage block is determined, the storage block information of the second target storage block can be obtained, including the size, memory address, etc. of the second target storage block. In combination with the cluster size of the file system, the file name and offset corresponding to the second target storage block can be found from the file cache information.
[0114] It should be noted that the offset refers to the starting position of the file segment in the file, the distance relative to the beginning of the file, and is generally measured in bytes. For example, if the offset of a file segment is 1024 bytes, it means that the file segment starts from the 1024th byte of the file. Through the offset, the part to be read in the file can be accurately located. The cluster size of the file system is the basic unit of storage space allocated by the file system, which can be a fixed size (such as 4KB, 8KB, etc.). The size of the second target storage block is also fixed (such as 4KB). Through the size of the second target storage block and the cluster size of the file system, the range of the file segment to be read in the file can be determined. For example, if the size of the second target storage block is 4KB and the cluster size of the file system is also 4KB, then one second target storage block corresponds to one cluster, so that the starting position and length of the file segment can be directly determined. According to the correspondence between the second target storage block and the file cluster, in combination with the offset, the accurate position of the file segment can be calculated, so as to determine the file segment required for starting the application.
[0115] Based on the size of the second target storage block, the cluster size of the file system, and the calculation method of the offset, the part to be loaded in the file can be accurately located, unnecessary data reading is avoided, and the starting efficiency is improved. At the same time, through the file name and offset in the file cache information, the corresponding file segment can be quickly found, further optimizing the file loading process in the starting process.
[0116] Through the implementation of the present disclosure, the first structure array is continuously updated and continuously optimized, so that the required file segment can be more efficiently preloaded at each start, and the starting efficiency is improved.
[0117] In some embodiments, during the process of starting the application program, there are multiple processes, and for each process of the application program, the file segment corresponding to the process is determined in the manner of any of the above embodiments, and then the file segment of the application program is obtained. For example, based on the storage block information of the first target storage block, the file segment required for starting the application program based on the first starting event is determined, including: for any process in the process of starting the application program, the file segment required for the process is determined based on the storage block information of the first storage block, and then the file segment required for starting the application program is determined.
[0118] As shown in Figure 4 If the file segment required for the process in the stage from P1 to P2 is needed, the start time (t1) of the stage and the completion time (t2) of the stage can be determined, and the first target storage block in the time period (target time window) is selected from the first structure array, and then the file segment required for running the process is determined based on the storage block information of the first target storage block, and then the file segment required for starting the application program is determined.
[0119] By determining the target time window of the file segment required for the process in a specific stage (from the start time t1 to the completion time t2), the first target storage block in the time period can be accurately selected from the first structure array, and the file segment required for running the process is determined based on the storage block information of the target storage block, and then the file segment required for starting the application program is determined based on the file segment required for running all processes.
[0120] In any of the above embodiments, the structure array is taken as an example of the page frame database, and the target page can be a target page, i.e., a target physical page frame.
[0121] In the first aspect, since the data in the first structure array can indicate the specific details of the process work, by determining the first target storage block from the first structure array and determining the file segment required for starting the application program based on the storage block information of the first target storage block, the accurate acquisition of the file segment can be realized; in the second aspect, compared with the manner of determining the file segment by relying on the system event tracking mechanism or the system call function in the related art, the additional system resource consumption caused by monitoring and processing system-level events can be reduced, and the resource utilization efficiency in the process of starting the application program is improved.
[0122] In some embodiments, after the file segment required for starting the application program is determined based on any of the above embodiments, the file segment required for starting the application program can be pre-read to the cache space to complete the pre-reading of the file segment.
[0123] In some embodiments, after determining the file segments required for starting the application based on the first start event, the method further comprises: loading the first file at the preset position in the input table of the application; in a case where loading of the system sub-file in the first file is completed, performing first initialization configuration by using the first initialization function of the first file; and in a case where the first initialization configuration is completed, pre-reading the file segments required for starting the application. Illustratively, after determining the file segments required for starting the application, in a case where there is a target component in the process of starting the application, the file segments are pre-read according to a pre-reading strategy. The pre-reading strategy comprises: loading the first file at the preset position in the input table of the application; in a case where loading of the system sub-file in the first file is completed, performing first initialization configuration by using the first initialization function of the first file; and in a case where the first initialization configuration is completed, pre-reading the file segments required for starting the application.
[0124] Illustratively, in a case where there is a target component in the process of starting the application, the first file at the preset position in the input table of the application is loaded; in a case where loading of the system sub-file in the first file is completed, first initialization configuration is performed by using the first initialization function of the first file; and in a case where the first initialization configuration is completed, the file segments required for starting the application are pre-read.
[0125] Here, after determining the file segments required for starting the application, a pre-reading strategy can be selected according to whether there is a target component in the starting process. The target component can also be referred to as an effective component, and can include a component having a preset function, for example, the target component can be a module having a key influence on the starting of the application or a module having a relatively high requirement for stability, and the target component can affect the dependency relationship and initialization process in the starting process. If there is a target component in the starting process, the file segments are pre-read according to the pre-reading strategy of the present application.
[0126] In some embodiments, different types of components have corresponding pre-reading strategies respectively. Illustratively, different types of components have different requirements for stability, and the corresponding pre-reading strategies are also different; and illustratively, different types of components have different importance for the starting of the application, and the corresponding pre-reading strategies are also different.
[0127] The present disclosure selects a corresponding pre-reading strategy according to whether there is a target component, so as to adapt to different starting scenarios, and can realize efficient pre-reading of the file segments required for starting the application. Not only can the starting efficiency of the application be improved, the time-consuming of the disk I / O operation can be reduced, and the user experience can be improved, but also various complex and changeable system environments and application starting requirements can be coped with.
[0128] In some embodiments, the pre-reading of the file segments required for starting the application into the cache space comprises: loading a first file located at a preset position in an input table of a process image file of the application; in a case where loading of a system sub-file in the first file is completed, performing a first initialization configuration by using a first initialization function in a preset callback table of the first file; in a case where the first initialization configuration is completed, pre-reading the file segments required for starting the application, and pre-reading the file segments required for starting the application into the cache space.
[0129] Figure 5 is a data processing device block diagram according to an exemplary embodiment. As shown in Figure 5 the data processing device 500 mainly comprises:
[0130] The acquisition module 501 is configured to, in response to a first starting event of an application, acquire a first execution parameter of a second starting event of the application, the second starting event being triggered before the first starting event;
[0131] The first determination module 502 is configured to determine a first target storage block from a current first structure array based on the first execution parameter;
[0132] The second determination module 503 is configured to determine a file segment required for starting the application based on the first starting event based on storage block information of the first target storage block.
[0133] In some embodiments, in a case where the first execution parameter comprises a starting duration of the application started based on the second starting event, the first determination module 502 is configured to:
[0134] load a key file of the application based on the first starting event;
[0135] determine a target time window based on the loading time and the starting duration;
[0136] determine a storage block in the first structure array whose loading time is within the target time window as the first target storage block.
[0137] In some embodiments, the first determination module 502 is configured to:
[0138] determine a reference list of the application;
[0139] determine a candidate storage block from the first structure array according to a target path in the reference list;
[0140] determine the first target storage block from the candidate storage block based on the first execution parameter.
[0141] In some embodiments, the apparatus 500 further comprises:
[0142] a third determining module configured to determine the target path based on the attribute information of the application program and / or the installation parameter of the application program, and store the target path to the reference list of the application program;
[0143] a first updating module configured to, in a case that the application program is successfully started based on the first starting event, update the reference list of the application program based on a second execution parameter of executing the first starting event.
[0144] In some embodiments, the second determining module 503 is configured to:
[0145] determine a file fragment required for starting the application program based on the first starting event based on the size of the first target storage block and the cluster size of the file system.
[0146] In some embodiments, in a case that the application program is successfully started based on the first starting event, the apparatus further comprises:
[0147] a fourth determining module configured to determine a second array of structures after the application program is started in response to the end of starting;
[0148] a second updating module configured to update the first array of structures based on difference information between the first array of structures and the second array of structures to obtain an updated first array of structures.
[0149] In some embodiments, in a case that the application program is successfully started based on the first starting event, the apparatus 500 further comprises:
[0150] a fifth determining module configured to, in response to triggering a third starting event of the application program, determine a second target storage block from the updated first array of structures based on a second execution parameter of executing the first starting event;
[0151] a sixth determining module configured to determine a file fragment required for starting the application program based on the third starting event based on storage block information of the second target storage block.
[0152] In some embodiments, the apparatus further comprises:
[0153] a loading module configured to load a first file at a preset position in an input table of the application program;
[0154] The initialization module is configured to perform first initialization configuration by using a first initialization function of the first file when loading of a system sub-file in the first file is completed.
[0155] The pre-reading module is configured to pre-read a file segment required by a starting application when the first initialization configuration is completed. In some embodiments, the target storage block satisfies at least one of the following conditions:
[0156] The target storage block is located in a paging pool.
[0157] The target storage block is located in a standby list.
[0158] The storage content of the target storage block satisfies a preset format.
[0159] The target storage block has been mapped to a target process.
[0160] As to the apparatus in the above embodiments, the specific manners in which the various modules perform operations have been described in detail in the embodiments of the method, and thus will not be described in detail here.
[0161] Based on the same inventive concept, the embodiments of the present disclosure provide an electronic device, which can be the computer or terminal in one or more of the above embodiments. Figure 6 is a structural schematic diagram of an electronic device according to an exemplary embodiment. As shown in Figure 6 The electronic device 600 adopts general computer hardware, and includes a processor 601, a memory 602, a bus 603, an input device 604 and an output device 605.
[0162] In some possible implementations, the memory 602 can include computer storage media in the form of volatile and / or non-volatile memory, such as read-only memory and / or random access memory. The memory 602 can store operating systems, application programs, other program modules, executable code, program data, user data, and the like.
[0163] The input device 604 can be used to input commands and information to the electronic device, and the input device 604 can be a keyboard or a pointing device, such as a mouse, a trackball, a touchpad, a microphone, a joystick, a game pad, a satellite television antenna, a scanner, or the like. The input device 604 can be connected to the processor 601 through the bus 603.
[0164] The output device 605 can be used for the electronic device 600 to output information, and in addition to a monitor, the output device 605 can also be other peripheral output devices, such as a speaker and / or a printing device. The output device 605 can also be connected to the processor 601 through the bus 603.
[0165] The electronic device 600 can be connected to a network, for example, a local area network (LAN), through the antenna 606. In a networked environment, executable instructions can be stored in a remote storage device, without being limited to being stored locally.
[0166] When the processor 601 in the electronic device 600 executes the executable code or application program stored in the memory 602, the electronic device 600 can implement the file processing method in the above embodiments, and the specific execution process is described above, which will not be repeated here.
[0167] The memory 602 described above can store executable instructions for implementing the functions of the acquisition module 501, the first determination module 502, and the second determination module 503 in the above embodiments. Figure 5 The memory 602 described above can store executable instructions for implementing the functions of the acquisition module 501, the first determination module 502, and the second determination module 503 in the above embodiments. Figure 5 The functions / implementation processes of the acquisition module 501, the first determination module 502, and the second determination module 503 in the above embodiments can be implemented by the processor 601 in the electronic device 600 calling the executable instructions stored in the memory 602, and the specific implementation process and functions are described above with reference to the related embodiments. Figure 6 The functions / implementation processes of the acquisition module 501, the first determination module 502, and the second determination module 503 in the above embodiments can be implemented by the processor 601 in the electronic device 600 calling the executable instructions stored in the memory 602, and the specific implementation process and functions are described above with reference to the related embodiments.
[0168] Based on the same inventive concept, the embodiments of the present disclosure also provide a storage medium. The storage medium stores instructions. When the instructions are run on a computer, the instructions are used to execute the data processing method in one or more of the above embodiments.
[0169] Based on the same inventive concept, the embodiments of the present disclosure also provide a computer program or computer program product. When the computer program product is executed on a computer, the computer program product causes the computer to implement the data processing method in one or more of the above embodiments.
[0170] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the aspects of the present disclosure disclosed herein. It is intended that the present disclosure cover any and all variations of the present disclosure that come within the scope of the claims and their equivalents. It is intended that the specification and examples be considered exemplary only, with the true scope and spirit of the disclosure indicated by the following claims.
[0171] It should be understood that the present disclosure is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present disclosure. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized by, The method comprises: in response to a first starting event of an application program, obtaining a first execution parameter of a second starting event of the application program, the second starting event being triggered before the first starting event; based on the first execution parameter, determining a first target storage block from a current first structure array; based on storage block information of the first target storage block, determining a file segment required for starting the application program based on the first starting event.
2. The method of claim 1, wherein, In a case where the first execution parameter comprises a starting duration of the application program based on the second starting event, the determining, based on the first execution parameter, of the first target storage block from the current first structure array comprises: loading a key file of the application program based on the first starting event; determining a target time window based on a loading time of the key file and the starting duration; determining, as the first target storage block, a storage block in the first structure array whose loading time is within the target time window.
3. The method of claim 1, wherein, The determining, based on the first execution parameter, of the first target storage block from the current first structure array comprises: determining a reference list of the application program; determining a candidate storage block from the first structure array according to a target path in the reference list; determining the first target storage block from the candidate storage block based on the first execution parameter.
4. The method of claim 3, wherein, The method further comprises: determining the target path based on attribute information of the application program and / or installation parameters of the application program, and storing the target path to the reference list of the application program; in a case where the application program is successfully started based on the first starting event, updating the reference list of the application program based on a second execution parameter of executing the first starting event.
5. The method of claim 1, wherein, The determining, based on the storage block information of the first target storage block, of the file segment required for starting the application program based on the first starting event comprises: determining the file segment required for starting the application program based on the first starting event based on a size of the first target storage block and a cluster size of a file system.
6. The method of claim 1, wherein, In a case where the application program is successfully started based on the first starting event, the method further comprises: in response to an end of starting of the application program, determining a second structure array after the end of starting; updating the first structure array based on difference information between the first structure array and the second structure array to obtain an updated first structure array.
7. The method of claim 6, wherein, In a case where the application program is successfully started based on the first starting event, the method further comprises: in response to a third starting event of the application program, determining a second target storage block from the updated first structure array based on the second execution parameter of executing the first starting event; determining a file segment required for starting the application program based on the third starting event based on storage block information of the second target storage block.
8. The method of claim 1, wherein, In a case where the application program is successfully started based on the first starting event, the method further comprises: loading a first file at a preset position in an input table of the application program; In a case that system sub-files in the first file are loaded completely, a first initialization configuration is performed by using a first initialization function of the first file; In a case that the first initialization configuration is completed, a file segment required by a starting application program is pre-read.
9. The method according to any one of claims 1 to 8, characterized in that, The target storage block satisfies at least one of the following conditions: The target storage block is located in a paging pool; The target storage block is located in a standby list; Storage content of the target storage block satisfies a preset format; The target storage block has been mapped to a target process.
10. A data processing apparatus, characterized by, Comprise: An acquisition module is configured to acquire a first execution parameter of a second starting event of an application program in response to a first starting event of the application program, the second starting event being triggered before the first starting event; A first determination module is configured to determine a first target storage block from a current first structure array based on the first execution parameter; A second determination module is configured to determine a file segment required by starting the application program based on the first starting event based on storage block information of the first target storage block.
11. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are executed by the processor to implement the steps of the method of any one of claims 1 to 9.