File reading method and device, equipment and storage medium

By combining and sequentially reading the target access files in smart electronic devices, the business process operation stability problem caused by abnormal disk input and output in smart electronic devices is solved, and the effect of improving file reading efficiency and stability is achieved.

CN120010770APending Publication Date: 2025-05-16SHENZHEN TCL NEW-TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510076803.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In smart electronic devices, the random read and write methods of UFS and eMMC memory chips lead to abnormal disk input and output, which affects the operation stability of business processes.

Method used

By responding to the file read request of the target business process, the target access file is obtained, and the initial file page is combined according to the file page offset interval and the preset grouping policy to generate a continuous file page combination. The target access files are then sequentially read according to the continuous file page combination and the read-ahead window size.

Benefits of technology

By adjusting file pre-reading method to sequential reading, the disk sequential reading performance is fully utilized, file reading efficiency is improved, and the probability of process unresponsive events caused by input and output blockage is reduced, thereby improving the operational stability of business processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010770A_ABST
    Figure CN120010770A_ABST
Patent Text Reader

Abstract

The invention provides a file reading method and device, equipment and a storage medium, and the file reading method comprises the steps: obtaining a target access file corresponding to a target business process in response to a file reading request for the target business process; and sequentially reading the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result. According to the technical scheme, the file pre-reading mode of the target business process can be adjusted into sequential reading through the predetermined continuous file page combination, so that the sequential reading performance of a disk is fully played, and the file reading efficiency is improved; and furthermore, the occurrence probability of process non-response events caused by input and output blockage of the target business process or other business processes is reduced, so that the operation stability of the target business process or other business processes is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a file reading method, device, equipment and storage medium. Background Art

[0002] At present, with the rapid development of the field of intelligent electronic devices, intelligent electronic devices can provide users with various business processes to meet business needs. However, in actual application, intelligent electronic devices may choose storage chips such as UFS (Universal Flash Storage) and eMMC (embedded MultiMediaCard) for cost and supply considerations. The storage read and write mode of such storage chips is usually random read and write, and this random read and write mode is limited by factors such as disk addressing, resulting in the inability to give full play to the disk performance, which may increase the IO (input / output) operation blocking of the intelligent electronic device, resulting in the business process waiting for the input and output operation to end. The process is unresponsive (i.e., Uninterruptible Sleep state), affecting the running stability of the business process. Summary of the invention

[0003] The embodiments of the present application provide a file reading method, device, equipment and storage medium, aiming to solve the technical problem in the prior art that the business process operation stability is poor due to disk input and output abnormalities.

[0004] On the one hand, an embodiment of the present application provides a file reading method, the file reading method comprising the following steps:

[0005] In response to a file read request for a target business process, obtaining a target access file corresponding to the target business process;

[0006] The target access file is sequentially read according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0007] In a possible implementation of the present application, before obtaining the target access file corresponding to the target service process, the method further includes:

[0008] Get each initial file page in the target access file;

[0009] The initial file pages are grouped and merged based on the file page offset interval of each initial file page and a preset grouping strategy to obtain a continuous file page combination of the target access file.

[0010] In a possible implementation of the present application, grouping and merging the initial file pages based on the file page offset interval of the initial file pages and a preset grouping strategy to obtain a continuous file page combination of the target access file includes:

[0011] Acquire file page information of each of the initial file pages according to a preset file loading point;

[0012] Calculating the file page offset interval of each of the initial file pages based on the file page offset in the file page information;

[0013] Determine the continuous file pages in each of the initial file pages according to the file page offset interval and a preset grouping strategy;

[0014] The continuous file pages are grouped and merged to obtain a combination of continuous file pages of the target access file.

[0015] In a possible implementation of the present application, determining the continuous file pages in each of the initial file pages according to the file page offset interval and a preset grouping strategy includes:

[0016] Obtaining a memory capacity value of a storage module corresponding to the target access file;

[0017] Calculate the offset interval threshold of each of the initial file pages according to the preset grouping strategy and the memory capacity value;

[0018] The initial file pages whose file page offset interval is less than or equal to the offset interval threshold are determined as continuous file pages.

[0019] In a possible implementation of the present application, after calculating the file page offset interval of each of the initial file pages based on the file page offset in the file page information, the method further includes:

[0020] Obtaining storage sector parameters and drive sector parameters of the storage module corresponding to the target access file;

[0021] Determining a target offset interval according to the storage sector parameters, the drive sector parameters and the file page size of the initial file page;

[0022] If the file page offset interval is greater than the target offset interval, the target offset interval is set as the file page offset interval of the initial file page.

[0023] In a possible implementation of the present application, sequentially reading the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain the file reading result includes:

[0024] Determine a target file page combination in a continuous file page combination according to a file page read identifier in the file read request and a file page number identifier in the continuous file group;

[0025] Acquire the number of target files in the target file page combination, and generate a pre-reading window size corresponding to the number of target files;

[0026] The target access file is sequentially read based on the pre-reading window size and the target file page combination to obtain a file reading result.

[0027] In a possible implementation of the present application, sequentially reading the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain the file reading result includes:

