Data processing method, device, equipment and storage medium
By merging data fragments that are smaller than the preset value and uploading fragments that are larger than the preset value, the problem that the fragment size does not meet the regulations when the cloud server uploads large files is solved, and the success rate of file upload and development efficiency are improved.
Patent Information
- Application Number
- CN202011074539.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-09
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-10-09
AI Technical Summary
When uploading large files to the cloud server, if the size of the fragmented files after the large file is fragmented does not meet the preset minimum size specified by the cloud manufacturer, the file upload will fail and the success rate will be reduced.
By obtaining multiple data fragments, merge the fragments whose file size is smaller than the preset value, generate the merged fragments whose file size is greater than or equal to the preset value, and gradually upload the merged fragments and the remaining fragments greater than the preset value to server.
It improves the success rate of file upload, avoids upload failures caused by non-compliant fragment sizes, and simplifies the development costs of clients and servers.
Smart Images

Figure CN112333238B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and storage medium. Background Art
[0002] With the development of various cloud server technologies, more and more users choose to upload large files generated or stored on the World Wide Web (web) or client to cloud servers for storage.
[0003] At present, when a web or client uploads a large file, in order to ensure the stability and efficiency of the upload, the web or client first splits the large file into pieces, and then uploads multiple pieces to the cloud server separately. At the same time, each cloud vendor that provides cloud servers will impose certain restrictions on the size of the pieces based on the consideration of the storage efficiency and reading efficiency of the pieces. The general restriction condition is that the size of the pieces other than the last piece must be larger than the preset minimum size specified by the cloud vendor, that is, to avoid the size of the pieces obtained after cutting the large file being too small.
[0004] However, in the current solution, if the size of the fragmented files after the large file is fragmented is small and does not meet the preset minimum size specified by the cloud vendor, the file upload will fail, reducing the success rate of the file upload. Summary of the invention
[0005] In order to avoid the problems existing in the related art, the present application provides a data processing method, device, equipment and storage medium.
[0006] According to a first aspect of an embodiment of the present application, a data processing method is provided, including:
[0007] Acquire multiple data slices, wherein the file sizes of the data slices are used to represent the sizes of the data volumes of the data slices;
[0008] For a first data slice whose file size is greater than a first preset value among the multiple data slices, merge at least two of the first data slices to obtain a merged slice, wherein the first data slices obtained from different merged slices are different from each other;
[0009] The merged slice and a second data slice among the multiple data slices are sent to a server, wherein a file size of the second data slice is greater than or equal to the first preset value.
[0010] In a possible implementation manner, after the step of obtaining a plurality of data shards, the method further includes:
[0011] Sorting the first data slices according to a preset order to obtain a slice sequence;
[0012] The step of merging at least two of the first data shards to obtain a merged shard comprises:
[0013] Starting from one end of the fragment sequence, at least two adjacent first data fragments in the fragment sequence are merged to obtain the merged fragment.
[0014] In a possible implementation manner, the first data slices are acquired sequentially;
[0015] The step of merging at least two of the first data shards to obtain a merged shard comprises:
[0016] According to the most recently acquired new first data fragment, determine in the fragment sequence a sub-fragment sequence corresponding to the new first data fragment, the sub-fragment sequence being a partial sequence that starts from one end of the fragment sequence and is continuously arranged in order;
[0017] Merging at least two first data slices selected from the sub-slice sequence to obtain the merged slice;
[0018] Determine a target merged shard corresponding to the new first data shard from the merged shards;
[0019] The step of sending the merged fragments to the server includes:
[0020] The target merged fragment is sent to the server.
[0021] In a possible implementation manner, the step of merging at least two first data slices having a file size greater than a first preset value among the multiple data slices to obtain a merged slice includes:
[0022] In a case where the number of the data slices is equal to a preset number value, determining at least two target first data slices in the first data slices, the sum of the file sizes of the target first data slices being greater than or equal to the first preset value;
[0023] The at least two target first data fragments are merged to obtain the merged fragment.
[0024] In a possible implementation manner, when the number of target first data shards for merging shards is a minimum value,
[0025] After the step of merging the at least two target first data fragments to obtain the merged fragment, the method further includes:
[0026] All the first data slices that have not been merged are merged and sent to the server.
[0027] In a possible implementation manner, before the step of determining, in the slice sequence, a sub-slice sequence corresponding to the new first data slice acquired most recently, the method further includes:
[0028] The shard sequence is queried, and when the shard sequence does not include the new first data shard, the shard sequence is updated according to the new first data shard.
[0029] In a possible implementation, the step of sending the merged shard and the second data shard among the multiple data shards to the server includes:
[0030] When receiving the sending instruction, sending the merged shard and the second data shard among the multiple data shards to the server;
[0031] Clear the fragment sequence.
[0032] In a possible implementation manner, the file size of the merged fragment is smaller than a second preset value, and the second preset value is larger than the first preset value.
[0033] In a possible implementation manner, the data slices further include data identifiers, and the data identifiers are used to identify the order in which the data slices are uploaded.
[0034] The step of sorting the first data slices according to a preset order to obtain a slice sequence includes:
[0035] The first data fragments are sorted according to the data identifiers to obtain the fragment sequence.
[0036] According to a second aspect of an embodiment of the present application, a data processing device is provided, including:
[0037] An acquisition module, used for acquiring a plurality of data slices, wherein the file size of the data slices is used for representing the size of the data volume of the data slices;
[0038] a merging module, configured to merge at least two first data slices whose file size is greater than a first preset value among the plurality of data slices to obtain a merged slice, wherein the first data slices obtained from different merged slices are different from each other;
[0039] The first sending module is used to send the merged slice and the second data slice among the multiple data slices to the server, wherein the file size of the second data slice is greater than or equal to the first preset value.
[0040] In a possible implementation manner, the device further includes:
[0041] A sorting module, used to sort the first data slices according to a preset order to obtain a slice sequence;
[0042] The merging module comprises:
[0043] The first merging submodule is used to merge at least two adjacent first data fragments in the fragment sequence starting from one end of the fragment sequence to obtain the merged fragment.
[0044] In a possible implementation manner, the first data slices are acquired sequentially;
[0045] The merging module comprises:
[0046] A first determining submodule is used to determine, according to the most recently acquired new first data slice, a sub-slice sequence corresponding to the new first data slice in the slice sequence, wherein the sub-slice sequence is a partial sequence that starts from one end of the slice sequence and is continuously arranged in order;
[0047] A second merging submodule, configured to merge at least two first data slices selected from the sub-slice sequence to obtain the merged slice;
[0048] A second determination submodule, configured to determine a target merged slice corresponding to the new first data slice from the merged slices;
[0049] The first sending module includes:
[0050] The first sending submodule is used to send the target merged segment to the server.
[0051] In a possible implementation manner, the merging module includes:
[0052] A third determining submodule, configured to determine, when the number of the data slices is equal to a preset number value, at least two target first data slices in the first data slices, the sum of the file sizes of the target first data slices being greater than or equal to the first preset value;
[0053] The third merging submodule is used to merge the at least two target first data fragments to obtain the merged fragment.
[0054] In a possible implementation manner, when the number of target first data shards for merging shards is obtained to be a minimum value, the device further includes:
[0055] The second sending module is used to merge the first data slices that have not been merged in all the first data slices and send them to the server.
[0056] In a possible implementation manner, the device further includes:
[0057] An updating module is used to query the fragment sequence, and when the fragment sequence does not contain the new first data fragment, update the fragment sequence according to the new first data fragment.
[0058] In a possible implementation manner, the first sending module includes:
[0059] A second sending submodule, configured to send the merged slice and a second data slice among the multiple data slices to the server when receiving a sending instruction;
[0060] The clearing submodule is used to clear the fragment sequence.
[0061] In a possible implementation manner, the file size of the merged fragment is smaller than a second preset value, and the second preset value is larger than the first preset value.
[0062] In a possible implementation manner, the data slices further include data identifiers, and the data identifiers are used to identify the order in which the data slices are uploaded.
[0063] The sorting module comprises:
[0064] A sorting submodule is used to sort the first data slices according to the data identifier to obtain the slice sequence.
[0065] According to a third aspect of an embodiment of the present application, a device is provided, the device comprising:
[0066] processor;
[0067] a memory for storing instructions executable by the processor;
[0068] The processor is configured to execute operations to implement the data processing method provided in this application.
[0069] According to the fourth aspect of an embodiment of the present application, a non-temporary computer-readable storage medium is provided. When the instructions in the storage medium are executed by a processor of a device, the device is enabled to perform an operation performed to implement a data processing method as provided in the present application.
[0070] According to the fifth aspect of an embodiment of the present application, an application is provided, comprising one or more instructions, which, when executed by a processor of a device, enables the device to perform an operation performed by a method for processing data as provided in the present application.
[0071] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0072] Acquire multiple data slices, wherein the file size of the data slice is used to characterize the size of the data volume of the data slice; for a first data slice among the multiple data slices whose file size is greater than a first preset value, merge at least two first data slices to obtain a merged slice, wherein the first data slices obtained from different merged slices are different from each other; send the merged slice and a second data slice among the multiple data slices to a server, wherein the file size of the second data slice is greater than or equal to the first preset value. In an embodiment of the present application, after acquiring a first data slice with a smaller data volume sent by a client, the communication device can merge at least two first data slices to obtain a merged slice with a larger data volume, and finally send the merged slice and the second data slice with a larger data volume among the acquired data slices to the server to complete the data slice upload process, thereby avoiding the failure of data slice upload due to the fact that the data slice obtained after file segmentation is smaller than the first preset value specified by the cloud vendor, thereby improving the success rate of file upload.
[0073] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.
[0075] Figure 1 is a structural schematic diagram of a data processing system according to an exemplary embodiment;
[0076] Figure 2 is a flow chart of a data processing method according to an exemplary embodiment;
[0077] Figure 3 is a schematic diagram of file uploading according to an exemplary embodiment;
[0078] Figure 4 is a schematic diagram of data processing for file upload according to an exemplary embodiment;
[0079] Figure 5 is a flowchart of another method for processing data according to an exemplary embodiment;
[0080] Figure 6 is a schematic diagram of data processing of a first data slice according to an exemplary embodiment;
[0081] Figure 7is a schematic diagram of data processing of another first data slice according to an exemplary embodiment;
[0082] Figure 8 is a block diagram of a data processing device according to an exemplary embodiment;
[0083] Fig. 9 is a block diagram of a device according to an exemplary embodiment;
[0084] Fig.10 is a block diagram of another device according to an exemplary embodiment. DETAILED DESCRIPTION
[0085] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0086] Figure 1 is a structural diagram of a data processing system according to an exemplary embodiment. Figure 1 As shown, the data processing method provided by the embodiment of the present disclosure is applied to a data processing system including a client / web terminal 10, a communication device 20 and a server 30, wherein the client / web terminal 10 is used to receive various upload operations input by the user, and receive various large files that the user needs to upload to the server 30, and to ensure upload stability and upload efficiency, after receiving various large files, the client / web terminal 10 can cut the large files into multiple data fragments, thereby uploading the large files in the form of multiple data fragments.
[0087] Specifically, after receiving the multiple data slices sent by the client / web terminal 10, the communication device 20 sends the multiple data slices to the servers 30 corresponding to various cloud vendors, thereby completing the process of sending and storing the large file in the cloud server. In one embodiment, the communication device 20 can be a gateway device.
[0088] It should be noted that various cloud vendors will impose certain restrictions on the size of data shards received by the server 30 based on considerations of shard storage and reading efficiency. The general restriction is that except for the last data shard, the size of other data shards must be larger than the preset minimum size specified by the cloud vendor, that is, it is necessary to ensure that the size of the shards obtained after cutting the large file is not too small.
[0089] However, in actual use, for example, in the scenario of transcoding and uploading live audio and video data streams, audio files and video files are generally transcoded and uploaded separately. Audio files are generally small, while the data volume of video files is related to the image content of the video frames contained in the video, which is usually large. At present, when live data is segmented, audio files and video files are segmented according to time. For example, live audio data and live video data within 5 seconds can be transcoded and compressed separately and uploaded to the server. Since the audio data is small, the data volume of the audio data after segmentation mostly does not meet the preset minimum size of data segmentation specified by each cloud vendor, resulting in the failure of uploading the live audio and video data stream.
[0090] Figure 2 is a flow chart of a data processing method according to an exemplary embodiment. Figure 2 As shown, the following steps are included:
[0091] Step 101: Acquire multiple data slices, where the file size of the data slices is used to represent the size of the data volume of the data slices.
[0092] In this step, the communication device may obtain multiple data slices from the client or the web, wherein the file size of the data slice is used to characterize the size of the data volume of the data slice.
[0093] Figure 3 is a schematic diagram of a file upload according to an exemplary embodiment. Figure 3 As shown, the process of cloud storage of files with larger file sizes is shown. The client / web end slices the file to obtain multiple data slices with smaller data volumes. The file sizes of the data slices are used to characterize the size of the data volumes of the data slices. For example, the client / web end slices a file with a data volume of 10 megabytes to obtain 20 data slices of 512 kilobytes. When uploading the file, the 20 sliced data slices of 512 kilobytes are sent to the communication device. The communication device obtains multiple data slices. The communication device can further perform selection operations and merging operations on the data slices, and upload the merged slices to the cloud server, thereby completing the cloud storage process.
[0094] Step 102: For the first data slices whose file size is greater than a first preset value among the multiple data slices, merge at least two of the first data slices to obtain merged slices, wherein the first data slices obtained from different merged slices are different from each other.
[0095] In this step, after acquiring multiple data slices, the communication device may first select a first data slice from the data slices, wherein the first data slice may be a data slice whose file size is smaller than the first preset value among the data slices. The first preset value may be a preset minimum size of a data slice that can be received that is preset by each cloud vendor, for example, the first preset value is 1 megabyte.
[0096] For example, if the client / web end segments an original file of 10 megabytes in size, 10 data segments of 512 kilobytes and 5 1 megabyte are obtained. The preset minimum size of the data segments that can be received set by each cloud vendor is 1 megabyte, that is, the first preset value. Then, when the communication device obtains the 10 data segments of 512 kilobytes and 5 1 megabyte, the 10 512 kilobytes are the first data segments that need to be merged, and the 5 1 megabyte data segments are the second data segments whose file size is greater than or equal to the first preset value. Since the file size of the 5 1 megabyte second data segments meets the preset minimum size of the data segments that can be received set by the cloud vendor, these second data segments can be uploaded to the server by the communication device without being merged.
[0097] Specifically, after the communication device determines the first data slices that need to be merged from the acquired data slices, it merges at least two of the first data slices to obtain a merged slice, so that the file size of the merged slice is greater than or equal to the first preset value. For example, the communication device can select 2 512-kilobyte first data slices from the 10 512-kilobyte data slices in the above example to merge, and obtain a 1-megabyte merged slice, so that the merged merged slice can meet the preset minimum size of the receivable data slices pre-set by the cloud vendor. Furthermore, the communication device can obtain multiple merged slices by performing multiple merge operations, and the first data slices obtained from different merged slices are different from each other, thereby ensuring that all the first data slices in the acquired data slices are merged to obtain the merged slice, and the same first data slice will not be merged repeatedly.
[0098] In one embodiment, the communication device may determine the first data slices to be merged based on the first preset value and the size of each first data slice. For example, if the sizes of the first data slices are the same, the communication device may select the number of first data slices to be merged based on the ratio of the first preset value M to the size N of the first data slices. When M / N is an integer, at least M / N first data slices may be selected for merging. When M / N is not an integer, the integer of the ratio + 1 may be selected as the number of first data slices.
[0099] In another embodiment, the communication device may select two first data slices for merging, and when the amount of data after merging is less than a first preset value, select a first data slice from the first data slices that have not been merged for merging, until the amount of data after merging is not less than the first preset value. The communication device repeats the above merging process until all the first data slices are merged.
[0100] In another embodiment, the communication device may select at least two first data slices for merging. Specifically, the communication device determines whether the sum of the numbers of the selected first data slices is greater than a first preset value. If it is less than, a first data slice is selected from the first data slices that have not been merged, and whether the sum of the numbers of the selected first data slices is greater than the first preset value, until the sum of the numbers of the selected first data slices is greater than the first preset value. Then, the selected first data slices are merged. The communication device repeats the above merging process until all the first data slices are merged.
[0101] It should be understood that after multiple merging, the amount of data obtained by the last merging may be smaller than the first preset value.
[0102] Figure 4 FIG. 1 is a schematic diagram of data processing for file upload according to an exemplary embodiment. Figure 4 As shown, after obtaining an original file with a larger file size, the client / web end can process the original file fragments into multiple first data fragments and second data fragments with a file size greater than or equal to a first preset value, and further generate multiple merged fragments based on the multiple first data fragments through multiple merging. The above merging process can be performed by the client or by the communication device.
[0103] Step 103: Send the merged slice and a second data slice among the multiple data slices to a server, wherein the file size of the second data slice is greater than or equal to the first preset value.
[0104] In this step, since the data fragments acquired by the communication device include a first data fragment whose file size is smaller than the first preset value and a second data fragment whose file size is greater than or equal to the first preset value, the first data fragments are merged to generate a merged fragment whose file size is greater than or equal to the first preset value.
[0105] Therefore, the communication device can send the merged fragment and the second data fragment whose file size is greater than or equal to the first preset value to the server, thereby improving the upload success rate of files (such as files with large data volume), ensuring that all file contents in the file are successfully uploaded to the server, and completing the file upload process.
[0106] In the embodiment of the present application, it is only necessary to predetermine different first preset values according to the preset minimum size of data slices specified by different manufacturers, so that after the communication device receives the data slices sent by the client / web, it can merge the data slices according to the first preset values corresponding to each manufacturer to obtain different merged slices, so that the data slices sent by the client / web can be successfully uploaded to the cloud servers of different manufacturers. During the upload process, the data acquisition or slice process of the client / web can remain unchanged, and the development cost is low.
[0107] To summarize, the embodiment of the present application provides a data processing method. After obtaining the first data fragment with a smaller data volume sent by the client, the communication device can merge at least two first data fragments to obtain a merged fragment with a larger data volume, and finally send the merged fragment and the second data fragment with a larger data volume in the data fragment to the server to complete the data fragment upload process, thereby avoiding the failure of data fragment upload caused by the data fragment obtained after file fragmentation being smaller than the first preset value specified by the cloud vendor, thereby improving the success rate of file upload.
[0108] Figure 5 is a flowchart of another method for processing data according to an exemplary embodiment. Figure 5 As shown, the following steps are included:
[0109] Step 201: Acquire multiple data slices, where the file size of the data slices is used to represent the size of the data volume of the data slices.
[0110] In this step, the communication device may obtain multiple data slices from the client or the web, wherein the file size of the data slice is used to characterize the size of the data volume of the data slice.
[0111] The data fragments acquired by the communication device may include a first data fragment whose file size is smaller than the first preset value, and a second data fragment whose file size is greater than or equal to the first preset value. Since the file size of the first data fragment is smaller than the first preset value, in order to avoid upload failure, multiple first data fragments can be merged to generate a merged fragment whose file size is greater than or equal to the first preset value, and the communication device then uploads the merged fragment to the server.
[0112] In an embodiment of the present application, the client / web side can send the generated data slices to the communication device in real time. Therefore, there is no need to cache and merge the data slices on the client / web side, thereby reducing the file size of the client / web side cache and improving the usage efficiency of the client / web side.
[0113] Step 202: Sort the first data slices according to a preset order to obtain a slice sequence.
[0114] In this step, the first data shards may be sorted in a preset order to obtain a shard sequence consisting of the first shard data, so that when the first data shards are merged, they are merged in sequence according to the arrangement order of the first data shards in the shard sequence.
[0115] Optionally, when the data slices further include data identifiers, and the data identifiers are used to identify the order of uploading the data slices, step 202 specifically includes:
[0116] Sub-step 2021: Sort the first data fragments according to the data identifier to obtain the fragment sequence.
[0117] In this step, since the data slices also include data identifiers, and the data identifiers are used to identify the order in which the data slices are uploaded, the first data slices can be sorted according to the data identifiers to obtain a slice sequence.
[0118] In an embodiment of the present application, the data identifier may be a continuous integer starting from a preset value. The embodiment of the present application may sort the data identifiers in ascending order to obtain a fragmentation sequence.
[0119] Figure 6 is a schematic diagram of data processing of a first data slice according to an exemplary embodiment. Figure 6 As shown, the first data fragments received by the communication device are respectively data identifiers 0, 1, 2, 3, 4, 5, 6, 7, 12 and 20, and the corresponding file sizes are 20KB, 20KB, 15KB, 40KB, 25KB, 25KB, 40KB, 20KB, 40KB and 20KB, respectively. Therefore, Figure 6 The preset value is 0, that is, the data identifier corresponding to the first data slice is a continuous integer starting from 0.
[0120] It should be noted that when the client / web sends data fragments to the communication device, a multi-process / thread method can be used to send different data fragments in different processes / threads. Therefore, the data identifiers of the data fragments received by the communication device may be discontinuous. Figure 6, the first data fragment currently received by the communication device may be the data fragment with data identifier 3, and the data fragments with data identifiers 8 to 11 and 13 to 19 have not been sent to the communication device through the client / web end. Therefore, by sorting in ascending order of data identifiers, a fragment sequence 40 including the first data fragments with data identifiers 0, 1, 2, 3, 4, 5, 6, 7, 12 and 20 can be obtained.
[0121] Step 203: Starting from one end of the fragment sequence, merge at least two adjacent first data fragments in the fragment sequence to obtain the merged fragment.
[0122] In this step, starting from one end of the obtained fragment sequence, at least two adjacent first data fragments in the fragment sequence can be merged to obtain the merged fragment, thereby ensuring that all first data contained in the fragment sequence are merged and the same first data fragment is not merged repeatedly.
[0123] Optionally, when the first data slices are acquired sequentially, step 203 specifically includes:
[0124] Sub-step 2031: upon receiving a new first data fragment, querying the fragment sequence, and if the fragment sequence does not contain the new first data fragment, updating the fragment sequence according to the new first data fragment.
[0125] In this step, since different data slices are sent in different processes / threads, each time a new first data slice is received, it can be first determined whether the slice sequence contains the new first data slice. If the slice sequence does not contain the new first data slice, it means that the new first data slice has not been uploaded to the communication device, so the new first data slice can be received and the slice sequence can be updated. If the slice sequence contains the new first data slice, the new first data slice is discarded, thereby avoiding waste of resources caused by repeated uploading.
[0126] Sub-step 2032: according to the most recently acquired new first data fragment, determine in the fragment sequence a sub-fragment sequence corresponding to the new first data fragment, wherein the sub-fragment sequence is a partial sequence that starts from one end of the fragment sequence and is continuously arranged in order.
[0127] In this step, since different data slices are sent in different processes / threads, the communication device receives different data slices in sequence. After each new first data slice is received, a sub-slice sequence corresponding to the new first data slice can be determined in the slice sequence based on the received new first data slice, so that the data slices can be further merged in the sub-slice sequence.
[0128] Specifically, the sub-slice sequence is a partial sequence that starts from one end of the slice sequence and is arranged in sequence. In one embodiment, the sub-slice sequence is a sequence that starts from one end of the first received data slice in the slice sequence and is arranged in sequence.
[0129] Reference Figure 6 If the most recently acquired new first data fragment is a first data fragment with a data identifier of 3 and a file size of 40KB, then the sub-fragment sequence corresponding to the new first data fragment may be a sub-fragment sequence 50 of the first data fragments including data identifiers of 0 to 7.
[0130] Sub-step 2033: merge at least two first data slices selected from the sub-slice sequence to obtain a plurality of merged slices.
[0131] In this step, at least two first data fragments can be selected from the determined sub-fragment sequence for merging to obtain a plurality of merged fragments. Therefore, after each new first data fragment is received, the sub-fragment sequence corresponding to different new first data fragments and the merged fragment determined according to the sub-fragment sequence can be determined, so that the communication device can further determine the target merged fragment corresponding to the new first data fragment from the merged fragment.
[0132] Reference Figure 6 , if the most recently acquired new first data fragment is a first data fragment with a data identifier of 3 and a file size of 40KB, the corresponding sub-fragment sequence 50 corresponding to the new first data fragment may be a sub-fragment sequence including first data fragments with data identifiers of 0 to 7, and the first preset value is 50KB. Since the sum of the file sizes of the three first data fragments with data identifiers of 0 to 2 in the sub-fragment sequence 50 is 55KB, which is greater than the first preset value of 50KB, the three first data fragments with data identifiers of 0 to 2 in the sub-fragment sequence may be selected and merged to obtain a merged fragment with a merged fragment identifier of 0. Merge slices; the sum of the file sizes of the two first data slices with data identifiers 3 to 4 in the sub-slice sequence is 65KB, which is greater than the first preset value of 50KB. Therefore, the two first data slices with data identifiers 3 to 4 in the sub-slice sequence can be selected and merged to obtain a merged slice with a merged slice identifier of 1; the sum of the file sizes of the two first data slices with data identifiers 5 to 6 in the sub-slice sequence is 65KB, which is greater than the first preset value of 50KB. Therefore, the two first data slices with data identifiers 5 to 6 in the sub-slice sequence can be selected and merged to obtain a merged slice with a merged slice identifier of 2.
[0133] Sub-step 2034: Determine a target merged shard corresponding to the new first data shard from the merged shards.
[0134] In this step, the target merged fragment corresponding to the new first data fragment can be further determined from the merged fragments determined in sub-step 2033. Therefore, after each new first data fragment is received, the target merged fragment corresponding to different new first data fragments can be determined, so that the target merged fragments corresponding to different new first data fragments are different from each other, thereby ensuring that the same first data fragment in the fragment sequence will not be repeatedly merged and uploaded.
[0135] Optionally, the file size of the merged fragment is less than a second preset value, and the second preset value is greater than the first preset value. That is, the file size of the merged fragment obtained by the communication device is greater than or equal to the first preset value, which can meet the preset minimum size specified by the cloud vendor. At the same time, in order to ensure the upload stability and upload efficiency of the merged fragment, a second preset value greater than the first preset value can also be set so that the file size of the merged fragment is not too large. For example, the first preset value can be 50KB, and the second preset value can be 90KB.
[0136] In an embodiment of the present application, in order to ensure that the file size of the merged slice is not too large on the basis of being greater than or equal to the first preset value, when multiple first data slices are selected in the sub-slice sequence for merging, at least two first data slices with the smallest number of consecutive arrangements are selected, so that the sum of the file sizes of the at least two first data slices is greater than the first preset value.
[0137] It should be noted that, refer to Figure 6 , the target merged slice 60 corresponding to the new first data slice is the merged slice with the merged slice identifier 1 and the merged slice identifier 2, that is, the merged slice with the merged slice identifier 1 synthesized from the new first data slice and the merged slice with the merged slice identifier greater than 2 can be used as the target merged slice corresponding to the new first data slice. This is because the merged slice with the merged slice identifier 0 has been used as the target merged slice corresponding to one of the first data slices with data identifiers 0, 1 or 2 when the communication device obtains the three first data slices with data identifiers 0 to 2. Therefore, the target merged slice 60 corresponding to the first data slice with data identifier 3 does not include the merged slice with the merged slice identifier 0.
[0138] Figure 7 is a schematic diagram of data processing of another first data slice according to an exemplary embodiment, such as Figure 7As shown, the first data fragments received by the communication device are data identifiers 0, 1 and 2, and the corresponding file sizes are 20KB, 20KB and 15KB respectively. The new first fragment currently received by the communication device may be the data fragment with data identifier 2. Therefore, by sorting in order from small to large data identifiers, a fragment sequence 41 including the first data fragments with data identifiers 0, 1 and 2 can be obtained. Correspondingly, the sub-fragment sequence corresponding to the new first data fragment may be a sub-fragment sequence 51 including the first data fragments with data identifiers 0 to 2. If the first preset value is 50KB, since the sum of the file sizes of the three first data fragments with data identifiers 0 to 2 in the sub-fragment sequence 51 is 55KB, which is greater than the first preset value of 50KB, the three first data fragments with data identifiers 0 to 2 in the sub-fragment sequence can be selected and merged to obtain a merged fragment with a merged fragment identifier of 0. The target merged fragment 61 corresponding to the new first data fragment is the merged fragment with a merged fragment identifier of 0.
[0139] In an embodiment of the present application, the communication device can obtain multiple merged fragments through multiple merging, and the first data fragments of different merged fragments are different from each other, thereby ensuring that all the first data fragments in the acquired data fragments are merged to obtain the merged fragment, and the same first data fragment will not be merged repeatedly.
[0140] Optionally, in step 203, for a first data slice whose file size is greater than a first preset value among the multiple data slices, merging at least two of the first data slices to obtain a merged slice may specifically include:
[0141] Sub-step 2035: when the number of the data shards is equal to a preset number value, determine at least two target first data shards in the first data shards, and the sum of the file sizes of the target first data shards is greater than or equal to the first preset value.
[0142] In this step, when receiving the data slices sent by the client / web, the communication device can record the number of data slices, and when the number of the data slices is equal to the preset number value, determine at least two target first data slices in the first data slice, and the sum of the file sizes of the target first data slices is greater than or equal to the first preset value, wherein the preset number value can be a value corresponding to the data slice determined by the client / web, and the client / web sends the determined preset number value to the communication device. Therefore, before receiving the data slices, the communication device can receive the preset number value from the client / web, so that it can judge whether all the data slices have been received according to the preset number value. The preset number value is related to the size of the original file and the size of the data slices after the original file is sliced. For example, if the size of the original file is 10 megabytes, and the size of the data slices obtained after the original file is sliced is required to be 512 kilobytes, then the client / web can determine that the original file needs to be processed into 20 data slices with a file size of 512 kilobytes, and accordingly, the preset number value is 20.
[0143] Specifically, the preset number value can be the number of data slices obtained after the original file slice processing, which is set in advance according to the size of the original file and the size of the data slices after the original file slice processing when the client / web end is processing the larger original file slices. For example, the original file slice processing can be preset to be 15 data slices, so that the 15 data slices after the slice processing are uploaded to the server through the communication device.
[0144] In an embodiment of the present application, if the number of data slices acquired by the communication device is equal to a preset number value, it means that the client / web end has sent all the data slices to the communication device, that is, the communication device has acquired all the data slices, and therefore, at least two target first data slices can be further determined in the first data slice in the data slices, so that the at least two target first data slices can be further merged to obtain the merged slice.
[0145] Sub-step 2036: merge the at least two target first data fragments to obtain the merged fragment.
[0146] In this step, at least two target first data shards determined in the above steps may be merged, thereby finally obtaining a merged shard.
[0147] Optionally, when the number of target first data slices for the merged slices is a minimum value, the first data slices can be selected and merged to generate merged slices whose file size is greater than or equal to a first preset value, and unmerged first data slices whose file size is less than the first preset value.
[0148] Therefore, the communication device may merge the unmerged first data fragments again. It should be noted that the file size of the merged fragments obtained after this merger is smaller than the first preset value.
[0149] Accordingly, after sub-step 2036, the following steps may also be included:
[0150] Sub-step 2037: merge all the first data slices that have not been merged in the first data slices and send them to the server.
[0151] In this step, the first data slices that have not been merged can be merged again. Since the file size of the merged slice obtained after this merger is smaller than the first preset value, it is necessary to send the merged slice obtained by merging the first data slices that have not been merged in the first data slices to the server separately.
[0152] Specifically, in the process of merging the target first data slices in the slice sequence to generate a merged slice, it may happen that after obtaining multiple merged slices, there is still at least one first data slice that has not been merged in the slice sequence, that is, the sum of the file sizes of at least one first data slice that has not been merged is smaller than the first preset value, so that the file size of the last merged slice obtained after merging at least one first data slice that has not been merged is smaller than the first preset value. Therefore, it is necessary to synthesize all the first data slices that have not been merged to obtain the last merged slice and send it to the server after determining that the communication device has received all the first data slices.
[0153] Step 204: upon receiving a sending instruction, sending the merged slice and a second data slice among the multiple data slices to a server, wherein a file size of the second data slice is greater than or equal to the first preset value.
[0154] In this step, since the data fragments acquired by the communication device include a first data fragment whose file size is smaller than the first preset value, and a second data fragment whose file size is greater than or equal to the first preset value, the first data fragments are selected and merged to generate a merged fragment whose file size is greater than or equal to the first preset value.
[0155] Therefore, upon receiving a sending instruction, the communication device can send the second data segment whose file size is greater than or equal to the first preset value and the merged segment to the server, thereby ensuring that all file contents in the original file are successfully uploaded to the server and completing the upload process of the original file.
[0156] Optionally, the process of sending the merged fragments to the server in step 204 specifically includes:
[0157] Sub-step 2041: Send the target merged fragment to the server.
[0158] In this step, since the at least two first data fragments are obtained sequentially, the communication device can send the target merged fragment to the server after determining the target merged fragment corresponding to the new first data fragment from the merged fragments, thereby shortening the upload time of the data fragments.
[0159] In this step, since different data slices are sent in different processes / threads, each time a new first data slice is received, the target merged slice corresponding to the new first data slice can be determined and generated, and then the target merged slice can be sent to the server. When the next first data slice is received, the target merged slice corresponding to the later received first data slice can be sent to the server again, so that it is not necessary to receive all the first data slices, determine and synthesize all the merged slices, and then send the merged slices to the server, which further improves the efficiency of file upload.
[0160] Step 205: Clear the fragment sequence.
[0161] In this step, after sending the second data fragment whose file size is greater than or equal to the first preset value and the merged fragment to the server, the communication device can clear the fragment sequence, thereby clearing the cache of the fragment sequence in the communication device and improving the usage efficiency of the communication device.
[0162] To summarize, the embodiment of the present application provides a data processing method. After obtaining the first data fragment with a smaller data volume sent by the client, the communication device can merge at least two first data fragments to obtain a merged fragment with a larger data volume, and finally send the merged fragment and the second data fragment with a larger data volume among the obtained data fragments to the server to complete the data fragment upload process, thereby avoiding the failure of data fragment upload caused by the data fragment obtained after file fragmentation being smaller than the first preset value specified by the cloud vendor, thereby improving the success rate of file upload.
[0163] In addition, the data slices also include data identifiers, and the data identifiers are used to identify the order of uploading the data slices. Therefore, they can be sorted according to the data identifiers to obtain a slice sequence, and further starting from one end of the slice sequence, at least two adjacent first data slices in the slice sequence are merged to obtain a merged slice, thereby ensuring that all the first data contained in the slice sequence are merged, and the same first data slice is not merged repeatedly, thereby improving the accuracy and efficiency of file uploading.
[0164] Figure 8 is a block diagram of a data processing device according to an exemplary embodiment. Figure 8 As shown, the device 300 may include:
[0165] An acquisition module 301 is used to acquire a plurality of data slices, wherein the file size of the data slices is used to represent the size of the data volume of the data slices;
[0166] A merging module 302 is configured to merge at least two first data slices whose file sizes are greater than a first preset value among the plurality of data slices to obtain a merged slice, wherein the first data slices obtained from different merged slices are different from each other;
[0167] The first sending module 303 is used to send the merged slice and the second data slice among the multiple data slices to the server, wherein the file size of the second data slice is greater than or equal to the first preset value.
[0168] The merging module 302 is connected to the acquiring module 301 , and the first sending module 303 is connected to the merging module 302 .
[0169] The device provided in the embodiment of the present application includes: obtaining multiple data slices, the file size of the data slice is used to characterize the size of the data volume of the data slice; for the first data slice whose file size is greater than the first preset value among the multiple data slices, merging at least two first data slices to obtain a merged slice, wherein the first data slices obtained from different merged slices are different from each other; sending the merged slice and the second data slice among the multiple data slices to the server, wherein the file size of the second data slice is greater than or equal to the first preset value. In the embodiment of the present application, after obtaining the first data slice with a smaller data volume sent by the client, the communication device can merge at least two first data slices to obtain a merged slice with a larger data volume, and finally send the merged slice and the second data slice with a larger data volume among the obtained data slices to the server to complete the data slice upload process, thereby avoiding the failure of data slice upload due to the data slice obtained after file segmentation being smaller than the first preset value specified by the cloud vendor, thereby improving the success rate of file upload.
[0170] The device also includes:
[0171] A sorting module, used to sort the first data slices according to a preset order to obtain a slice sequence;
[0172] The merging module comprises:
[0173] The first merging submodule is used to merge at least two adjacent first data fragments in the fragment sequence starting from one end of the fragment sequence to obtain the merged fragment.
[0174] In a possible implementation manner, the first data slices are acquired sequentially;
[0175] The merging module comprises:
[0176] A first determining submodule is used to determine, according to the most recently acquired new first data slice, a sub-slice sequence corresponding to the new first data slice in the slice sequence, wherein the sub-slice sequence is a partial sequence that starts from one end of the slice sequence and is continuously arranged in order;
[0177] A second merging submodule, configured to merge at least two first data slices selected from the sub-slice sequence to obtain the merged slice;
[0178] A second determination submodule, configured to determine a target merged slice corresponding to the new first data slice from the merged slices;
[0179] The first sending module includes:
[0180] The first sending submodule is used to send the target merged segment to the server.
[0181] In a possible implementation manner, the merging module includes:
[0182] A third determining submodule, configured to determine, when the number of the data slices is equal to a preset number value, at least two target first data slices in the first data slices, the sum of the file sizes of the target first data slices being greater than or equal to the first preset value;
[0183] The third merging submodule is used to merge the at least two target first data fragments to obtain the merged fragment.
[0184] In a possible implementation manner, when the number of target first data shards for merging shards is obtained to be a minimum value, the device further includes:
[0185] The second sending module is used to merge the first data slices that have not been merged in all the first data slices and send them to the server.
[0186] In a possible implementation manner, the device further includes:
[0187] An updating module is used to query the fragment sequence, and when the fragment sequence does not contain the new first data fragment, update the fragment sequence according to the new first data fragment.
[0188] In a possible implementation manner, the first sending module includes:
[0189] A second sending submodule, configured to send the merged slice and a second data slice among the multiple data slices to the server when receiving a sending instruction;
[0190] The clearing submodule is used to clear the fragment sequence.
[0191] In a possible implementation manner, the file size of the merged fragment is smaller than a second preset value, and the second preset value is larger than the first preset value.
[0192] In a possible implementation manner, the data slices further include data identifiers, and the data identifiers are used to identify the order in which the data slices are uploaded.
[0193] The sorting module comprises:
[0194] A sorting submodule is used to sort the first data slices according to the data identifier to obtain the slice sequence.
[0195] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0196] Fig. 9 4 is a block diagram of a device according to an exemplary embodiment. For example, the device 400 may be a mobile phone, a computer, a digital broadcast device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0197] Reference Fig. 9 , device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0198] The processing component 402 generally controls the overall operation of the device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0199] The memory 404 is configured to store various types of data to support operations on the device 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phone book data, messages, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0200] The power supply component 406 provides power to the various components of the device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 400.
[0201] The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0202] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the device 400 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0203] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0204] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the device 400. For example, the sensor assembly 414 can detect the open / closed state of the device 400, the relative positioning of components, such as the display and keypad of the device 400, and the sensor assembly 414 can also detect the position change of the device 400 or a component of the device 400, the presence or absence of user contact with the device 400, the orientation or acceleration / deceleration of the device 400, and the temperature change of the device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0205] The communication component 416 is configured to facilitate wired or wireless communication between the device 400 and other devices. The device 400 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0206] In an exemplary embodiment, the device 400 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components, and is used to execute the steps in the above-mentioned information reminder method when the device 400 is provided as the aforementioned first device.
[0207] In an exemplary embodiment, a non-transitory storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of the device 400 to complete the above data processing method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0208] In an exemplary embodiment, the embodiment of the present application also provides an application program, including one or more instructions, which, when executed by a processor of a device, enables the device to perform an operation performed to implement a data processing method as provided in the present application.
[0209] Fig.10 is a block diagram of another device according to an exemplary embodiment. Fig.10 , the device 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions, such as applications, that can be executed by the processing component 522. The application stored in the memory 932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform the steps in the above-mentioned data processing method.
[0210] The device 500 may also include a power component 526 configured to perform power management of the device 500, a wired or wireless network interface 550 configured to connect the device 500 to a network, and an input / output (I / O) interface 558. The device 500 may operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.
[0211] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0212] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A data processing method, It is characterized in that The method comprises: Acquire multiple data slices, wherein the file sizes of the data slices are used to represent the sizes of the data volumes of the data slices; For a first data slice whose file size is smaller than a first preset value among the multiple data slices, merge at least two of the first data slices to obtain a merged slice, wherein the first data slices of different merged slices are different from each other; the file size of the merged slice is smaller than a second preset value, and the second preset value is larger than the first preset value; Sending the merged slice and a second data slice among the multiple data slices to a server, wherein a file size of the second data slice is greater than or equal to the first preset value; The step of merging at least two of the first data slices whose file size is smaller than the first preset value among the multiple data slices to obtain a merged slice comprises: In a case where the number of the data slices is equal to a preset number value, determining at least two target first data slices in the first data slices, the sum of the file sizes of the target first data slices being greater than or equal to the first preset value; Merging the at least two target first data fragments to obtain the merged fragment; The method further comprises: When the number of target first data slices for merging the slices is the minimum, all the first data slices that have not been merged are merged and sent to the server.
2. The method according to claim 1, It is characterized in that After the step of obtaining a plurality of data fragments, the method further includes: Sorting the first data slices according to a preset order to obtain a slice sequence; The step of merging at least two of the first data shards to obtain a merged shard comprises: Starting from one end of the fragment sequence, at least two adjacent first data fragments in the fragment sequence are merged to obtain the merged fragment.
3. The method according to claim 2, It is characterized in that The first data slices are obtained sequentially; The step of merging at least two of the first data shards to obtain a merged shard comprises: According to the most recently acquired new first data fragment, determine in the fragment sequence a sub-fragment sequence corresponding to the new first data fragment, the sub-fragment sequence being a partial sequence that starts from one end of the fragment sequence and is continuously arranged in order; Merging at least two first data slices selected from the sub-slice sequence to obtain the merged slice; Determine a target merged shard corresponding to the new first data shard from the merged shards; The step of sending the merged fragments to the server includes: The target merged fragment is sent to the server.
4. The method according to claim 3, It is characterized in that Before the step of determining, in the slice sequence, a sub-slice sequence corresponding to the new first data slice acquired most recently, the method further includes: The shard sequence is queried, and when the shard sequence does not include the new first data shard, the shard sequence is updated according to the new first data shard.
5. The method according to claim 3, It is characterized in that The step of sending the merged shard and the second data shard among the multiple data shards to the server includes: When receiving the sending instruction, sending the merged shard and the second data shard among the multiple data shards to the server; Clear the fragment sequence.
6. The method according to claim 2, It is characterized in that The data slices also include data identifiers, which are used to identify the order in which the data slices are uploaded. The step of sorting the first data slices according to a preset order to obtain a slice sequence includes: The first data fragments are sorted according to the data identifiers to obtain the fragment sequence.
7. A data processing device, It is characterized in that The device comprises: An acquisition module, used for acquiring a plurality of data slices, wherein the file size of the data slices is used for representing the size of the data volume of the data slices; a merging module, configured to merge at least two first data slices whose file size is smaller than a first preset value among the multiple data slices to obtain a merged slice, wherein the first data slices of different merged slices are different from each other; the file size of the merged slice is smaller than a second preset value, and the second preset value is larger than the first preset value; A first sending module, configured to send the merged slice and a second data slice among the multiple data slices to a server, wherein a file size of the second data slice is greater than or equal to the first preset value; A third determining submodule, configured to determine, when the number of the data slices is equal to a preset number value, at least two target first data slices in the first data slices, the sum of the file sizes of the target first data slices being greater than or equal to the first preset value; A third merging submodule, configured to merge the at least two target first data fragments to obtain the merged fragment; A second sending module is used to merge the first data slices that have not been merged in all the first data slices and send them to the server.
8. The device according to claim 7, It is characterized in that The device also includes: A sorting module, used to sort the first data slices according to a preset order to obtain a slice sequence; The merging module comprises: The first merging submodule is used to merge at least two adjacent first data fragments in the fragment sequence starting from one end of the fragment sequence to obtain the merged fragment.
9. The device according to claim 8, It is characterized in that The first data slices are obtained sequentially; The merging module comprises: A first determining submodule is used to determine, according to the most recently acquired new first data slice, a sub-slice sequence corresponding to the new first data slice in the slice sequence, wherein the sub-slice sequence is a partial sequence that starts from one end of the slice sequence and is continuously arranged in order; A second merging submodule, configured to merge at least two first data slices selected from the sub-slice sequence to obtain the merged slice; A second determination submodule, configured to determine a target merged slice corresponding to the new first data slice from the merged slices; The first sending module includes: The first sending submodule is used to send the target merged segment to the server.
10. The device according to claim 9, It is characterized in that The device also includes: An updating module is used to query the fragment sequence, and when the fragment sequence does not contain the new first data fragment, update the fragment sequence according to the new first data fragment.
11. The device according to claim 9, It is characterized in that The first sending module includes: A second sending submodule, configured to send the merged slice and a second data slice among the multiple data slices to the server when receiving a sending instruction; The clearing submodule is used to clear the fragment sequence.
12. The device according to claim 8, It is characterized in that The data slices also include data identifiers, which are used to identify the order in which the data slices are uploaded. The sorting module comprises: A sorting submodule is used to sort the first data slices according to the data identifier to obtain the slice sequence.
13. A device, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute operations performed to implement the data processing method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a device, enables the device to perform an operation performed to implement the data processing method according to any one of claims 1 to 6.
