Image transmission method, device, electronic device and readable storage medium

By obtaining and verifying the MD5 value of the image file and the MD5 value of the segmentation method, the image file is divided into slice files and verified during the transmission process, which solves the image transmission pressure and data integrity problems in the existing technology and realizes large-scale image processing. Correct transfer and assembly of files.

CN115514494BActive Publication Date: 2024-09-24GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211128321.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2024-09-24
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

Existing image transmission technology cannot effectively handle the transmission pressure of large image files, especially when the image information is large, the content is complex, or has a special segmentation method, and it cannot ensure the correct transmission and combination of data.

Method used

By obtaining the MD5 value of the image file and the MD5 value of the splitting method, the image file is divided into multiple slice files, and the MD5 value is used to verify the integrity of the file during the transmission process to ensure the correct combination and transmission of the file on the server side.

Benefits of technology

It achieves the correct transmission and combination of large image files, ensures data integrity and consistency, and solves the problem of image loss or damage during image transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115514494B
    Figure CN115514494B
Patent Text Reader

Abstract

The present application discloses an image transmission method, device, electronic device and readable storage medium, which can be applied to the field of communication transmission or automobile production. Obtain the image file to be segmented and the MD5 value of the image file; determine the segmentation method according to the file information of the image file, and obtain the MD5 value corresponding to the segmentation method; segment the image file into multiple slice files according to the segmentation method; obtain the MD5 value of the slice file; upload the MD5 value of the image file, multiple slice files, the MD5 value of the slice file, and the MD5 value corresponding to the segmentation method to the server, so that the server can determine whether the image file transmission is correct by verifying the received file, segmentation method and MD5 value. If the image file transmission is correct, the transmission of the image file is completed. Uploading the segmentation method ensures that the image with a lot of information, complex content, or a special segmentation method can be correctly restored, and verifies the segmentation method to ensure the correctness of the transmission segmentation method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication transmission or automobile production, and in particular to an image transmission method, device, electronic device and readable storage medium. Background Art

[0002] With the continuous development of science and technology, image acquisition technology is also constantly improving. For images, the more details in the picture, the more information recorded on the image, which means that the generated image is getting larger and larger. As the image grows, the pressure to transmit these images also increases. The development of image transmission technology has far failed to keep up with the development of image acquisition technology. The amount of information carried by images is getting larger and larger, making image transmission more and more difficult, causing many troubles for people in production and life.

[0003] There are currently some methods that segment images before transmitting them, but the methods in existing image transmission technology can only detect whether the image is damaged during transmission. If the image has a lot of information, complex content, or has a special segmentation method, the existing methods cannot be used to completely combine the original image. Therefore, how to design an image transmission method that can protect the correct transmission of data has become a technical problem that urgently needs to be solved in this field. Summary of the invention

[0004] In view of this, the embodiments of the present application provide an image transmission method, device, electronic device and readable storage medium, aiming to achieve the requirement of protecting images with correct data transmission.

[0005] In a first aspect, an embodiment of the present application provides a method for transmitting an image, the method comprising:

[0006] Obtain the image file to be segmented and the MD5 value of the image file;

[0007] Determine a segmentation method according to the file information of the image file, and obtain an MD5 value corresponding to the segmentation method;

[0008] Splitting the image file into a plurality of slice files according to the segmentation method;

[0009] Obtain the MD5 value of each of the slice files;

[0010] The MD5 value of the image file, multiple slice files, the MD5 value of each slice file, the segmentation method and the MD5 value corresponding to the segmentation method are uploaded to the server, so that the server can determine whether the image file transmission is correct by verifying the received files, segmentation method and each MD5 value. If the image file transmission is correct, the transmission of the image file is completed.

[0011] Optionally, before obtaining the image file to be segmented and the MD5 value of the image file, the method further includes:

[0012] When an image file needs to be uploaded, the user sends an upload request to the server through the terminal that obtains the image file;

