Asynchronous uploading method, system, electronic device and medium for massive photo upload

Through asynchronous concurrent multi -thread upload and asynchronous time -time replenishment technology, the problem of slowness and loss of photos upload in the agricultural insurance business has been solved, and the timely uploading and user experience of massive photos are realized.

CN115914286BActive Publication Date: 2025-01-24PEOPLE'S INSURANCE COMPANY OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211367454.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2025-01-24
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

In the agricultural insurance business, when a mobile phone uploads a large number of photos, the photos are uploaded slowly and lost due to unstable network signals and server performance bottlenecks, and the user experience is poor.

Method used

Adopt the asynchronous concurrent multi -threaded upload method. The mobile terminal is obtained to upload the photo set, uploaded to the background server through the asynchronous concurrent multi -threaded thread, and recorded the upload status at the background server.

Benefits of technology

The timely uploading of massive photos has been achieved, the data loss is avoided, and the user experience is improved. Through asynchronous timely replenishment and multi -threaded upload technology, the network bandwidth occupation and server pressure are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914286B_ABST
    Figure CN115914286B_ABST
Patent Text Reader

Abstract

The present invention discloses an asynchronous uploading method, system, electronic device and medium for mass photos, and relates to the technical field of data transmission. The method comprises: obtaining a group of claims photos to be uploaded through a mobile terminal; uploading multiple claims photos in the group of claims photos to be uploaded to a background server through asynchronous concurrent multithreading through the mobile terminal; sending the upload status of each claims photo to the mobile terminal for local storage through the background server; the upload status includes upload failure and upload success; and uploading the claims photos with upload status of upload failure to the background server through asynchronous concurrent multithreading through the mobile terminal at a fixed time. The present invention realizes timely uploading of photos and solves the problem of photo upload loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission, and in particular to a method, system, electronic device and medium for asynchronously uploading massive photos. Background Art

[0002] Agricultural insurance has the characteristics of being numerous, widespread, huge in number, and dispersed in space. In addition, the network signal is weak in rural areas, especially in mountainous areas, which has a great impact on the online inspection and photo upload of mobile terminals. In addition, large agricultural insurance households have a large number of insured persons, and the number of photos taken during inspection and accident inspection is large. If there is no asynchronous upload processing mechanism in the background of the upload server, it will take a long time to upload, the user experience will be poor, and if the signal is unstable, it will cause upload interruption and photo loss.

[0003] When uploading photos on the mobile phone APP, the photo files themselves are relatively large and take up network bandwidth. Especially in the actual business of agricultural insurance, a large number of on-site photos need to be collected as image data during the inspection and investigation process. The currently commonly used real-time interface upload technology is subject to factors such as network signals and server performance bottlenecks. Problems such as photo loss and slow photo upload often occur, resulting in a poor user experience. Summary of the invention

[0004] The purpose of the present invention is to provide a method, system, electronic device and medium for asynchronously uploading massive photos, so as to achieve timely uploading and solve the problem of photo upload loss.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] In a first aspect, the present invention provides an asynchronous uploading method for massive photos, comprising:

[0007] Obtaining a group of claims photos to be uploaded through a mobile terminal; the group of claims photos to be uploaded includes multiple claims photos;

[0008] Uploading multiple claim photos in the claim photo group to be uploaded to the backend server through asynchronous concurrent multi-threading via the mobile terminal;

[0009] The upload status of each claim photo is sent to the mobile terminal through the backend server for local storage; the upload status includes upload failure and upload success;

[0010] The mobile terminal periodically uploads the claim photos with upload status of failed upload to the backend server through asynchronous concurrent multi-threading.

[0011] Optionally, the asynchronous uploading method for massive photos further includes:

[0012] The upload status of each claim photo is stored through the local Room database of the mobile terminal.

[0013] Optionally, the backend server is a head office application server;

[0014] Uploading the plurality of claim photos in the claim photo group to be uploaded to the backend server through asynchronous concurrent multithreading by the mobile terminal specifically includes:

[0015] The multiple claims photos in the to-be-uploaded claims photo group are uploaded to the head office application server through asynchronous concurrent multi-threading via the head office firewall isolation area through the mobile terminal.

[0016] Optionally, the backend server includes a head office application server, a head office claims service server and a branch office image server;

