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

By extracting all music packets in the thread queue into the temporary queue in the music player and decoding them, the problem of unbalanced music packet storage and decoding extraction time is solved, and the processing efficiency of music packets is improved and Thread queue utilization.

CN119473646APending Publication Date: 2025-02-18BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310989611.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The music player has unbalanced storage and decoding and extraction times for music packets, which causes music packets to wait for storage for a long time, resulting in data congestion.

Method used

In response to the music playback request, all music packets in the thread queue are extracted to the temporary queue in sequence, and the music packets in the temporary queue are decoded in sequence, and finally music playback is performed based on the decoded music packets. .

Benefits of technology

The utilization rate of thread queues is improved, the channel crowding situation of information receiving devices is alleviated, and the problem of thread queue mutual exclusion is solved to store and decode and extract music packets, which greatly improves the processing efficiency of music packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473646A_ABST
    Figure CN119473646A_ABST
Patent Text Reader

Abstract

The invention provides a music playing method and device, electronic equipment, a storage medium and a vehicle, and relates to the field of data processing. The method comprises the following steps: in response to a music playing request, extracting all music data packets in a thread queue to a temporary storage queue in sequence; decoding the music data packets in the temporary storage queue in sequence; and playing music according to the decoded music data packet. Through the same extraction of all music data packets, the utilization rate of a thread queue is greatly improved, and the channel occupation condition of an information receiving device is relieved. Meanwhile, decoding of the music data packet in the temporary storage queue and storage of the subsequent music data packet of the current music data packet to the thread queue can be synchronously carried out, the problem that the thread queues are mutually exclusive to store and extract the music data packets is solved, and the processing efficiency of the music data packets is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a music playing method, device, electronic device, storage medium and vehicle. Background Art

[0002] The music player receives music data packets through wireless signals and further plays the music. It needs to rely on thread queues to store music data, sort the music data, and extract and decode the music data from the thread queue when playing the music, so that the music player can play the music.

[0003] However, the storage and decoding of music data packets by the thread queue are mutually exclusive, that is, the storage and decoding cannot be performed synchronously. At the same time, affected by the decoding speed, the decoding rate of music data from the thread queue is lower than the storage rate. Therefore, the storage of music data packets requires a long wait in the process of decoding and extracting each music data packet, which is easy to cause congestion when the music player receives information through wireless signals, increasing the workload of the music player. Summary of the invention

[0004] In view of this, the present application provides a music playing method, device, electronic device, storage medium and vehicle, the main purpose of which is to solve the problem of data congestion caused by the imbalance of storage and decoding extraction time of music data packets in the music player, which causes the music data packets to wait for a long time to be stored.

[0005] To achieve the above-mentioned purpose, the first aspect of the present application discloses a music playing method, which comprises:

[0006] In response to a music playing request, all music data packets in the thread queue are extracted to a temporary storage queue in order;

[0007] Decode the music data packets in the temporary queue in order;

[0008] Music is played according to the decoded music data packet.

[0009] Optionally, before playing music according to the decoded music data packet, the method includes:

[0010] Obtaining the data to be played generated by sequentially decoding the music data packets in the temporary storage sequence;

[0011] Copying the to-be-played data into the to-be-played sequence in order;

[0012] The step of playing music according to the decoded music data packet comprises:

[0013] Music is played according to the to-be-played data in the to-be-played sequence.

[0014] Optionally, in response to the music playing request, extracting all the music data packets in the thread queue to the temporary storage queue in order, including:

[0015] In response to a music playback request, identifying a wireless signal;

[0016] Acquire the music data packet from the wireless signal;

[0017] Open the thread queue and store the music data packets in the thread queue in order;

[0018] According to the storage status of the music data packets in the thread queue, all the music data packets in the thread queue are extracted to the temporary storage queue in sequence.

[0019] Optionally, extracting all the music data packets in the thread queue to the temporary storage queue in order according to the storage status of the music data packets in the thread queue includes:

[0020] Identify the storage status of the music data packet in the thread queue;

