Online music playing method and system based on automatic caching mechanism

By introducing an automatic cache mechanism and a system that works in a multi-module synchronously in the music player, the problems of poor cache data management and difficulty in synchronization with multiple devices in the existing technology are solved, the continuity and integrity of music playback are achieved, and the Accurate song recommendations improve user experience.

CN119396783APending Publication Date: 2025-02-07FUJIAN JINJIANG VOCATIONAL TECH SCHOOL

Patent Information

Application Number
CN202411983326.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art cannot scan and repair damaged or lost cached data in music players regularly, resulting in interruption or incomplete music playback, and poor storage space management, affecting device performance, and failing to achieve multi-device data synchronization and accurate song recommendations.

Method used

Provide an online music playback system based on the automatic caching mechanism, including user interaction module, cache management module, network monitoring module, server data acquisition module, local cache storage module, music playback module, data synchronization module, song association information module and Song recommendation module. The system can scan and repair damaged or lost cached data regularly, intelligently clean up strategies to free up storage space, realize multi-device data synchronization, and accurately recommend songs based on user playback history, collection and cache songs and other data.

Benefits of technology

It realizes the continuity and integrity of music playback, optimizes the music playback experience, ensures seamless music playback between multiple devices, enriches users' understanding of the song background, and provides accurate song recommendations, broadens users' music Vision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396783A_ABST
    Figure CN119396783A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of music caching, and discloses an online music playing method and system based on an automatic caching mechanism, and the method comprises the steps: a user selects music in a music library interface; customizing cache parameters through a cache management module; the network monitoring module monitors the network connection state in real time; a cache process control unit monitors the cache progress; the cache data maintenance unit checks the integrity and correctness of the cache data; the server data acquisition module adjusts a playing strategy; the data synchronization module realizes multi-device synchronization; the music playing module plays music, and the song association information module displays song association information; the song recommendation module recommends similar or different songs. According to the invention, music playing continuity and integrity are ensured; the storage space is released through the intelligent cleaning strategy, and enough space is provided for a new cache task; multi-device data synchronization can be realized; the song association information can be enriched, and the song association information can be displayed when music is played; and accurate song recommendation can be carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of music caching, and more specifically, to an online music playing method and system based on an automatic caching mechanism. Background Art

[0002] With the advancement of wireless communication technology, the application functions of mobile terminals are becoming more and more abundant, and the music player of mobile terminals has become one of the indispensable applications of mobile terminals. Existing music players generally enable you to listen to songs while viewing the lyrics and singer's head portrait of the current song. The mobile terminal client needs to connect to the server to download the lyrics, singer's head portrait and song music file (mp3) to the mobile terminal separately before the complete song can be played.

[0003] The document with the prior art publication number CN118964766A provides an online music playing method based on an automatic caching mechanism, including the following steps: S1: obtaining the historical playing records of online music and extracting the playing data; S2: calculating the time interval according to the playing data, and determining the playing tags of the online music in the historical playing records based on the time interval; respectively counting the proportion of valid tags and invalid tags to the total number of playing times; S3: calculating the liking degree quantification coefficient of the online music according to the valid proportion, invalid proportion and total number of playing times, and determining the online music that needs to be cached according to the liking degree quantification coefficient. The online music that needs to be cached can be screened according to the user behavior, thereby reducing the traffic consumption when the user plays music.

[0004] Although the above-mentioned prior art solutions can achieve relevant beneficial effects through the structure of the prior art, they still have the following defects: 1. It is impossible to regularly scan and repair damaged or lost cached data, which may cause interruption or incomplete music playback. Poor management of cached data may take up too much storage space and affect device performance. 2. Poor storage space management: lack of intelligent cleaning strategy, unable to effectively free up storage space to provide sufficient space for new cache tasks. The music playback experience is limited. When the local cached data is insufficient, music cannot be played quickly, and playback interruptions are frequent. 3. When users log in with the same account on different devices, cached data and playback history cannot be automatically synchronized. The music playback experience is discontinuous, and users need to re-cache and play music when switching between different devices. 4. It is impossible to make accurate song recommendations based on user playback history, favorites, cached songs and other data.

[0005] In view of this, we propose an online music playing system and method based on automatic caching mechanism. Summary of the invention

[0006] 1. Technical problems to be solved.

[0007] The purpose of the present application is to provide an online music playback method and system based on an automatic caching mechanism, which solves the technical problems raised in the above-mentioned background technology, realizes efficient cache data maintenance, regularly scans and repairs damaged or lost cache data, and ensures the continuity and integrity of music playback; intelligent cleaning strategies release storage space to provide sufficient space for new cache tasks; multi-device data synchronization can be achieved, and when users log in with the same account on different devices, cache data and playback history can be automatically synchronized to achieve a seamless music playback experience; song-related information can be enriched, and song-related information, such as singer resumes and music works, can be displayed when playing music, to enhance users' understanding of and interest in the background of songs; accurate song recommendations can be made, and based on users' playback history, favorites, cached songs and other data, songs that suit users' tastes can be intelligently recommended, thereby broadening their musical horizons.

[0008] 2. Technical solution.

[0009] The technical solution of the present application provides an online music playing system based on an automatic caching mechanism, including:

[0010] User interaction module: includes login authentication unit and music selection and playback interface unit.

[0011] Login authentication unit: responsible for receiving the account and password information entered by the user, verifying it with the user database on the server to ensure the legitimacy of the user's identity. After successful verification, a secure connection channel with the server is established, laying the foundation for subsequent music resource acquisition and operation.

[0012] Music selection and playback interface unit: presents users with a rich music library interface, including various music categories, popular song recommendations, album displays, singer lists, etc. Users can quickly locate the music tracks they want to play by entering keywords in the search bar. At the same time, the interface displays the current music playback status, playback progress, volume control and other basic playback control functions, as well as cache status information in real time. Users can also perform manual cache operation control on this interface, such as pausing the cache, resuming the cache or canceling the cache.

[0013] Cache management module: manages the cache, including a cache setting unit, a cache process control unit and a cache data maintenance unit.

[0014] Cache setting unit: provides users with the function of customizing cache parameters, such as selecting the quality of cached music, setting the cache storage space limit, and setting the cache trigger condition. These setting information are stored in the local configuration file and can be modified and updated by the user at any time.

[0015] Cache process control unit: decides whether to start the cache process based on the user's configuration in the cache setting unit and the network status information fed back by the current network monitoring module. When the cache conditions are met, this unit coordinates the work between the server data acquisition module and the local cache storage module, and starts the download and storage operations of the cache data. During the cache process, it is responsible for monitoring the cache progress and feeding back the progress information in real time to the music selection and playback interface unit of the user interaction module for display. At the same time, it also handles the supplementary cache request triggered by the user during the playback process due to insufficient cache, and arranges the cache tasks according to the priority strategy.

[0016] Cache data maintenance unit: Regularly check and organize local cache data. Scan the local cache folder at a predetermined time interval to check the integrity and correctness of the cache data. For damaged or missing data, promptly start the repair mechanism and re-download the corresponding data from the server to supplement it. According to the cache storage space limit set by the user, when the cache data occupies a space close to the threshold, the unit adopts an intelligent cleanup strategy to release enough storage space for new cache tasks.

[0017] Network monitoring module: includes network connection detection unit and network speed test unit.

[0018] Network connection detection unit: monitors the network connection status of the device in real time to determine whether it is currently connected to Wi-Fi, mobile data network, or no network connection. If it is connected to Wi-Fi, further detect the Wi-Fi signal strength and network stability; if it is a mobile data network, obtain information such as the remaining amount of current mobile data traffic and network speed.

[0019] Network speed test unit: Test the speed of the current network connection from time to time to more accurately evaluate the impact of network conditions on music playback and caching. During the caching process, dynamically adjust the download rate of cached data according to the network speed. When the network speed is fast, increase the download speed appropriately to speed up the caching process; when the network speed is slow, reduce the download speed to avoid other network applications from freezing or music playback interruption due to excessive occupation of network resources.

[0020] Server data acquisition module: includes a music resource request unit and a data receiving and parsing unit.

[0021] Music resource request unit: receives music playback or cache request information from the user interaction module, converts it into a request instruction that complies with the server communication protocol, and sends it to the server.

