Data processing method and device, electronic equipment and computer medium

By allocating storage space in terminal devices, judging and giving priority to the use of core files of the operating system, the problem of operating system instability caused by insufficient storage space is solved, and the stability and reliability of the system are improved.

CN120020740APending Publication Date: 2025-05-20BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311546049.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2025-05-20

AI Technical Summary

Technical Problem

Insufficient storage space for terminal devices such as mobile phones and tablets leads to unstable operating system operation and may even lead to crashes or crashes.

Method used

By dividing the total storage space capacity of the terminal device into the first storage space capacity available to all files and the second storage space capacity reserved for the operating system operation, it is determined whether the target file is a core file, and if necessary, the total storage space capacity is used for the core file to avoid it being occupied by other files.

Benefits of technology

It effectively improves the operating stability of the operating system, reduces the probability of crashes and crashes, and ensures normal reading and writing of core files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120020740A_ABST
    Figure CN120020740A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, electronic equipment and a computer medium, and the method comprises the steps: obtaining a target storage space capacity required by target data and a currently available first storage space capacity in response to a received write-in instruction for indicating to write the target data into a target file, the first storage space capacity is partial storage space capacity in the available storage space total capacity; when the target storage space capacity is greater than the first storage space capacity, determining whether the target file is a core file required by the operation of the operating system or not based on the write-in instruction; if yes, whether the target storage space capacity is larger than the total storage space capacity or not is determined; and when determining that the target storage space capacity is not greater than the total storage space capacity, determining to execute a writing instruction to write the target data into the target file. According to the technical scheme provided by the embodiment of the invention, the operation stability of the operation system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure belongs to the technical field of operating systems, and particularly relates to a data processing method, apparatus, electronic device, and computer medium. Background Art

[0002] The storage space capacity of terminal devices such as mobile phones and tablet computers is limited. As the related functions of application programs become more and more complex, the files of some application programs and the files required for the operation of the operating system will occupy a large amount of storage space. As a result, the storage space of the terminal device may be insufficient, making it impossible to read and write the core files required for the normal operation of the operating system, and even causing the operating system to crash and the terminal device to freeze, resulting in low stability of the system operation. Summary of the Invention

[0003] Embodiments of the present disclosure provide an implementation different from the related art to solve the technical problem of low stability of the operating system operation in the related art.

[0004] In a first aspect, the present disclosure provides a data processing method applied to a terminal device, including:

[0005] In response to receiving a write instruction for instructing to write target data to a target file, obtaining the target storage space capacity required for the target data and the current available first storage space capacity, where the first storage space capacity is a part of the total available storage space capacity;

[0006] When the target storage space capacity is greater than the first storage space capacity, based on the write instruction, determining whether the target file is a core file required for the operation of the operating system; if so, determining whether the target storage space capacity is greater than the total storage space capacity;

[0007] When it is determined that the target storage space capacity is not greater than the total storage space capacity, determining to execute the write instruction to write the target data to the target file.

[0008] In a second aspect, the present disclosure provides a data processing apparatus, including:

[0009] An obtaining unit, configured to, in response to receiving a write instruction for instructing to write target data to a target file, obtain the target storage space capacity required for the target data and the current available first storage space capacity, where the first storage space capacity is a part of the total available storage space capacity;

[0010] A determination unit, configured to, when the target storage space capacity is greater than the first storage space capacity, determine, based on the write instruction, whether the target file is a core file required for the operation of the operating system, and if so, determine whether the target storage space capacity is greater than the total storage space capacity;

[0011] An execution unit, configured to, when it is determined that the target storage space capacity is not greater than the total storage space capacity, determine to execute the write instruction to write the target data into the target file.

[0012] In a third aspect, the present disclosure provides an electronic device, including:

[0013] A processor; and a memory for storing executable instructions of the processor;

[0014] Wherein, the processor is configured to execute any method in the first aspect and each possible implementation manner of the first aspect by executing the executable instructions.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements any method in the first aspect and each possible implementation manner of the first aspect.

[0016] The present disclosure provides a solution that, in response to receiving a write instruction for instructing to write target data into a target file, obtains the target storage space capacity required for the target data and the current available first storage space capacity, where the first storage space capacity is a partial storage space capacity in the total available storage space capacity; when the target storage space capacity is greater than the first storage space capacity, determine, based on the write instruction, whether the target file is a core file required for the operation of the operating system; if so, determine whether the target storage space capacity is greater than the total storage space capacity; when it is determined that the target storage space capacity is not greater than the total storage space capacity, determine to execute the write instruction to write the target data into the target file. By dividing the total storage space capacity in the terminal device into a first storage space capacity available for all files and a second storage space capacity reserved for core files required for the operation of the operating system, and then in the case where the first storage space capacity does not meet the target storage space capacity required to write the target data into the target file, if it is determined that the target file is a core file, the total storage space capacity is provided for the target file to use, so as to avoid the problem that the second storage space capacity reserved for the core file is occupied by other files, resulting in the inability to perform normal reading and writing of the core file, reducing the probability of the occurrence of the situation where the operating system crashes and the terminal device cannot be powered on or freezes, and effectively improving the stability of the operation of the operating system. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or related technologies, the following will briefly introduce the drawings required for the description of the embodiments or related technologies. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In the drawings:

[0018] Figure 1 It is a schematic flowchart of a data processing method provided by an exemplary embodiment of the present disclosure;

[0019] Figure 2 It is a schematic structural diagram of a system provided by an exemplary embodiment of the present disclosure;

[0020] Figure 3 It is a schematic structural diagram of an operating system provided by an exemplary embodiment of the present disclosure;

[0021] Figure 4 It is a schematic flowchart of a data processing method provided by an exemplary embodiment of the present disclosure;

[0022] Figure 5 It is a schematic flowchart for determining whether a target file is a core file required for the operation of an operating system provided by an exemplary embodiment of the present disclosure;

[0023] Figure 6 It is a schematic structural diagram of a data processing device provided by an exemplary embodiment of the present disclosure;

[0024] Figure 7 It is a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. Detailed Embodiments

[0025] The following will describe in detail the embodiments of the present disclosure, and the examples of the embodiments are shown in the drawings. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present disclosure, and should not be construed as a limitation to the present disclosure.

[0026] In the description, claims, and drawings of the embodiments of the present disclosure, terms such as "first" and "second" are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0027] First, some terms in the embodiments of the present disclosure are explained below to facilitate understanding by those skilled in the art.

[0028] A file extension (Filename Extension, or also known as the extended file name, suffix name) is a mechanism used by an operating system to identify a file format.

[0029] Extensible Markup Language (xml) is a data storage language.

[0030] The text file format (Text File, txt) is a text format attached to an operating system, mainly storing text information, that is, literal information.

[0031] The primary data file (MDF) file is a disc image file format used for storing disc images.

[0032] The root user, also known as the root user, is the only superuser in Unix and Unix-like systems (such as Linux, etc.), and Android and iOS mobile device systems.

[0033] Linux generally refers to GNU / Linux (the separate Linux kernel cannot be directly used and is generally paired with the GNU suite, hence this name). It is a Unix-like operating system that is free to use and freely distributed.

[0034] Android is a free and open-source mobile operating system based on the Linux kernel.

[0035] Microsoft Windows is an operating system developed based on a graphical user interface, mainly used in devices such as computers and smartphones.

[0036] iOS is a mobile operating system.

[0037] A soft link, also known as a symbolic link, refers to a file that contains the path name of another file.

[0038] The initialization process (init process) is the first user-level process started by the kernel when the Linux system runs programs.

[0039] Incubator process: A child process created by the init process.

[0040] The Fourth extended filesystem (ext4) is a journaling file system under the Linux system.

[0041] The virtual file system is a distributed file system for network environments and is an interface that allows the operating system to use different file system implementations.

[0042] The Flash Friendly File System (f2fs) is a new type of open-source flash file system.

[0043] Read-Only Memory (ROM) works in a non-destructive read-out mode and can only read information and cannot write information.

[0044] The storage space capacity of terminal devices such as mobile phones and tablets is limited. As the related functions of application programs become more and more complex, the files of some application programs and the files required for the operation of the operating system will occupy a large amount of storage space. As a result, the storage space of the terminal device may be insufficient, making it impossible to read and write the core files required for the normal operation of the operating system, and even causing the operating system to crash and the terminal device to freeze, resulting in low stability of the system operation. For this reason, the present disclosure provides a data processing method, device, electronic device, and computer medium to solve the technical problem of low stability of the operating system operation in the related art.

[0045] The following uses specific embodiments to detail the technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems. These specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present disclosure will be described below in conjunction with the accompanying drawings.

[0046] Figure 1A flowchart of a data processing method provided by an exemplary embodiment of the present disclosure. This method can be applied to terminal devices (such as smartphones, laptops, tablets, smartwatches, etc.). The method at least includes the following steps S1 - S3:

[0047] S1. In response to receiving a write instruction for instructing to write target data to a target file, obtain the target storage space capacity required for the target data, and the current available first storage space capacity. The first storage space capacity is a partial storage space capacity in the total available storage space capacity;

[0048] In some embodiments, an operating system (such as Android, Microsoft Windows, Linux, iOS, etc.) can be installed in the terminal device. The operating system can be used to manage hardware resources, provide a user interface, and support the operation of application programs. The operating system can specifically include a file system (such as ext4, f2fs, etc.). The file system is a software mechanism in the operating system responsible for managing and storing file information, and the file system contains multiple files. The target file can be any one of the multiple files contained in the file system; additionally, the target file may not be included in the above - mentioned multiple files. When the target file is not included in the above - mentioned multiple files, the target file can be created first, and then subsequent steps can be performed based on the target file.

[0049] In some embodiments, an application program can be installed in the terminal device. When a user using the terminal device uses the installed application program, a write instruction can be triggered. For example, caching application - related application data can trigger the write instruction.

[0050] In some embodiments, the write instruction includes: attribute information of the target file. The attribute information includes a first identifier of the user of the operating system and a second identifier of the user group to which the user belongs.

[0051] In some embodiments, when the operating system is a UNIX or UNIX - like operating system, the attribute information of the target file can be a file index node (Index Node). Index Node is a data structure used to represent and manage files in UNIX and UNIX - like operating systems.