[0028] Identify a file reading scenario corresponding to the file reading request and a business process type of the target business process;

[0029] If the file reading scenario is the same as a preset target reading scenario and / or the business process type is the same as a preset sequential reading process type, determining that the file reading type of the file reading request is a sequential reading type;

[0030] The target access file is sequentially read based on the sequential read type, the continuous file page combination in the target access file and the pre-read window size corresponding to the continuous file page combination to obtain a file read result.

[0031] On the other hand, the present application provides a file reading device, the file reading device comprising:

[0032] A file access module is configured to respond to a file read request for a target business process and obtain a target access file corresponding to the target business process;

[0033] The sequential reading module is configured to sequentially read the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0034] On the other hand, the present application also provides a file reading device, the file reading device comprising:

[0035] one or more processors;

[0036] Memory; and

[0037] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps of the file reading method.

[0038] On the other hand, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in the file reading method.

[0039] In the present application, by responding to a file read request for a target business process, a target access file corresponding to the target business process is obtained; the target access file is sequentially read according to the continuous file page combination in the target access file and the pre-read window size corresponding to the continuous file page combination, to obtain a file read result. The target access file corresponding to the target business process is obtained when a file read request of a target business program is executed using a disk with lower performance, and the target access file is sequentially read according to a continuous file page combination composed of several continuous file pages pre-generated in the target access file and the pre-read window size corresponding to the continuous file page combination, to obtain a file read result. The file pre-reading mode of the target business process is adjusted to sequential reading through a predetermined continuous file page combination, thereby giving full play to the sequential reading performance of the disk, improving the file reading efficiency, and further reducing the probability of the target business process or other business processes causing a process non-response event due to input and output blocking, thereby improving the operation stability of the target business process or other business processes. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 A schematic diagram of a scenario of a file reading method according to an embodiment of the present application;

[0042] Figure 2 A flowchart of an embodiment of a file reading method in an embodiment of the present application;

[0043] Figure 3 A schematic diagram of a scenario in which a target accesses a file in a file reading method provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of a flow chart of an embodiment of determining continuous file pages in a file page to generate a continuous file page combination in a file reading method provided in an embodiment of the present application;

[0045] Figure 5 A flowchart of an embodiment of determining whether to sequentially read a target access file in a file reading method provided in an embodiment of the present application;

[0046] Figure 6 A schematic diagram of the structure of an embodiment of a file reading device provided in an embodiment of the present application;

[0047] Figure 7 A schematic diagram of the structure of an embodiment of a file reading device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0049] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0050] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.

[0051] At present, with the rapid development of the field of intelligent electronic devices, intelligent electronic devices can provide users with various business processes to meet business needs. However, in actual application, intelligent electronic devices may choose storage chips such as UFS (Universal Flash Storage) and eMMC (embedded MultiMediaCard) for cost and supply considerations. The storage read and write mode of such storage chips is usually random read and write, and this random read and write mode is limited by factors such as disk addressing, resulting in the inability to give full play to the disk performance, which may increase the IO (input / output) operation blocking of the intelligent electronic device, resulting in the business process waiting for the input and output operation to end. The process is unresponsive (i.e., Uninterruptible Sleep state), affecting the running stability of the business process.

[0052] Based on this, the present application proposes a file reading method, device, equipment and computer-readable storage medium to solve the technical problem in the prior art that the business process operation stability is poor due to disk input and output abnormalities.

[0053] The file reading method in the embodiment of the present invention is applied to a file reading device, which is arranged in a file reading device. The file reading device is provided with one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the file reading method; wherein the file reading device can be an intelligent terminal, such as a mobile phone, a tablet computer, a network device, and a smart computer; optionally, the file reading device can also be a server, or a service cluster composed of multiple servers.

[0054] like Figure 1 As shown, Figure 1 This is a scenario diagram of the file reading method in an embodiment of the present application. The file reading scenario in the embodiment of the present invention includes a file reading device 100 (a file reading device is integrated in the file reading device 100), and a computer-readable storage medium corresponding to the file reading method is running in the file reading device 100 to execute the steps of the file reading method.

[0055] Understandably, Figure 1 The file reading device in the file reading method scenario shown, or the devices included in the file reading device, does not constitute a limitation on the embodiments of the present invention, that is, the number and type of file reading devices included in the file reading method scenario, or the number and type of devices included in each device, do not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed to be protected in the embodiments of the present invention.

[0056] The file reading device 100 in the embodiment of the present invention is mainly used to: respond to a file reading request for a target business process and obtain a target access file corresponding to the target business process;

[0057] The target access file is sequentially read according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0058] The file reading device 100 in the embodiment of the present invention can be an independent file reading device, such as a smart terminal such as a mobile phone, a tablet computer, a network device, a server, and a smart computer, or it can be a file reading network or a file reading cluster composed of multiple file reading devices.

[0059] The embodiments of the present application provide a file reading method, apparatus, device and computer-readable storage medium, which are described in detail below.

