File distribution method, device, electronic device and computer-readable storage medium

By analyzing the file acquisition request of the terminal device and determining the supported file formats, only the target files in the file format supported by the terminal device are issued, which solves the problem of resource waste caused by storing files in different formats, reduces file storage pressure and improves storage quality.

CN119743474APending Publication Date: 2025-04-01SHENZHEN TCL NEW-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411775090.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In Internet business operations, storing files in different formats poses a challenge to file storage, and users do not always need files in all formats, resulting in resource waste in storage of files in all formats.

Method used

By analyzing the file acquisition request sent by the terminal device, determining the file format supported by the terminal device, and determining the target file in the preset format issuance order, and only the target file in the file format supported by the terminal device issuance.

Benefits of technology

Reduce the required files to be stored, reduce the file storage pressure, and optimize the format of stored files through the preset format distribution order, improving the storage quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743474A_ABST
    Figure CN119743474A_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a file sending method, device, electronic device and computer-readable storage medium, the method comprising: the server responds to the file acquisition request sent by the terminal device, parses the file acquisition request, and obtains at least one file format supported by the terminal device; determines the target file corresponding to the file acquisition request according to at least one file format and a preset format sending order; sends the target file to the terminal device. The target format is matched by the file format supported by the terminal device, so that the server does not need to save files of various file formats. As long as there is a file format that matches the file format supported by the terminal device, the server can respond to the file acquisition request of the terminal device to obtain the target file, thereby reducing the files that need to be stored and reducing the pressure of file storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of file processing technology, and specifically to a file distribution method, device, electronic device, and computer-readable storage medium. Background Art

[0002] In the operation of Internet business, file distribution accounts for a considerable amount of traffic and operating costs. Files include documents, pictures, audio and video, etc. File distribution realizes the transmission and presentation of diversified information on the Internet, bringing convenience to people's lives.

[0003] With the increase of user demands and the development of computer technology, file formats suitable for different needs have emerged, and file formats have become diverse.

[0004] However, storing files in different formats poses a challenge to file storage, and users do not always need files in all formats, resulting in a waste of resources when files are stored in all formats separately. Summary of the invention

[0005] The embodiments of the present application provide a file distribution method, device, electronic device and computer-readable storage medium, which can reduce the files required to be stored and reduce the file storage pressure.

[0006] In a first aspect, an embodiment of the present application provides a file delivery method, which is applied to a server, and the method includes:

[0007] In response to a file acquisition request sent by a terminal device, parsing the file acquisition request to obtain at least one file format supported by the terminal device;

[0008] Determining a target file corresponding to the file acquisition request according to the at least one file format and a preset format distribution order;

[0009] Send the target file to the terminal device.

[0010] In a second aspect, an embodiment of the present application further provides a file sending device, which is applied to a server, and the device includes:

[0011] A response module, configured to respond to a file acquisition request sent by a terminal device, parse the file acquisition request, and obtain at least one file format supported by the terminal device;

[0012] A determination module, configured to determine a target file corresponding to the file acquisition request according to the at least one file format and a preset format delivery order;

[0013] The sending module is used to send the target file to the terminal device.

[0014] Optionally, in some embodiments of the present application, determining the target file corresponding to the file acquisition request according to the at least one file format and a preset format delivery order includes:

[0015] The matching files corresponding to the file formats are matched in sequence according to the format delivery order, and after a matching file of any file format is matched, the matching is terminated and the matching file is used as the target file.

[0016] Optionally, in some embodiments of the present application, matching files corresponding to the file formats are matched in sequence according to the order in which the formats are issued, and after a matching file of any file format is matched, the matching is ended, and the matching file is used as the target file, including:

[0017] Determining a first format from the at least one file format according to the format delivery order;

[0018] matching a first matching file for the file acquisition request according to the first format;

[0019] If a first matching file of the first format is matched, taking the first matching file as the target file;

[0020] If no first matching file in the first format is found, a second format other than the first format is determined from the at least one file format according to the format delivery order, and a target file for the file acquisition request is determined according to the second format.