[0021] When the storage memory occupied by the music data packets in the thread queue exceeds a preset memory value, pausing the storage action of the thread queue;

[0022] All the music data packets in the thread queue are extracted to the temporary storage queue in sequence.

[0023] Optionally, when the storage memory occupied by the music data packets in the thread queue exceeds a preset memory value, pausing the storage action of the thread queue includes:

[0024] When the storage memory occupied by the music data packets in the thread queue exceeds the preset memory value, a temporary storage queue is opened;

[0025] The storage action of the thread queue is suspended, and the storage location of the music data packet is modified to the temporary storage queue.

[0026] Optionally, after pausing the storage action of the thread queue and modifying the storage location of the music data packet to the temporary storage queue, the method further includes:

[0027] After confirming that all the music data packets in the thread queue are extracted to the temporary storage queue, extracting the music data packets in the temporary storage queue to the thread queue in order;

[0028] Modify the storage location of the music data packet to the thread queue.

[0029] In a second aspect of the present application, an embodiment provides a music playing device, the device comprising:

[0030] An extraction module, for extracting all music data packets in the thread queue to a temporary storage queue in order in response to a music playing request;

[0031] A decoding module, used for sequentially decoding the music data packets in the temporary queue;

[0032] The playing module is used to play music according to the decoded music data packet.

[0033] In a third aspect of the present application, an electronic device is provided, including:

[0034] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the methods disclosed in the first aspect.

[0035] In a fourth aspect of the present application, an embodiment provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0036] In a fifth aspect embodiment of the present application, a vehicle is provided, in which the music playback device as described in the second aspect or the electronic device as described in the third aspect is mounted.

[0037] In summary, according to the technical solution disclosed in the present application, in order to solve the problem of data congestion caused by the music player having to wait for a long time for storage due to the imbalance of storage and decoding extraction time of the music data packet during vehicle driving. The present application extracts all the music data packets in the thread queue to the temporary storage queue in order in response to the music playing request; decodes the music data packets in the temporary storage queue in order; and plays music according to the decoded music data packets. By uniformly extracting all the music data packets, the utilization rate of the thread queue is greatly improved, and the channel crowding of the information receiving device is alleviated. At the same time, the decoding and extraction of the music data packets in the temporary storage queue and the storage of the subsequent music data packets of the current music data packet to the thread queue can be performed simultaneously, which solves the problem of the thread queue mutually exclusive storage and decoding extraction of the music data packets, and greatly improves the processing efficiency of the music data packets.

[0038] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

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

[0041] Figure 1 A flow chart of a music playing method provided by an embodiment of the present application is shown;

[0042] Figure 2 A structural diagram of a music playing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0043] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0044] In order to solve the problem of data congestion caused by the imbalance between the storage and decoding time of the music data packet in the music player during the driving process of the vehicle, the music data packet waits for a long time for storage. The present application provides the following embodiments to solve the above problem:

[0045] This embodiment provides a music playing method, such as Figure 1 FIG. 1 is a flowchart of the method of this embodiment, and the method of this embodiment may specifically include the following steps:

[0046] Step 101, in response to a music playing request, all music data packets in the thread queue are sequentially extracted to a temporary storage queue.

[0047] The technical solution of the present application is applied to a music player, and in particular, can be applied to a car-mounted music player, wherein the car-mounted music player is equipped with a wireless communication function, can be connected to other communication devices through wireless communication, and receive control instructions sent by other communication devices through wireless signals. For example, the other communication device can be a mobile phone, and the wireless signal can be a Bluetooth signal, a WIFI signal, or a near-field communication NFC signal, etc. Through the control of the mobile phone, the music player can play the selected music.

[0048] The music player includes a thread queue for storing music data packets sent from the mobile phone. After wireless communication is established between the mobile phone and the music player, after the mobile phone confirms the music being played, the data corresponding to the music is sent to the music player in the form of a music data packet. After receiving the music data packet, the music player stores the music data packet in the thread queue in sequence and further decodes the music data packet.