[0060] It can be understood by those skilled in the art that Figure 1 The application environment shown in is only one of the application scenarios related to the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer file reading devices, or file reading network connection relationships shown, such as Figure 1 Only one file reading device is shown. It can be understood that the scenario of the file reading method can also include one or more file reading devices, which is not specifically limited here. The file reading device 100 can also include a memory for storing file data and other data.

[0061] It should be noted that Figure 1 The scenario diagram of the file reading method shown is only an example. The scenario of the file reading method described in the embodiment of the present invention is to more clearly illustrate the technical solution of the embodiment of the present invention, and does not constitute a limitation on the technical solution provided by the embodiment of the present invention.

[0062] Based on the scenario of the above-mentioned file reading method, various embodiments of the file reading method disclosed in the present invention are proposed.

[0063] like Figure 2 As shown, Figure 2 This is a flowchart of an embodiment of a file reading method in an embodiment of the present application. The file reading method includes the following steps 201 to 202:

[0064] 201. Respond to a file read request for a target business process and obtain a target access file corresponding to the target business process;

[0065] The file reading method in this embodiment is applied to a file reading device, and the type and quantity of the file reading device are not specifically limited, that is, the file reading device can be one or more intelligent electronic devices. In a specific embodiment, the file reading device is any intelligent electronic device such as a smart phone, a tablet computer, a smart TV, and a smart computer.

[0066] The target business process is a running process running in the file reading device and used to execute a specific business.

[0067] The target access file is a file to be accessed that is stored in a corresponding storage module in a file reading device and stores process data associated with a target business process. The target access file can contain at least one or more initial file pages. Optionally, in a specific embodiment, the initial file page is a kernel file page or other file page associated with the target business process or other processes. Figure 3 As shown, Figure 3 A schematic diagram of a scenario in which a target accesses a file in a file reading method provided in an embodiment of the present application. Figure 3 It can be seen that Figure 3 The three target access files associated with the target business process are shown in Figure 3 The target access file A, the target access file B and the target access file C in the target access file are shown in FIG. 1 ). Different target access files include a number of initial file pages. For example, the target access file A includes initial file pages from A1 to A13, the target access file B includes initial file pages from B1 to B13, and the target access file C includes initial file pages from C1 to C13.

[0068] Among them, Figure 3 As shown in the schematic diagram, the distances between different initial file pages in the target access file are different. Figure 3 The “.” symbol is used to represent the file page distances of different initial file pages, where the more “.” symbols there are, the farther the file page distances of the corresponding initial file pages are. Figure 3 In the illustrated embodiment, the distance between the initial file page A2 and the initial file page A4 is smaller than the distance between the initial file page B5 and the initial file page B7.

[0069] Optionally, in other embodiments, the target access file and the number of initial file pages in the target access file may be Figure 3 The arrangement of the same or different number of files is not specifically limited in this embodiment.

[0070] Specifically, during the operation of the file reading device, the business behavior of the existing target business process when accessing the target access file is difficult to predict, and the order in which the existing target business process accesses the target access file is difficult to limit. The access method of the target business process when accessing the target access file can be random access. Figure 3 In the embodiment shown, the target business process accesses the target file page in the following manner: A1->B7->C10->A5->B1->C1->A2->A4->B2->B3->B4->C2->C3->C4->C11->C13->B8->A6->A7. This random access method will result in the inability to effectively utilize the disk reading performance, causing the target business process or other related processes to experience a process unresponsiveness event due to input and output blocking.

[0071] Based on this, during operation, the file reading device responds to the file reading request triggered for the target business process, wherein the file reading request is an operation request for driving the file reading device to read the specified file information in the target access file associated with the target business process. The triggering method of the file reading request is not specifically limited here, that is, the file reading request can be actively triggered by the user, for example, the user can actively trigger the file reading operation corresponding to the target business process IO by clicking the operation button associated with the target business process in the file reading device. In addition, the file reading request can also be automatically triggered by the file reading device, for example, when the target business process in the file reading device executes the corresponding business behavior, it automatically triggers the file reading request corresponding to the business behavior.

[0072] Specifically, after obtaining the file reading request for the target business process, the file reading device determines the target access file to be read by the target business process according to the file reading request of the target business process.

[0073] Optionally, in a specific embodiment, when the file reading device obtains a file reading request, it also obtains the file reading scenario corresponding to the file reading request and the business process type of the target business process, and determines whether it is necessary to perform sequential reading on the target access file based on the file reading scenario and the business process type, thereby improving file reading efficiency.

[0074] 202. Sequentially read the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0075] Specifically, after obtaining the target access file to be read by the target business process and determining that the file reading request is a sequential read and write request, the file reading device also sequentially reads the target access file according to the continuous file page combination in the target access file and the pre-read window size corresponding to the continuous file page combination to obtain the file reading result of the target business process.

[0076] The continuous file page combination is a file page combination obtained from a specified initial file page combination determined as continuous file pages in the target access file.

[0077] The pre-read window size is the read range information of the data read window for pre-reading file data obtained by configuring the file system in the file reading device according to the combination of continuous file pages.

