Data processing method and device, electronic equipment and storage medium

By creating separate hash value files for data storage requests and backing them up, the problem of low data storage efficiency under large data volumes is solved, and the speed and security of data operations are improved.

CN121387828APending Publication Date: 2026-01-23JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511400263.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing data storage methods are inefficient when handling large amounts of data, resulting in slower data operation response times.

Method used

By receiving data storage requests, determining the key and attribute fields of the data, performing hash calculations and sorting, creating separate files with hash values ​​as filenames to store the data, backing up the data in backup files, and building index files for quick data location.

Benefits of technology

The data storage method was optimized, which improved the response speed and efficiency of data operation requests and ensured business continuity and data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387828A_ABST
    Figure CN121387828A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: receiving a data storage request, and determining a first key value, a second key value and a plurality of attribute fields of to-be-stored first data in the data storage request; performing hash calculation on the first key value and the second key value to obtain a first hash value; according to a preset sorting rule, sorting the plurality of attribute fields to obtain a sorting result; determining a second hash value according to the sorting result and the first hash value; and creating a first file taking the second hash value as a file name in the main folder, and storing the first data in the first file. Therefore, the independent first file is created for the first data in the data storage request, and the first data is stored through the independent first file, so that all the data are not stored in one file any more, optimization of a data storage mode is achieved, and improvement of the response speed and efficiency of a subsequent data operation request is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a data processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] At present, in the process of storing data through a file, the data is usually stored in a file. However, when executing a data operation request, the data storage manner usually needs to read all data in the entire file. When the data amount in the file is large, the efficiency of data operation will be significantly reduced. Therefore, how to optimize the data storage manner is crucial for improving the response speed and efficiency of data operation. SUMMARY

[0003] The present application provides a data processing method and device, electronic equipment and storage medium.

[0004] The present application provides a data processing method and device, electronic equipment and storage medium.

[0005] The data processing method provided by the present application receives a data storage request, and determines a first key value, a second key value and a plurality of attribute fields of first data to be stored in the data storage request. The first key value and the second key value are subjected to hash calculation to obtain a first hash value. The plurality of attribute fields are sorted according to a preset sorting rule to obtain a sorting result. A second hash value is determined according to the sorting result and the first hash value. A first file with the second hash value as a file name is created in a main folder, and the first data is saved into the first file. Thus, a separate first file is created for the first data in the data storage request, and the first data is stored through the separate first file, so that all data is no longer stored in a file, the data storage manner is optimized, and the response speed and efficiency of subsequent data operation requests are improved.

[0006] Another aspect of the present application provides a data processing apparatus, comprising: a receiving module configured to receive a data storage request and determine a first key value, a second key value and a plurality of attribute fields of first data to be stored in the data storage request; a hash processing module configured to perform hash calculation on the first key value and the second key value to obtain a first hash value; an ordering module configured to perform ordering on the plurality of attribute fields according to a preset ordering rule to obtain an ordering result; a determining module configured to determine a second hash value according to the ordering result and the first hash value; and a saving module configured to create a first file with the second hash value as a file name in a main folder and save the first data into the first file.

[0007] The data processing apparatus provided by the embodiments of the present application receives a data storage request and determines a first key value, a second key value and a plurality of attribute fields of first data to be stored in the data storage request; performs hash calculation on the first key value and the second key value to obtain a first hash value; performs ordering on the plurality of attribute fields according to a preset ordering rule to obtain an ordering result; determines a second hash value according to the ordering result and the first hash value; and creates a first file with the second hash value as a file name in a main folder and saves the first data into the first file. In this way, a separate first file is created for the first data in the data storage request, and the first data is stored in the separate first file, so that all data is no longer stored in one file, and the data storage manner is optimized, which helps to improve the response speed and efficiency of subsequent data operation requests.

[0008] Another aspect of the present application provides an electronic device, comprising: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the data processing method of the embodiments of the present application when executing the computer program.

[0009] Another aspect of the present application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement the data processing method disclosed in the embodiments of the present application.

[0010] Another aspect of the present application provides a computer program product comprising a computer program, wherein the computer program is executable by a processor to implement the data processing method in the embodiments of the present application.