[0049] In conventional technology, the frequency of extracting music data packets is determined according to the decoding rate of the data packets, that is, after a music data packet is decoded and extracted, the next music data packet is extracted from the thread queue for decoding and extraction.

[0050] In the present embodiment, it is further proposed that when extracting music data packets from a thread queue, all music data packets in the thread queue are directly extracted, and the extracted music data packets are transferred to a temporary queue, and further subsequent operations are performed on the music data packets.

[0051] Step 102, decoding the music data packets in the temporary queue in order.

[0052] After all the music data packets in the thread queue are extracted into the temporary storage queue, the music data packets in the temporary storage queue are further extracted and decoded in sequence to convert the music data packets into a data format that can be directly recognized by the playback device.

[0053] Step 103, playing music according to the decoded music data packet.

[0054] The storage and extraction of music data packets by the thread queue are mutually exclusive, that is, the storage and extraction cannot be performed synchronously. Therefore, the existing thread queue needs to extract the next music data packet from the thread queue for extraction and decoding after the extraction and decoding of a music data packet is completed, which greatly slows down the time for the thread queue to store music data packets. At the same time, when the mobile phone sends music data packets at a too fast rate using wireless communication, it will greatly occupy the channel of the information receiving device of the music player, causing information congestion and making the music player unable to receive other information.

[0055] By adopting the technical solution of this embodiment, when extracting music data packets from the thread queue, all data packets in the thread queue are directly extracted first and transferred to the temporary queue. The subsequent extraction and decoding of the music data packets can directly extract the music data packets from the temporary queue, and perform subsequent decoding and music playing. By adopting the technical solution of this embodiment, all music data packets are uniformly extracted. Because the extraction time is extremely short compared to the decoding time, the waiting time of the thread queue is greatly shortened, thereby improving the utilization rate of the thread queue and alleviating the channel crowding of the information receiving device. At the same time, the decoding of the music data packets in the temporary queue and the storage of the subsequent music data packets of the current music data packet to the thread queue can be performed simultaneously, which solves the problem of the storage and decoding extraction of the music data packets by the mutual exclusion of the thread queue, and greatly improves the processing efficiency of the music data packets.

[0056] In a possible embodiment, before playing music according to the decoded music data packet, the method includes:

[0057] Obtaining the to-be-played data generated by sequentially decoding the music data packets in the temporary storage sequence; and sequentially copying the to-be-played data to the to-be-played sequence;

[0058] Play music according to the decoded music data packet, including:

[0059] Music is played according to the data to be played in the sequence to be played.

[0060] In this embodiment, it is further proposed that when playing the decoded music data packet, the to-be-played data generated by the decoded music data packet is stored in a to-be-played sequence, and the music is played directly according to the to-be-played data.

[0061] The technical solution of this embodiment takes into account the asynchronous working speed between the music playback data and the decoded data packet. The data to be played generated by directly decoding cannot directly play the music. At the same time, when the data to be played is directly used to play the music, the playback may be stuck. On this basis, the technical solution of this embodiment further proposes that after the music data packet is decoded and before the music is played by the data to be played, the data to be played is stored in the sequence to be played. The generated data to be played is stored in the sequence to be played, and the data to be played is directly extracted from the sequence to be played when the music is played, so as to buffer the asynchronous working speed between the music playback data and the decoded data packet. At the same time, the sequence to be played plays the role of a playback sequence, and the decoding of the music data packet and the playing of the data to be played can be performed in parts, which reduces the possibility of music playback being stuck and improves the user's listening experience.

[0062] In a possible embodiment, in response to a music playing request, all music data packets in the thread queue are sequentially extracted to a temporary storage queue, including:

[0063] In response to a music playing request, a wireless signal is identified; a music data packet is obtained from the wireless signal; a thread queue is opened, and the music data packets are stored in the thread queue in sequence; and according to the storage status of the music data packets in the thread queue, all the music data packets in the thread queue are extracted in sequence to a temporary storage queue.