[0017] The asynchronous uploading method for massive photos also includes:

[0018] Receiving and storing the claim photos with the upload status of successful upload through the head office application server, and generating a storage location directory corresponding to the claim photos with the upload status of successful upload;

[0019] Sending the claim photos with the upload status of successfully uploaded and the storage location directory to the claim business server of the head office through the head office application server to screen the photos to obtain qualified claim photos;

[0020] Determine the storage location corresponding to the qualified claim photos through the head office claims business server, and send the storage location corresponding to the qualified claim photos to the branch office image server;

[0021] The qualified claim photos are obtained through the branch image server according to the storage location corresponding to the qualified claim photos.

[0022] Optionally, the asynchronous uploading method for massive photos further includes:

[0023] The mobile terminal records the claim business type, photo name, universal unique identification code and upload time of each claim photo.

[0024] In a second aspect, the present invention provides an asynchronous uploading system for massive photos, including a mobile terminal and a backend server;

[0025] The mobile terminal is used for:

[0026] Obtaining a group of claims photos to be uploaded; the group of claims photos to be uploaded includes multiple claims photos;

[0027] Uploading multiple claim photos in the claim photo group to be uploaded to the backend server through asynchronous concurrent multithreading;

[0028] The backend server is used to

[0029] Sending the upload status of each claim photo to the mobile terminal for local storage; the upload status includes upload failure and upload success;

[0030] The mobile terminal is also used for:

[0031] The claim photos with upload status of failed upload are uploaded to the backend server through asynchronous concurrent multi-threading at regular intervals.

[0032] In a third aspect, the present invention provides an electronic device, the electronic device comprising a memory and a processor;

[0033] The memory is used to store a computer program, and the processor is used to run the computer program to execute an asynchronous uploading method for massive photos.

[0034] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program;

[0035] The computer program, when executed by a processor, implements the steps of an asynchronous uploading method for massive photos.

[0036] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0037] The present invention provides an asynchronous uploading method, system, electronic device and medium for massive photos. For the group of claims photos to be uploaded collected by the mobile terminal, they are uploaded to the background server through asynchronous concurrent multi-threading, so as to realize the simultaneous transmission of massive data on the mobile terminal, greatly shorten the upload time, and realize timely upload. The upload status of the claims photos is recorded by the background server, and the mobile terminal re-uploads the claims photos whose upload status is upload failure through asynchronous concurrent multi-threading at a fixed time to avoid data loss. In summary, the present invention combines multi-threaded uploading, asynchronous timed supplementary uploading and local storage of the mobile terminal, and has a good experience of timely uploading of photos, no user perception, and silent uploading in the background. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 It is a flow chart of the asynchronous uploading method of massive photos of the present invention;

[0040] Figure 2 It is a schematic diagram of a flow chart of an embodiment of the present invention;

[0041] Figure 3 It is a structural schematic diagram of the asynchronous uploading system for massive photos of the present invention. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] The present invention proposes an asynchronous uploading method, system, electronic device and medium for a single massive photo, integrating APP local database, multi-threaded uploading and asynchronous timed supplementary uploading methods. After modification, the mobile phone supports interrupted and continued uploading such as connecting to a phone call, answering a WeChat voice video, switching an operation interface, etc., solving the problems of upload loss and upload timeout of inspection and survey photos when the network signal is poor or during the peak period of inspection and survey, thereby improving the user experience.

[0044] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0045] Embodiment 1

[0046] like Figure 1 As shown, this embodiment provides an asynchronous uploading method for massive photos, including:

[0047] Step 100, obtaining a set of claim photos to be uploaded through a mobile terminal; the set of claim photos to be uploaded includes multiple claim photos.

[0048] Step 200, uploading multiple claim photos in the claim photo group to be uploaded to the backend server through asynchronous concurrent multi-threading via the mobile terminal.

[0049] (1) The backend server is the head office application server.

[0050] Step 200 specifically includes:

[0051] The multiple claims photos in the to-be-uploaded claims photo group are uploaded to the head office application server through asynchronous concurrent multi-threading via the head office firewall isolation area through the mobile terminal.