[0013] Determine whether the image file size is greater than a preset value. If the image file size is greater than the preset value, mark the image file as being in a state to be segmented; if the image file size is less than or equal to the preset value, mark the image file as being in a state to be directly uploaded.

[0014] Optionally, determining the segmentation method according to the file information of the image file specifically includes:

[0015] The segmentation method of the current image file is determined according to the correspondence between the file information of the preset image file and the segmentation method.

[0016] Optionally, uploading the multiple slice files and the MD5 value of each slice file to the server specifically includes:

[0017] Perform upload processing on each piece file;

[0018] Start a new thread, upload each piece file through okhttp, and store the MD5 value of each piece file in the transmission protocol.

[0019] In a second aspect, an embodiment of the present application provides a method for determining the correctness of image transmission, the method comprising:

[0020] The server receives the MD5 value of the image file, a plurality of slice files, the MD5 value of each of the slice files, the segmentation method and the MD5 value corresponding to the segmentation method;

[0021] For each slice file received, the server determines whether the MD5 value of the slice file is the same as the MD5 value of the corresponding slice file uploaded to the server. If they are the same, it is determined that the slice file is transmitted correctly;

[0022] The server determines the MD5 value of the segmentation method and compares it with the MD5 value of the segmentation method uploaded to the server. If they are the same, it is determined that the segmentation method is transmitted correctly;

[0023] When it is determined that each of the slice files is transmitted correctly and the segmentation method is transmitted correctly, it is determined that the image file is transmitted correctly.

[0024] Optionally, after determining that the image file is transmitted correctly, the method further includes:

[0025] The server reassembles the multiple correctly transmitted slice files into an image file according to the segmentation method;

[0026] The MD5 value of the reassembled image file is calculated, and the MD5 value is compared with the MD5 value of the image file uploaded to the server. If the MD5 values ​​are the same, the reassembled image file is correctly assembled.

[0027] Optionally, the method further includes:

[0028] When the MD5 value of the current file after transmission and / or combination is different from the MD5 value uploaded to the server, it is determined that the current file transmission and / or combination is incorrect, the current file is discarded and the transmission is restarted.

[0029] In a third aspect, an embodiment of the present application provides an image transmission device, the device comprising:

[0030] A file acquisition module, used to acquire the image file to be segmented and the MD5 value of the image file;

[0031] A segmentation judgment module, used to determine a segmentation method according to the file information of the image file, and obtain an MD5 value corresponding to the segmentation method;

[0032] A segmentation execution module, used for segmenting the image file into a plurality of slice files according to the segmentation method;

[0033] An MD5 value acquisition module is used to acquire the MD5 value of the slice file;

[0034] The transmission verification module is used to upload the MD5 value of the image file, multiple slice files, the MD5 value of the slice file, the segmentation method and the MD5 value corresponding to the segmentation method to the server, so that the server can determine whether the image file transmission is correct by verifying the received file, segmentation method and MD5 value. If the image file transmission is correct, the transmission of the image file is completed.

[0035] In a fourth aspect, an embodiment of the present application provides an electronic device for transmitting an image, the electronic device comprising:

[0036] Memory for storing computer programs;

[0037] A processor is used to execute the computer program to implement the image transmission method as described in the first aspect above.

[0038] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium comprising:

[0039] The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the image transmission method as described in the first aspect is implemented.

[0040] An embodiment of the present application provides an image transmission method, comprising: obtaining an image file to be segmented and an MD5 value of the image file; determining a segmentation method according to file information of the image file, and obtaining an MD5 value corresponding to the segmentation method; segmenting the image file into multiple slice files according to the segmentation method; obtaining the MD5 value of the slice file; uploading the MD5 value of the image file, multiple slice files, the MD5 value of the slice file, the segmentation method, and the MD5 value corresponding to the segmentation method to a server, so that the server determines whether the image file transmission is correct by verifying the received file, segmentation method, and MD5 value. If the image file transmission is correct, the transmission of the image file is completed.