[0011] The other effects of the above optional modes will be described in the following with reference to specific embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0012] The accompanying drawings are used to better understand the present application, but do not constitute limitations on the present application. Among them: Figure 1is a flowchart of a data processing method according to an embodiment of the present application.

[0013] Figure 2 is a flowchart of a data processing method according to another embodiment of the present application.

[0014] Figure 3 is a flowchart of a data processing method according to another embodiment of the present application.

[0015] Figure 4 is a flowchart of a data processing method according to another embodiment of the present application.

[0016] Figure 5 is a flowchart of a data processing method according to another embodiment of the present application.

[0017] Figure 6 is a flowchart of a data processing method according to another embodiment of the present application.

[0018] Figure 7 is a flowchart of a data processing method according to another embodiment of the present application.

[0019] Figure 8 is a flowchart of a data processing method according to another embodiment of the present application.

[0020] Figure 9 is a flowchart of a data processing method according to another embodiment of the present application.

[0021] Figure 10 is a structural diagram of a data processing apparatus according to an embodiment of the present application.

[0022] Figure 11 is a block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which like or similar elements are denoted by the same or similar reference signs, and examples of the embodiments are described in detail below with reference to the accompanying drawings, in which like or similar elements are denoted by the same or similar reference signs. The embodiments described below by reference to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as limiting the present application.

[0024] The data processing method, apparatus, electronic device and storage medium of the embodiments of the present application are described below with reference to the accompanying drawings.

[0025] Figure 1is a flowchart of a data processing method according to an embodiment of the present application. It should be noted that the data processing method provided in this embodiment is executed by a data processing apparatus, which can be implemented by software and / or hardware. In this embodiment, the data processing apparatus can be an electronic device or can be configured in an electronic device to enable the electronic device to have a data processing function.

[0026] In this embodiment, the electronic device can include, but is not limited to, a terminal device and a server, and the like. The electronic device is not limited in this embodiment.

[0027] As shown in Figure 1 the data processing method can include the following steps. In step 101, a data storage request is received, and a first key value, a second key value and a plurality of attribute fields of first data to be stored in the data storage request are determined.

[0028] The first data can be any data, and the first data is not limited in this embodiment.

[0029] In some embodiments, the first key value and the second key value of the first data are two different random values generated for the first data according to a preset random algorithm.

[0030] In other embodiments, a first attribute field of a plurality of candidate attribute fields of the first data can be used as the first key value of the first data, a second attribute field of the plurality of candidate attribute fields of the first data can be used as the second key value of the first data, and other attribute fields of the plurality of candidate attribute fields of the first data except the first attribute field and the second attribute field can be used as the plurality of attribute fields of the first data. The first attribute field and the second attribute field are different.

[0031] It should be noted that the preset random algorithm is a random algorithm that is preset according to actual needs.

[0032] It can be understood that the plurality of attribute fields of the first data are different when the data type of the first data is different. For example, the first data is product data, and the plurality of attribute fields of the product data can include at least two of the following: product type, product name, product brand, product price, product evaluation, and the like. For another example, the first data is order data, and the plurality of attribute fields of the order data can include at least two of the following: order identifier, user identifier, product name, product quantity, product price, order status, order date, delivery address, and the like. For another example, the first data is delivery data, and the plurality of attribute fields of the delivery data can include at least two of the following: delivery identifier, delivery address, delivery method, delivery status, delivery time, consignee name, consignee phone number, and the like.

[0033] Step 102, hash calculation is performed on the first key value and the second key value to obtain a first hash value.

[0034] In some embodiments, the first hash value can be obtained by performing hash calculation on the first key value and the second key value according to a preset hash algorithm.

[0035] The preset hash algorithm is a hash algorithm preset according to actual requirements, for example, the preset hash algorithm can be Message Digest Algorithm 5 (MD5), or Secure Hash Algorithm (SHA), etc., and the preset hash algorithm is not specifically limited in this embodiment.

[0036] Step 103, sorting is performed on the plurality of attribute fields according to a preset sorting rule to obtain a sorting result.

[0037] The preset sorting rule is a sorting rule set according to actual requirements, for example, the plurality of attribute fields can be sorted according to the order of American Standard Code for Information Interchange (ASCII) code of the first letter of the attribute field from small to large, or from large to small. For another example, the plurality of attribute fields can be sorted according to the preset letter order (for example, the order of pinyin letters) according to the first letter of the attribute field, and the preset sorting rule is not specifically limited in this embodiment.