[0078] Specifically, in order to improve the file reading performance, the file reading device groups and merges the initial file pages in each target access file in advance before obtaining the file reading request for the target business process, thereby obtaining a continuous file page combination in each target access file. After obtaining the file reading request for each target business process, the file reading device can sequentially read the target file pages through the continuous file page combination, thereby enabling the target business process to issue IO faster, thereby reducing the probability of the target business process or other business processes becoming unresponsive due to input and output blocking.

[0079] Optionally, during the power-on operation, the file reading device obtains each initial file page in each target access file, and groups and merges the initial file pages based on the file page offset interval of each initial file page and the preset grouping strategy, and forms a continuous file page combination of the target access file, so as to update the target access file to an access file including a plurality of continuous file page combinations. The file page offset interval is an offset interval parameter that characterizes the file page offsets of each initial file page. The preset grouping strategy is a set of rule strategies that include continuous file page identification for u initial file pages and grouping of continuous file pages.

[0080] Specifically, after acquiring the target access file, the file reading device also acquires the file page information of each initial file page according to the preset file loading pile point. That is, the file reading device uses the preset file loading pile point to record the initial file page information corresponding to the target business process accessing the target access file in a specified time period or a specified business scenario. In a specific embodiment, the initial file page information includes a file device identifier, a file page number identifier, and a file page offset.

[0081] The file page offset is a parameter used to characterize the position of the initial file page in the target access file. In a specific embodiment, the file page offset is the number of bytes from the starting file position of the target access file to the initial file page position. The file page offset can identify the file page position of the initial file page in the target access file.

[0082] Specifically, after obtaining the file page offset in the initial file page information, the file reading device also calculates the file page offset interval between each initial file page according to the file page offset. That is, after obtaining the file page offset of each initial file page, the file reading device also calculates the file page offset difference between different initial file pages, and determines the file page offset difference between different initial file pages as the file page offset interval between each initial file page. The file page offset difference is a positive number greater than 0.

[0083] Specifically, after obtaining the corresponding file page offset interval between each initial file page, the file reading device also identifies the continuous file pages in each initial file page according to the file page offset interval and the preset grouping strategy, and groups and merges the identified continuous file pages, merging each continuous file page into a file page combination in the target access file to obtain a continuous file page combination.

[0084] Optionally, in a specific embodiment, after acquiring the file page offset interval, the file reading device further modifies the file page offset interval according to the target offset interval in the preset grouping strategy, and compares the modified file offset interval with the offset interval threshold in the preset grouping strategy to determine whether the initial file pages corresponding to each file page offset interval are continuous file pages. The continuous file pages are similar initial file pages whose file page offset intervals satisfy the preset grouping strategy.

[0085] Specifically, after generating a continuous file page combination in a target access file, the file reading device also obtains the number of target files in the continuous file page combination, wherein the number of target files is the number of continuous file pages in the continuous file page combination. After obtaining the continuous file page combination and the number of target files of the continuous file page combination, the file reading device also updates the target access file according to the continuous file page combination and the number of target files to obtain an updated target access file. Optionally, in a specific embodiment, the updated target access file includes:

[0086] Target access file A: continuous file page combination 1, target file number 1; continuous file page combination 2, target file number 2; continuous file page combination 3, target file number 3; ... continuous file page combination n, target file number n.

[0087] Target access file B: continuous file page combination 1, target file number 1; continuous file page combination 2, target file number 2; continuous file page combination 3, target file number 3; ... continuous file page combination n, target file number n.

[0088] Target access file B: continuous file page combination 1, target file number 1; continuous file page combination 2, target file number 2; continuous file page combination 3, target file number 3; ... continuous file page combination n, target file number n.

[0089] Specifically, after obtaining the updated target access file, the file reading device also responds to the file reading request for the target business process and obtains the target access file corresponding to the target business process. The file reading request is parsed to obtain the file page reading identifier in the file reading request, and the target file page combination in the continuous file page combination is determined according to the file page reading identifier and the file page number identifier in the continuous file group. The file page reading identifier is a file page identifier corresponding to the continuous file page to be read by the target business process. The target file page combination is a continuous file page combination for which the target business process is to perform a file page reading operation in this file reading request.

[0090] Specifically, after obtaining the file page read identifier, the file reading device compares the file page read identifier with the file page number identifier in each continuous file group. If the file page read identifier and the file page number identifier are the same, the continuous file page combination corresponding to the file page identifier is determined as the target file page combination hit by the file read request.

[0091] Specifically, after obtaining the target file page combination hit by the file read request, the file reading device also obtains the number of target files in the target file page combination, and configures the pre-reading window size according to the number of target files, that is, after determining the target file page combination to be read, the file reading device sets the file pre-reading window corresponding to the window size of the file pre-reading system to the number of target files of the target file page combination, and obtains the pre-reading window size. The pre-reading window size is the same as the number of target files.

[0092] Specifically, after obtaining the pre-reading window size and the target file page combination, the file reading device sequentially reads the target access file based on the pre-reading window size and the target file page combination to obtain the file reading result. That is, the file reading device reads the continuous file pages in the target file page combination in each target access file according to each target file page combination and the corresponding pre-reading window size, thereby realizing sequential reading of each target access file, so as to improve the IO delivery efficiency of the target business process and avoid the process unresponsiveness event caused by the input and output blocking of the target business process or other business processes.