[0052] In some embodiments, the first identifier of a user may be a UID (User Identifier), which is a unique identifier used to identify and distinguish different users. In operating systems such as Unix, Linux, and Android, each user is assigned a unique UID to determine the user's identity and permissions in the system. In the file system, each file and directory is associated with a UID to determine the owner of the file. In an operating system, a UserGroup is a mechanism for managing and organizing users. UserGroups are used to classify a group of users and assign them the same permissions and access controls. The second identifier is a unique identifier for each user group, specifically a GID (Group Identifier), which is used to uniquely identify and distinguish different user groups in the operating system.

[0053] In some embodiments, the attribute information of the target file may further include file name information, which may specifically include: the target file name and the target file extension. Among them, the target file name is used to indicate the content of the target file, and the target file extension, that is, the target file suffix, is used to indicate the type and format of the target file. In addition, the attribute information of the target file may further include the size, creation time, etc. of the target file.

[0054] In some embodiments, the total capacity of the available storage space may be the capacity of the unoccupied storage space in the data partition of the current terminal device, and the first storage space capacity is less than the total storage space capacity.

[0055] S2. When the target storage space capacity is greater than the first storage space capacity, based on the write instruction, determine whether the target file is a core file required for the operation of the operating system; if so, determine whether the target storage space capacity is greater than the total storage space capacity;

[0056] In some embodiments, the core files required for the operation of the operating system may be system files or files of application programs.

[0057] In some embodiments, the core files required for the operation of the operating system generally have the following characteristics: the file name is globally unique; the file extension is a fixed preset extension such as database (e.g., MDF), xml, txt, etc.; the path corresponding to the file name is unique, and the file name does not include soft links, etc.

[0058] For example, the core files may include: some key files that need to be written during the system startup process, database files accessed by application programs, etc.

[0059] In some alternative embodiments provided by the present disclosure, in S2, based on the write instruction, determining whether the target file is a core file required for the operation of the operating system includes S21:

[0060] S21. When the attribute information included in the write instruction contains a preset tag, determining that the target file is a core file required for the operation of the operating system.

[0061] In some embodiments, the preset tag can be used to indicate that the target file is a core file.

[0062] In some alternative embodiments provided by the present disclosure, for the determination of the preset tag, the method further includes: after determining that the target file is a core file required for the operation of the operating system, adding the preset tag to the attribute information of the target file.

[0063] In some alternative embodiments provided by the present disclosure, in S2, based on the write instruction, determining whether the target file is a core file required for the operation of the operating system further includes S22 - S24:

[0064] S22. When the attribute information included in the write instruction does not contain the preset tag, obtaining the first identifier and the second identifier included in the attribute information;

[0065] S23. When the first identifier is the same as the first preset identifier and the second identifier is the same as the second preset identifier, obtaining the file name information of the target file;

[0066] In some embodiments, the first preset identifier corresponding to the core file may specifically be the user identifier corresponding to the user to whom the core file belongs, and the second preset identifier may specifically be the group identifier corresponding to the group to which the user to whom the core file belongs belongs.

[0067] In some embodiments, the first preset identifier may be 0, or may be set to other numbers, and its value is obtained by the distribution configuration process from the server. Taking the first preset identifier as 0 as an example, in Unix and Unix - like operating systems, the user with UID (the first identifier) being 0 is the root user. In some embodiments, the second preset identifier may also be 0, or may be set to other numbers, and its value is obtained by the distribution configuration process from the server. Taking the second preset identifier as 0 as an example, in Unix and Unix - like operating systems, the user group with GID (the second identifier) being 0 can be called the root user group.

[0068] In some embodiments, when the first identifier is different from the first preset identifier, or the second identifier is different from the second preset identifier, it can be determined that the target file is not a core file required for the operation of the operating system.

[0069] S24. Determine whether the target file is a core file required for the operation of the operating system based on the file name information.

[0070] In some optional embodiments provided by the present disclosure, in S24, determining whether the target file is a core file required for the operation of the operating system based on the file name information includes S241 - S243:

[0071] S241. Determine whether the target file extension included in the file name information matches a preset file extension;

[0072] In some embodiments, when the target file extension is included in the preset file extension, it is determined that the target file extension included in the file name information matches the preset file extension; when the target file extension is not included in the preset file extension, it is determined that the target file extension included in the file name information does not match the preset file extension. Among them, the preset file extensions may include: database, xml, txt, etc.

[0073] S242. When the target file extension matches the preset file extension, obtain and query a core file list, where the core file list includes the file names of multiple core files;

[0074] S243. When it is queried that the target file name included in the file name information is included in the file names of the multiple core files, determine that the target file is a core file required for the operation of the operating system.

[0075] In some optional embodiments provided by the present disclosure, the core file list and the above-mentioned second storage space capacity, the first preset identifier and the second preset identifier corresponding to the core file may be determined by the server. For the acquisition of the core file list and the second storage space capacity, the first preset identifier and the second preset identifier, the method further includes S01 - S02:

[0076] S01. Send its own operation information to the server based on a preset period, so that the server determines the configuration file corresponding to the terminal device based on the operation information. The configuration file includes the core file list, the second storage space capacity, the first preset identifier and the second preset identifier corresponding to the core file. The sum of the second storage space capacity and the first storage space capacity is not greater than the total storage space capacity; the operation information includes at least one of the following: the version information of the operating system, the total storage space capacity, the crash information corresponding to the applications installed on the terminal device, etc.;