[0022] Data receiving and parsing unit: responsible for receiving music data or related information returned by the server in response to the request. For music data, it is parsed and processed according to the predetermined data format, converted into a format suitable for storage in the local cache storage module, and passed to the cache process control unit of the cache management module for cache operation; for information such as music resource update notification, it is passed to the cache data maintenance unit of the cache management module so that it can decide whether to perform cache data update operation.

[0023] Local cache storage module: includes a cache data storage unit and a cache data index unit.

[0024] Cache data storage unit: creates a cache folder in the designated storage area of ​​the local device to store the music cache data downloaded from the server. According to the instructions of the cache management module, the received music data is stored in a specific file structure and format to ensure the security and integrity of the cache data. At the same time, it provides a data reading function. When the music playback module needs to play cached music, it can quickly and accurately read the music data from the local cache and pass it to the music playback module.

[0025] Cache data index unit: Establish and maintain index information of local cache data, record the metadata of each cached music and its storage location information in the local cache folder. Through the index information, the cache management module can quickly locate and manage cache data, such as quickly finding the cache file that needs to be operated when cleaning or updating cache data; the user interaction module can also easily query and display the list information and related status information of cached music.

[0026] Music playback module: includes playback control unit and audio decoding output unit.

[0027] Playback control unit: responsible for the core control functions of music playback, including receiving the user's playback operation instructions in the music selection and playback interface unit, and controlling the reading and playback process of music data according to the instructions. During the playback process, it works closely with the cache management module. When the local cache data is sufficient, it directly reads the music data from the local cache storage module for playback; when the cache data is insufficient, it promptly notifies the cache management module to start the cache replenishment process, and dynamically adjusts the playback strategy according to the network status and cache progress. For example, when the network signal is poor and the cache is not replenished in time, the buffered playback technology is used to ensure the continuity of music playback as much as possible.

[0028] Audio decoding output unit: Performs audio decoding operations on the music data obtained from the local cache storage module or the server data acquisition module, converts it into an audio signal that can be recognized and played by the device audio system, and outputs it to the device's speakers or headphones and other audio output devices to play music. This unit supports decoding functions for multiple audio formats and can automatically select the appropriate decoding algorithm for decoding processing according to the format of the music data to ensure high-quality audio playback effects.

[0029] Data synchronization module: includes local data upload unit and server data download unit.

[0030] Local data upload unit: When a user logs in to the music playback system with the same account on multiple devices, this unit is responsible for uploading the cached data information on the local device to the server. When the device is in a suitable network connection state, the upload operation is automatically started, and the local cached data information is converted into a format that can be received and stored by the server, and then sent to the server.

[0031] Server data download unit: When a user logs in to the music playback system on a new device or other device, this unit obtains the cache data information corresponding to the account from the server. Based on the cache data information returned by the server, it determines whether the local device needs to download the cached music data. If necessary, it cooperates with the server data acquisition module and downloads the corresponding music cache data from the server to the local cache storage module according to the setting requirements of the cache management module, so as to achieve synchronization of cache data between multiple devices, so that users can have a consistent music playback experience on different devices.

[0032] Song related information module: includes rich user experience unit and information display interaction unit.

[0033] Enriching the user experience unit: Providing related information such as the singer's name, resume, pictures, and hobbies, allowing users to have a deeper understanding of the creator behind the song.

[0034] Information display interactive unit: In the music playback interface or song details page, a special area is set up to display the content of the song-related information unit. The singer's name is used as a highlighted title, and after clicking it, it can be linked to a more detailed singer's resume page, which includes important milestones in his music career, awards won, and other information. Information such as hobbies can be presented in a concise text form to enrich the user's cognitive dimension of the singer.

[0035] Song recommendation module: Based on the user's playback history, favorite songs, cached songs and other data, it performs intelligent analysis to recommend similar songs or different songs by the same singer to the user. The song recommendation module uses collaborative filtering algorithms, content-based recommendation algorithms or hybrid algorithms to make recommendations. The collaborative filtering algorithm analyzes the listening behavior of other users with similar music preferences to recommend songs that the target user likes but has not yet discovered. The content-based recommendation algorithm mainly makes recommendations based on the music characteristics of the song itself and the singer's information.

[0036] The present invention provides an online music playing method based on an automatic cache mechanism, comprising the following steps.

[0037] S1. User login and authentication: The user enters the account number and password through the login authentication unit, and a secure connection with the server is established after successful authentication.

[0038] S2. Music selection: Users select music in the music library interface and can search by category, recommendation, album, singer list or search bar.

[0039] S3, Cache settings: Users can customize cache parameters, such as sound quality, storage space limit and cache trigger conditions, and the setting information is stored in the local configuration file.

[0040] S4. Network monitoring and cache decision: The network monitoring module monitors the network connection status in real time and decides whether to start the cache process based on the network status.

[0041] S5, caching process and progress feedback: The cache process control unit monitors the cache progress and provides real-time feedback to the user, and the user can manually control the cache operation.

[0042] S6. Cache data maintenance: The cache data maintenance unit checks the integrity and correctness of the cache data, repairs damaged or lost data in a timely manner, and uses intelligent cleanup strategies to release storage space.

[0043] S7, music playback: If the local cache data is sufficient, the music data is directly read from the local for playback; if it is insufficient, the cache replenishment process is started, and the playback strategy is adjusted according to the network status and cache progress.

[0044] S8. Multi-device data synchronization: When a user logs in on multiple devices, the data synchronization module automatically uploads local cached data to the server and downloads the corresponding cached data on the new device to achieve multi-device synchronization.

[0045] S9. Display and review of song-related information: When playing music, song-related information, such as the singer’s name and resume, is displayed to enrich users’ understanding of the creator behind the song.

[0046] S10, Song Recommendation: Based on data such as user playback history, favorites, and cached songs, a variety of recommendation algorithms are used to recommend similar or different songs to users, and the recommendation strategy is continuously optimized.

[0047] 3. Beneficial effects.

[0048] One or more technical solutions provided in the technical solution of this application have at least the following technical effects or advantages.

[0049] 1. The present invention provides transparent caching process and progress feedback, so that users can view the caching progress in real time and understand the music downloading situation. It also provides manual caching operation control, such as pausing, resuming and canceling caching, to enhance user interactivity.

[0050] 2. It can efficiently maintain cache data, regularly scan and repair damaged or lost cache data to ensure the continuity and integrity of music playback.

[0051] 3. Intelligent cleanup strategy releases storage space to provide enough space for new cache tasks. It can optimize the music playback experience and achieve fast music playback when the local cache data is sufficient. When the cache data is insufficient, it dynamically adjusts the playback strategy, such as buffered playback technology, to reduce playback interruptions.

[0052] 4. It can realize multi-device data synchronization. When users log in with the same account on different devices, they can automatically synchronize cache data and playback history to achieve a seamless music playback experience.

[0053] 5. It can enrich song-related information and display song-related information when playing music, such as singer's resume and music works, to enhance users' understanding and interest in the background of the song.

[0054] 6. It can make accurate song recommendations. Based on the user's play history, favorites, cached songs and other data, it can intelligently recommend songs that suit the user's taste and broaden the music horizon. It will continue to optimize the recommendation algorithm and strategy to improve the accuracy and effectiveness of the recommendation and enhance user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a flow chart of the online music playing method based on the automatic caching mechanism disclosed in this application. DETAILED DESCRIPTION

[0056] The present application is further described in detail below in conjunction with the accompanying drawings.

[0057] Reference Figure 1 , an embodiment of the present application provides an online music playing system based on an automatic caching mechanism, including.

[0058] User interaction module: includes login authentication unit and music selection and playback interface unit.

[0059] Login authentication unit: responsible for receiving the account and password information entered by the user, verifying it with the user database on the server to ensure the legitimacy of the user's identity. After successful verification, a secure connection channel with the server is established, laying the foundation for subsequent music resource acquisition and operation.

[0060] Music selection and playback interface unit: presents users with a rich music library interface, including various music categories (such as pop, classical, rock, etc.), hot song recommendations, album displays, singer lists, etc. Users can quickly locate the music tracks they want to play by entering keywords (song name, singer name, album name, etc.) in the search bar. At the same time, the interface displays the current music playback status (play, pause, stop, etc.), playback progress, volume control and other basic playback control functions in real time, as well as cache status information (whether it has been cached, cache progress percentage, etc.). Users can also perform manual cache operation control on this interface, such as pausing the cache, resuming the cache, or canceling the cache.