[0038] Step 104, the second hash value is determined according to the sorting result and the first hash value.

[0039] In some embodiments, the second hash value can be obtained by performing hash calculation on the sorting result and the first hash value.

[0040] In another embodiment, the sorting result can also be serialized to obtain serialized data, and the second hash value can be obtained by performing hash calculation on the serialized data and the first hash value. Thus, the second hash value is accurately obtained.

[0041] In some embodiments, the serialized data can be in a string format, and can also be in other formats, and the format of the serialized data is not specifically limited in this embodiment. That is, in some embodiments, the sorting result can be serialized into a string.

[0042] Step 105, a first file with the second hash value as the file name is created in the main folder, and the first data is saved into the first file.

[0043] The data processing method provided in the embodiments of the present application can receive a data storage request, determine a first key value, a second key value and a plurality of attribute fields of first data to be stored in the data storage request, perform hash calculation on the first key value and the second key value to obtain a first hash value, sort the plurality of attribute fields according to a preset sorting rule to obtain a sorting result, determine a second hash value according to the sorting result and the first hash value, create a first file with the second hash value as a file name in a main folder, and save the first data into the first file. In this way, a separate first file is created for the first data in the data storage request, and the first data is stored in the separate first file, so that all data is no longer stored in one file, and the optimization of the data storage mode is achieved, which helps to improve the response speed and efficiency of subsequent data operation requests.

[0044] Based on the above embodiments, in order to effectively ensure business continuity and data security and reduce the risk of data loss, in some embodiments, a second file with the second hash value as a file name can be created in the backup file, and the first data is saved into the second file. In this way, the first data is backed up, which helps to ensure the subsequent business continuity and data security.

[0045] Based on the above embodiments, in order to facilitate subsequent processing of data operation requests (such as data query requests, data modification requests or data deletion requests), the second hash value can be obtained conveniently, so as to quickly obtain the file used for saving the corresponding data according to the second hash value, in some embodiments, a key-value pair with the first hash value as a first key value and the sorting result and the second hash value as a value can be constructed, and the key-value pair is saved into an index file.

[0046] In order to clearly understand the data processing method of the embodiments, the following will be described in combination with Figure 2 The method of the embodiments is further exemplarily described.

[0047] Figure 2 is a flowchart of a data processing method according to another embodiment of the present application.

[0048] As shown in Figure 2 may include: Step 201, receiving a data storage request, and determining a first key value, a second key value and a plurality of attribute fields of first data to be stored in the data storage request.

[0049] Step 202, performing hash calculation on the first key value and the second key value to obtain a first hash value h1.

[0050] Step 203, sorting the plurality of attribute fields according to a preset sorting rule to obtain a sorting result v1.

[0051] Step 204, serialize the sorting result v1 to obtain serialized data s1.

[0052] Step 205, perform hash calculation on the serialized data s1 and the first hash value h1 to obtain a second hash value h2.

[0053] Step 206, create a first file with the second hash value h2 as the file name in the main folder, and save the first data into the first file.

[0054] Step 207, construct a key-value pair with the first hash value h1 as the first key value, and with the sorting result v1 and the second hash value h2 as the value, and save the key-value pair into the index file.

[0055] In some embodiments, the first key value and the second key value can also be saved into the value of the key-value pair.

[0056] It should be noted that the execution order of step 206 and step 207 is not limited, in some embodiments, step 206 can be executed first, and then step 207 can be executed, or step 207 can be executed first, and then step 206 can be executed, or step 206 and step 207 can be executed synchronously, and the embodiments do not make specific limitation on this.

[0057] Step 208, in the backup folder, create a second file with the second hash value h2 as the file name, and save the first data into the second file.

[0058] In this embodiment, by creating a separate first file for the first data in the data storage request, and storing the first data through the separate first file, the data storage mode is optimized, which helps to improve the response speed and efficiency of subsequent data operation requests, and by creating a separate second file for the first data in the backup folder, and saving the first data into the second file, the data backup of the first data is realized, which helps to improve the continuity of the business and the data security.

[0059] In some embodiments, after storing the first data through the data storage request, the first file containing the first data can be operated through the data operation request. In order to clearly understand the process of operating the first file containing the first data through the data operation request, the process will be described below in combination with the data operation request. Figure 3 The process will be described below in combination with the data operation request.