[0052] In a specific application, a mobile application APP is set up on the mobile terminal (such as a mobile phone or tablet). After each claim photo is taken by the mobile application APP, the mobile terminal will start a background asynchronous thread to upload the claim photo to the background server, that is, the head office application server. Because it uses a background asynchronous thread, it does not affect the front-end operation of the mobile terminal, and can continue to take the next photo, thereby improving the shooting efficiency and data uploading efficiency, and reducing the waiting time.

[0053] The images and photos taken by the mobile application APP will update the local photo path and other business information stored in the mobile phone (including images and photos in the status of waiting to be uploaded, images and photos in the process of being uploaded, images and photos uploaded successfully, images and photos uploaded failed, and images and photos waiting to be uploaded again) to the local Room database of the mobile application APP in real time.

[0054] The above is for single image photos, but for multiple image photos:

[0055] After the data other than images and photos collected by the mobile application APP is successfully saved in the background, the mobile application APP will asynchronously start the image and photo upload service thread, which supports concurrent multi-threaded uploads. The image upload service thread will upload images and photos in groups from the global image upload queue array. After each group of image photos is successfully uploaded, the status of the corresponding image photos in the local database will be changed to uploaded (not uploaded by default), and the uploaded group of image photo information in the global image photo upload array will be removed, and then the next group will be uploaded until the global image photos are uploaded.

[0056] If there are images that failed to be uploaded, they will be temporarily stored in the local Room database of the mobile application APP, and multiple images that failed to be uploaded will be collected to obtain an image group that failed to be uploaded; after the global images are uploaded, the image data in the image group that failed to be uploaded will be re-uploaded. When there is no image data in the array, the upload service thread is closed.

[0057] (2) The mobile terminal and mobile application APP mentioned in the previous article (1) are mainly responsible for transmitting photos to the middle platform. At the same time, the mobile terminal database records the current status of the photo (including upload status and storage status), interrupts the transmission and resumes the transmission when a phone call is connected, and also records the UUID (Universally Unique Identifier) ​​of the current claim photo, the claim business type, the photo name and the upload time.

[0058] The main function of the middle platform is to temporarily save the claim photo information, waiting for the core clerks to review and screen it. After the screening is completed, the address where the photo information is stored is sent to the branch image server. The branch image server obtains the photo information from the temporary storage directory on the mobile terminal according to the address where the photo information is stored and transfers it to the formal directory after the review is passed, thereby realizing the sorting of claim photos and providing a data basis for subsequent claims.

[0059] Specifically, the backend server includes a head office application server, a head office claims service server and a branch office image server.

[0060] The asynchronous uploading method for massive photos also includes:

[0061] 1) The claim photos with the upload status of successful upload are received and stored through the head office application server, and a storage location directory corresponding to the claim photos with the upload status of successful upload is generated.

[0062] 2) The claim photos with the upload status of successfully uploaded and the storage location directory are sent to the claim business server of the head office through the head office application server for photo screening to obtain qualified claim photos.

[0063] 3) Determine the storage location corresponding to the qualified claim photos through the head office claims business server, and send the storage location corresponding to the qualified claim photos to the branch image server.

[0064] 4) Obtaining the qualified claim photos through the branch image server according to the storage location corresponding to the qualified claim photos.

[0065] Step 300, the upload status of each claim photo is sent to the mobile terminal for local storage through the background server; the upload status includes upload failure and upload success; specifically, the upload status of each claim photo is stored through the local Room database of the mobile terminal.

[0066] Step 400, the mobile terminal periodically uploads the claim photos with upload status of failed upload to the backend server through asynchronous concurrent multi-threading.

[0067] In a specific practical application, such as Figure 2 As shown, if the claim photos taken by the mobile terminal fail to be uploaded asynchronously in the background, the failure status will be recorded in the APP local Room database. The APP main thread will scan the local Room database regularly, add the image photo information that failed to be uploaded in the background to the global image upload queue array of the mobile application APP, and upload it again.

[0068] If the claim photos taken by the mobile terminal are uploaded successfully in the background asynchronously, the uploaded claim photos will be converted by dnat to the head office public network, and then pass through the head office firewall isolation area (demilitarized zone, DMZ) of the head office application server, enter the head office application server, and be stored there.