[0093] Optional, in Figure 3 In the specific embodiment shown, the file reading device determines the continuous file page combination in the target access file through the file page offset interval and the preset grouping strategy, and determines the target file page combination to be read in the continuous file page combination through the file page reading identifier in the file reading request, and then reads the target file page combination in the target access file, thereby realizing sequential reading of each target access file, and pre-reading the target file page combination that will be accessed by the subsequent target business process in advance, thereby reducing the duration of the target business process entering the UninterruptibleSleep (IO) waiting state in the target business scenario as a whole. Among them, in a specific embodiment, the file reading device sequentially reads each target access file in a sequential access order as follows:

[0094] A1->A2->A4->B7->B8->C10->C11->C13->A5->A6->A7->B1->B2->B3->B4->C1->C2->C3->C4.

[0095] Among them, A1->A2->A4 and A5->A6->A7 are target file page combinations in target access file A respectively; B7->B8 and B1->B2->B3->B4 are target file page combinations in target access file B respectively; C10->C11->C13 and C1->C2->C3->C4 are target file combinations in target access file C respectively.

[0096] In this embodiment, the file reading device obtains the target access file corresponding to the target business process by responding to the file reading request for the target business process; the target access file is sequentially read according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain the file reading result. When the file reading request of the target business program is executed by using a disk with lower performance, the target access file corresponding to the target business process is obtained, and the target access file is sequentially read according to the continuous file page combination composed of several continuous file pages pre-generated in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain the file reading result. The file pre-reading mode of the target business process is adjusted to sequential reading through the predetermined continuous file page combination, so as to give full play to the sequential reading performance of the disk, improve the file reading efficiency, and then reduce the probability of the target business process or other business processes causing the process to be unresponsive due to input and output blocking, thereby improving the operation stability of the target business process or other business processes.

[0097] like Figure 4 As shown, Figure 4This is a flowchart of an embodiment of determining continuous file pages in a file page to generate a continuous file page combination in a file reading method provided in an embodiment of the present application. Specifically, in this embodiment, the file reading method further includes steps 301 to 303:

[0098] 301. Obtain the memory capacity value of the storage module corresponding to the target access file;

[0099] 302. Calculate the offset interval threshold of each of the initial file pages according to the preset grouping strategy and the memory capacity value;

[0100] 303. Determine the initial file pages whose file page offset interval is less than or equal to the offset interval threshold as continuous file pages.

[0101] Based on the above embodiments, in this embodiment, after receiving a file read request and before sequentially reading the continuous file combination and the pre-reading window size associated with the file read request, the file reading device also identifies the continuous file pages in each initial file page according to the file page offset interval between the initial file pages and the preset grouping strategy, and groups and merges the identified continuous file pages, merging each continuous file page into a file page combination in the target access file to obtain a continuous file page combination.

[0102] Specifically, before sequentially reading and writing the target access file page, the file reading device also obtains the memory capacity value (unit: Gigabyte, GB) of the storage module corresponding to the target access file. The content capacity value represents the available memory size of the storage module where the target access file is located.

[0103] Specifically, after obtaining the memory capacity value, the file reading device also calculates the offset interval threshold for detecting whether each initial file page is a similar continuous file page according to the preset grouping strategy and the memory capacity value. That is, the file reading device obtains the offset interval threshold algorithm in the preset grouping strategy, and inputs the memory capacity value into the offset interval algorithm to obtain the offset interval threshold. Optionally, in a specific embodiment, the offset interval threshold algorithm expression is: offset threshold interval = capacity coefficient * memory capacity value - offset constant. Among them, the capacity coefficient and the offset constant are constants that are customized according to the actual business scenario requirements. For example, in a specific embodiment, the capacity coefficient is set to 0.5, and the offset constant is set to 1. At this time, the offset threshold interval = 0.5 * content capacity value - 1.

[0104] Optionally, after obtaining the file page offset interval and the offset threshold interval, the file reading device further modifies the file page offset interval according to the target offset interval in the preset grouping strategy, and compares the modified file offset interval with the offset interval threshold in the preset grouping strategy to determine whether the initial file pages corresponding to each file page offset interval are continuous file pages. The continuous file pages are similar initial file pages whose file page offset intervals satisfy the preset grouping strategy.

[0105] Specifically, the file reading device obtains the storage sector parameter and the drive sector parameter of the storage module corresponding to the target access file, wherein the storage sector parameter is the maximum single IO size parameter supported by the file reading device. The drive sector parameter is the maximum single IO size parameter supported by the kernel driver of the file reading device. Optionally, in a specific embodiment, the storage sector parameter is the max_hw_sectors_kb parameter; the drive sector parameter is the max_sectors_kb parameter.