[0060] Figure 3 is a flow diagram of a data processing method according to another embodiment of the application.

[0061] AsFigure 3 The method shown in addition to the steps involved in the method Figure 1 The method shown in addition to the steps involved in the method Step 301, receiving a data operation request, wherein the data operation request is at least one of a data query request, a data deletion request and a data modification request.

[0062] Step 302, determining a first key value and a second key value according to the data operation request.

[0063] In some embodiments, the first key value and the second key value can be extracted from the data operation request.

[0064] Step 303, obtaining a key-value pair from the index file according to a first hash value matched with the first key value and the second key value.

[0065] In some embodiments, the first hash value matched with the first key value and the second key value can be obtained from a pre-stored correspondence between the first key value, the second key value and the hash value.

[0066] In other embodiments, the first hash value can be obtained by hashing the first key value and the second key value.

[0067] In this embodiment, after the first hash value is determined, the key-value pair with the first hash value as the key can be obtained from the index file.

[0068] Step 304, obtaining a second hash value from the value of the key-value pair.

[0069] Step 305, obtaining a first file with the second hash value as the file name from the main folder and performing an operation on the first file according to the data operation request.

[0070] It can be understood that in the case of different types of data operation requests, the operation on the first file according to the data operation request is different, which is illustrated as follows: As an example, in the case of a data query request as the data operation request, the first data in the first file can be taken as the query result of the data query request.

[0071] After obtaining the query result, the query result can also be output, so that the corresponding user can conveniently know the query result of the corresponding data query request.

[0072] As another example, in the case of a data deletion request as the data operation request, the first file can be deleted.

[0073] As another example, in the case of a data modification request as the data operation request, the second data after modification can be obtained according to the data modification request, and the first data in the first file can be updated to the second data.

[0074] In some embodiments, in order to make the file content of the second file in the backup file consistent with the file content of the first file, the second file with the second hash value as the file name can also be obtained from the backup folder correspondingly, and the second file is operated according to the data operation request.

[0075] It can be understood that the operation of the second file according to the data operation request is different in the case that the type of the data operation request is different, and examples are as follows: In some embodiments, in the case that the data operation request is a data query request, the first data in the second file can be taken as the query result of the data query request. Further, the query result can be output.

[0076] In some other embodiments, in the case that the data operation request is a data deletion request, the second file can be deleted.

[0077] In some other embodiments, in the case that the data operation request can be a data modification request, the second data obtained according to the data modification request can be used to modify the first data in the second file.

[0078] In some embodiments, in the case that the data operation request is a data deletion request, the key-value pair in the index file can also be deleted. Thus, the storage space can be saved, and data inconsistency can be avoided.

[0079] In this embodiment, after receiving the data operation request, the first key value and the second key value are determined according to the data operation request, the key-value pair is obtained from the index file according to the first hash value matched with the first key value and the second key value, the second hash value is obtained from the value of the key-value pair, the first file with the second hash value as the file name is obtained from the main folder, and the first file is operated according to the data operation request. Thus, the first file required when the data operation request is operated is quickly determined in combination with the data operation request, which helps to improve the response speed and efficiency of the data operation request.

[0080] Figure 4 is a flowchart of a data processing method according to another embodiment of the application.

[0081] As shown in Figure 4 , the method further includes the following steps in addition to the steps involved in Figure 1 : Step 401, receiving a data operation request, wherein the data operation request is at least one of a data query request, a data deletion request and a data modification request.

[0082] Step 402, according to the data operation request, determining the first key value, the second key value and the plurality of attribute fields.

[0083] In some embodiments, the first key value and the second key value are extracted from the data operation request, and the attribute field corresponding to the attribute keyword of the data operation request is determined according to the attribute keyword.

[0084] Step 403, determining the first hash value matched with the first key value and the second key value.

[0085] It should be noted that the specific implementation of step 403 can be referred to the related description in other embodiments, which will not be repeated here.

[0086] Step 404, determining the sorting result of the plurality of attribute fields.

[0087] In some embodiments, the sorting result of the plurality of attribute fields can be determined from the pre-stored corresponding relationship between the attribute field and the sorting result.