[0021] Optionally, in some embodiments of the present application, matching files corresponding to the file formats are matched in sequence according to the order in which the formats are issued, and after a matching file of any file format is matched, the matching is ended, and the matching file is used as the target file, including:

[0022] Determine common file formats;

[0023] Within a preset number of downgrades, downgrade the matching files corresponding to each of the file formats in sequence according to the order in which the formats are issued;

[0024] If a matching file is found within the preset downgrade times, the matching is terminated and the matching file is used as the target file;

[0025] If the matching file is not found within the preset downgrade times, the matching is terminated and the matching file in the universal file format is used as the target file.

[0026] Optionally, in some embodiments of the present application, after sending the target file to the terminal device, the method further includes:

[0027] Acquire a matching log of the server, and filter at least one target acquisition request of a missed file and at least one file format corresponding to each target acquisition request from the matching log;

[0028] Determine at least one missed target resource file and a target file format corresponding to each target resource file according to the at least one target acquisition request and the at least one file format;

[0029] For each target resource file, if the number of matches of the target file format corresponding to the target resource file exceeds a preset threshold, a target resource file corresponding to the target file format is converted.

[0030] Optionally, in some embodiments of the present application, before determining the target file corresponding to the file acquisition request according to the at least one file format and the preset format delivery order, the method further includes:

[0031] In response to the uploaded format customization rule information, determine the priority of each file format, and determine the format distribution order according to the priority;

[0032] Alternatively, in response to obtaining the matching log of the server, the number of requests for each file format is counted, and the format delivery order is determined according to the number of requests;

[0033] Alternatively, in response to the analysis results of the file features of each file format, the format distribution order of each file format is determined according to the analysis results;

[0034] The file feature includes at least one of compression loss information, processing energy consumption information, file size information, file quality information or file encoding and decoding speed information.

[0035] In a third aspect, an embodiment of the present application provides a file delivery method, which is applied to a terminal device, and the method includes:

[0036] In response to the file acquisition operation, acquiring at least one file format supported by the terminal device;

[0037] generating a file acquisition request corresponding to the file acquisition operation according to the at least one file format;

[0038] Sending the file acquisition request to a server, the server determining a target file corresponding to the file acquisition request according to at least one file format included in the file acquisition request and a preset format distribution order, and delivering the target file to the terminal device;

[0039] Receive the target file sent by the server.

[0040] In a fourth aspect, an embodiment of the present application provides a file delivery device, which is applied to a terminal device, and the device includes:

[0041] A response module, configured to obtain at least one file format supported by the terminal device in response to a file acquisition operation;

[0042] A generating module, configured to generate a file acquisition request corresponding to the file acquisition operation according to the at least one file format;

[0043] A sending module, configured to send the file acquisition request to a server, wherein the server determines a target file corresponding to the file acquisition request according to at least one file format included in the file acquisition request and a preset format distribution order, and distributes the target file to the terminal device;

[0044] A receiving module is used to receive the target file sent by the server.

[0045] In a fifth aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps in the above-mentioned file sending method are implemented.

[0046] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned file sending method are implemented.

[0047] In a seventh aspect, the embodiments of the present application further provide a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations described in the embodiments of the present application.

[0048] The server in an embodiment of the present application responds to a file acquisition request sent by a terminal device, parses the file acquisition request, obtains at least one file format supported by the terminal device, determines a target file corresponding to the file acquisition request according to the at least one file format and a preset format distribution order, and distributes the target file to the terminal device.

[0049] Among them, the target format is matched by the file format supported by the terminal device, so that the server does not need to save files of various file formats. As long as there is a file format that matches the file format supported by the terminal device, it can respond to the file acquisition request of the terminal device to obtain the target file, thereby reducing the files that need to be stored and reducing file storage pressure.

[0050] Among them, the preset format delivery order also provides guidance for file storage, which helps to control the format of stored files and improve storage quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0052] Figure 1 It is a schematic diagram of a scenario in which a server according to an embodiment of the present application executes a method for sending the file;

[0053] Figure 2 It is a flowchart of the file distribution method provided in the embodiment of the present application;