[0041] It can be seen that the present application splits the files that need to be split into slice files, then calculates the MD5 value of the slice file and the MD5 value of the file, uploads the slice file, the MD5 value of the slice file and the MD5 value of the file respectively, calculates and uploads the MD5 value of the splitting method, and after all the slice files are uploaded, assembles the slice files into files according to the splitting method, calculates the MD5 value of the assembled file, and then compares the MD5 value of the splitting method and the assembled file to verify the correctness of the assembly. Uploading the splitting method not only ensures that images with a lot of information, complex content, or special splitting methods can be correctly restored, but also verifies the splitting method, ensuring the correctness of the transmission splitting method. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 A method flow chart of an image transmission method provided in an embodiment of the present application;

[0044] Figure 2 Another method flow chart of the image transmission method provided in the embodiment of the present application;

[0045] Figure 3 A flow chart of a method for determining the correctness of image transmission provided by an embodiment of the present application;

[0046] Figure 4A schematic diagram of the structure of an image transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0048] It should be noted that the image transmission method, device, electronic device and readable storage medium provided by the present invention can be used in the field of communication transmission or automobile production. The above is only an example and does not limit the application field of the image transmission method, device, electronic device and readable storage medium provided by the present invention.

[0049] The present application embodiment provides an image transmission method, which is applied to industrial Internet and automobile production. The following method can be executed on a controller or server at the image acquisition end. The method flow chart of the method is as follows: Figure 1 As shown, the following steps are included:

[0050] S10, obtaining the image file to be segmented and the MD5 value of the image file.

[0051] The image file to be segmented is obtained according to the image uploaded by the user through the image acquisition terminal, and then the MD5 value of the original image file is calculated through the MD5 algorithm.

[0052] S20, determining a segmentation method according to the file information of the image file, and obtaining an MD5 value corresponding to the segmentation method.

[0053] The file information of the image file includes the information carried by the image in the image file and the attributes of the image file itself.

[0054] The segmentation method and the file information of the image file correspond to each other, wherein the segmentation method is determined according to the file information, and the segmentation can be performed according to the amount of information carried by the image, color, shape, etc. The corresponding relationship between the segmentation method and the file information of the image file can be preset by the user, or can be set by the user after obtaining the image file. For example: the image file is segmented according to the parts with concentrated and dispersed information, or the image file is segmented according to different colors or different shapes.

[0055] This is equivalent to classifying image files with the same information or image files with similar file attributes into one category, so that the segmented file segments are clearer when they are transmitted separately.

[0056] The segmentation method is transmitted in the form of a json file, which includes: the file name of the image file, the name of the slice file, the offset of the slice file in the image file, and the binary data length of the slice file. Based on this information, a large file can be split into a group of slice files, and a group of slice files can be reassembled into the original file.

[0057] After the segmentation method of the image file is obtained, the segmentation method is calculated using the MD5 algorithm to obtain the MD5 value of the segmentation method.

[0058] Since the segmentation method also needs to be transmitted along with the image file, and the segmentation method (json file) may also be incorrect during transmission due to code loss or file errors during transmission, it is necessary to calculate the MD5 value of the segmentation method (json file) using the MD5 algorithm.

[0059] S30, dividing the image file into a plurality of slice files according to the dividing method.

[0060] According to the requirements in the segmentation method, a plurality of slice files are segmented, wherein the requirements in the segmentation method require that the image file be segmented into at least two slice files.

[0061] The method of dividing the multiple slice files can be set according to needs, and this application does not make any specific limitation here.

[0062] S40, obtaining the MD5 value of the slice file.

[0063] The slice files divided in step S30 may not be completely consistent, and it is necessary to calculate the corresponding MD5 value for each slice file respectively, and mark the calculated MD5 value so that it can correspond to the slice file after division.

[0064] S50, uploading the MD5 value of the image file, multiple slice files, the MD5 value of the slice file, the segmentation method and the MD5 value corresponding to the segmentation method to the server, so that the server can determine whether the image file transmission is correct by verifying the received file, segmentation method and MD5 value. If the image file transmission is correct, the transmission of the image file is completed.

