Data processing method, device and equipment, readable storage medium and program product
By receiving client manipulation information and storing user reading status using bitmaps, the problem of the inability to accurately judge the user's reading comic chapters in the prior art is solved, and the effect of saving storage space and encouraging users to read new chapters is achieved.
Patent Information
- Application Number
- CN202311200534.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art cannot accurately determine whether the user has read a certain chapter when reading a comic, resulting in repeated points on the client, unable to effectively motivate the user to read new chapters, and occupy a large amount of storage space.
By receiving the control information sent by the client, the chapter number of the target chapter in the corresponding target reading object of the chapter identification is determined, and the bitmap is used to store the information about whether the user has read the target chapter, so as to achieve accurate user reading status judgment.
On the premise of saving storage space, it is possible to accurately determine whether the user has read a chapter of the comic, avoiding repeated points on the client, effectively motivating users to read new chapters.
Smart Images

Figure CN119690957A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a data processing method, apparatus, device, readable storage medium, and program product. Background Art
[0002] In the prior art, a user reads comics through a client. For example, a user participates in a point-earning activity for reading comics during the National Day. The user reads certain chapters of a comic through a client, and the client displays the user's points. If the user reads the same chapter repeatedly, the client will repeatedly earn points. The prior art occupies a large amount of storage space and cannot accurately determine whether the user has read a certain chapter of the comic, that is, it cannot accurately determine whether the user has repeatedly read a certain chapter of the comic, which results in the client earning repeated points and fails to achieve the effect of motivating users to read new chapters in the comic. Summary of the invention
[0003] In view of the shortcomings of the existing methods, the present application proposes a data processing method, device, equipment, computer-readable storage medium and computer program product to solve the problem of how to accurately determine whether a user has read a chapter of a comic while saving storage space.
[0004] In a first aspect, the present application provides a data processing method, comprising:
[0005] Receiving control information sent by the client, the control information includes an operation instruction, a scenario identifier of a business scenario, a user identifier of a user, an object identifier of a target reading object, and a chapter identifier of the target reading object, wherein the business scenario is determined by the purpose of the operation on the target reading object;
[0006] Based on the object identifier and the chapter identifier, determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier;
[0007] Determine the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier, and the object identifier;
[0008] Determine at least one of the sequence number of the binary bit in the bitmap corresponding to the chapter sequence number and the value of the binary bit in the bitmap corresponding to the chapter sequence number;
[0009] Based on the key of the target key-value pair and each key in the determined target storage unit, a matching process is performed to determine a matching result, where the matching result is used to indicate whether the key of the target key-value pair and any key in each key are the same;
[0010] Based on the operation instruction for the target chapter, the matching result and at least one item, it is determined whether the user has read the target chapter.
[0011] In one embodiment, before determining the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the object identifier, the method further includes:
[0012] Constructing a plurality of key-value pairs in the target storage unit, each of the plurality of key-value pairs comprising a key and a value corresponding to the key, the value corresponding to the key being used to indicate whether a user has read a chapter in a reading object;
[0013] Construct a bitmap corresponding to a key, and a bitmap stores the value corresponding to a key.
[0014] In one embodiment, after receiving the manipulation information sent by the client, the method further includes:
[0015] Dividing the scene identifier by the total number of preset storage units to obtain a remainder, and determining the remainder as the sequence number of the target storage unit;
[0016] Based on the sequence number of the target storage unit, any storage unit is determined as the target storage unit from the plurality of storage units, and the sequence number of any storage unit is the same as the sequence number of the target storage unit.
[0017] In one embodiment, based on the object identifier and the chapter identifier, determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier includes:
[0018] Sending the object identifier and the chapter identifier to a third-party server, so that the third-party server can determine the text information corresponding to the target reading object based on the object identifier and the chapter identifier;
[0019] Receive the text information sent by the third-party server, and extract the chapter number of the target chapter in the target reading object corresponding to the chapter identifier from the text information.
[0020] In one embodiment, based on the object identifier and the chapter identifier, determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier includes:
[0021] Based on the object identifier and the chapter identifier, the chapter number of the target chapter in the target reading object corresponding to the chapter identifier is determined through a preset hash table in the local cache. Any key-value pair in the preset hash table is constructed by the key corresponding to the chapter identifier and the value corresponding to the chapter number.
[0022] In one embodiment, determining at least one of the sequence number of the binary bit in the bitmap corresponding to the chapter sequence number and the value of the binary bit in the bitmap corresponding to the chapter sequence number includes:
[0023] If the operation instruction is a query instruction, determine the serial number of the binary bit in the bitmap corresponding to the chapter serial number;
[0024] If the operation instruction is a write instruction, the value of the binary bit in the bitmap corresponding to the chapter number and the serial number of the binary bit in the bitmap corresponding to the chapter number are determined. The value of the binary bit in the bitmap is used to indicate whether the user has read the target chapter, and the serial number of the binary bit in the bitmap is used to indicate the arrangement order of the binary bits in the bitmap.
[0025] In one embodiment, determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result, and at least one item includes:
[0026] If the operation instruction is a query instruction, and the matching result is a successful match, then based on the serial number of the binary bit in the bitmap corresponding to the chapter number, the value of the target binary bit is queried from the bitmap corresponding to any key, the serial number of the target binary bit is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number, the target binary bit is the binary bit in the bitmap corresponding to any key, and the value of the target binary bit is the value of the target key-value pair;
[0027] Based on the value of the target bit, determine whether the user has read the target chapter.
[0028] In one embodiment, based on the value of the target binary bit, determining whether the user has read the target chapter includes:
[0029] If the value of the target binary bit is a predetermined first value, it is determined that the user has read the target chapter, and the predetermined first value is used to indicate that the user has read the target chapter;
[0030] If the value of the target binary bit is a predetermined second value, it is determined that the user has not read the target chapter. The predetermined second value is used to indicate that the user has not read the target chapter.
[0031] In one embodiment, determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result, and at least one item includes:
[0032] If the operation instruction is a write instruction, the matching result is a successful match, and the predetermined first value is successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has not read the target chapter, the predetermined first value is used to indicate that the user has read the target chapter, the serial number of the binary bit in the bitmap corresponding to any key is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number, the value of the binary bit in the bitmap corresponding to the chapter number is the predetermined first value, and the value of the binary bit in the bitmap corresponding to the chapter number is the value of the target key-value pair;
[0033] If the operation instruction is a write instruction, the matching result is a successful match, and the predetermined first value is not successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has read the target chapter.
[0034] In one embodiment, after determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and at least one item, the method further includes:
[0035] Obtain the expiration time point of the business scenario and the idle time period of the storage space in the target storage unit;
[0036] Based on the expiration time point of the business scenario and the preset random number, random mapping processing is performed to determine the expiration time point after processing, and the expiration time point after processing is in the idle time period;
[0037] Based on the processed expiration time point and the current time point of the user reading, determine the validity period of the key.
[0038] In a second aspect, the present application provides a data processing device, comprising:
[0039] A first processing module is used to receive control information sent by a client, the control information includes an operation instruction, a scenario identifier of a business scenario, a user identifier of a user, an object identifier of a target reading object, and a chapter identifier of the target reading object, wherein the business scenario is determined by the purpose of the operation on the target reading object;
[0040] A second processing module is used to determine the chapter number of the target chapter in the target reading object corresponding to the chapter identifier based on the object identifier and the chapter identifier;
[0041] A third processing module, used to determine the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the object identifier;
[0042] A fourth processing module, used to determine at least one of the serial number of the binary bit in the bitmap corresponding to the chapter serial number and the value of the binary bit in the bitmap corresponding to the chapter serial number;
[0043] A fifth processing module, used for performing matching processing based on the key of the target key-value pair and each key in the determined target storage unit, and determining a matching result, wherein the matching result is used to indicate whether the key of the target key-value pair and any key in each key are the same;
[0044] The sixth processing module is used to determine whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and at least one item.
[0045] In a third aspect, the present application provides an electronic device, including: a processor, a memory, and a bus;
[0046] A bus, used to connect the processor and memory;
[0047] A memory, used for storing operation instructions;
[0048] The processor is used to execute the data processing method of the first aspect of the present application by calling an operation instruction.
[0049] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which is used to execute the data processing method of the first aspect of the present application.
[0050] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the data processing method in the first aspect of the present application when the computer program is executed by a processor.
[0051] The technical solution provided in the embodiments of the present application has at least the following beneficial effects:
[0052] Receive control information sent by the client, the control information includes operation instructions, scenario identifier of the business scenario, user identifier of the user, object identifier of the target reading object and chapter identifier of the target reading object, the business scenario is determined by the operation purpose for the target reading object; based on the object identifier and the chapter identifier, determine the chapter number of the target chapter in the target reading object corresponding to the chapter identifier; based on the scenario identifier, user identifier and object identifier, determine the key of the target key-value pair corresponding to the business scenario; determine at least one of the binary bit number in the bitmap corresponding to the chapter number and the value of the binary bit in the bitmap corresponding to the chapter number; perform matching processing based on the key of the target key-value pair and each key in the determined target storage unit to determine Matching result, the matching result is used to characterize whether the key of the target key-value pair is the same as any key in each key; in this way, based on the operation instruction for the target chapter, the matching result and at least one item, it is accurately determined whether the user has read the target chapter. The target chapter, for example, a chapter of a comic, is converted into a chapter number through a chapter identifier, and the chapter number is stored through a bitmap by utilizing the orderly characteristics. Since the bitmap uses binary bits to store the value corresponding to the chapter number, that is, the value of the binary bit in the bitmap, the value of the binary bit in the bitmap can be used to characterize whether the user has read a chapter of the comic, thereby saving storage space. That is, on the premise of saving storage space, it is achieved to accurately determine whether the user has read a chapter of the comic. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0054] Figure 1 A schematic diagram of the architecture of a data processing system provided in an embodiment of the present application;
[0055] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of data processing provided in an embodiment of the present application;
[0057] Figure 4 A schematic diagram of data processing provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of data processing provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of data processing provided in an embodiment of the present application;
[0060] Figure 7 A schematic diagram of a data cleaning process provided in an embodiment of the present application;
[0061] Figure 8 A flowchart of a data processing method provided in an embodiment of the present application;
[0062] Fig. 9 A flowchart of a data processing method provided in an embodiment of the present application;
[0063] Fig.10 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0064] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0066] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" indicates that it is implemented as "A", or implemented as "B", or implemented as "A and B".
[0067] It is understandable that in the specific implementation of this application, data related to data processing is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0068] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0069] The embodiment of the present application is a data processing method provided by a data processing system, and the data processing involves fields such as maps.
[0070] Intelligent Traffic System (ITS), also known as Intelligent Transportation System, effectively and comprehensively applies advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) to transportation, service control and vehicle manufacturing, strengthens the connection between vehicles, roads and users, and thus forms a comprehensive transportation system that ensures safety, improves efficiency, improves the environment and saves energy.
[0071] In order to better understand and illustrate the solutions of the embodiments of the present application, some technical terms involved in the embodiments of the present application are briefly explained below.
[0072] Bitmap: A bitmap is a data structure used to represent a collection of binary bits; in a bitmap, each binary bit can represent a state or flag, such as 0 or 1, true or false, presence or absence, etc.; a bitmap usually uses a byte or smaller storage unit to store each binary bit, so it can save storage space.
[0073] Chapter identification: A comic book has multiple chapters, and each chapter needs to be identified by a unique ID (IdentityDocument). The characteristics of chapter identification (chapter ID) are unique, but continuity and monotonicity are not guaranteed.
[0074] Chapter number: A comic book has multiple chapters, and each chapter has a serial number, such as Chapter 1, Chapter 2, etc. The chapter numbers are continuous and monotonous.
[0075] The solution provided by the embodiment of the present application relates to data processing technology. The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0076] In order to better understand the solution provided by the embodiment of the present application, the solution is described below in conjunction with a specific application scenario.
[0077] In one embodiment, Figure 1 The schematic diagram of the architecture of a data processing system applicable to the embodiment of the present application is shown in FIG. It can be understood that the data processing method provided in the embodiment of the present application can be applied to but not limited to the following applications: Figure 1 In the application scenario shown.
[0078] In this example, Figure 1 As shown, the architecture of the data processing system in this example may include but is not limited to a server 10, a terminal 20 and a database 30. The server 10, the terminal 20 and the database 30 may interact with each other via a network 40.
[0079] The server 10 receives the control information sent by the client 20, the control information includes the operation instruction, the scenario identifier of the business scenario, the user identifier of the user, the object identifier of the target reading object and the chapter identifier of the target reading object, the business scenario is determined by the operation purpose for the target reading object; the server 10 determines the chapter number of the target chapter in the target reading object corresponding to the chapter identifier based on the object identifier and the chapter identifier; the server 10 determines the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the object identifier; the server 10 determines at least one of the serial number of the binary bit in the bitmap corresponding to the chapter serial number and the value of the binary bit in the bitmap corresponding to the chapter serial number; the server 10 performs matching processing based on the key of the target key-value pair and each key in the determined target storage unit to determine the matching result, the matching result is used to characterize whether the key of the target key-value pair is the same as any key in each key; the server 10 determines whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and at least one item; wherein the database 30 includes multiple storage units, and the multiple storage units include the target storage unit. For example, in the activity of calculating points for reading comics during the National Day, if the server 10 determines that the user has not read the target chapter, that is, the user is reading the target chapter for the first time, the points will be accumulated through the client on the terminal 20; if the server 10 determines that the user has read the target chapter, the client on the terminal 20 will be notified not to accumulate points.
[0080] It is understandable that the above is only an example and is not limited to this embodiment.
[0081] Among them, terminals include but are not limited to smart phones (such as Android phones, iOS phones, etc.), mobile phone simulators, tablet computers, laptops, digital broadcast receivers, MIDs (Mobile Internet Devices), PDAs (Personal Digital Assistants), intelligent voice interaction devices, smart home appliances, car terminals, etc.
[0082] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster 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 (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0083] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0084] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0085] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0086] The so-called artificial intelligence cloud service is generally also called AIaaS (AI as a Service). This is the service mode of a mainstream artificial intelligence platform. Specifically, the AIaaS platform will split several common AI services and provide independent or packaged services in the cloud. This service model is similar to opening an AI theme mall: all developers can access and use one or more artificial intelligence services provided by the platform through the API interface. Some senior developers can also use the AI framework and AI infrastructure provided by the platform to deploy and operate their own cloud artificial intelligence services.
[0087] The above network may include but is not limited to: wired network, wireless network, wherein the wired network includes: local area network, metropolitan area network and wide area network, and the wireless network includes: Bluetooth, Wi-Fi and other networks that realize wireless communication. The specific can also be determined based on the actual application scenario requirements and is not limited here.
[0088] See also Figure 2 , Figure 2 The flowchart of a data processing method provided by an embodiment of the present application is shown, wherein the method can be executed by any electronic device, such as a server, etc. As an optional implementation, the method can be executed by a server. For the convenience of description, in the description of some optional embodiments below, the server will be used as an example to illustrate the execution subject of the method. Figure 2 As shown, the data processing method provided in the embodiment of the present application includes the following steps:
[0089] S201, receiving control information sent by the client, the control information includes operation instructions, a scenario identifier of a business scenario, a user identifier of a user, an object identifier of a target reading object, and a chapter identifier of the target reading object. The business scenario is determined by the purpose of the operation on the target reading object.
[0090] Specifically, for example, if a user reads a chapter (target chapter) in a comic through a client, the client is triggered to generate manipulation information, which includes an operation instruction, a scenario identifier of a business scenario, a user identifier of a user, an object identifier of a target reading object, and a chapter identifier of a target reading object; wherein the operation instruction is a write instruction, which instructs the server to write a value 1 into a binary bit of a bitmap, and the value 1 indicates that the user has read the chapter (target chapter); the business scenario is determined by the operation purpose for the target reading object, and the operation purpose is to read a comic; the user is, for example, a user who reads a comic, the target reading object is, for example, a comic, the object identifier of the target reading object is, for example, a comic identifier of a comic, and the chapter identifier of the target reading object is, for example, a chapter identifier of a comic. The target reading object is, for example, a novel, a picture book, etc.
[0091] Operation instructions include query instructions, write instructions, etc. Business scenarios include Figure 3 The time-limited reading task scenario shown in Figure 4 The permanent reading points scene, loyal fan scene, task system-reading task, like scene, comment scene, picture sliding scene, etc. are shown. For example, Figure 3 The time-limited reading task scenario shown corresponds to a user reading a comic, such as Figure 4 The permanent reading points scenario shown corresponds to users reading comics, the like scenario corresponds to users liking comics, the comment scenario corresponds to users commenting on comics, and the picture sliding scenario corresponds to users sliding comics; the operation purposes for comics can be reading comics, liking comics, commenting on comics, sliding comics, etc.
[0092] For example, as shown in Table 1, scene_id represents a scene identifier, uin represents a user identifier, comic_id represents an object identifier, such as a comic identifier, and chapter_id represents a chapter identifier.
[0093] Table 1 Fields and field types corresponding to various identifiers
[0094]
[0095]
[0096] S202: Determine the chapter number of the target chapter in the target reading object corresponding to the chapter identifier based on the object identifier and the chapter identifier.
[0097] Specifically, the object identifier of the target reading object is, for example, a comic identifier of a comic, the chapter identifier of the target reading object is, for example, a chapter identifier of a comic, and the target chapter in the target reading object is, for example, a chapter of a comic that the user is reading; based on the comic identifier of a comic and the chapter identifier of the comic, determine the chapter number of a chapter in the comic corresponding to the chapter identifier.
[0098] S203: Determine the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the object identifier.
[0099] Specifically, for example, the key of the target key-value pair corresponding to the business scenario is {scene_id}_{uin}_{comic_id}; wherein scene_id represents the scene identifier, uin represents the user identifier, and comic_id represents the object identifier, that is, comic_id represents the comic identifier.
[0100] S204, determining at least one of the serial number of the binary bit in the bitmap corresponding to the chapter serial number and the value of the binary bit in the bitmap corresponding to the chapter serial number.
[0101] Specifically, the value of the binary bit in the bitmap is used to indicate whether the user has read the target chapter, and the serial number of the binary bit in the bitmap is used to indicate the arrangement order of the binary bit in the bitmap.
[0102] S205, performing matching processing based on the key of the target key-value pair and each key in the determined target storage unit to determine a matching result, where the matching result is used to indicate whether the key of the target key-value pair is the same as any key in each key.
[0103] Specifically, multiple key-value pairs are constructed in the target storage unit, each of which includes a key and a value corresponding to the key; a bitmap corresponding to a key is constructed, and the bitmap stores the value corresponding to the key. Multiple keys are stored in the target storage unit, and the key of the target key-value pair and the multiple keys in the target storage unit are matched respectively. If it is determined that the key of the target key-value pair is the same as a key in the target storage unit, the matching result is determined to be a successful match.
[0104] The size of a bitmap can be determined according to the number of chapters of the target reading object; for example, the object identifier of the target reading object is the comic identifier of a comic that the user is reading, and the comic has 40 chapters. The size of a bitmap corresponding to the comic can be 40 binary bits.
[0105] The target storage unit can be a slice, for example Figure 5 The sharded storage architecture shown in the figure has multiple shards, such as shard 1, shard 2, and shard 3; all data under the same business scenario are concentrated in the same shard, and multiple key-value pairs are stored in the shard, that is, multiple keys and multiple bitmaps are stored in the shard, and the bitmap corresponding to each key in the multiple keys is used to store the value corresponding to the key.
[0106] S206: Determine whether the user has read the target chapter based on the operation instruction, the matching result and at least one item for the target chapter.
[0107] Specifically, the server accurately determines whether the user has read a target chapter based on the operation instruction, the matching result and at least one item. The target chapter is, for example, a chapter of a comic. Since a bitmap method is used, storage space is saved. That is, while saving storage space, it is possible to accurately determine whether the user has read a chapter of the comic.
[0108] In the embodiment of the present application, control information sent by the client is received, and the control information includes an operation instruction, a scenario identifier of a business scenario, a user identifier of a user, an object identifier of a target reading object, and a chapter identifier of the target reading object. The business scenario is determined by the purpose of the operation on the target reading object; based on the object identifier and the chapter identifier, the chapter number of the target chapter in the target reading object corresponding to the chapter identifier is determined; based on the scenario identifier, the user identifier, and the object identifier, the key of the target key-value pair corresponding to the business scenario is determined; at least one of the serial number of the binary bit in the bitmap corresponding to the chapter serial number and the value of the binary bit in the bitmap corresponding to the chapter serial number is determined; matching processing is performed based on the key of the target key-value pair and each key in the determined target storage unit. The matching result is determined, and the matching result is used to characterize whether the key of the target key-value pair is the same as any key in each key; in this way, based on the operation instruction for the target chapter, the matching result and at least one item, it is accurately determined whether the user has read the target chapter. The target chapter, for example, a chapter of a comic, is converted into a chapter number through a chapter identifier, and the chapter number is stored through a bitmap by utilizing the orderly characteristics. Since the bitmap uses binary bits to store the value corresponding to the chapter number, that is, the value of the binary bit in the bitmap, the value of the binary bit in the bitmap can be used to characterize whether the user has read a chapter of the comic, thereby saving storage space. That is, on the premise of saving storage space, it is achieved to accurately determine whether the user has read a chapter of the comic.
[0109] In one embodiment, before determining the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the object identifier, the method further includes:
[0110] Constructing a plurality of key-value pairs in the target storage unit, each of the plurality of key-value pairs including a key and a value corresponding to the key, the value corresponding to the key being used to indicate whether a user has read a chapter in a reading object;
[0111] Construct a bitmap corresponding to a key, and a bitmap stores the value corresponding to a key.
[0112] In one embodiment, after receiving the manipulation information sent by the client, the method further includes:
[0113] Dividing the scene identifier by the total number of preset storage units to obtain a remainder, and determining the remainder as the sequence number of the target storage unit;
[0114] Based on the sequence number of the target storage unit, any storage unit is determined as the target storage unit from the plurality of storage units, and the sequence number of any storage unit is the same as the sequence number of the target storage unit.
[0115] Specifically, for example, Figure 5 The sharded storage architecture shown in the figure has multiple shards, such as shard 1, shard 2 and shard 3; all data under the same business scenario are concentrated in the same shard, such as the iron fan scenario, task system-reading task, like scenario, comment scenario, picture sliding scenario, etc. All data in the iron fan scenario is concentrated in shard 1, all data in the task system-reading task is concentrated in shard 1, all data in the like scenario is concentrated in shard 2, all data in the comment scenario is concentrated in shard 2, and all data in the picture sliding scenario is concentrated in shard 3; each of the multiple shards can store multiple bitmaps.
[0116] It should be noted that, in the die-hard fan scenario: points need to be added to users based on their reading behavior, and the title of die-hard fan needs to be awarded; the task system - reading tasks: users will be rewarded when they complete the specified reading tasks; the like scenario: users can like the chapters of the comics, and it is necessary to determine whether the user has already liked the chapters; the comment scenario: users can comment on the chapters of the comics, and it is necessary to determine whether the user has already commented on the chapters; the picture sliding scenario: determine whether the user has sliding behavior when reading the chapters of the comics.
[0117] Hash operations such as hash slot algorithms are used for load balancing. Figure 5As shown, based on the scene identification of the iron fan scene, shard 1 is determined from multiple shards through the hash slot algorithm; wherein the multiple shards are multiple storage units, and shard 1 is the target storage unit.
[0118] For example, a hash judgment is performed on the scene identifier to determine a target storage unit from multiple storage units, that is, based on the scene identifier and the total number of multiple storage units, the target storage unit is determined from multiple storage units through remainder processing; for example, Figure 5 As shown, if the scenario identifier is 8, there are only 3 shards in the shard storage architecture, which are shard 1, shard 2 and shard 3. The total number of 3 shards is 3, then 8 / 3 is 2, and 2 is the shard number, that is, shard 2 is the target storage unit.
[0119] In one embodiment, based on the object identifier and the chapter identifier, determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier includes:
[0120] Sending the object identifier and the chapter identifier to a third-party server, so that the third-party server can determine the text information corresponding to the target reading object based on the object identifier and the chapter identifier;
[0121] Receive the text information sent by the third-party server, and extract the chapter number of the target chapter in the target reading object corresponding to the chapter identifier from the text information.
[0122] Specifically, the third-party server is, for example, a comic server. For example, the object identifier of the target reading object is the comic identifier of a comic, and the chapter identifier of the target reading object is the chapter identifier of a comic. The server sends the comic identifier and the chapter identifier to the comic server; the comic server determines the text information corresponding to the comic based on the comic identifier and the chapter identifier, and the text information is the comic information, and the comic information includes the chapter number of the target chapter in the comic corresponding to the chapter identifier, the name of the comic author, the comic picture, etc.; the comic server sends the comic information to the server, and the server extracts the chapter number of the target chapter in the comic from the comic information.
[0123] In one embodiment, based on the object identifier and the chapter identifier, determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier includes:
[0124] Based on the object identifier and the chapter identifier, the chapter number of the target chapter in the target reading object corresponding to the chapter identifier is determined through a preset hash table in the local cache. Any key-value pair in the preset hash table is constructed by the key corresponding to the chapter identifier and the value corresponding to the chapter number.
[0125] Specifically, a hash table is stored in the local cache of the server, the key (key) of the key-value pair in the hash table is the chapter identifier (chapter_id), the value (value) of the key-value pair in the hash table is the chapter sequence number (seq_no), and one chapter identifier corresponds to one chapter sequence number.
[0126] For example, the object identifier of the target reading object is the comic identifier of a comic, and the chapter identifier of the target reading object is the chapter identifier of a comic. Based on the comic identifier and the chapter identifier, the chapter number of the target chapter in the comic corresponding to the chapter identifier is determined through the hash table in the local cache.
[0127] In one embodiment, the server queries the chapter number of the target chapter in the target reading object corresponding to the chapter identifier through the hash table in the local cache based on the object identifier and the chapter identifier. If the chapter number of the target chapter is not found in the hash table, the server sends the object identifier and the chapter identifier to the third-party server; the third-party server determines the text information corresponding to the target reading object based on the object identifier and the chapter identifier; the server receives the text information sent by the third-party server, extracts the chapter number of the target chapter from the text information, and stores the chapter number of the target chapter in the local cache.
[0128] For example, Figure 6 As shown, the server queries the chapter number of the target chapter in the comic corresponding to the chapter identifier through the hash table in the local cache based on the comic identifier and the chapter identifier. If the chapter number of the target chapter is not found in the hash table, the server sends the comic identifier and the chapter identifier to the third-party server; the third-party server determines the text information corresponding to the comic based on the comic identifier and the chapter identifier, and the text information is the comic information; the server receives the comic information sent by the third-party server, extracts the chapter number of the target chapter from the comic information, and stores the chapter number of the target chapter in the local cache; wherein the third-party server provides comic services.
[0129] In one embodiment, determining at least one of the sequence number of the binary bit in the bitmap corresponding to the chapter sequence number and the value of the binary bit in the bitmap corresponding to the chapter sequence number includes:
[0130] If the operation instruction is a query instruction, determine the serial number of the binary bit in the bitmap corresponding to the chapter serial number;
[0131] If the operation instruction is a write instruction, the value of the binary bit in the bitmap corresponding to the chapter number and the serial number of the binary bit in the bitmap corresponding to the chapter number are determined. The value of the binary bit in the bitmap is used to indicate whether the user has read the target chapter, and the serial number of the binary bit in the bitmap is used to indicate the arrangement order of the binary bits in the bitmap.
[0132] Specifically, for example, if the operation instruction is a query instruction, which is used to instruct to query the reading status of five chapters of the comic whose chapter numbers are 1, 2, 3, 4, and 5 respectively, then the binary bit numbers in the bitmap corresponding to the chapter numbers are determined to be 1, 2, 3, 4, and 5 respectively.
[0133] For example, if the operation instruction is a write instruction, the write instruction is used to instruct that the reading status of the chapter numbered 3 that has been read is written into the target storage unit, then the value of a binary bit in the bitmap corresponding to the chapter numbered 3 and the serial number of a binary bit in the bitmap corresponding to the chapter numbered 3 are determined, the value of the binary bit in the bitmap is 1, and the serial number of the binary bit in the bitmap is 3; wherein, the value of the binary bit in the bitmap is 1 indicating that the user has read the chapter numbered 3 in the comic, and the value of the binary bit in the bitmap is 0 indicating that the user has not read the chapter numbered 3 in the comic.
[0134] In one embodiment, matching processing is performed based on the key of the target key-value pair and the keys in the determined target storage unit to determine the matching result, including:
[0135] Match the key of the target key-value pair with the keys in the determined target storage unit.
[0136] If it is determined that the key of the target key-value pair is the same as any key in the target storage unit, then the matching result is determined to be a successful match;
[0137] If it is determined that the key of the target key-value pair and the keys in the target storage unit are not the same, then the matching result is determined to be a failed match.
[0138] Specifically, for example, Figure 5 As shown in the figure, a target storage unit is a shard, and a shard stores multiple keys, and each of the multiple keys corresponds to a bitmap. The size of a bitmap is related to the number of chapters in the comic. For example, if a comic has 100 chapters, the size of a bitmap is 100 binary bits, that is, 100 / 8 bytes; if a comic has 8 chapters, the size of a bitmap is 8 binary bits, 1 byte.
[0139] The key of the target key-value pair is matched with each key in a shard. If it is determined that the key of the target key-value pair is the same as a key in the shard, the matching result is determined to be a successful match; if it is determined that the key of the target key-value pair is different from each key in the shard, the matching result is determined to be an unsuccessful match, and a key needs to be built in the shard, which is the same as the key of the target key-value pair.
[0140] In one embodiment, chapter identifiers are converted into chapter numbers, and the chapter numbers are stored in a bitmap format using the orderly nature of the chapter numbers, thereby effectively saving storage space.
[0141] For example, among 1 million users, each user reads 50 comics on average, and each of the 50 comics has 50 chapters. The number of key-value pairs can be calculated using formula (1), which is as follows:
[0142] Number of key-value pairs = number of users × number of comics Formula (1)
[0143] The formula (2) for calculating the bytes occupied by each key-value pair is as follows:
[0144] Each key-value pair occupies bytes = Key bytes + Value bytes Formula (2)
[0145] Among them, Key represents the key of the key-value pair, and Value represents the value of the key-value pair.
[0146] The formula (3) for calculating the number of storage bytes is as follows:
[0147] Number of bytes stored = number of key-value pairs × bytes occupied by each key-value pair Formula (3)
[0148] According to formula (1), the number of key-value pairs that need to be stored is 50 million; the Key byte is 20 bytes, and the Value is stored in the binary bit of the bitmap. Each Value occupies 1 bit. A comic with 50 chapters only needs 50 bits of storage space, that is, the Value byte is 6.25 bytes. According to formula (2), the bytes occupied by each key-value pair are 26.25 bytes. According to formula (3), the number of storage bytes is 50 million × 26.25 bytes = 125 MB. In this way, storage space can be effectively saved and storage costs can be reduced.
[0149] In one embodiment, determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result, and at least one item includes:
[0150] If the operation instruction is a query instruction, and the matching result is a successful match, then based on the serial number of the binary bit in the bitmap corresponding to the chapter number, the value of the target binary bit is queried from the bitmap corresponding to any key, the serial number of the target binary bit is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number, the target binary bit is the binary bit in the bitmap corresponding to any key, and the value of the target binary bit is the value of the target key-value pair;
[0151] Based on the value of the target bit, determine whether the user has read the target chapter.
[0152] Specifically, for example, the chapter number is 5, and the serial number of the binary bit in the bitmap corresponding to the chapter number is 5. If the operation instruction is a query instruction and the matching result is a successful match, then based on the serial number 5 of the binary bit in the bitmap corresponding to the chapter number, the value of the target binary bit is queried from a bitmap corresponding to a key. The key is stored in the target storage unit, and the bitmap corresponding to the key is also stored in the target storage unit. The value of the target binary bit is 1 or 0, and the serial number of the target binary bit is 5, that is, the serial number 5 of the target binary bit is the same as the serial number 5 of the binary bit in the bitmap corresponding to the chapter number; if the value of the target binary bit is 1, it means that the user has read the chapter with chapter number 5, that is, the user has read the target chapter (the chapter with chapter number 5); if the value of the target binary bit is 0, it means that the user has not read the chapter with chapter number 5, that is, the user has not read the target chapter.
[0153] In one embodiment, based on the value of the target binary bit, determining whether the user has read the target chapter includes:
[0154] If the value of the target binary bit is a predetermined first value, it is determined that the user has read the target chapter, and the predetermined first value is used to indicate that the user has read the target chapter;
[0155] If the value of the target binary bit is a predetermined second value, it is determined that the user has not read the target chapter. The predetermined second value is used to indicate that the user has not read the target chapter.
[0156] Specifically, the predetermined first value is, for example, 1, and the predetermined second value is, for example, 0. If the value of the target binary bit is 1, it can be determined that the user has read the target chapter, and 1 is used to indicate that the user has read the target chapter; if the value of the target binary bit is 0, it can be determined that the user has not read the target chapter, and 0 is used to indicate that the user has not read the target chapter.
[0157] In one embodiment, if the operation instruction is a query instruction and the matching result is a failed match, the server returns a query failure message to the client.
[0158] In one embodiment, determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result, and at least one item includes:
[0159] If the operation instruction is a write instruction, the matching result is a successful match, and the predetermined first value is successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has not read the target chapter, the predetermined first value is used to indicate that the user has read the target chapter, the serial number of the binary bit in the bitmap corresponding to any key is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number, the value of the binary bit in the bitmap corresponding to the chapter number is the predetermined first value, and the value of the binary bit in the bitmap corresponding to the chapter number is the value of the target key-value pair;
[0160] If the operation instruction is a write instruction, the matching result is a successful match, and the predetermined first value is not successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has read the target chapter.
[0161] Specifically, a predetermined first value, such as 1, is used to indicate that the user has read the target chapter; a predetermined second value, such as 0, is used to indicate that the user has not read the target chapter.
[0162] If the operation instruction is a write instruction, the matching result is a successful match, and 1 is successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has not read the target chapter; that is, before writing, the value of the binary bit of the bitmap corresponding to any key is 0, and 0 is used to represent that the user has not read the target chapter; when writing, 0 is replaced by 1, that is, the user is reading the target chapter for the first time, and 1 is successfully written into the binary bit of the bitmap corresponding to any key.
[0163] If the operation instruction is a write instruction, the matching result is a successful match, and 1 is not successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has read the target chapter; that is, before writing, the value of the binary bit of the bitmap corresponding to any key is 1, and 1 is used to represent that the user has read the target chapter; when writing, 1 is not successfully written, that is, the user has read the target chapter for the second time or more.
[0164] In one embodiment, after determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and at least one item, the method further includes:
[0165] Obtain the expiration time point of the business scenario and the idle time period of the storage space in the target storage unit;
[0166] Based on the expiration time point of the business scenario and the preset random number, random mapping processing is performed to determine the expiration time point after processing, and the expiration time point after processing is in the idle time period;
[0167] Based on the processed expiration time point and the current time point of the user reading, determine the validity period of the key.
[0168] Specifically, if a large amount of data in a scene expires, it may cause request blocking, so the service needs to calculate a reasonable expiration time to allow the memory to expire during idle time. Figure 3 As shown, in the limited-time reading task scenario, the reading time is set to 24 hours (0:00-24:00) on a certain day. After these 24 hours, data cleaning is performed, so that the data automatically expires with the business. For one-time calls of activity types, the expiration time of the activity (business scenario) is indicated during registration, and expired data can be recycled, further reducing storage costs.
[0169] For example, Figure 7 As shown, the data cleaning process includes the following steps:
[0170] S701, obtaining the expiration time point of the business scenario.
[0171] Specifically, for example, the expiration time of a business scenario is 24:00 on August 17, that is, all key-value pairs under the business scenario expire at 24:00 on August 17, and the expiration time of the business scenario is the exact expiration time.
[0172] S702, determining the accurate validity time based on the expiration time point of the business scenario and the current time point of the user reading.
[0173] Specifically, for example, the accurate effective time = the expiration time point of the business scenario - the current time point of the user's reading.
[0174] S703: Obtain an idle time period of the storage space in the target storage unit.
[0175] Specifically, for example, the idle time period of the storage space in the target storage unit is 2:00-5:00 on August 18th.
[0176] S704, performing random mapping processing based on the expiration time point of the business scenario and a preset random number, and determining the expiration time point after processing, where the expiration time point after processing is in the idle time period.
[0177] For example, the idle time period of the storage space in the target storage unit is 2:00-5:00 on August 18. Based on the expiration time point of the business scenario and the preset random number, random mapping processing is performed to determine the expiration time point after processing. In this way, the expiration time points of all key-value pairs after processing can be as uniform as possible in the idle time period, so that all key-value pairs gradually expire in the idle time period of 2:00-5:00. Different keys correspond to different random numbers.
[0178] S705, determining a valid time period of the key based on the processed expiration time point and the current time point of the user's reading.
[0179] Specifically, for example, the effective time period of a key = the expiration time point after processing - the current time point when the user reads. For another example, the effective time period of a key-value pair = the expiration time point after processing - the current time point when the user reads.
[0180] The application of the embodiments of the present application has at least the following beneficial effects:
[0181] The server accurately determines whether the user has read the target chapter based on the operation instruction, the matching result and the binary bit of the bitmap corresponding to the chapter number (at least one of the sequence number of the binary bit in the bitmap corresponding to the chapter number and the value of the binary bit in the bitmap corresponding to the chapter number). The target chapter, for example, a chapter of a comic, reduces the storage cost by hundreds to thousands of times compared with traditional storage solutions due to the use of a bitmap. Expired storage can also be recycled without wasting resources, thereby saving storage space. That is, while saving storage space, it is possible to accurately determine whether the user has read a chapter of the comic.
[0182] In order to better understand the method provided in the embodiment of the present application, the scheme of the embodiment of the present application is further explained below with reference to examples of specific application scenarios.
[0183] In a specific application scenario embodiment, such as a comic reading scenario, see Figure 8 , shows a process of a data processing method, such as Figure 8 As shown, the process of the data processing method provided in the embodiment of the present application includes the following steps:
[0184] S801, the user triggers a query instruction through the client.
[0185] Specifically, the query instruction can be a single query instruction or a batch query instruction. For example, if a user queries whether a certain chapter in a comic has been read, a single query instruction is triggered. For another example, if a user enters a comic catalog and queries whether multiple chapters in the comic have been read, a batch query instruction is triggered. Both single query and batch query provide good response speed. Batch query of multiple chapter status (whether multiple chapters have been read) only requires one query, thanks to the high efficiency of the operating system in performing bitwise AND operations.
[0186] S802: The client sends control information to the server.
[0187] Specifically, the manipulation information includes a query instruction, a scenario identifier of a business scenario, a user identifier of a user, a comic identifier of a comic, and a chapter identifier of a comic.
[0188] S803, the server receives the manipulation information, and determines a target storage unit from a plurality of preset storage units through a hash operation based on the scene identifier in the manipulation information.
[0189] Specifically, the target storage unit is, for example, Figure 5 Shards in the sharded storage architecture shown.
[0190] S804: The server determines the chapter number of the target chapter in the comic corresponding to the chapter identifier through the third-party server based on the comic identifier and the chapter identifier.
[0191] Specifically, the server sends the comic ID and chapter ID to the third-party server; the third-party server determines the text information corresponding to the comic based on the comic ID and chapter ID; the server receives the text information sent by the third-party server, and extracts the chapter number of the target chapter in the comic corresponding to the chapter ID from the text information.
[0192] S805: The server determines the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, user identifier and comic identifier in the manipulation information.
[0193] Specifically, the key of the target key-value pair is {scene_id}_{uin}_{comic_id}; wherein scene_id represents the scene identifier, uin represents the user identifier, and comic_id represents the comic identifier.
[0194] S806: The server determines the serial number of the binary bit in the bitmap corresponding to the chapter serial number.
[0195] Specifically, for example, the query instruction is used to instruct to query the reading status of five chapters of a comic whose chapter numbers are 1, 2, 3, 4, and 5 respectively, then the binary bit numbers in the bitmap corresponding to the chapter numbers are determined to be 1, 2, 3, 4, and 5 respectively.
[0196] S807, the server performs matching processing based on the key of the target key-value pair and each key in the target storage unit to determine a matching result.
[0197] Specifically, if the server determines that the key of the target key-value pair is the same as a key in the target storage unit, the matching result is determined to be a successful match; if the server determines that the key of the target key-value pair is different from each key in the target storage unit, the matching result is determined to be an unsuccessful match.
[0198] S808, if the matching result is successful, the server queries the value of the target binary bit from the bitmap corresponding to a key in the target storage unit based on the sequence number of the binary bit in the bitmap corresponding to the chapter sequence number.
[0199] Specifically, the key of the target key-value pair is the same as a key in the target storage unit, the target binary bit is the binary bit in the bitmap corresponding to a key, the value of the target binary bit is the value of the target key-value pair, and the sequence number of the target binary bit is the same as the sequence number of the binary bit in the bitmap corresponding to the chapter number.
[0200] S809: The server determines whether the user has read the target chapter based on the value of the target binary bit.
[0201] Specifically, for example, if the value of the target binary bit is 1, it means that the user has read the chapter corresponding to the chapter number; if the value of the target binary bit is 0, it means that the user has not read the chapter corresponding to the chapter number.
[0202] S810, the server sends the query result to the client.
[0203] Specifically, for example, if the value of the target binary bit is 1, it means that the user has read the chapter corresponding to the chapter number, and the server returns 1 to the client; if the value of the target binary bit is 0, it means that the user has not read the chapter corresponding to the chapter number, and the server returns 0 to the client.
[0204] The application of the embodiments of the present application has at least the following beneficial effects:
[0205] The server accurately determines whether the user has read a certain chapter or certain chapters of the comic based on the query instruction, the matching result and the binary bit of the bitmap corresponding to the chapter number (at least one of the sequence number of the binary bit in the bitmap corresponding to the chapter number and the value of the binary bit in the bitmap corresponding to the chapter number). Due to the use of the bitmap method, the storage cost is reduced by hundreds to thousands of times compared with the traditional storage solution. Expired storage can also be recycled without causing waste of resources, thereby saving storage space. That is, under the premise of saving storage space, it is possible to accurately determine whether the user has read a certain chapter of the comic. The data processing method provided in the embodiment of the present application can be abstracted into a common component, which can be used on demand in various business scenarios. The common component provides a query and modification interface to the outside world, shields storage details, and each business scenario no longer needs to write logic separately, thereby reducing the threshold and cost of use.
[0206] In a specific application scenario embodiment, such as a comic reading scenario, see Fig. 9 , shows a process of a data processing method, such as Fig. 9 As shown, the process of the data processing method provided in the embodiment of the present application includes the following steps:
[0207] S901, the user triggers a write instruction through the client.
[0208] Specifically, the user reads a chapter of the comic through the client, triggering a write instruction.
[0209] S902: The client sends control information to the server.
[0210] Specifically, the manipulation information includes a write instruction, a scenario identifier of a business scenario, a user identifier of a user, a comic identifier of a comic, and a chapter identifier of a comic.
[0211] S903, the server receives the manipulation information, and determines a target storage unit from a plurality of preset storage units through a hash operation based on the scene identifier in the manipulation information.
[0212] Specifically, the target storage unit is, for example, Figure 5 Shards in the sharded storage architecture shown.
[0213] S904: The server determines the chapter number of the target chapter in the comic corresponding to the chapter identifier through the third-party server based on the comic identifier and the chapter identifier.
[0214] Specifically, the server sends the comic ID and chapter ID to the third-party server; the third-party server determines the text information corresponding to the comic based on the comic ID and chapter ID; the server receives the text information sent by the third-party server, and extracts the chapter number of the target chapter in the comic corresponding to the chapter ID from the text information.
[0215] S905: The server determines the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the comic identifier in the manipulation information.
[0216] Specifically, the key of the target key-value pair is {scene_id}_{uin}_{comic_id}; wherein scene_id represents the scene identifier, uin represents the user identifier, and comic_id represents the comic identifier.
[0217] S906, the server determines the value of the binary bit in the bitmap corresponding to the chapter number and the serial number of the binary bit in the bitmap corresponding to the chapter number.
[0218] Specifically, for example, if the write instruction is used to instruct to write the reading status of the chapter numbered 3 that has been read into the target storage unit, then the value of a binary bit in the bitmap corresponding to the chapter number 3 and the serial number of a binary bit in the bitmap corresponding to the chapter number 3 are determined, the value of the binary bit in the bitmap is 1, and the serial number of the binary bit in the bitmap is 3; wherein the value of the binary bit in the bitmap is 1 indicating that the user has read the chapter numbered 3 in the comic.
[0219] S907, the server performs matching processing based on the key of the target key-value pair and each key in the target storage unit to determine a matching result.
[0220] Specifically, if the server determines that the key of the target key-value pair is the same as a key in the target storage unit, the matching result is determined to be a successful match; if the server determines that the key of the target key-value pair is different from each key in the target storage unit, the matching result is determined to be an unsuccessful match.
[0221] S908, the server determines whether the user has read the target chapter based on the write instruction, the matching result, the value of the binary bit in the bitmap corresponding to the chapter number, and the serial number of the binary bit in the bitmap corresponding to the chapter number.
[0222] Specifically, the predetermined first value is, for example, 1, which is used to indicate that the user has read the target chapter. If the matching result is a successful match, and the predetermined first value is successfully written into the binary bit of the bitmap corresponding to a certain key, it is determined that the user has not read the target chapter. The predetermined first value is used to indicate that the user has read the target chapter. The serial number of the binary bit in the bitmap corresponding to a certain key is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number. The value of the binary bit in the bitmap corresponding to the chapter number is the predetermined first value, and the value of the binary bit in the bitmap corresponding to the chapter number is the value of the target key-value pair. If the matching result is a successful match, and the predetermined first value is not successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has read the target chapter.
[0223] S909, the server sends the writing result to the client.
[0224] Specifically, for example, if the server successfully writes 1 into the binary bit of the bitmap corresponding to a key, the server returns 0 to the client, indicating that the write result is successful; 0 means that the user has not read the target chapter before writing; that is, before writing, the value of the binary bit of the bitmap corresponding to a key is 0, and 0 is used to represent that the user has not read the target chapter; when writing, 0 is replaced by 1, that is, the user is reading the target chapter for the first time, and 1 is successfully written into the binary bit of the bitmap corresponding to a key.
[0225] For example, if the server fails to successfully write 1 to the binary bit of the bitmap corresponding to a key, the server returns 1 to the client, indicating that the write result is unsuccessful; 1 means that the user has read the target chapter before writing; that is, before writing, the value of the binary bit of the bitmap corresponding to a key is 1, and 1 is used to represent that the user has read the target chapter; when writing, 1 is not written successfully, that is, the user reads the target chapter for the second time or more.
[0226] S910: The client performs points processing based on the written result.
[0227] Specifically, for example, in a time-limited reading task scenario, such as Figure 3In the example shown in 301, the user reads comics to get a reward. The reading time is set to 24 hours (0:00-24:00) on a certain day. The user has 3 chapters left to read. Figure 3 The user shown in 302 repeatedly reads the same chapter of the comic; Figure 3 As shown in 303, the user's reading progress is increased by one, repeated readings are not accumulated, and the user has 2 chapters left to read; if the writing result is successful writing, it means that before writing, the user has not read a certain chapter of the comic, and this is the first time the user has read this chapter, that is, from Figure 3 The "3 chapters left" shown in 301 is converted to Figure 3 In the example, "2 chapters left" is shown in 303; "3 chapters left" means that the user has 3 chapters left to read, and "2 chapters left" means that the user has 2 chapters left to read. In this way, by determining whether the user has read a certain chapter of the comic, repeated accumulation on the client side can be avoided, that is, repeated reading is not accumulated, thereby achieving the effect of encouraging users to read new chapters in the comic.
[0228] For example, in the permanent reading points scenario, Figure 4 As shown in 401, the user can increase the iron fan points by reading comics or purchasing chapters. The spark value is the reading score, that is, the points. The user's current points are 285 points. Figure 4 The user shown in 402 unlocks and reads the comic; Figure 4 The first time a user reads a certain chapter, as shown in 403, the score increases by 4 points, from "285 points" to "289 points", that is, the current score is updated to 289 points, and the subsequent user repeatedly unlocks and reads the chapter, and the score will not be repeatedly accumulated; if the write result is successful writing, it means that before writing, the user has not read a certain chapter of the comic, and this is the first time the user has read the chapter, that is, the score increases by 4 points, from "285 points" to "289 points"; if the write result is unsuccessful writing, it means that before writing, the user has read a certain chapter of the comic, and this is the second or multiple times the user has read the chapter, and the score will not increase, that is, the score remains unchanged. In this way, by determining whether the user has read a certain chapter of the comic, repeated points on the client can be avoided, that is, if the user repeatedly reads the chapter, the points will not be repeatedly accumulated, thereby achieving the effect of encouraging users to read new chapters in the comic.
[0229] For another example, the server determines whether the user has read a chapter of a comic, and the server displays to the user through the client whether the chapter has been read or not, so that the user knows whether the chapter has been read, thereby achieving the effect of motivating the user to read new chapters in the comic.
[0230] The application of the embodiments of the present application has at least the following beneficial effects:
[0231] The server accurately determines whether the user has read a certain chapter or certain chapters of the comic based on the write instruction, the matching result and the binary bit of the bitmap corresponding to the chapter number (at least one of the sequence number of the binary bit in the bitmap corresponding to the chapter number and the value of the binary bit in the bitmap corresponding to the chapter number). Due to the use of the bitmap method, the storage cost is reduced by hundreds to thousands of times compared with the traditional storage solution. Expired storage can also be recycled without causing waste of resources, thereby saving storage space. That is, under the premise of saving storage space, it is possible to accurately determine whether the user has read a certain chapter of the comic. The data processing method provided in the embodiment of the present application can be abstracted into a common component, which can be used on demand in various business scenarios. The common component provides a query and modification interface to the outside world, shields storage details, and each business scenario no longer needs to write logic separately, thereby reducing the threshold and cost of use.
[0232] The present application also provides a data processing device. The structural diagram of the data processing device is as follows: Fig.10 As shown, the data processing device 80 includes a first processing module 801 , a second processing module 802 , a third processing module 803 , a fourth processing module 804 , a fifth processing module 805 and a sixth processing module 806 .
[0233] The first processing module 801 is used to receive the control information sent by the client, the control information includes the operation instruction, the scenario identifier of the business scenario, the user identifier of the user, the object identifier of the target reading object and the chapter identifier of the target reading object, the business scenario is determined by the operation purpose for the target reading object;
[0234] The second processing module 802 is used to determine the chapter number of the target chapter in the target reading object corresponding to the chapter identifier based on the object identifier and the chapter identifier;
[0235] The third processing module 803 is used to determine the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the object identifier;
[0236] The fourth processing module 804 is used to determine at least one of the serial number of the binary bit in the bitmap corresponding to the chapter serial number and the value of the binary bit in the bitmap corresponding to the chapter serial number;
[0237] A fifth processing module 805 is used to perform matching processing based on the key of the target key-value pair and each key in the determined target storage unit to determine a matching result, where the matching result is used to indicate whether the key of the target key-value pair is the same as any key in each key;
[0238] The sixth processing module 806 is used to determine whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and at least one item.
[0239] In one embodiment, the third processing module 803 is further configured to:
[0240] Constructing a plurality of key-value pairs in the target storage unit, each of the plurality of key-value pairs comprising a key and a value corresponding to the key, the value corresponding to the key being used to indicate whether a user has read a chapter in a reading object;
[0241] Construct a bitmap corresponding to a key, and a bitmap stores the value corresponding to a key.
[0242] In one embodiment, the first processing module 801 is further configured to:
[0243] Dividing the scene identifier by the total number of preset storage units to obtain a remainder, and determining the remainder as the sequence number of the target storage unit;
[0244] Based on the sequence number of the target storage unit, any storage unit is determined as the target storage unit from the plurality of storage units, and the sequence number of any storage unit is the same as the sequence number of the target storage unit.
[0245] In one embodiment, the second processing module 802 is specifically configured to:
[0246] Sending the object identifier and the chapter identifier to a third-party server, so that the third-party server can determine the text information corresponding to the target reading object based on the object identifier and the chapter identifier;
[0247] Receive the text information sent by the third-party server, and extract the chapter number of the target chapter in the target reading object corresponding to the chapter identifier from the text information.
[0248] In one embodiment, the second processing module 802 is specifically configured to:
[0249] Based on the object identifier and the chapter identifier, the chapter number of the target chapter in the target reading object corresponding to the chapter identifier is determined through a preset hash table in the local cache. Any key-value pair in the preset hash table is constructed by the key corresponding to the chapter identifier and the value corresponding to the chapter number.
[0250] In one embodiment, the fourth processing module 804 is specifically configured to:
[0251] If the operation instruction is a query instruction, determine the serial number of the binary bit in the bitmap corresponding to the chapter serial number;
[0252] If the operation instruction is a write instruction, the value of the binary bit in the bitmap corresponding to the chapter number and the serial number of the binary bit in the bitmap corresponding to the chapter number are determined. The value of the binary bit in the bitmap is used to indicate whether the user has read the target chapter, and the serial number of the binary bit in the bitmap is used to indicate the arrangement order of the binary bits in the bitmap.
[0253] In one embodiment, the sixth processing module 806 is specifically configured to:
[0254] If the operation instruction is a query instruction, and the matching result is a successful match, then based on the serial number of the binary bit in the bitmap corresponding to the chapter number, the value of the target binary bit is queried from the bitmap corresponding to any key, the serial number of the target binary bit is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number, the target binary bit is the binary bit in the bitmap corresponding to any key, and the value of the target binary bit is the value of the target key-value pair;
[0255] Based on the value of the target bit, determine whether the user has read the target chapter.
[0256] In one embodiment, the sixth processing module 806 is specifically configured to:
[0257] If the value of the target binary bit is a predetermined first value, it is determined that the user has read the target chapter, and the predetermined first value is used to indicate that the user has read the target chapter;
[0258] If the value of the target binary bit is a predetermined second value, it is determined that the user has not read the target chapter. The predetermined second value is used to indicate that the user has not read the target chapter.
[0259] In one embodiment, the sixth processing module 806 is specifically configured to:
[0260] If the operation instruction is a write instruction, the matching result is a successful match, and the predetermined first value is successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has not read the target chapter, the predetermined first value is used to indicate that the user has read the target chapter, the serial number of the binary bit in the bitmap corresponding to any key is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number, the value of the binary bit in the bitmap corresponding to the chapter number is the predetermined first value, and the value of the binary bit in the bitmap corresponding to the chapter number is the value of the target key-value pair;
[0261] If the operation instruction is a write instruction, the matching result is a successful match, and the predetermined first value is not successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has read the target chapter.
[0262] In one embodiment, the sixth processing module 806 is further configured to:
[0263] Obtain the expiration time point of the business scenario and the idle time period of the storage space in the target storage unit;
[0264] Based on the expiration time point of the business scenario and the preset random number, random mapping processing is performed to determine the expiration time point after processing, and the expiration time point after processing is in the idle time period;
[0265] Based on the processed expiration time point and the current time point of the user reading, determine the validity period of the key.
[0266] The application of the embodiments of the present application has at least the following beneficial effects:
[0267] Receive control information sent by the client, the control information includes operation instructions, scenario identifier of the business scenario, user identifier of the user, object identifier of the target reading object and chapter identifier of the target reading object, the business scenario is determined by the operation purpose for the target reading object; based on the object identifier and the chapter identifier, determine the chapter number of the target chapter in the target reading object corresponding to the chapter identifier; based on the scenario identifier, user identifier and object identifier, determine the key of the target key-value pair corresponding to the business scenario; determine at least one of the binary bit number in the bitmap corresponding to the chapter number and the value of the binary bit in the bitmap corresponding to the chapter number; perform matching processing based on the key of the target key-value pair and each key in the determined target storage unit to determine Matching result, the matching result is used to characterize whether the key of the target key-value pair is the same as any key in each key; in this way, based on the operation instruction for the target chapter, the matching result and at least one item, it is accurately determined whether the user has read the target chapter. The target chapter, for example, a chapter of a comic, is converted into a chapter number through a chapter identifier, and the chapter number is stored through a bitmap by utilizing the orderly characteristics. Since the bitmap uses binary bits to store the value corresponding to the chapter number, that is, the value of the binary bit in the bitmap, the value of the binary bit in the bitmap can be used to characterize whether the user has read a chapter of the comic, thereby saving storage space. That is, on the premise of saving storage space, it is achieved to accurately determine whether the user has read a chapter of the comic.
[0268] The present application also provides an electronic device. The structural diagram of the electronic device is as follows: Fig.11 As shown, Fig.11 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0269] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0270] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0271] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0272] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.
[0273] Among them, electronic equipment includes but is not limited to: servers, etc.
[0274] The application of the embodiments of the present application has at least the following beneficial effects:
[0275] Receive control information sent by the client, the control information includes operation instructions, scenario identifier of the business scenario, user identifier of the user, object identifier of the target reading object and chapter identifier of the target reading object, the business scenario is determined by the operation purpose for the target reading object; based on the object identifier and the chapter identifier, determine the chapter number of the target chapter in the target reading object corresponding to the chapter identifier; based on the scenario identifier, user identifier and object identifier, determine the key of the target key-value pair corresponding to the business scenario; determine at least one of the binary bit number in the bitmap corresponding to the chapter number and the value of the binary bit in the bitmap corresponding to the chapter number; perform matching processing based on the key of the target key-value pair and each key in the determined target storage unit to determine Matching result, the matching result is used to characterize whether the key of the target key-value pair is the same as any key in each key; in this way, based on the operation instruction for the target chapter, the matching result and at least one item, it is accurately determined whether the user has read the target chapter. The target chapter, for example, a chapter of a comic, is converted into a chapter number through a chapter identifier, and the chapter number is stored through a bitmap by utilizing the orderly characteristics. Since the bitmap uses binary bits to store the value corresponding to the chapter number, that is, the value of the binary bit in the bitmap, the value of the binary bit in the bitmap can be used to characterize whether the user has read a chapter of the comic, thereby saving storage space. That is, on the premise of saving storage space, it is achieved to accurately determine whether the user has read a chapter of the comic.
[0276] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0277] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.
[0278] Based on the same principle as the method provided in the embodiment of the present application, the embodiment of the present application further provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in any optional embodiment of the present application.
[0279] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0280] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A data processing method, characterized in that: include: Receiving control information sent by a client, the control information including an operation instruction, a scenario identifier of a business scenario, a user identifier of a user, an object identifier of a target reading object, and a chapter identifier of the target reading object, wherein the business scenario is determined by an operation purpose for the target reading object; Based on the object identifier and the chapter identifier, determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier; Determine a key of a target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier, and the object identifier; Determine at least one of the sequence number of the binary bit in the bitmap corresponding to the chapter sequence number and the value of the binary bit in the bitmap corresponding to the chapter sequence number; Based on the key of the target key-value pair and each key in the determined target storage unit, a matching process is performed to determine a matching result, wherein the matching result is used to indicate whether the key of the target key-value pair is the same as any key in the keys; Based on the operation instruction for the target chapter, the matching result and the at least one item, it is determined whether the user has read the target chapter.
2. The method according to claim 1, characterized in that: Before determining the key of the target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the object identifier, the method further includes: Constructing a plurality of key-value pairs in the target storage unit, each of the plurality of key-value pairs comprising a key and a value corresponding to the key, the value corresponding to the key being used to indicate whether the user has read a chapter in the reading object; A bitmap corresponding to the key is constructed, and the bitmap stores the value corresponding to the key.
3. The method according to claim 1, characterized in that After receiving the control information sent by the client, the method further includes: Dividing the scene identifier by the total number of preset storage units to obtain a remainder, and determining the remainder as the sequence number of the target storage unit; Based on the sequence number of the target storage unit, any storage unit is determined from the multiple storage units as the target storage unit, and the sequence number of the any storage unit is the same as the sequence number of the target storage unit.
4. The method according to claim 1, characterized in that: The step of determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier based on the object identifier and the chapter identifier includes: Sending the object identifier and the chapter identifier to a third-party server, so that the third-party server determines the text information corresponding to the target reading object based on the object identifier and the chapter identifier; The text information sent by the third-party server is received, and the chapter number of the target chapter in the target reading object corresponding to the chapter identifier is extracted from the text information.
5. The method according to claim 1, characterized in that The step of determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier based on the object identifier and the chapter identifier includes: Based on the object identifier and the chapter identifier, the chapter number of the target chapter in the target reading object corresponding to the chapter identifier is determined through a preset hash table in the local cache, and any key-value pair in the preset hash table is constructed by the key corresponding to the chapter identifier and the value corresponding to the chapter number.
6. The method according to claim 1, characterized in that The determining at least one of the sequence number of the binary bit in the bitmap corresponding to the chapter sequence number and the value of the binary bit in the bitmap corresponding to the chapter sequence number comprises: If the operation instruction is a query instruction, determining the serial number of the binary bit in the bitmap corresponding to the chapter serial number; If the operation instruction is a write instruction, the value of the binary bit in the bitmap corresponding to the chapter number and the serial number of the binary bit in the bitmap corresponding to the chapter number are determined. The value of the binary bit in the bitmap is used to indicate whether the user has read the target chapter, and the serial number of the binary bit in the bitmap is used to indicate the arrangement order of the binary bit in the bitmap.
7. The method according to claim 1, characterized in that The determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and the at least one item includes: If the operation instruction is a query instruction, and the matching result is a successful match, then based on the serial number of the binary bit in the bitmap corresponding to the chapter number, the value of the target binary bit is queried from the bitmap corresponding to any key, the serial number of the target binary bit is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number, the target binary bit is the binary bit in the bitmap corresponding to any key, and the value of the target binary bit is the value of the target key-value pair; Based on the value of the target binary bit, it is determined whether the user has read the target chapter.
8. The method according to claim 7, characterized in that The determining, based on the value of the target binary bit, whether the user has read the target chapter comprises: If the value of the target binary bit is a predetermined first value, it is determined that the user has read the target chapter, and the predetermined first value is used to indicate that the user has read the target chapter; If the value of the target binary bit is a predetermined second value, it is determined that the user has not read the target chapter, and the predetermined second value is used to indicate that the user has not read the target chapter.
9. The method according to claim 1, characterized in that: The determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and the at least one item includes: If the operation instruction is a write instruction, the matching result is a successful match, and the predetermined first value is successfully written into the binary bit of the bitmap corresponding to any one of the keys, it is determined that the user has not read the target chapter, the predetermined first value is used to indicate that the user has read the target chapter, the serial number of the binary bit in the bitmap corresponding to any one of the keys is the same as the serial number of the binary bit in the bitmap corresponding to the chapter number, the value of the binary bit in the bitmap corresponding to the chapter number is the predetermined first value, and the value of the binary bit in the bitmap corresponding to the chapter number is the value of the target key-value pair; If the operation instruction is a write instruction, the matching result is a successful match, and the predetermined first value is not successfully written into the binary bit of the bitmap corresponding to any key, it is determined that the user has read the target chapter.
10. The method according to claim 1, characterized in that After determining whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and the at least one item, the method further includes: Acquire the expiration time point of the business scenario and the idle time period of the storage space in the target storage unit; Based on the expiration time point of the business scenario and a preset random number, a random mapping process is performed to determine an expiration time point after the process, wherein the expiration time point after the process is within the idle time period; Based on the processed expiration time point and the current time point of the user reading, the valid time period of the key is determined.
11. A data processing device, characterized in that: include: A first processing module is used to receive control information sent by a client, wherein the control information includes an operation instruction, a scenario identifier of a business scenario, a user identifier of a user, an object identifier of a target reading object, and a chapter identifier of the target reading object, wherein the business scenario is determined by an operation purpose for the target reading object; A second processing module, for determining the chapter number of the target chapter in the target reading object corresponding to the chapter identifier based on the object identifier and the chapter identifier; A third processing module, configured to determine a key of a target key-value pair corresponding to the business scenario based on the scenario identifier, the user identifier and the object identifier; A fourth processing module, configured to determine at least one of a sequence number of a binary bit in the bitmap corresponding to the chapter sequence number and a value of a binary bit in the bitmap corresponding to the chapter sequence number; a fifth processing module, configured to perform matching processing based on the key of the target key-value pair and each key in the determined target storage unit, and determine a matching result, wherein the matching result is used to indicate whether the key of the target key-value pair is the same as any key in the keys; A sixth processing module is used to determine whether the user has read the target chapter based on the operation instruction for the target chapter, the matching result and the at least one item.
12. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.