Data processing method, device, electronic device and storage medium

By determining the read strategy based on the size of the evaluation index in the Zset data structure of Redis, the problem of mutual coverage when writing Redis data in a high-concurrency environment is solved, and timely updating of data and high-performance reading and writing are achieved.

CN113986936BActive Publication Date: 2024-10-29BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111224338.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-19
Publication Date
2024-10-29
Estimated Expiration
2041-10-19

AI Technical Summary

Technical Problem

In a high-concurrency environment, existing cache components such as Redis and Memcache are prone to overwriting each other when writing data, leading to data conflicts. Existing solutions such as distributed locks, message queues, and transaction mechanisms have performance bottlenecks or logic Complexity, unable to effectively resolve data conflicts in concurrent environments.

Method used

By responding to the user's data update operation in the Zset data structure of Redis, determining the characteristic identifier and evaluation index of the element indicated by the data update operation, determining the reading strategy based on the size of the evaluation index, and reading the target evaluation in the target data storage unit. Indicators realize updating and reading of data storage units, solving the problem of data conflicts in concurrent environments.

Benefits of technology

It effectively solves the problem of data conflicts in a concurrent environment, improves the performance of the data reading and writing interface, avoids the problem of data not being updated in time, and is suitable for high-concurrency and large-flow scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986936B_ABST
    Figure CN113986936B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a data processing method, device, electronic device and storage medium, in which: responding to a user's data update operation, and determining the characteristic identification and evaluation index of the element indicated by the data update operation; the evaluation index characterizes the order of the elements in the element set, and the characteristic identification of each element in an element set is the same as the characteristic identification of the element set; adding the evaluation index of the element indicated by the update operation to the data storage unit matching the characteristic identification; if a read instruction is detected, identifying the read instruction to determine the target characteristic identification; determining the target element set corresponding to the target characteristic identification and the target data storage unit storing the evaluation index of each element in the target element set; reading the target evaluation index in the target data storage unit according to the read strategy determined based on the size of the evaluation index. The problem of data concurrency conflict caused when multiple data update operations occur simultaneously is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] For user-oriented applications, in scenarios with high concurrency and large flow fields, high-performance cache components are usually used to cope with high-frequency read and write operations.

[0003] Common cache components are Redis and Memcache, which are both KV memory databases with one-to-one correspondence between key and value. When operating the application, there is no judgment when writing KV data, so there will be a phenomenon of mutual overwriting, so there will be conflicts for data writing in a concurrent environment.

[0004] In the related technologies, the solutions to this problem usually have the following problems: in the distributed lock solution, all concurrent threads compete for the same lock, which will cause performance bottlenecks and occupy additional resources, and cannot be used in production environments; in the message queue solution, the parallel to serial operation causes the data update operation to slow down, which will make the cache data not timely enough; in the solution using the transaction mechanism in Redis, the implementation logic is complex, prone to errors, and the performance is not high; in the solution of replacing other cache components or changing the Redis source code, the problem cannot be fundamentally solved. Therefore, it is particularly important to solve the data conflict problem in a concurrent environment. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, device, electronic device and storage medium, thereby solving the problem of data conflict in a concurrent environment.

[0006] In a first aspect, an embodiment of the present application provides a data processing method, including:

[0007] Responding to a data update operation of a user, and determining a feature identifier and an evaluation index of an element indicated by the data update operation; wherein the evaluation index represents the order of the element in an element set, and the feature identifier of each element in an element set is the same as the feature identifier of the element set;

[0008] Adding the evaluation index of the element indicated by the data update operation to the data storage unit in the database that matches the feature identifier; wherein the database includes at least one data storage unit; each data storage unit stores the evaluation index of each element in an element set;

[0009] If a read instruction is detected, identifying the read instruction to determine a target feature identifier;

[0010] Determine a target element set corresponding to the target feature identifier, and a target data storage unit storing evaluation indicators of each element in the target element set;

[0011] The target evaluation index in the target data storage unit is read according to a reading strategy determined based on the size of the evaluation index.

[0012] In some exemplary embodiments, if the read strategy determined based on the size of the evaluation index is to read the largest evaluation index, then the reading of the evaluation index in the target data storage unit includes:

[0013] The maximum evaluation index in the target data storage unit is read.

[0014] In some exemplary embodiments, reading the maximum evaluation index in the target data storage unit includes:

[0015] Sending an element read command to the database, wherein the element read command includes a read start character and a read end character, and the read start character and the read end character are both determined according to the maximum evaluation index in the target data storage unit;

[0016] The maximum evaluation index is read according to the read start character and the read end character.

[0017] In some exemplary embodiments, adding the evaluation index of the element indicated by the data update operation to the data storage unit matching the feature identifier includes:

[0018] Sending an element adding command to the database, wherein the element adding command includes an evaluation index of the element indicated by the data updating operation and a feature identifier of the element indicated by the data updating operation;

[0019] Determine a data storage unit that matches a characteristic identifier of an element indicated by the data update operation;

[0020] The evaluation index of the element indicated by the data update operation is added to the data storage unit matching the feature identifier.

[0021] In some exemplary embodiments, before reading the target evaluation index in the target data storage unit according to the reading strategy determined based on the size of the evaluation index, the method further includes:

[0022] For each data storage unit, eliminating evaluation indicators other than the maximum evaluation indicator in the data storage unit;

[0023] The reading strategy determined based on the size of the evaluation index is to read the evaluation index in the target data storage unit after the elimination operation;

[0024] Reading the target evaluation index in the target data storage unit according to a reading strategy determined based on the size of the evaluation index includes:

[0025] In the target data storage unit after the culling operation, the remaining evaluation index in the target data storage unit is read.

[0026] In some exemplary embodiments, for each data storage unit, eliminating evaluation indicators other than the maximum evaluation indicator in the data storage unit includes:

[0027] For each data storage unit, an element filtering command is sent to the data storage unit by sending the element filtering command to the database; wherein the element filtering command includes a filtering start character and a filtering end character, the filtering start character is determined according to the minimum evaluation index in the data storage unit, and the filtering end character is determined according to the second largest evaluation index in the data storage unit;

[0028] The filter start character and the filter end character are applied to remove evaluation indicators other than the maximum evaluation indicator in the data storage unit.

