File processing method and device

By processing the initial file identification of computer software files into target file identification with less memory and converting it into target strings that are compatible with file systems, the problem of excessive file names occupies memory and file system incompatibility is solved, and resource savings and cost reduction are achieved.

CN114153805BActive Publication Date: 2025-05-13ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111511928.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2025-05-13
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

The number of computer software files is too large, resulting in excessive file names occupying memory resources. The existing technology replaces file names through hash values ​​but requires the entire file system to be transformed, resulting in wasted time and labor costs.

Method used

The initial file identification of the target file is processed as the target file identification through the preset algorithm, and when the target file identification is different from the historical file identification, the target file identification is converted into a target string based on the association information and the preset identification rules.

Benefits of technology

It avoids the problem of excessive memory resources occupied by the initial file identifier, and solves the incompatibility of the target file identifier with the file system, and avoids the time and labor costs waste in the transformation of the entire file system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114153805B_ABST
    Figure CN114153805B_ABST
Patent Text Reader

Abstract

The present application provides a file processing method and device, wherein the file processing method comprises: processing the initial file identifier of the target file into a target file identifier through a preset algorithm; when the target file identifier is different from the historical file identifier, based on the associated information of the target file identifier and the preset identification rule, converting the target file identifier into a target string; wherein the historical file identifier is an identifier obtained by processing the initial file identifier of the historical file through the preset algorithm. Specifically, the method processes the initial file identifier into a target file identifier with a small memory footprint through a hash algorithm, thereby avoiding the problem of the initial file identifier occupying too much memory resources, and converts the target file identifier into a target string based on the associated information of the target file identifier and the preset identification rule, thereby solving the problem of incompatibility between the target file identifier and the file system, and saving the cost of transforming the file system.
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 processing method. The present application also relates to a file processing device, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of Internet technology and computer technology, people's demand for computer software continues to increase, and many organizations need to continuously improve the capabilities of computer software to meet people's growing needs. However, in this process, the number of computer software files is too large, which in turn causes the file names to occupy too much memory resources.

[0003] In the prior art, many organizations use hash values, which occupy less memory, to replace file names, which occupy more memory, to save memory resources. However, the file systems of many computer software are built based on strings. If hash values ​​are used to replace file names, the entire file system needs to be modified to make it compatible with hash values, which results in a huge waste of time and labor costs. Summary of the invention

[0004] In view of this, the embodiment of the present application provides a file processing method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a file processing device, a computing device, and a computer-readable storage medium.

[0005] According to a first aspect of an embodiment of the present application, a file processing method is provided, comprising:

[0006] Processing the initial file identifier of the target file into the target file identifier through a preset algorithm;

[0007] In the case where the target file identifier is different from the historical file identifier, converting the target file identifier into a target character string based on the associated information of the target file identifier and a preset identification rule;

[0008] The historical file identifier is an identifier obtained by processing the initial file identifier of the historical file through a preset algorithm.

[0009] According to a second aspect of an embodiment of the present application, there is provided a file processing device, including:

[0010] A processing module, configured to process the initial file identifier of the target file into a target file identifier through a preset algorithm;

[0011] A conversion module, configured to convert the target file identifier into a target character string based on the associated information of the target file identifier and a preset identification rule when the target file identifier is different from the historical file identifier;

[0012] The historical file identifier is an identifier obtained by processing the initial file identifier of the historical file through a preset algorithm.

[0013] According to a third aspect of an embodiment of the present application, there is provided a computing device, including:

[0014] Memory and processor;

[0015] The memory is used to store computer executable instructions, and the processor implements the steps of the file processing method when executing the computer executable instructions.

[0016] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the file processing method are implemented.

[0017] According to a fifth aspect of the embodiments of the present application, a chip is provided, which stores a computer program, and the computer program implements the steps of the file processing method when executed by the chip.

[0018] The file processing method provided by the present application includes processing an initial file identifier of a target file into a target file identifier through a preset algorithm; when the target file identifier is different from a historical file identifier, converting the target file identifier into a target character string based on associated information of the target file identifier and a preset identification rule; wherein the historical file identifier is an identifier obtained by processing the initial file identifier of the historical file through a preset algorithm.

[0019] Specifically, the method processes the initial file identifier of the target file into a target file identifier with a smaller memory footprint through a preset algorithm, thereby avoiding the problem of the initial file identifier occupying too much memory resources, and converts the target file identifier into a target string based on the associated information of the target file identifier and preset identification rules, thereby solving the incompatibility problem between the target file identifier and the file system and avoiding the time cost and labor cost wasted in the process of transforming the entire file system. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of a file processing method provided by an embodiment of the present application;

[0021] Figure 2 It is a processing flow chart of a file processing method applied to a scenario of encrypting a hash value provided by an embodiment of the present application;

[0022] Figure 3 is a structural schematic diagram of a file processing device provided by an embodiment of the present application;

[0023] Figure 4 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0024] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0025] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0026] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.

[0027] First, the terms involved in one or more embodiments of the present invention are explained.

[0028] Hash: It refers to transforming an input of arbitrary length (also called pre-image) into an output of fixed length through a hash algorithm, such as mapping a large set to a small set; in practical applications, the fixed-length output may be the same as the output of the historical transformation. If the two are the same, it is determined that the fixed-length output has a conflict.

[0029] Binary state compression: compress and store a set of abstract states using a binary integer.

[0030] With the development of Internet technology and computer technology, people's demand for computer software continues to increase, and many organizations need to continuously improve the capabilities of computer software to meet people's growing needs. As a result, the number of computer software files is too large, resulting in excessive memory resource occupation by the file names of the files.

[0031] For example, the computer software can be understood as a computer game. In the process of storing and transmitting the real file name in the file and download system of the computer game, a file name often requires a relatively high memory space, such as more than 60B of memory space; and the number of files in computer games is relatively high, for example, the number of files can reach the order of 4*10^7. Based on this, the file name of the file requires more than 2GB of memory space. This is an unacceptable memory size, and many current game players' computers cannot run it.

[0032] Therefore, this specification provides a method for processing a real file name using a preset algorithm to obtain an unsigned 64-bit integer. For example, the preset algorithm can be a hash algorithm; by replacing the file name (60B string) with an integer (hash value), the memory usage can be greatly reduced. However, the file and download system of computer games was originally built based on strings. If hash values ​​are used instead, this is incompatible with the original framework built based on strings. Therefore, a lot of time and labor costs are required to transform the entire file system, resulting in huge labor time costs.

