Media resource file synchronization method and related equipment
By comparing the file attributes of the media resource file list with the server, determining the target file and synchronizing it, the problem of the client requiring the server-side media resource file list every time it plays, achieving the effect of reducing network traffic and improving playback fluency.
Patent Information
- Application Number
- CN202411844415.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-01
AI Technical Summary
Since the client needs to request the media resource file list from the server each time it plays, the increase in network traffic and the smoothness of playback are affected.
After receiving the file synchronization instruction from the server, the client obtains the media resource file list on both ends, and determines the target file by comparing the file attributes, and performs synchronization processing until the client and the server are in a synchronized state.
Through precise synchronization processing, unnecessary data transmission is avoided, network traffic consumption is reduced, playback fluency is improved, and user experience is guaranteed.
Smart Images

Figure CN119743489A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data synchronization, and in particular to a method for synchronizing media resource files and related equipment. Background Art
[0002] The backend server usually stores a large number of media resource files, including video, audio or picture files. When the local client needs to play a certain media resource file, it sends a request to the server, and the server provides the corresponding media resource file according to the request.
[0003] However, since the client needs to request a list of media resource files from the server each time playback occurs, this not only increases network traffic but also affects playback smoothness. Summary of the invention
[0004] In view of this, the purpose of the present application is to propose a method for synchronizing media resource files and related devices to solve the above technical problems.
[0005] Based on the above purpose, the first aspect of the present application provides a method for synchronizing media resource files, which is applied to a client, and the method includes:
[0006] In response to receiving a file synchronization instruction sent by the server, a first media resource file list of the server and a second media resource file list of the client are obtained, wherein the first media resource file list is composed of a plurality of first files, and the second media resource file list is composed of a plurality of second files, and a total number of first files in the first media resource file list is counted;
[0007] Acquire file attributes of each first file in the first media resource file list and file attributes of each second file in the second media resource file list;
[0008] The following synchronization process is performed on the second media resource file list:
[0009] Determine a target file according to the file attributes of each first file and the file attributes of each second file, and perform synchronization processing on the target file in the second media resource file list;
[0010] Determine a statistical value of the number of files synchronized between the client and the server, and compare the statistical value with the total value to obtain a comparison result;
[0011] In response to the comparison result being that the quantity statistics value is different from the total quantity value, the synchronization process is repeated until the comparison result is that the quantity statistics value is the same as the total quantity value, and it is determined that the client and the server are in a synchronized state.
[0012] Optionally, the file attributes include a file name;
[0013] The step of determining the target file according to the file attributes of each first file and the file attributes of each second file, and synchronously processing the target file in the second media resource file list includes:
[0014] For each of the second files the following operations are performed:
[0015] Compare the file name of the second file with the file name of each first file respectively, and determine whether there is a file name identical to the file name of the second file in each first file;
[0016] In response to determining that the second file does not exist, the second file is used as the target file, and the target file is deleted from the second media resource file list.
[0017] Optionally, the file attributes further include a file suffix and / or a file size;
[0018] After determining whether there is a file name identical to the file name of the second file in each of the first files, the method further includes:
[0019] In response to determining that the second file exists, the file suffix and / or file size of the second file are compared with the file suffix and / or file size of each first file to determine whether there is a file suffix and / or file size that is the same as the file suffix and / or file size of the second file in each first file;
[0020] In response to determining that the second file does not exist, the second file is used as the target file, and the target file is deleted from the second media resource file list.
[0021] Optionally, after determining whether each of the first files has a file suffix and / or a file size that is the same as that of the second file, the method further includes:
[0022] In response to determining that it exists, a statistical value of the number of files synchronized between the client and the server is obtained, and 1 is added to the statistical value.
[0023] Optionally, the file attributes include a file name;
[0024] The step of determining the target file according to the file attributes of each first file and the file attributes of each second file, and synchronously processing the target file in the second media resource file list includes:
[0025] For each of the first files, the following operations are performed:
[0026] Compare the file name of the first file with the file name of each second file respectively, and determine whether there is a file name identical to the file name of the first file in each second file;
[0027] In response to determining that it does not exist, the first file is used as the target file, and the target file is synchronized to the second media resource file list.
[0028] Optionally, after synchronizing the target file to the second media resource file list, the method further includes:
[0029] Get file synchronization feedback signal;
[0030] In response to the file synchronization feedback signal indicating successful synchronization, obtaining a statistical value of the number of files synchronized between the client and the server, and adding 1 to the statistical value; or
[0031] In response to the file synchronization feedback signal indicating synchronization failure, a statistical value of the number of files synchronized between the client and the server is obtained, the statistical value is kept unchanged, and the target file is deleted from the second media resource file list.
[0032] Optionally, in response to receiving the file synchronization instruction sent by the server, the method further includes:
[0033] Detecting a network status for connecting the client and the server;
[0034] In response to determining that the network state is an abnormal state, the second file that is already in the second media resource file list is played based on the received play instruction.
[0035] Based on the same inventive concept, the second aspect of the present application provides a method for synchronizing media resource files, which is applied to a server side, and the method includes:
[0036] In response to a file update operation on a first media resource file list on a server side on a file list page, a file synchronization instruction is generated;
[0037] The file synchronization instruction is sent to the client.
[0038] Optionally, a new add control and a refresh data control are set on the file list page;
[0039] The file update operation on the first media resource file list on the server side includes:
[0040] In response to a triggering operation on the newly added control, displaying a newly added page of the first media resource file list;
[0041] In response to an editing operation on the newly added first file on the newly added page, editing the newly added media resource information corresponding to the newly added first file, and adding the newly added first file and the newly added media resource information to the first media resource file list;
[0042] A triggering operation on the refresh data control on the file list page.
[0043] Optionally, a delete control and a refresh data control are set on the file list page;
[0044] The file update operation on the first media resource file list on the server side includes:
[0045] In response to a selection instruction for a target first file in the first media resource file list and a triggering operation on the deletion control, deleting the target first file in the first media resource file list;
[0046] A triggering operation on the refresh data control on the file list page.
[0047] Optionally, a query control and a query input field are set on the file list page, and the method further includes:
[0048] In response to receiving the file name of the target first file input in the query input field and triggering the query control, a display field of media resource information corresponding to the target first file is displayed on the file list page.
[0049] Optionally, an edit control and / or a view control is set in a display column of the media resource information corresponding to the target first file;
[0050] After the file list page displays a display bar for media resource information corresponding to the target first file, the method further includes:
[0051] In response to a triggering operation on the editing control, displaying an editing page corresponding to the target first file; or,
[0052] In response to a triggering operation on the viewing control, a viewing page corresponding to the target first file is displayed.
[0053] Based on the same inventive concept, the third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor implements the method described in the first aspect or the second aspect above when executing the computer program.
[0054] Based on the same inventive concept, the fourth aspect of the present application provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect or the second aspect above.
[0055] Based on the same inventive concept, the fifth aspect of the present application provides a computer program product, including computer program instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect or the second aspect.
[0056] From the above, it can be seen that the synchronization method and related equipment of media resource files provided by the present application can efficiently compare the media resource file list between the client and the server by receiving the file synchronization instruction to ensure the consistency of the resources of both parties. In this process, by accurately matching the attributes of the file, the accurate synchronization of the target file is achieved, and unnecessary data transmission is avoided. It is also combined with the statistical value of the number of files synchronized between the client and the server, and the total number of the first file in the first media resource file list for comparison, to realize the real-time confirmation mechanism of the synchronization status, to ensure that the client and the server maintain the latest media resource status, and then when the client plays, because the media resource status of the client has been synchronized to the latest media resource status at this time, there is no need to request the media resource file list from the server, and it can be played directly on the client locally, thereby greatly reducing the consumption of network traffic, and effectively improving the smoothness of playback and ensuring user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 A first flow chart of a method for synchronizing media resource files according to an embodiment of the present application;
[0059] Figure 2 A second flow chart of the method for synchronizing media resource files according to an embodiment of the present application;
[0060] Figure 3 A schematic diagram of a file list page displayed on a server side according to an embodiment of the present application;
[0061] Figure 4 A schematic diagram of the synchronization process of media resource files in an embodiment of the present application;
[0062] Figure 5 A first structural block diagram of a device for synchronizing media resource files according to an embodiment of the present application;
[0063] Figure 6 A second structural block diagram of the device for synchronizing media resource files according to an embodiment of the present application;
[0064] Figure 7 A schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0066] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0067] It is understandable that before using the technical solutions of each embodiment of the present application, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.
[0068] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to the electronic device, application, server, storage medium or other software or hardware that performs the operation of the technical solution of the present application according to the prompt message.
[0069] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0070] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation method of this application. Other methods that meet relevant laws and regulations may also be applied to the implementation method of this application.
[0071] The backend server usually stores a large number of media resource files, including video, audio or picture files. When the local client needs to play a certain media resource file, it sends a request to the server, and the server provides the corresponding media resource file according to the request.
[0072] However, since the client needs to request a list of media resource files from the server each time playback occurs, this not only increases network traffic but also affects playback smoothness.
[0073] The embodiment of the present application provides a method for synchronizing media resource files, which is applied to a client, such as Figure 1 As shown, the method includes:
[0074] Step 101, in response to receiving a file synchronization instruction sent by a server, obtain a first media resource file list of the server and a second media resource file list of the client, wherein the first media resource file list is composed of multiple first files, and the second media resource file list is composed of multiple second files, and the total number of first files in the first media resource file list is counted.
[0075] In this step, the client (such as a computer, mobile phone or other smart device) has established a connection with the server, and the server sends a command to the client to perform a file synchronization operation. File synchronization is usually used to ensure that files on different devices or storage locations remain consistent.
[0076] After receiving the synchronization instruction, the client will request the server to provide its currently stored media resource file list (ie, the first media resource file list).
[0077] The first media resource file list is a collection or list including a plurality of first files, which may be files in audio, video, picture or other media formats.
[0078] At the same time, the client also generates or obtains a list of media resource files stored by itself (ie, a second media resource file list).
[0079] The second media resource file list is similar to the first media resource file list, which is also a collection or list containing a plurality of files (second files). These second files can also be files of various media formats, but may be different from or overlap with the files in the first file list.
[0080] After obtaining the media resource file lists of the server and the client, the client will count the number of media resource files on the server (i.e. the total number of the first file). This total number value indicates how many media files on the server need to be considered for synchronization. Counting the number of files is an important step in the file synchronization process because it can help the client understand the scale of the synchronization task and the resources that may be required (such as time, network bandwidth, etc.).
[0081] Step 102: Obtain file attributes of each first file in the first media resource file list and file attributes of each second file in the second media resource file list.
[0082] In this step, each file has a series of attributes that provide detailed information about the file. File attributes include file name, file size, creation date, modification date, file type (such as mp3, jpg, etc.), permissions (such as readable, writable, etc.). In some cases, more specific media attributes may also be included, such as the bit rate of audio files, the resolution of video files, etc.
[0083] The attribute information of each file in the above two lists can be read or queried through the file system application programming interface (API) or a specific software library. These APIs or libraries provide methods for accessing and operating files and directories.
[0084] The following synchronization process is performed on the second media resource file list:
[0085] Step 103: determine a target file according to the file attributes of each first file and the file attributes of each second file, and perform synchronization processing on the target file in the second media resource file list.
[0086] In this step, each file (whether the first file or the second file) has a series of attributes, which may include but are not limited to file name, file size, creation date, modification date, file type (such as audio, video, picture, etc.), permission settings, etc. These attributes are used to distinguish between files and determine the behavior of files in specific operations.
[0087] The two sets of file collections may contain the same or different files, and the properties of these files may be the same or different.
[0088] Based on the comparison of the properties of the first file and the second file, determine which files are the target files that need to be synchronized, based on various factors, such as whether the files are updated (by comparing the modification date), whether the file sizes are different (which may indicate that the file content has changed), whether the file exists in one of the two locations but not in the other, etc.
[0089] Once the target files are determined, they will be synchronized in the second media resource file list. The synchronization may include downloading the target files from the first media resource file list to the second media resource file list (if the target files are in the first media resource file list but not in the second media resource file list), or deleting the target files in the second media resource file list (if the target files exist in both collections but have different attributes, or the target files are in the second media resource file list but not in the first media resource file list). Accurate synchronization of the target files is achieved, avoiding unnecessary data transmission.
[0090] Step 104, determining a statistical value of the number of files synchronized between the client and the server, and comparing the statistical value with the total value to obtain a comparison result;
[0091] In this step, the files that have been successfully synchronized between the client and the server are checked, and the total number of these files, that is, the number statistics value, is calculated. The number statistics value represents the number of files that have been successfully consistent between the two ends so far.
[0092] Compare the quantity statistics value with the total quantity value to obtain a comparison result. Through the comparison result, you can intuitively understand the completion status of the synchronization work, and then quickly determine whether the client and server are in a synchronized state.
[0093] Additionally, quantitative statistics can be determined using a calculator.
[0094] Step 105, in response to the comparison result being that the quantity statistics value is different from the total quantity value, repeating the above synchronization process until the comparison result is that the quantity statistics value is the same as the total quantity value, and determining that the client and the server are in a synchronized state.
[0095] In this step, if the comparison result shows that the quantity statistics value is different from the total quantity value, it means that the data on the client and server are inconsistent and the synchronization between the two ends is not completed. At this time, you need to continue the synchronization process until the data is consistent.
[0096] When the number statistics value and the total number value are shown to be the same through comparison, it means that the data of the client and the server are consistent. At this time, it can be determined that the client and the server are in synchronization. Since the media resource status of the client has been synchronized to the latest media resource status, there is no need to request the media resource file list from the server when playing. It can be played directly on the client, thereby greatly reducing the consumption of network traffic, effectively improving the smoothness of playback, and ensuring user experience.
[0097] In some embodiments, the file attributes include a file name.
[0098] Step 103 includes:
[0099] For each of the second files the following operations are performed:
[0100] Step A1: Compare the file name of the second file with the file names of each first file respectively to determine whether there is a file name in each first file that is the same as the file name of the second file.
[0101] Step A2: in response to determining that the second file does not exist, taking the second file as the target file, and deleting the target file from the second media resource file list.
[0102] In the above solution, the first file can be regarded as a reference file or a benchmark file, and the second file can be regarded as a file to be processed.
[0103] The target file is determined based on the file attributes of the two sets of files. In this scenario, the main basis is the name of the file.
[0104] For each second file, the file name thereof is compared one by one with the file names of all first files in the first media resource file list.
[0105] The purpose of this comparison is to find out the files in the second media resource file list but not in the first media resource file list, that is, the second files whose file names have no matching items in the first media resource file list.
[0106] If, during the comparison process, it is found that the file name of a second file does not have the same file name in the first media resource file list, then the second file is regarded as the target file.
[0107] For the second files determined as target files, synchronization processing is performed on them in the second media resource file list, that is, the target files are deleted.
[0108] By deleting the files in the second media resource file list but not in the first media resource file list, synchronization of the file names of the two groups of file lists is achieved.
[0109] In some embodiments, the file attributes also include a file suffix and / or a file size.
[0110] After step A1, the method further comprises:
[0111] Step B1, in response to determining existence, compare the file suffix and / or file size of the second file with the file suffix and / or file size of each first file respectively to determine whether there is a file suffix and / or file size that is the same as the file suffix and / or file size of the second file in each first file.
[0112] Step B2: In response to determining that the second file does not exist, the second file is used as the target file, and the target file is deleted from the second media resource file list.
[0113] In the above solution, the file attributes include not only the file name, but also the file suffix (ie, the file extension, such as txt, jpg, etc.) and / or the file size (ie, the size of the storage space occupied by the file).
[0114] First, check whether there is a file with the same name as the second file in each first file. This step is basic and is used to preliminarily screen possible matching files.
[0115] If a file with the same name is found (i.e., a file with the same name exists), the file suffix and / or file size of the first file is further compared to see if it is the same as the file suffix and / or file size of the second file. This step is to more accurately confirm whether the two files are exactly the same, because the same file name alone does not guarantee that the file content or type is also the same.
[0116] If no file that completely matches the second file in name, suffix and / or size is found in all first files (ie, no such file exists), the second file is regarded as a target file and deleted from the second media resource file list.
[0117] By carefully comparing the properties (name, suffix, size) of the two sets of files, it is determined whether there are identical files. If there are no such files, the target file in the second media resource file list is deleted. This method can be used in scenarios such as file management, data cleaning or file synchronization to ensure the accuracy and efficiency of file processing.
[0118] In some embodiments, after step B1, the method further comprises:
[0119] In response to determining that it exists, a statistical value of the number of files synchronized between the client and the server is obtained, and 1 is added to the statistical value.
[0120] In the above scheme, if a file that completely matches the second file in name, suffix and / or size is found among all the first files (i.e., such a file exists in the first media resource file list), the number of files that have been synchronized between the current client and the server is obtained. This quantity statistic may be a counter that is used to track the total number of files that have been successfully synchronized so far. Then, this quantity statistic is increased by 1. This means that since a second file that matches the first file in file suffix and / or file size is found, it is considered that these two files can be regarded as one of the "synchronized" files.
[0121] This process is a step in the file synchronization process that is used to identify and record the number of files that are considered to be matched or have matched (from a statistical perspective) based on file name, file suffix and / or size. Such a mechanism helps to manage and monitor the progress of file synchronization and ensure data integrity and synchronization accuracy.
[0122] In some embodiments, the file attributes include a file name.
[0123] Step 103 includes:
[0124] For each of the first files, the following operations are performed:
[0125] Step C1, comparing the file name of the first file with the file names of each second file respectively, to determine whether there is a file name identical to the file name of the first file in each second file.
[0126] Step C2: in response to determining that the first file does not exist, taking the first file as the target file, and synchronizing the target file to the second media resource file list.
[0127] In the above solution, each first file in the second media resource file list is traversed, and for each first file, its file name is compared with the file name of each second file in the second media resource file list.
[0128] If the second file with the same name as the first file is not found in the second media resource file list, the first file is regarded as a target file to be synchronized, and the target file is downloaded to the second media resource file list.
[0129] By reversely comparing the files in the second media resource file list that are less than those in the first media resource file list through the file names, the target file can be quickly determined, and the target file can be downloaded to the second media resource file list to complete the synchronization.
[0130] In some embodiments, after step C2, the method further comprises:
[0131] Step D1, obtaining a file synchronization feedback signal.
[0132] Step D2, in response to the file synchronization feedback signal indicating successful synchronization, obtaining a statistical value of the number of files synchronized between the client and the server, and adding 1 to the statistical value. Or,
[0133] Step D3, in response to the file synchronization feedback signal indicating synchronization failure, obtaining a statistical value of the number of files synchronized between the client and the server, keeping the statistical value unchanged, and deleting the target file from the second media resource file list.
[0134] In the above solution, when the target file is downloaded to the second media resource file list, this operation means that a file (target file) is sent from the server to the client and added to the second media resource file list. This list may contain multiple media resource files, such as pictures, videos, audio, etc.
[0135] During this process, a feedback signal is received, which indicates the result of the file synchronization. This feedback signal is an indication of whether the synchronization operation is successful.
[0136] If the feedback signal shows that the file synchronization is successful, the statistical value of the number of files synchronized between the current client and server will be obtained (this may be a counter or a record in a database), and then the statistical value will be increased by 1 to reflect the new successfully synchronized file.
[0137] If the feedback signal shows that the file synchronization fails, the current quantity statistics value will also be obtained, but this time it will not be increased (ie, the quantity statistics value remains unchanged). In addition, the target file that failed to synchronize will be deleted from the second media resource file list to maintain the accuracy and consistency of the file list.
[0138] The above methods ensure that the file synchronization operation between the client and the server can be carried out correctly and respond promptly when problems occur, such as deleting files that failed to synchronize to avoid potential data confusion or redundancy. At the same time, by updating the number statistics, the number of synchronized files can be tracked and managed, which may be beneficial for resource management and performance optimization.
[0139] In some embodiments, in step 101, in response to receiving a file synchronization instruction sent by the server, the method further includes:
[0140] Step E1, detecting the network status for connecting the client and the server.
[0141] Step E2: in response to determining that the network state is an abnormal state, playing the second file in the second media resource file list based on the received play instruction.
[0142] In the above scenario, before or during the attempt to perform a file synchronization operation, the client will first detect the network connection status between it and the server. This is to ensure a stable and reliable communication environment during the synchronization process and avoid synchronization failure or data loss due to network problems.
[0143] If it is detected that the current network status does not meet the conditions required for file synchronization (for example, the network delay is too high, the connection is unstable, or even completely disconnected, etc.), the client will determine that the network status is abnormal.
[0144] After determining that the network status is abnormal, if the client also receives a play instruction (this instruction may be initiated by the user or automatically triggered by the client according to some logic), the client will not try to continue the file synchronization operation. Instead, it will search for the second file that is already in the second media resource file list based on the play instruction and try to play the second file.
[0145] Through the above intelligent behavior adjustment strategy, when the network status is poor, the client will not blindly try to perform a file synchronization operation that may fail, but will instead play a media resource (second file) that has been prepared locally. This approach can improve the user experience and avoid the situation where users cannot enjoy the service due to synchronization failure when the network is unstable.
[0146] Based on the same inventive concept, the embodiment of the present application proposes a method for synchronizing media resource files, which is applied to the server side, such as Figure 2 As shown, the method includes:
[0147] Step 201 : In response to a file update operation on a first media resource file list on a server side on a file list page, a file synchronization instruction is generated.
[0148] Step 202: Send the file synchronization instruction to the client.
[0149] In the above solution, the file list page is used to display the list of media resource files stored on the server. The server-side management user in the background can view and manage (such as upload, download, delete, etc.) files on this page.
[0150] The first media resource file list on the server side refers to a list of specific types of media resource files (such as pictures, videos, audio, etc.) stored on the server. These files are objects that can be accessed and managed by the management user on the backend server side.
[0151] On the file list page, the server-side management user in the background makes some form of modification to the first media resource file list on the server side, which is called a file update operation. These operations may include adding new files, deleting existing files, modifying file attributes (such as name, description, permissions, etc.) or moving files to different directories.
[0152] Once the above file update operation is detected, a file synchronization instruction will be generated. This instruction is used by the server to instruct how to reflect these changes to the client. It may contain file information that needs to be synchronized (such as file name, path, operation type, etc.) to ensure that the client's file list is consistent with the server.
[0153] The server sends this file synchronization instruction to the client through the network. After receiving the instruction, the client will perform corresponding operations according to the content of the instruction, such as updating the local file list, downloading new files, deleting deleted files, etc., to ensure that the file status of the client is synchronized with the server.
[0154] In some embodiments, a new add control and a refresh data control are provided on the file list page.
[0155] In step 201, the file update operation on the first media resource file list on the server side includes:
[0156] Step F1, in response to a triggering operation on the newly added control, displaying a newly added page of the first media resource file list.
[0157] Step F2, in response to the editing operation of the newly added first file on the newly added page, edit the newly added media resource information corresponding to the newly added first file, and add the newly added first file and the newly added media resource information to the first media resource file list.
[0158] Step F3, triggering the refresh data control on the file list page.
[0159] In the above scheme, if Figure 3 As shown, the file list page 300 is provided with a new control 301, which is a user interface (UI) element (such as a button or link) on the file list page 300. The management user of the backend server can add a new file after clicking it. The purpose of this control is to provide an intuitive interface so that the management user can start the process of adding a new file.
[0160] The refresh data control 302 is also a UI element on the file list page 300, which can be expressed as a refresh button or icon. Its function is to allow the management user to manually trigger the reloading of data, thereby ensuring that the client user sees the latest file list. This is more applicable when files are added, deleted or modified in the background, but the current interface of the client user is not automatically updated.
[0161] When the management user clicks the add control 301, this operation will be responded to and a add page will be displayed, allowing the management user to enter or select detailed information of the new file (such as file name, description, category, etc.) and upload the file itself.
[0162] On the new page, the management user will perform editing operations, such as filling in the relevant information of the file. This information constitutes the new media resource information.
[0163] Once the management user completes editing and file uploading (if necessary), the newly added first file and the corresponding media resource information are added to the first media resource file list on the server side. This usually involves storing the file in a specified location on the server and storing the file information (such as path, name, metadata, etc.) in a database.
[0164] When the management user clicks the refresh data control 302, the client obtains the latest file list data from the server and updates the current file list page 300 of the client. This ensures that the user of the client sees the latest file status, including any newly added, deleted or modified files.
[0165] In some embodiments, a delete control and a refresh data control are provided on the file list page.
[0166] In step 201, the file update operation on the first media resource file list on the server side includes:
[0167] Step G1, in response to a selection instruction for a target first file in the first media resource file list and a triggering operation on the deletion control, the target first file is deleted from the first media resource file list.
[0168] Step G2: triggering the refresh data control on the file list page.
[0169] In the above scheme, if Figure 3 As shown, a delete control 303 and a refresh data control 302 are set on the file list page 300 .
[0170] On the file list page 300, the management user of the backend server can see a media resource file list, which includes media resource files (such as pictures, videos, audios, etc.) stored on the server.
[0171] In addition to displaying the file list, two important controls are set on this page: a delete control 303 and a refresh data control 302.
[0172] The delete control 303 allows the management user to delete the selected file from the file list.
[0173] The refresh data control 302 allows the management user to manually refresh the file list to ensure that the latest file data is displayed, and generates a file synchronization instruction for the client to synchronize based on it.
[0174] The management user first needs to select a target file (i.e., the file to be deleted) in the file list, and then use the management user to trigger the deletion control 303 (perhaps by clicking a "Delete" button). The server responds to this operation and deletes the selected target file from the first media resource file list on the server. After that, the management user triggers the refresh data control 302 (perhaps by clicking a "Refresh" button). The server responds to this operation, re-acquires the latest media resource file list from the server, updates the file list displayed on the page, and generates a file synchronization instruction for the client to synchronize based on this.
[0175] In this way, management users can easily manage media resource files on the server, including deleting unnecessary files and ensuring that the latest file list is displayed. This interface design improves the convenience and efficiency of management user interaction.
[0176] In some embodiments, a query control and a query input field are set on the file list page, and the method further includes:
[0177] Step H1, in response to receiving the file name of the target first file input in the query input field and triggering the query control, a display field of media resource information corresponding to the target first file is displayed on the file list page.
[0178] In the above scheme, if Figure 3 As shown, on the file list page 300, there are a query control 304 (such as a button, a drop-down menu, etc.) and a query input field 305 (such as a text box).
[0179] The purpose of these controls and input fields is to allow the backend server-side management user to enter query conditions and trigger query operations.
[0180] The management user of the server side at the backend will input the file name of the target first file in the query input field 305. The "target first file" here refers to the file that the management user wants to find.
[0181] Subsequently, the management user may trigger the query control 304, such as clicking a query button, to start the query process.
[0182] After receiving the file name input by the management user and triggering the query operation, the server will search for files that match the input file name.
[0183] If a matching file (ie, the target first file) is found, a display bar 306 of media resource information corresponding to the file will be displayed on the file list page 300 .
[0184] This display bar 306 may include detailed information of the file, such as size, type, creation date, etc., as well as previews or links to media resources (such as pictures, videos, etc.) that may be included.
[0185] The query control 304 and the query input field 305 can improve the efficiency and convenience of the management user in searching for files.
[0186] In some embodiments, an editing control and / or a viewing control is set in a display column of the media resource information corresponding to the target first file.
[0187] After step H1, the method further comprises:
[0188] Step I1, in response to a trigger operation on the editing control, displaying an editing page corresponding to the target first file. Or,
[0189] Step I2: in response to a triggering operation on the viewing control, displaying a viewing page corresponding to the target first file.
[0190] In the above scheme, if Figure 3 As shown, on the file list page 300, a display bar of the media resource information corresponding to the target first file is displayed. In the display bar 306, at least one interactive control is set. These controls can be edit controls 307 (controls that allow management users on the backend server to edit media resource information) and / or view controls 308 (controls that allow management users to view detailed information or more content of media resources).
[0191] These two controls may exist separately or simultaneously. That is, display bar 306 may have only edit control 307, only view control 308, or both.
[0192] When the management user clicks or touches the edit control 307, the server will respond to this operation and display an edit page corresponding to the target first file. This edit page allows the management user to modify media resource information, such as title, description, tags, etc.
[0193] Similarly, when the management user clicks or touches the view control 308, the server responds to the operation and displays a view page corresponding to the target first file. The view page provides detailed information or more content of the media resource, which may be a direct preview of a picture, video, or audio, or metadata of these media resources (such as shooting date, location, author, etc.).
[0194] The editing control 307 and / or viewing control 308 allow the management user to directly edit or view specific media resource information on a file list page 300 without leaving the current page or performing complex navigation operations. This design improves the interactivity and user experience of the user interface.
[0195] Through the above scheme, by receiving the file synchronization instruction, the client and the server can efficiently compare the media resource file list to ensure the consistency of the resources of both parties. In this process, by accurately matching the attributes of the file, the accurate synchronization of the target file is achieved, avoiding unnecessary data transmission. It also combines the statistical value of the number of files synchronized between the client and the server, and the total number of the first file in the first media resource file list for comparison, to implement a real-time confirmation mechanism for the synchronization status, ensuring that the client and the server maintain the latest media resource status, and then when the client plays, since the media resource status of the client has been synchronized to the latest media resource status, there is no need to request the media resource file list from the server, and it can be played directly on the client locally, thereby greatly reducing the consumption of network traffic, and effectively improving the smoothness of playback and ensuring user experience.
[0196] In some embodiments, Figure 4 As shown, the player on the client and the server on the backend establish a long connection through a full-duplex communication protocol (Websocket). When the backend adds, deletes, or modifies the playlist (i.e., the first media resource file list) (i.e., a file update operation), you can click the real-time data update button (i.e., refresh data control). At this time, the server will send a network communication mechanism (socket) update request to the client. After the client receives the response, it will proceed with all the following processes:
[0197] Prepare a counter A to count the number of local files and remote files that are equal. Set the initial value to 0, that is, counter A = 0; for example, if the counter is 5 and the number of remote files is also 5, it can be determined that the information in the local and remote file lists is completely consistent. As for why it can be determined, because each time the value of the counter is +1, it is determined based on the fact that the file name, size, and suffix of the two files are completely consistent. If there are two files, and their names, suffixes, and sizes are exactly the same, then the contents of the two files are considered to be exactly the same. The specific ideas and steps are as follows:
[0198] First, use a request library such as ajax to pull the remote file list provided by the interface (i.e., the first media resource file list), and set the total number of files in the remote list to B (i.e., the total number value); then pull the local file list (i.e., the second media resource file list) (local files are stored in the public directory of the project. Since the player is made, the local files are generally pictures and videos);
[0199] At this point, you have obtained a local and a remote file list, as well as the number of files in each.
[0200] The core function of the player is to make the local and remote resources completely consistent. Therefore, first delete the files that are more in the local area than in the remote area (i.e., the redundant local part); for example, if the local area has files 1, 2, 3, and 4, and the remote area has files 1, 2, and 3, then the local area needs to delete file 4 (i.e., the target file). The process of deleting redundant files can be done by comparing the file names. Search each local file name in the remote list. If it cannot be found, it means that the remote area does not have this file, so delete the local one.
[0201] If a local and remote file with the same name is found, the file suffixes and file sizes are compared between the two. If the name, suffix and size are exactly the same, they are determined to be the same file, and the counter (i.e., the quantity statistical value) is increased by 1.
[0202] It is also necessary to reversely compare the files that are less locally than remotely (i.e., those that are missing locally). For example, if there are files 1, 2, and 3 locally, and files 1, 2, 3, and 4 remotely, then it is necessary to download the missing file 4 (i.e., the target file) locally. Start the file download program locally, and then start listening for download requests (i.e., file synchronization feedback signals) in the program. If the download is detected to be successful (i.e., the file synchronization feedback signal is synchronization success), the counter is incremented by 1 (i.e., A+1). If the download is detected to be unsuccessful (i.e., the file synchronization feedback signal is synchronization failure), the counter remains unchanged, and the unfinished downloaded junk files are deleted.
[0203] Each time the counter is incremented by 1, the current value of the counter (i.e., the quantity statistics value) is compared with the number B of remote files (i.e., the total number value). If the numbers A and B are equal, it indicates that the expected effect of complete consistency between local resources and remote resources has been achieved, and the client is notified to perform local rendering and playback.
[0204] If the program encounters abnormal software usage at the beginning, such as network abnormality (no network, network disconnection in the middle) (that is, the network status is abnormal), or network abnormality halfway through downloading (that is, the network status is abnormal), the client is directly notified to play local data. At this time, the comparison result of the counter is ignored, and only the downloaded data is played.
[0205] After synchronization, since all local files are played, the web client can support videos with a resolution of 4K or above (if the hardware conditions of the device are sufficient to support it). The resources requested by the web 4K video through the Hypertext Transfer Protocol (http) will be stuck (limited by the browser decoding ability, network speed, hardware, etc.), but the local video will not be played.
[0206] Based on this, this application can achieve that when the client plays media, the background server needs to manage the addition, deletion, modification and query of media resources, and synchronize the information to the client. And when the network is disconnected, the cached data can be played; if the hardware configuration meets the requirements, the pure web page playback of 4K videos and above will not have a stuttering effect, making the playback of 4K and above videos smoother and more stable.
[0207] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0208] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0209] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a device for synchronizing media resource files.
[0210] refer to Figure 5 , the media resource file synchronization device comprises:
[0211] The list acquisition module 501 is configured to, in response to receiving a file synchronization instruction sent by the server, acquire a first media resource file list of the server and a second media resource file list of the client, wherein the first media resource file list is composed of a plurality of first files, the second media resource file list is composed of a plurality of second files, and count the total number of first files in the first media resource file list;
[0212] The attribute acquisition module 502 is configured to acquire the file attributes of each first file in the first media resource file list and the file attributes of each second file in the second media resource file list;
[0213] The synchronization module 503 is configured to perform the following synchronization process on the second media resource file list: determine the target file according to the file attributes of each first file and the file attributes of each second file, and synchronize the target file in the second media resource file list; determine the quantity statistics of the files synchronized between the client and the server, compare the quantity statistics with the total quantity value, and obtain a comparison result; in response to the comparison result that the quantity statistics is different from the total quantity value, repeat the above synchronization process until the comparison result is that the quantity statistics is the same as the total quantity value, and determine that the client and the server are in a synchronized state.
[0214] In some embodiments, the file attributes include a file name;
[0215] The synchronization module 503 is specifically configured as follows:
[0216] For each of the second files the following operations are performed:
[0217] Compare the file name of the second file with the file name of each first file respectively, and determine whether there is a file name identical to the file name of the second file in each first file;
[0218] In response to determining that the second file does not exist, the second file is used as the target file, and the target file is deleted from the second media resource file list.
[0219] In some embodiments, the file attributes further include a file suffix and / or a file size;
[0220] The synchronization device for media resource files further includes a deletion module. After determining whether there is a file name identical to the file name of the second file in each of the first files, the deletion module is specifically configured to:
[0221] In response to determining that the file exists, comparing the file suffix and / or file size of the second file with the file suffix and / or file size of each first file, respectively, to determine whether there is a file suffix and / or file size that is the same as the file suffix and / or file size of the second file in each first file;
[0222] In response to determining that the second file does not exist, the second file is used as the target file, and the target file is deleted from the second media resource file list.
[0223] In some embodiments, the synchronization device for the media resource file further includes a counting module, after determining whether there is a file suffix and / or file size that is the same as the file suffix and / or file size of the second file in each first file, the counting module is specifically configured to:
[0224] In response to determining that it exists, a statistical value of the number of files synchronized between the client and the server is obtained, and 1 is added to the statistical value.
[0225] In some embodiments, the file attributes include a file name;
[0226] The synchronization module 503 is specifically configured as follows:
[0227] For each of the first files, the following operations are performed:
[0228] Compare the file name of the first file with the file name of each second file respectively, and determine whether there is a file name identical to the file name of the first file in each second file;
[0229] In response to determining that it does not exist, the first file is used as the target file, and the target file is synchronized to the second media resource file list.
[0230] In some embodiments, the media resource file synchronization device further includes a feedback module. After synchronizing the target file to the second media resource file list, the feedback module is specifically configured to:
[0231] Get file synchronization feedback signal;
[0232] In response to the file synchronization feedback signal indicating successful synchronization, obtaining a statistical value of the number of files synchronized between the client and the server, and adding 1 to the statistical value; or
[0233] In response to the file synchronization feedback signal indicating synchronization failure, a statistical value of the number of files synchronized between the client and the server is obtained, the statistical value is kept unchanged, and the target file is deleted from the second media resource file list.
[0234] In some embodiments, the media resource file synchronization device further includes a network status detection module. In response to receiving a file synchronization instruction sent by the server, the network status detection module is specifically configured to:
[0235] Detecting a network status for connecting the client and the server;
[0236] In response to determining that the network state is an abnormal state, the second file that is already in the second media resource file list is played based on the received play instruction.
[0237] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides a device for synchronizing media resource files, such as Figure 6 As shown, the device comprises:
[0238] The instruction generation module 601 is configured to generate a file synchronization instruction in response to a file update operation on a first media resource file list on a server side on a file list page;
[0239] The instruction sending module 602 is configured to send the file synchronization instruction to the client.
[0240] In some embodiments, a new add control and a refresh data control are provided on the file list page;
[0241] The instruction generation module 601 is specifically configured to:
[0242] In response to a triggering operation on the newly added control, displaying a newly added page of the first media resource file list;
[0243] In response to an editing operation on the newly added first file on the newly added page, editing the newly added media resource information corresponding to the newly added first file, and adding the newly added first file and the newly added media resource information to the first media resource file list;
[0244] A triggering operation on the refresh data control on the file list page.
[0245] In some embodiments, a delete control and a refresh data control are provided on the file list page;
[0246] The instruction generation module 601 is specifically configured to:
[0247] In response to a selection instruction for a target first file in the first media resource file list and a triggering operation on the deletion control, deleting the target first file in the first media resource file list;
[0248] A triggering operation on the refresh data control on the file list page.
[0249] In some embodiments, a query control and a query input field are set on the file list page, and the media resource file synchronization device further includes a query module, and the query module is specifically configured to:
[0250] In response to receiving the file name of the target first file input in the query input field and triggering the query control, a display field of media resource information corresponding to the target first file is displayed on the file list page.
[0251] In some embodiments, an edit control and / or a view control is provided in a display column of the media resource information corresponding to the target first file;
[0252] The media resource file synchronization device further includes a trigger module. After the file list page displays a display bar of the media resource information corresponding to the target first file, the trigger module is specifically configured to:
[0253] In response to a triggering operation on the editing control, displaying an editing page corresponding to the target first file; or,
[0254] In response to a triggering operation on the viewing control, a viewing page corresponding to the target first file is displayed.
[0255] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0256] The device of the above embodiment is used to implement the corresponding method for synchronizing media resource files in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0257] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for synchronizing the media resource files described in any of the above embodiments is implemented.
[0258] Figure 7 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 701, a memory 702, an input / output interface 703, a communication interface 704, and a bus 705. The processor 701, the memory 702, the input / output interface 703, and the communication interface 704 are connected to each other in communication within the device through the bus 705.
[0259] The processor 701 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0260] The memory 702 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 702 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 702 and are called and executed by the processor 701.
[0261] The input / output interface 703 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0262] The communication interface 704 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0263] The bus 705 includes a path for transmitting information between various components of the device (eg, the processor 701 , the memory 702 , the input / output interface 703 , and the communication interface 704 ).
[0264] It should be noted that, although the above device only shows the processor 701, the memory 702, the input / output interface 703, the communication interface 704 and the bus 705, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0265] The electronic device of the above embodiment is used to implement the corresponding method for synchronizing media resource files in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0266] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the media resource file synchronization method described in any of the above embodiments.
[0267] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0268] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the method for synchronizing media resource files as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0269] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a computer program product, including computer program instructions. When the computer program instructions are run on a computer, the computer executes the method described in any of the above embodiments, which has the beneficial effects of the corresponding method embodiments and will not be repeated here.
[0270] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0271] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0272] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0273] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A method for synchronizing media resource files, characterized in that: Applied to a client, the method comprises: In response to receiving a file synchronization instruction sent by the server, a first media resource file list of the server and a second media resource file list of the client are obtained, wherein the first media resource file list is composed of a plurality of first files, and the second media resource file list is composed of a plurality of second files, and a total number of first files in the first media resource file list is counted; Acquire file attributes of each first file in the first media resource file list and file attributes of each second file in the second media resource file list; The following synchronization process is performed on the second media resource file list: Determine a target file according to the file attributes of each first file and the file attributes of each second file, and perform synchronization processing on the target file in the second media resource file list; Determine a statistical value of the number of files synchronized between the client and the server, and compare the statistical value with the total value to obtain a comparison result; In response to the comparison result being that the quantity statistics value is different from the total quantity value, the synchronization process is repeated until the comparison result is that the quantity statistics value is the same as the total quantity value, and it is determined that the client and the server are in a synchronized state.
2. The method according to claim 1, characterized in that: The file attributes include file name; The step of determining the target file according to the file attributes of each first file and the file attributes of each second file, and synchronously processing the target file in the second media resource file list includes: For each of the second files the following operations are performed: Compare the file name of the second file with the file name of each first file respectively, and determine whether there is a file name identical to the file name of the second file in each first file; In response to determining that the second file does not exist, the second file is used as the target file, and the target file is deleted from the second media resource file list.
3. The method according to claim 2, characterized in that The file attributes also include file suffix and / or file size; After determining whether there is a file name identical to the file name of the second file in each of the first files, the method further includes: In response to determining that the second file exists, the file suffix and / or file size of the second file are compared with the file suffix and / or file size of each first file to determine whether there is a file suffix and / or file size that is the same as the file suffix and / or file size of the second file in each first file; In response to determining that the second file does not exist, the second file is used as the target file, and the target file is deleted from the second media resource file list.
4. The method according to claim 3, characterized in that After determining whether each of the first files has a file suffix and / or a file size that is the same as that of the second file, the method further includes: In response to determining that it exists, a statistical value of the number of files synchronized between the client and the server is obtained, and 1 is added to the statistical value.
5. The method according to claim 1, characterized in that The file attributes include file name; The step of determining the target file according to the file attributes of each first file and the file attributes of each second file, and synchronously processing the target file in the second media resource file list includes: For each of the first files, the following operations are performed: Compare the file name of the first file with the file name of each second file respectively, and determine whether there is a file name identical to the file name of the first file in each second file; In response to determining that it does not exist, the first file is used as the target file, and the target file is synchronized to the second media resource file list.
6. The method according to claim 5, characterized in that After synchronizing the target file to the second media resource file list, the method further includes: Get file synchronization feedback signal; In response to the file synchronization feedback signal indicating successful synchronization, obtaining a statistical value of the number of files synchronized between the client and the server, and adding 1 to the statistical value; or In response to the file synchronization feedback signal indicating synchronization failure, a statistical value of the number of files synchronized between the client and the server is obtained, the statistical value is kept unchanged, and the target file is deleted from the second media resource file list.
7. The method according to claim 1, characterized in that In response to receiving the file synchronization instruction sent by the server, the method further includes: Detecting a network status for connecting the client and the server; In response to determining that the network state is an abnormal state, the second file that is already in the second media resource file list is played based on the received play instruction.
8. A method for synchronizing media resource files, characterized in that: Applied to the server side, the method includes: In response to a file update operation on a first media resource file list on a server side on a file list page, a file synchronization instruction is generated; The file synchronization instruction is sent to the client.
9. The method according to claim 8, characterized in that Setting a new control and a refresh data control on the file list page; The file update operation on the first media resource file list on the server side includes: In response to a triggering operation on the newly added control, displaying a newly added page of the first media resource file list; In response to an editing operation on the newly added first file on the newly added page, editing the newly added media resource information corresponding to the newly added first file, and adding the newly added first file and the newly added media resource information to the first media resource file list; A triggering operation on the refresh data control on the file list page.
10. The method according to claim 8, characterized in that Setting a delete control and a refresh data control on the file list page; The file update operation on the first media resource file list on the server side includes: In response to a selection instruction for a target first file in the first media resource file list and a triggering operation on the deletion control, deleting the target first file in the first media resource file list; A triggering operation on the refresh data control on the file list page.
11. The method according to claim 8, characterized in that A query control and a query input field are set on the file list page, and the method further includes: In response to receiving the file name of the target first file input in the query input field and triggering the query control, a display field of media resource information corresponding to the target first file is displayed on the file list page.
12. The method according to claim 11, characterized in that Setting an edit control and / or a view control in a display column of the media resource information corresponding to the target first file; After the file list page displays a display bar for media resource information corresponding to the target first file, the method further includes: In response to a triggering operation on the editing control, displaying an editing page corresponding to the target first file; or, In response to a triggering operation on the viewing control, a viewing page corresponding to the target first file is displayed.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 12 is implemented.
14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 12.
15. A computer program product, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 12.