CN111190751A - 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
CN111190751A
CN111190751A CN201911389874.XA CN201911389874A CN111190751A CN 111190751 A CN111190751 A CN 111190751A CN 201911389874 A CN201911389874 A CN 201911389874A CN 111190751 A CN111190751 A CN 111190751A
Authority
CN
China
Prior art keywords
task
processing
song list
thread pool
tasks
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.)
Granted
Application number
CN201911389874.XA
Other languages
Chinese (zh)
Other versions
CN111190751B (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

Images

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 list-based task processing method and device, computer equipment and a storage medium. The received tasks are managed by utilizing the thread pool queue, so that other received asynchronous tasks can be stored in the thread pool queue and wait for idle threads to appear even if synchronous tasks are carried out, and after the synchronous tasks are completed, the tasks can be continuously executed based on processing services in the thread pool queue, thereby avoiding the situation that other asynchronous tasks are cancelled due to the synchronous tasks in progress, avoiding the need of a user to initiate the asynchronous tasks again, and simplifying the user operation.

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 method and an apparatus for processing a task 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 massive songs, can establish a song list in the music applications, and collect favorite songs and store the favorite songs in a server, so that users can receive the songs collected at any time from the server.
For music applications, a song-sheet based task processing function is provided to complete the audiovisual experience. The consistency of the audio-visual experience is very important, that is, once the user wants to perform an editing operation on the menu, for example, delete a certain collected song from the menu, add a song to the menu, modify song information in the menu, and the like, the task processing needs to be sent to the server, and the server performs corresponding task processing on the corresponding song information in the stored menu.
However, the music application is periodically in a synchronous state, the synchronization mainly performs data synchronization on the local song list of the terminal and the song list of the server, and when any song list is in the synchronous state, other tasks of the song list are cancelled, so that the editing operation cannot be successful, the operation can be initiated only after the synchronization process is finished, the execution opportunity of the operation is limited, for a user, repeated operation may be involved, 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 list-based task processing method and device, computer equipment and a storage medium, which can simplify user operation without a user initiating an asynchronous task again. The technical scheme is as follows:
in one aspect, a song list-based task processing method is provided, including:
receiving a processing task of the 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 through 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 list based on an idle thread in the thread pool.
In one possible implementation, after receiving the processing task for the target song list and 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 a possible implementation manner, after the corresponding processing of the target song list based on the idle threads in the thread pool, the method further includes:
and if the processing task is finished, deleting the processing task from the data to be operated.
In one possible implementation, after receiving the processing task for the target song list, the method further includes:
detecting whether the target menu has an ongoing synchronization task;
and if the target song list has an ongoing synchronization task, executing the step of adding the processing task into a thread pool queue.
In one possible implementation, the detecting whether the target song list has an ongoing synchronization task includes:
and detecting whether the target song list has a locking mark, if so, the target song list has an ongoing synchronization task, otherwise, the target song list does not have the ongoing synchronization task.
In one aspect, a song list-based task processing apparatus 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 tasks into a thread pool queue, and the thread pool queue is used for storing tasks to be processed through idle threads in a thread pool;
and the processing module is used for correspondingly processing the target song list based on an idle thread in the thread pool if the processing task is positioned at the head of the thread pool queue.
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 finished.
In one possible implementation, the apparatus further includes: a detection module for detecting the position of the optical fiber,
the detection module includes:
a detecting unit for detecting whether the target menu has an ongoing synchronization task;
and the triggering unit is used for triggering the adding module to execute the step of adding the processing task into the thread pool queue if the target song list has the synchronous task in progress.
In a possible implementation manner, the detecting 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, otherwise, 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 at least one program code stored therein, the program code being loaded and executed by the one or more processors to implement the operations performed by the song list-based task processing method as described above.
In one aspect, a computer-readable storage medium having at least one program code stored therein is provided, the program code being loaded into and executed by a processor to implement the operations performed by the song list-based task processing as described above.
According to the technical scheme, the received tasks are managed by utilizing the thread pool queue, so that even if synchronous tasks are carried out, the received other asynchronous tasks can be stored in the thread pool queue and wait for idle threads to appear, after the synchronous tasks are completed, the synchronous tasks can be continuously executed based on processing services in the thread pool queue, the situation that the other asynchronous tasks are cancelled due to the synchronous tasks in progress is avoided, a user does not need to initiate the asynchronous tasks again, and user operation is simplified.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of an implementation environment of a song-based task processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of a song list based task processing method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a song list based task processing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a song list-based task processing device 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
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment of a song-based task processing method according to an embodiment of the present application, and referring to fig. 1, the implementation environment includes a terminal 110 and a server 140. The terminal 110 is connected to the server 140 through a wireless network or a wired network.
The terminal 110 may be a smart phone, a tablet computer, a portable computer, or the like. The terminal 110 is installed and operated with an application program supporting the editing of the song list. The application program can be a music application program, and the application program of the music application program can also have the functions of video playing, chatting and the like. Illustratively, the terminal 110 is a terminal used by a user, and an application running in the terminal 110 is logged with a user account.
The server 140 may be a cloud computing platform, a virtualization center, or the like. The server 140 is used for providing background services for the application programs supporting the song list editing. Alternatively, the server 140 undertakes the primary song list editing processing work, and the terminal 110 undertakes the secondary song list editing processing work; or, the server 140 undertakes the secondary song list editing processing work, and the terminal 110 undertakes the primary song list editing processing work; alternatively, the server 140 or the terminal 110 may be separately responsible for the song list editing processing work, respectively.
Optionally, the server 140 comprises: the server, the song list server and the database are accessed. The access server is used to provide access services for the terminal 110. The song list editing server is used for providing background services related to song list editing processing. The database may include a song list information database, a song information database, and the like, and different databases may be corresponded based on different services provided by the server, and the song list server may be one or more. When there are a plurality of song list servers, there are at least two song list servers for providing different services, and/or there are at least two song list servers for providing the same service, for example, providing the same service in a load balancing manner, which is not limited in the embodiments of the present application.
The terminal 110 may be generally referred to as one of a plurality of terminals, and the embodiment is only illustrated by the terminal 110.
Those skilled in the art will appreciate that the number of terminals described above may be greater or fewer. For example, the number of the terminal may be only one, or several tens or hundreds, or more, and in this case, other terminals are also included in the implementation environment. The number of terminals and the type of the device are not limited in the embodiments of the present application.
Based on the implementation framework, the process of processing the tasks related to the song list based on the interaction between the terminal and the server is introduced: when a user triggers a synchronous task for a song list on a music application running on a terminal or the music application automatically executes the synchronous task for the song list, the terminal sends the synchronous task to a server, the server reads song list information stored in the server by the user after receiving the synchronous task, and data synchronization is carried out on the song list information of the server and the song list information stored on the terminal by the user; when a user triggers a task of editing 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 task of editing the song list, sends the edited song list information to a server to perform data synchronization with the song list information stored on the terminal, stores the edited song list information if the terminal is not connected with the server through a network at the moment, and sends the edited song list information to the server to perform data synchronization with the song list information stored on the server after the terminal is connected with the server through the network.
Fig. 2 is a flowchart of a song-based task processing method provided in an embodiment of the present application, and with reference to fig. 2, the method specifically includes:
201. a processing task for the target song list is received.
202. And adding the processing task into a thread pool queue, wherein the thread pool queue is used for storing the task to be processed through an idle thread in the thread pool.
203. And if the processing task is positioned at the head of the thread pool queue, performing corresponding processing on the target song list based on an idle thread in the thread pool.
In one possible implementation, after receiving a processing task for the target song list and before adding the processing task to the thread pool queue, the method further comprises:
and if the processing task is an asynchronous task, adding the processing task to the data to be operated.
In one possible implementation manner, after the target song list is processed based on idle threads in the thread pool, the method further includes:
and if the processing task is finished, deleting the processing task from the data to be operated.
In one possible implementation, after receiving the processing task for the target song list, the method further comprises:
detecting whether the target menu has an ongoing synchronization task;
if the target menu has an ongoing synchronization task, the step of adding the processing task to the thread pool queue is performed.
In one possible implementation, the detecting whether the target song list has an ongoing synchronization task includes:
and detecting whether the target song list has a locking mark, if so, the target song list has an ongoing synchronization task, otherwise, the target song list does not have the ongoing synchronization task.
Fig. 3 is a flowchart of a song-based task processing method according to an embodiment of the present application, and with reference to fig. 3, the method specifically includes:
301. the computer device receives a processing task for the target song list.
The target song list refers to a specific song list targeted by the processing task. For example, when the user performs an operation of adding a song to a certain song list on the computer device, the song list may be acquired as the target song list of the current added task on the computer device, and for example, when the user performs a synchronization operation in a certain song list on the computer device, the song list may be acquired as the target song list of the current synchronized task on the computer device.
The processing task may be an editing task for any song list triggered on the computer device, for example, when a user performs an operation of adding a certain song to a certain song list on the computer device, the adding task for the song list may be acquired on the computer device, when a user performs an operation of deleting a certain song from a certain song list on the computer device, the deleting task for the song list may be acquired on the computer device, and when a user performs an operation of modifying information of a certain song in a certain song list on the computer device, the task of modifying information of a certain song in a certain song list may be acquired on the computer device; the synchronous task of the song list can also be the data synchronization of the song list information stored by the computer equipment and the song list information stored by the server, and the synchronous task can be actively triggered by the user or periodically and automatically triggered by the computer equipment.
For any processing task, when the computer device receives the processing task, it may first detect whether there is an ongoing synchronization task to determine whether to perform special processing, that is, in a possible implementation manner, after the computer device receives the processing task for the target song list, it first detects whether the target song list has an ongoing synchronization task, and if the target song list has an ongoing synchronization task, the computer device performs the following step of adding the processing task into the thread pool queue. Whether the processing of the subsequent steps is required to be performed or not can be determined through the detection process of whether the synchronous task is in progress or not, if the synchronous task is not in progress, the subsequent steps of waiting based on a thread pool and the like can be avoided, so that the processing tasks are executed according to a normal processing sequence, and the processing time of the tasks can be reduced.
When detecting whether the target song list has an ongoing synchronization task, the computer device can adopt the following implementation mode: detecting whether the target song list has a locking mark, if so, the target song list has an ongoing synchronization task, and if not, the target song list does not have the locking mark, the target song list does not have the ongoing synchronization task. Wherein the lock flag refers to a special mark added to the song list by the computer device when the song list is synchronized to indicate that the song list is being synchronized. When the menu has the locking identification, the computer device cannot perform operations of adding songs to the menu, deleting songs from the menu, modifying song information in the menu and the like. By adding and judging based on the locking identification, whether a synchronous task is in progress can be determined by adopting a simple and visual judging mode, and the overall processing efficiency is improved.
302. The computer device detects whether the processing task is a synchronization task, if so, performs step 303, and if not, performs step 304.
In this embodiment of the present application, the computer device may detect whether a processing task is a synchronous task according to a task type identifier of the processing task, for different tasks, the processing task corresponds to different task type identifiers, the computer device may compare the synchronous task type identifier with a task type identifier of the processing task, if the comparison result indicates that the identifiers are consistent, the processing task is the synchronous task, the computer device executes the processing task according to the following step 303, and if the comparison result indicates that the identifiers are not consistent, the processing task is not the synchronous task, the computer device executes the processing task according to the following step 304.
303. And if the processing task is a synchronous task, the computer equipment adds the processing task into a thread pool queue, and the thread pool queue is used for storing the task to be processed through an idle thread in the thread pool.
The thread is the smallest unit that the operating system can perform operation scheduling, is included in the process, and is the actual operation unit in the process. A thread refers to a single sequential control flow in a process, multiple threads can be concurrently executed in a process, and each thread executes different tasks in parallel. The thread pool is a multi-thread processing form, the computer device adds the tasks to be processed to a thread pool queue in the process of processing the tasks, the thread pool queue is a first-in first-out queue, and the tasks can be called to be processed by the threads in a queue mode. The computer device puts the processing tasks which are not executed into a thread pool queue, the processing tasks which are not executed enter the queue according to the sequence of the receiving time of the processing tasks in the thread pool queue, when idle threads exist in the thread pool, the processing tasks which are not executed are listed from the thread pool queue according to the First Input First Output (FIFO) principle, are distributed to the idle threads, and the idle threads execute the processing tasks.
In the embodiment of the application, when the computer device detects that the processing task is a synchronous task, the computer device directly adds the synchronous task to the thread pool queue, and when all tasks arranged in front of the synchronous task are executed by the computer device, the computer device executes the synchronous task again. By the step of synchronously adding the synchronization task into the thread pool queue, the synchronization task can be ensured to wait in the thread pool queue when no idle thread exists in the thread pool, and the computer equipment executes the synchronization task after the idle thread exists in the thread pool, so that the synchronization task can be prevented from colliding with other tasks being executed, and the computer equipment is prevented from running abnormally.
304. And if the processing task is an asynchronous task, the computer equipment adds the processing task to the data to be operated and adds the processing task to the thread pool queue.
The data to be operated refers to relevant recorded data made by the computer device on processing tasks which are not executed yet. The data to be operated may adopt 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 adopt other forms of storage, which is not limited in this embodiment of the application.
In this embodiment, when the computer device detects that the processing task is an asynchronous task, that is, the processing task is a task of adding a song to the target song list, deleting a song from the target song list, modifying song information in the target song list, and performing an editing operation on the target song list, 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 for recording, 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 asynchronous task, the processing task may also be directly added to the thread pool queue, so that the processing task and other queued tasks can be sequentially processed according to their receiving times, thereby saving the processing resources of the computer device.
The following purposes can be achieved by adding the asynchronous task into the data to be operated for recording in the process of processing the processing service: 1. the task loss caused by the events such as sudden power failure and the like is avoided. 2. The completion of the task may be checked based on the recorded unsynchronized tasks.
Based on the purpose of point 1, since the computer device may encounter an emergency situation such as a sudden power failure, at this time, all the tasks to be executed in the thread pool queue may be emptied, resulting in task loss, after the asynchronous task is added to the data to be operated for recording, the asynchronous task may be continuously executed based on the record to be operated after the computer device is restored to normal operation. In one possible implementation, the specific process of continuing to execute the asynchronous task based on the to-be-operated record may include: when detecting that the computer device is restarted, the computer device may detect whether the data to be operated is empty, and if not, read each processing task recorded in the data to be operated, store each processing task to the thread pool queue according to the receiving time sequence, and process the task based on the thread pool queue.
Based on the purpose of point 2, since the embodiment of the present application performs task processing based on the thread pool queue, some tasks may be interrupted or have errors in task processing during the processing process, which results in incomplete tasks or overtime tasks, and therefore, after the asynchronous tasks are added to the data to be operated for recording, it can be detected whether any processing task is not completed after exceeding the preset time based on the processing tasks recorded in the data to be operated, and the problem of poor user experience such as waiting due to the above 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 situation such as a sudden power failure, the synchronization task to be executed in the thread pool queue is emptied, and after the operation of the computer device is recovered to normal, 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 this setting of recording the synchronization task and the non-synchronization task distinctively reduces the burden of the computer device for recording data.
305. And if the processing task is positioned at the head of the thread pool queue, the computer equipment correspondingly processes the target song list based on an idle thread in the thread pool.
According to the principle of first-in first-out, after all tasks arranged in front of the processing task in the thread pool queue are executed by the computer equipment, the processing task is located at the head of the thread pool queue, at this time, if there is an idle thread in the thread pool, the computer equipment calls the idle thread to execute the processing task, at this time, if there is no idle thread in the thread pool, the computer equipment continues to wait in the thread pool queue until there is an idle thread in the thread pool, and then the computer equipment calls the idle thread to execute the processing task.
306. And if the processing task is finished, deleting the processing task from the data to be operated by the computer equipment.
In this embodiment, the asynchronous task is added to the data to be operated for recording 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 device can query a data item including the task identifier from the data to be operated based on the task identifier of the asynchronous task, and delete the queried data item. The task identifier is used for uniquely identifying a task. By deleting the record of the processing task after the processing task is completed, the storage space can be saved, and possible repeated processing 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 synchronous tasks are carried out, other received asynchronous tasks can be stored in the thread pool queue and wait for idle threads to appear, after the synchronous tasks are completed, the synchronous tasks can be continuously executed based on processing services in the thread pool queue, the situation that other asynchronous tasks are cancelled due to the synchronous tasks in progress is avoided, a user does not need to initiate the asynchronous tasks again, and the user operation is simplified. Furthermore, the asynchronous task is recorded in the data to be operated and deleted after the processing is finished, so that the reliability of the execution of the processing task is improved, the completion condition of the task can be detected, and the reliability of the execution of the processing task is also improved.
Fig. 4 is a schematic structural diagram of a song-form-based task processing device 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;
an adding module 402, configured to add the processing task to a thread pool queue, where the thread pool queue is used to store a task to be processed by an idle thread in a thread pool;
and a processing module 403, configured to perform corresponding processing on the target song list based on an idle thread in the thread pool if the processing task is located at the head of the thread pool queue.
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 finished.
In one possible implementation, the apparatus further includes: a detection module, the detection module comprising:
a detecting unit for detecting whether the target menu has an ongoing synchronization task;
and the triggering unit is used for triggering the adding module to execute the step of adding 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 locking flag, if so, the target song list has an ongoing synchronization task, otherwise, the target song list does not have an ongoing synchronization task.
It should be noted that: in the above embodiment, when processing the song list task, the task processing device based on the song list is only illustrated by the division of the functional modules, and in practical application, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the task processing device based on the song list provided by the above embodiment and the task processing method based on the song list belong to the same concept, and the specific implementation process is detailed in the method embodiment, which is 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 according to the embodiment of the present application, where the terminal may be configured to execute the method of the computer device according to the embodiment. The terminal 500 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio layer iii, motion video Experts compression standard Audio layer 3), an MP4 player (Moving Picture Experts Group Audio layer IV, motion video Experts compression standard Audio layer 4), a notebook computer, or a desktop computer. Terminal 500 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, and the like.
In general, the terminal 500 includes: one or more processors 501 and one or more memories 502.
The processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 501 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 501 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, processor 501 may also include an AI (Artificial Intelligence) processor for processing computational 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 song list based task processing method provided by method embodiments herein.
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 a bus or signal lines. Each peripheral may be connected to the peripheral interface 503 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 504, display screen 505, camera 506, audio circuitry 507, positioning components 508, and power supply 509.
The peripheral interface 503 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 501 and the memory 502. In some embodiments, the processor 501, memory 502, and peripheral interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 501, the memory 502, and the peripheral interface 503 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 504 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 504 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 504 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 504 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 504 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 505 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 505 is a touch display screen, the display screen 505 also has the ability to capture touch signals on or over the surface of the display screen 505. The touch signal may be input to the processor 501 as a control signal for processing. At this point, the display screen 505 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 505 may be one, providing the front panel of the terminal 500; in other embodiments, the display screens 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 on a folded surface of the terminal 500. Even more, the display screen 505 can be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display screen 505 may be made of LCD (liquid crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 506 is used to capture images or video. Optionally, camera assembly 506 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 506 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuitry 507 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, 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 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 500. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 501 or the radio frequency circuit 504 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 507 may also include a headphone jack.
The positioning component 508 is used to locate the current geographic position of the terminal 500 for navigation or LBS (location based Service). The positioning component 508 may be a positioning component based on the GPS (global positioning System) in the united states, the beidou System in china, the graves System in russia, or the galileo System in the european union.
Power supply 509 is used to power the various components in terminal 500. The power source 509 may be alternating current, direct current, disposable or rechargeable. When power supply 509 includes 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, terminal 500 also includes one or more sensors 510. The one or more sensors 510 include, but are not limited to: acceleration sensor 511, gyro sensor 512, pressure sensor 513, fingerprint sensor 514, optical sensor 515, and proximity sensor 516.
The acceleration sensor 511 may detect the magnitude of acceleration 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 the gravitational acceleration in three coordinate axes. The processor 501 may control the display screen 505 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected 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 cooperate with the acceleration sensor 511 to acquire a 3D motion of the user on the terminal 500. The processor 501 may implement the following functions according to the data collected by the gyro sensor 512: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 513 may be disposed on a side frame of the terminal 500 and/or underneath the display screen 505. When the pressure sensor 513 is disposed on the side frame of the terminal 500, a user's holding signal of the terminal 500 may be detected, and the processor 501 performs left-right hand recognition or shortcut operation according to the holding 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 control comprises 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 a 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 processor 501 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 514 may be provided on the front, back, or side of the terminal 500. When a physical button or a vendor Logo is provided on the terminal 500, the fingerprint sensor 514 may be integrated with the physical button 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 ambient light intensity collected by the optical sensor 515. Specifically, when the ambient light intensity is high, the display brightness of the display screen 505 is increased; when the ambient light intensity is low, the display brightness of the display screen 505 is reduced. In another embodiment, processor 501 may also dynamically adjust the shooting parameters of camera head assembly 506 based on the ambient light intensity collected by optical sensor 515.
A proximity sensor 516, also referred to as a distance sensor, is typically disposed on the front panel of the terminal 500. The proximity sensor 516 is used to collect the 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 surface of the terminal 500 gradually decreases, the processor 501 controls the display screen 505 to switch from the bright screen state to the dark screen state; when the proximity sensor 516 detects that the distance between the user and the front surface of the terminal 500 becomes gradually larger, the display screen 505 is controlled by the processor 501 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 5 is not intended to be limiting of terminal 500 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
In an exemplary embodiment, there is also provided a computer-readable storage medium, such as a memory, including instructions executable by a processor to perform the song list-based task processing method in the above-described embodiments. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an 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 instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A task processing method based on a song list is characterized by comprising the following steps:
receiving a processing task of the 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 through 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 list based on an idle thread in the thread pool.
2. The method of claim 1, wherein after receiving a processing task for a target song list and before adding the processing task to a thread pool queue, the method further comprises:
and if the processing task is an asynchronous task, adding the processing task to the data to be operated.
3. The method of claim 2, wherein after said processing said target song list based on idle threads in said thread pool, said method further comprises:
and if the processing task is finished, deleting the processing task from the data to be operated.
4. The method of claim 1, wherein after receiving the processing task for the target song list, the method further comprises:
detecting whether the target menu has an ongoing synchronization task;
and if the target song list has an ongoing synchronization task, executing the step of adding the processing task into a thread pool queue.
5. The method of claim 4, wherein said detecting whether said target song list has an ongoing synchronization task comprises:
and detecting whether the target song list has a locking mark, if so, the target song list has an ongoing synchronization task, otherwise, the target song list does not have the ongoing synchronization task.
6. A song list-based task processing apparatus, 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 tasks into a thread pool queue, and the thread pool queue is used for storing tasks to be processed through idle threads in a thread pool;
and the processing module is used for correspondingly processing the target song list based on an idle thread in the thread pool if the processing task is positioned at the head of the thread pool queue.
7. The apparatus of claim 6, further comprising:
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.
8. The apparatus of claim 7, further comprising:
and the deleting module is used for deleting the processing task from the data to be operated if the processing task is finished.
9. A computer device comprising one or more processors and one or more memories having stored therein at least one instruction that is loaded and executed by the one or more processors to perform operations performed by the song list based task processing method of any one of claims 1 to 5.
10. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor to perform operations performed by the song list-based task processing of any one of claims 1 to 5.
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 true CN111190751A (en) 2020-05-22
CN111190751B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037702A (en) * 2022-05-23 2022-09-09 北京梧桐车联科技有限责任公司 Message distribution method, data transmission method 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

Cited By (2)

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

Also Published As

Publication number Publication date
CN111190751B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN110308956B (en) Application interface display method and device and mobile terminal
CN111346376B (en) Interaction method and device based on multimedia resources, electronic equipment and storage medium
CN110569220B (en) Game resource file display method and device, terminal and storage medium
CN110007981B (en) Method and device for starting application program, electronic equipment and medium
CN110677713B (en) Video image processing method and device and storage medium
CN112966798B (en) Information display method and device, electronic equipment and storage medium
CN110868642B (en) Video playing method, device and storage medium
CN111986700A (en) Method, device, equipment and storage medium for triggering non-contact operation
CN111881423A (en) Method, device and system for limiting function use authorization
CN109107163B (en) Analog key detection method and device, computer equipment and storage medium
CN111258683A (en) Detection method, detection device, computer equipment and storage medium
CN111190751B (en) Task processing method and device based on song list, computer equipment and storage medium
CN112181915A (en) Method, device, terminal and storage medium for executing service
CN111711841B (en) Image frame playing method, device, terminal and storage medium
CN111464829B (en) Method, device and equipment for switching media data and storage medium
CN110941458B (en) Method, device, equipment and storage medium for starting application program
CN112015612B (en) Method and device for acquiring stuck information
CN113378154B (en) Application starting method and device
CN113220935B (en) Video data storage and query method and device
CN113064537B (en) Media resource playing method, device, equipment, medium and product
CN111522576B (en) Application management method, device, equipment and computer storage medium
CN114078583A (en) Method, device, equipment, storage medium and product for generating health service data
CN115827470A (en) Method, device, terminal, storage medium and product for positioning error reporting information
CN112181938A (en) Database cleaning method, device and computer readable 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