[0033] Based on this, in the present application, a file processing method is provided. The present application also relates to a file processing device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0034] See also Figure 1 , Figure 1 A flowchart of a file processing method provided according to an embodiment of the present application is shown, which specifically includes the following steps:

[0035] Step S102: Processing the initial file identifier of the target file into a target file identifier through a preset algorithm.

[0036] In practical applications, the file processing method provided in this application can be applied to the file system of computer software. The computer software can be set according to the actual application scenario, and this application does not make specific limitations on this, for example, the file system of computer games.

[0037] Among them, the target file can be understood as a file that needs to convert the initial file identifier into a target file identifier. The target file can be a file of computer software. For example, it can be a file of computer games, computer shopping applications, etc. Correspondingly, the initial file identifier can be understood as the file name of the target file. The type of the initial file identifier can be a character type. For example, the initial file identifier can be "E:\**Game\4545600995". The target file identifier can be understood as an integer obtained by processing the file name through a preset algorithm. When the initial file identifier is a file name and the target file identifier is an integer, the preset algorithm can be understood as any algorithm that can convert a file name into an integer. This application does not make specific restrictions on it. For example, it can be a hash algorithm.

[0038] Specifically, the file system can perform conversion processing on the initial file identifier of the target file through a preset algorithm to obtain the target file identifier corresponding to the target file.

[0039] Furthermore, in the file processing method provided by this application, the preset algorithm is a hash algorithm;

[0040] Correspondingly, the process of processing the initial file identifier of the target file into a target file identifier through an encryption algorithm includes:

[0041] Processing the initial file identifier of the target file into a target file identifier through a hash algorithm.

[0042] Among them, when the preset algorithm is a hash algorithm, the target file identifier can be understood as a hash value obtained by processing the file name through the hash algorithm. The hash value can be an unsigned 64-bit integer, or a non-"0" unsigned 64-bit integer.

[0043] Specifically, the file system can perform hash processing on the initial file identifier of the target file through the hash algorithm to obtain the target file identifier corresponding to the target file.

[0044] Next, taking the file system scenario of computer games as an example where the file processing method provided by this application is applied, the process of processing the initial file identifier of the target file into a target file identifier through the hash algorithm will be further described. Among them, the target file can be a game file of a computer game, the initial file identifier can be the file name of the game file, and the type of this file name is a character type; the target file identifier can be understood as an integer obtained by hashing the file name, that is, a hash value.

[0045] The file system of the computer game can perform a hash process on a file name (eg, "E:\**Game\4545600995") through a hash algorithm to convert the file name into an unsigned 64-bit integer (uint64_t).

[0046] In practical applications, the integer can be a non-zero integer. That is, the hash algorithm does not convert the file name into an integer of 0 during the hashing process of the file name.

[0047] Step S104: when the target file identifier is different from the historical file identifier, the target file identifier is converted into a target character string based on the associated information of the target file identifier and a preset identification rule.

[0048] The historical file identifier is an identifier obtained by processing the initial file identifier of the historical file through a preset algorithm. The historical file identifier can be understood as a hash value obtained by the file system performing a hash process on the file name of the historical file through a hash algorithm.

[0049] The associated information of the target file identifier can be understood as information associated with the target file identifier, including but not limited to the attribute information of the target file identifier, the character size rule for the target file identifier, etc. Correspondingly, the attribute information of the target file identifier includes but is not limited to the type of the target file identifier, the memory size occupied by the target file identifier, and other information. The character size rule can be understood as the requirement for the size of a character in a file system built based on characters, that is, the requirement for the size of a character. The character size required by the character size rule can be 8 bits for a character, 16 bits for a character, etc.

[0050] The preset identification rule can be understood as the naming requirement of the file system for character-type file names. The preset identification rule can be set according to the actual application scenario, and this manual does not make specific limitations on this. For example, the preset identification rule can be to update specific characters in the character-type file name, or the character-type file name cannot contain specific characters, etc.; wherein, the specific character can be set according to the actual application scenario, for example, the specific character can be the character "0".

[0051] The target string can be understood as a string converted from a hash value and that satisfies a preset identification rule; when the preset identification rule is to update the character "0" in a character-type file name, the target string can be understood as a string converted from a hash value and that updates the character "0" contained therein.

[0052] Specifically, after the file system processes the initial file identifier of the target file into a target file identifier through a hash algorithm, when the file system determines that the target file identifier is different from the historical file identifier obtained after processing the initial file identifier of the historical file based on the hash algorithm, the file system converts the target file identifier into a target string based on the associated information of the target file identifier and a preset identification rule.

[0053] In actual applications, when the file system uses a hash algorithm to hash the initial file identifier of the target file (for example, a file name with a size of 60B) and obtains the target file identifier (for example, a hash value with a size of 8B), since the process maps a large set to a small set, the obtained hash value may be the same as the hash value obtained historically, that is, the obtained hash value conflicts with the hash value obtained historically. In this case, there will be two identical hash values ​​in the file system, which will cause errors in the operation of the file system.

[0054] Based on this, in the file processing method provided by the present application, when the target file identifier is different from the historical file identifier, the target file identifier is converted into a target string based on the associated information of the target file identifier and the preset identification rule, thereby reducing the excessive memory occupation by the file name while avoiding the incompatibility problem between the hash value and the file system.

[0055] If the target file identifier is the same as the historical file identifier, it is determined that the target file identifier conflicts with the historical file identifier, so the step of converting the target file identifier into the target string is stopped, avoiding errors in the operation of the file system. After the file system stops converting the target file identifier into the target string, it continues to use the initial file identifier (for example, a file name with a size of 60B) to store and propagate the target file (for example, a game file).

[0056] Furthermore, in the file processing method provided in the present application, the target file identifier is converted into a target character string based on the associated information of the target file identifier and a preset identification rule, which specifically includes steps one to three.

[0057] Step 1: Determine the attribute information and character size rule of the target file identifier from the associated information of the target file identifier.

[0058] Specifically, after determining that the target file identifier is different from the historical file identifier, the file system determines the attribute information of the target file identifier and the character size rule for the target file identifier from the associated information of the target file identifier.

[0059] Step 2: Based on the attribute information of the target file identifier and the character size rule, convert the target file identifier into an initial character string.

[0060] Specifically, after determining the attribute information and the character size rule corresponding to the target file identifier, the file system can convert the target file identifier into an initial character string based on the attribute information and the character size rule.