[0106] Specifically, when the file reading device obtains the storage sector parameters and the drive sector parameters, it also obtains the file page size of each initial file page, and determines the target offset interval according to the file page size, the storage sector parameters and the drive sector parameters. That is, the file reading device obtains the target offset interval algorithm in the preset grouping strategy, and determines the target offset interval corresponding to the initial file page in each target access file according to the file page size, the storage sector parameters, the drive sector parameters and the target offset interval algorithm. Optionally, in a specific embodiment, the target offset interval algorithm expression is:

[0107] Target offset interval = min(max_hw_sectors_kb, max_sectors_kb) / PAGE_SIZE, where PAGE_SIZE is the file page size.

[0108] That is, the file reading device compares the parameter sizes of the storage sector parameter and the drive sector parameter in advance, and determines the ratio of the smaller storage sector parameter or the drive sector parameter to the file page size as the target offset interval, wherein the target offset interval is the maximum file page offset interval between the initial file pages in the target access file.

[0109] Specifically, after acquiring the target offset interval, the file reading device compares the target offset interval with the file page offset interval of each initial file page, and corrects the file page offset interval according to the comparison result to obtain a corrected file page offset interval.

[0110] Optionally, if the file reading device determines that the file page offset interval is smaller than the target offset interval, it is determined that the file page offset interval meets the preset grouping strategy requirements, and there is no need to correct the file page offset interval.

[0111] Optionally, if the file reading device determines that the file page offset interval is greater than the target offset interval, the file reading device sets the target offset interval as a new file page offset interval of the initial file page.

[0112] Specifically, after obtaining the corrected file page offset interval, the file page reading device also compares the file page offset interval with the offset interval threshold to determine whether the initial file pages corresponding to the file page offset interval are continuous file pages with similar file page positions.

[0113] Optionally, if the file page offset interval is less than or equal to the offset interval threshold, the file page reading device determines that the file page positions between the initial file pages corresponding to the file page offset interval are close, and determines the initial file pages whose file page offset interval is less than or equal to the offset interval threshold as continuous file pages.

[0114] Specifically, after the file page reading device identifies the continuous file pages in the initial file pages corresponding to each target access file, it groups and merges the identified continuous file pages, merges the continuous file pages into a file page combination in the target access file, obtains a continuous file page combination, and in subsequent steps, sequentially reads the required file information according to the continuous file page combination, so as to improve the IO issuance efficiency of the target business process and avoid process unresponsiveness events caused by input and output blocking of the target business process or other business processes.

[0115] In this embodiment, the file page reading device obtains the memory capacity value of the storage module corresponding to the target access file; calculates the offset interval threshold of each of the initial file pages according to the preset grouping strategy and the memory capacity value; and determines the initial file pages whose file page offset interval is less than or equal to the offset interval threshold as continuous file pages. The continuous file page identification and merging of the initial file pages in the target access file are realized to obtain a continuous file page combination, and the target access file is sequentially read through the continuous file page combination to improve the file reading efficiency of the target business process.

[0116] like Figure 5 As shown, Figure 5 This is a flowchart of an embodiment of determining whether to sequentially read a target access file in a file reading method provided in an embodiment of the present application. Specifically, in this embodiment, the file reading method further includes steps 401 to 403:

[0117] 401. Identify a file reading scenario corresponding to the file reading request and a business process type of the target business process;

[0118] 402. If the file reading scenario is the same as a preset target reading scenario and / or the business process type is the same as a preset sequential reading process type, determining that the file reading type of the file reading request is a sequential reading type;

[0119] 403. Sequentially read the target access file based on the sequential read type, the continuous file page combination in the target access file, and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0120] Based on the above embodiments, in this embodiment, after receiving a file read request, the file reading device also identifies the file reading scenario corresponding to the file read request and the business process type of the target business process. The file reading scenario is business scenario information that characterizes the business action of the target business process corresponding to the file read request. For example, the file reading scenario can be an audio and video playback scenario, a game high-load scenario, a system interaction scenario, and other file reading scenarios. The business process type is a process type identifier that characterizes the target business process. Optionally, the business process type can be a first process type and a second process type. The first process type is a business process type that characterizes the process interaction of the target business process as a lower priority. The second process type is a business process type that characterizes the process interaction of the target business process as a higher priority. The file reading device determines the second process type as a sequential business type to be read sequentially.

[0121] Specifically, after obtaining the file reading scenario and business process type, the file reading device also compares the file reading scenario with the preset target reading scenario, and compares the business process type with the preset sequential reading business type, so as to judge the file reading type of the file reading request based on the comparison result, and then determine whether it is necessary to perform a sequential reading operation on the target access file corresponding to the file reading request based on the file reading type.

[0122] Optionally, if the file reading scenario is the same as a preset target reading scenario and / or the business process type is the same as a preset sequential reading process type, the file reading device determines that the file reading type of the file reading request is a sequential reading type. The target reading scenario is a file reading scenario that characterizes a high demand for file reading efficiency. For example, in a specific embodiment, the file reading device determines the audio and video playback scenario, the game high-load scenario, and other application scenarios with high demand for file reading efficiency as target reading scenarios.

