[go: up one dir, main page]

CN111190751B - Task processing method and device based on song list, computer equipment and storage medium - Google Patents

Task processing method and device based on song list, computer equipment and storage medium Download PDF

Info

Publication number
CN111190751B
CN111190751B CN201911389874.XA CN201911389874A CN111190751B CN 111190751 B CN111190751 B CN 111190751B CN 201911389874 A CN201911389874 A CN 201911389874A CN 111190751 B CN111190751 B CN 111190751B
Authority
CN
China
Prior art keywords
task
processing
thread pool
song list
target song
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911389874.XA
Other languages
Chinese (zh)
Other versions
CN111190751A (en
Inventor
杨亚斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201911389874.XA priority Critical patent/CN111190751B/en
Publication of CN111190751A publication Critical patent/CN111190751A/en
Application granted granted Critical
Publication of CN111190751B publication Critical patent/CN111190751B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/63Querying
    • G06F16/638Presentation of query results
    • G06F16/639Presentation of query results using playlists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the technical field of networks and discloses a song-based task processing method, a song-based task processing device, computer equipment and a storage medium. By managing the received tasks by using the thread pool queue, even if the synchronous tasks are in progress, the received other asynchronous tasks can be stored in the thread pool queue and wait for the occurrence of idle threads, and after the synchronous tasks are completed, the processing service in the thread pool queue can be continuously executed, so that the situation of canceling the other asynchronous tasks caused by the synchronous tasks in progress is avoided, the user does not need to initiate the asynchronous tasks again, and the user operation is simplified.

Description

Task processing method and device based on song list, computer equipment and storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a task processing method and apparatus based on a song list, a computer device, and a storage medium.
Background
With the development of internet technology, people can install various music applications on terminals such as smart phones, tablet computers and portable computers to listen to mass songs, can build song lists in the music applications, store favorite songs to a server, and can receive songs stored by the users from the server at any time.
For music applications, a song-based task processing function is provided to perfect the audiovisual experience. The consistency of the audio-visual experience is very important, that is, once the user wants to edit the song list, for example, delete a certain collected song from the song list, add a song to the song list, modify song information in the song list, etc., the task process needs to be sent to the server, and the server performs a corresponding task process on the corresponding song information in the stored song list.
However, the music application is periodically in a synchronous state, and the synchronization is mainly to synchronize the local song of the terminal with the song of the server, and when any song is in the synchronous state, other tasks of the song are cancelled, so that the editing operation cannot be successful, the operation can be initiated only after the synchronization process is finished, the execution time of the operation is limited, multiple repeated operations may be involved for a user, the complexity of the operation is high, and the use of the user is inconvenient.
Disclosure of Invention
The embodiment of the application provides a song-based task processing method, a song-based task processing device, computer equipment and a storage medium, which can avoid the need of a user to initiate an unsynchronized task again and simplify the operation of the user. The technical scheme is as follows:
in one aspect, a task processing method based on a song list is provided, including:
receiving a processing task for a target song list;
adding the processing task into a thread pool queue, wherein the thread pool queue is used for storing tasks to be processed by idle threads in a thread pool;
and if the processing task is positioned at the head of the thread pool queue, correspondingly processing the target song based on the idle thread in the thread pool.
In a possible implementation manner, after the receiving the processing task for the target song, before the adding the processing task to the thread pool queue, the method further includes:
and if the processing task is an asynchronous task, adding the processing task to the data to be operated.
In a possible implementation manner, after the processing the target song based on the idle threads in the thread pool, the method further includes:
and deleting the processing task from the data to be operated if the processing task is completed.
In a possible implementation manner, after the receiving the processing task on the target song list, the method further includes:
detecting whether the target song has an ongoing synchronization task;
and if the target song list has an ongoing synchronous task, executing the step of adding the processing task into a thread pool queue.
In one possible implementation, the detecting whether the target song has an ongoing synchronization task includes:
detecting whether the target song list has a locking identifier, if so, the target song list has an ongoing synchronous task, otherwise, the target song list does not have an ongoing synchronous task.
In one aspect, a task processing device based on a song list is provided, including:
the receiving module is used for receiving a processing task of the target song list;
the adding module is used for adding the processing task into a thread pool queue, and the thread pool queue is used for storing the task to be processed by the idle thread in the thread pool;
and the processing module is used for correspondingly processing the target song list based on the idle thread in the thread pool if the processing task is positioned at the head of the thread pool queue.
In a possible implementation manner, the apparatus further includes:
and the adding module is used for adding the processing task to the data to be operated if the processing task is an asynchronous task.
In a possible implementation manner, the apparatus further includes:
and the deleting module is used for deleting the processing task from the data to be operated if the processing task is completed.
In a possible implementation manner, the apparatus further includes: the detection module is used for detecting the position of the object,
the detection module comprises:
the detection unit is used for detecting whether the target song list has an ongoing synchronous task or not;
and the triggering unit is used for triggering the joining module to execute the step of joining the processing task into the thread pool queue if the target song list has the synchronous task in progress.
In one possible implementation manner, the detection unit is configured to detect whether the target song list has a locking identifier, if so, the target song list has an ongoing synchronization task, and if not, the target song list does not have an ongoing synchronization task.
In one aspect, a computer device is provided that includes one or more processors and one or more memories having stored therein at least one program code loaded and executed by the one or more processors to perform operations as performed by the song-based task processing method described above.
In one aspect, a computer readable storage medium having at least one program code stored therein is loaded and executed by a processor to perform operations as performed by the above-described song-based task process.
According to the technical scheme provided by the embodiment of the application, the received tasks are managed by utilizing the thread pool queue, so that even if the synchronous tasks are in progress, the received other asynchronous tasks can be stored in the thread pool queue and wait for idle threads to appear, and after the synchronous tasks are completed, the execution can be continued based on the processing service in the thread pool queue, so that the condition of canceling the other asynchronous tasks caused by the synchronous tasks in progress is avoided, the user does not need to initiate the asynchronous tasks again, and the user operation is simplified.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment of a task processing method based on a song list according to an embodiment of the present application;
FIG. 2 is a flowchart of a task processing method based on a song list provided by an embodiment of the present application;
FIG. 3 is a flowchart of a task processing method based on a song list provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of a task processing device based on a song list according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment of a task processing method based on a song list according to an embodiment of the present application, and referring to fig. 1, the implementation environment includes a terminal 110 and a server 140. Terminal 110 is connected to server 140 via a wireless network or a wired network.
Terminal 110 may be a smart phone, tablet, portable computer, or the like. The terminal 110 installs and runs an application program supporting song editing. The application program can be a music application type application program, and the application program of the music application type can also have the functions of video playing, chatting and the like. The terminal 110 is an exemplary terminal used by a user, and a user account is logged into an application running in the terminal 110.
Server 140 may be a cloud computing platform, a virtualization center, or the like. The server 140 is used to provide background services for applications that support song editing. Optionally, the server 140 takes over the primary menu editing process, and the terminal 110 takes over the secondary menu editing process; alternatively, the server 140 performs the secondary song edit processing, and the terminal 110 performs the primary song edit processing; alternatively, the server 140 or the terminal 110 may separately undertake the song editing process work, respectively.
Optionally, the server 140 includes: access server, song list server and database. The access server is used to provide access services for the terminal 110. The song order editing server is used for providing background services related to the song order editing process. The database may include song information, song information databases, etc., and the different services provided by the servers may correspond to different databases, and the song server may be one or more. When the song list server is a plurality of song list servers, at least two song list servers are used for providing different services, and/or at least two song list servers are used for providing the same service, such as providing the same service in a load balancing manner, the embodiment of the present application is not limited thereto.
Terminal 110 may refer broadly to one of a plurality of terminals, with the present embodiment being illustrated only by terminal 110.
Those skilled in the art will recognize that the number of terminals may be greater or lesser. For example, the number of the terminals may be only one, or the number of the terminals may be tens or hundreds, or more, where other terminals are also included in the implementation environment. The embodiment of the application does not limit the number of terminals and the equipment type.
Based on the implementation architecture, the process of processing the task related to the song list based on the interaction between the terminal and the server is described: when a user triggers a synchronous task of a song list on a music application running on a terminal or the music application automatically executes the synchronous task of the song list, the terminal sends the synchronous task to a server, after receiving the synchronous task, the server reads song list information stored in the server by the user, and performs data synchronization on the song list information of the server and the song list information stored in the terminal by the user; when a user triggers an editing task of a song list on a music application operated by a terminal, such as adding a song to the song list, deleting the song from the song list, modifying song information and the like, the terminal executes the editing task of the song list, sends edited song list information to a server to be in data synchronization with the song list information stored on the terminal, if the terminal is not connected with the server through a network at this time, the terminal stores the edited song list information, and after the terminal is connected with the server through the network, sends the edited song list information to the server to be in data synchronization with the song list information stored on the server.
Fig. 2 is a flowchart of a task processing method based on a song list, and referring to fig. 2, the method specifically includes:
201. and receiving a processing task for the target song list.
202. And adding the processing task into a thread pool queue, wherein the thread pool queue is used for storing tasks to be processed by idle threads in the thread pool.
203. And if the processing task is positioned at the head of the thread pool queue, correspondingly processing the target song based on the idle thread in the thread pool.
In one possible implementation, after receiving a processing task for a target song, before adding the processing task to the thread pool queue, the method further includes:
and if the processing task is an asynchronous task, adding the processing task to the data to be operated.
In one possible implementation, after the target song is correspondingly processed based on the idle threads in the thread pool, the method further includes:
and if the processing task is completed, deleting the processing task from the data to be operated.
In one possible implementation, after receiving the processing task for the target song, the method further includes:
detecting whether the target song has an ongoing synchronization task;
if the target song has an ongoing synchronization task, then the step of adding the processing task to the thread pool queue is performed.
In one possible implementation, the detecting whether the target song has an ongoing synchronization task includes:
detecting whether the target song list has a locking identifier, if so, the target song list has an ongoing synchronous task, otherwise, the target song list does not have an ongoing synchronous task.
Fig. 3 is a flowchart of a task processing method based on a song list, and referring to fig. 3, the method specifically includes:
301. the computer device receives a processing task for a target song.
The target song list refers to a specific song list aimed at by the processing task. For example, when the user performs an operation of adding a song to a song list on the computer device, the computer device may acquire the song list as a target song list of the current adding task, and for example, when the user performs a synchronous operation in a song list on the computer device, the computer device may acquire the song list as a target song list of the current synchronizing task.
The processing task may be an editing task triggered on the computer device for any song list, for example, when a user performs an operation of adding a song to a song list on the computer device, the computer device may obtain an adding task for the song list, when the user performs an operation of deleting a song from a song list on the computer device, the computer device may obtain a deleting task for the song list, and when the user performs an operation of modifying a song information in a song list on the computer device, the computer device may obtain a task of modifying a song information in a song list; the method can also be a synchronous task of the song list, namely, the song list information stored in the computer equipment and the song list information stored in the server are subjected to data synchronization, and the synchronous task can be actively triggered by a user or can be periodically and automatically triggered by the computer equipment.
For any processing task, the computer device may first perform detection of whether an ongoing synchronization task is performed when receiving the processing task to determine whether special processing is performed, that is, in one possible implementation, after receiving the processing task for the target song, the computer device first detects whether the target song has an ongoing synchronization task, and if the target song has an ongoing synchronization task, the computer device performs a step of adding the processing task to the thread pool queue. By detecting whether the synchronous task is in progress or not, whether the processing of the subsequent step is to be performed can be determined, and if the synchronous task is not in progress, the subsequent steps such as waiting based on a thread pool can be avoided, so that the processing task is executed according to the normal processing sequence, and the processing time of the task can be reduced.
The computer device may detect whether the target song has an ongoing synchronization task, by adopting the following implementation manner: detecting whether the target song list has a locking identifier, if the target song list has the locking identifier, the target song list has an ongoing synchronous task, and if the target song list does not have the locking identifier, the target song list does not have the ongoing synchronous task. Wherein the locking identifier refers to a special mark added to the song list by the computer device during the song list synchronization to indicate that the song list is being synchronized. When a song list has a lock identification, the computer device cannot perform operations such as adding songs to the song list, deleting songs from the song list, modifying song information in the song list, and the like. By adding and judging based on the locking identification, a simple and visual judging mode can be adopted to determine whether synchronous tasks are in progress, and the efficiency of overall processing is improved.
302. The computer device detects whether the processing task is a synchronous task, if so, step 303 is performed, and if not, step 304 is performed.
In the embodiment of the present application, the computer device may detect whether the processing task is a synchronous task according to the task type identifier of the processing task, for different tasks, which correspond to different task type identifiers, the computer device may compare the task type identifier of the processing task with the task type identifier of the processing task based on the synchronous task type identifier, when the comparison result is that the identifiers are consistent, the processing task is the synchronous task, the computer device will execute the processing task according to step 303 described below, and when the comparison result is that the identifiers are inconsistent, the processing task is not the synchronous task, and the computer device will execute the processing task according to step 304 described below.
303. If the processing task is a synchronous task, the computer device adds the processing task to a thread pool queue, wherein the thread pool queue is used for storing tasks to be processed by idle threads in a thread pool.
The thread refers to the minimum unit of operation scheduling that an operating system can perform, and is included in a process and is the actual operation unit in the process. One thread refers to a single sequential control flow in a process, and multiple threads can be concurrent in a process, each thread executing different tasks in parallel. The thread pool refers to a multithreading processing form, the computer equipment adds the task to be processed to a thread pool queue in the process of processing the task, the thread pool queue is a first-in first-out queue, and the thread can be called to process the task in a queue mode. The computer device places the processing tasks which are not executed in a thread pool queue, the processing tasks which are not executed in the thread pool queue enter the queue according to the sequence of the receiving time of the processing tasks, when the thread pool has free threads, the processing tasks which are not executed are dequeued from the thread pool queue according to the principle of first-in first-out (First Input First Output, FIFO) and are distributed to the free threads, and the free threads execute the processing tasks.
In the embodiment of the application, when the computer equipment detects that the processing task is a synchronous task, the computer equipment directly adds the synchronous task into a thread pool queue, and after all tasks arranged in front of the synchronous task are executed by the computer equipment, the computer equipment executes the synchronous task again. The step of synchronously adding the synchronous task into the thread pool queue can ensure that the synchronous task waits in the thread pool queue when no idle thread exists in the thread pool, and the computer equipment executes the synchronous task again after the idle thread exists in the thread pool, so that the conflict between the synchronous task and other tasks being executed can be avoided, and the abnormal operation of the computer equipment is caused.
304. If the processing task is an unsynchronized task, the computer device adds the processing task to the data to be operated on and adds the processing task to a thread pool queue.
The above data to be operated refers to the relevant record data made by the computer device for the processing task that has not yet been executed. The data to be operated may be in any data storage form, for example, the data to be operated may be data stored in a specific storage space, or the data to be operated may be data stored in a specific text, and of course, the data to be operated may also be stored in other forms, which is not limited in the embodiment of the present application.
In this embodiment, when the computer device detects that the processing task is an unsynchronized task, that is, the processing task is a task of adding a song to a target song list, deleting a song from the target song list, modifying song information in the target song list, and the like, the computer device does not directly add the processing task to the thread pool queue, but adds the processing task to the data to be operated to record, and then adds the processing task to the thread pool queue. Of course, in some possible implementations, when the computer device detects that the processing task is an unsynchronized task, the processing task may also be directly added to the thread pool queue, so that the processing task and other listed tasks can be sequentially processed according to the receiving time of the processing task and other listed tasks, thereby saving processing resources of the computer device.
The following objects can be achieved by adding an unsynchronized task to data to be operated for recording in the process of processing a processing service: 1. and the task loss caused by the sudden power failure and other events is avoided. 2. The completion of a task may be checked based on the recorded unsynchronized task.
Based on the purpose of point 1, since the computer device may encounter sudden power failure and other unexpected conditions, at this time, all tasks to be executed in the thread pool queue may be emptied, resulting in task loss, so after the asynchronous task is added to the data to be operated to record, the asynchronous task may be continuously executed based on the record to be operated after the operation of the computer device is recovered to be normal. In one possible implementation, the specific process of continuing to perform the unsynchronized task based on the record to be operated may include: when the computer equipment is detected to be restarted, the computer equipment can detect whether the data to be operated is empty or not, if not, each processing task recorded in the data to be operated is read, each processing task is stored in a thread pool queue according to the receiving time sequence, and the tasks are processed based on the thread pool queue.
Based on the purpose of the 2 nd point, because the embodiment of the application processes tasks based on the thread pool queue, some tasks may be interrupted or the task processing is wrong in the processing process, so that the tasks are incomplete or the tasks are overtime, therefore, after the unsynchronized tasks are added into the data to be operated for recording, whether any processing task exceeds the preset duration and is not completed yet can be detected based on the processing tasks recorded in the data to be operated, and the problem of poor user experience such as waiting caused by the reasons can be avoided.
It should be noted that, because the synchronization task may be automatically triggered by the computer device, when the computer device encounters an emergency such as sudden power failure, the synchronization task to be executed in the thread pool queue is emptied, and after the computer device returns to normal operation, the computer device may automatically trigger the synchronization task, so that the synchronization task may not be added to the data to be operated for recording, and the setting of recording the distinction between the synchronization task and the non-synchronization task reduces the burden of the computer device for recording data.
305. If the processing task is located at the head of the thread pool queue, the computer device performs corresponding processing on the target song based on the idle thread in the thread pool.
According to the principle of first-in first-out, when all tasks in the thread pool queue arranged in front of the processing task are executed by the computer equipment, the processing task is positioned at the head of the thread pool queue, at the moment, if an idle thread exists in the thread pool, the computer equipment calls the idle thread to execute the processing task, and if no idle thread exists in the thread pool, the computer equipment continues to wait in the thread pool queue until the idle thread exists in the thread pool, and then the computer equipment calls the idle thread to execute the processing task.
306. If the processing task is completed, the computer device deletes the processing task from the data to be operated.
In this embodiment, the asynchronous task is added to the data to be operated to record before being added to the thread pool queue, and after the asynchronous task is executed by the computer device, the record related to the asynchronous task can be found from the data to be operated and deleted. The computer equipment can query the data item comprising the task identifier from the data to be operated based on the task identifier of the asynchronous task, and delete the data item obtained by the query. The task identifier is used to represent a task that is uniquely identified. By deleting the record of the processing task after the processing task is completed, the storage space can be saved and possible repetition of the processing procedure can be avoided.
According to the method provided by the embodiment of the application, the received tasks are managed by utilizing the thread pool queue, so that even if the synchronous tasks are in progress, the received other asynchronous tasks can be stored in the thread pool queue and wait for the occurrence of idle threads, and after the synchronous tasks are completed, the execution can be continued based on the processing service in the thread pool queue, so that the condition of canceling the other asynchronous tasks caused by the synchronous tasks in progress is avoided, the user does not need to initiate the asynchronous tasks again, and the user operation is simplified. Further, the above-mentioned process of recording the unsynchronized task in the data to be operated and deleting after the processing is completed improves the reliability of the execution of the processing task, and also can detect the completion of the task and also improves the reliability of the execution of the processing task.
Fig. 4 is a schematic structural diagram of a task processing device based on a song list according to an embodiment of the present application.
Referring to fig. 4, the apparatus includes:
a receiving module 401, configured to receive a processing task for a target song list;
a joining module 402, configured to join the processing task into a thread pool queue, where the thread pool queue is configured to store a task to be processed by an idle thread in a thread pool;
and a processing module 403, configured to, if the processing task is located at the head of the thread pool queue, perform corresponding processing on the target song based on the idle thread in the thread pool.
In one possible implementation, the apparatus further includes:
and the adding module is used for adding the processing task to the data to be operated if the processing task is an asynchronous task.
In one possible implementation, the apparatus further includes:
and the deleting module is used for deleting the processing task from the data to be operated if the processing task is completed.
In a possible implementation manner, the apparatus further includes: a detection module, the detection module comprising:
the detection unit is used for detecting whether the target song list has an ongoing synchronous task or not;
and the triggering unit is used for triggering the joining module to execute the step of joining the processing task into the thread pool queue if the target song list has the synchronous task in progress.
In one possible implementation, the detecting unit is configured to detect whether the target song list has a lock identifier, if so, the target song list has an ongoing synchronization task, and if not, the target song list does not have an ongoing synchronization task.
It should be noted that: in the task processing device based on the song list provided in the above embodiment, only the division of the above functional modules is used for illustrating the task processing of the song list, and in practical application, the above functional allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the task processing device based on the song list provided in the above embodiment and the task processing method embodiment based on the song list belong to the same concept, and detailed implementation processes of the task processing device based on the song list are detailed in the method embodiment, and are not described herein again.
The computer device according to the embodiment of the present application may be provided as a terminal, and fig. 5 is a schematic structural diagram of a terminal provided by the embodiment of the present application, where the terminal may be used to execute the method of computing the computer device in the foregoing embodiment. The terminal 500 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. The terminal 500 may also be referred to by other names of user devices, portable terminals, laptop terminals, desktop terminals, etc.
In general, the terminal 500 includes: one or more processors 501 and one or more memories 502.
Processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 501 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 501 may also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 501 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 501 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 502 is used to store at least one instruction for execution by processor 501 to implement the order-based task processing method provided by the method embodiments of the present application.
In some embodiments, the terminal 500 may further optionally include: a peripheral interface 503 and at least one peripheral. The processor 501, memory 502, and peripheral interface 503 may be connected by buses or signal lines. The individual peripheral devices may be connected to the peripheral device interface 503 by buses, signal lines or circuit boards. Specifically, the peripheral device includes: at least one of radio frequency circuitry 504, a display 505, a camera 506, audio circuitry 507, a positioning component 508, and a power supply 509.
Peripheral interface 503 may be used to connect at least one Input/Output (I/O) related peripheral to processor 501 and memory 502. In some embodiments, processor 501, memory 502, and peripheral interface 503 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 501, memory 502, and peripheral interface 503 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 504 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuitry 504 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 504 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 504 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 504 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 504 may also include NFC (Near Field Communication ) related circuitry, which is not limited by the present application.
The display 505 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 505 is a touch display, the display 505 also has the ability to collect touch signals at or above the surface of the display 505. The touch signal may be input as a control signal to the processor 501 for processing. At this time, the display 505 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 505 may be one, providing a front panel of the terminal 500; in other embodiments, the display 505 may be at least two, respectively disposed on different surfaces of the terminal 500 or in a folded design; in still other embodiments, the display 505 may be a flexible display disposed on a curved surface or a folded surface of the terminal 500. Even more, the display 505 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display 505 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 506 is used to capture images or video. Optionally, the camera assembly 506 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 506 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuitry 507 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 501 for processing, or inputting the electric signals to the radio frequency circuit 504 for voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones may be respectively disposed at different portions of the terminal 500. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 501 or the radio frequency circuit 504 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuitry 507 may also include a headphone jack.
The location component 508 is used to locate the current geographic location of the terminal 500 to enable navigation or LBS (Location Based Service, location-based services). The positioning component 508 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
A power supply 509 is used to power the various components in the terminal 500. The power supply 509 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 509 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 500 further includes one or more sensors 510. The one or more sensors 510 include, but are not limited to: an acceleration sensor 511, a gyro sensor 512, a pressure sensor 513, a fingerprint sensor 514, an optical sensor 515, and a proximity sensor 516.
The acceleration sensor 511 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 500. For example, the acceleration sensor 511 may be used to detect components of gravitational acceleration on three coordinate axes. The processor 501 may control the display 505 to display a user interface in a landscape view or a portrait view according to a gravitational acceleration signal acquired by the acceleration sensor 511. The acceleration sensor 511 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 512 may detect a body direction and a rotation angle of the terminal 500, and the gyro sensor 512 may collect a 3D motion of the user to the terminal 500 in cooperation with the acceleration sensor 511. The processor 501 may implement the following functions based on the data collected by the gyro sensor 512: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 513 may be disposed at a side frame of the terminal 500 and/or at a lower layer of the display 505. When the pressure sensor 513 is disposed at a side frame of the terminal 500, a grip signal of the user to the terminal 500 may be detected, and the processor 501 performs left-right hand recognition or quick operation according to the grip signal collected by the pressure sensor 513. When the pressure sensor 513 is disposed at the lower layer of the display screen 505, the processor 501 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 505. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 514 is used for collecting the fingerprint of the user, and the processor 501 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 514, or the fingerprint sensor 514 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by the processor 501 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 514 may be provided on the front, back or side of the terminal 500. When a physical key or a vendor Logo is provided on the terminal 500, the fingerprint sensor 514 may be integrated with the physical key or the vendor Logo.
The optical sensor 515 is used to collect the ambient light intensity. In one embodiment, the processor 501 may control the display brightness of the display screen 505 based on the intensity of ambient light collected by the optical sensor 515. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 505 is turned up; when the ambient light intensity is low, the display brightness of the display screen 505 is turned down. In another embodiment, the processor 501 may also dynamically adjust the shooting parameters of the camera assembly 506 based on the ambient light intensity collected by the optical sensor 515.
A proximity sensor 516, also referred to as a distance sensor, is typically provided on the front panel of the terminal 500. The proximity sensor 516 serves to collect a distance between the user and the front surface of the terminal 500. In one embodiment, when the proximity sensor 516 detects that the distance between the user and the front of the terminal 500 gradually decreases, the processor 501 controls the display 505 to switch from the bright screen state to the off screen state; when the proximity sensor 516 detects that the distance between the user and the front surface of the terminal 500 gradually increases, the processor 501 controls the display 505 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 5 is not limiting and that more or fewer components than shown may be included or certain components may be combined or a different arrangement of components may be employed.
In an exemplary embodiment, a computer readable storage medium, such as a memory including instructions executable by a processor to perform the order-based task processing method of the above embodiment is also provided. For example, the computer readable storage medium may be Read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), compact disc Read-Only Memory (CD-ROM), magnetic tape, floppy disk, optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the above storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the application.