[0061] In a specific implementation process, the target file identifier is converted into an initial character string based on the attribute information of the target file identifier and the character size rule, including:

[0062] Determining the initial number of characters based on the attribute information of the target file identifier and the character size rule;

[0063] Converting the target file identifier into binary data, and dividing the binary data based on the initial number of characters to obtain a binary data set with the same number of initial characters;

[0064] The binary data set is converted into initial characters, and an initial character string is constructed based on the initial characters.

[0065] Among them, when the attribute information of the target file identifier is the memory size occupied by the target file identifier, and the character size rule is the requirement for the size of the character, the initial number of characters can be understood as the number of initial characters that can be converted into the target file identifier under the requirement of the character size rule; the binary set can be understood as a set containing binary data; the initial characters can be understood as the characters contained in the initial character string.

[0066] Specifically, after determining the attribute information and the character size rule of the target file identifier, the file system can determine the initial number of characters that the target file identifier can be converted to based on the attribute information of the target file identifier and the character size rule for the target file identifier. Afterwards, the file system can convert the target file identifier into binary data, and divide the binary data based on the initial number of characters to obtain a binary data set with the same number as the initial number of characters, wherein the binary data set contains binary data, and the size of the binary data set is the same as the size of one character required by the character size rule.

[0067] After the binary data set is determined, the binary data set is converted into initial characters, and an initial character string is constructed based on the initial characters.

[0068] Using the above example, the attribute information may be the size of the hash value; the character size required by the character size rule is that one character is 8 bits.

[0069] Based on this, when the file system determines that the hash value converted to the file name of the game file is an unsigned 64-bit integer (uint64_t), based on the character size rule that one character is 8 bits, it determines that the hash value can be converted into 8 characters. After that, the file system converts the hash value into a 64-bit binary data, where the binary data can be "00010100,00000000,00011110,00010111,11111111,00000010,00000100,00000000", and divides the binary data from front to back in a way that 8 bits of binary data are 1 set, and obtains 8 binary data sets. The eight binary data sets can be "00010100", "00000000", "00011110", "00010111", "11111111", "00000010", "00000100", "00000000".

[0070] After obtaining 8 binary data sets, each binary data set is converted into a character, which can be "00010100" converted into the character "20", "00000000" converted into the character "0", "00011110" converted into the character "30", "00010111" converted into the character "23", "11111111" converted into the character "255", "00000010" converted into the character "2", "00000100" converted into the character "4", and "00000000" converted into the character "0". The initial character string "20,0,30,23,255,2,4,0" is constructed based on the characters.

[0071] In actual applications, the file system of computer software may rely on specific characters in a string (a character-type file name) to determine the length and type of the string. For example, the file system of a computer game will add a specific character, such as the character "0", to the end of each string, and then determine the length of the entire string based on the character "0"; or the file system of computer software will add a characteristic character, such as the character "*", to the beginning of each string, and then determine the type of the entire string based on the character "*".

[0072] Based on this, when a specific character exists in the initial string converted based on the target file identifier, for example, the character "0" exists in the initial string, it may cause an error in the process of the computer game's file system processing the string.

[0073] Therefore, the file processing method provided in the present application can process the initial character string based on the preset identification rules of the file system for the file name. For the specific implementation method, see step three.

[0074] Step three: Update the initial character string based on a preset identification rule to obtain a target character string.

[0075] Specifically, after converting the target file identifier into the initial character string, the file system can update the initial character string based on the preset identification rule, thereby obtaining a target character string that meets the requirements of the preset identification rule.

[0076] Further, the updating of the initial character string based on a preset identification rule to obtain a target character string includes:

[0077] Determining character attributes of initial characters in the initial character string;

[0078] When the character attribute satisfies a preset identification rule, the initial character corresponding to the character attribute is updated to obtain an updated character string;

[0079] Determining update status data corresponding to the update character string;

[0080] Based on the update status data and the update character string, a target character string is determined.

[0081] The character attribute can be understood as the attribute of the character in the initial string, for example, the character attribute can be an attribute indicating whether the initial character is the character "0"; the updated string can be understood as a string that complies with a preset identification rule. The file processing method provided in the present application can update the characters in the initial string based on the preset identification rule, based on which, the update status data can be understood as data recording the file system updating the characters in the initial string.

[0082] Specifically, after obtaining the initial character string, the file system can obtain the character attribute of the initial character in the initial character string, and if the character attribute satisfies a preset identification rule, update the initial character in the initial character string corresponding to the character attribute, thereby obtaining an updated character string.

[0083] Afterwards, the file system determines update status data recording the update status of the characters in the update character string, and constructs a target character string based on the update status data and the update character string.

[0084] Using the above example, the preset identification rule can be to update the character "0" in the string. Based on this, after obtaining the initial string "20,0,30,23,255,2,4,0", the file system of the computer game can determine the character attributes of each character in the initial string, and when it is determined based on the character attributes that the character "0" exists in the initial string, the file system of the computer game determines that the character attributes meet the preset identification rule, and updates the character "0" in the initial string based on the preset identification rule, that is, the 2nd and 8th characters in the initial string "20,0,30,23,255,2,4,0" are updated, thereby obtaining the updated initial string, that is, the updated string.

[0085] Since the file system of the computer game updates an initial string containing 8 characters, a character value (also called a storage value) of a byte (2^8bit) size can be used to record the update of the file system to the initial string. In this example, the file system updates the second and eighth characters in the initial string "20,0,30,23,255,2,4,0", and therefore determines a binary data 0b******** corresponding to the initial character in the initial string; the bit corresponding to the updated initial character in the initial string is set to "1" in the binary data, and the bit corresponding to the initial character that is not updated in the initial string is set to "0" in the binary data. Based on this, the file system updates the second and eighth characters in the initial string "20,0,30,23,255,2,4,0", and obtains the update status data "0b01000001 (i.e., decimal 65)". The file system records the modification (update) of the initial string through "0b01000001 (i.e., decimal 65)".

[0086] After determining the update character string and the update status information, the file system of the computer game adds the decimal representation of the update status information "0b01000001", that is, the character "65", to the update character string, thereby obtaining the target character string.

[0087] In practical applications, a byte-sized (2^8bit) character value, i.e., updated state data, is used to store the modification (update) information of the initial string. This is called binary state compression.