[0077] S02. Receive the configuration file fed back by the server for the operation information and parse the configuration file to obtain the core file list, the second storage space capacity, the first preset identifier, and the second preset identifier.

[0078] In some embodiments, the version information of the above operating system may be the version number of the operating system, the installed application programs of the terminal device may be a list composed of a preset number of application programs with the highest user usage rate, the total storage space capacity may be the size of the operating system ROM, and the crash information corresponding to the installed application programs of the terminal device may include: the name of the crashed application program, the crash time, the number of crashes, etc.

[0079] Figure 2 The structural schematic diagram of a system provided by an embodiment of the present disclosure includes: a terminal device and a server. The terminal device and the server are connected through a network, for example, through a wired or wireless network connection, etc.

[0080] In some embodiments, the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. Among them, the server may be used to determine the configuration file corresponding to the terminal device based on the operation information and send the configuration file to the corresponding terminal device, and the configuration file includes the core file list and the second storage space capacity.

[0081] In some embodiments, a terminal device may include a user space and a kernel space. The user space may refer to the area for applications and users to execute. In the user space, applications can run, execute, and access various resources, such as documents, media files, etc. The user space may include an initialization process (init process), which is the first process to run when the operating system starts. It can be responsible for starting and managing other processes and providing basic functions and services of the system. The user space may also include an incubator process, which is a child process created after the init process starts and can be used to preload some commonly used resource files when the system starts. The user space may also include a monitoring process, which can be created by the initialization process. The user space may also include a configuration distribution process, which can be created by the incubator process. The monitoring process and the configuration distribution process may use a certain inter-process communication method and can transmit data to the kernel driver module by calling system calls. The kernel space may be the operating environment of the operating system kernel. In the kernel space, the operating system executes core system functions. The kernel space includes a kernel driver module, which can be used to drive or control specific hardware devices, implement specific functions, or extend the functions of the operating system.

[0082] In some embodiments, the terminal device may communicate with a server through the configuration distribution process based on a network protocol. Specifically, the configuration distribution process may connect to the server and send its own running information to the server based on a preset period, and receive a configuration file feedback by the server for the running information. The configuration file includes the core file list, the capacity of the second storage space, the first preset identifier and the second preset identifier corresponding to the core file. Figure 3 A schematic structural diagram of an operating system provided by an embodiment of the present disclosure is as Figure 3 shown. After receiving the configuration file (including the core file list, the capacity of the second storage space, the first preset identifier, and the second preset identifier), the configuration distribution process may send the configuration file to the monitoring process. When the terminal device is powered on and the operating system starts, the monitoring process parses the configuration file to obtain the core file list, the capacity of the second storage space, the first preset identifier, and the second preset identifier, and sends the core file list, the capacity of the second storage space, the first preset identifier, and the second preset identifier to the kernel driver module. In addition, the capacity of the second storage space may also be directly sent to the file system by the monitoring module (the monitoring process can configure the reserved space of the second storage space in the file system by directly writing to the file node). File system functions implement operations on files and directories in the file system by calling interfaces provided by the file system. Among them, file system functions may include open functions, read functions, write functions, memory mapping functions, etc. Figure 3The user space processes 1, 2, and n in it can refer to user space processes running outside the operating system kernel. All user space processes can access files in the file system by calling file system library functions. These library functions ultimately access the kernel driver module through system calls and then reach the actual file system through the virtual file system.

[0083] In the above solution, the configuration file generated by the server is based on big data analysis of the system's running information. Since the actual running conditions of different terminal devices vary, the running information of different terminal devices is different. The server can dynamically configure different core file lists, reserved space sizes (the capacity of the second storage space), as well as the first preset identifier and the second preset identifier for different terminal devices. For example, if the server detects through the running information of a certain terminal device that the process of this terminal device crashes repeatedly because a certain core file is missing from the core file list, then it is necessary to dynamically send the updated core file list and other information to this terminal device. This solution can improve the flexibility, compatibility, and scalability of the configuration file, be able to generate a configuration file that better matches the current running status of the terminal device, and effectively improve the stability of the operating system.

[0084] In some alternative embodiments provided by the present disclosure, the method further includes:

[0085] When the target storage space capacity is not greater than the first storage space capacity, execute the write instruction to write the target data into the target file.

[0086] That is to say, when the available first storage space capacity is sufficient to meet the target storage space capacity required to write the target data into the target file, the write instruction can be directly executed without determining whether the target file is a core file, effectively saving the data processing volume and improving the data processing efficiency.

[0087] In some embodiments, when the target storage space capacity is greater than the first storage space capacity and the target file is not a core file required for the operation of the operating system, do not perform the action of writing the target data into the target file as indicated by the above write instruction, and return an error message indicating insufficient storage space.

[0088] In some embodiments, the sum of the above first storage space capacity and the second storage space capacity can be equal to the total storage space capacity or less than the total storage space capacity.

[0089] In the above solution, in addition to the capacity of the first storage space, the total storage space capacity may further include the capacity of a second storage space, which may be the capacity of the storage space reserved for core files, so as to prevent files other than core files from occupying the storage space corresponding to the second storage space capacity, thereby protecting the security and integrity of core files, reducing the risk of operating system failures, and thus ensuring the stable operation of the operating system.

