Data processing method, device, server and readable storage medium

By dynamically selecting the server's queue to provide sorted data, the problem of poor server sorting performance is solved, and more efficient data sorting is achieved.

CN114860189BActive Publication Date: 2024-11-01BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202110163166.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-05
Publication Date
2024-11-01
Estimated Expiration
2041-02-05

AI Technical Summary

Technical Problem

In existing technologies, the use of fixed queues during data sorting by servers leads to reduced throughput and poor sorting performance.

Method used

By determining whether the metric to be sorted is an existing metric, the system dynamically selects either the first or second queue to provide sorting data, thereby enhancing the flexibility and intelligence of the sorting data and avoiding a reduction in queue throughput.

Benefits of technology

It improves the efficiency of data sorting, enhances the flexibility and intelligence of sorting data, and maintains the throughput of the queue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860189B_ABST
    Figure CN114860189B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a data processing method, device, server and readable storage medium, the method comprising: obtaining an index to be sorted; judging whether the index to be sorted is an existing sorting index, and sending a data scheduling instruction to a first queue or a second queue based on the judgment result of the index to be sorted; controlling the first queue or the second queue to generate sorting data based on the index to be sorted based on the data scheduling instruction; and controlling the first queue or the second queue to provide the sorting data. In this way, compared with the method of providing sorting data only through a fixed queue, the method in the embodiment of the present invention is more flexible and will not reduce the throughput of the first queue and the second queue, thereby achieving a better sorting effect on the sorting data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, server and readable storage medium. Background Art

[0002] At present, with the development of electronic technology, electronic devices have played an increasingly important role in people's lives, and electronic devices will acquire and output a large amount of data during use. Therefore, in order for electronic devices to better acquire data, the server needs to sort the above data. However, in actual use, the inventor found that the prior art has the following problems: since the server usually uses a fixed queue to sort the data, this will lead to a decrease in data throughput, so that the server has a poor data sorting effect. Summary of the invention

[0003] The purpose of the embodiments of the present invention is to provide a data processing method, device, server and readable storage medium to solve the problem that the server has poor data sorting effect. The specific technical solution is as follows:

[0004] In a first aspect of the present invention, a data processing method is provided, comprising:

[0005] Get the index to be sorted;

[0006] Determine whether the to-be-sorted index is an existing sorting index, and send a data scheduling instruction to the first queue or the second queue based on the determination result of the to-be-sorted index;

[0007] Controlling the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction;

[0008] Control the first queue or the second queue to provide the sorted data.

[0009] In a second aspect of the present invention, a data processing device is provided, which is applied to a server. The data processing device includes:

[0010] The acquisition module is used to obtain the indicators to be sorted;

[0011] A judgment module, used for judging whether the to-be-sorted index is an existing sorting index, and sending a data scheduling instruction to the first queue or the second queue based on the judgment result of the to-be-sorted index;

[0012] A first control module, configured to control the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction;

[0013] The second control module is used to control the first queue or the second queue to provide the sorting data.

[0014] In another aspect of the present invention, a server is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0015] Memory, used to store computer programs;

[0016] The processor is used to implement any of the above-mentioned data processing methods when executing the program stored in the memory.

[0017] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the above-mentioned data processing methods.

[0018] In yet another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned data processing methods.

[0019] The data processing method provided in the embodiment of the present invention can determine whether the corresponding first queue or second queue provides sorting data based on the judgment result of whether the index to be sorted is an existing sorting index. Therefore, compared with the method of providing sorting data only through a fixed queue, the method in the embodiment of the present invention is more flexible and will not reduce the throughput of the first queue and the second queue, thereby achieving a better sorting effect on the sorting data. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0021] Figure 1 A flowchart of a data processing method provided by an embodiment of the present invention;

[0022] Figure 2 A flowchart of determining the state of a flag bit of a first queue in a data processing method provided by an embodiment of the present invention;

[0023] Figure 3 A flowchart of function switching between a first queue and a second queue in a data processing method provided in an embodiment of the present invention;

[0024] Figure 4 A flowchart of switching a sorting index in a data processing method provided by an embodiment of the present invention;