[0088] In the specific implementation process, since the existence of the character "0" in the string will cause incorrect recognition of the file system, the character "0" in the string is replaced with the character "1" and the modification information of the file system is recorded through a character value, thereby avoiding the problem of incorrect recognition of the file system.

[0089] However, the character value may also be the character "0". For example, if the character "0" does not exist in the string, the string does not need to be modified. Therefore, the character value of the record modification information becomes the character "0". In this case, if the character value of the character "0" is added to the update string, it will also cause the file system to misrecognize the problem.

[0090] Based on this, the file processing method provided by the present application takes into account that the hash algorithm will only convert the file name into a non-zero integer (hash value). Therefore, when the hash value is converted into the initial string and updated, there is no situation where the character value of the modification information is recorded as the character "255". Therefore, when the character value is the character "0", the character value is converted into the character "255", thereby avoiding the problem of adding the character value of the character "0" to the update string, resulting in incorrect recognition of the file system.

[0091] In the file processing method provided by the present application, when it is determined that the character attribute of the initial character in the initial character string meets the preset identification rule, the initial character corresponding to the character attribute is updated to obtain an updated character string; and update status data recording the update status corresponding to each character in the updated character string is determined; and based on the update status data and the updated character string, the target character string is determined. This avoids the problem of errors in the file system when there are specific characters in the initial character string, and improves the stability of the file system. At the same time, it is convenient for the file system to restore the target character string to the target file identification based on the update status data after completing the storage and propagation of the target file.

[0092] In a specific implementation process, the process of updating the characters in the initial character string may be to replace the characters in the initial character string with specific characters, and the specific implementation method is as follows.

[0093] The updating of the initial character corresponding to the character attribute to obtain an updated character string includes:

[0094] The initial character corresponding to the character attribute is replaced by a preset update character to obtain an update character string, wherein the initial character is a character in the initial character string.

[0095] The preset update character can be set according to the actual application scenario, and this specification does not make specific settings for this. For example, the preset update character can be the character "1", the character "*", etc.

[0096] Continuing with the above example, the preset update character can be the character "1". Correspondingly, the preset identification rule can be to replace the character "0" in the character string with the character "1". Based on this, after the file system of the computer game determines that the character attribute meets the preset identification rule, based on the preset identification rule, the character "0" in the initial character string will be updated with the character "1", that is, the 2nd and 8th characters in the initial character string "20,0,30,23,255,2,4,0" will be replaced with the character "1", thereby obtaining the updated character string "20,1,30,23,255,2,4,1".

[0097] In the embodiments of the present specification, the initial characters corresponding to the character attributes are replaced by preset update characters to obtain an updated character string, thereby avoiding the problem of file system errors caused by the presence of specific characters in the initial character string and improving the stability of the file system.

[0098] In actual applications, after the file system obtains the update string "20,1,30,23,255,2,4,1", it can determine the update status information "0b01000001" corresponding to the update string, and add the decimal representation of the update status information, that is, the character "65", to the update string to obtain the target string, that is, "65,20,1,30,23,255,2,4,1".

[0099] In addition, the file processing method provided by the present application, since the target string is of character type, and there are other character strings in the file system, for example, the initial file identifier of the target file is also of character type, based on this, in order to make the file system of the computer software more convenient to distinguish the target string from other strings and avoid confusion of the file system, an update identifier can be added to the target string during the process of converting the target file identifier to the target string, which is used to indicate that the string is the target string converted based on the target file identifier. The specific implementation method is as follows.

[0100] The updating of the initial character string based on a preset identification rule to obtain a target character string includes:

[0101] Determine an update identifier corresponding to the update string;

[0102] A target character string is constructed based on the update identifier, the update status data and the update character string.

[0103] Among them, the update identifier can be understood as an identifier that identifies the string as the target string. The update identifier can be set according to the actual application scenario, and this application does not make specific limitations on this. For example, the update identifier can be the character "1".

[0104] Specifically, after the file system determines the update status data, it can determine a corresponding update identifier for the update string, and construct a target string based on the update identifier, the update status data, and the update string.

[0105] Using the above example, the update string can be "20,1,30,23,255,2,4,1", the update status information can be "65", and the update identifier can be the character "1". Based on this, after the file system determines the update status data corresponding to the update string, it can determine a character "1" for the update string; and based on the update string "20,1,30,23,255,2,4,1", the update status information "65" and the update identifier "1", the target string "1,65,20,1,30,23,255,2,4,1" is constructed together.

[0106] In the embodiments of this specification, by determining the update identifier corresponding to the update string, and constructing the target string based on the update identifier, update status data and the update string, the file system can accurately identify the target string and avoid confusion of the file system.

[0107] The file processing method provided in the present application processes the initial file identifier of the target file into a target file identifier with a smaller memory footprint through a hash algorithm, thereby avoiding the problem of the initial file identifier occupying too much memory resources, and converts the target file identifier into a target string based on associated information based on the target file identifier and preset identification rules, thereby solving the incompatibility problem between the target file identifier and the file system and avoiding the time and labor costs wasted in the process of transforming the entire file system.

[0108] In practical applications, the file processing method provided by the present application uses the above steps to convert the hash value into a string to replace the file name of the game file, thereby optimizing the original 60B file name size to only 10B. Therefore, in the process of storing and transmitting the file name of the game file, the memory occupation of the file name can be greatly reduced, and the modification of the file system is avoided, which reduces a lot of time and labor costs.

[0109] Among them, in the file processing method provided by the present application, the operation of converting the target file identifier into a target string can be understood as the process of encrypting the target file identifier, that is, the process of encrypting the hash value obtained by hashing the file name of the game file based on the hash algorithm.

[0110] Furthermore, in the file processing method provided by the present application, an encryption algorithm with both time and space advantages is designed to convert the unsigned 64-bit integer into an encrypted string compatible with the original framework (file system) before storage and transmission, thereby reducing the memory occupied by the file name and avoiding the modification of the file system.

[0111] At the same time, the file processing method provided by the present application needs to restore the encrypted string to an unsigned 64-bit integer through an equally efficient decryption algorithm after the encrypted string is used or propagated.

[0112] Based on this, the present application provides a decryption method for an encrypted string, specifically: when the encrypted string needs to be decrypted, by removing the newly added first two digits, that is, the update status data and the update identifier; and according to the information recorded in the storage value (update status data), the character replaced by the character "1" in the string is changed to "\0", that is, the character "0", thereby completing the restoration of the encrypted string.