[0088] In some other embodiments, the plurality of attribute fields can be sorted according to the preset sorting rule to obtain the sorting result.

[0089] Step 405, according to the first hash value and the sorting result, obtaining the key value pair from the index file.

[0090] In some embodiments, the key value pair with the first hash value as the key and the value of the key including the sorting result can be obtained from the index file.

[0091] Step 406, obtaining the second hash value from the value of the key value pair.

[0092] Step 407, obtaining the first file with the second hash value as the file name from the main folder, and performing operation on the first file according to the data operation request.

[0093] It should be noted that the specific description of steps 406 and 407 can be referred to the related description in other embodiments, which will not be repeated here.

[0094] In order to clearly understand the present application, the following will be described in combination with Figure 5 The processing process of the data processing method of the embodiment when the data operation request is the first data query request will be described exemplarily. It should be noted that the first data query request is used to query the plurality of attribute fields corresponding to the first key value and the second key value.

[0095] Figure 5 is a flow diagram of the data processing method according to another embodiment of the present application.

[0096] AsFigure 5 As shown in Figure 1 In addition to the steps involved in the Step 501, receiving a first data query request.

[0097] Step 502, determining a first key value and a second key value according to the first data query request.

[0098] Step 503, performing hash calculation on the first key value and the second key value to obtain a first hash value.

[0099] Step 504, obtaining a key-value pair with the first hash value as the key from the index file.

[0100] Step 505, obtaining a sorting result from the value of the key-value pair, wherein the sorting result is obtained by sorting a plurality of attribute fields.

[0101] Step 506, taking the sorting result as the query result of the first data query request, and outputting the query result.

[0102] In order to clearly understand the present application, the following will be described in combination with Figure 6 The processing process of the data processing method of the embodiment when the data operation request is a second data query request will be described exemplarily. It should be noted that the second data query request is used to query according to the first key value, the second key value and the plurality of attribute fields to obtain the corresponding query result.

[0103] Figure 6 is a flow diagram of a data processing method according to another embodiment of the present application.

[0104] As shown in Figure 6 In addition to the steps involved in the Figure 1 Step 601, receiving a second data query request and determining a first key value, a second key value and a plurality of attribute fields according to the second data query request.

[0105] In some embodiments, the first key value and the second key value are extracted from the second data query request, and the attribute field corresponding to the attribute keyword of the second data query request can also be determined according to the attribute keyword.

[0106] Step 602, performing hash calculation on the first key value and the second key value to obtain a first hash value.

[0107] It should be noted that the first key value in the embodiment can be referred to as a primary key value, and correspondingly, the second key value can also be referred to as an auxiliary key value.

[0108] ​Step 603, according to the preset sorting rule, the plurality of attribute fields are sorted to obtain a sorting result.

[0109] Step 604, according to the first hash value and the sorting result, a key-value pair is obtained from the index file.

[0110] In some embodiments, a key-value pair with the first hash value as the key and the value of the key including the sorting result can be obtained from the index file.

[0111] Step 605, a second hash value is extracted from the value of the key-value pair.

[0112] Step 606, a first file with the second hash value as the file name is obtained from the main folder, first data in the first file is taken as the query result of the second data query request, and the query result of the second data query request is output.

[0113] In order to clearly understand the present application, the following will be described in combination with Figure 7 The processing process of the data processing method of the embodiment is exemplarily described when the data deletion request is a data deletion request. It should be noted that the data deletion request is used for data deletion according to the first key value and the second key value.

[0114] Figure 7 is a flow diagram of a data processing method according to another embodiment of the present application.

[0115] As Figure 7 indicated, in addition to the steps involved in Figure 1 , the following steps are also included: Step 701, receiving a data deletion request.

[0116] Step 702, according to the data deletion request, determining a first key value and a second key value.

[0117] In some embodiments, the first key value and the second key value can be extracted from the data deletion request.

[0118] Step 703, performing hash calculation on the first key value and the second key value to obtain a first hash value.

[0119] Step 704, obtaining a key-value pair with the first hash value as the key from the index file.

[0120] Step 705, obtaining a second hash value from the value of the key-value pair.

[0121] It should be noted that in addition to the second hash value, the value of the key-value pair can also include a sorting result obtained by sorting a plurality of attribute fields.