[0061] Cache management module: manages the cache, including a cache setting unit, a cache process control unit and a cache data maintenance unit.

[0062] Cache setting unit: provides users with the function of customizing cache parameters, such as selecting the quality of cached music (standard sound quality, high sound quality, lossless sound quality, etc.), setting cache storage space limits, and setting cache trigger conditions (such as caching only when connected to Wi-Fi, caching when mobile data traffic exceeds a certain threshold, etc.). These settings are stored in the local configuration file and can be modified and updated by the user at any time.

[0063] Cache process control unit: decides whether to start the cache process based on the user's configuration in the cache setting unit and the network status information fed back by the current network monitoring module. When the cache conditions are met, this unit coordinates the work between the server data acquisition module and the local cache storage module, and starts the download and storage operations of the cache data. During the cache process, it is responsible for monitoring the cache progress and feeding back the progress information in real time to the music selection and playback interface unit of the user interaction module for display. At the same time, it handles the supplementary cache request triggered by the user during the playback process due to insufficient cache, and arranges the cache task according to the priority strategy (such as caching the music data near the current playback position first).

[0064] Cache data maintenance unit: Regularly check and organize local cache data. Scan the local cache folder at a predetermined time interval to check the integrity and correctness of the cache data. For damaged or missing data, promptly start the repair mechanism and re-download the corresponding data from the server to supplement it. In addition, according to the cache storage space limit set by the user, when the cache data occupies a space close to the threshold, the unit adopts an intelligent cleanup strategy, such as deleting the earliest cached music data that has not been played recently, to free up enough storage space for new cache tasks.

[0065] Network monitoring module: includes network connection detection unit and network speed test unit.

[0066] Network connection detection unit: monitors the network connection status of the device in real time to determine whether it is currently connected to Wi-Fi, mobile data network, or no network connection. If it is a Wi-Fi connection, further detect the Wi-Fi signal strength and network stability; if it is a mobile data network, obtain information such as the remaining amount of current mobile data traffic and network speed. This network status information is promptly transmitted to the cache process control unit of the cache management module as an important basis for deciding whether to start caching and adjusting the cache strategy.

[0067] Network speed test unit: Test the speed of the current network connection from time to time to more accurately evaluate the impact of network conditions on music playback and caching. For example, during the caching process, dynamically adjust the download rate of cached data according to the network speed. When the network speed is fast, increase the download speed appropriately to speed up the caching process; when the network speed is slow, reduce the download speed to avoid other network applications from freezing or music playback interruption due to excessive occupation of network resources.

[0068] Server data acquisition module: includes a music resource request unit and a data receiving and parsing unit.

[0069] Music resource request unit: Receives music playback or cache request information from the user interaction module, converts it into a request instruction that complies with the server communication protocol, and sends it to the server. For example, when a user clicks to play a song, the unit sends a playback request instruction containing song ID, user account information and other parameters to the server; when the cache management module starts the cache process, it sends a cache request instruction containing detailed information about the music to be cached (such as song name, singer name, sound quality requirements, etc.) to the server.

[0070] Data receiving and parsing unit: responsible for receiving music data or related information returned by the server in response to the request. For music data, it is parsed and processed according to the predetermined data format, converted into a format suitable for storage in the local cache storage module, and passed to the cache process control unit of the cache management module for cache operation; for information such as music resource update notification, it is passed to the cache data maintenance unit of the cache management module so that it can decide whether to perform cache data update operation.

[0071] Local cache storage module: includes a cache data storage unit and a cache data index unit.

[0072] Cache data storage unit: creates a cache folder in the designated storage area of ​​the local device to store the music cache data downloaded from the server. According to the instructions of the cache management module, it stores the received music data in a specific file structure and format (such as encrypted audio file format) to ensure the security and integrity of the cache data. At the same time, it provides a data reading function. When the music playback module needs to play cached music, it can quickly and accurately read the music data from the local cache and pass it to the music playback module.

[0073] Cache data index unit: Establish and maintain index information of local cache data, record the relevant metadata of each cached music (such as song name, singer name, cache time, number of plays, etc.) and its storage location information in the local cache folder. Through the index information, the cache management module can quickly locate and manage cache data. For example, when cleaning or updating cache data, it can quickly find the cache file that needs to be operated; the user interaction module can also easily query and display the list information and related status information of cached music.

[0074] Music playback module: includes playback control unit and audio decoding output unit.

[0075] Playback control unit: responsible for the core control functions of music playback, including receiving playback operation instructions (such as play, pause, stop, fast forward, fast rewind, etc.) from the user in the music selection and playback interface unit, and controlling the reading and playback process of music data according to the instructions. During the playback process, it works closely with the cache management module. When the local cache data is sufficient, it directly reads the music data from the local cache storage module for playback; when the cache data is insufficient, it promptly notifies the cache management module to start the cache replenishment process, and dynamically adjusts the playback strategy according to the network status and cache progress. For example, when the network signal is poor and the cache is not replenished in time, the buffered playback technology (such as playing for a few seconds and pausing for a few seconds to wait for the cache data to catch up) is used to ensure the continuity of music playback as much as possible.

[0076] Audio decoding output unit: Performs audio decoding operations on the music data obtained from the local cache storage module or the server data acquisition module (if not cached), converts it into an audio signal that can be recognized and played by the device audio system, and outputs it to the device's speakers or headphones and other audio output devices to play music. This unit supports decoding functions for multiple audio formats and can automatically select the appropriate decoding algorithm for decoding processing according to the format of the music data to ensure high-quality audio playback effects.

[0077] Data synchronization module: includes local data upload unit and server data download unit.

[0078] Local data upload unit: When a user logs in to the music playback system with the same account on multiple devices, this unit is responsible for uploading the cached data information (including cached music list, cached progress, playback history, etc.) on the local device to the server. When the device is in a suitable network connection state (such as Wi-Fi connection and the device is idle), the upload operation is automatically started, and the local cached data information is converted into a format that can be received and stored by the server, and sent to the server.

[0079] Server data download unit: When a user logs in to the music playback system on a new device or other device, this unit obtains the cache data information corresponding to the account from the server. Based on the cache data information returned by the server, it determines whether the local device needs to download the cached music data. If necessary, it cooperates with the server data acquisition module and downloads the corresponding music cache data from the server to the local cache storage module according to the setting requirements of the cache management module, so as to achieve synchronization of cache data between multiple devices, so that users can have a consistent music playback experience on different devices.

[0080] Song related information module: includes rich user experience unit and information display interaction unit.

[0081] Enriching the user experience unit: Providing related information such as the singer's name, resume, picture, and hobbies can allow users to have a deeper understanding of the creator behind the song. For example, when a user plays a favorite song, they can view the singer's detailed resume and pictures, and understand the singer's musical journey and personal style characteristics, which helps to enhance the emotional connection between the user and the music and the singer. Users may pay more attention to their other works because of their in-depth understanding of a singer, thereby increasing the frequency and stickiness of using the music playback system. For example, for an emerging singer, users can better understand the source of his creative inspiration through information such as his hobbies, so that music appreciation is not limited to the melody and lyrics of the song itself.

[0082] Information display interactive unit: In the music playback interface or song details page, a special area is set aside to display the content of the song-related information unit. The singer's name is used as a highlighted title, and after clicking it, you can link to a more detailed singer's resume page, which includes important milestones in his music career, awards won, and other information. Information such as hobbies can be presented in a concise text form to enrich the user's cognitive dimension of the singer. For example, in a mobile music playback application, when a user clicks on a song in the song list to enter the playback page, a window containing the singer's related information can slide out from the bottom of the page or the sidebar, and the user can view the detailed information by sliding or clicking to expand it.

[0083] Song recommendation module: Based on the user's play history, favorite songs, cached songs and other data, it performs intelligent analysis to recommend similar songs or different songs by the same singer to the user. This helps users discover more works that suit their musical tastes and broaden their musical horizons. For example, if a user often plays songs of a certain type (such as rock), the recommendation module can filter out other excellent rock songs of the same type that may not be well-known from the massive music library and recommend them to the user, thereby improving the user's efficiency in exploring music resources. For different song recommendations for the same singer, when a user likes a popular song by a singer, the recommendation module can recommend other works of the singer, including some non-main songs but with unique styles, to the user, so that the user can have a more comprehensive understanding of the diversity of the singer's musical styles.