[0113] Based on this method, it can be noted that the time complexity of encrypting the hash value is O(8), and the time complexity of decrypting the encrypted string is O(8). Although there is almost no additional increase in memory, the memory usage is reduced by 5 times. The original file system and download system do not need to be modified. However, this method makes the operation of each file increase the time complexity of O(16).

[0114] Based on this, the file processing method provided by this application notes that the time complexity of the encryption process is difficult to optimize, but the decryption process can be optimized to O(1) time complexity by making a preprocessed table of only 2kb based on state compression, and this preprocessing process only takes a few milliseconds after being optimized using dynamic programming. This reduces the time complexity of operating each file, and the specific implementation method is as follows.

[0115] After converting the target file identifier into a target character string, the method further includes:

[0116] Determining update status data of the target character string;

[0117] Acquire the restoration data corresponding to the update status data from the restoration data set;

[0118] The target character string is restored based on the restoration data to obtain a target file identifier.

[0119] The restored data set can be understood as a container for storing restored data, which includes but is not limited to a table, an array or a memory; this specification does not specifically limit this. In actual applications, the size of the restored data set can be set according to the actual application scenario, for example, the size can be 2kb, 10kb, etc.

[0120] The restored data may be understood as data capable of restoring the target string to the target file identifier, for example, after encrypting the hash value to the encrypted string, the encrypted string may be restored to the hash value data.

[0121] Specifically, after converting the target file identifier into the target string, when it is necessary to convert the target string into the target file identifier, the file system can also determine the update status data contained in the target string, and search from the restoration data set based on the update status data, wherein the restoration data set contains the update status data and the restoration data corresponding to the update status data; based on this, the restoration data corresponding to the update status data can be obtained from the restoration data set. After obtaining the restoration data, the file system can restore the target string based on the restoration data, thereby obtaining the target file identifier.

[0122] Using the above example, the restored data set can be understood as an array containing restored data, such as an array of uint64_t

[256] . In practical applications, the size of the array can be 2kb.

[0123] Based on this, after the file system encrypts the hash value to obtain the encrypted string, it can use and store the encrypted string; and when the encrypted string needs to be restored to the hash value after use and storage, the file system can obtain the updated status data in the encrypted string, that is, the character "65"; and based on the character "65", obtain the restored data corresponding to the character "65" from an array of uint64_t

[256] .

[0124] The array includes update status data, and each update status data corresponds to a restoration data; based on this, the corresponding restoration data can be obtained from the array based on the update status information.

[0125] After obtaining the restoration data, the file system can restore the target string based on the restoration data, thereby obtaining a hash value obtained by the file system hashing the game file.

[0126] In the embodiment provided by the present application, the update status data of the target string is used to obtain the restoration data corresponding to the update status data from the restoration data set; and the target string is quickly restored based on the restoration data, thereby improving the efficiency of obtaining the target file identifier and reducing the time complexity of the file system's operation on the target file.

[0127] Furthermore, in the process of restoring the target string based on the restored data, the data restoration of the target string can be completed by only performing an XOR operation on the restored data and the target string, thereby improving the efficiency of data restoration. The specific implementation method is as follows.

[0128] The performing data restoration on the target character string based on the restoration data to obtain a target file identifier includes:

[0129] Deleting the update identifier and the update status data in the target character string;

[0130] Convert the target character string into binary data, and perform an XOR operation on the binary data based on the restored data to obtain the binary data after the operation;

[0131] A target file identifier is obtained based on the binary data after the operation.

[0132] Specifically, after determining the restored data corresponding to the updated file identifier, the file system can delete the update identifier and the update status data in the target string, and convert the target string with the updated identifier and the update status data deleted into binary data. The binary data is subjected to a bitwise XOR operation based on the restored data, thereby obtaining the binary data after the operation. The file system then converts the binary data after the operation into the target file identifier, thereby completing the decryption of the target string.

[0133] Continuing with the above example, the update status data may be the character "65", and the restored data may be "00000000,00000001,00000000,00000000,00000000,00000000,00000000,000000001".

[0134] Based on this, after restoring the data corresponding to the character "65", the file system can delete the update status data and update identifier in the target string "1,65,20,1,30,23,255,2,4,1", that is, delete the first character "1" and the second character "65", thereby obtaining the string "20,1,30,23,255,2,4,1".

[0135] After that, the file system converts the string "20,1,30,23,255,2,4,1" into binary data "00010100,00000001,00011110,00010111,11111111,00000010,00000100,00000001" and performs a bitwise XOR operation on the binary data and the restored data to obtain the binary data after the operation, that is, "00010100,00000000,00011110,00010111,11111111,00000010,00000100,00000000"; through the above steps, the character "0" replaced by the character "1" in the target string can be restored.

[0136] After obtaining the binary data after the operation, the file system converts the binary data after the operation into an unsigned 64-bit integer (uint64_t), thereby converting the encrypted string into a hash value.

[0137] In the embodiment of the specification, by converting the target string after deleting the update mark and the update status data into binary data, and performing an XOR operation on the binary data based on the restored data, the binary data after the operation is obtained; and the target file identifier is obtained based on the binary data after the operation. Rapid data restoration of the target string is achieved, the efficiency of obtaining the target file identifier is improved, and the time complexity of the file system in the process of operating the target file is reduced.

[0138] In addition, before restoring the target string, the file system needs to generate restoration data based on the update status data corresponding to the target string and construct a restoration data set, so as to quickly restore the target string to the target file identifier based on the restoration data set. The specific implementation method is as follows.

[0139] Before determining the update status data of the target character string, the method further includes:

[0140] Obtaining update status data of the target character string;

[0141] Converting the updated state data into binary data, and calculating the binary data based on a preset data algorithm to obtain restored data corresponding to the binary data;

[0142] A restoration data set is constructed based on the update status data and the restoration data.

[0143] The preset data algorithm may be set according to actual application, and this specification does not make any specific limitation on this.

[0144] Specifically, after the file system restores the target string, it needs to determine the update status data corresponding to the target string and convert the update status data into binary data. Then, based on a preset data algorithm, the binary data is calculated to obtain the restored data corresponding to the binary data. After the file system obtains the restored data, it determines the correspondence between the restored data and the update status information, and constructs a restored data set based on the restored data and the corresponding update status information.