[0054] Figure 3 It is another flowchart of the file distribution method provided in the embodiment of the present application;

[0055] Figure 4 It is a structural diagram of a file issuing device provided in an embodiment of the present application;

[0056] Figure 5 is another structural schematic diagram of the file issuing device provided in an embodiment of the present application;

[0057] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0059] The embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for sending files. Specifically, the embodiments of the present application provide a file sending device suitable for electronic devices, which is used to respond to a file acquisition request of a terminal device and send a target file in a file format supported by the terminal device to the terminal device. The electronic device includes a terminal device or a server, and the terminal device includes but is not limited to mobile phones, tablet computers, laptop computers, televisions and other devices. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, etc. The server can be directly or indirectly connected via wired or wireless communication.

[0060] See also Figure 1 , Figure 1 : is a schematic diagram of a scenario in which a server executes a method for sending a file provided in an embodiment of the present application, wherein the specific execution process of the server executing the method for sending the file is as follows:

[0061] The server 10 responds to the file acquisition request sent by the terminal device 11, parses the file acquisition request, obtains at least one file format supported by the terminal device 11, determines the target file corresponding to the file acquisition request according to the at least one file format and a preset format sending order, and sends the target file to the terminal device 11.

[0062] For example, a user initiates a file acquisition request to the server 10 through the terminal device 11. After receiving the file acquisition request, the server 10 parses the file acquisition request, matches a target file in a file format supported by the terminal device 11, and sends the matched target file to the terminal device 11 so that the user can browse the target file through the terminal device 11.

[0063] In summary, the embodiment of the present application matches the target format through the file format supported by the terminal device, so that the server does not need to save files of various file formats. As long as there is a file format that matches the file format supported by the terminal device, the server can respond to the file acquisition request of the terminal device to obtain the target file, thereby reducing the files that need to be stored and reducing the file storage pressure.

[0064] Among them, the preset format delivery order also provides guidance for file storage, which helps to control the format of stored files and improve storage quality.

[0065] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.

[0066] See also Figure 2 , Figure 2 A flowchart of a method for sending a file provided in an embodiment of the present application. Although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the flowchart. Specifically, the process of the method for sending the file specifically includes:

[0067] 101. In response to a file acquisition request sent by a terminal device, parse the file acquisition request to obtain at least one file format supported by the terminal device.

[0068] The terminal device mainly refers to a user-side device, such as a mobile phone, a laptop computer, or a tablet computer, etc. The user can send a file acquisition request to the server through the terminal device. For example, the user automatically generates a file acquisition request by clicking a file viewing control on the terminal device interface, and the terminal device automatically sends the file acquisition request to the server.

[0069] Among them, the file format is the format of the file, which refers to the data organization method of the file, including the characteristics of data encoding, structure, storage method, and how to read and interpret data. Different file formats are suitable for different purposes and are different forms of expression for the same content. For example, document files include txt files, doc files, or pdf files, etc. For pictures, they include jpg (or jpeg), png, gif, avif, or webp, etc.

[0070] For example, if the file is a picture, the access link corresponding to the file acquisition request includes https: / / AAA.com / xx / xx / a.jpg?type=png,webp,avif.

[0071] It is understandable that the terminal device supports one, two or more file formats.

[0072] 102. Determine a target file corresponding to the file acquisition request according to the at least one file format and a preset format delivery order.

[0073] Among them, the preset format delivery order is a pre-configured format delivery order, that is, the order in which the formats are delivered first. For example, for pictures, the corresponding format delivery order is avif, wepp, jpg and png, that is, avif format files are delivered first, then webp format files, and finally jpg and png format files.

[0074] Among them, by determining the target file according to the format delivery order, it is helpful to control the delivery of files according to priority or order, and improve the rationality of file delivery. For example, the format delivery order of each file format can be configured based on user customization or file characteristics, and the delivered file format can be controlled according to the format delivery order.

[0075] Specifically, in some embodiments of the present application, the format delivery order can be obtained in the following manner, that is, before the step of "determining the target file corresponding to the file acquisition request according to the at least one file format and the preset format delivery order", the method further includes:

[0076] In response to the uploaded format customization rule information, determine the priority of each file format, and determine the format distribution order according to the priority;

[0077] Alternatively, in response to obtaining the matching log of the server, the number of requests for each file format is counted, and the format delivery order is determined according to the number of requests;

[0078] Alternatively, in response to the analysis results of the file features of each file format, the format distribution order of each file format is determined according to the analysis results;

[0079] The file feature includes at least one of compression loss information, processing energy consumption information, file size information, file quality information or file encoding and decoding speed information.

[0080] The format customization rule refers to a format delivery rule customized by a user, that is, a format delivery order. The format customization rule can be uploaded by a user to a server and stored in the server.

[0081] Among them, the matching log is a log generated by the server after responding to a file acquisition request, which records the responded file acquisition request and the target file matched for the file acquisition request, wherein the matched target file refers to the records of matched files and unmatched files, etc.

[0082] Among them, file features refer to the characteristics of the file, including information such as file compression loss, processing energy consumption, file size, file quality, and encoding and decoding speed. The order of each file format is comprehensively analyzed through various features, so that the final format delivery order can comprehensively consider the characteristics of each dimension, thereby improving the rationality and effectiveness of the format delivery order.

[0083] 103. Send the target file to the terminal device.

[0084] That is, the target file is sent to the terminal device that initiates the request to obtain the file.

[0085] In summary, the embodiment of the present application matches the target format through the file format supported by the terminal device, so that the server does not need to save files of various file formats. As long as there is a file format that matches the file format supported by the terminal device, the server can respond to the file acquisition request of the terminal device to obtain the target file, thereby reducing the files that need to be stored and reducing the file storage pressure.

[0086] Among them, the preset format delivery order also provides guidance for file storage, which helps to control the format of stored files and improve storage quality.

[0087] Optionally, in an embodiment of the present application, target files of corresponding file formats may be matched sequentially based on the format delivery order. That is, optionally, in some embodiments of the present application, the step of “determining the target file corresponding to the file acquisition request according to the at least one file format and the preset format delivery order” includes:

[0088] The matching files corresponding to the file formats are matched in sequence according to the format delivery order, and after a matching file of any file format is matched, the matching is terminated and the matching file is used as the target file.

[0089] For example, taking the file as an image, first match the target image in avif format from the server. If the server does not contain the target image in this format, match the target image in webp format. If no match is found, match the target image in jpg and png formats.

[0090] That is, the target files corresponding to the first format, the second format and the third format are matched in sequence according to the order in which the formats are sent, that is, the step of "matching files corresponding to the file formats in sequence according to the order in which the formats are sent, and after matching a matching file of any file format, ending the matching, and taking the matching file as the target file" includes:

[0091] Determining a first format from the at least one file format according to the format delivery order;

[0092] matching a first matching file for the file acquisition request according to the first format;

[0093] If a first matching file of the first format is matched, taking the first matching file as the target file;

[0094] If no first matching file in the first format is found, a second format other than the first format is determined from the at least one file format according to the format delivery order, and a target file for the file acquisition request is determined according to the second format.

[0095] For example, taking the file as a picture, the access link corresponding to the file acquisition request initiated by the terminal device is: https: / / AAA.com / xx / xx / a.jpg? type=png,webp,avif, then the terminal device or the application (APP) in the terminal device supports jpg, png, gif, avif, and webp. Correspondingly, if the format is issued in the order of avif, webp, jpg and png, the first format corresponds to avif, and the second format corresponds to webp. For example, if the first matching file of the first format is matched, the file format of the first matching file is avif; if the second matching file of the second format is matched, the file format of the second matching file is webp.

[0096] Among them, in the embodiments of the present application, the number of downgrades of the format delivery order can be set, that is, the number of matches in sequence according to the format delivery order can be set to avoid the server queuing for matching for a long time, causing the terminal device to wait for a long time for a response, affecting the user experience, that is, optionally, in some embodiments of the present application, the step of "matching files corresponding to each of the file formats in sequence according to the format delivery order, and ending the matching after matching a matching file of any file format, and using the matching file as the target file" includes:

[0097] Determine common file formats;

[0098] Within a preset number of downgrades, downgrade the matching files corresponding to each of the file formats in sequence according to the order in which the formats are issued;

[0099] If a matching file is found within the preset downgrade times, the matching is terminated and the matching file is used as the target file;

[0100] If the matching file is not found within the preset downgrade times, the matching is terminated and the matching file in the universal file format is used as the target file.

[0101] The general file format refers to a commonly used, customary or uniformly required file format. For example, for pictures, jpg and png formats are general file formats.

[0102] Among them, the preset number of downgrades refers to the number of times the files are matched in the order of format delivery. Accordingly, taking the preset number of downgrades as two as an example, if the target file is not matched for two consecutive sequential matches, pictures in jpg or png format are directly matched so that the user can perceive a quick response on the terminal device side.

[0103] Optionally, in an embodiment of the present application, if the target file is not matched, that is, the target file is not hit, or it takes more than a preset number of downgrades to match a file of a common file format, and the number of occurrences is large, then the conversion can be controlled to generate a file of a corresponding format to improve the efficiency of subsequent matching, thereby improving the response efficiency, that is, optionally, in some embodiments of the present application, after the step of "sending the target file to the terminal device", the method further includes:

[0104] Acquire a matching log of the server, and filter at least one target acquisition request of a missed file and at least one file format corresponding to each target acquisition request from the matching log;

[0105] Determine at least one missed target resource file and a target file format corresponding to each target resource file according to the at least one target acquisition request and the at least one file format;

[0106] For each target resource file, if the number of matches of the target file format corresponding to the target resource file exceeds a preset threshold, a target resource file corresponding to the target file format is converted.

[0107] For example, for picture A, if the number of misses of picture A in AVIF and WebP formats exceeds the threshold through matching log statistics, picture A in AVIF and WebP formats is generated. For example, picture A in jpg format is converted to generate picture A in AVIF and WebP formats, and picture A in AVIF and WebP formats with relatively frequent matches is obtained. In the embodiment of the present application, picture A in jpg format can also be retained to meet the acquisition needs of some users.

[0108] In summary, the embodiment of the present application matches the target format through the file format supported by the terminal device, so that the server does not need to save files of various file formats. As long as there is a file format that matches the file format supported by the terminal device, the server can respond to the file acquisition request of the terminal device to obtain the target file, thereby reducing the files that need to be stored and reducing the file storage pressure.

[0109] Among them, the preset format delivery order also provides guidance for file storage, which helps to control the format of stored files and improve storage quality.

[0110] Also, files are sent based on the file format supported by the terminal device to ensure that the sent files are compatible with the terminal device to avoid incompatibility issues.

[0111] Here, statistics are collected through multiple matching results, and format conversion is performed based on the statistical results to ensure that the converted file format is commonly used and effective.

[0112] Based on the above file delivery method, the file acquisition request issued by the terminal device side needs to include the file format supported by the terminal device (similarly, also refers to the client or APP) itself. Therefore, the terminal device side needs to have the ability to obtain the supported file format. Figure 3 , Figure 3 is another flow chart of the file sending method provided in an embodiment of the present application, wherein the process of the file sending method is applicable to a terminal device, that is, the terminal device executes the process specifically including:

[0113] 111. In response to a file acquisition operation, acquire at least one file format supported by the terminal device;

[0114] Among them, the file format supported by the terminal device is determined based on the characteristics of the terminal device or the application. The characteristics or supported file formats can be stored in the form of fields. Then, the terminal device can obtain the supported file formats by obtaining the fields.

[0115] 112. Generate a file acquisition request corresponding to the file acquisition operation according to the at least one file format;

[0116] For example, fields corresponding to supported file formats are added to the link corresponding to the file acquisition request.

[0117] 113. Send the file acquisition request to a server, the server determines a target file corresponding to the file acquisition request according to at least one file format included in the file acquisition request and a preset format delivery order, and delivers the target file to the terminal device;