[0084] The song recommendation module uses collaborative filtering algorithms, content-based recommendation algorithms, or hybrid algorithms to make recommendations. The collaborative filtering algorithm recommends songs that target users like but have not yet discovered by analyzing the listening behavior of other users with similar music preferences. The content-based recommendation algorithm mainly makes recommendations based on the musical characteristics of the song itself (such as melody, rhythm, lyrics theme, etc.) and singer information. Continuously collect and analyze user data, such as user feedback on recommended songs (play, favorite, skip, etc.), in order to continuously optimize the recommendation algorithm and improve the accuracy and effectiveness of the recommendation. At the same time, as the music library is constantly updated, the recommendation module also needs to update its recommendation strategy in a timely manner to adapt to new music resources and user needs.

[0085] Furthermore, the cache management module manages the cache, including the following steps.

[0086] 1. The cache setting unit displays the available cache music quality options to the user, including standard sound quality, high sound quality, lossless sound quality, etc. Interactive elements such as input boxes or sliders are provided to allow users to set the cache storage space limit value. The setting interface of the cache trigger conditions is presented, such as setting a switch option to automatically cache only when connected to Wi-Fi, and setting a traffic threshold setting item to allow caching only when the mobile data traffic exceeds a certain value. When the user completes each setting, the setting information is stored in a local configuration file in a specific data format for subsequent reading and use. At the same time, the user's modification of the settings is monitored, and once the user makes a modification, the corresponding information in the local configuration file is immediately updated.

[0087] 2. The cache process control unit periodically reads the cache setting information in the local configuration file to obtain the cache music quality, storage space limit, cache trigger conditions and other parameters set by the user. Receive the current network status information from the network monitoring module, including network connection type (Wi-Fi or mobile data), network signal strength (for Wi-Fi), mobile data traffic remaining and other data.

[0088] Determine whether the cache conditions are met based on the cache settings and network conditions: If the user sets the cache only when connected to Wi-Fi, and the current network is Wi-Fi and the signal strength reaches a certain standard, the cache conditions are met. If the user sets the mobile data traffic threshold cache condition, and the current network is mobile data and the remaining traffic exceeds the set threshold, the cache conditions are met. When the cache conditions are met: send a cache request to the server data acquisition module, the request contains the user-selected music quality parameters and the music track information to be cached (determined by the song selected by the user in the music selection and playback interface). Receive the music data from the server data acquisition module and pass it to the local cache storage module for storage, and start cache progress monitoring at the same time. Calculate the ratio of the cached data volume to the total data volume at regular intervals to obtain the cache progress percentage. Send the cache progress information to the music selection and playback interface unit of the user interaction module so that it can be displayed to the user on the interface. During the music playback process, continuously monitor the correspondence between the music playback position and the local cache data. If it is found that the playback position is about to exceed the cached range, that is, the cache is insufficient, a supplementary cache request is sent to the server data acquisition module in accordance with the priority strategy of caching music data near the current playback position, and the requested data range is music data of a certain length before and after the playback position, and the above-mentioned cache data receiving and storage and progress monitoring steps are repeated.

[0089] The supplementary cache range is determined according to the following formula: ; In the formula, t pIndicates the current position time of the music playback, in seconds. It records the specific time point that the user has reached when playing a certain piece of music. This value will change as the playback progresses and is one of the important bases for determining where to start replenishing the cache. v represents the average amount of music data per second, in bytes / second. s refers to the average speed at which the user has played similar music in history. w is the network fluctuation coefficient. The system will monitor the relevant indicators of the network in real time, such as network delay, packet loss rate, etc., and calculate this coefficient based on a certain algorithm to reflect the stability of the current network. S s To supplement the cache start position, the unit is bytes. e Indicates the end position of the supplemental cache. c Indicates the length of time, in seconds, that needs to be added to the cache starting from the current position of music playback.

[0090] 3. The cache data maintenance unit sets a timer to trigger the cache data checking task at a predetermined time interval.

[0091] When the timer is triggered: traverse all cached music files in the local cache folder. Check the integrity and correctness of each cached music file by using file header information, checksum algorithm or comparison with server-side music file information.

[0092] If a cached music file is found to be damaged or has missing data: record the relevant information of the file (such as file name, file path, damaged location, etc.). Send a repair request to the server data acquisition module based on the recorded information, requesting to re-download the damaged or missing data. Receive the repair data from the server and write it to the corresponding location of the local cache file to complete the data repair.

[0093] Regularly check the size of the space occupied by local cache data: Get the total size of the local cache folder and the size of the used space. Calculate the ratio of the used space to the cache storage space limit set by the user. If the ratio is close to 1, that is, the space occupied by the cache data is close to the threshold: Sort the locally cached music files in order of cache time. Start deleting the oldest music files that have not been played recently, until enough storage space is released (such as reaching 0.7 times the cache storage space limit) to meet the needs of new cache tasks.

[0094] Furthermore, the network monitoring module monitors the network, including the following steps.

[0095] 1. Initialization monitoring: When the system starts, start the network connection detection unit to monitor the network connection status of the device in real time. Turn on the relevant system network interface monitoring function and prepare to receive notification information of network status changes.

[0096] 2. Determine the network connection type: At regular intervals, obtain the current network connection type information through the network status query interface provided by the system. Determine the returned information. If it is displayed as a Wi-Fi network, enter the Wi-Fi network related detection process; if it is displayed as a mobile data network, enter the mobile data network related detection process; if it is displayed as no network connection, record this status information and pass it to the cache process control unit of the cache management module to inform that network-related operations such as caching cannot be performed at present.

[0097] 3. Wi-Fi network detection: Call the system's Wi-Fi signal strength detection function to obtain the current Wi-Fi signal strength value and record the strength value. Evaluate the stability of the Wi-Fi network by sending a network stability test data packet to a specific server and counting indicators such as the round-trip time and packet loss rate of the data packet. Integrate the detected Wi-Fi signal strength and network stability information into Wi-Fi network status information, and then pass it to the cache process control unit of the cache management module.

[0098] 4. Mobile data network detection: By interacting with the mobile data management module provided by the device operating system, obtain the remaining amount of current mobile data traffic and record the remaining amount value. Use the network speed test tool to initiate a download request to a specific speed test server, record the amount of data downloaded within a certain period of time, and calculate the current mobile data network download speed, while recording the speed value. Integrate the remaining amount of mobile data traffic and network speed information into mobile data network status information, and pass it to the cache process control unit of the cache management module.

[0099] 5. Continuous monitoring and feedback: Repeat the network connection type judgment and the corresponding network status detection process at time intervals, update the network status information in real time and pass it to the cache management module in time so that it can make cache-related decisions based on the latest network conditions.

[0100] 6. Network speed test: Set the trigger conditions for the network speed test. When the trigger conditions are met, select the appropriate speed test server according to the current network connection type. If it is a Wi-Fi connection, give priority to the speed test server in the local area network or the external speed test server recommended by the network service provider; if it is a mobile data network, choose a professional speed test server in cooperation with the mobile operator to ensure the accuracy and reliability of the test results. Initialize the speed test related parameters, such as setting the speed test duration, recording the start time, etc. Initiate an HTTP download request to the selected speed test server, start timing and record the changes in the amount of data during the download process. After the set speed test duration ends, calculate the download speed of the current network based on the amount of data downloaded and the time taken.

[0101] 7. Test result application feedback: The network speed result obtained from the test is passed to the cache process control unit of the cache management module. The cache process control unit makes corresponding cache strategy adjustments based on the speed information, as follows: If the network speed is fast, the server data acquisition module is notified to appropriately increase the download rate of the cache data to speed up the cache process. If the network speed is slow, the server data acquisition module is notified to reduce the download rate of the cache data to avoid other network applications from freezing or music playback being interrupted due to excessive occupation of network resources. Continue to repeat the network speed test operation according to the trigger mechanism, so as to dynamically adjust the cache strategy according to the network conditions in real time to ensure smooth music playback and caching process. Calculate the cache data download speed according to the following formula.

[0102] When v test >v high hour; ; When v test <v low hour; .

[0103] When v low ≤v test ≤v high hour; ; In the formula, r ad Represents the adjusted cache data download rate, and its value will change dynamically according to different network conditions, music file characteristics, and user-related factors, in order to ensure that the cache process can both efficiently utilize network resources and meet users' expectations for different music caches, so that the music playback experience is not affected by cache factors as much as possible. test Refers to the current network speed measured by the network speed test unit. ori Indicates the cache data download rate originally set by the cache process control unit. high It is the high-speed threshold, which is the key boundary standard for judging the speed of the network. It is used to determine whether the current network speed is good enough, so as to decide whether to increase the cache data download rate to speed up the cache process. lowis the low-speed threshold. b is the network load balancing coefficient, which is mainly used to measure the resource usage and busyness of the entire network environment, that is, to evaluate the current network load status from a macro perspective, and focus on the specific busyness of the network link where the current device is located. h is the music file popularity coefficient, which is a quantitative coefficient determined after comprehensively considering the popularity-related indicators of the music file in the entire online music platform. These indicators cover many factors such as the number of music plays, the frequency of user searches, the number of collections, and the ranking on various popular charts. The more popular and popular a piece of music is on the platform, the larger its corresponding h value is. This means that when the system adjusts the cache strategy, considering that users are likely to have higher access needs and cache expectations for popular music, it will tend to allocate a relatively higher cache download rate to this type of music. p is the user cache preference coefficient, which is determined based on personalized factors such as the user's past cache behavior habits, the cache priority set for different music types, and the preference for specific music styles, singers, etc. If the analysis of the user's historical cache data shows that the user often actively caches a certain type of music, it means that the user has a higher cache preference for this type of music, and accordingly, the value of p will be relatively large; conversely, if the user rarely caches a certain type of music, it indicates that he or she has a lower interest in caching this type of music, and the value of p will be relatively small.

[0104] Furthermore, the data synchronization module automatically uploads the local cache data to the server through the local data uploading unit when the user logs in to the same music playback account on multiple devices, including the following steps.

[0105] 1. Monitor login status and network conditions: Continuously monitor the user's login operations on each device. When it is detected that the user uses the same account to log in to the music playback system on multiple different devices, start the preparation work for the local data upload process. At the same time, monitor the network connection status of the device in real time, check the network type (to determine whether it is a Wi-Fi connection) and the operating status of the device at regular intervals (whether it is in an idle state, which can be comprehensively judged by detecting the CPU usage rate, whether there are other applications running in the foreground that occupy a large number of resources, etc., for example, set the CPU usage rate to be less than 10% and there are no foreground high-resource-occupying applications to be judged as idle).

[0106] 2. Data format conversion: After determining that the device is in a suitable network connection state (Wi-Fi connection and the device is idle), start collecting cache data information on the local device, including cached music list (obtaining basic metadata such as song names and singer information corresponding to all cached music files in the local cache folder), cache progress (sorted according to the percentage of cached parts of each music in the total data volume recorded by the cache management module) and play history (extracted from the system's record of the user's past music play time, number of times, etc.) and other content. The collected data is converted according to the unified data format pre-defined by the server.

[0107] 3. Execution of upload operation: Establish a secure communication connection with the server, and send an upload request containing local cached data information to the server. The request carries user account information and cached data content after format conversion. During the upload process, the upload progress is monitored in real time, and the upload percentage is calculated by the ratio of the uploaded data volume to the total data volume. The progress information is displayed in the system notification bar of the local device or the specific prompt area of ​​the music playback application to facilitate users to understand the upload status. If there are abnormal situations such as network interruption, server response timeout, etc. during the upload process, the upload operation is suspended and the current upload location information is recorded. After the network returns to normal, the upload will automatically continue from the recorded interruption location to ensure that the data is uploaded to the server completely.

[0108] 4. Upload completion confirmation: After receiving the upload success confirmation message returned by the server, the local device will record the completion time of the upload operation, the amount of data uploaded, and other log information for subsequent data analysis and troubleshooting. At the same time, the relevant status mark of the local cached data is updated to mark that the cached data information uploaded this time has been successfully synchronized to the server to avoid repeated uploading of the same data until the local cached data changes again.

[0109] 5. Detect login and determine demand: When the user logs in to a new device or reopens the music playback system on other existing devices, the server data download unit starts working. First, a cache data query request containing user account information is sent to the server to inquire whether the server has cache data information corresponding to the account. After receiving the request, the server returns the corresponding cache data information status and specific cache data details. The unit determines whether the local device needs to download cached music data based on the content returned by the server. The judgment is based on factors such as whether the current cache of the local device is empty, whether the server-side cache data has new content that is not cached by the local device, and whether the server-side cache data version is updated.

[0110] 6. Collaborative downloading: If it is determined that the cached music data needs to be downloaded, the server data download unit communicates and collaborates with the server data acquisition module, and sends a download request to the server data acquisition module. The request specifies the scope and requirements of the music cache data to be downloaded. These requirements will refer to the relevant parameters set locally by the cache management module, such as the quality selection of cached music (standard sound quality, high sound quality, lossless sound quality, etc.), cache storage space restrictions, etc., to ensure that the downloaded cached data complies with the cache strategy and user preferences of the local device. At the same time, the local cache storage module is initialized to prepare to receive the cached data downloaded from the server, and a temporary cache data storage buffer is created to temporarily store data fragments during the download process to prevent file corruption and other problems caused by abnormalities caused by direct data writing to the formal cache file.

[0111] 7. Data download and storage: Start downloading cached music data from the server, and write the data into the temporary buffer first according to the data sequence and format responded by the server. During the download process, monitor the download speed and progress in real time, and display this information on the corresponding interface of the local device to facilitate users to know the download status. When a data segment is completely downloaded and temporarily stored in the buffer, check its integrity and accuracy (checksum algorithm, such as CRC checksum, etc., can be used to compare the checksum of the downloaded data with the checksum of the original data provided by the server). If the check passes, write the data segment from the buffer to the corresponding position of the official cache file of the local cache storage module to ensure the correctness and integrity of the cached data. If there are abnormal situations such as network failure and server connection interruption during the download process, suspend the download operation, record the key information such as the range of downloaded data and the current download position, and continue downloading from the breakpoint based on the recorded information after the network returns to normal, so as to avoid repeated downloading of the acquired data and improve the download efficiency and data accuracy.

[0112] 8. Download completion and synchronization confirmation: When all cached music data to be downloaded are successfully downloaded and stored in the local cache storage module, a download completion confirmation message is sent to the server to inform the server that the local device has completed the cache data synchronization operation. The relevant status identifier of the cached data is updated on the local device, marking that the cached data downloaded this time has been synchronized with the server, and the local cached data index information is updated at the same time, so that the subsequent music playback module can accurately read and use these cached data, so as to achieve a consistent music playback experience for users on different devices. The entire download process is logged.

[0113] Furthermore, the song recommendation module performs intelligent analysis based on the user's play history, favorite songs, cached songs and other data to recommend similar songs or different songs by the same singer to the user. The following steps are included.

[0114] 1. Determine the data source: Clearly obtain the data for recommendation analysis from multiple relevant modules of the system, mainly including the user's play history (recording the song title, singer, play time, play count, etc. of each song played by the user), the favorite song list (including the detailed information of the songs manually added to the favorites by the user), and the cached song details (the metadata related to the songs cached locally, such as the song title, singer, cache time, etc.). Establish a connection with the system's database, extract this data regularly through the pre-set query interface, and integrate it into the data storage space dedicated to the song recommendation module to facilitate subsequent unified analysis and processing.

[0115] 2. Data preprocessing: Clean the collected raw data to remove any erroneous data. Standardize the data so that the data from different sources are consistent in format and representation, which is convenient for subsequent algorithm analysis.

[0116] 3. User similarity calculation: Extract all users’ listening behavior information from the sorted data and construct a user-song matrix. The rows of the matrix represent different users, and the columns represent different songs. The values ​​of the matrix elements can be numerical values ​​that reflect the degree of preference, such as the number of times the user has played the song, whether it has been collected, etc. Select a suitable similarity calculation method, such as cosine similarity, Pearson correlation coefficient, etc., to calculate the similarity of music preferences between the target user and all other users. After calculating the similarity values ​​of the target user and other users, sort other users from high to low according to the similarity, and select the top k users with higher similarity as the similar user group. These users are closer to the target user in music preference, and their listening behavior has a higher reference value for recommendation.

[0117] 4. Song recommendation generation: Analyze the list of songs that have been heard by similar user groups but not yet heard by the target user, count the popularity of these songs among similar users (for example, it can be measured by calculating the total number of plays among similar users, the collection ratio, and other indicators), and sort these songs from high to low according to popularity. Select the first m songs from the sorted song list as the candidate set of songs recommended to the target user based on the collaborative filtering algorithm. These songs are liked by other users with similar music tastes to the target user, but the target user has not yet discovered them, and there is a high probability that they meet the preferences of the target user. Perform song recommendation evaluation according to the following formula: ; ; ; ; ; In the formula, w cf Represents the basic weight of the collaborative filtering algorithm; w cb Represents the basic weight of the content-based recommendation algorithm. popIt is a factor affecting the popularity of songs. This factor is determined based on the overall popularity of the song on the entire music platform. Specifically, it takes into account multiple indicators related to popularity, such as the number of song plays, the frequency of user searches, and the total number of collections. pref It is the user's personalized preference matching factor, which measures the degree of fit between a song and the target user's personal music preference by deeply analyzing the user's past music behavior data (such as historical play records, style characteristics of favorite songs, frequently cached music types, etc.). new Is the song freshness factor, which is determined by the interval between the song's release time and the current time, and is used to reflect the impact of the song's freshness on the recommendation weight. ’ cf It is the weight of the collaborative filtering algorithm that is dynamically adjusted after considering factors such as song popularity, user personalized preference matching, and song freshness. ’ cb is the weight of the content-based recommendation algorithm after dynamic adjustment of multiple factors. ’’ cf and W ’’ cb They are respectively ’ cf and W ’ cb The weight value obtained after normalization. S cf It is the original score of a song in the candidate set recommended by the collaborative filtering algorithm. This score is a value assigned to each recommended song by the collaborative filtering algorithm based on its own calculation logic and evaluation criteria (such as the degree of preference of similar users for songs, the popularity of songs in similar user groups, etc.). It is used to measure the recommendation priority or recommendation strength of the song in the collaborative filtering algorithm recommendation system. The higher the value, the more worthy the song is to be recommended to the target user according to the collaborative filtering algorithm. cb It represents the original score of a song in the candidate set of the content-based recommendation algorithm. It is a score value determined by the content-based recommendation algorithm based on the degree of match between the song's own musical features (such as melody, rhythm, lyrics theme, etc.) and the target user's preferences, the song's relative advantages among similar characteristic songs, and other factors. It is used to indicate the recommendation value of the song under the framework of the content-based recommendation algorithm. The higher the score, the more suitable it is for recommendation to the target user according to the algorithm. a and β are adjustment coefficients. S is the total recommendation score. The higher the score, the higher the song will be in the list recommended to the user, thus achieving a more accurate song recommendation effect that better meets the diverse needs of users.

[0118] 5. User feedback monitoring: In the interface of the music player application, the user operation behavior of the recommended songs is monitored in real time, and the user feedback on each recommended song is recorded. The feedback behavior mainly includes operations such as play, favorite, skip, etc., and the time when these operations occurred, the corresponding song information and other details are recorded. The user feedback data is stored in a special feedback database in a timely manner for subsequent analysis. By analyzing the actual response of users to the recommended songs, the effect of the recommendation algorithm is evaluated to understand which recommendations meet user expectations and which ones need to be improved.

[0119] 6. Algorithm optimization and adjustment: According to user feedback data, the recommendation algorithm is optimized and analyzed regularly. For example, if it is found that a certain type of songs (classified by genre, singer, etc.) are skipped by a large number of users, it means that the songs recommended by the current algorithm may not be in line with the tastes of the user group. It is necessary to check whether the selection of similar users in the collaborative filtering algorithm is inaccurate, or whether there are problems with the song feature extraction or similarity calculation in the content-based recommendation algorithm, and then adjust the parameters of the corresponding algorithm in a targeted manner (such as adjusting the weight factor when calculating the similarity, reselecting the dimension of feature extraction, etc.) or improve the algorithm logic. At the same time, with the update of the music library (such as the addition of new songs, song version upgrades, etc.), re-evaluate the impact of the characteristics of the new music resources on the recommendation algorithm, update the song feature database in a timely manner, and adjust some thresholds involved in the algorithm to ensure that the recommendation algorithm can adapt to new music resources and the changing needs of users, and continuously improve the accuracy and effectiveness of recommendations.

[0120] The user similarity is calculated according to the following formula: ; In the formula, u and q represent two different user individuals. ui Represents the rating of song i by user u. This value comes from the user's active rating operation on the music platform or the system's estimated rating value based on the user's other listening-related behaviors (such as the number of plays, play time, etc.). qi It represents the rating of song i by user q. uq represents the set of songs that both user u and user v have rated. When calculating the similarity between two users, it is necessary to consider the songs they have rated together, because only based on the common understanding (the songs that have been listened to and rated) can we more reasonably compare the similarities between the two people in terms of music preferences. z1 is the time decay factor (z1>0), which is used to reflect the impact of time factors on the score weight. Its meaning is that as the time when the user rated the song becomes longer and longer away from the current time, the weight of this score in calculating the similarity should become smaller and smaller, and the value of z1 determines the speed of this decay over time. ui and t qiThey represent the time interval between the time when user u and user q rated song i and the current time. Sim(u,q) represents the similarity between user u and user q.

[0121] The song similarity is calculated according to the following formula: ; ; In the formula, s1 and s2 represent two different songs. s1,i Refers to the quantitative value of the song s1 in the i-th melody feature dimension, which is obtained from the song audio data through a specific audio analysis technology or feature extraction algorithm. s2,i is the quantitative value of the melody feature dimension of song s2; w i Indicates the weight value corresponding to the i-th melody feature dimension. The larger the weight value, the more important the melody feature dimension is in judging the similarity between two songs. t indicates a time-related variable, which is mainly used to reflect the process of changes in user listening behavior and preferences over time. w i (t) is the weight value corresponding to the i-th melody feature dimension at time t. Wi0 represents the initial weight of the i-th melody feature dimension, reflecting the initial importance of each melody feature for measuring the similarity of songs without considering the user's subsequent dynamic listening behavior and other changing factors. It will be changed through a dynamic update mechanism based on actual conditions. 幅度 It is an update amplitude adjustment parameter, which is used to control the amplitude of the weight change over time or other related factors. g(t) is a function related to time t, which is used to measure the relevant changes of a specific melody feature at time t, so as to determine the adjustment amplitude of the feature weight. For example, g(t) can be a function based on the number of recent plays. By analyzing the relative frequency of songs containing this melody feature played by users recently, it can reflect the degree of attention of this melody feature in the current user's listening preferences, thereby affecting the dynamic update of its weight. Different forms of g(t) function definitions can be used for different application scenarios and considerations. Sim(s1,s2) represents the similarity between songs s1 and s2. S represents the set of all songs that the user has recently listened to. N s,i Indicates the number of times song s (s belongs to S, i.e., the songs that the user has recently listened to) contains the ith melody feature and has been played in the most recent T time period. T represents a specific time period, which is used to define the time range for calculating the number of song plays and other related data.

[0122] Set a threshold for the matching degree between the recommended songs and the user's historical preferences. Adjust the threshold based on the acceptance rate of the recommended songs in the user feedback data (such as the collection rate, the proportion of playback time reaching a certain standard, etc.).

[0123] The recommended threshold adjustment is as follows: θ=θ0*[1+k调 *(LL t ) / (1+|LL t |)]; where θ is the adjusted recommendation threshold. θ0 is the initial threshold. L is the acceptance rate in user feedback data (such as the collection rate, the proportion of playback time reaching a certain standard, etc.). L t is the target acceptance rate. k 调 It is the adjustment coefficient, which is used to control the amplitude of threshold adjustment.

[0124] In this technical solution, the song recommendation module can make full use of user data, combine different recommendation algorithms and continuous optimization mechanisms, provide users with song recommendations that suit their musical tastes, and help users better explore and discover the rich content in the world of music.

[0125] The present invention provides an online music playing method based on an automatic cache mechanism, comprising the following steps.

[0126] S1. User login and authentication: The user enters the account number and password through the login authentication unit, and a secure connection with the server is established after successful authentication.

[0127] S2. Music selection: Users select music in the music library interface and can search by category, recommendation, album, singer list or search bar.

[0128] S3, Cache settings: Users can customize cache parameters, such as sound quality, storage space limit and cache trigger conditions, and the setting information is stored in the local configuration file.

[0129] S4. Network monitoring and cache decision: The network monitoring module monitors the network connection status in real time and decides whether to start the cache process based on the network status.

[0130] S5, caching process and progress feedback: The cache process control unit monitors the cache progress and provides real-time feedback to the user, and the user can manually control the cache operation.

[0131] S6. Cache data maintenance: The cache data maintenance unit checks the integrity and correctness of the cache data, repairs damaged or lost data in a timely manner, and uses intelligent cleanup strategies to release storage space.

[0132] S7, music playback: If the local cache data is sufficient, the music data is directly read from the local for playback; if it is insufficient, the cache replenishment process is started, and the playback strategy is adjusted according to the network status and cache progress.

[0133] S8. Multi-device data synchronization: When a user logs in on multiple devices, the data synchronization module automatically uploads local cached data to the server and downloads the corresponding cached data on the new device to achieve multi-device synchronization.

[0134] S9. Display and review of song-related information: When playing music, song-related information, such as the singer’s name and resume, is displayed to enrich users’ understanding of the creator behind the song.

[0135] S10, Song Recommendation: Based on data such as user playback history, favorites, and cached songs, a variety of recommendation algorithms are used to recommend similar or different songs to users, and the recommendation strategy is continuously optimized.

[0136] The working principle of an online music playing system based on an automatic cache mechanism of the present invention is as follows: the user enters the account number and password through the login authentication unit, and establishes a secure connection with the server after successful verification. The user selects music in the music library interface and can search by classification, recommendation, album, singer list or search bar. The user can customize cache parameters, such as sound quality, storage space limit and cache trigger condition, and the setting information is stored in the local configuration file. The network monitoring module monitors the network connection status in real time and decides whether to start the cache process according to the network status. The cache process control unit monitors the cache progress and gives real-time feedback to the user, and the user can manually control the cache operation. The cache data maintenance unit checks the integrity and correctness of the cache data, repairs the damaged or lost data in time, and uses an intelligent cleaning strategy to release storage space. If the local cache data is sufficient, the music data is directly read from the local for playback; if it is insufficient, the supplementary cache process is started, and the playback strategy is adjusted according to the network status and cache progress. When the user logs in on multiple devices, the data synchronization module automatically uploads the local cache data to the server and downloads the corresponding cache data on the new device to achieve multi-device synchronization. When playing music, song-related information, such as the singer's name and resume, is displayed to enrich the user's understanding of the creator behind the song. Based on data such as user playback history, favorites, and cached songs, a variety of recommendation algorithms are used to recommend similar or different songs to users, and the recommendation strategy is continuously optimized.

[0137] The present invention allows users to view the cache progress in real time and understand the music downloading situation through transparent cache process and progress feedback. It provides manual cache operation control, such as pausing, resuming and canceling cache, to enhance user interactivity. It can efficiently maintain cache data, regularly scan and repair damaged or lost cache data, and ensure the continuity and integrity of music playback. Intelligent cleaning strategy releases storage space to provide enough space for new cache tasks. It can optimize the music playback experience, and achieve fast music playback when the local cache data is sufficient. When the cache data is insufficient, the playback strategy is dynamically adjusted, such as buffered playback technology, to reduce playback interruption. It can achieve multi-device data synchronization, and when users log in with the same account on different devices, they can automatically synchronize cache data and playback history to achieve seamless music playback experience. It can enrich song related information, display song related information when playing music, such as singer resume and music works, to enhance users' understanding and interest in the background of songs. It can make accurate song recommendations, and intelligently recommend songs that meet users' tastes based on users' playback history, collections and cached songs, etc., to broaden their music horizons.

[0138] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An online music playing method based on automatic caching mechanism, characterized in that: The following steps are involved: S1. The user logs in to the authentication unit through the user interaction module and enters the account number and password. After successful verification, a secure connection with the server is established; S2, the user selects music in the music library interface; S3. The user customizes cache parameters through the cache management module, and the cache management module stores the setting information in a local configuration file; S4, the network monitoring module monitors the network connection status in real time, and decides whether to start the cache process according to the network status; S5, the cache process control unit monitors the cache progress and provides real-time feedback to the user, and the user manually controls the cache operation; S6. The cache data maintenance unit checks the integrity and correctness of the cache data, repairs damaged or lost data in a timely manner, and uses an intelligent cleaning strategy to release storage space; S7. If the local cache data is sufficient, the server data acquisition module directly reads the music data from the local device for playback; If it is insufficient, the cache replenishment process is started and the playback strategy is adjusted according to the network status and cache progress; S8. When a user logs in on multiple devices, the data synchronization module automatically uploads the local cache data to the server, downloads the corresponding cache data on the new device, and the local cache storage module stores the data to achieve multi-device synchronization; S9, the music playing module plays music, and the song related information module displays song related information; S10. The song recommendation module recommends similar or different songs to users based on their playback history, favorites, and cached song data, and continuously optimizes the recommendation strategy.

2. The online music playing method based on the automatic caching mechanism according to claim 1, characterized in that: Step S3 includes the following steps: S31, the cache setting unit allows the user to select the cache music quality, set the storage space limit and cache trigger condition, and after the user sets, the information is stored in the local configuration file; S32, the cache process control unit determines whether the cache conditions are met according to the local configuration and network conditions, requests and stores the music data from the server, and monitors the cache progress and displays it on the interface; during the playback process, if the cache is insufficient, the cache data is supplemented according to the priority strategy; S33. The cache data maintenance unit periodically checks the integrity and correctness of the local cached music files. If damage or loss is found, it requests repair from the server. It also regularly checks the cache space usage. When the limit is approaching, it deletes old files according to the cache time and playback frequency to free up space to meet new cache requirements.

3. The online music playing method based on the automatic caching mechanism according to claim 2 is characterized in that: In step S32, the supplementary cache range is determined according to the following formula: ; In the formula, t p represents the current time of the music playing; v represents the average amount of music data per second; s refers to the average speed of the same type of music played by the user in history; w is the network fluctuation coefficient; S s To supplement the cache starting position; S e Indicates the end position of the supplementary cache; t c Indicates the length of time, in seconds, that needs to be added to the cache starting from the current position of music playback.

4. The online music playing method based on the automatic caching mechanism according to claim 1, characterized in that: Step S4 includes the following steps: S41, initialization monitoring: when the system starts, the network connection detection unit starts to monitor the device connection status in real time, and turns on the interface monitoring function to receive notifications of network status changes; S42, network connection type determination: the system periodically queries the network connection type, and enters different detection processes or notification processes for no-cache operations according to whether it is Wi-Fi, mobile data, or no connection; S43, Wi-Fi network detection: including obtaining signal strength, sending test data packets and evaluating network stability, and integrating the information and passing it to the cache process control unit of the cache management module; S44, mobile data network detection: obtaining the remaining traffic and measuring the download speed, integrating this information into network status information and transmitting it to the cache process control unit of the cache management module; S45, continuous monitoring and feedback: Continuously monitor the network type and status, update the information in real time and pass it to the cache management module to support it in making cache decisions based on the latest network conditions; S46, Network speed test: Select the speed test server according to the connection type, initiate a download request after initializing the parameters, record data changes, and calculate the download speed after the speed test time is over to ensure that the results are accurate and reliable; S47. Feedback on application of test results: Apply test results to cache management and adjust cache strategy according to network speed: increase speed if network speed is high and decrease speed if network speed is low to ensure smooth music playback and cache. Meanwhile, continue testing to dynamically adjust strategy.

5. The online music playing method based on automatic caching mechanism according to claim 4 is characterized in that: In step S47, the cache data download speed is calculated according to the following formula: When v test >v high hour; ; When v test <v low hour; ; When v low ≤v test ≤v high hour; ; In the formula, r ad Represents the adjusted cache data download rate; v test Refers to the current network speed measured by the network speed test unit; ori Indicates the cache data download rate originally set by the cache process control unit; v high is the high-speed threshold; v low is the low speed threshold; b is the network load balancing coefficient; h is the music file heat coefficient; and p is the user cache preference coefficient.