[0145] Continuing with the above example, where the size of the update status data can be one byte. Correspondingly, the update status data can represent 256 types of update statuses. Based on this, before the file system decrypts the encrypted string, it can preprocess the compressed values (update status data) representing these 256 statuses, that is, preprocess the 256 update status data from 0 to 255, obtain the restored data corresponding to each update status data, and store the restored data and the update status data in an array of uint64_t

[256] , so that in the subsequent replacement process, the encryption string can be restored with only one bitwise XOR operation.

[0146] Among them, the process of preprocessing the compressed values representing 256 statuses can preprocess the compressed values representing 256 statuses through a preset data algorithm. The preset data algorithm can be the following Formula 1 and Formula 2.

[0147] dp[1<<i] = (1<<i)^3 Formula 1

[0148] dp[S] = dp[S^(S&-S)]|dp[S&-S] Formula 2

[0149] Among them, ^ represents the bitwise XOR operation; & represents AND, that is, the bitwise AND operation; S&-S represents obtaining the lowest 1 in the binary representation of S. For example, for 0b10010 (decimal 18), after obtaining it, we can get 0b00010; S can be understood as the compressed values representing 256 statuses from 0 to 255.

[0150] Specifically, the file system first processes the values with only one numerical "1" among the compressed values representing 256 statuses through Formula 1. There are only 8 such values; for example, 0b10000000 (decimal 128). By setting dp[1<<i] = (1<<i)^3, the 0b10000000 (decimal 128) is expanded into the binary data "00000001,00000000,00000000,00000000,00000000,00000000,00000000,00000000". We traverse i from 0 to 7 to obtain the expansion of these 8 values.

[0151] Next, we traverse S from 0 to 255 and use the state transition dp[S]=dp[S^(S&-S)]|dp[S&-S] to complete the expansion of 256 values ​​representing state compression and obtain 256 types of restored data.

[0152] The file processing method provided by the present application converts the update status data of the target string into binary data, and calculates the binary data based on a preset data algorithm to obtain the restoration data corresponding to the binary data; and constructs a restoration data set based on the update status data and the restoration data, so as to facilitate the subsequent rapid restoration of the target string based on the restoration data set, thereby reducing the time complexity of the file system's operation on the target file.

[0153] In addition, in the file processing method provided in the present application, after the file system converts the target file identifier into a target string, it can perform various processing on the target file based on the target string, and the specific implementation method is as follows.

[0154] After converting the target file identifier into a target character string, the method further includes:

[0155] The target file is stored based on the target character string.

[0156] Specifically, after the file system of the computer software converts the target file identifier into a target character string, the target file can be stored based on the target character string, so that the subsequent file system can perform various processing on the target file.

[0157] In actual applications, the file system can also propagate and / or use the target file based on the target string, thereby avoiding the problem of the initial file identifier occupying too much memory resources, and avoiding the incompatibility between the target file identifier and the file system, resulting in wasted time and labor costs for transforming the entire file system.

[0158] The file processing method provided by the present application processes the initial file identifier of the target file into a target file identifier with a smaller memory footprint through a preset algorithm, thereby avoiding the problem of the initial file identifier occupying too much memory resources, and converts the target file identifier into a target string based on the associated information of the target file identifier and preset identification rules, thereby solving the incompatibility problem between the target file identifier and the file system and avoiding the time and labor costs wasted in the process of transforming the entire file system.

[0159] The following combination Figure 2 , taking the application of the file processing method provided by the present application to the hash value encryption scenario as an example, the file processing method is further described. Figure 2A processing flow chart of a file processing method for encrypting a hash value provided by an embodiment of the present application is shown, which specifically includes the following steps:

[0160] Step S202: The file system converts the file name into a hash value.

[0161] Specifically, the file system of a computer game can convert the file name of the game file (represented by a string) into an unsigned 64-bit integer (uint64_t), that is, a hash value, through a hash algorithm.

[0162] Furthermore, the file system determines whether the hash value is the same as the historical hash value obtained by the hash algorithm. If so, it indicates that the hash value conflicts, and stops encrypting the hash value converted from the file name. The file system then uses the file name to store and disseminate the game file.

[0163] If not, it means that the hash value will not cause conflict, and step S204 is executed.

[0164] Among them, the game file can be understood as the target file in the above embodiment, the file name can be understood as the initial file identifier in the above embodiment, and the hash value can be understood as the target file identifier in the above embodiment.

[0165] Step S204: The file system converts the hash value into a character string.

[0166] The character string may be understood as the initial character string in the above embodiment.

[0167] Specifically, for an unsigned 64-bit integer that does not generate a conflict, it can be directly converted into a string with a length of 8B (8 bytes), wherein each character value (char) in the string is one byte in size, and 8 chars are equivalent to 1 uint64_t.

[0168] Step S206: The file system replaces the character "0" in the character string with the character "1".

[0169] In actual application, the file system of the computer game will add a character "0" at the end of the string and use the character "0" to determine the length of the entire string. The character "0" exists in the string converted from the hash value, and the file system of the computer game relies on this character "0" to determine the length of the entire string.

[0170] Therefore, in order to avoid misjudgment by the file system, all character values ​​in the string that are "0" can be changed to "1" to encrypt the string; and this can also be stored in a character value of one byte (2^8bit), which is called binary state compression.

[0171] For example, the character value can be any character from 0 to 255, and the string based on the character value can be (20,0,30,23,255,2,4,0), which is a string of length 8. After replacing the character "0" in the string with the character "1" and obtaining the replaced string (20,1,30,23,255,2,4,1), the stored value 0b01000001 (i.e. decimal 65) can be used to represent this modification, where the second and last 1s of the stored value indicate that the second and last digits of the original string have been modified. We put this value into the original string and get a new string of length 9, i.e. (101,20,1,30,23,255,2,4,1).

[0172] In actual applications, when the character "0" does not exist in the string, the storage value of the string modification information is also "0"; therefore, adding the storage value to the original string may cause incorrect recognition of the file system; based on this, when the file system determines that the storage bit is the character "0", it will change the storage value of the character "0" to the character "255", thereby avoiding incorrect recognition of the file system due to the presence of the character "0" in the string.

[0173] The stored value may be understood as the update status data in the above embodiment, and the character string (20, 1, 30, 23, 255, 2, 4, 1) may be understood as the update character string in the above embodiment.

[0174] Step S208: The file system determines an identification character for the encrypted character string.