[0122] Step 706: Obtain the first file with the second hash value as the filename from the main folder, and delete the first file in the main folder.

[0123] Step 707: Delete the key-value pair from the index file.

[0124] To ensure a clear understanding of this application, the following will be combined with... Figure 8 The following is an exemplary description of the data processing method of this embodiment when the first data modification request is a first data modification request. It should be noted that the first data modification request is used to modify multiple attribute fields corresponding to the first data, and the first data modification request includes the modified target attribute fields of the first data. Additionally, the first data modification request may also include a first key value and a second key value of the first data.

[0125] Figure 8 This is a schematic flowchart of a data processing method according to another embodiment of this application.

[0126] like Figure 8 As shown, in Figure 1 In addition to the steps shown, the following steps are also included: Step 801: Receive the first data modification request.

[0127] Step 802: Determine the first key value and the second key value based on the first data modification request.

[0128] In this embodiment, the first key value and the second key value can be extracted from the first data modification request.

[0129] Step 803: Perform a hash calculation on the first key value and the second key value to obtain the first hash value.

[0130] Step 804: Sort multiple target attribute fields according to preset sorting rules to obtain the target sorting result.

[0131] Step 805: Replace the sorting result in the key-value pairs with the first hash value in the index file with the target sorting result.

[0132] To ensure a clear understanding of this application, the following will be combined with... Figure 9 The processing procedure of the data processing method in this embodiment is described exemplarily when the second data modification request is a second data modification request. It should be noted that the second data modification request is used to instruct the first data to be modified into the second data. Furthermore, the second data modification request may also include a first key value and a second key value of the first data.

[0133] Figure 9 This is a schematic flowchart of a data processing method according to another embodiment of this application.

[0134] As shown in Figure 9 the steps involved in Figure 1 the steps involved in Step 901, receiving a second data modification request.

[0135] Step 902, determining a first key value, a second key value and a plurality of attribute fields according to the second data modification request.

[0136] In this embodiment, the first key value and the second key value can be extracted from the second data modification request, and the plurality of attribute fields can be extracted from the second data modification request correspondingly.

[0137] Step 903, performing hash calculation on the first key value and the second key value to obtain a first hash value.

[0138] Step 904, sorting the plurality of attribute fields according to a preset sorting rule to obtain a sorting result.

[0139] Step 905, serializing the sorting result to obtain serialized data.

[0140] Step 906, performing hash calculation on the serialized data and the first hash value to obtain a second hash value.

[0141] Step 907, obtaining a first file with the second hash value as a file name from a main folder, and modifying first data in the first file to second data.

[0142] That is, in this embodiment, the second data can be used to overwrite the first data in the first file.

[0143] In other embodiments, a possible alternative for obtaining the second hash value can be: according to the sorting result and the first hash value, obtaining, from an index file, a key value pair with the first hash value as a key and the value of the key including the sorting result, and obtaining the second hash value from the value of the key value pair.

[0144] Corresponding to the data processing method provided in the above several embodiments, an embodiment of the present application further provides a data processing apparatus. Since the data processing apparatus provided in the embodiment of the present application corresponds to the data processing method provided in the above several embodiments, the implementation of the data processing method is also applicable to the data processing apparatus provided in the embodiment of the present application, which will not be described in detail in this embodiment.

[0145] Figure 10is a structural schematic diagram of a data processing apparatus according to an embodiment of the present application. It should be noted that the data processing apparatus can be implemented in a software and / or hardware manner, and in the embodiment, the data processing apparatus can be an electronic device or can be configured in an electronic device. In the embodiment, the electronic device can include, but is not limited to, a terminal device and a server, and the like, and the embodiment does not specifically limit the electronic device.

[0146] As shown in Figure 10 The data processing apparatus 1000 includes a receiving module 1001, a hash processing module 1002, an ordering module 1003, a determining module 1004, and a saving module 1005, wherein: The receiving module 1001 is configured to receive a data storage request, and determine a first key value, a second key value, and a plurality of attribute fields of first data to be stored in the data storage request.

[0147] The hash processing module 1002 is configured to perform hash calculation on the first key value and the second key value to obtain a first hash value.

[0148] The ordering module 1003 is configured to perform ordering on the plurality of attribute fields according to a preset ordering rule to obtain an ordering result.

[0149] The determining module 1004 is configured to determine a second hash value according to the ordering result and the first hash value.