[0065] The MD5 value of the image file, the MD5 value of the slice file, the segmentation method and the MD5 value corresponding to the segmentation method are uploaded to the server along with multiple slice files. The upload method does not need to be in a certain order, and multiple lines can be uploaded simultaneously. After receiving the upload request in advance, the server will receive the above files and related information respectively and store them accordingly. After all files and related information are uploaded, multiple slice files and segmentation methods will be verified. After the verification is correct, the transmission of the image file is completed.

[0066] It can be seen that the present application splits the files that need to be split into slice files, then calculates the MD5 value of the slice file and the MD5 value of the file, uploads the slice file, the MD5 value of the slice file and the MD5 value of the file respectively, calculates and uploads the MD5 value of the splitting method, and after all the slice files are uploaded, assembles the slice files into files according to the splitting method, calculates the MD5 value of the assembled file, and then compares the MD5 value of the splitting method and the assembled file to verify the correctness of the assembly. Uploading the splitting method not only ensures that images with a lot of information, complex content, or special splitting methods can be correctly restored, but also verifies the splitting method, ensuring the correctness of the transmission splitting method.

[0067] In some specific embodiments, the method may also adopt the following steps. In this case, another method flow chart of the image transmission method is as follows: Figure 2 As shown:

[0068] S11, when an image file needs to be uploaded, the user sends an upload request to the server through a terminal that obtains the image file.

[0069] S12, determining whether the image file size is greater than a preset value, if the image file size is greater than the preset value, marking the image file as being in a state to be segmented, if the image file size is less than or equal to the preset value, marking the image file as being in a state to be directly uploaded.

[0070] The user uploads the image through the image acquisition terminal, and the uploaded image also carries the information of the original image, such as: parameters of the image acquisition terminal, message type, image file name, image file size and image file type, etc.

[0071] Before the image is transmitted, the transmission method needs to be determined mainly based on the image size. The user can set a value for the image size to distinguish when the image file needs to be split and transmitted after the image file size reaches a certain value. After using this value to determine the transmission status of the image file, this status (to be split or directly uploaded) is marked in the image file so that different steps can be performed later according to different image file states.

[0072] In some specific embodiments, step S20 specifically includes:

[0073] According to the correspondence between the file information of the preset image file and the segmentation method, the segmentation method of the current image file is determined, and the MD5 value corresponding to the segmentation method is obtained.

[0074] Different segmentation methods are determined according to the file information of different image files, and the correspondence between the file information and the segmentation method can be prioritized. For example, first determine whether the first information reaches a preset value. If so, segmentation is performed according to the first segmentation method. If not, continue to determine whether the second information reaches the preset value, and so on.

[0075] The segmentation method may be set as required, for example, segmenting the image file according to the parts with concentrated and dispersed information, or segmenting the image file according to different colors or shapes.

[0076] In some specific embodiments, step S50 specifically includes:

[0077] Perform upload processing on each piece file;

[0078] Start a new thread, upload each piece file through okhttp, and store the MD5 value of each piece file in the transmission protocol.

[0079] The MD5 value of each slice file is stored in the transmission protocol, which can be specifically added to the http Header, and the MD5 value of each slice file is stored in the tag variable. This step improves the okhttp protocol and adds a tag variable to store each MD5 value, so that the technical solution provided by this application can not only avoid repeated requests and automatically recover when the connection is interrupted, but also upload the MD5 value of each slice file and the corresponding slice file to the server together, which is convenient for comparing the MD5 value of the server-side object after uploading to ensure the consistency of the transmitted data.

[0080] The embodiment of the present application also provides a method for determining the correctness of image transmission, which is applied to industrial Internet and automobile production. The following method can be executed on the server. The method flow chart of the method is as follows: Figure 3 As shown, the following steps are included:

[0081] S21, the server receives the MD5 value of the image file, a plurality of slice files, the MD5 value of each of the slice files, the segmentation method and the MD5 value corresponding to the segmentation method.

[0082] S22, the server determines, for each received slice file, whether the MD5 values ​​of the plurality of slice files respectively calculated are the same as the MD5 values ​​of the corresponding slice files uploaded to the server, and if they are the same, determines that the slice file is correctly transmitted.