[0025] Figure 5 A schematic diagram of data sorting in a data processing method provided by an embodiment of the present invention;

[0026] Figure 6 A schematic diagram of the structure of a data processing device provided by an embodiment of the present invention;

[0027] Figure 7 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0029] See also Figure 1 , Figure 1 A flowchart of a data processing method provided by an embodiment of the present invention is as follows: Figure 1 As shown, the method comprises the following steps:

[0030] Step 101, obtaining the index to be sorted;

[0031] The index to be sorted may be obtained through a data interface in the server, and the data interface may be an interface between two modules in the server, which is not specifically limited here.

[0032] Wherein, as an optional implementation manner, the index to be sorted includes: any one of: playback volume, exposure volume, like volume and comment volume.

[0033] Among them, the exposure amount can be understood as the refresh amount. For example, when the pre-stored data is a video, the exposure amount can be understood as the total number of times the user refreshes to the video but does not wait until the video starts playing or the playing time is within the preset time, that is, refreshes to other videos.

[0034] In this way, since there are many types of indicators to be sorted, the way of sorting data based on the indicators to be sorted is more diversified and more flexible, thereby achieving a better data sorting effect.

[0035] Step 102: determine whether the to-be-sorted index is an existing sorting index, and send a data scheduling instruction to the first queue or the second queue based on the determination result of the to-be-sorted index;

[0036] Step 103: Based on the data scheduling instruction, control the first queue or the second queue to generate sorting data based on the to-be-sorted indicator;

[0037] Step 104: Control the first queue or the second queue to provide the sorted data.

[0038] The working principle of the embodiment of the present invention can be seen in the following description:

[0039] In the embodiment of the present invention, the first queue or the second queue corresponding to the sorting data can be determined according to the judgment result of whether the index to be sorted is an existing sorting index. Different judgment results correspond to different queues. In this way, compared with the method of providing sorting data through a fixed queue, the embodiment of the present invention can enhance the flexibility and intelligence of the method of providing sorting data, and will not reduce the throughput of the first queue and the second queue. At the same time, because different judgment results correspond to different queues, that is to say, each judgment result has a unique corresponding queue for providing sorting data, so that the sorting effect of the sorting data is better.

[0040] It should be noted that the correspondence between the judgment result and the queue is not specifically limited here. For example, as an optional implementation, when the judgment result is that the indicator to be sorted is not an existing sorting indicator, the second queue can be controlled to provide sorting data; when the indicator to be sorted is an existing sorting indicator, the first queue can be controlled to provide sorting data.

[0041] In addition, as another optional implementation, the sending of the data scheduling instruction to the first queue or the second queue based on the judgment result of the to-be-sorted indicator includes:

[0042] When the to-be-sorted index is not an existing sorting index, sending a first data scheduling instruction to the first queue, the flag bit of the first queue being a first identifier;

[0043] The controlling the first queue or the second queue to generate sorting data based on the to-be-sorted indicator based on the data scheduling instruction includes:

[0044] Assigning a value corresponding to the to-be-sorted index to the to-be-sorted data based on the first data scheduling instruction;

[0045] Controlling the first queue to sort the data to be sorted based on the value corresponding to the to-be-sorted indicator to generate first sorted data;

[0046] The controlling the first queue or the second queue to provide the sorted data comprises:

[0047] When the flag bit of the first queue is switched to the second flag, the first queue is controlled to provide the first sorted data.

[0048] In an implementation manner of the present invention, when the index to be sorted is not an existing sorting index, the data to be sorted can be first assigned a value corresponding to the index to be sorted, and the data to be sorted can be sorted based on the value corresponding to the index to be sorted to generate first sorting data, and then the first queue is controlled to provide the first sorting data. In this way, the first sorting data can be sorted based on the value corresponding to the index to be sorted, so that the sorting result of the first sorting data is more accurate.

[0049] It should be noted that the first identifier and the second identifier may be different, and when the flag of the first queue is the first identifier, the first queue may be used to sort the data. When the flag of the first queue is the second identifier, the first queue may be used to transmit data, for example, to receive data or to send data (also referred to as pop-up data).

[0050] It should be noted that the existing sorting index may refer to a sorting index that already exists locally, and the non-existing sorting index may refer to a sorting index that does not exist locally.

[0051] In addition, assigning the value corresponding to the to-be-sorted index to the to-be-sorted data may be executed by the first queue, and of course, may also be executed by other components, which is not specifically limited here.

[0052] In addition, when the data to be sorted is sorted, it can be sorted according to a priority strategy or a sorting strategy, and the above priority strategy or sorting strategy can be understood as: arranging in order from large to small or from small to large according to the corresponding numerical values.

[0053] In addition, the value corresponding to the index to be sorted can be called a model class, which can be generated according to the code generation library cglib. In this way, the accuracy of the value corresponding to the index to be sorted is higher and the generation method is simpler.

[0054] As another optional implementation, the sending of the data scheduling instruction to the first queue or the second queue based on the judgment result of the to-be-sorted indicator further includes:

[0055] When the to-be-sorted indicator is an existing sorting indicator, sending a second data scheduling instruction to the second queue;

[0056] The step of controlling the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction further includes:

[0057] Controlling the second queue to sort the data to be sorted based on the second data scheduling instruction to generate second sorted data;

[0058] The controlling the first queue or the second queue to provide the sorted data further includes:

[0059] When the flag bit of the second queue is the second identifier, the second queue is controlled to provide the second sorted data.

[0060] In the implementation manner of the present invention, when the index to be sorted is an existing sorting index, the second queue can be directly controlled to provide the second sorting data, so that the provision method of the sorting data when the index to be sorted is not an existing sorting index can be distinguished, and the flexibility and intelligence of the provision method of the sorting data can be enhanced. In addition, when the index to be sorted is an existing sorting index, the second queue can be directly controlled to provide the second sorting data, so that there is no need to assign a value to the data to be sorted, so that the provision speed of the second sorting data can also be improved.

[0061] It should be noted that the first identifier and the second identifier can refer to the corresponding descriptions in the above implementation manner, and will not be described in detail here.

[0062] For example: See Figure 4 , you can get the field name of the indicator to be sorted (which can also be understood as the value of the indicator to be sorted), and then use logic to determine whether the field name of the indicator to be sorted exists in the data to be sorted (that is, determine whether the field of the indicator to be sorted is a newly added field). If not, you need to assign the value corresponding to the indicator to be sorted to each piece of data to be sorted, call the sorting logic, and sort the data to be sorted according to the value corresponding to the indicator to be sorted. If yes, directly call the sorting logic and sort the data to be sorted according to the value corresponding to the indicator to be sorted.

[0063] The above-mentioned sorting logic may be the above-mentioned priority strategy or sorting strategy.

[0064] In addition, when each piece of data to be sorted has a value corresponding to the index to be sorted, when the sorting index is switched (for example: switching from the current sorting index to the index to be sorted), the corresponding field of the sorting index to be switched (that is, the index to be sorted) can be obtained by reflection, and then sorting can be performed according to the corresponding field.

[0065] It should be noted that when the data to be sorted does not have the value of the indicator to be sorted, but after each piece of data in the data to be sorted is assigned the value of the corresponding indicator to be sorted, before the data to be sorted is sorted based on the value of the indicator to be sorted, the sorting strategy can be obtained first, and then the data to be sorted can be sorted based on the sorting strategy and the value of the indicator to be sorted.

[0066] Similarly, when the data to be sorted has the value of the index to be sorted, before sorting the data to be sorted based on the value of the index to be sorted, the sorting strategy can also be obtained first, and then the pre-stored data can be sorted based on the sorting strategy and the value of the index to be sorted.

[0067] The above-mentioned sorting strategy may be a priority strategy, that is, it may include sorting from large to small according to the value of the index to be sorted, and sorting from small to large according to the value of the index to be sorted.

[0068] In addition, when sorting the data to be sorted according to the value of the to-be-sorted index, the value of the to-be-sorted index of a certain data can be compared with the values ​​of the to-be-sorted index of other data, so as to sort the data to the corresponding position. Figure 5 Each circle can represent a data, and the value in the circle can represent the value of the index to be sorted of the data, and the value indicated by the arrow can represent the matching order between the data and the data indicated by the circle. For example, if the value of the index to be sorted of a certain data is -1, it can be compared with the value in each circle in the order of 507, 506, 505, 504, 503, 502 and 501, and finally determine that -1 is less than 0. Therefore, the position of the data should be above the circle indicated by 501.

[0069] As an optional implementation, the data to be sorted includes: sorted data and incremental data based on the existing sorting index. In this way, since the data to be sorted includes sorted data and incremental data sorted based on the existing sorting index, the data to be sorted is more comprehensive, and the sorting result is more accurate.

[0070] Among them, data sorting can be understood as sorting by period, and the above-mentioned data to be sorted can be understood as data that needs to be sorted in the current period, and the sorting data based on the existing sorting indicators can be understood as the sorting data that has been sorted before the current period, and the incremental data can be understood as: when sorting the above-mentioned sorting data based on the existing sorting indicators, the newly received data (it can also be understood as the data newly received before the current period, but the data that did not participate in the sorting of the previous period).

[0071] In addition, since both the first queue and the second queue have flag bits, the functions of the first queue and the second queue can be determined by judging the state of the flag bit of at least one of the first queue and the second queue.

[0072] For example, the first queue can be priority queue A, the second queue can be priorityQueB, and the flag of the first queue can be called used_flag_A, and correspondingly, the flag of the second queue can be called used_flag_B. Figure 2When incremental data is received, the status of used_flag_A and / or used_flag_B can be judged, and the function of the queue corresponding to the flag bit in used_flag_A and used_flag_B that is in the correct (true) state can be determined as transmitting data, while the function of the queue corresponding to the flag bit in the error (false) state can be determined as sorting. For example: used_flag_A=false, used_flag_B=true, then the first queue is used to sort data, and the second queue is used to transmit data, so that the functions of the first queue and the second queue can be accurately and quickly determined.

[0073] It should be noted that transmitting data may refer to sending data or receiving data, and sorting data may refer to sorting data to be sorted.

[0074] It should be noted that the functions of the first queue and the second queue may be fixed, or they may be switched to each other.

[0075] For example, as an optional implementation, the controlling the first queue or the second queue to provide the sorting data further includes:

[0076] Starting from the moment when the flag bit of the first queue is determined to be the first identifier, after a preset period, the flag bit of the first queue is switched to the second identifier, and the flag bit of the second queue is switched from the second identifier to the first identifier.

[0077] The specific value of the preset period is not limited here, for example, it can be 10 milliseconds or 1 second, etc. In addition, the value of the preset period can be determined according to the time length for the first queue to complete sorting of the pre-stored data.

[0078] In this way, by switching the flag bits of the first queue and the second queue, the functions of the first queue and the second queue are switched, which makes it more flexible to provide sorted data and receive data. At the same time, the functions of the first queue and the second queue can be switched with each other. When one queue fails to sound, the other queue can also implement different functions through switching, thereby ensuring that different functions can be implemented normally, thereby making the stability of the functions better.

[0079] For example: after a preset period, the functions of the first queue and the second queue can be switched by reversing the states of the flag bits corresponding to the first queue and the second queue. Figure 3, the flag bits associated with the first queue and the second queue are reversed, that is, the original flag bit status is used_flagA = true, used_flagB = false, and after the reverse, it is used_flagA = false, used_flagB = true; then, in this way, the switching of the functions of the first queue and the second queue is completed. Of course, the functions of the first queue and the second queue can be switched again after a preset period, that is, the switching of the functions of the first queue and the second queue can be executed cyclically.

[0080] See also Figure 6 , Figure 6 A structural diagram of a data processing device is also provided for an embodiment of the present invention, such as Figure 6 As shown, the data processing device 600 includes:

[0081] The acquisition module 601 is used to acquire the index to be sorted;

[0082] A judgment module 602 is used to judge whether the to-be-sorted index is an existing sorting index, and send a data scheduling instruction to the first queue or the second queue based on the judgment result of the to-be-sorted index;

[0083] A first control module 603, configured to control the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction;

[0084] The second control module 604 is used to control the first queue or the second queue to provide the sorted data.

[0085] Optionally, the judgment module 602 is further configured to send a first data scheduling instruction to the first queue when the to-be-sorted index is not an existing sorting index, and the flag bit of the first queue is a first identifier;

[0086] The first control module 603 includes:

[0087] An assigning submodule, configured to assign a value corresponding to the to-be-sorted index to the to-be-sorted data based on the first data scheduling instruction;

[0088] A control submodule, used for controlling the first queue to sort the data to be sorted based on the value corresponding to the to-be-sorted index to generate first sorted data;

[0089] The second control module 604 is further configured to control the first queue to provide the first sorted data when the flag bit of the first queue is switched to a second flag.

[0090] Optionally, the judging module 602 is further configured to send a second data scheduling instruction to the second queue when the to-be-sorted indicator is an existing sorted indicator;

[0091] The first control module 603 is further configured to control the second queue to sort the data to be sorted based on the second data scheduling instruction to generate second sorted data;

[0092] The second control module 604 is further configured to control the second queue to provide the second sorted data when the flag bit of the second queue is a second identifier.

[0093] Optionally, the data to be sorted includes: sorted data based on the existing sorting index and incremental data.

[0094] Optionally, the second control module 604 further includes:

[0095] The switching submodule is used to switch the flag bit of the first queue to the second identifier and switch the flag bit of the second queue from the second identifier to the first identifier after a preset period starting from the moment when the flag bit of the first queue is determined to be the first identifier.

[0096] Optionally, the index to be sorted includes: any one of: playback volume, exposure volume, like volume and comment volume.

[0097] In this way, the data processing device provided by the embodiment of the present invention can also achieve a better sorting effect on sorted data.

[0098] The embodiment of the present invention also provides a server, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.

[0099] Memory 703, used for storing computer programs;

[0100] The processor 701 is used to execute the program stored in the memory 703 to implement the following steps:

[0101] Get the index to be sorted;

[0102] Determine whether the to-be-sorted index is an existing sorting index, and send a data scheduling instruction to the first queue or the second queue based on the determination result of the to-be-sorted index;

[0103] Controlling the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction;

[0104] Control the first queue or the second queue to provide the sorted data.

[0105] Optionally, the processor 701 executes the sending of a data scheduling instruction to the first queue or the second queue based on the judgment result of the to-be-sorted indicator, including:

[0106] When the to-be-sorted index is not an existing sorting index, sending a first data scheduling instruction to the first queue, the flag bit of the first queue being a first identifier;

[0107] The controlling the first queue or the second queue to generate sorting data based on the to-be-sorted indicator based on the data scheduling instruction includes:

[0108] Assigning a value corresponding to the to-be-sorted index to the to-be-sorted data based on the first data scheduling instruction;

[0109] Controlling the first queue to sort the data to be sorted based on the value corresponding to the to-be-sorted indicator to generate first sorted data;

[0110] The controlling the first queue or the second queue to provide the sorted data comprises:

[0111] When the flag bit of the first queue is switched to the second flag, the first queue is controlled to provide the first sorted data.

[0112] Optionally, the processor 701 executes the sending of a data scheduling instruction to the first queue or the second queue based on the judgment result of the to-be-sorted indicator, including:

[0113] When the to-be-sorted indicator is an existing sorting indicator, sending a second data scheduling instruction to the second queue;

[0114] The step of controlling the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction further includes:

[0115] Controlling the second queue to sort the data to be sorted based on the second data scheduling instruction to generate second sorted data;

[0116] The controlling the first queue or the second queue to provide the sorted data further includes:

[0117] When the flag bit of the second queue is the second identifier, the second queue is controlled to provide the second sorted data.

[0118] Optionally, the data to be sorted includes: sorted data based on the existing sorting index and incremental data.

[0119] Optionally, the controlling the first queue or the second queue to provide the sorting data executed by the processor 701 further includes:

[0120] Starting from the moment when the flag bit of the first queue is determined to be the first identifier, after a preset period, the flag bit of the first queue is switched to the second identifier, and the flag bit of the second queue is switched from the second identifier to the first identifier.

[0121] Optionally, the index to be sorted includes: any one of: playback volume, exposure volume, like volume and comment volume.

[0122] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0123] The communication interface is used for communication between the above terminal and other devices.

[0124] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0125] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0126] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the data processing method described in any one of the above embodiments.

[0127] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the data processing method described in any one of the above embodiments.

[0128] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

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

[0130] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0131] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A data processing method, characterized in that: Applied to a server, the method comprises: Get the index to be sorted; Determine whether the to-be-sorted index is an existing sorting index, and send a data scheduling instruction to the first queue or the second queue based on the determination result of the to-be-sorted index; Controlling the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction; Controlling the first queue or the second queue to provide the sorted data; The sending of the data scheduling instruction to the first queue or the second queue based on the judgment result of the to-be-sorted indicator includes: When the to-be-sorted index is not an existing sorting index, sending a first data scheduling instruction to the first queue, the flag bit of the first queue being a first identifier; In a case where the to-be-sorted index is an existing sorting index, a second data scheduling instruction is sent to the second queue.

2. The method according to claim 1, characterized in that The controlling the first queue or the second queue to generate sorting data based on the to-be-sorted indicator based on the data scheduling instruction includes: Assigning a value corresponding to the to-be-sorted index to the to-be-sorted data based on the first data scheduling instruction; Controlling the first queue to sort the data to be sorted based on the value corresponding to the to-be-sorted indicator to generate first sorted data; The controlling the first queue or the second queue to provide the sorted data comprises: When the flag bit of the first queue is switched to the second flag, the first queue is controlled to provide the first sorted data.

3. The method according to claim 1, characterized in that The step of controlling the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction further includes: Controlling the second queue to sort the data to be sorted based on the second data scheduling instruction to generate second sorted data; The controlling the first queue or the second queue to provide the sorted data further includes: When the flag bit of the second queue is the second identifier, the second queue is controlled to provide the second sorted data.

4. The method according to claim 2 or 3, characterized in that: The data to be sorted includes: sorted data based on the existing sorting index and incremental data.

5. The method according to claim 2 or 3, characterized in that: The controlling the first queue or the second queue to provide the sorted data further includes: Starting from the moment when the flag bit of the first queue is determined to be the first identifier, after a preset period, the flag bit of the first queue is switched to the second identifier, and the flag bit of the second queue is switched from the second identifier to the first identifier.

6. The method according to claim 1, characterized in that The index to be sorted includes: any one of the number of views, the number of exposures, the number of likes and the number of comments.

7. A data processing device, characterized in that: Applied to a server, the data processing device comprises: The acquisition module is used to obtain the indicators to be sorted; A judgment module, used for judging whether the to-be-sorted index is an existing sorting index, and sending a data scheduling instruction to the first queue or the second queue based on the judgment result of the to-be-sorted index; A first control module, configured to control the first queue or the second queue to generate sorted data based on the to-be-sorted indicator based on the data scheduling instruction; A second control module, used for controlling the first queue or the second queue to provide the sorting data; The judgment module is further configured to send a first data scheduling instruction to the first queue when the to-be-sorted index is not an existing sorting index, and the flag bit of the first queue is a first identifier; The judgment module is further configured to send a second data scheduling instruction to the second queue when the to-be-sorted indicator is an existing sorting indicator.

8. The data processing device according to claim 7, characterized in that: The first control module comprises: An assigning submodule, configured to assign a value corresponding to the to-be-sorted index to the to-be-sorted data based on the first data scheduling instruction; A control submodule, used for controlling the first queue to sort the data to be sorted based on the value corresponding to the to-be-sorted index to generate first sorted data; The second control module is further configured to control the first queue to provide the first sorting data when the flag bit of the first queue is switched to a second flag.

9. A server, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.

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

Citation Information

Patent Citations

  • Data storage device, control unit and task sorting method thereof

    CN107305504A

  • Content feature query method and device, computer equipment and storage medium

    CN108763458A

  • Remote control method and device for APP, electronic equipment and system

    CN110113495A

  • Task scheduling method and device, electronic equipment and computer readable storage medium

    CN110837410A

  • Video interaction data processing method and device, electronic equipment and storage medium

    CN111988669A