[0069] Then, the photos containing the claims data can be selectively sent to the head office claims server, where relevant staff will review and screen them according to work needs, and send the storage addresses of the screened photos to the branch image server. The branch image server obtains the corresponding photos from the mobile application APP based on the storage addresses of the photos obtained, through the head office application server.

[0070] All the information such as the names and storage paths of the images and photos collected by the mobile application APP will be saved in the timed task table of the background database, and the photo push task will be executed regularly. If the photo push task fails, the number of times will be recorded. If it fails twice in 24 hours, the push will not continue. The number of failures will be updated regularly at 0:00 every day, and the push will continue.

[0071] In summary, the present invention provides an asynchronous upload mechanism for massive image photos. The overall architecture adopts a layered, distributed deployment structure, which clearly separates the presentation layer and business logic, and can ensure the consistency, stability, openness, functional extensibility, micro-maintainability, and concurrency of the application service logic.

[0072] Embodiment 2

[0073] like Figure 3 As shown, in order to execute the method corresponding to the above-mentioned embodiment 1 to achieve the corresponding functions and technical effects, this embodiment provides an asynchronous uploading system for massive photos, including a mobile terminal and a background server.

[0074] The mobile terminal is used for:

[0075] Obtaining a group of claims photos to be uploaded; the group of claims photos to be uploaded includes multiple claims photos;

[0076] Uploading multiple claim photos in the claim photo group to be uploaded to the backend server through asynchronous concurrent multithreading;

[0077] The backend server is used to

[0078] Sending the upload status of each claim photo to the mobile terminal for local storage; the upload status includes upload failure and upload success;

[0079] The mobile terminal is also used for:

[0080] The claim photos with upload status of failed upload are uploaded to the backend server through asynchronous concurrent multi-threading at regular intervals.

[0081] Embodiment 3

[0082] This embodiment provides an electronic device, which includes a memory and a processor; the memory is used to store a computer program, and the processor is used to run the computer program to execute the asynchronous uploading method of massive photos described in Embodiment 1.

[0083] Optionally, the electronic device is a server.

[0084] In addition, this embodiment also provides a computer-readable storage medium, which stores a computer program; when the computer program is executed by a processor, the steps of the asynchronous uploading method for massive photos described in Example 1 are implemented.

[0085] Compared with the prior art, the present invention also has the following advantages:

[0086] The asynchronous uploading method, system, electronic device and medium of massive photos of the present invention can achieve silent asynchronous uploading, have relatively low requirements on network speed, relatively low network bandwidth resource occupancy, and reduce server concurrency pressure.

[0087] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0088] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for asynchronously uploading a large amount of photos, characterized in that: The asynchronous uploading method for massive photos includes: Obtaining a group of claims photos to be uploaded through a mobile terminal; the group of claims photos to be uploaded includes multiple claims photos; Uploading multiple claim photos in the claim photo group to be uploaded to the backend server through asynchronous concurrent multi-threading via the mobile terminal; The upload status of each claim photo is sent to the mobile terminal through the backend server for local storage; the upload status includes upload failure and upload success; The mobile terminal periodically uploads the claim photos with upload failure status to the backend server through asynchronous concurrent multithreading; A mobile application APP is set up on the mobile terminal; the mobile application APP asynchronously starts the image photo upload service thread, supports concurrent multi-threaded upload, and the image upload service thread uploads images and photos in groups from the global image upload queue array; after each group of image photos is successfully uploaded, the status of the image photos in the local database will be changed to uploaded, and the uploaded group of image photo information in the global image photo upload array will be removed, and then the next group will be uploaded until the global image photos are uploaded; If there are images and photos that failed to be uploaded, the images and photos that failed to be uploaded are temporarily stored in the local Room database of the mobile application APP, and multiple images and photos that failed to be uploaded are collected to obtain an image group that failed to be uploaded; after the global images and photos are uploaded, the image data in the image group that failed to be uploaded is re-uploaded until there is no image and photo data in the array, and the upload service thread is closed; All the names and storage paths of the images and photos collected by the mobile application APP are saved in the scheduled task table of the background database, and the task of pushing photos is executed regularly; The backend server includes a head office application server, a head office claims service server and a branch office image server; the method for asynchronously uploading a large number of photos also includes: Receiving and storing the claim photos with the upload status of successful upload through the head office application server, and generating a storage location directory corresponding to the claim photos with the upload status of successful upload; Sending the claim photos with the upload status of successfully uploaded and the storage location directory to the claim business server of the head office through the head office application server to screen the photos to obtain qualified claim photos; Determine the storage location corresponding to the qualified claim photos through the head office claims business server, and send the storage location corresponding to the qualified claim photos to the branch office image server; The qualified claim photos are obtained through the branch image server according to the storage location corresponding to the qualified claim photos.