[0083] S23, the server determines and compares the calculated MD5 value of the segmentation method with the MD5 value of the segmentation method uploaded to the server. If they are the same, it is determined that the segmentation method is transmitted correctly.

[0084] S24, when it is determined that each of the slice files is transmitted correctly and the segmentation method is transmitted correctly, it is determined that the image file is transmitted correctly.

[0085] Files are prone to damage or loss during transmission, for example, image files may have missing pixels, text files may have garbled characters, etc. The MD5 algorithm can calculate an MD5 value based on the file, and the MD5 value is a fixed value that will not change after calculation. The MD5 value is calculated again after the file is transferred. If the MD5 values ​​calculated twice are the same, it means that the transferred file is exactly the same as the original file. On the contrary, if there is any change in the file, the calculated MD5 value cannot be the same. This can determine whether the transferred file is correct.

[0086] In some specific embodiments, after step S23, the method may further include the following steps:

[0087] S25, the server reassembles the multiple correctly transmitted slice files into an image file according to the segmentation method.

[0088] S26, calculating the MD5 value of the reassembled image file, comparing the MD5 value with the MD5 value of the image file uploaded to the server, if the MD5 values ​​are the same, the reassembled image file is correctly assembled.

[0089] After the image is reassembled, the entire image file is verified again to prevent problems with the segmentation method and its corresponding MD5 value or the MD5 value from being lost during transmission. This step serves as a double guarantee for image file verification.

[0090] In some specific embodiments, steps S21-S26 specifically include:

[0091] When the MD5 value of the current file after transmission and / or combination is different from the MD5 value uploaded to the server, it is determined that the current file transmission and / or combination is incorrect, the current file is discarded and the transmission is restarted.

[0092] Since the MD5 value cannot be reversely calculated or derived to obtain the original image file (this is also the reason why the obtained value is relatively fixed), when it is determined that the MD5 value of the current transmission file is different from the MD5 value calculated from the original image file, the entire image file and its related information will be discarded. If there is still a need for image transmission, start again from the revelation step.

[0093] Based on the image transmission method provided in the above embodiment, the present application embodiment provides a device for performing the above image transmission. Figure 4 As shown, the image transmission device includes:

[0094] The file acquisition module 10 is used to acquire the image file to be segmented and the MD5 value of the image file.

[0095] The image file to be segmented is obtained through the user's transmission, and then the MD5 value of the original image file is calculated through the MD5 algorithm.

[0096] The segmentation judgment module 20 is used to determine the segmentation method according to the file information of the image file and obtain the MD5 value corresponding to the segmentation method.

[0097] The segmentation method and the file information of the image file correspond to each other, wherein the segmentation method is determined according to the file information, and the image can be segmented according to the amount of information carried by the image, color, shape, etc. The corresponding relationship between the segmentation method and the file information of the image file can be preset by the user, or can be set by the user after obtaining the image file.

[0098] The segmentation execution module 30 is used to segment the image file into a plurality of slice files according to the segmentation method.

[0099] The MD5 value acquisition module 40 acquires the MD5 value of the slice file.

[0100] The slice files divided in the segmentation execution module 30 may not be completely consistent, and it is necessary to calculate the corresponding MD5 value for each slice file respectively, and mark the calculated MD5 value so that it can correspond to the slice file after the segmentation.

[0101] The transmission verification module 50 is used to upload the MD5 value of the image file, multiple slice files, the MD5 value of the slice file, the segmentation method and the MD5 value corresponding to the segmentation method to the server, so that the server can determine whether the image file transmission is correct by verifying the received file, segmentation method and MD5 value. If the image file transmission is correct, the transmission of the image file is completed.

[0102] The MD5 value of the image file, the MD5 value of the slice file, the segmentation method and the MD5 value corresponding to the segmentation method are uploaded to the server along with the multiple slice files.

[0103] In some specific embodiments, the device further comprises:

[0104] The request sending module is used for, when an image file needs to be uploaded, the user sends an upload request to the server through a terminal that obtains the image file.

[0105] Users upload images through image acquisition terminals, and the uploaded images also carry the information of the original images.

[0106] The status determination module is used to determine whether the image file size is greater than a preset value. If the image file size is greater than the preset value, the image file is marked as being in a state to be segmented; if the image file size is less than or equal to the preset value, the image file is marked as being in a state to be directly uploaded.

[0107] Before the image is transmitted, the transmission method needs to be determined mainly based on the image size. The user can set a value for the image size to distinguish when the image file needs to be split and transmitted after the image file size reaches a certain value.

[0108] According to the correspondence between the file information of the preset image file and the segmentation method, the segmentation method of the current image file is determined, and the MD5 value corresponding to the segmentation method is obtained.

[0109] In some specific embodiments, the transmission verification module 50 is specifically used to:

[0110] Calculate the MD5 values ​​of the multiple slice files respectively, and determine whether the MD5 values ​​are the same as the MD5 values ​​of the corresponding slice files uploaded to the server. If the MD5 values ​​are the same, the slice files are transmitted correctly.

[0111] The MD5 value of the segmentation method is calculated, and the MD5 value is compared with the MD5 value of the segmentation method uploaded to the server. If the MD5 values ​​are the same, the segmentation method is transmitted correctly.

[0112] Files are prone to damage or loss during transmission. If there is any change in the file, the calculated MD5 value will not be the same. This can be used to determine whether the transferred file is correct.

[0113] In some specific embodiments, the device further comprises:

[0114] The file reassembly module is used to reassemble a plurality of correctly transmitted slice files into an image file according to the correctly transmitted segmentation method.

[0115] After the image is reassembled, the entire image file is verified again to prevent problems with the segmentation method and its corresponding MD5 value or the MD5 value from being lost during transmission.

[0116] In addition, the embodiment of the present application also discloses an electronic device for transmitting an image, including:

[0117] Memory for storing computer programs;

[0118] A processor is used to execute the computer program to implement the image transmission method as described above.

[0119] In addition, an embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data stream processing method for image transmission as described above is implemented.

[0120] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0121] The above is a detailed introduction to the scheme provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for transmitting an image, characterized in that: The method comprises: Obtain the image file to be segmented and the MD5 value of the image file; Determine a segmentation method according to the file information of the image file, and obtain an MD5 value corresponding to the segmentation method; Splitting the image file into a plurality of slice files according to the segmentation method; Obtain the MD5 value of each of the slice files; Upload the MD5 value of the image file, multiple slice files, the MD5 value of each slice file, the segmentation method and the MD5 value corresponding to the segmentation method to the server, so that the server can determine whether the image file is correctly transmitted by verifying the received file, the segmentation method and each MD5 value, and after determining that the image file is correctly transmitted, the server reassembles the multiple correctly transmitted slice files into an image file according to the segmentation method; calculates the MD5 value of the reassembled image file, compares the MD5 value with the MD5 value of the image file uploaded to the server, and if the MD5 values ​​are the same, the reassembled image file is correctly combined; The server determines whether the image file is correctly transmitted by verifying the received file, segmentation method and each MD5 value, including: For each slice file received, the server determines whether the MD5 value of the slice file is the same as the MD5 value of the corresponding slice file uploaded to the server. If they are the same, it is determined that the slice file is correctly transmitted; The server compares the MD5 value of the segmentation method with the MD5 value of the segmentation method uploaded to the server, and if they are the same, it is determined that the segmentation method is transmitted correctly; When it is determined that each of the slice files is transmitted correctly and the segmentation method is transmitted correctly, it is determined that the image file is transmitted correctly; if the image file is transmitted correctly, the transmission of the image file is completed.

2. The method according to claim 1, characterized in that Before obtaining the image file to be segmented and the MD5 value of the image file, the method further includes: When an image file needs to be uploaded, the user sends an upload request to the server through the terminal that obtains the image file; Determine whether the image file size is greater than a preset value. If the image file size is greater than the preset value, mark the image file as being in a state to be segmented; if the image file size is less than or equal to the preset value, mark the image file as being in a state to be directly uploaded.