[0150] The saving module 1005 is configured to create a first file with the second hash value as a file name in a main folder, and save the first data into the first file.

[0151] In an embodiment of the present application, the determining module 1004 is specifically configured to serialize the ordering result to obtain serialized data, and perform hash calculation on the serialized data and the first hash value to obtain the second hash value.

[0152] In an embodiment of the present application, the apparatus can further include: A backup module is configured to create a second file with the second hash value as a file name in a backup file, and save the first data into the second file.

[0153] In an embodiment of the present application, the apparatus can further include: A first processing module is configured to construct a key-value pair with the first hash value as a first key value, and with the ordering result and the second hash value as a value, and save the key-value pair into an index file.

[0154] In an embodiment of the present application, the apparatus can further include: The second processing module is configured to receive a data operation request, wherein the data operation request is at least one of a data query request, a data deletion request, and a data modification request; determine a first key value and a second key value according to the data operation request; obtain a key-value pair from the index file according to a first hash value matched with the first key value and the second key value; obtain a second hash value from a value of the key-value pair; and obtain a first file with the second hash value as a file name from the master folder and perform an operation on the first file according to the data operation request.

[0155] In an embodiment of the present application, the second processing module determines the first key value and the second key value according to the data operation request in the following manner: determines the first key value, the second key value, and a plurality of attribute fields according to the data operation request. The second processing module obtains the key-value pair from the index file according to the first hash value matched with the first key value and the second key value in the following manner: determines the first hash value matched with the first key value and the second key value; determines a sorting result of the plurality of attribute fields; and obtains the key-value pair from the index file according to the first hash value and the sorting result.

[0156] In an embodiment of the present application, the apparatus can further include: The third processing module is configured to obtain a second file with the second hash value as a file name from the backup folder and perform an operation on the second file according to the data operation request.

[0157] In an embodiment of the present application, when the data operation request is a data deletion request, the apparatus can further include a deletion module configured to delete the key-value pair in the index file.

[0158] The data processing apparatus according to an embodiment of the present application receives a data storage request and determines a first key value, a second key value, and a plurality of attribute fields of first data to be stored in the data storage request; performs hash calculation on the first key value and the second key value to obtain a first hash value; sorts the plurality of attribute fields according to a preset sorting rule to obtain a sorting result; determines a second hash value according to the sorting result and the first hash value; creates a first file with the second hash value as a file name in a master folder; and saves the first data into the first file. Thus, a separate first file is created for the first data in the data storage request, and the first data is stored in the separate first file, so that all data is no longer stored in one file, and the data storage manner is optimized, which helps to improve the response speed and efficiency of subsequent data operation requests.

[0159] According to an embodiment of the present application, an electronic device is provided.

[0160] Figure 11 is a block diagram of an electronic device according to an embodiment of the present application.

[0161] As shown in Figure 11 The electronic device includes: a memory 1101, a processor 1102, and computer instructions stored in the memory 1101 and executable on the processor 1102.

[0162] The processor 1102 implements the data processing method provided in the above embodiments when executing the instructions.

[0163] Further, the electronic device further includes: a communication interface 1103 for communication between the memory 1101 and the processor 1102.

[0164] The memory 1101 is used to store computer instructions executable on the processor 1102.

[0165] The memory 1101 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.

[0166] The processor 1102 is used to implement the data processing method of the above embodiments when executing the program.

[0167] If the memory 1101, the processor 1102 and the communication interface 1103 are independently implemented, the communication interface 1103, the memory 1101 and the processor 1102 can be connected to each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 11 only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0168] Optionally, in specific implementation, if the memory 1101, the processor 1102 and the communication interface 1103 are integrated on a chip, the memory 1101, the processor 1102 and the communication interface 1103 can complete communication between each other through an internal interface.

[0169] The processor 1102 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0170] This application also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method disclosed in the embodiments of this application.

[0171] This application also proposes a computer program product, including a computer program that, when executed by a processor, implements the data processing method described in the embodiments of this application.

[0172] It should be noted that the acquisition, transmission, storage, use, and processing of data in this application's technical solution all comply with the relevant provisions of laws and regulations.