6. The online music playing method based on automatic caching mechanism according to claim 1, characterized in that: Step S8 includes the following steps: S81. Monitor login status and network conditions: Continuously monitor login status and network conditions, including multi-device login, network type and device operation status, to prepare conditions for the local data upload process; S82, data format conversion: when the device is connected to Wi-Fi and idle, collect local cached music information, cache progress and playback history, and convert them into a data format predefined by the server; S83, upload operation execution: securely connect to the server, send a request containing the account number and cached data after format conversion, monitor and display the upload progress in real time; pause and record the location when an abnormality occurs, and automatically resume the upload after the network is restored to ensure that the data is uploaded completely; S84, upload completion confirmation: after the upload is completed, log information is recorded and the local cache status is updated to avoid repeated uploads until the data changes again; S85, detecting login and determining demand: when the user logs in, the server data download unit queries the server cache data status, and determines whether the cached music data needs to be downloaded according to the local cache status, server new content and version update factors; S86, collaborative downloading: if the cached music data needs to be downloaded, the server data download unit cooperates with the acquisition module to send a download request according to the local cache strategy and user preference, and initializes the local cache module and creates a temporary buffer to ensure data download security; S87, data download storage: download cached music data from the server to a temporary buffer, monitor the download speed and progress and display them; after verifying the data integrity, write them into the formal cache file; if there is a network anomaly, pause and record the information, and resume the download from the breakpoint after recovery to improve efficiency and accuracy; S88, download completion and synchronization confirmation: After the download is complete, confirm with the server and update the local cache status, synchronize data indexes, and record logs to ensure a consistent music playback experience.

7. The online music playing method based on automatic caching mechanism according to claim 1, characterized in that: Step S9 includes the following steps: S91, determine data sources: integrate playback history, favorite songs, and cached song data, extract from the system database regularly and store in the recommendation module for analysis and processing; S92. Data preprocessing: Clean the collected raw data to remove any possible erroneous data; standardize the data to make the data from different sources consistent in format and representation; S93, user similarity calculation: construct a user-song matrix, use a similarity calculation method to calculate the similarity of the target user's music preferences with other users, and select the top k users with the highest similarity as the similar user group for recommendation reference; S94, song recommendation generation: analyzing a list of songs that have been listened to by similar user groups but not listened to by the target user, counting the popularity of these songs among similar users, and sorting these songs from high to low according to popularity; after sorting, selecting the top m songs as candidate recommendations for the target user to match his or her preferences; S95, User feedback monitoring: Real-time recording of user feedback behaviors and detailed information on playing, collecting and skipping recommended songs, and storage in the feedback database to evaluate the effect of the recommendation algorithm and guide improvements; S96. Algorithm optimization and adjustment: Based on user feedback and new music resources, regularly analyze and optimize the recommendation algorithm, adjust parameters or improve logic, update feature database and thresholds to adapt to changing needs and improve recommendation accuracy and effectiveness.

8. The online music playing method based on automatic caching mechanism according to claim 7, characterized in that: In step S94, song recommendation evaluation is performed according to the following formula: ; In the formula, w cf Represents the basic weight of the collaborative filtering algorithm; w cb Represents the basic weight of the content-based recommendation algorithm; f pop is the song popularity factor; f pref is the user's personalized preference matching factor; f new It’s the song’s freshness factor; W ’ cf It is the weight of the collaborative filtering algorithm that is dynamically adjusted after considering the popularity of songs, the matching degree of user personalized preferences, and the freshness of songs; W ’ cb is the weight of the content-based recommendation algorithm after dynamic adjustment of multiple factors; W ’’ cf and W ’’ cb They are respectively ’ cf and W ’ cb The weight value obtained after normalization; S cf It is the original score of a song in the candidate set recommended by the collaborative filtering algorithm; S cb It represents the original score of a song in the candidate set of content-based recommendation algorithm; a and β are adjustment coefficients; S is the total recommendation score.

9. The online music playing method based on automatic caching mechanism according to claim 7, characterized in that: In step S96, user similarity is calculated according to the following formula: ; In the formula, u and q represent two different user individuals; r ui represents the rating of song i by user u; r qi It represents the rating of song i by user q; uq represents the set of songs that have been rated by both user u and user v; z1 is the time decay factor, which is used to reflect the influence of time factors on the rating weight; t ui and t qi They represent the time interval between the time when user u and user q rated song i and the current time; Sim(u,q) represents the similarity between user u and user q.

10. The online music playing method based on automatic caching mechanism according to claim 1, characterized in that: In step S96, the song similarity is calculated according to the following formula: ; ; In the formula, s1 and s2 represent two different songs; f s1,i Refers to the quantitative value of the song s1 in the i-th melody feature dimension; f s2,i is the quantitative value of the melody feature dimension of song s2; w i represents the weight value corresponding to the i-th melody feature dimension; t represents the time-related variable; w i (t) is the weight value corresponding to the i-th melody feature dimension at time t; Wi0 represents the initial weight of the i-th melody feature dimension; λ 幅度 is the update amplitude adjustment parameter; g(t) is a function related to time t, which is used to measure the relevant changes of a specific melody feature at time t; Sim(s1,s2) represents the similarity between songs s1 and s2; S represents the set of all songs that the user has listened to recently; N s,i Indicates the number of times song s contains the i-th melody feature and has been played in the most recent T time period; T represents a specific time period.

11. The online music playing method based on automatic caching mechanism according to claim 1, characterized in that: In step S96, the threshold is adjusted according to the following formula: θ=θ0*[1+k 调 *(LL t ) / (1+|LL t |)]; where θ is the adjusted recommendation threshold; θ0 is the initial threshold; L is the acceptance rate in the user feedback data; L t is the target acceptance rate; k 调 It is the adjustment coefficient, which is used to control the amplitude of threshold adjustment.

12. An online music playing system based on automatic caching mechanism, comprising: User interaction module, cache management module, network monitoring module, server data acquisition module, local cache storage module, music playback module, data synchronization module, song association information module and song recommendation module; characterized in that: User interaction module: including login authentication unit and music selection and playback interface unit; the login authentication unit is responsible for verifying the user's identity and establishing a secure connection, and the music selection and playback interface unit provides a rich music library and playback control functions, including search, playback status display, basic control and cache management; Cache management module: manages the cache, including a cache setting unit, a cache process control unit, and a cache data maintenance unit; the cache setting unit allows users to customize cache parameters and store them in local configuration files; the cache process control unit decides whether to start the cache based on user configuration and network conditions, monitors cache progress, and processes cache replenishment requests; the cache data maintenance unit regularly checks and maintains local cache data to ensure data integrity and storage space management; Network monitoring module: including a network connection detection unit and a network speed test unit; the network connection detection unit monitors the device connection status; the network speed test unit tests the network speed irregularly and dynamically adjusts the cache download rate according to the network speed; Server data acquisition module: includes a music resource request unit and a data receiving and parsing unit; the music resource request unit receives user requests and converts them into server instructions for sending; the data receiving and parsing unit receives the data returned by the server and passes it to the cache management module for caching or updating after parsing; Local cache storage module: includes a cache data storage unit and a cache data index unit; the cache data storage unit is responsible for creating a folder locally to store music cache data; the cache data index unit establishes and maintains index information of cache data; Music playback module: includes a playback control unit and an audio decoding output unit; the playback control unit cooperates with the cache management module to ensure playback continuity and adjusts the playback strategy according to network conditions and cache progress; the audio decoding output unit decodes the music data, converts it into an audio signal that can be played by the device, and outputs it to the audio output device, supporting high-quality playback of multiple audio formats; Data synchronization module: includes a local data upload unit and a server data download unit; the local data upload unit is responsible for uploading local cached data to the server when the user logs in to multiple devices; the server data download unit is responsible for obtaining cached data from the server when the user logs in to a new device, and downloading it to the local as needed, so as to achieve cached data synchronization among multiple devices; Song related information module: including a user experience enrichment unit and an information display interaction unit; the user experience enrichment unit provides detailed information about the singer, and the information display interaction unit displays this information on the music playback interface or the song details page; Song recommendation module: Based on the user's playback history, collection and cached song data, a collaborative filtering algorithm is used to recommend different songs of similar or same singer to users.

Citation Information

Patent Citations

  • Method, system and device for playing music during caching

    CN107958036A

  • Music playing method and device, electronic equipment and storage medium

    CN108287680A

  • Cross-device offline data synchronization method and device, equipment and storage medium

    CN116032943A

  • Music recommendation method and music player

    CN117033798A

  • Online music playing method based on automatic caching mechanism

    CN118964766A

Cited By

  • Cache processing method and device of gateway router and network equipment

    CN119922140A

  • Cross-device audio playing method, system and device and storage medium

    CN120499456A

  • Digital music recommendation method, electronic device, storage medium and computer program product

    CN121301606A