[0064] In the technical solution of this embodiment, the storage action of the music data packet and the identification of the start of extraction are further disclosed. After the music player establishes a wireless signal connection with other communication devices, the music player receives the control signal and the music data packet transmitted by the other communication devices through the wireless signal, and further stores the music data packet in the thread queue. When the music data packet in the thread queue occupies a large amount of memory, all the music data packets in the thread queue are extracted to the temporary storage queue.

[0065] This embodiment further discloses the storage action of the thread queue on the music data packet, and further proposes a signal for starting the transfer of the music data packet in the thread queue, that is, when the memory occupancy of the thread queue is high, the transfer action of the music data packet is executed. However, it can be predicted that there can be multiple signals for starting the transfer of the music data packet, for example, after the temporary storage queue completes the decoding of all or part of the music data packets in the queue, all the music data in the thread queue can be extracted to the temporary storage queue, or after reaching a preset cycle time, all the music data in the thread queue can be extracted to the temporary storage queue.

[0066] The thread queue disclosed in the technical solution of this embodiment stores music data packets, and extracts and transfers all music data packets, which can clear the music sequence inside the thread queue to improve the utilization rate of the thread queue, and divide the music data packets into sequences for storage and decoding, further improving the playback efficiency of the music player for the music data packets and improving the user experience.

[0067] In a possible embodiment, according to the storage status of the music data packets in the thread queue, all the music data packets in the thread queue are sequentially extracted to the temporary storage queue, including:

[0068] Identify the storage status of the music data packets in the thread queue; when the storage memory occupied by the music data packets in the thread queue exceeds the preset memory value, suspend the storage action of the thread queue; extract all the music data packets in the thread queue to the temporary queue in sequence.

[0069] In response to the above-mentioned embodiment, according to the storage status of the music data packets in the thread queue, the extraction of all music data packets in the thread queue is realized. The present embodiment further proposes to judge the storage status based on a preset memory value, that is, when the storage value of the music data packet in the thread queue exceeds the preset memory value, the extraction of all music data packets in the thread queue is executed. Exemplarily, after completing the storage of music data packet A, the memory occupancy of the music data packets in the thread queue reaches 72%, and the preset memory value is 70%. At this time, all music data packets in the thread queue are extracted to the temporary storage queue.

[0070] In the technical solution of this embodiment, an initial scheme for extracting music data packets in the thread queue is further implemented, that is, the extraction of music data packets is implemented according to the storage situation of the music data packets and the specific preset memory value, so as to prevent the music data packets in the thread queue from being unable to be extracted to the temporary storage queue in time, thereby affecting the storage of voice data packets.

[0071] In a possible embodiment, when the storage memory occupied by the music data packet in the thread queue exceeds the preset memory value, pausing the storage action of the thread queue includes:

[0072] When the storage memory occupied by the music data packet in the thread queue exceeds the preset memory value, a temporary storage queue is opened; the storage action of the thread queue is suspended, and the storage position of the music data packet is modified to the temporary storage queue.

[0073] The technical solution of this embodiment takes into account the situation that when extracting the music data packet in the execution thread queue, the thread queue cannot perform the storage function of the music data packet, while other communication devices are still continuously sending music data packets to the music playback device. This embodiment further proposes to open a temporary storage queue, and when the thread queue suspends storing the music data packet, modify the storage location of the music data packet, and store the music data packets subsequently obtained through wireless signals in the temporary storage queue.

[0074] By adopting the technical solution of this embodiment, it is possible to avoid the situation where the thread queue is unable to execute music data packet storage, and it is also possible to store music data packets sent by other communication devices, thereby preventing the loss of music data packets, ensuring the integrity of music playback, and ensuring the user's music listening experience.

[0075] In a possible embodiment, after pausing the storage action of the thread queue and modifying the storage location of the music data packet to the temporary storage queue, the method further includes:

[0076] After confirming that all the music data packets in the thread queue are extracted to the temporary storage queue, the music data packets in the temporary storage queue are extracted to the thread queue in order; and the storage position of the music data packets is modified to the thread queue.