[0175] Specifically, in order to more easily distinguish the encrypted string and other strings in the system, the file system will add an identification character before the encrypted string to indicate whether the string is encrypted, so that the file system can distinguish whether it is the string obtained by encrypting the hash value or the original name (original file name). The new string with a length of 10B is obtained, that is, (1,65,20,1,30,23,255,2,4,1).

[0176] The identification character may be understood as the update identification in the above embodiment.

[0177] Based on this, the original file name of the game file with a size of 60B is optimized to a string with a size of only 10B. Thus, the game file is stored and transmitted using a 10B string.

[0178] In the specific implementation process, after use or transmission, the encrypted string needs to be restored to an unsigned 64-bit integer through a decryption algorithm with the same efficiency.

[0179] When decrypting the encrypted string, by removing the first two newly added bits, that is, the stored value and the encryption flag; and according to the modified bits recorded by the stored value, change the characters replaced with '1' in the encrypted string to '0'.

[0180] However, it can be noted that the time complexity of encrypting the hash value is O(8), and the time complexity of decrypting the encrypted string is O(8). Although there is almost no additional increase in memory, the memory usage is reduced by 5 times. And the original file system and download system do not need to be modified. However, this method increases the time complexity of O(16) for each file operation.

[0181] Based on this, the file processing method provided in this application notes that the time complexity of the encryption process is difficult to optimize, but the decryption process can be optimized to O(1) time complexity by making a preprocessed table of only 2kb based on state compression, and this preprocessing process only takes a few milliseconds after being optimized by dynamic programming. Thus, the time complexity of operating on each file is reduced, and the specific implementation method is as follows.

[0182] Step S210: The file system preprocesses the value of state compression and stores it in an array.

[0183] Specifically, by preprocessing the 256 values representing state compression from 0 to 255, the binary data corresponding to each value is obtained and stored in an array of uint64_t

[256] (about 2kb), so that the subsequent replacement process of the character '1' in the encrypted string can be completed with only one bitwise XOR operation.

[0184] Among them, the preprocessing of the state compression value is: first, let dp[1<<i] = (1<<i)^3, and i traverses from 0 to 7.

[0185] Next, traverse S from 0 to 255 and use state transfer dp[S]=dp[S^(S&-S)]|dp[S&-S], where S is 256 values ​​representing state compression; ^ represents bitwise XOR operation; & represents AND, that is, bitwise AND operation, and S&-S means obtaining the lowest 1 in S in binary, such as 0b10010, and after taking it, you can get 0b00010.

[0186] Based on this, each 1-byte value representing state compression is expanded to a 64-bit (8-byte) binary number.

[0187] Step S212: The file system restores the encrypted string to a hash value.

[0188] Specifically, the file system deletes the first two digits of the encrypted string (1,65,20,1,30,23,255,2,4,1) to obtain the string (20,1,30,23,255,2,4,1). Then, the binary number corresponding to the value representing the state compression in the string is determined from the array, that is, the binary number corresponding to the character "65". The binary number can be "00000000,00000001,00000000,0000000,00000000,00000000,00000000,00000000,000000001".

[0189] The string (20,1,30,23,255,2,4,1) is then converted back to an unsigned 64-bit integer and XORed with dp

[101] (the binary number corresponding to the character "65") to complete the decryption process.

[0190] The file processing method provided by the present application converts the integer into a string compatible with the original framework before storage and dissemination by designing an encryption algorithm with both time and space advantages, and after use or dissemination, restores the string to an integer through an efficient decryption algorithm, thereby realizing the use of conflict-free hash values ​​to replace file names and optimize the memory of the file system, and using encryption and decryption algorithms based on state compression, the entire file system does not need to undergo code reconstruction and code testing at a very low memory and time cost, saving huge time costs.

[0191] Corresponding to the above method embodiment, the present application also provides a file processing device embodiment, Figure 3 FIG. 1 shows a schematic diagram of the structure of a file processing device provided by an embodiment of the present application. Figure 3 As shown, the device comprises:

[0192] The processing module 302 is configured to process the initial file identifier of the target file into a target file identifier through a preset algorithm;

[0193] The conversion module 304 is configured to convert the target file identifier into a target character string based on the associated information of the target file identifier and a preset identification rule when the target file identifier is different from the historical file identifier;

[0194] The historical file identifier is an identifier obtained by processing the initial file identifier of the historical file through a preset algorithm.

[0195] Optionally, the preset algorithm is a hash algorithm;

[0196] Correspondingly, the processing module 302 is further configured to process the initial file identifier of the target file into a target file identifier through a hash algorithm.

[0197] Optionally, the conversion module 304 is further configured to:

[0198] Determining attribute information and character size rules of the target file identifier from the associated information of the target file identifier;

[0199] Based on the attribute information of the target file identifier and the character size rule, converting the target file identifier into an initial character string;

[0200] The initial character string is updated based on a preset identification rule to obtain a target character string.

[0201] Optionally, the conversion module 304 is further configured to:

[0202] Determining the initial number of characters based on the attribute information of the target file identifier and the character size rule;

[0203] Converting the target file identifier into binary data, and dividing the binary data based on the initial number of characters to obtain a binary data set with the same number of initial characters;

[0204] The binary data set is converted into initial characters, and an initial character string is constructed based on the initial characters.

[0205] Optionally, the conversion module 304 is further configured to:

[0206] Determining character attributes of initial characters in the initial character string;

[0207] When the character attribute satisfies a preset identification rule, the initial character corresponding to the character attribute is updated to obtain an updated character string;

[0208] Determining update status data corresponding to the update character string;

[0209] Based on the update status data and the update character string, a target character string is determined.

[0210] Optionally, the conversion module 304 is further configured to:

[0211] The initial character corresponding to the character attribute is replaced by a preset update character to obtain an update character string, wherein the initial character is a character in the initial character string.

[0212] Optionally, the conversion module 304 is further configured to:

[0213] Determine an update identifier corresponding to the update string;

[0214] A target character string is constructed based on the update identifier, the update status data and the update character string.

[0215] Optionally, the file processing device further includes a restoration module configured to:

[0216] Determining update status data of the target character string;

[0217] Acquire the restoration data corresponding to the update status data from the restoration data set;

[0218] The target character string is restored based on the restoration data to obtain a target file identifier.

[0219] Optionally, the restoration module is further configured to:

[0220] Deleting the update identifier and the update status data in the target character string;

[0221] Convert the target character string into binary data, and perform an XOR operation on the binary data based on the restored data to obtain the binary data after the operation;

[0222] A target file identifier is obtained based on the binary data after the operation.