[0173] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0174] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0175] Any processes or methods described in the flowcharts or otherwise described herein can be understood as representing a module, segment, or portion of code that includes one or more executable instructions for implementing the specified logical function or process, and the various embodiments of the application contemplate that additional implementation can be implemented in hardware, software, firmware, or a combination thereof. The various embodiments of the application contemplate that the order of the steps or methods can be changed, or that additional steps or methods can be added, or that some steps or methods can be omitted, or that some steps or methods can be performed substantially simultaneously, or that some steps or methods can be performed in reverse order, depending on the functionality involved. These and other variations are contemplated by the various embodiments of the application.

[0176] Logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a computer- readable storage medium or a computer-readable communication medium. The computer- readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include the following: an electrical connection having one or more wires (electronic), a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber (optical), and a portable compact disc read-only memory (CDROM). Note that the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0177] It is to be understood that the various parts of the present application can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any of the following technologies, or a combination thereof, can be used: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and so forth.

[0178] Those skilled in the art of the present technology can understand that all or part of the steps carried out by the above-mentioned embodiment methods can be completed by programs instructing related hardware, and the programs can be stored in a computer readable storage medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0179] In addition, each functional unit in each embodiment of the present application can be integrated into one processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. The integrated module, if realized in the form of a software functional module and sold or used as an independent product, can also be stored in a computer readable storage medium.

[0180] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-mentioned embodiments within the scope of the present application.

Claims

1. A data processing method, characterized by, The method comprises: receiving a data storage request and determining a first key value, a second key value and a plurality of attribute fields of first data to be stored in the data storage request; hashing the first key value and the second key value to obtain a first hash value; sorting the plurality of attribute fields according to a preset sorting rule to obtain a sorting result; determining a second hash value according to the sorting result and the first hash value; creating a first file with the second hash value as a file name in a main folder and saving the first data into the first file.

2. The method of claim 1, wherein, The determining of the second hash value according to the sorting result and the first hash value comprises: serializing the sorting result to obtain serialized data; hashing the serialized data and the first hash value to obtain the second hash value.

3. The method of claim 2, wherein, The method further comprises: creating a second file with the second hash value as a file name in a backup file and saving the first data into the second file.

4. The method of claim 3, wherein, The method further comprises: constructing a key-value pair with the first hash value as a first key value and the sorting result and the second hash value as a value; saving the key-value pair into an index file.

5. The method of claim 4, wherein, The method further comprises: receiving a data operation request, wherein the data operation request is at least one of a data query request, a data deletion request and a data modification request; determining the first key value and the second key value according to the data operation request; obtaining the key-value pair from the index file according to the first hash value matched with the first key value and the second key value; obtaining the second hash value from the value of the key-value pair; obtaining the first file with the second hash value as a file name from the main folder and operating the first file according to the data operation request.

6. The method of claim 5, wherein, The determining of the first key value and the second key value according to the data operation request comprises: determining the first key value, the second key value and the plurality of attribute fields according to the data operation request. The obtaining of the key-value pair from the index file according to the first hash value matched with the first key value and the second key value comprises: determining the first hash value matched with the first key value and the second key value; determining the sorting result of the plurality of attribute fields; obtaining the key-value pair from the index file according to the first hash value and the sorting result.

7. The method of claim 5, wherein, The method further comprises: obtaining the second file with the second hash value as a file name from the backup folder and operating the second file according to the data operation request.

8. The method of any one of claims 5-7, wherein, In the case that the data operation request is a data deletion request, the method further comprises: deleting the key-value pair in the index file.

9. A data processing apparatus, characterized by, The apparatus comprises: a receiving module configured to receive a data storage request and determine a first key value, a second key value and a plurality of attribute fields of first data to be stored in the data storage request; a hash processing module configured to hash the first key value and the second key value to obtain a first hash value; The sorting module is configured to sort the multiple attribute fields according to a preset sorting rule to obtain a sorting result. The determining module is configured to determine a second hash value according to the sorting result and the first hash value. The saving module is configured to create a first file with the second hash value as a file name in a main folder, and save the first data into the first file.

10. An electronic device, comprising: The computer program is configured to be executed by the processor to implement the method in any one of claims 1-8. The computer program is configured to be executed by the processor to implement the method in any one of claims 1-8.

11. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is configured to be executed by the processor to implement the method in any one of claims 1-8.

12. A computer program product, characterised in that, ​