[0077] After all the music data packets in the thread queue are successfully extracted to the temporary storage queue, the thread queue can normally perform the storage function of the music data packet. At this time, the music data packet storage function of the thread queue is enabled, and the music data packets in the temporary storage queue are extracted to the thread queue, and the storage location of the music data packet is modified to the thread queue, so that the thread queue continues to perform the subsequent storage function of the music data packet. At the same time, in order to achieve the uniqueness of the storage location of the music data packet, the temporary storage queue can be selectively closed, so that the music data packet can be uniquely stored in the thread queue, ensuring the uniqueness of the music data packet as a whole, thereby achieving the accuracy of music playback and ensuring the user's music listening experience.

[0078] The music playback device establishes data connection with the mobile phone via Bluetooth wireless communication to obtain audio data and other control data sent by the mobile phone. The audio data packet includes a music data packet, wherein other control data includes music switching, volume adjustment data, etc. A receiving thread, i.e., a thread queue, is established for the data sent by the mobile phone. The data sent by the mobile phone is transmitted in the music playback device through the thread queue, wherein all audio data in the receiving thread is extracted to a temporary storage queue (queue RxQueue).

[0079] By adopting the technical solution of this embodiment, when extracting music data packets from the thread queue, all data packets in the thread queue are directly extracted and transferred to the temporary storage queue. The subsequent decoding of the music data packets can directly extract the music data packets from the temporary storage queue, and perform subsequent decoding and music playing. The technical solution of this embodiment enables the thread queue to avoid long waiting times in the process of parsing and extracting the music data packets, greatly improving the utilization rate of the thread queue and alleviating the channel crowding of the information receiving device. At the same time, decoding the music data packets in the temporary storage queue and storing the subsequent music data packets of the current music data packet in the thread queue can be performed simultaneously, solving the problem of thread queues mutually exclusive in storing and extracting music data packets, and greatly improving the processing efficiency of music data packets.

[0080] This embodiment provides a music playing device, such as Figure 2 As shown, it is a structural diagram of the device of this embodiment, including:

[0081] The extraction module 21 is used to extract all the music data packets in the thread queue to the temporary storage queue in order in response to the music playing request;

[0082] A decoding module 22, for sequentially decoding the music data packets in the temporary queue;

[0083] The playing module 23 is used to play music according to the decoded music data packet.

[0084] In a possible embodiment, the playing module 23 is further specifically configured to:

[0085] Obtaining the data to be played generated by sequentially decoding the music data packets in the temporary storage sequence;

[0086] Copying the to-be-played data into the to-be-played sequence in order;

[0087] The playing module 23 is specifically used to play music according to the to-be-played data in the to-be-played sequence.

[0088] In a possible embodiment, the extraction module 21 is specifically configured to:

[0089] In response to a music playback request, identifying a wireless signal;

[0090] Acquire the music data packet from the wireless signal;

[0091] Open the thread queue and store the music data packets in the thread queue in order;

[0092] According to the storage status of the music data packets in the thread queue, all the music data packets in the thread queue are extracted to the temporary storage queue in sequence.

[0093] In a possible embodiment, the extraction module 21 is specifically configured to:

[0094] Identify the storage status of the music data packet in the thread queue;

[0095] When the storage memory occupied by the music data packets in the thread queue exceeds a preset memory value, pausing the storage action of the thread queue;

[0096] All the music data packets in the thread queue are extracted to the temporary storage queue in sequence.

[0097] In a possible embodiment, the extraction module 21 is specifically configured to:

[0098] When the storage memory occupied by the music data packets in the thread queue exceeds the preset memory value, a temporary storage queue is opened;

[0099] The storage action of the thread queue is suspended, and the storage location of the music data packet is modified to the temporary storage queue.

[0100] In a possible embodiment, the extraction module 21 is further specifically configured to:

[0101] After confirming that all the music data packets in the thread queue are extracted to the temporary storage queue, extracting the music data packets in the temporary storage queue to the thread queue in order;

[0102] Modify the storage location of the music data packet to the thread queue.