[0118] 114. Receive the target file sent by the server.

[0119] The process of matching the target file according to the file acquisition request can be referred to as Figure 2 It should be understood from the description in that the server can be a device capable of data processing and data storage, including a content distribution server. In some scenarios, the server can also be understood as a cloud, that is, responding to a file acquisition request through the cloud and sending the target file.

[0120] In summary, by carrying the file formats supported by the terminal device in the file acquisition request, the terminal device can help the server to accurately send files compatible with the terminal device, thereby improving the rationality and accuracy of file sending. Specifically, by uploading various supported file formats, it helps the server to match files that meet any file format, thereby reducing the number of files that need to be stored on the server side. That is, only one file with the same file format as the one supported by the terminal device needs to be stored, thereby reducing the files that need to be stored and reducing file storage pressure.

[0121] In order to better implement the file distribution method of the present application, the present application also provides a file distribution device based on the above file distribution method. The meanings of the terms are the same as those in the above file distribution method, and the specific implementation details can refer to the description in the method embodiment.

[0122] See also Figure 4 , Figure 4 : is a schematic diagram of the structure of a file issuing device provided in an embodiment of the present application. The file issuing device is applied to a server, and the specific structure is as follows:

[0123] A response module 201 is used to respond to a file acquisition request sent by a terminal device, parse the file acquisition request, and obtain at least one file format supported by the terminal device;

[0124] A determination module 202, configured to determine a target file corresponding to the file acquisition request according to the at least one file format and a preset format delivery order;

[0125] The sending module 203 is used to send the target file to the terminal device.

[0126] Optionally, in some embodiments of the present application, determining the target file corresponding to the file acquisition request according to the at least one file format and a preset format delivery order includes:

[0127] The matching files corresponding to the file formats are matched in sequence according to the format delivery order, and after a matching file of any file format is matched, the matching is terminated and the matching file is used as the target file.

[0128] Optionally, in some embodiments of the present application, matching files corresponding to the file formats are matched in sequence according to the order in which the formats are issued, and after a matching file of any file format is matched, the matching is ended, and the matching file is used as the target file, including:

[0129] Determining a first format from the at least one file format according to the format delivery order;

[0130] matching a first matching file for the file acquisition request according to the first format;

[0131] If a first matching file of the first format is matched, taking the first matching file as the target file;

[0132] If no first matching file in the first format is found, a second format other than the first format is determined from the at least one file format according to the format delivery order, and a target file for the file acquisition request is determined according to the second format.

[0133] Optionally, in some embodiments of the present application, matching files corresponding to the file formats are matched in sequence according to the order in which the formats are issued, and after a matching file of any file format is matched, the matching is ended, and the matching file is used as the target file, including:

[0134] Determine common file formats;

[0135] Within a preset number of downgrades, downgrade the matching files corresponding to each of the file formats in sequence according to the order in which the formats are issued;

[0136] If a matching file is found within the preset downgrade times, the matching is terminated and the matching file is used as the target file;

[0137] If the matching file is not found within the preset downgrade times, the matching is terminated and the matching file in the universal file format is used as the target file.

[0138] Optionally, in some embodiments of the present application, after sending the target file to the terminal device, the method further includes:

[0139] Acquire a matching log of the server, and filter at least one target acquisition request of a missed file and at least one file format corresponding to each target acquisition request from the matching log;

[0140] Determine at least one missed target resource file and a target file format corresponding to each target resource file according to the at least one target acquisition request and the at least one file format;

[0141] For each target resource file, if the number of matches of the target file format corresponding to the target resource file exceeds a preset threshold, a target resource file corresponding to the target file format is converted.

[0142] Optionally, in some embodiments of the present application, before determining the target file corresponding to the file acquisition request according to the at least one file format and the preset format delivery order, the method further includes:

[0143] In response to the uploaded format customization rule information, determine the priority of each file format, and determine the format distribution order according to the priority;

[0144] Alternatively, in response to obtaining the matching log of the server, the number of requests for each file format is counted, and the format delivery order is determined according to the number of requests;

[0145] Alternatively, in response to the analysis results of the file features of each file format, the format distribution order of each file format is determined according to the analysis results;

[0146] The file feature includes at least one of compression loss information, processing energy consumption information, file size information, file quality information or file encoding and decoding speed information.

[0147] In the embodiment of the present application, the response module 201 responds to the file acquisition request sent by the terminal device, parses the file acquisition request, and obtains at least one file format supported by the terminal device; the determination module 202 determines the target file corresponding to the file acquisition request according to the at least one file format and a preset format issuance order, and the issuance module 203 sends the target file to the terminal device.

[0148] Among them, the embodiment of the present application matches the target format through the file format supported by the terminal device, so that the server does not need to save files of various file formats. As long as there is a file format that matches the file format supported by the terminal device, it can respond to the file acquisition request of the terminal device to obtain the target file, thereby reducing the files that need to be stored and reducing file storage pressure.

[0149] Among them, the preset format delivery order also provides guidance for file storage, which helps to control the format of stored files and improve storage quality.

[0150] See also Figure 5 , Figure 5 : is another structural schematic diagram of a file issuing device provided in an embodiment of the present application, wherein the file issuing device is applied to a terminal device, and specifically can be as follows:

[0151] A response module 211, configured to obtain at least one file format supported by the terminal device in response to a file acquisition operation;

[0152] A generating module 212, configured to generate a file acquisition request corresponding to the file acquisition operation according to the at least one file format;

[0153] The sending module 213 is used to send the file acquisition request to the server, and the server determines the target file corresponding to the file acquisition request according to at least one file format included in the file acquisition request and a preset format distribution order, and distributes the target file to the terminal device;

[0154] The receiving module 214 is used to receive the target file sent by the server.

[0155] In summary, the embodiment of the present application matches the target format through the file format supported by the terminal device, so that the server does not need to save files of various file formats. As long as there is a file format that matches the file format supported by the terminal device, the server can respond to the file acquisition request of the terminal device to obtain the target file, thereby reducing the files that need to be stored and reducing the file storage pressure.

[0156] Among them, the preset format delivery order also provides guidance for file storage, which helps to control the format of stored files and improve storage quality.

[0157] In addition, by carrying the file formats supported by the terminal device in the file acquisition request, the terminal device can help the server accurately send files compatible with the terminal device, thereby improving the rationality and accuracy of file sending. Specifically, by uploading various supported file formats, the server can match files that meet any file format, reducing the number of files that need to be stored on the server side. That is, only one file with the same file format as the one supported by the terminal device needs to be stored, thereby reducing the files that need to be stored and reducing file storage pressure.

[0158] In addition, the present application also provides an electronic device, such as Figure 6 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:

[0159] The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, a power supply 303, and an input unit 304. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0160] The processor 301 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 301.

[0161] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.

[0162] The electronic device also includes a power supply 303 for supplying power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 303 can also include any components such as one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, and power status indicators.

[0163] The electronic device may further include an input unit 304, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0164] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 301 in the electronic device will load the executable file corresponding to the process of one or more application programs into the memory 302 according to the following instructions, and the processor 301 will run the application program stored in the memory 302, thereby implementing the steps in any one of the file delivery methods provided in the embodiments of the present application.

[0165] The server in an embodiment of the present application responds to a file acquisition request sent by a terminal device, parses the file acquisition request, obtains at least one file format supported by the terminal device, determines a target file corresponding to the file acquisition request according to the at least one file format and a preset format distribution order, and distributes the target file to the terminal device.

[0166] Among them, the target format is matched by the file format supported by the terminal device, so that the server does not need to save files of various file formats. As long as there is a file format that matches the file format supported by the terminal device, it can respond to the file acquisition request of the terminal device to obtain the target file, thereby reducing the files that need to be stored and reducing file storage pressure.

[0167] Among them, the preset format delivery order also provides guidance for file storage, which helps to control the format of stored files and improve storage quality.

[0168] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0169] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0170] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any file delivery method provided in the present application.