3. The method according to claim 1, characterized in that The determining of the segmentation method according to the file information of the image file specifically includes: The segmentation method of the current image file is determined according to the correspondence between the file information of the preset image file and the segmentation method.

4. The method according to claim 1, characterized in that The uploading of the plurality of slice files and the MD5 value of each slice file to the server specifically includes: Perform upload processing on each piece file; Start a new thread, upload each piece file through okhttp, and store the MD5 value of each piece file in the transmission protocol.

5. A method for determining the correctness of image transmission, characterized in that: The method comprises: a server receives an MD5 value of an image file, a plurality of slice files, an MD5 value of each of the slice files, a segmentation method and an MD5 value corresponding to the segmentation method, wherein each of the slice files is obtained by segmenting the image file according to the segmentation method; For each slice file received, the server determines whether the MD5 value of the slice file is the same as the MD5 value of the corresponding slice file uploaded to the server. If they are the same, it is determined that the slice file is correctly transmitted; The server compares the MD5 value of the segmentation method with the MD5 value of the segmentation method uploaded to the server, and if they are the same, it is determined that the segmentation method is transmitted correctly; When it is determined that each of the slice files is transmitted correctly and the segmentation method is transmitted correctly, it is determined that the image file is transmitted correctly; After determining that the image file is transmitted correctly, the method further includes: The server reassembles the multiple correctly transmitted slice files into an image file according to the segmentation method; The MD5 value of the reassembled image file is calculated, and the MD5 value is compared with the MD5 value of the image file uploaded to the server. If the MD5 values ​​are the same, the reassembled image file is correctly assembled.

6. The method according to claim 5, characterized in that The method further comprises: When the MD5 value of the current file after transmission and / or combination is different from the MD5 value uploaded to the server, it is determined that the current file transmission and / or combination is incorrect, the current file is discarded and the transmission is restarted.

7. An image transmission device, characterized in that: The device comprises: A file acquisition module, used to acquire the image file to be segmented and the MD5 value of the image file; A segmentation judgment module, used to determine a segmentation method according to the file information of the image file, and obtain an MD5 value corresponding to the segmentation method; A segmentation execution module, used for segmenting the image file into a plurality of slice files according to the segmentation method; An MD5 value acquisition module is used to acquire the MD5 value of the slice file; a transmission verification module, for uploading the MD5 value of the image file, a plurality of slice files, the MD5 value of the slice file, the segmentation method and the MD5 value corresponding to the segmentation method to a server, so that the server can determine whether the image file is correctly transmitted by verifying the received file, the segmentation method and the MD5 value, and after determining that the image file is correctly transmitted, the server reassembles the plurality of correctly transmitted slice files into an image file according to the segmentation method; calculates the MD5 value of the reassembled image file, compares the MD5 value with the MD5 value of the image file uploaded to the server, and if the MD5 values ​​are the same, the reassembled image file is correctly combined; The server determines whether the image file is correctly transmitted by verifying the received file, segmentation method and each MD5 value, including: For each slice file received, the server determines whether the MD5 value of the slice file is the same as the MD5 value of the corresponding slice file uploaded to the server. If they are the same, it is determined that the slice file is correctly transmitted; The server compares the MD5 value of the segmentation method with the MD5 value of the segmentation method uploaded to the server, and if they are the same, it is determined that the segmentation method is transmitted correctly; When it is determined that each of the slice files is transmitted correctly and the segmentation method is transmitted correctly, it is determined that the image file is transmitted correctly; if the image file is transmitted correctly, the transmission of the image file is completed.

8. An electronic device for transmitting an image, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the image transmission method as described in any one of claims 1 to 4, or the method for determining the correctness of image transmission as described in any one of claims 5 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for transmitting an image as described in any one of claims 1 to 4, or the method for determining the correctness of image transmission as described in any one of claims 5 to 6 is implemented.