[0123] Optionally, if the file reading scenario is different from the preset target reading scenario and / or the business process type is different from the preset sequential reading process type, the file reading device determines that the file reading type of the file reading request is a normal reading type, and then pre-reads the target access file in a random access manner to obtain a file reading result.

[0124] Specifically, after the file reading device determines that the file reading type of the file reading request is a sequential reading type, it sequentially reads the target access file based on the sequential reading type, the continuous file page combination in the target access file, and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0125] In this embodiment, the file reading device identifies the file reading scenario corresponding to the file reading request and the business process type of the target business process; if the file reading scenario is the same as the preset target reading scenario and / or the business process type is the same as the preset sequential reading process type, the file reading type of the file reading request is determined to be a sequential reading type; based on the sequential reading type, the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination, the target access file is sequentially read to obtain a file reading result. The file reading type of the file reading request is identified by the file reading scenario and the business process type, and after determining that the file reading type is a sequential reading type, the target file page combination in the target access file is sequentially accessed according to the sequential reading type, thereby selecting the corresponding file reading method for different file reading requirements, improving file access efficiency and reducing system resources consumed by file reading.

[0126] In order to better implement the file reading method in the embodiment of the present application, based on the file reading method, the embodiment of the present application also provides a file reading device, such as Figure 6 As shown, Figure 6 The present invention provides a schematic diagram of the structure of an embodiment of a file reading device. Specifically, the file reading device 500 includes:

[0127] The file access module 501 is configured to respond to a file read request for a target business process and obtain a target access file corresponding to the target business process;

[0128] The sequential reading module 502 is configured to sequentially read the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0129] In a possible implementation of this embodiment, before the file reading device obtains the target access file corresponding to the target service process, the method further includes:

[0130] Get each initial file page in the target access file;

[0131] The initial file pages are grouped and merged based on the file page offset interval of each initial file page and a preset grouping strategy to obtain a continuous file page combination of the target access file.

[0132] In a possible implementation of this embodiment, the file reading device groups and merges the initial file pages based on the file page offset interval of each initial file page and a preset grouping strategy to obtain a continuous file page combination of the target access file, including:

[0133] Acquire file page information of each of the initial file pages according to a preset file loading point;

[0134] Calculating the file page offset interval of each of the initial file pages based on the file page offset in the file page information;

[0135] Determine the continuous file pages in each of the initial file pages according to the file page offset interval and a preset grouping strategy;

[0136] The continuous file pages are grouped and merged to obtain a combination of continuous file pages of the target access file. In a possible implementation of this embodiment, the file reading device determines the continuous file pages in each of the initial file pages according to the file page offset interval and a preset grouping strategy, including:

[0137] Obtaining a memory capacity value of a storage module corresponding to the target access file;

[0138] Calculate the offset interval threshold of each of the initial file pages according to the preset grouping strategy and the memory capacity value;

[0139] The initial file pages whose file page offset interval is less than or equal to the offset interval threshold are determined as continuous file pages.

[0140] In a possible implementation of this embodiment, after the file reading device calculates the file page offset interval of each of the initial file pages based on the file page offset in the file page information, it further includes:

[0141] Obtaining storage sector parameters and drive sector parameters of the storage module corresponding to the target access file;

[0142] Determining a target offset interval according to the storage sector parameters, the drive sector parameters and the file page size of the initial file page;

[0143] If the file page offset interval is greater than the target offset interval, the target offset interval is set as the file page offset interval of the initial file page.

[0144] In a possible implementation of this embodiment, the file reading device sequentially reads the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result, including:

[0145] Determine a target file page combination in a continuous file page combination according to a file page read identifier in the file read request and a file page number identifier in the continuous file group;

[0146] Acquire the number of target files in the target file page combination, and generate a pre-reading window size corresponding to the number of target files;

[0147] The target access file is sequentially read based on the pre-reading window size and the target file page combination to obtain a file reading result.

[0148] In a possible implementation of this embodiment, the file reading device sequentially reads the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result, including:

[0149] Identify a file reading scenario corresponding to the file reading request and a business process type of the target business process;

[0150] If the file reading scenario is the same as a preset target reading scenario and / or the business process type is the same as a preset sequential reading process type, determining that the file reading type of the file reading request is a sequential reading type;

[0151] The target access file is sequentially read based on the sequential read type, the continuous file page combination in the target access file and the pre-read window size corresponding to the continuous file page combination to obtain a file read result.

[0152] In this embodiment, the file reading device obtains the target access file corresponding to the target business process by responding to the file reading request for the target business process; the target access file is sequentially read according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain the file reading result. When the file reading request of the target business program is executed by using a disk with lower performance, the target access file corresponding to the target business process is obtained, and the target access file is sequentially read according to the continuous file page combination composed of several continuous file pages pre-generated in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain the file reading result. The file pre-reading mode of the target business process is adjusted to sequential reading through the predetermined continuous file page combination, so as to give full play to the sequential reading performance of the disk, improve the file reading efficiency, and further reduce the probability of the target business process or other business processes causing the process to be unresponsive due to input and output blocking, thereby improving the operation stability of the target business process or other business processes.

[0153] The embodiment of the present invention also provides a file reading device, such as Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of an embodiment of a file reading device provided in an embodiment of the present application.

[0154] The file reading device integrates any one of the file reading devices provided by the embodiments of the present invention, and the file reading device includes:

[0155] one or more processors;

[0156] Memory; and

[0157] One or more applications, wherein the one or more applications are stored in the memory and are configured so that the processor executes the steps of the file reading method described in any of the above file reading method embodiments.

[0158] Specifically, the file reading device may include one or more processing core processors 601, one or more computer-readable storage media memories 602, a power supply 603, an input unit 604 and other components. Those skilled in the art will understand that Figure 7 The structure of the document reading device shown in the figure does not constitute a limitation on the document reading device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0159] The processor 601 is the control center of the file reading device. It uses various interfaces and lines to connect various parts of the entire file reading device. By running or executing software programs and / or modules stored in the memory 602 and calling data stored in the memory 602, it executes various functions of the file reading device and processes data, thereby monitoring the file reading device as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.

[0160] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of a file reading device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0161] The file reading device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0162] The document reading device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0163] Although not shown, the file reading device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 601 in the file reading device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby realizing various functions, as follows:

[0164] In response to a file read request for a target business process, obtaining a target access file corresponding to the target business process;

[0165] The target access file is sequentially read according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0166] To this end, an embodiment of the present invention provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any file reading method provided in an embodiment of the present invention. For example, the computer program can be loaded by a processor to execute the following steps:

[0167] In response to a file read request for a target business process, obtaining a target access file corresponding to the target business process;

[0168] The target access file is sequentially read according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

[0169] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0170] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.

[0171] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0172] The above is a detailed introduction to a file reading method provided in an embodiment of the present application. Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A file reading method, characterized in that: The file reading method comprises: In response to a file read request for a target business process, obtaining a target access file corresponding to the target business process; The target access file is sequentially read according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

2. The file reading method according to claim 1, characterized in that: Before obtaining the target access file corresponding to the target business process, the method further includes: Get each initial file page in the target access file; The initial file pages are grouped and merged based on the file page offset interval of each initial file page and a preset grouping strategy to obtain a continuous file page combination of the target access file.

3. The file reading method according to claim 2, characterized in that: The grouping and merging of the initial file pages based on the file page offset interval of the initial file pages and the preset grouping strategy to obtain a continuous file page combination of the target access file includes: Acquire file page information of each of the initial file pages according to a preset file loading point; Calculate the file page offset interval of each of the initial file pages based on the file page offset in the file page information; Determine the continuous file pages in each of the initial file pages according to the file page offset interval and a preset grouping strategy; The continuous file pages are grouped and merged to obtain a combination of continuous file pages of the target access file.

4. The file reading method according to claim 3, characterized in that: The determining of the continuous file pages in each of the initial file pages according to the file page offset interval and the preset grouping strategy includes: Obtaining a memory capacity value of a storage module corresponding to the target access file; Calculate the offset interval threshold of each of the initial file pages according to the preset grouping strategy and the memory capacity value; The initial file pages whose file page offset interval is less than or equal to the offset interval threshold are determined as continuous file pages.

5. The file reading method according to claim 3, characterized in that: After calculating the file page offset interval of each of the initial file pages based on the file page offset in the file page information, the method further includes: Obtaining storage sector parameters and drive sector parameters of the storage module corresponding to the target access file; Determining a target offset interval according to the storage sector parameters, the drive sector parameters and the file page size of the initial file page; If the file page offset interval is greater than the target offset interval, the target offset interval is set as the file page offset interval of the initial file page.

6. The file reading method according to any one of claims 1 to 5, characterized in that: The step of sequentially reading the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain the file reading result includes: Determine a target file page combination in a continuous file page combination according to a file page read identifier in the file read request and a file page number identifier in the continuous file group; Acquire the number of target files in the target file page combination, and generate a pre-reading window size corresponding to the number of target files; The target access file is sequentially read based on the pre-reading window size and the target file page combination to obtain a file reading result.

7. The file reading method according to claim 1, characterized in that: The step of sequentially reading the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain the file reading result includes: Identify a file reading scenario corresponding to the file reading request and a business process type of the target business process; If the file reading scenario is the same as a preset target reading scenario and / or the business process type is the same as a preset sequential reading process type, determining that the file reading type of the file reading request is a sequential reading type; The target access file is sequentially read based on the sequential read type, the continuous file page combination in the target access file and the pre-read window size corresponding to the continuous file page combination to obtain a file read result.

8. A file reading device, characterized in that: The file reading device comprises: A file access module is configured to respond to a file read request for a target business process and obtain a target access file corresponding to the target business process; The sequential reading module is configured to sequentially read the target access file according to the continuous file page combination in the target access file and the pre-reading window size corresponding to the continuous file page combination to obtain a file reading result.

9. A file reading device, characterized in that: The file reading device comprises: one or more processors; Memory; and One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the processor to implement the steps of the file reading method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps of the file reading method according to any one of claims 1 to 7.

Citation Information

Cited By

  • File reading method, apparatus and device, and storage medium

    WO2026152893A1