[0171] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0172] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0173] Since the instructions stored in the computer-readable storage medium can execute the steps in any file distribution method provided in the present application, the beneficial effects that can be achieved by any file distribution method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0174] The above is a detailed introduction to a file distribution method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. 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 method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A file distribution method, characterized in that: Applied to a server, the method comprises: In response to a file acquisition request sent by a terminal device, parsing the file acquisition request to obtain at least one file format supported by the terminal device; Determining a target file corresponding to the file acquisition request according to the at least one file format and a preset format distribution order; Send the target file to the terminal device.

2. The file distribution method according to claim 1, characterized in that: The determining the target file corresponding to the file acquisition request according to the at least one file format and a preset format delivery order includes: The matching files corresponding to the file formats are matched in sequence according to the format delivery order, and after a matching file of any file format is matched, the matching is terminated and the matching file is used as the target file.

3. The file distribution method according to claim 2, characterized in that: The matching files corresponding to the file formats are matched in sequence according to the format delivery order, and after matching a matching file of any file format, the matching is terminated, and the matching file is used as the target file, including: Determining a first format from the at least one file format according to the format delivery order; matching a first matching file for the file acquisition request according to the first format; If a first matching file of the first format is matched, taking the first matching file as the target file; If no first matching file in the first format is found, a second format other than the first format is determined from the at least one file format according to the format delivery order, and a target file for the file acquisition request is determined according to the second format.

4. The file distribution method according to claim 2, characterized in that: The matching files corresponding to the file formats are matched in sequence according to the format delivery order, and after matching a matching file of any file format, the matching is terminated, and the matching file is used as the target file, including: Determine common file formats; Within a preset number of downgrades, downgrade the matching files corresponding to the file formats in sequence according to the format delivery order; If a matching file is found within the preset downgrade times, the matching is terminated and the matching file is used as the target file; If the matching file is not found within the preset downgrade times, the matching is terminated and the matching file in the universal file format is used as the target file.

5. The file distribution method according to claim 1, characterized in that: After sending the target file to the terminal device, the method further includes: Acquire a matching log of the server, and filter at least one target acquisition request of a missed file and at least one file format corresponding to each target acquisition request from the matching log; Determine at least one missed target resource file and a target file format corresponding to each target resource file according to the at least one target acquisition request and the at least one file format; For each target resource file, if the number of matches of the target file format corresponding to the target resource file exceeds a preset threshold, a target resource file corresponding to the target file format is converted.

6. The file distribution method according to claim 1, characterized in that: Before determining the target file corresponding to the file acquisition request according to the at least one file format and the preset format delivery order, the method further includes: In response to the uploaded format customization rule information, determine the priority of each file format, and determine the format distribution order according to the priority; Alternatively, in response to obtaining the matching log of the server, the number of requests for each file format is counted, and the format delivery order is determined according to the number of requests; Alternatively, in response to the analysis results of the file features of each file format, the format distribution order of each file format is determined according to the analysis results; The file feature includes at least one of compression loss information, processing energy consumption information, file size information, file quality information or file encoding and decoding speed information.

7. A file distribution method, characterized in that: Applied to a terminal device, the method comprises: In response to the file acquisition operation, acquiring at least one file format supported by the terminal device; generating a file acquisition request corresponding to the file acquisition operation according to the at least one file format; Sending the file acquisition request to a server, the server determining a target file corresponding to the file acquisition request according to at least one file format included in the file acquisition request and a preset format distribution order, and delivering the target file to the terminal device; Receive the target file sent by the server.

8. A file distribution device, characterized in that: Applied to a server, the device comprises: A response module, configured to respond to a file acquisition request sent by a terminal device, parse the file acquisition request, and obtain at least one file format supported by the terminal device; A determination module, configured to determine a target file corresponding to the file acquisition request according to the at least one file format and a preset format delivery order; The sending module is used to send the target file to the terminal device.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method implements the steps of the file sending method as described in any one of claims 1 to 6, or implements the steps of the file sending method as described in claim 7.

10. 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 steps in the file sending method according to any one of claims 1 to 7 are implemented.