[0090] S3. When it is determined that the target storage space capacity is not greater than the total storage space capacity, determine to execute the write instruction to write the target data into the target file.

[0091] In some embodiments, the method further includes: when it is determined that the target storage space capacity is greater than the total storage space capacity, do not perform the action of writing the target data into the target file as indicated by the above write instruction, and return an error message indicating insufficient storage space. This error message is used to prompt the user that the current storage space is insufficient, so that the user can clean up the storage space.

[0092] Further, the present solution will be described below in conjunction with specific scenarios:

[0093] Figure 4 A flowchart of a data processing method provided by an exemplary embodiment of the present disclosure is shown as Figure 4 . When a write instruction for indicating writing target data into a target file is received, obtain the target storage space capacity required for the target data and the currently available first storage space capacity (total storage space capacity - second storage space capacity), and then determine whether the target storage space capacity is greater than the first storage space capacity; if not, directly execute the write instruction to write the target data into the target file; if so, call a detection module to determine whether the target file is a core file; it can be determined whether the target file is a core file based on the value returned by the detection module; when the target file is not a core file, do not perform the action of writing the target data into the target file as indicated by the above write instruction, and return an error message indicating insufficient storage space to prompt the user that the current storage space is insufficient; when the target file is a core file, further determine whether the target storage space capacity is greater than the total storage space capacity, if so, do not perform the action of writing the target data into the target file as indicated by the above write instruction, and return an error message indicating insufficient storage space, if not, execute the write instruction to write the target data into the target file.

[0094] Regarding the process of the above detection module determining whether the target file is a core file, reference can be made to Figure 5 , Figure 5Schematic flowchart for determining whether a target file is a core file required for operating system operation provided by an exemplary embodiment of the present disclosure. First, obtain the attribute information of the file included in the write instruction, and determine whether the attribute information of the file includes a preset tag. If so, directly determine that the target file is a core file required for operating system operation. If not, further obtain the first identifier (such as UID) and the second identifier (such as GID) included in the attribute information of the file; if the first identifier is the same as the first preset identifier and the second identifier is the same as the second preset identifier, obtain the file name information of the target file for further judgment. If not, determine that the target file is not a core file required for operating system operation; the file name information includes the target file extension and the target file name. If the target file extension matches the preset file extension and the core file list includes the target file name, determine that the target file is a core file required for operating system operation. If not, determine that the target file is not a core file required for operating system operation. After determining that the target file is a core file required for operating system operation, a preset tag can be added to the attribute information of the target file. When accessing the target file subsequently, the preset tag can be directly viewed for easy detection. The above solution uses the first identifier, the second identifier, the target file extension, and the target file name for multiple screenings, and can filter out most files not in the core file list in advance to improve the file detection efficiency.

[0095] The present disclosure provides that in response to receiving a write instruction for instructing to write target data to a target file, obtain the target storage space capacity required for the target data, and the current available first storage space capacity, where the first storage space capacity is a partial storage space capacity in the total available storage space capacity; when the target storage space capacity is greater than the first storage space capacity, based on the write instruction, determine whether the target file is a core file required for operating system operation; if so, determine whether the target storage space capacity is greater than the total storage space capacity; when it is determined that the target storage space capacity is not greater than the total storage space capacity, determine to execute the write instruction to write the target data to the target file. By dividing the total storage space capacity in the terminal device into a first storage space capacity available to all files and a second storage space capacity reserved for core files required for operating system operation, and then in the case where the first storage space capacity does not meet the target storage space capacity required to write the target data to the target file, if it is determined that the target file is a core file, the total storage space capacity is provided for the target file to use, so as to avoid the problem that the second storage space capacity reserved for core files is occupied by other files, resulting in the inability to perform normal reading and writing of core files, reducing the probability of the occurrence of the situation where the operating system crashes and the terminal device cannot be powered on or freezes, and effectively improving the stability of the operating system operation.

[0096] Figure 6 A structural schematic diagram of a data processing device provided by an exemplary embodiment of the present disclosure;

[0097] Among them, the device includes:

[0098] An acquisition unit 601, configured to, in response to receiving a write instruction for instructing to write target data into a target file, acquire the capacity of the target storage space required by the target data, and the current available first storage space capacity, where the first storage space capacity is a partial storage space capacity in the total available storage space capacity;

[0099] A determination unit 602, configured to, when the capacity of the target storage space is greater than the first storage space capacity, based on the write instruction, determine whether the target file is a core file required for the operation of the operating system, and if so, determine whether the capacity of the target storage space is greater than the total storage space capacity;

[0100] An execution unit 603, configured to, when it is determined that the capacity of the target storage space is not greater than the total storage space capacity, determine to execute the write instruction to write the target data into the target file.

[0101] In some optional embodiments provided by the present disclosure, the write instruction includes: attribute information of the target file. When the determination unit 602 is configured to determine whether the target file is a core file required for the operation of the operating system based on the write instruction, it specifically includes:

[0102] When the attribute information included in the write instruction contains a preset tag, determine that the target file is a core file required for the operation of the operating system.