[0103] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.

[0104] Based on the above Figure 1 The method shown, and Figure 2 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device that can be configured on the vehicle (such as a new energy vehicle) side, and the device includes at least one processor and a memory that is communicatively connected to the at least one processor; the memory is used to store instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, and the processor is used to execute a computer program to implement the above-mentioned Figure 1 The method shown.

[0105] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0106] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.

[0107] Based on the above Figure 1 The method shown, the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method corresponding to any embodiment is implemented. The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned entity device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the information processing entity device.

[0108] Based on the above electronic device, the embodiment of the present application further provides a vehicle, which may specifically include: Figure 2 The device shown in the figure or the electronic device as described above. The vehicle can be a new energy vehicle or a traditional vehicle.

[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware platforms, or by hardware. By applying the scheme of this embodiment, compared with the current prior art, this embodiment extracts all music data packets in the thread queue to the temporary storage queue in order in response to the music playing request; decodes the music data packets in the temporary storage queue in order; and plays music according to the decoded music data packets. By uniformly extracting all music data packets, the utilization rate of the thread queue is greatly improved, and the channel crowding of the information receiving device is alleviated. At the same time, the decoding and extraction of the music data packets in the temporary storage queue and the storage of the subsequent music data packets of the current music data packet to the thread queue can be performed simultaneously, which solves the problem of the thread queue mutually exclusive storage and decoding extraction of the music data packets, and greatly improves the processing efficiency of the music data packets.

[0110] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0111] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.

Claims

1. A music playing method, characterized in that: include: In response to a music playing request, all music data packets in the thread queue are extracted to a temporary storage queue in order; Decode the music data packets in the temporary queue in order; Music is played according to the decoded music data packet.

2. The method according to claim 1, characterized in that Before playing music according to the decoded music data packet, the method includes: Obtaining the data to be played generated by sequentially decoding the music data packets in the temporary storage sequence; Copying the to-be-played data into the to-be-played sequence in order; The step of playing music according to the decoded music data packet comprises: Music is played according to the to-be-played data in the to-be-played sequence.

3. The method according to claim 1, characterized in that In response to the music playing request, extracting all the music data packets in the thread queue to the temporary storage queue in order, including: In response to a music playback request, identifying a wireless signal; Acquire the music data packet from the wireless signal; Open the thread queue and store the music data packets in the thread queue in order; According to the storage status of the music data packets in the thread queue, all the music data packets in the thread queue are extracted to the temporary storage queue in sequence.

4. The method according to claim 3, characterized in that The extracting all the music data packets in the thread queue to the temporary storage queue in order according to the storage status of the music data packets in the thread queue comprises: Identify the storage status of the music data packet in the thread queue; When the storage memory occupied by the music data packets in the thread queue exceeds a preset memory value, pausing the storage action of the thread queue; All the music data packets in the thread queue are extracted to the temporary storage queue in sequence.

5. The method according to claim 4, characterized in that When the storage memory occupied by the music data packets in the thread queue exceeds the preset memory value, pausing the storage action of the thread queue includes: When the storage memory occupied by the music data packets in the thread queue exceeds the preset memory value, a temporary storage queue is opened; The storage action of the thread queue is suspended, and the storage location of the music data packet is modified to the temporary storage queue.

6. The method according to claim 5, characterized in that After pausing the storage action of the thread queue and modifying the storage location of the music data packet to the temporary storage queue, the method further includes: After confirming that all the music data packets in the thread queue are extracted to the temporary storage queue, extracting the music data packets in the temporary storage queue to the thread queue in order; Modify the storage location of the music data packet to the thread queue.

7. A music playing device, characterized in that: include: An extraction module, for extracting all music data packets in the thread queue to a temporary storage queue in order in response to a music playing request; A decoding module, used for sequentially decoding the music data packets in the temporary queue; The playing module is used to play music according to the decoded music data packet.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A vehicle, characterized in that: The vehicle is equipped with the device according to claim 7 or the electronic device according to claim 8.