[0223] Optionally, the restoration module is further configured to:

[0224] Obtaining update status data of the target character string;

[0225] Converting the updated state data into binary data, and calculating the binary data based on a preset data algorithm to obtain restored data corresponding to the binary data;

[0226] A restoration data set is constructed based on the update status data and the restoration data.

[0227] Optionally, the file processing device further includes a storage module configured to:

[0228] The target file is stored based on the target character string.

[0229] The file processing device provided by the present application processes the initial file identifier of the target file into a target file identifier with a smaller memory footprint through a preset algorithm, thereby avoiding the problem of the initial file identifier occupying too much memory resources, and converts the target file identifier into a target string based on the associated information of the target file identifier and preset identification rules, thereby solving the incompatibility problem between the target file identifier and the file system and avoiding the time and labor costs wasted in the process of transforming the entire file system.

[0230] The above is a schematic scheme of a file processing device of the present embodiment. It should be noted that the technical scheme of the file processing device and the technical scheme of the above-mentioned file processing method belong to the same concept. For details not described in detail in the technical scheme of the file processing device, please refer to the description of the technical scheme of the above-mentioned file processing method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.

[0231] Figure 4 The block diagram of a computing device 400 according to an embodiment of the present application is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.

[0232] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0233] In one embodiment of the present application, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0234] Computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 400 may also be a mobile or stationary server.

[0235] The processor 420 is used to execute computer executable instructions of the file processing method.

[0236] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned file processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned file processing method.

[0237] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used in a file processing method when executed by a processor.

[0238] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned file processing method belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the above-mentioned file processing method.

[0239] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the file processing method when executed by the chip.

[0240] It should be noted that the technical solution of the chip and the technical solution of the above-mentioned file processing method belong to the same concept. For details not described in detail in the technical solution of the chip, please refer to the description of the technical solution of the above-mentioned file processing method.

[0241] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0242] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0243] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0244] 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, reference can be made to the relevant descriptions of other embodiments.

[0245] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A file processing method, characterized in that: include: Processing the initial file identifier of the target file into a target file identifier through a preset algorithm, wherein the initial file identifier is the file name of the target file; In the case that the target file identifier is different from the historical file identifier, the target file identifier is converted into a target character string based on the associated information of the target file identifier and the preset identification rule, wherein the conversion of the target file identifier into a target character string based on the associated information of the target file identifier and the preset identification rule comprises: determining the attribute information and the character size rule of the target file identifier from the associated information of the target file identifier; converting the target file identifier into an initial character string based on the attribute information and the character size rule of the target file identifier; updating the initial character string based on the preset identification rule to obtain the target character string, wherein the character size rule is a requirement for the size of a character in a file system constructed based on characters, and the preset identification rule is a naming requirement of the file system for character-type file names; The historical file identifier is an identifier obtained by processing the initial file identifier of the historical file through a preset algorithm.

2. The file processing method according to claim 1, characterized in that: The preset algorithm is a hash algorithm; Accordingly, the processing of the initial file identifier of the target file into the target file identifier by a preset algorithm includes: The initial file identifier of the target file is processed into the target file identifier through a hash algorithm.

3. The file processing method according to claim 1, characterized in that: The converting the target file identifier into an initial character string based on the attribute information of the target file identifier and the character size rule includes: Determining the initial number of characters based on the attribute information of the target file identifier and the character size rule; Converting the target file identifier into binary data, and dividing the binary data based on the initial number of characters to obtain a binary data set with the same number of initial characters; The binary data set is converted into initial characters, and an initial character string is constructed based on the initial characters.

4. The file processing method according to claim 1, characterized in that: The updating of the initial character string based on a preset identification rule to obtain a target character string includes: Determining character attributes of initial characters in the initial character string; When the character attribute satisfies a preset identification rule, the initial character corresponding to the character attribute is updated to obtain an updated character string; Determining update status data corresponding to the update character string; Based on the update status data and the update character string, a target character string is determined.

5. The file processing method according to claim 4, characterized in that: The updating of the initial character corresponding to the character attribute to obtain an updated character string includes: The initial character corresponding to the character attribute is replaced by a preset update character to obtain an update character string, wherein the initial character is a character in the initial character string.

6. The file processing method according to claim 4, characterized in that: The updating of the initial character string based on a preset identification rule to obtain a target character string includes: Determine an update identifier corresponding to the update string; A target character string is constructed based on the update identifier, the update status data and the update character string.

7. The file processing method according to claim 1, characterized in that: After converting the target file identifier into a target character string, the method further includes: Determining update status data of the target character string; Acquire the restoration data corresponding to the update status data from the restoration data set; The target character string is restored based on the restoration data to obtain a target file identifier.

8. The file processing method according to claim 7, characterized in that: The performing data restoration on the target character string based on the restoration data to obtain a target file identifier includes: Deleting the update identifier and the update status data in the target character string; Convert the target character string into binary data, and perform an XOR operation on the binary data based on the restored data to obtain the binary data after the operation; A target file identifier is obtained based on the binary data after the operation.

9. The file processing method according to claim 7, characterized in that: Before determining the update status data of the target character string, the method further includes: Obtaining update status data of the target character string; Converting the updated state data into binary data, and calculating the binary data based on a preset data algorithm to obtain restored data corresponding to the binary data; A restoration data set is constructed based on the update status data and the restoration data.

10. A file processing device, characterized in that: include: A processing module is configured to process an initial file identifier of a target file into a target file identifier through a preset algorithm, wherein the initial file identifier is a file name of the target file; A conversion module is configured to convert the target file identifier into a target character string based on the associated information of the target file identifier and a preset identification rule when the target file identifier is different from the historical file identifier, wherein the conversion module is further configured to: determine the attribute information and the character size rule of the target file identifier from the associated information of the target file identifier; convert the target file identifier into an initial character string based on the attribute information and the character size rule of the target file identifier; update the initial character string based on the preset identification rule to obtain the target character string, wherein the character size rule is a requirement for the size of a character in a file system constructed based on characters, and the preset identification rule is a naming requirement of the file system for character-type file names; The historical file identifier is an identifier obtained by processing the initial file identifier of the historical file through a preset algorithm.

11. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the file processing method according to any one of claims 1 to 9.

12. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the file processing method described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Method and device for adding and deciphering webpage enciphered data

    CN102685108A

  • File management module, printing device, file management method, file management program

    JP2009140063A