2. The asynchronous uploading method for mass photos according to claim 1, characterized in that: The asynchronous uploading method for massive photos also includes: The upload status of each claim photo is stored through the local Room database of the mobile terminal.

3. The asynchronous uploading method for mass photos according to claim 1, characterized in that: The backend server is the head office application server; Uploading the plurality of claim photos in the claim photo group to be uploaded to the backend server through asynchronous concurrent multithreading by the mobile terminal specifically includes: The multiple claims photos in the to-be-uploaded claims photo group are uploaded to the head office application server through asynchronous concurrent multi-threading via the head office firewall isolation area through the mobile terminal.

4. The asynchronous uploading method for mass photos according to claim 1, characterized in that: The asynchronous uploading method for massive photos also includes: The mobile terminal records the claim business type, photo name, universal unique identification code and upload time of each claim photo.

5. An asynchronous upload system for massive photos, characterized in that: The asynchronous uploading system for massive photos includes a mobile terminal and a backend server; The mobile terminal is used for: Obtaining a group of claims photos to be uploaded; the group of claims photos to be uploaded includes multiple claims photos; Uploading multiple claim photos in the claim photo group to be uploaded to the backend server through asynchronous concurrent multithreading; The backend server is used to Sending the upload status of each claim photo to the mobile terminal for local storage; the upload status includes upload failure and upload success; The mobile terminal is also used for: Regularly upload the claim photos with upload failure status to the backend server through asynchronous concurrent multi-threading; A mobile application APP is set up on the mobile terminal; the mobile application APP asynchronously starts the image photo upload service thread, supports concurrent multi-threaded upload, and the image upload service thread uploads images and photos in groups from the global image upload queue array; after each group of image photos is successfully uploaded, the status of the image photos in the local database will be changed to uploaded, and the uploaded group of image photo information in the global image photo upload array will be removed, and then the next group will be uploaded until the global image photos are uploaded; If there are images and photos that failed to be uploaded, the images and photos that failed to be uploaded are temporarily stored in the local Room database of the mobile application APP, and multiple images and photos that failed to be uploaded are collected to obtain an image group that failed to be uploaded; after the global images and photos are uploaded, the image data in the image group that failed to be uploaded is re-uploaded until there is no image and photo data in the array, and the upload service thread is closed; All the names and storage paths of the images and photos collected by the mobile application APP are saved in the scheduled task table of the background database, and the task of pushing photos is executed regularly; The backend server includes the head office application server, the head office claims service server and the branch office image server; The asynchronous uploading method for massive photos also includes: Receiving and storing the claim photos with the upload status of successful upload through the head office application server, and generating a storage location directory corresponding to the claim photos with the upload status of successful upload; Sending the claim photos with the upload status of successfully uploaded and the storage location directory to the claim business server of the head office through the head office application server to screen the photos to obtain qualified claim photos; Determine the storage location corresponding to the qualified claim photos through the head office claims business server, and send the storage location corresponding to the qualified claim photos to the branch office image server; The qualified claim photos are obtained through the branch image server according to the storage location corresponding to the qualified claim photos.

6. An electronic device, characterized in that: The electronic device comprises a memory and a processor; The memory is used to store a computer program, and the processor is used to run the computer program to execute the asynchronous uploading method for massive photos as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program; When the computer program is executed by a processor, the steps of the asynchronous uploading method for massive photos described in any one of claims 1-4 are implemented.

Citation Information

Patent Citations

  • Integrated system for claim settlement of vehicle insurance capable of shooting and uploading evidence-obtaining photograph or video by mobile phone

    CN101303761A

  • Picture data upload method for mobile equipment

    CN104954433A

  • Electronic invoice uploading method and device, storage medium and electronic equipment

    CN114742601A