Claims (8)

1. The task processing method based on the song list is characterized by comprising the following steps of:
receiving a processing task for a target song list;
if the processing task is an unsynchronized task, adding the processing task to the data to be operated, adding the processing task to a thread pool queue, wherein the unsynchronized task is a task for operating the target song list, and the unsynchronized task comprises adding songs to the target song list, deleting songs from the target song list or modifying song information in the target song list;
if the processing task is a synchronous task, adding the processing task into the thread pool queue, wherein the thread pool queue is used for storing tasks to be processed by idle threads in a thread pool;
if the processing task is located at the head of the thread pool queue, correspondingly processing the target song based on an idle thread in the thread pool;
after the computer equipment is detected to restart, the computer equipment automatically triggers the synchronous task, the computer equipment also detects whether the data to be operated is empty, if not, each processing task recorded in the data to be operated is read, each processing task is stored in the thread pool queue according to the receiving time sequence, the processing task is processed based on the thread pool queue, and the computer equipment does not execute the synchronous task and the asynchronous task of the target song at the same time.
2. The method of claim 1, wherein after the corresponding processing of the target song based on the free threads in the thread pool, the method further comprises:
and deleting the processing task from the data to be operated if the processing task is completed.
3. The method of claim 1, wherein after receiving the processing task for the target song, the method further comprises:
detecting whether the target song has an ongoing synchronization task;
and if the target song list has an ongoing synchronous task, executing the step of adding the processing task into a thread pool queue.
4. The method of claim 3, wherein the detecting whether the target song has an ongoing synchronization task comprises:
detecting whether the target song list has a locking identifier, if so, the target song list has an ongoing synchronous task, otherwise, the target song list does not have an ongoing synchronous task.
5. A song-based task processing device, comprising:
the receiving module is used for receiving a processing task of the target song list;
the adding module is used for adding the processing task to the data to be operated if the processing task is an asynchronous task, wherein the asynchronous task is a task for operating the target song list, and the asynchronous task comprises adding songs to the target song list, deleting songs from the target song list or modifying song information in the target song list;
the adding module is used for adding the processing task into a thread pool queue, and the thread pool queue is used for storing the task to be processed by the idle thread in the thread pool;
the processing module is used for correspondingly processing the target song list based on idle threads in the thread pool if the processing task is positioned at the head of the thread pool queue; after restarting the computer equipment is detected, automatically triggering the synchronous task, detecting whether data to be operated is empty or not, if not, reading each processing task recorded in the data to be operated, storing each processing task into the thread pool queue according to the receiving time sequence, processing the tasks based on the thread pool queue, and enabling the computer equipment not to execute the synchronous task and the asynchronous task of the target song at the same time.
6. The apparatus of claim 5, wherein the apparatus further comprises:
and the deleting module is used for deleting the processing task from the data to be operated if the processing task is completed.
7. A computer device comprising one or more processors and one or more memories, the one or more memories having stored therein at least one instruction that is loaded and executed by the one or more processors to implement the song-based task processing method of any of claims 1-4.
8. A computer readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement the song-based task processing method of any one of claims 1 to 4.
CN201911389874.XA 2019-12-30 2019-12-30 Task processing method and device based on song list, computer equipment and storage medium Active CN111190751B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911389874.XA CN111190751B (en) 2019-12-30 2019-12-30 Task processing method and device based on song list, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911389874.XA CN111190751B (en) 2019-12-30 2019-12-30 Task processing method and device based on song list, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111190751A CN111190751A (en) 2020-05-22
CN111190751B true CN111190751B (en) 2023-12-08