[0103] In some optional embodiments provided by the present disclosure, the attribute information includes a first identifier of a user of the operating system and a second identifier of a user group to which the user belongs. When the determination unit 602 is configured to determine whether the target file is a core file required for the operation of the operating system based on the write instruction, it is further configured to:

[0104] When the attribute information included in the write instruction does not contain the preset tag, acquire the first identifier and the second identifier included in the attribute information;

[0105] In a case where the first identifier is the same as a first preset identifier and the second identifier is the same as a second preset identifier, acquire the file name information of the target file;

[0106] Based on the file name information, determine whether the target file is a core file required for the operation of the operating system.

[0107] In some alternative embodiments provided by the present disclosure, the file name information includes a target file name and a target file extension. When the determining unit 602 is used to determine whether the target file is a core file required for the operation of the operating system based on the file name information, it is specifically used for:

[0108] Determine whether the target file extension included in the file name information matches a preset file extension;

[0109] When the target file extension matches the preset file extension, obtain and query a core file list, where the core file list includes the file names of multiple core files;

[0110] When it is queried that the target file name included in the file name information is included in the file names of the multiple core files, determine that the target file is a core file required for the operation of the operating system.

[0111] In some alternative embodiments provided by the present disclosure, the device is further used for:

[0112] After determining that the target file is a core file required for the operation of the operating system, add the preset label to the attribute information of the target file.

[0113] In some alternative embodiments provided by the present disclosure, the device is further used for:

[0114] Send its own operation information to the server based on a preset period, so that the server determines a configuration file corresponding to the terminal device based on the operation information. The configuration file includes the core file list, the second storage space capacity, the first preset identifier and the second preset identifier corresponding to the core file, and the sum of the second storage space capacity and the first storage space capacity is not greater than the total storage space capacity;

[0115] The operation information includes at least one of the following: the version information of the operating system, the total storage space capacity, the crash information corresponding to the applications installed on the terminal device, etc.;

[0116] Receive the configuration file fed back by the server for the operation information and parse the configuration file to obtain the core file list, the second storage space capacity, the first preset identifier and the second preset identifier.

[0117] In some alternative embodiments provided by the present disclosure, the device is further used for:

[0118] When the target storage space capacity is not greater than the first storage space capacity, execute the write instruction to write the target data into the target file.

[0119] It should be understood that the device embodiments and the method embodiments can correspond to each other, and similar descriptions can refer to the method embodiments. To avoid repetition, they will not be elaborated here. Specifically, the device can execute the above method embodiments, and the foregoing and other operations and / or functions of each module in the device respectively correspond to the corresponding processes in each method in the above method embodiments. For the sake of brevity, they will not be elaborated here.

[0120] The device of the embodiments of the present disclosure has been described above from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, can also be implemented by instructions in the form of software, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiments in the present disclosure can be completed by the integrated logic circuit in the hardware in the processor and / or instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as being executed and completed by the hardware decoding processor, or can be executed and completed by a combination of the hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the above method embodiments.

[0121] Figure 7 is a schematic block diagram of an electronic device provided by the embodiments of the present disclosure. The electronic device may include:

[0122] A memory 701 and a processor 702. The memory 701 is used to store a computer program and transmit the program code to the processor 702. In other words, the processor 702 can call and run the computer program from the memory 701 to implement the method in the embodiments of the present disclosure.

[0123] For example, the processor 702 can be used to execute the above method embodiments according to the instructions in the computer program.

[0124] In some embodiments of the present disclosure, the processor 702 may include, but is not limited to:

[0125] A general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and so on.

[0126] In some embodiments of the present disclosure, the memory 701 includes, but is not limited to:

[0127] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM).

[0128] In some embodiments of the present disclosure, the computer program can be divided into one or more modules, and the one or more modules are stored in the memory 701 and executed by the processor 702 to complete the method provided by the present disclosure. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0129] As Figure 7 shown, the electronic device may further include:

[0130] A transceiver 703, and the transceiver 703 can be connected to the processor 702 or the memory 701.

[0131] Among them, the processor 702 can control the transceiver 703 to communicate with other devices. Specifically, it can send information or data to other devices, or receive information or data sent by other devices. The transceiver 703 can include a transmitter and a receiver. The transceiver 703 may further include an antenna, and the number of antennas can be one or more.

[0132] It should be understood that the various components in the electronic device are connected through a bus system. Among them, the bus system includes, in addition to the data bus, a power bus, a control bus, and a status signal bus.

[0133] The present disclosure also provides a computer storage medium on which a computer program is stored. When the computer program is executed by a computer, the computer is enabled to execute the methods in the above method embodiments. Or rather, the embodiments of the present disclosure also provide a computer program product containing instructions. When the instructions are executed by a computer, the computer is enabled to execute the methods in the above method embodiments.

[0134] When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present disclosure are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)), etc.

[0135] According to one or more embodiments of the present disclosure, a data processing method is provided, which is applied to a terminal device and includes:

[0136] In response to receiving a write instruction for instructing to write target data into a target file, obtain the target storage space capacity required for the target data, and the currently available first storage space capacity, where the first storage space capacity is a partial storage space capacity in the total available storage space capacity;

[0137] When the capacity of the target storage space is greater than the capacity of the first storage space, based on the write instruction, determine whether the target file is a core file required for the operation of the operating system; if so, determine whether the capacity of the target storage space is greater than the total capacity of the storage space;

[0138] When it is determined that the capacity of the target storage space is not greater than the total capacity of the storage space, determine to execute the write instruction to write the target data into the target file.

[0139] According to one or more embodiments of the present disclosure, the write instruction includes: attribute information of the target file. Based on the write instruction, determining whether the target file is a core file required for the operation of the operating system includes:

[0140] When the attribute information included in the write instruction contains a preset tag, determine that the target file is a core file required for the operation of the operating system.

[0141] According to one or more embodiments of the present disclosure, the attribute information includes a first identifier of the user of the operating system and a second identifier of the user group to which the user belongs. Based on the write instruction, determining whether the target file is a core file required for the operation of the operating system further includes:

[0142] When the attribute information included in the write instruction does not contain the preset tag, obtain the first identifier and the second identifier included in the attribute information;

[0143] In the case where the first identifier is the same as the first preset identifier and the second identifier is the same as the second preset identifier, obtain the file name information of the target file;

[0144] Based on the file name information, determine whether the target file is a core file required for the operation of the operating system.

[0145] According to one or more embodiments of the present disclosure, the file name information includes a target file name and a target file extension. Based on the file name information, determining whether the target file is a core file required for the operation of the operating system includes:

[0146] Determine whether the target file extension included in the file name information matches the preset file extension;

[0147] When the target file extension matches the preset file extension, obtain and query a core file list, and the core file list includes the file names of multiple core files;

[0148] When it is queried that the target file name included in the file name information contains the file name of one of the multiple core files, it is determined that the target file is a core file required for the operation of the operating system.

[0149] According to one or more embodiments of the present disclosure, the method further includes:

[0150] After determining that the target file is a core file required for the operation of the operating system, add the preset label to the attribute information of the target file.

[0151] According to one or more embodiments of the present disclosure, the method further includes:

[0152] Send its own operation information to the server based on a preset period, so that the server determines the configuration file corresponding to the terminal device based on the operation information. The configuration file includes the core file list, the second storage space capacity, the first preset identifier and the second preset identifier corresponding to the core file. The sum of the second storage space capacity and the first storage space capacity is not greater than the total storage space capacity;

[0153] The operation information includes at least one of the following: the version information of the operating system, the total storage space capacity, the crash information corresponding to the applications installed on the terminal device, etc.;

[0154] Receive the configuration file fed back by the server for the operation information and parse the configuration file to obtain the core file list, the second storage space capacity, the first preset identifier and the second preset identifier.

[0155] According to one or more embodiments of the present disclosure, the method further includes:

[0156] When the target storage space capacity is not greater than the first storage space capacity, execute the write instruction to write the target data into the target file.

[0157] According to one or more embodiments of the present disclosure, a data processing device is provided, including:

[0158] An acquisition unit, configured to, in response to receiving a write instruction for instructing to write target data into a target file, acquire the target storage space capacity required for the target data, and the currently available first storage space capacity, where the first storage space capacity is a partial storage space capacity in the available total storage space capacity;

[0159] A determination unit, configured to, when the target storage space capacity is greater than the first storage space capacity, based on the write instruction, determine whether the target file is a core file required for the operation of the operating system, and if so, determine whether the target storage space capacity is greater than the total storage space capacity;

[0160] An execution unit, configured to, when it is determined that the target storage space capacity is not greater than the total storage space capacity, determine to execute the write instruction to write the target data into the target file.

[0161] According to one or more embodiments of the present disclosure, the write instruction includes: attribute information of the target file. When the determination unit is configured to determine whether the target file is a core file required for the operation of the operating system based on the write instruction, it is specifically configured to:

[0162] When the attribute information included in the write instruction contains a preset tag, determine that the target file is a core file required for the operation of the operating system.

[0163] According to one or more embodiments of the present disclosure, the attribute information includes a first identifier of the user of the operating system and a second identifier of the user group to which the user belongs. When the determination unit is configured to determine whether the target file is a core file required for the operation of the operating system based on the write instruction, it is further configured to:

[0164] When the attribute information included in the write instruction does not contain the preset tag, obtain the first identifier and the second identifier included in the attribute information;

[0165] In a case where the first identifier is the same as a first preset identifier and the second identifier is the same as a second preset identifier, obtain the file name information of the target file;

[0166] Based on the file name information, determine whether the target file is a core file required for the operation of the operating system.

[0167] According to one or more embodiments of the present disclosure, the file name information includes a target file name and a target file extension. When the determination unit is configured to determine whether the target file is a core file required for the operation of the operating system based on the file name information, it is specifically configured to:

[0168] Determine whether the target file extension included in the file name information matches a preset file extension;

[0169] When the target file extension matches the preset file extension, obtain and query a core file list, and the core file list includes the file names of multiple core files;

[0170] When it is queried that the target file name included in the file name information is included in the file names of the multiple core files, determine that the target file is a core file required for the operation of the operating system.

[0171] According to one or more embodiments of the present disclosure, the device is further configured to:

[0172] After determining that the target file is a core file required for the operation of the operating system, add the preset tag to the attribute information of the target file.

[0173] According to one or more embodiments of the present disclosure, the device is further configured to:

[0174] Send its own operation information to the server based on a preset period, so that the server determines the configuration file corresponding to the terminal device based on the operation information, and the configuration file includes the core file list, the second storage space capacity, the first preset identifier and the second preset identifier corresponding to the core file, and the sum of the second storage space capacity and the first storage space capacity is not greater than the total storage space capacity;

[0175] The operation information includes at least one of the following: the version information of the operating system, the total storage space capacity, the crash information corresponding to the applications installed on the terminal device, etc.;

[0176] Receive the configuration file fed back by the server for the operation information and parse the configuration file to obtain the core file list, the second storage space capacity, the first preset identifier and the second preset identifier.

[0177] According to one or more embodiments of the present disclosure, the device is further configured to:

[0178] When the target storage space capacity is not greater than the first storage space capacity, execute the write instruction to write the target data into the target file.

[0179] According to one or more embodiments of the present disclosure, there is provided an electronic device, including:

[0180] A processor; and

[0181] A memory for storing executable instructions of the processor;

[0182] Wherein, the processor is configured to execute the above data processing method by executing the executable instructions.

[0183] According to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above data processing method is implemented.

[0184] Those of ordinary skill in the art can realize that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this disclosure.

[0185] In several embodiments provided by this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or modules can be in electrical, mechanical, or other forms.

[0186] The modules described as separate components may or may not be physically separated. The components displayed as modules may or may not be physical modules, that is, they can be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. For example, in each embodiment of this disclosure, the various functional modules can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.

[0187] The above is only the specific implementation manner of this disclosure, but the protection scope of this disclosure is not limited thereto. Any person skilled in the art within the technical scope disclosed by this disclosure can easily think of changes or substitutions, which should all be covered by the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be subject to the protection scope of the claims.

Claims

1. A data processing method, characterized in that: Applied to terminal equipment, including: In response to receiving a write instruction for instructing to write target data into a target file, obtaining a target storage space capacity required for the target data and a currently available first storage space capacity, where the first storage space capacity is a portion of the total available storage space capacity; When the target storage space capacity is greater than the first storage space capacity, determining whether the target file is a core file required for the operation of the operating system based on the write instruction; if so, determining whether the target storage space capacity is greater than the total storage space capacity; When it is determined that the target storage space capacity is not greater than the total storage space capacity, it is determined to execute the write instruction to write the target data into the target file.

2. The method according to claim 1, characterized in that The write instruction includes: attribute information of the target file, and based on the write instruction, determining whether the target file is a core file required for the operation of the operating system includes: When the attribute information included in the write instruction includes a preset tag, it is determined that the target file is a core file required for the operation of the operating system.

3. The method according to claim 2, characterized in that The attribute information includes a first identifier of a user of the operating system and a second identifier of a user group to which the user belongs, and based on the write instruction, determining whether the target file is a core file required for the operation of the operating system further includes: When the attribute information included in the write instruction does not include the preset tag, acquiring the first identifier and the second identifier included in the attribute information; When the first identifier is the same as the first preset identifier, and the second identifier is the same as the second preset identifier, acquiring file name information of the target file; Based on the file name information, it is determined whether the target file is a core file required for the operation of the operating system.

4. The method according to claim 3, characterized in that: The file name information includes a target file name and a target file extension. Based on the file name information, determining whether the target file is a core file required for the operation of the operating system includes: Determining whether the target file extension included in the file name information matches a preset file extension; When the target file extension matches the preset file extension, a core file list is obtained and queried, wherein the core file list includes file names of multiple core files; When it is found that the target file name included in the file name information is included in the file names of the multiple core files, it is determined that the target file is a core file required for the operation of the operating system.

5. The method according to claim 4, characterized in that The method further comprises: After determining that the target file is a core file required for the operation of the operating system, the preset tag is added to the attribute information of the target file.

6. The method according to claim 4, characterized in that The method further comprises: sending its own operation information to the server based on a preset period, so that the server determines a configuration file corresponding to the terminal device based on the operation information, wherein the configuration file includes the core file list and the second storage space capacity, the first preset identifier and the second preset identifier corresponding to the core file, and the sum of the second storage space capacity and the first storage space capacity is not greater than the total storage space capacity; The operation information includes at least one of the following: version information of the operating system, the total capacity of the storage space, crash information corresponding to the application programs installed on the terminal device, etc.; The configuration file fed back by the server in response to the operation information is received and the configuration file is parsed to obtain the core file list and the second storage space capacity, the first preset identifier and the second preset identifier.

7. The method according to claim 1, characterized in that The method further comprises: When the target storage space capacity is not greater than the first storage space capacity, the write instruction is executed to write the target data into the target file.

8. A data processing device, characterized in that: include: an acquiring unit, configured to acquire, in response to receiving a write instruction for instructing to write target data into a target file, a target storage space capacity required for the target data and a currently available first storage space capacity, wherein the first storage space capacity is a portion of the total available storage space capacity; a determination unit, configured to determine, based on the write instruction, whether the target file is a core file required for the operation of the operating system when the target storage space capacity is greater than the first storage space capacity, and if so, determine whether the target storage space capacity is greater than the total storage space capacity; The execution unit is used to determine to execute the write instruction to write the target data into the target file when it is determined that the target storage space capacity is not greater than the total storage space capacity.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.