[0029] In some exemplary embodiments, after reading the target evaluation index in the target data storage unit, the method further includes:

[0030] Display the target elements corresponding to the target evaluation indicators.

[0031] In a second aspect, an embodiment of the present application provides a data processing device, including:

[0032] A first determining unit is configured to execute a data update operation in response to a user, and determine a feature identifier and an evaluation index of an element indicated by the data update operation; wherein the evaluation index represents an order of the element in an element set, and the feature identifier of each element in an element set is the same as the feature identifier of the element set;

[0033] An adding unit is configured to add the evaluation index of the element indicated by the data update operation to a data storage unit in the database that matches the feature identifier; wherein the database includes at least one data storage unit; each data storage unit stores the evaluation index of each element in an element set;

[0034] An instruction recognition unit, configured to recognize the read instruction to determine a target feature identifier when a read instruction is detected;

[0035] A second determining unit is configured to determine a target element set corresponding to the target feature identifier, and a target data storage unit storing an evaluation index of each element in the target element set;

[0036] The reading unit is configured to execute a reading strategy determined based on the size of the evaluation indicator to read the target evaluation indicator in the target data storage unit.

[0037] In some exemplary embodiments, if the reading strategy determined based on the size of the evaluation index is to read the largest evaluation index, the reading unit is specifically configured to execute:

[0038] The maximum evaluation index in the target data storage unit is read.

[0039] In some exemplary embodiments, the reading unit is specifically configured to perform:

[0040] Sending an element read command to the database, wherein the element read command includes a read start character and a read end character, and the read start character and the read end character are both determined according to the maximum evaluation index in the target data storage unit;

[0041] The maximum evaluation index in the target data storage unit is read according to the read start character and the read end character.

[0042] In some exemplary embodiments, the adding unit is configured to perform:

[0043] Sending an element adding command to the database, wherein the element adding command includes an evaluation index of the element indicated by the data updating operation and a feature identifier of the element indicated by the data updating operation;

[0044] Determine a data storage unit that matches a characteristic identifier of an element indicated by the data update operation;

[0045] The evaluation index of the element indicated by the data update operation is added to the data storage unit matching the feature identifier.

[0046] In some exemplary embodiments, a filtering unit is further included, and before reading the target evaluation index in the target data storage unit according to the reading strategy determined based on the size of the evaluation index, the filtering unit is configured to execute:

[0047] For each data storage unit, eliminating evaluation indicators other than the maximum evaluation indicator in the data storage unit;

[0048] The reading strategy determined based on the size of the evaluation index is to read the evaluation index in the target data storage unit after the elimination operation;

[0049] Reading the target evaluation index in the target data storage unit according to a reading strategy determined based on the size of the evaluation index includes:

[0050] In the target data storage unit after the culling operation, the remaining evaluation index in the target data storage unit is read.

[0051] In some exemplary embodiments, the filtering unit is specifically configured to perform:

[0052] For each data storage unit, an element filtering command is sent to the data storage unit by sending the element filtering command to the database; wherein the element filtering command includes a filtering start character and a filtering end character, the filtering start character is determined according to the minimum evaluation index in the data storage unit, and the filtering end character is determined according to the second largest evaluation index in the data storage unit;

[0053] The filter start character and the filter end character are applied to remove evaluation indicators other than the maximum evaluation indicator in the data storage unit.

[0054] In some exemplary embodiments, a display unit is further included. After reading the target evaluation index in the target data storage unit, the display unit is configured to execute:

[0055] Display the target elements corresponding to the target evaluation indicators.

[0056] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0057] processor;

[0058] a memory for storing instructions executable by the processor;

[0059] The processor is configured to execute the instructions to implement any one of the methods provided in the first aspect of the present application.

[0060] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any method provided in the first aspect of the present application.

[0061] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implements any of the methods provided in the first aspect of the present application.

[0062] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0063] While responding to the user operation, the characteristic identification and evaluation index of the element indicated by the user operation are determined; since the evaluation index can characterize the order of the elements in the element set, and the characteristic identification of each element in an element set is the same as the characteristic identification of the element set, the order of the target element in the element set corresponding to the characteristic identification can be determined through the user's data update operation, and then the evaluation index of the element indicated by the update operation is added to the data storage unit matching the characteristic identification in the database, thus realizing the update of the data storage unit. When the read command is detected, the read instruction is identified to determine the target characteristic identification, and then the target element set corresponding to the target characteristic identification is further determined, and the target data storage unit storing the evaluation index of each element in the target element set is stored; the evaluation index is read in the target data storage unit according to the reading strategy determined based on the size of the evaluation index. In this way, since the reading strategy is determined based on the determination of the evaluation index, even if there are multiple data update operations at the same time in a short period of time, the evaluation index can be read based on the size of the evaluation index as the reading criterion, solving the problem of data conflict in a concurrent environment.

[0064] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0066] Figure 1 A schematic diagram of an application scenario of a data processing method provided in one embodiment of the present application;

[0067] Figure 2 An application scenario diagram of a data processing method provided in one embodiment of the present application;

[0068] Figure 3 A flowchart of a data processing method provided in one embodiment of the present application;

[0069] Figure 4 A schematic diagram of an element structure provided in one embodiment of the present application;

[0070] Figure 5A schematic diagram of another element structure provided in an embodiment of the present application;

[0071] Figure 6 A schematic diagram of another element structure provided in an embodiment of the present application;

[0072] Figure 7 A schematic diagram of another element structure provided in an embodiment of the present application;

[0073] Figure 8 An application scenario diagram of a data processing method provided in one embodiment of the present application;

[0074] Fig. 9 A block diagram of a data processing device provided in one embodiment of the present application;

[0075] Fig.10 A schematic diagram of an electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION

[0076] In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0077] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0078] Below, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.

[0079] (1) In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.

[0080] (2) "and / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0081] (3) Servers provide services for terminals. The services provided include providing resources to terminals and storing terminal data. Servers correspond to applications installed on terminals and work in conjunction with applications on terminals.

[0082] (4) Terminal device, which can refer to software APP (Application) or client. It has a visual display interface and can interact with users; it corresponds to the server and provides local services to customers. For software applications, except for some applications that only run locally, they are generally installed on ordinary client terminals and need to cooperate with the server to run. After the development of the Internet, more commonly used applications include email clients for sending and receiving emails, and instant messaging clients. For this type of application, there needs to be corresponding servers and service programs in the network to provide corresponding services, such as database services, configuration parameter services, etc. In this way, specific communication connections need to be established between the client terminal and the server to ensure the normal operation of the application.

[0083] (5) Redis: An open source, network-enabled, memory-based, distributed, and optionally persistent key-value storage database written in ANSI C (American National Standards Institute C).

[0084] (6)Memcache: An open source, high-performance, distributed, memory-based key-value database.

[0085] (7)Zset: A data structure in Redis, an ordered set.

[0086] (8) Rpc (Remote Procedure Call) refers to a node in a network environment requesting a service provided by another node.

[0087] (9) Qps (Queries Per Second): The number of requests that can be processed per second.

[0088] (10) High concurrency: An environment where a large number of network requests are received at the same time or in a very short period of time.

[0089] (11) Distributed: A system consisting of a group of computer nodes that communicate through a network and coordinate their work to complete a common task.

[0090] (12) Transaction: A sequence of database operations that access and possibly manipulate various data items. These operations are either all executed or none of them, and are an indivisible unit of work.

[0091] (13) Idempotence: The impact of any number of executions is the same as the impact of a single execution.

[0092] (14) Synchronization: After submitting a request, wait for the operation to be fully executed before returning the execution result to the user.

[0093] (15) Asynchronous: After submitting a request, the execution result is not waited for. The submitter cannot perceive the execution result.

[0094] In actual practice, for user-oriented applications, in scenarios with high concurrency and large flow fields, high-performance cache components are usually used to cope with high-frequency read and write operations.

[0095] Taking the scenario of video APP (Application) as an example, at a certain entrance of the video APP, for the TV series watched by the user, the latest episodes watched need to be recorded and displayed on the APP page. For example, if the user watched episodes 1, 2, 5, 6, and 8 of a TV series, then the latest episode watched is 8; if the user does not watch the series in the normal order, but watches episodes 3, 1, 5, 7, and 2 in sequence, then the latest episode watched is 7, which is the largest value. Because this value needs to be frequently read and displayed on the front-end page, this requires the server interface to respond quickly, so this part of the data is put into a high-performance in-memory database (cache), and each read and write (query / update the user's latest episode) is an operation cache.

[0096] The commonly used cache components in the industry are Redis and Memcache. Both are kv memory databases with one-to-one correspondence between keys and values, and their structure is simple and easy to use.

[0097] When watching a TV series on the App, users switch episodes by swiping up and down. Users may not be interested in all episodes. They may keep swiping the page, and the swiping speed may be very fast. Therefore, they will frequently request the server interface and continuously send update commands to the Redis cache. There will be concurrency conflicts in the update operation of the latest episode of the same series: if the user clicks on episode 7 and episode 8 at the same time in a short period of time, two commands will be sent to the Redis server. Due to the uncertainty of network transmission, the latter command may arrive before the former command. Therefore, Redis will first write episode id=8 to value, and then update the late episode id=7 to value. This is different from the expected result. The expected result is that the largest id is recorded in Redis, but id=7 overwrites the value of id=8. When the user refreshes the APP page, he will see wrong data and see that the latest episode he watched (the largest episode) is episode 7 instead of episode 8. Reference Figure 1 , showing the latest episode you have watched to users.

[0098] The fundamental reason for this problem is that Redis does not make any judgment when writing kv data, so there will be a phenomenon of mutual overwriting. The same is true for the same type of Memcache cache. This is a common feature of kv memory databases, and there will be conflicts when writing data in a concurrent environment.

[0099] In addition to the application scenarios mentioned above, there are many common functions and scenarios that will encounter this problem. In the relevant technologies, there are probably the following solutions:

[0100] (1) Distributed lock: Before each update request reaches the Redis server, it needs to obtain a global lock first. The thread that grabs the lock can set $userId_$tvId$episodeId. Otherwise, it needs to wait for other threads to release the lock before competing for the lock. Advantages: It can solve the problem of critical resources and prevent the value of the same key in Redis from being overwritten. Disadvantages: Because all concurrent threads compete for the same lock, performance bottlenecks will occur and additional resources will be occupied, which cannot be used in a production environment.

[0101] (2) Message queue: Use the message queue component to serialize all update requests, queue them up and process them one by one, so that only one update request will operate the Redis server at the same time. Advantages: Because the requests are processed serially, there is no concurrency and no data conflict. Disadvantages: The originally parallel requests become serial after manual intervention, and in the serial logic, each time before sending a set command to Redis, it is necessary to use the get command to obtain the value of the key for pre-judgment (to determine whether the current set id is greater than the set id in Redis). Therefore, the update operation will inevitably be slower, which will make the cached data not timely enough, and will result in the old latest set id always being seen on the APP page.

[0102] (3) Use the transaction mechanism in Redis: Use the watch-multi-exec mechanism in Redis to watch the key each time a set operation is performed to prevent the key from being changed. Advantages: This solution can reduce the probability of key values ​​being overwritten to a certain extent. Disadvantages: Transactions in Redis are not real transactions. In extreme cases, concurrency conflicts may still occur. Moreover, the implementation logic is complex, prone to errors, and has low performance (because the entire process involves several commands and several RPC round trips).

[0103] (4) Use other cache components or change the Redis source code. Disadvantages: Other cache components such as Memcache also have similar defects and cannot avoid data conflicts in concurrent environments. As for changing the Redis source code to allow its set command to support pre-judgment, the problem can be solved in theory, but it requires R&D personnel to be quite familiar with the Redis source code and to ensure that the changes will not affect the functions of other commands, which is difficult to implement.

[0104] To this end, the present application utilizes a special data structure Zset in Redis, and utilizes the ordered nature of Zset and the atomic execution of commands by Redis to provide a data processing method, which is specifically implemented as follows: respond to a user's data update operation (the user clicks on a certain episode), and determine the feature identifier (Zhang San, Journey to the West) and evaluation index (ID=8) of the element indicated by the data update operation (such as the 8th episode); wherein the evaluation index represents the order of the elements in the element set, and the feature identifiers of each element set are different; the evaluation index of the element indicated by the data update operation is added to a data storage unit in the database that matches the feature identifier; wherein the database includes at least one data storage unit; if a read instruction is detected, the read instruction is identified to determine the target feature identifier; determine the target element set corresponding to the target feature identifier, and the target data storage unit that stores the evaluation index of each element in the target element set; read the target evaluation index in the target data storage unit according to a read strategy determined based on the size of the evaluation index.

[0105] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0106] refer to Figure 2 , which is a schematic diagram of an application scenario of the data processing method provided in an embodiment of the present application. The application scenario includes multiple terminal devices 201 (including terminal device 201-1, terminal device 201-2, ... terminal device 201-n) and a server 202. Among them, the terminal device 201 and the server 202 are connected via a wireless or wired network, and the terminal device 201 includes but is not limited to electronic devices such as desktop computers, mobile phones, mobile computers, tablet computers, media players, smart wearable devices, smart TVs, etc. The server 202 can be a server cluster or a cloud computing center composed of a server, a number of servers. The server 202 can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0107] The server 202 responds to the user's data update operation, and determines the feature identifier and evaluation index of the element indicated by the data update operation; adds the evaluation index of the element indicated by the data update operation to the data storage unit in the database that matches the feature identifier; if a read instruction is detected, identifies the read instruction to determine the target feature identifier; determines the target element set corresponding to the target feature identifier, and the target data storage unit that stores the evaluation index of each element in the target element set; reads the target evaluation index in the target data storage unit according to the reading strategy determined based on the size of the evaluation index, and displays the read target evaluation index and the corresponding target element through the terminal device. For example, the server sends the read evaluation index and target element to the terminal device 201-1 according to the read instruction of the user 201, and displays the read evaluation index and target element through the terminal device 201-1.

[0108] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1 The functions that can be implemented by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here.

[0109] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided in the embodiment of the present application.

[0110] Combine the following Figure 1 The application scenario shown illustrates the technical solution provided by the embodiment of the present application.

[0111] refer to Figure 3 , the present application embodiment provides a data processing method, comprising the following steps:

[0112] S301, responding to a user's data update operation, and determining a feature identifier and an evaluation index of an element indicated by the data update operation; wherein the evaluation index represents the order of the target element in an element set, and the feature identifier of each element in an element set is the same as the feature identifier of the element set.

[0113] S302. Add the evaluation index of the element indicated by the update operation to the data storage unit in the database that matches the feature identifier; wherein the database includes at least one data storage unit; and each data storage unit stores the evaluation index of each element in an element set.

[0114] S303: If a read instruction is detected, identify the read instruction to determine a target feature identifier.

[0115] S304: Determine a target element set corresponding to the target feature identifier and a target data storage unit storing an evaluation index of each element in the target element set.

[0116] S305 . Read the target evaluation index in the target data storage unit according to the reading strategy determined based on the size of the evaluation index.

[0117] In the embodiment of the present application, while responding to the user operation, the characteristic identification and evaluation index of the element indicated by the user operation are determined; since the evaluation index can characterize the order of the elements in the element set, and the characteristic identification of each element in an element set is the same as the characteristic identification of the element set, the order of the target element in the element set corresponding to the characteristic identification can be determined by the user's data update operation. Then the evaluation index of the element indicated by the update operation is added to the data storage unit matching the characteristic identification in the database, so that the data storage unit is updated, and then when the read command is detected, the read instruction is identified to determine the target characteristic identification, and then the target element set corresponding to the target characteristic identification is further determined, and the target data storage unit storing the evaluation index of each element in the target element set is stored; the evaluation index is read in the target data storage unit according to the reading strategy determined based on the size of the evaluation index. In this way, since the reading strategy is determined based on the determination of the evaluation index, even if there are multiple data update operations at the same time in a short period of time, the evaluation index can be read based on the size of the evaluation index as the reading criterion, solving the problem of data conflict in a concurrent environment.

[0118] Involving S301, in the embodiment of the present application, data processing is mainly implemented in the Zset structure of the Redis database. Still taking the above-mentioned video APP as an example, each episode of a TV series is called an element, and a whole TV series consisting of multiple episodes of a TV series is called an element set. The characteristic identifier of each element in each element set is the same as the characteristic identifier of the element set, and the characteristic identifiers of different element sets are different. The evaluation index is, for example, the number of episodes of a TV series, and the characteristic identifier of an element can be a user identifier and a TV series identifier. In this way, for example, Zhang San + TV series A corresponds to an element set, and Li Si + TV series B corresponds to another element set.

[0119] Specifically, in a scenario where a user updates data, for example, user Zhang San clicks on the icon of episode 8 of TV series A, indicating that the user wants to watch episode 8. Prior to this, the database stores the episodes of TV series A that Zhang San has clicked to watch, such as episodes 1 to 7. In actual applications, users may not watch consecutively, in which case episodes 1, 2, 3, and 6 may be stored in the database.

[0120] In this step, from the perspective of the server, data update operations of different users can be responded to at the same time. From the perspective of the user, the same user clicks on episode 7 and episode 8 at the same time in a short period of time, and the server also responds to the two data update operations of the user.

[0121] Taking user Zhang San as an example, since analyzing the operation of user Zhang San can determine which episode, which point data, and who operated the target element indicated by the operation, the feature identifier of the target element is Zhang San + TV series A, and the target element is episode 8.

[0122] Regarding S302, since the server needs to process requests from a large number of users, the database usually includes multiple data storage units, each of which stores evaluation indicators of each element in an element set, and the feature identifiers of the elements stored in each storage unit are the same. For example, TV series A watched by Zhang San is stored in one data storage unit, and TV series B watched by Li Si is stored in another data storage unit, and the various data storage units constitute a database.

[0123] After responding to the user's data update operation, the evaluation index of the element indicated by the data update operation is added to the data storage unit in the database that matches the feature identifier. For example, if the user's feature identifier is Zhang San+TV series A, the evaluation index of episode 8 is added to the data storage unit corresponding to Zhang San+TV series A.

[0124] In actual application, the element adding process can be implemented in the following ways:

[0125] An element adding command is sent to a database, wherein the element adding command includes an evaluation index of the element indicated by a data updating operation and a feature identifier of the element indicated by the data updating operation; a data storage unit matching the feature identifier of the element indicated by the data updating operation is determined; and the evaluation index of the element indicated by the data updating operation is added to the data storage unit matching the feature identifier.

[0126] Exemplarily, the format of the element adding command is zadd$key$score$member, where zadd is a keyword, indicating that the function of the command is to add an element; $key is a feature identifier, indicating the characteristics of the element set to which the element belongs, such as the set of episodes of which TV series is watched by which user; $score is an evaluation index, which indicates the order of each element in the element set, such as the higher the order in the set, the smaller the evaluation index, such as setting a weight or score for each episode, which is positively correlated with the order of the element in the set, the later the order, the larger the evaluation index, and in the actual application process, the evaluation index can also be directly represented by the number of episodes. $member is the unique identifier of the element, which can be represented by the number of episodes in this example, or by other identifiers. The corresponding relationship between the unique identifier of the element and the evaluation index of the element can be pre-stored in the database, so $member in the adding command is an optional option, which can be set according to the actual situation in the actual application process. In addition, since the server needs to determine whether the addition is successful, the way to send the element adding command can be synchronous.

[0127] In this way, the characteristic identifier of the element indicated by the data update operation can determine which data storage unit it belongs to, and then the evaluation index of the element triggered by the corresponding user is added to the data storage unit, so that the evaluation index of each element can be referenced when the data is read subsequently.

[0128] In S303, if a read instruction is detected, the read instruction is identified to determine the target feature identifier. Exemplarily, the read instruction can be generated in the following ways. For example, if there is no operation on the current interface within a preset time, a read instruction can be generated; or, if the user double-clicks the current display page, a read instruction can be generated. In both ways, it is indicated that the user has a demand. At this time, the server can identify the read instruction to determine the target feature identifier. In this way, it is possible to know which user operates on which data unit, such as the determined target feature identifier is Zhang San + Journey to the West.

[0129] In S304, since each data storage unit stores the evaluation index of each element in an element set, and each element set has a feature identifier, and the feature identifier of the element set is the same as the feature identifier of each element in the set, after determining the target feature identifier, the target element set corresponding to the target feature identifier can be determined according to the correspondence between the feature identifier and the element set, and the target data storage unit storing the evaluation index of each element in the target element set can be determined according to the correspondence between the target element set and the data storage unit.

[0130] In S305, the target evaluation index in the target data storage unit is read according to the reading strategy determined based on the size of the evaluation index.

[0131] During the data reading process, a reading strategy can be determined based on the size of the evaluation index, and the target evaluation index in the target data storage unit can be read according to the reading strategy. In a specific example, the evaluation index is the number of episodes of a TV series, and the target evaluation index is the 9th episode. After the target evaluation index is read, the target element corresponding to the target evaluation index (such as the content of the 9th episode) is displayed to the user.

[0132] In the actual application process, the reading strategy determined based on the size of the evaluation index is to read the largest evaluation index, in this case, it can be the largest evaluation index in the target data storage unit. In this way, no matter how many evaluation indicators are in the corresponding target data storage unit, the latest element can be displayed to the user as long as the largest evaluation index is read.

[0133] Optionally, the reading process can be implemented in the following manner: sending an element read command to the database, wherein the element read command includes a read start character and a read end character, and the read start character and the read end character are both determined based on the maximum evaluation index in the target data storage unit; and reading the maximum evaluation index in the target data storage unit based on the read start character and the read end character.

[0134] Exemplarily, the format of the element read command can be zrange$key$start$stop, where zrange is a keyword, indicating that the function of this command is element read; $key is a feature identifier, indicating the attribute of the element set to which the element to be read belongs; $start and $stop are read identifiers. In this example, $start takes the evaluation index -1 as the read start symbol, and $stop takes the evaluation index -1 as the read end symbol. In this way, this command can realize the reading of the maximum evaluation index in the corresponding target data storage unit.

[0135] In this way, by sending an element reading command to the database, the function of reading the maximum evaluation index can be configured in the element reading command, thereby realizing the reading of the maximum evaluation index.

[0136] The above operation can realize the reading of the maximum evaluation index, but in order to save memory, the evaluation index of unnecessary elements can also be deleted, and only the maximum evaluation index is retained. The deletion operation can occur after adding and before reading. Specifically, for each data storage unit, the evaluation indexes other than the maximum evaluation index in the data storage unit are eliminated; at this time, since only the largest evaluation index is left in the corresponding data storage unit, the reading strategy determined based on the size of the evaluation index is to read the evaluation index in the target data storage unit after the elimination operation. Therefore, during the reading process, in the target data storage unit after the elimination operation, the remaining evaluation index in the target data storage unit is read, and the evaluation index read is the maximum evaluation index. In addition, since the server does not need to determine whether the deletion is successful, the method of sending the element addition command can be asynchronous.

[0137] In this way, only the largest evaluation index is retained through the elimination operation, which not only saves memory but also solves the problem of data concurrency conflict.

[0138] Specifically, element deletion can be achieved in the following way: for each data storage unit, an element filtering command is sent to the data storage unit by sending the element filtering command to the database; wherein, the element filtering command includes a filtering start character and a filtering end character, the filtering start character is determined according to the minimum evaluation index in the data storage unit, and the filtering end character is determined according to the second largest evaluation index in the data storage unit; the filtering start character and the filtering end character are applied to eliminate the evaluation indexes other than the maximum evaluation index in the data storage unit.

[0139] Exemplarily, the format of the element filtering command is zremrangebyrank$key$start$stop, where zremrangebyrank is a keyword, indicating that the function of this command is element filtering; $key is a feature identifier, indicating the attribute of the element set to which the element to be filtered belongs; $start and $stop are filter identifiers. In this example, $start takes the evaluation index 0 as the filter start symbol, and $stop takes the evaluation index -2 as the filter end symbol, so that the smallest evaluation index to the second largest element index can be filtered, leaving only the largest evaluation index.

[0140] In this way, by sending an element filtering command to the database, the function of deleting the evaluation index except the largest one can be configured in the element filtering command, thereby realizing the filtering of various evaluation indexes.

[0141] In addition, even if the above deletion process fails, or a read command is detected before deletion, the maximum evaluation index can be read through the data reading method in the embodiment of the present application, which can also solve the problem of data concurrency conflict.

[0142] In order to improve the display effect, after reading the target evaluation index in the target data storage unit, it also includes: displaying the target element corresponding to the target evaluation index. In this way, still taking the TV series as an example, after the target evaluation index (episode 9) is determined, the target element corresponding to episode 9 (the video screen of episode 9) can be displayed to the user. In this way, the user can obtain the target element and the display effect in time, and the user experience is better.

[0143] The following is an example of a complete flowchart. Figure 8 .

[0144] S801. Respond to a data update operation of a user, and determine a feature identifier and an evaluation index of an element indicated by the data update operation.

[0145] The evaluation index represents the order of the target elements in the element set, and the feature identifier of each element in an element set is the same as the feature identifier of the element set.

[0146] S802: Send an element adding command to the database.

[0147] The element adding command includes an evaluation index of the element indicated by the data updating operation and a feature identifier of the element indicated by the data updating operation.

[0148] S803: Determine a data storage unit that matches the feature identifier of the element indicated by the data update operation.

[0149] S804: Add the evaluation index of the element indicated by the data update operation to the data storage unit matching the feature identifier.

[0150] S805 . For each data storage unit, send an element filtering command to the data storage unit by sending the element filtering command to the database.

[0151] The element filtering command includes a filtering start character and a filtering end character. The filtering start character is determined according to the minimum evaluation index in the data storage unit, and the filtering end character is determined according to the second largest evaluation index in the data storage unit.

[0152] S806: Apply the filter start character and the filter end character to remove the evaluation indicators other than the maximum evaluation indicator in the data storage unit.

[0153] S807: If a read instruction is detected, identify the read instruction to determine the target feature identifier.

[0154] S808: Determine a target element set corresponding to the target feature identifier, and a target data storage unit that stores an evaluation index of each element in the target element set.

[0155] S809: Send an element read command to the database.

[0156] The element read command includes a read start character and a read end character, and both the read start character and the read end character are determined according to the maximum evaluation index in the target data storage unit;

[0157] S810 , reading the maximum evaluation index in the target data storage unit according to the read start character and the read end character.

[0158] It should be noted that Figure 8 This is just an exemplary description of the case where the reading strategy determined based on the size of the evaluation index is to read the largest evaluation index. For other reading strategies, please refer to the relevant descriptions in the embodiments. Figure 8 Not shown in FIG.

[0159] In order to make the technical solution of the present application easier to understand, a specific example is used below to illustrate the general structure of zset and the specific implementation process of the embodiment of the present application.

[0160] First, the general structure of Zset is as follows:

[0161] Zset is an ordered set, which stores different elements in an orderly manner. Each element has two attributes: score (evaluation index) and member (element identifier). Score can be a score / weight, which is used for sorting. Member is the value or id of the element, which is used to uniquely identify an element. Figure 4 , shows the general structure of a Zset containing 5 elements with scores ranging from 100 to 500. In this example, the evaluation indicators are 100, 200, 300, 400 and 500 respectively; members are 1, 2, 3, 4 and 5 respectively.

[0162] If applied to the example of a TV series, for the convenience of expression, both score and member can be represented by the episode id, that is, the evaluation index and element identifier of the 8th episode are both 8.

[0163] Second, the specific implementation process of the embodiment of the present application is as follows:

[0164] Step 1: In the kv structure, the key structure is user id (Zhang San) + TV series id (My Fair Princess), which is represented by $userId_$tvId in the command, and uniquely identifies the user's information in memory. The value uses zset, where score and member both use the episode id. When a user clicks on a certain episode, the backend server will send a set$userId_$tvId$episodeId command to the Redis server after a previous logical check, which is used to update the user's latest episode id to the value corresponding to the Redis key. When an update is required, it corresponds to the business scenario, that is, when the user watches an episode of the TV series, and the following two steps are performed:

[0165] (1) The server synchronously sends the command zadd$userId_$tvId 1 1 to Redis (the user has watched the first episode of the TV series) (the format of the zadd command is zadd$key$score$member, so the first 1 is score and the second 1 is member, both using the value of the episode id).

[0166] (2) If (1) is executed successfully, the command zremrangebyrank$userId_$tvId 0-2 is sent asynchronously to Redis (the format of the zremrangebyrank command is zremrangebyrank$key$start$stop), indicating that the first to the second to last elements in the Zset $userId_$tvId are deleted; if (1) fails, no operation is performed and an error prompt is directly returned to the upper layer.

[0167] In this example, assuming that Zset is empty before, after steps (1) and (2) above are successfully executed, the zset structure of $userId_$tvId in Redis is as follows: Figure 5 :

[0168] Step 2: Delete the first to the second to last elements. Since there is only one element in Zset in this example, there is no change in the Zset structure after the deletion command is executed.

[0169] This example is used to analyze how to prevent concurrent conflicts. Assume that the user clicks on episode 2 and episode 3 at almost the same time. The two requests arrive at the server at almost the same time. Then the server executes step (1) at the same time and sends zadd$userId_$tvId 2 2 and zadd$userId_$tvId 3 3 to Redis. At this time, the structure of zset is as follows: Figure 6 :

[0170] Both of them also execute step (2) almost simultaneously, sending zremrangebyrank$userId_$tvId 0-2 commands to the Redis server respectively. After the first command is executed, the zset structure is as follows: Figure 7 When the second command is executed, there is only one element left in Zset, so the Zset structure does not change after execution.

[0171] These two steps ensure that even in a concurrent environment, the element at the end of Zset at any time is the one with the largest set ID, which is our target element. Therefore, when reading (for APP page display), you need to use the command zrange$userId_$tvId-1-1 (the format of the zrange command is zrange$key$start$stop) to get the last element in zset. In this way, if step (2) of the above update steps is not executed in time or fails, there will be more than one element in Zset, but only the one with the largest set ID, that is, the one at the end, is needed. Therefore, the command zrange$userId_$tvId-1-1 can correctly retrieve the last element, no matter how many elements are contained in zset.

[0172] In addition, the benefit of element deletion is that even if Zset is allowed to have more than one element in a short period of time, unnecessary elements are still deleted to save memory. The reason why asynchronous rather than synchronous is used is that whether the deletion is successful does not affect the reading result (even if it is unsuccessful, the element still exists in Zset and does not affect the result of the zrange command of the read operation), so asynchronous is used to improve the performance of the write interface and avoid the time-consuming synchronous waiting for the result. At the same time, this command also has the ability of fault-tolerant correction, so that even if the last zremrangebyrank deletion operation is unsuccessful, all the remaining elements will be deleted at once next time, so that the result is idempotent.

[0173] In summary, after using the Zset data structure and the above algorithm steps, in an online concurrent environment with tens of thousands of Qps, the cache no longer has data conflicts, and the read and write interface performance is normal without any degradation, and the memory consumption of the Redis server is also normal. The problem of concurrency conflicts has been solved while meeting the product's functions and performance.

[0174] Fig. 9 is a block diagram of a data processing device according to an exemplary embodiment. Figure 7 The device includes a first determining unit 91, an adding unit 92, an instruction identifying unit 93, a second determining unit 94 and a reading unit 95.

[0175] A first determining unit 91 is configured to execute a data update operation in response to a user, and determine a feature identifier and an evaluation index of an element indicated by the data update operation; wherein the evaluation index represents the order of the element in the element set, and the feature identifier of each element in an element set is the same as the feature identifier of the element set;

[0176] The adding unit 92 is configured to add the evaluation index of the element indicated by the data update operation to the data storage unit in the database that matches the feature identifier; wherein the database includes at least one data storage unit; each data storage unit stores the evaluation index of each element in an element set;

[0177] The instruction recognition unit 93 is configured to perform, when a read instruction is detected, recognizing the read instruction to determine a target feature identifier;

[0178] A second determining unit 94 is configured to determine a target element set corresponding to the target feature identifier, and a target data storage unit storing an evaluation index of each element in the target element set;

[0179] The reading unit 95 is configured to execute a reading strategy determined based on the size of the evaluation indicator to read the target evaluation indicator in the target data storage unit.

[0180] In some exemplary embodiments, if the reading strategy determined based on the size of the evaluation index is to read the largest evaluation index, the reading unit 95 is specifically configured to execute:

[0181] Read the maximum evaluation index in the target data storage unit.

[0182] In some exemplary embodiments, the reading unit 95 is specifically configured to perform:

[0183] Sending an element read command to the database, wherein the element read command includes a read start character and a read end character, and the read start character and the read end character are both determined according to the maximum evaluation index in the target data storage unit;

[0184] The maximum evaluation index is read based on the read start character and the read end character.

[0185] In some exemplary embodiments, the adding unit 92 is configured to perform:

[0186] Sending an element adding command to the database, wherein the element adding command includes an evaluation index of the element indicated by the data updating operation and a feature identifier of the element indicated by the data updating operation;

[0187] Determine a data storage unit that matches a characteristic identifier of an element indicated by a data update operation;

[0188] The evaluation index of the element indicated by the data update operation is added to the data storage unit matching the feature identifier.

[0189] In some exemplary embodiments, a filtering unit is further included, and before reading the target evaluation index in the target data storage unit according to the reading strategy determined based on the size of the evaluation index, the filtering unit is configured to execute:

[0190] For each data storage unit, remove all evaluation indicators except the maximum evaluation indicator in the data storage unit;

[0191] The reading strategy determined based on the size of the evaluation index is to read the evaluation index in the target data storage unit after the elimination operation;

[0192] Reading the target evaluation index in the target data storage unit according to the reading strategy determined based on the size of the evaluation index includes:

[0193] In the target data storage unit after the culling operation, the remaining evaluation index in the target data storage unit is read.

[0194] In some exemplary embodiments, the filtering unit is specifically configured to perform:

[0195] For each data storage unit, an element filtering command is sent to the data storage unit by sending the element filtering command to the database; wherein the element filtering command includes a filtering start character and a filtering end character, the filtering start character is determined according to the minimum evaluation index in the data storage unit, and the filtering end character is determined according to the second largest evaluation index in the data storage unit;

[0196] Apply the filter start character and the filter end character to remove the evaluation indicators other than the maximum evaluation indicator in the data storage unit.

[0197] In some exemplary embodiments, a display unit is further included. After reading the target evaluation index in the target data storage unit, the display unit is configured to execute:

[0198] Displays the target elements corresponding to the target evaluation indicators.

[0199] The data processing device proposed in the embodiment of the present application adopts the same inventive concept as the above-mentioned data processing method and can achieve the same beneficial effects, which will not be repeated here.

[0200] After introducing the data processing method and device according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.

[0201] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0202] In some possible implementations, the electronic device according to the present application may include at least one processor and at least one memory. The memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the data processing method according to various exemplary implementations of the present application described above in this specification. For example, the processor may execute the steps in the data processing method.

[0203] Refer to the following Fig.10 The electronic device 130 according to this embodiment of the present application is described. Fig.10 The electronic device 130 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0204] like Fig.10 As shown, the electronic device 130 is in the form of a general electronic device. The components of the electronic device 130 may include but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).

[0205] Bus 133 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.

[0206] The memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and / or a cache memory 1322 , and may further include a read-only memory (ROM) 1323 .

[0207] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0208] The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 130, and / or communicate with any device that enables the electronic device 130 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 135. Furthermore, the electronic device 130 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 136. As shown, the network adapter 136 communicates with other modules for the electronic device 130 via a bus 133. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0209] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 132 including instructions, and the instructions can be executed by the processor 131 to perform the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0210] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, and when the computer program / instruction is executed by the processor 131, any method of the data processing method provided in the present application is implemented.

[0211] In an exemplary embodiment, various aspects of a data processing method provided by the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of a data processing method according to various exemplary embodiments of the present application described above in this specification.

[0212] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0213] The program product for image zooming of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on an electronic device. However, the program product of the present application is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0214] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0215] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0216] The program code for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code can be executed entirely on the user electronic device, partially on the user device, as an independent software package, partially on the user electronic device and partially on the remote electronic device, or entirely on the remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).

[0217] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0218] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0219] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0220] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable image scaling device to produce a machine, so that the instructions executed by the processor of the computer or other programmable image scaling device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0221] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable image scaling device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instruction device being implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0222] These computer program instructions may also be loaded onto a computer or other programmable image scaling device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0223] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0224] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data processing method, It is characterized in that include: Responding to a data update operation of a user, and determining a feature identifier and an evaluation index of an element indicated by the data update operation; wherein the evaluation index represents the order of the element in an element set, and the feature identifier of each element in an element set is the same as the feature identifier of the element set; Adding the evaluation index of the element indicated by the data update operation to the data storage unit in the database that matches the feature identifier; wherein the database includes at least one data storage unit; each data storage unit stores the evaluation index of each element in an element set; If a read instruction is detected, identifying the read instruction to determine a target feature identifier; Determine a target element set corresponding to the target feature identifier, and a target data storage unit storing evaluation indicators of each element in the target element set; Reading the target evaluation index in the target data storage unit according to a reading strategy determined based on the size of the evaluation index; Wherein, before reading the target evaluation index in the target data storage unit according to the reading strategy determined based on the size of the evaluation index, the method further includes: For each data storage unit, eliminating evaluation indicators other than the maximum evaluation indicator in the data storage unit; The reading strategy determined based on the size of the evaluation index is to read the evaluation index in the target data storage unit after the elimination operation; Reading the target evaluation index in the target data storage unit according to a reading strategy determined based on the size of the evaluation index includes: In the target data storage unit after the culling operation, the remaining evaluation index in the target data storage unit is read.

2. The method according to claim 1, It is characterized in that If the reading strategy determined based on the size of the evaluation index is to read the largest evaluation index, then the reading of the evaluation index in the target data storage unit includes: The maximum evaluation index in the target data storage unit is read.

3. The method according to claim 2, It is characterized in that The reading of the maximum evaluation index in the target data storage unit comprises: Sending an element read command to the database, wherein the element read command includes a read start character and a read end character, and the read start character and the read end character are both determined according to the maximum evaluation index in the target data storage unit; The maximum evaluation index in the target data storage unit is read according to the read start character and the read end character.

4. The method according to claim 1, It is characterized in that The step of adding the evaluation index of the element indicated by the data update operation to the data storage unit matching the feature identifier comprises: Sending an element adding command to the database, wherein the element adding command includes an evaluation index of the element indicated by the data updating operation and a feature identifier of the element indicated by the data updating operation; Determine a data storage unit that matches a characteristic identifier of an element indicated by the data update operation; The evaluation index of the element indicated by the data update operation is added to the data storage unit matching the feature identifier.

5. The method according to claim 1, It is characterized in that For each data storage unit, eliminating other evaluation indicators except the maximum evaluation indicator in the data storage unit includes: For each data storage unit, an element filtering command is sent to the data storage unit by sending the element filtering command to the database; wherein the element filtering command includes a filtering start character and a filtering end character, the filtering start character is determined according to the minimum evaluation index in the data storage unit, and the filtering end character is determined according to the second largest evaluation index in the data storage unit; The filter start character and the filter end character are applied to remove evaluation indicators other than the maximum evaluation indicator in the data storage unit.

6. The method according to any one of claims 1 to 5, It is characterized in that After reading the target evaluation index in the target data storage unit, the method further includes: Display the target elements corresponding to the target evaluation indicators.

7. A data processing device, It is characterized in that include: A first determining unit is configured to execute a data update operation in response to a user, and determine a feature identifier and an evaluation index of an element indicated by the data update operation; wherein the evaluation index represents an order of the element in an element set, and the feature identifier of each element in an element set is the same as the feature identifier of the element set; An adding unit is configured to add the evaluation index of the element indicated by the data update operation to a data storage unit in the database that matches the feature identifier; wherein the database includes at least one data storage unit; each data storage unit stores the evaluation index of each element in an element set; An instruction recognition unit, configured to recognize the read instruction to determine a target feature identifier when a read instruction is detected; A second determining unit is configured to determine a target element set corresponding to the target feature identifier, and a target data storage unit storing an evaluation index of each element in the target element set; A reading unit is configured to execute a reading strategy determined based on the size of the evaluation index to read the target evaluation index in the target data storage unit; The device further comprises a filtering unit, and before reading the target evaluation index in the target data storage unit according to the reading strategy determined based on the size of the evaluation index, the filtering unit is configured to execute: For each data storage unit, eliminating evaluation indicators other than the maximum evaluation indicator in the data storage unit; The reading strategy determined based on the size of the evaluation index is to read the evaluation index in the target data storage unit after the elimination operation; Reading the target evaluation index in the target data storage unit according to a reading strategy determined based on the size of the evaluation index includes: In the target data storage unit after the culling operation, the remaining evaluation index in the target data storage unit is read.

8. The device according to claim 7, It is characterized in that If the reading strategy determined based on the size of the evaluation index is to read the largest evaluation index, the reading unit is specifically configured to execute: The maximum evaluation index in the target data storage unit is read.

9. The device according to claim 8, It is characterized in that The reading unit is specifically configured to perform: Sending an element read command to the database, wherein the element read command includes a read start character and a read end character, and the read start character and the read end character are both determined according to the maximum evaluation index in the target data storage unit; The maximum evaluation index in the target data storage unit is read according to the read start character and the read end character.

10. The device according to claim 7, It is characterized in that The adding unit is configured to perform: Sending an element adding command to the database, wherein the element adding command includes an evaluation index of the element indicated by the data updating operation and a feature identifier of the element indicated by the data updating operation; Determine a data storage unit that matches a characteristic identifier of an element indicated by the data update operation; The evaluation index of the element indicated by the data update operation is added to the data storage unit matching the feature identifier.

11. The device according to claim 7, It is characterized in that The filtering unit is specifically configured to perform: For each data storage unit, an element filtering command is sent to the data storage unit by sending the element filtering command to the database; wherein the element filtering command includes a filtering start character and a filtering end character, the filtering start character is determined according to the minimum evaluation index in the data storage unit, and the filtering end character is determined according to the second largest evaluation index in the data storage unit; The filter start character and the filter end character are applied to remove evaluation indicators other than the maximum evaluation indicator in the data storage unit.

12. The device according to any one of claims 7 to 11, It is characterized in that The present invention also includes a display unit, after reading the target evaluation index stored in the target data storage unit, the display unit is configured to execute: Display the target elements corresponding to the target evaluation indicators.

13. An electronic device, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data processing method according to any one of claims 1 to 6.

14. A computer-readable storage medium, It is characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method according to any one of claims 1 to 6.

15. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the data processing method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Ranking list generation method and device, server and storage medium

    CN113239084A