Family

ID=70711077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911389874.XA Active CN111190751B (en) 2019-12-30 2019-12-30 Task processing method and device based on song list, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111190751B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037702B (en) * 2022-05-23 2024-04-12 北京梧桐车联科技有限责任公司 Message distribution and data transmission methods and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450971A (en) * 2017-06-29 2017-12-08 北京五八信息技术有限公司 Task processing method and device
CN108108463A (en) * 2017-12-29 2018-06-01 北京奇虎科技有限公司 Synchronous task processing method and processing device based on time slice scheduling

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450971A (en) * 2017-06-29 2017-12-08 北京五八信息技术有限公司 Task processing method and device
CN108108463A (en) * 2017-12-29 2018-06-01 北京奇虎科技有限公司 Synchronous task processing method and processing device based on time slice scheduling

Also Published As

Publication number Publication date
CN111190751A (en) 2020-05-22

Similar Documents

Publication Publication Date Title
US11200022B2 (en) Method and apparatus of playing audio data
CN111346376B (en) Interaction method and device based on multimedia resources, electronic equipment and storage medium
CN112751679B (en) Instant messaging message processing method, terminal and server
CN111510482B (en) Method and device for determining failed network request and computer storage medium
CN111462742B (en) Text display method and device based on voice, electronic equipment and storage medium
CN115378900A (en) Song list sharing method, device, terminal and storage medium
WO2020088542A1 (en) Data management method, apparatus and system, and server, terminal and storage medium
CN113282355B (en) Instruction execution method, device, terminal and storage medium based on state machine
CN113378154B (en) Application starting method and device
CN109218169B (en) Instant messaging method, device and storage medium
CN112966798B (en) Information display method and device, electronic equipment and storage medium
CN113408989B (en) Automobile data comparison method and device and computer storage medium
CN113076286B (en) Method, device, equipment and readable storage medium for acquiring multimedia file
CN112669884B (en) Audio data processing method, device, equipment and storage medium
CN111930438B (en) Method, device, equipment and storage medium for determining page loading time
CN111986700B (en) Method, device, equipment and storage medium for triggering contactless operation
CN111190751B (en) Task processing method and device based on song list, computer equipment and storage medium
CN111245629B (en) Conference control method, device, equipment and storage medium
CN111428080B (en) Video file storage method, video file search method and video file storage device
CN109107163B (en) Analog key detection method and device, computer equipment and storage medium
CN108310767B (en) Information display method, device, equipment and computer readable storage medium
CN114253442B (en) Module processing method and device for foreground and background separation system and storage medium
CN113220935B (en) Video data storage and query method and device
CN112181915A (en) Method, device, terminal and storage medium for executing service
CN113268214B (en) Picture display method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant